Skip to content

Commit e5d9e59

Browse files
CzarekCzarek
authored andcommitted
Directory structure under "cef1/linux/" changed to support both
32bit and 64bit architectures. Compile scripts updated to reflect that. Updated makefiles on Linux to make it work on 64bit platform. Fixes to cython and setup files for the 64bit platform on Linux. Created 64bit binaries for Ubuntu 12.04 LTS.
1 parent 25d7ddb commit e5d9e59

File tree

18 files changed

+1276
-31
lines changed

18 files changed

+1276
-31
lines changed

cefpython/browser.pyx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ cpdef PyBrowser GetBrowserByWindowHandle(WindowHandle windowHandle):
8181
for browserId in g_pyBrowsers:
8282
pyBrowser = g_pyBrowsers[browserId]
8383
if (pyBrowser.GetWindowHandle() == windowHandle or
84-
pyBrowser.GetUserData("__outerWindowHandle") == int(windowHandle)):
84+
pyBrowser.GetUserData("__outerWindowHandle") == long(windowHandle)):
8585
return pyBrowser
8686
return None
8787

@@ -296,14 +296,14 @@ cdef class PyBrowser:
296296
cpdef WindowHandle GetOpenerWindowHandle(self) except *:
297297
cdef WindowHandle hwnd
298298
IF CEF_VERSION == 1:
299-
hwnd = <int>self.GetCefBrowser().get().GetOpenerWindowHandle()
299+
hwnd = <WindowHandle>self.GetCefBrowser().get().GetOpenerWindowHandle()
300300
ELIF CEF_VERSION == 3:
301-
hwnd = <int>self.GetCefBrowserHost().get().GetOpenerWindowHandle()
301+
hwnd = <WindowHandle>self.GetCefBrowserHost().get().GetOpenerWindowHandle()
302302
return hwnd
303303

304304
cpdef WindowHandle GetOuterWindowHandle(self) except *:
305305
if self.GetUserData("__outerWindowHandle"):
306-
return <int>self.GetUserData("__outerWindowHandle")
306+
return <WindowHandle>self.GetUserData("__outerWindowHandle")
307307
else:
308308
return self.GetWindowHandle()
309309

@@ -315,9 +315,9 @@ cdef class PyBrowser:
315315
cpdef WindowHandle GetWindowHandle(self) except *:
316316
cdef WindowHandle hwnd
317317
IF CEF_VERSION == 1:
318-
hwnd = <int>self.GetCefBrowser().get().GetWindowHandle()
318+
hwnd = <WindowHandle>self.GetCefBrowser().get().GetWindowHandle()
319319
ELIF CEF_VERSION == 3:
320-
hwnd = <int>self.GetCefBrowserHost().get().GetWindowHandle()
320+
hwnd = <WindowHandle>self.GetCefBrowserHost().get().GetWindowHandle()
321321
return hwnd
322322

323323
cpdef double GetZoomLevel(self) except *:
@@ -404,7 +404,7 @@ cdef class PyBrowser:
404404
cpdef py_void ToggleFullscreen_Windows(self):
405405
cdef WindowHandle windowHandle
406406
if self.GetUserData("__outerWindowHandle"):
407-
windowHandle = <int>self.GetUserData("__outerWindowHandle")
407+
windowHandle = <WindowHandle>self.GetUserData("__outerWindowHandle")
408408
else:
409409
windowHandle = self.GetWindowHandle()
410410

cefpython/cef1/client_handler/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ SRC = client_handler.cpp
55
OBJ = $(SRC:.cpp=.o)
66
OUT = libclient_handler.a
77

8-
INC = -I./../ -I/usr/include/python2.7 -I/usr/include/gtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/gtk-2.0/include -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/atk-1.0
8+
INC = -I./../ -I/usr/include/python2.7 -I/usr/include/gtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/gtk-2.0/include -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/atk-1.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include
99

1010
.cpp.o:
11-
$(CC) $(INC) $(CCFLAGS) -c $< -o $@
11+
$(CC) -fPIC $(INC) $(CCFLAGS) -c $< -o $@
1212

1313
$(OUT): $(OBJ)
1414
ar rcs $(OUT) $(OBJ)
File renamed without changes.
File renamed without changes.
File renamed without changes.

cefpython/cef1/linux/binaries/pygtk_.py renamed to cefpython/cef1/linux/binaries_32bit/pygtk_.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# An example of embedding CEF browser in PyGTK on Linux.
22

3-
import platform
4-
if platform.architecture()[0] != "32bit":
5-
raise Exception("Only 32bit architecture is supported")
6-
73
import ctypes, os, sys
84
libcef_so = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'libcef.so')
95
if os.path.exists(libcef_so):
@@ -24,7 +20,7 @@
2420
import re
2521

2622
def GetApplicationPath(file=None):
27-
import re, os
23+
import re, os, platform
2824
# If file is None return current directory without trailing slash.
2925
if file is None:
3026
file = ""

cefpython/cef1/linux/binaries/wxpython.py renamed to cefpython/cef1/linux/binaries_32bit/wxpython.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# An example of embedding CEF browser in wxPython on Linux.
22

3-
import platform
4-
if platform.architecture()[0] != "32bit":
5-
raise Exception("Only 32bit architecture is supported")
6-
73
import ctypes, os, sys
84
libcef_so = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'libcef.so')
95
if os.path.exists(libcef_so):
@@ -31,7 +27,7 @@
3127
USE_EVT_IDLE = False
3228

3329
def GetApplicationPath(file=None):
34-
import re, os
30+
import re, os, platform
3531
# If file is None return current directory without trailing slash.
3632
if file is None:
3733
file = ""
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.

0 commit comments

Comments
 (0)