Skip to content

Commit a00c8a4

Browse files
committed
Get rid of the CEF_VERSION compile time constant. Issue cztomczak#106.
Update api/ docs.
1 parent 99d03d0 commit a00c8a4

File tree

16 files changed

+408
-882
lines changed

16 files changed

+408
-882
lines changed

api/API-index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@
128128
* [GetModuleDirectory](cefpython.md#getmoduledirectory)
129129
* [Initialize](cefpython.md#initialize)
130130
* [IsThread](cefpython.md#isthread)
131-
* [IsKeyModifier](cefpython.md#iskeymodifier)
132131
* [MessageLoop](cefpython.md#messageloop)
133132
* [MessageLoopWork](cefpython.md#messageloopwork)
134133
* [PostTask](cefpython.md#posttask)

api/cefpython.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Table of contents:
1616
* [GetModuleDirectory](#getmoduledirectory)
1717
* [Initialize](#initialize)
1818
* [IsThread](#isthread)
19-
* [IsKeyModifier](#iskeymodifier)
2019
* [MessageLoop](#messageloop)
2120
* [MessageLoopWork](#messageloopwork)
2221
* [PostTask](#posttask)
@@ -138,17 +137,6 @@ List of threads in the Renderer process:
138137
* TID_RENDERER: The main thread in the renderer. Used for all webkit and V8 interaction.
139138

140139

141-
### IsKeyModifier
142-
143-
| Parameter | Type |
144-
| --- | --- |
145-
| key | int |
146-
| modifiers | int |
147-
| __Return__ | bool |
148-
149-
For use with [KeyboardHandler](KeyboardHandler.md) to check whether ALT, SHIFT or CTRL are pressed.
150-
151-
152140
### MessageLoop
153141

154142
| | |

cefpython/browser.pyx

Lines changed: 155 additions & 384 deletions
Large diffs are not rendered by default.

cefpython/cefpython.pyx

Lines changed: 20 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,10 @@ include "browser.pyx"
137137
include "frame.pyx"
138138

139139
include "settings.pyx"
140-
IF UNAME_SYSNAME == "Windows" and CEF_VERSION == 1:
141-
# Off-screen rendering currently supported only on Windows
142-
include "paint_buffer_cef1.pyx"
143140

144141
IF UNAME_SYSNAME == "Windows":
145142
include "window_utils_win.pyx"
146143
include "dpi_aware_win.pyx"
147-
IF CEF_VERSION == 1:
148-
include "http_authentication_win.pyx"
149144
ELIF UNAME_SYSNAME == "Linux":
150145
include "window_utils_linux.pyx"
151146
ELIF UNAME_SYSNAME == "Darwin":
@@ -302,29 +297,27 @@ def Initialize(applicationSettings=None, commandLineSwitches=None):
302297
# CEF options - default values.
303298
if not "multi_threaded_message_loop" in applicationSettings:
304299
applicationSettings["multi_threaded_message_loop"] = False
305-
IF CEF_VERSION == 3:
306-
if not "single_process" in applicationSettings:
307-
applicationSettings["single_process"] = False
300+
if not "single_process" in applicationSettings:
301+
applicationSettings["single_process"] = False
308302

309303
cdef CefRefPtr[CefApp] cefApp
310304

311-
IF CEF_VERSION == 3:
312-
cefApp = <CefRefPtr[CefApp]?>new CefPythonApp()
313-
IF UNAME_SYSNAME == "Windows":
314-
cdef HINSTANCE hInstance = GetModuleHandle(NULL)
315-
cdef CefMainArgs cefMainArgs = CefMainArgs(hInstance)
316-
ELIF UNAME_SYSNAME == "Linux":
317-
# TODO: use the CefMainArgs(int argc, char** argv) constructor.
318-
cdef CefMainArgs cefMainArgs
319-
ELIF UNAME_SYSNAME == "Darwin":
320-
# TODO: use the CefMainArgs(int argc, char** argv) constructor.
321-
cdef CefMainArgs cefMainArgs
322-
cdef int exitCode = 1
323-
with nogil:
324-
exitCode = CefExecuteProcess(cefMainArgs, cefApp)
325-
Debug("CefExecuteProcess(): exitCode = %s" % exitCode)
326-
if exitCode >= 0:
327-
sys.exit(exitCode)
305+
cefApp = <CefRefPtr[CefApp]?>new CefPythonApp()
306+
IF UNAME_SYSNAME == "Windows":
307+
cdef HINSTANCE hInstance = GetModuleHandle(NULL)
308+
cdef CefMainArgs cefMainArgs = CefMainArgs(hInstance)
309+
ELIF UNAME_SYSNAME == "Linux":
310+
# TODO: use the CefMainArgs(int argc, char** argv) constructor.
311+
cdef CefMainArgs cefMainArgs
312+
ELIF UNAME_SYSNAME == "Darwin":
313+
# TODO: use the CefMainArgs(int argc, char** argv) constructor.
314+
cdef CefMainArgs cefMainArgs
315+
cdef int exitCode = 1
316+
with nogil:
317+
exitCode = CefExecuteProcess(cefMainArgs, cefApp)
318+
Debug("CefExecuteProcess(): exitCode = %s" % exitCode)
319+
if exitCode >= 0:
320+
sys.exit(exitCode)
328321

329322
# Make a copy as applicationSettings is a reference only
330323
# that might get destroyed later.
@@ -345,12 +338,8 @@ def Initialize(applicationSettings=None, commandLineSwitches=None):
345338

346339
Debug("CefInitialize()")
347340
cdef cpp_bool ret
348-
IF CEF_VERSION == 1:
349-
with nogil:
350-
ret = CefInitialize(cefApplicationSettings, cefApp)
351-
ELIF CEF_VERSION == 3:
352-
with nogil:
353-
ret = CefInitialize(cefMainArgs, cefApplicationSettings, cefApp)
341+
with nogil:
342+
ret = CefInitialize(cefMainArgs, cefApplicationSettings, cefApp)
354343

355344
if not ret:
356345
Debug("CefInitialize() failed")
@@ -421,13 +410,6 @@ def CreateBrowserSync(windowInfo, browserSettings, navigateUrl, requestContext=N
421410
cdef PyBrowser pyBrowser = GetPyBrowser(cefBrowser)
422411
pyBrowser.SetUserData("__outerWindowHandle", int(windowInfo.parentWindowHandle))
423412

424-
# IF CEF_VERSION == 3:
425-
# Test whether process message sent before renderer thread is created
426-
# will be delivered - OK.
427-
# Debug("Sending 'CreateBrowserSync() done' message to the Renderer")
428-
# pyBrowser.SendProcessMessage(cef_types.PID_RENDERER,
429-
# "CreateBrowserSync() done")
430-
431413
return pyBrowser
432414

433415
def MessageLoop():

cefpython/cython_includes/cef_app.pxd

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,24 @@ from cef_ptr cimport CefRefPtr
1212
from cef_base cimport CefBase
1313
from libcpp cimport bool as cpp_bool
1414

15-
IF CEF_VERSION == 3:
16-
IF UNAME_SYSNAME == "Windows":
17-
from cef_win cimport CefMainArgs
18-
ELIF UNAME_SYSNAME == "Linux":
19-
from cef_linux cimport CefMainArgs
20-
ELIF UNAME_SYSNAME == "Darwin":
21-
from cef_mac cimport CefMainArgs
15+
IF UNAME_SYSNAME == "Windows":
16+
from cef_win cimport CefMainArgs
17+
ELIF UNAME_SYSNAME == "Linux":
18+
from cef_linux cimport CefMainArgs
19+
ELIF UNAME_SYSNAME == "Darwin":
20+
from cef_mac cimport CefMainArgs
2221

2322
cdef extern from "include/cef_app.h":
2423

2524
cdef cppclass CefApp(CefBase):
2625
pass
2726

28-
IF CEF_VERSION == 3:
29-
cdef int CefExecuteProcess(CefMainArgs& args, CefRefPtr[CefApp] application) nogil
27+
cdef int CefExecuteProcess(CefMainArgs& args, CefRefPtr[CefApp] application) nogil
3028

31-
IF CEF_VERSION == 1:
32-
cdef cpp_bool CefInitialize(CefSettings&, CefRefPtr[CefApp]) nogil
33-
ELIF CEF_VERSION == 3:
34-
cdef cpp_bool CefInitialize(CefMainArgs&, CefSettings&, CefRefPtr[CefApp]) nogil
29+
cdef cpp_bool CefInitialize(CefMainArgs&, CefSettings&, CefRefPtr[CefApp]) nogil
3530

3631
cdef void CefRunMessageLoop() nogil
3732
cdef void CefDoMessageLoopWork() nogil
3833
cdef void CefQuitMessageLoop() nogil
3934
cdef void CefShutdown() nogil
40-
41-
IF CEF_VERSION == 3:
42-
cdef void CefSetOSModalLoop(cpp_bool osModalLoop) nogil
43-
35+
cdef void CefSetOSModalLoop(cpp_bool osModalLoop) nogil

cefpython/cython_includes/cef_browser_static.pxd

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,12 @@ from cef_browser cimport CefBrowser
1818
from libcpp cimport bool as cpp_bool
1919
from cef_string cimport CefString
2020

21-
IF CEF_VERSION == 1:
22-
23-
# Specifying namespace allows to import a static method.
24-
cdef extern from "include/cef_browser.h" namespace "CefBrowser":
25-
26-
cdef CefRefPtr[CefBrowser] CreateBrowserSync(
27-
CefWindowInfo&,
28-
CefRefPtr[CefClient],
29-
CefString&,
30-
CefBrowserSettings&) nogil
31-
32-
ELIF CEF_VERSION == 3:
33-
34-
# Specifying namespace allows to import a static method.
35-
cdef extern from "include/cef_browser.h" namespace "CefBrowserHost":
36-
37-
cdef CefRefPtr[CefBrowser] CreateBrowserSync(
38-
CefWindowInfo&,
39-
CefRefPtr[CefClient],
40-
CefString&,
41-
CefBrowserSettings&,
42-
CefRefPtr[CefRequestContext]) nogil
21+
# Specifying namespace allows to import a static method.
22+
cdef extern from "include/cef_browser.h" namespace "CefBrowserHost":
23+
24+
cdef CefRefPtr[CefBrowser] CreateBrowserSync(
25+
CefWindowInfo&,
26+
CefRefPtr[CefClient],
27+
CefString&,
28+
CefBrowserSettings&,
29+
CefRefPtr[CefRequestContext]) nogil

cefpython/cython_includes/cef_linux.pxd

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ cdef extern from "include/internal/cef_linux.h":
1919
void SetTransparentPainting(cpp_bool)
2020
void SetAsOffScreen(CefWindowHandle)
2121

22-
IF CEF_VERSION == 3:
23-
cdef cppclass CefMainArgs(CefStructBase):
24-
CefMainArgs()
25-
CefMainArgs(int argc_arg, char** argv_arg)
22+
cdef cppclass CefMainArgs(CefStructBase):
23+
CefMainArgs()
24+
CefMainArgs(int argc_arg, char** argv_arg)
2625

cefpython/cython_includes/cef_mac.pxd

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ cdef extern from "include/internal/cef_linux.h":
1919
void SetTransparentPainting(cpp_bool)
2020
void SetAsOffScreen(CefWindowHandle)
2121

22-
IF CEF_VERSION == 3:
23-
cdef cppclass CefMainArgs(CefStructBase):
24-
CefMainArgs()
25-
CefMainArgs(int argc_arg, char** argv_arg)
22+
cdef cppclass CefMainArgs(CefStructBase):
23+
CefMainArgs()
24+
CefMainArgs(int argc_arg, char** argv_arg)

cefpython/cython_includes/cef_types_wrappers.pxd

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ include "compile_time_constants.pxi"
66

77
from libcpp cimport bool as cpp_bool
88
from cef_string cimport cef_string_t
9-
IF CEF_VERSION == 3:
10-
from cef_types cimport cef_state_t
11-
from cef_types cimport cef_color_t
9+
from cef_types cimport cef_state_t
10+
from cef_types cimport cef_color_t
1211

1312
cdef extern from "include/internal/cef_types_wrappers.h":
1413

cefpython/cython_includes/cef_win.pxd

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ cdef extern from "include/internal/cef_win.h":
2020
void SetTransparentPainting(int)
2121
void SetAsOffScreen(HWND)
2222

23-
IF CEF_VERSION == 3:
24-
cdef cppclass CefMainArgs(CefStructBase):
25-
CefMainArgs()
26-
CefMainArgs(HINSTANCE hInstance)
23+
cdef cppclass CefMainArgs(CefStructBase):
24+
CefMainArgs()
25+
CefMainArgs(HINSTANCE hInstance)
2726

2827
ctypedef _cef_key_info_t CefKeyInfo

0 commit comments

Comments
 (0)