Skip to content

Commit 8933c31

Browse files
CzarekCzarek
authored andcommitted
CEF 3 Linux port is complete. Development of the linux port is
sponsored by Cyan Inc. Added CEF 3 patch for the GTK implementation Added CEF 3 patch to fix the Zygote subprocess.
1 parent 4a86a45 commit 8933c31

7 files changed

Lines changed: 429 additions & 59 deletions

File tree

cefpython/cef3/linux/CEF-GTK-patch.txt

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,50 +5,52 @@ Do the following changes in the CEF C++ sources:
55

66
1. In `chromium/src/cef/libcef/browser/browser_host_impl_gtk.cc`:
77

8-
At the end of the CefBrowserImpl::UIT_CreateBrowser() function,
8+
At the end of the CefBrowserHostImpl::PlatformCreateWindow() function,
99
before the return statement add the following code:
1010

11-
gtk_widget_show_all(GTK_WIDGET(window_info_.widget));
11+
gtk_widget_show_all(GTK_WIDGET(window_info_.widget));
1212

13-
2. In `chromium/src/cef/libcef/webwidget_host_gtk.cc`:
13+
In the same function replace this code:
1414

15-
In WebWidgetHostGtkWidget::CreateNewWidget() function replace this line:
16-
17-
gtk_box_pack_start(GTK_BOX(parent_view), widget, TRUE, TRUE, 0);
15+
gtk_container_add(GTK_CONTAINER(window_info_.parent_widget),
16+
window_info_.widget);
1817

1918
With the following code:
2019

21-
if (GTK_IS_BOX(parent_view)) {
22-
gtk_box_pack_start(GTK_BOX(parent_view), widget, TRUE, TRUE, 0);
23-
} else {
24-
// Parent view shouldn't contain any children, but in wxWidgets library
25-
// there will be GtkPizza widget for Panel or any other control.
26-
GList *children, *iter;
27-
children = gtk_container_get_children(GTK_CONTAINER(parent_view));
28-
GtkWidget* child = NULL;
29-
GtkWidget* vbox = gtk_vbox_new(FALSE, 0);
30-
for (iter = children; iter != NULL; iter = g_list_next(iter)) {
31-
child = GTK_WIDGET(iter->data);
32-
// We will have to keep a reference to that child that we remove,
33-
// otherwise we will get lots of warnings like "invalid unclassed
34-
// pointer in cast to `GtkPizza'". First we increase a reference,
35-
// we need to do this for a moment before we add this child to the
36-
// vbox, then we will decrease that reference.
37-
g_object_ref(G_OBJECT(child));
38-
gtk_container_remove(GTK_CONTAINER(parent_view), child);
39-
}
40-
g_list_free(children);
41-
gtk_box_pack_start(GTK_BOX(vbox), widget, TRUE, TRUE, 0);
42-
if (child != NULL) {
43-
// This child is packed to the box only so that its reference lives,
44-
// as it might be referenced from other code thus resulting in errors.
45-
gtk_box_pack_end(GTK_BOX(vbox), child, FALSE, FALSE, 0);
46-
gtk_widget_hide(GTK_WIDGET(child));
47-
g_object_unref(G_OBJECT(child));
48-
}
49-
gtk_widget_show(GTK_WIDGET(vbox));
50-
if (GTK_IS_SCROLLED_WINDOW(parent_view))
51-
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(parent_view), vbox);
52-
else
53-
gtk_container_add(GTK_CONTAINER(parent_view), vbox);
20+
if (GTK_IS_BOX(window_info_.parent_widget)) {
21+
gtk_box_pack_start(GTK_BOX(window_info_.parent_widget),
22+
window_info_.widget, TRUE, TRUE, 0);
23+
} else {
24+
// Parent view shouldn't contain any children, but in wxWidgets library
25+
// there will be GtkPizza widget for Panel or any other control.
26+
GList *children, *iter;
27+
children = gtk_container_get_children(GTK_CONTAINER(
28+
window_info_.parent_widget));
29+
GtkWidget* child = NULL;
30+
GtkWidget* vbox = gtk_vbox_new(FALSE, 0);
31+
for (iter = children; iter != NULL; iter = g_list_next(iter)) {
32+
child = GTK_WIDGET(iter->data);
33+
// We will have to keep a reference to that child that we remove,
34+
// otherwise we will get lots of warnings like "invalid unclassed
35+
// pointer in cast to `GtkPizza'". First we increase a reference,
36+
// we need to do this for a moment before we add this child to the
37+
// vbox, then we will decrease that reference.
38+
g_object_ref(G_OBJECT(child));
39+
gtk_container_remove(GTK_CONTAINER(window_info_.parent_widget), child);
40+
}
41+
g_list_free(children);
42+
gtk_box_pack_start(GTK_BOX(vbox), window_info_.widget, TRUE, TRUE, 0);
43+
if (child != NULL) {
44+
// This child is packed to the box only so that its reference lives,
45+
// as it might be referenced from other code thus resulting in errors.
46+
gtk_box_pack_end(GTK_BOX(vbox), child, FALSE, FALSE, 0);
47+
gtk_widget_hide(GTK_WIDGET(child));
48+
g_object_unref(G_OBJECT(child));
5449
}
50+
gtk_widget_show(GTK_WIDGET(vbox));
51+
if (GTK_IS_SCROLLED_WINDOW(window_info_.parent_widget))
52+
gtk_scrolled_window_add_with_viewport(
53+
GTK_SCROLLED_WINDOW(window_info_.parent_widget), vbox);
54+
else
55+
gtk_container_add(GTK_CONTAINER(window_info_.parent_widget), vbox);
56+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Edit file "chromium/src/cef/libcef/browser/content_browser_client.cc":
2+
3+
1. Change this line:
4+
command_line->HasSwitch(switches::kBrowserSubprocessPath)) {
5+
To:
6+
browser_cmd.HasSwitch(switches::kBrowserSubprocessPath)) {
7+
8+
2. Change this line:
9+
command_line->GetSwitchValuePath(switches::kBrowserSubprocessPath);
10+
To:
11+
browser_cmd.GetSwitchValuePath(switches::kBrowserSubprocessPath);
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Copyright (c) 2012-2013 Czarek Tomczak. Portions Copyright
2+
(c) 2008-2013 Marshall A.Greenblatt, 2006-2009 Google Inc.
3+
All rights reserved.
4+
5+
Redistribution and use in source and binary forms, with
6+
or without modification, are permitted provided that the
7+
following conditions are met:
8+
9+
* Redistributions of source code must retain the above
10+
copyright notice, this list of conditions and the
11+
following disclaimer.
12+
13+
* Redistributions in binary form must reproduce the above
14+
copyright notice, this list of conditions and the
15+
following disclaimer in the documentation and/or other
16+
materials provided with the distribution.
17+
18+
* Neither the name of Google Inc. nor the name Chromium
19+
Embedded Framework nor the name of CEF Python nor the
20+
names of its contributors may be used to endorse or
21+
promote products derived from this software without
22+
specific prior written permission.
23+
24+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
25+
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
26+
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
27+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
29+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
31+
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
32+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
35+
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Chromium Embedded Framework (CEF) Standard Binary Distribution for Linux
2+
-------------------------------------------------------------------------------
3+
4+
Date: June 21, 2013
5+
6+
CEF Version: 3.1453.1279
7+
CEF URL: http://chromiumembedded.googlecode.com/svn/branches/1453/cef3@1279
8+
9+
Chromium Verison: 27.0.1453.110
10+
Chromium URL: http://src.chromium.org/svn/branches/1453/src@202711
11+
12+
This distribution contains all components necessary to build and distribute an
13+
application using CEF on the Linux platform. Please see the LICENSING
14+
section of this document for licensing terms and conditions.
15+
16+
17+
CONTENTS
18+
--------
19+
20+
cefclient Contains the cefclient sample application configured to build
21+
using the files in this distribution.
22+
23+
Debug Contains libcef.so and other components required to run the debug
24+
version of CEF-based applications. By default these files should be
25+
placed in the same directory as the executable and will be copied
26+
there as part of the build process.
27+
28+
include Contains all required CEF header files.
29+
30+
libcef_dll Contains the source code for the libcef_dll_wrapper static library
31+
that all applications using the CEF C++ API must link against.
32+
33+
Release Contains libcef.so and other components required to run the release
34+
version of CEF-based applications. By default these files should be
35+
placed in the same directory as the executable and will be copied
36+
there as part of the build process.
37+
38+
Resources Contains resources required by libcef.so. By default these files
39+
should be placed in the same directory as libcef.so and will be
40+
copied there as part of the build process.
41+
42+
43+
USAGE
44+
-----
45+
46+
Run 'build.sh Debug' to build the cefclient target in Debug mode.
47+
48+
Please visit the CEF Website for additional usage information.
49+
50+
http://code.google.com/p/chromiumembedded
51+
52+
53+
REDISTRIBUTION
54+
--------------
55+
56+
This binary distribution contains the below components. Components listed under
57+
the "required" section must be redistributed with all applications using CEF.
58+
Components listed under the "optional" section may be excluded if the related
59+
features will not be used.
60+
61+
Required components:
62+
63+
* CEF core library
64+
libcef.so
65+
66+
Optional components:
67+
68+
* Localized resources
69+
locales/
70+
Note: Contains localized strings for WebKit UI controls. A .pak file is loaded
71+
from this folder based on the value of environment variables which are read
72+
with the following precedence order: LANGUAGE, LC_ALL, LC_MESSAGES and LANG.
73+
Only configured locales need to be distributed. If no locale is configured the
74+
default locale of "en-US" will be used. Locale file loading can be disabled
75+
completely using CefSettings.pack_loading_disabled. The locales folder path
76+
can be customized using CefSettings.locales_dir_path.
77+
78+
* Other resources
79+
cef.pak
80+
devtools_resources.pak
81+
Note: Contains WebKit image and inspector resources. Pack file loading can be
82+
disabled completely using CefSettings.pack_loading_disabled. The resources
83+
directory path can be customized using CefSettings.resources_dir_path.
84+
85+
86+
LICENSING
87+
---------
88+
89+
The CEF project is BSD licensed. Please read the LICENSE.txt file included with
90+
this binary distribution for licensing terms and conditions. Other software
91+
included in this distribution is provided under other licenses. Please visit
92+
"about:credits" in a CEF-based application for complete Chromium and third-party
93+
licensing information.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset=utf-8>
5+
<title>CefSimple (utf-8: ąś)</title>
6+
<style>
7+
body { font: 13px Segoe UI, Arial; line-height: 1.4em; }
8+
pre { background: #ddd; font: 12px Consolas, Courier New; }
9+
</style>
10+
</head>
11+
<body>
12+
13+
Use mouse context menu to go Back/Forward in history navigation.
14+
15+
16+
17+
<h3>Google Search</h3>
18+
<a href="http://www.google.com/">http://www.google.com/</a>
19+
20+
21+
22+
<h3>User agent</h3>
23+
<script>document.write(navigator.userAgent)</script>
24+
25+
26+
27+
<h3>Popup</h3>
28+
<a href="javascript:window.open('wxpython.html')">
29+
window.open('wxpython.html')</a>
30+
31+
32+
33+
<h3>HTML5 video & accelerated content</h3>
34+
<a href="http://www.youtube.com/watch?v=siOHh0uzcuY&html5=True">
35+
HTML 5 video</a><br>
36+
<a href="http://mudcu.be/labs/JS1k/BreathingGalaxies.html">
37+
Accelerated canvas</a><br>
38+
<a href="http://www.webkit.org/blog-files/3d-transforms/poster-circle.html">
39+
Accelerated layers</a><br>
40+
41+
42+
<br><br><br><br><br><br><br><br>
43+
<br><br><br><br><br><br><br><br>
44+
<br><br><br><br><br><br><br><br>
45+
46+
</body>
47+
</html>

0 commit comments

Comments
 (0)