Skip to content

Commit 85ca353

Browse files
committed
Version 0.20
Comes with real API: http://code.google.com/p/cefpython/wiki/API
1 parent 7f39a58 commit 85ca353

24 files changed

Lines changed: 689 additions & 226 deletions

bindings.pyx

Lines changed: 0 additions & 152 deletions
This file was deleted.

cefclient2.h renamed to cef_client2.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "include/cef.h"
1+
#include "include/cef_client.h"
22

33
class CefClient2 : public CefClient
44

@@ -24,10 +24,20 @@ class CefClient2 : public CefClient
2424
{ return NULL; }
2525
virtual CefRefPtr<CefKeyboardHandler> GetKeyboardHandler() OVERRIDE
2626
{ return NULL; }
27+
virtual CefRefPtr<CefMenuHandler> GetMenuHandler() OVERRIDE
28+
{ return NULL; }
29+
virtual CefRefPtr<CefPermissionHandler> GetPermissionHandler() OVERRIDE
30+
{ return NULL; }
2731
virtual CefRefPtr<CefPrintHandler> GetPrintHandler() OVERRIDE
2832
{ return NULL; }
33+
virtual CefRefPtr<CefFindHandler> GetFindHandler() OVERRIDE
34+
{ return NULL; }
35+
virtual CefRefPtr<CefJSDialogHandler> GetJSDialogHandler() OVERRIDE
36+
{ return NULL; }
2937
virtual CefRefPtr<CefV8ContextHandler> GetV8ContextHandler() OVERRIDE
3038
{ return NULL; }
39+
virtual CefRefPtr<CefRenderHandler> GetRenderHandler() OVERRIDE
40+
{ return NULL; }
3141
virtual CefRefPtr<CefDragHandler> GetDragHandler() OVERRIDE
3242
{ return NULL; }
3343

cefexample/!README.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Example application
2-
*cefexample.py* is an example application, run it and view source
3-
to see how it works.
2+
There are 2 example applications:
3+
- cefsimple.py
4+
- cefadvanced.py
45

56
Files
67
cefpython.pyd - cefpython library compiled using Cython extension,
@@ -11,6 +12,12 @@ Files
1112
that can be downloaded from the Chromium Embedded Framework
1213
project: http://code.google.com/p/chromiumembedded/
1314

15+
Manifest and msvcr90.dll are dependencies of cefpython.pyd:
16+
Microsoft.VC90.CRT.manifest
17+
msvcm90.dll (not really required but must be redistributed together)
18+
msvcp90.dll (not really required but must be redistributed together)
19+
msvcr90.dll
20+
1421
Programming API
1522
http://code.google.com/p/cefpython/wiki/API
1623

@@ -24,3 +31,8 @@ Copyright
2431
Czarek Tomczak. All rights reserved.
2532
Website:
2633
http://code.google.com/p/cefpython/
34+
35+
36+
icon.ico
37+
That icon is from "FS Ubuntu Icons" by Frank Souza.
38+
Licensed under GNU General Public License.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
3+
<noInheritable></noInheritable>
4+
<assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.30729.6161" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
5+
<file name="msvcr90.dll" hashalg="SHA1" hash="7021457b391b35606e708c69987e4b6f606609ee"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>S83+LBs1RkUxSkzia1WysaAhLbk=</dsig:DigestValue></asmv2:hash></file> <file name="msvcp90.dll" hashalg="SHA1" hash="88549dd3ce8eaa62ca8aad0e96ddd9fec2203628"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>cKyCmIKF+fcGn6qaBhKuun+wAcQ=</dsig:DigestValue></asmv2:hash></file> <file name="msvcm90.dll" hashalg="SHA1" hash="65ef374affa5b48827e539b35b3275c201b41fc9"><asmv2:hash xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>r+4y/NnOFgaANxNXoHL1jF95DUg=</dsig:DigestValue></asmv2:hash></file>
6+
</assembly>

cefexample/cefadvanced.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<style>
5+
body { font: 13px Arial; }
6+
</style>
7+
</head>
8+
<body>
9+
10+
Welcome to <b>CEF Python</b> - bindings for the Chromium Embedded Framework.<br>
11+
12+
<br>
13+
14+
Project's website: <a href="http://code.google.com/p/cefpython/">http://code.google.com/p/cefpython/</a><br>
15+
Programming API: <a href="http://code.google.com/p/cefpython/wiki/API">http://code.google.com/p/cefpython/wiki/API</a><br>
16+
17+
<br>
18+
19+
navigator.userAgent: <span style="background:#eee"><script>document.write(navigator.userAgent)</script></span><br>
20+
21+
<br>
22+
23+
Features coming next:
24+
<ul>
25+
<li>javascript bindings
26+
<li>javascript callbacks
27+
<li>popup and modal windows
28+
<li>resizing and moving windows
29+
<li>developer tools
30+
<li>loading content from zip (optionally encrypted)
31+
</ul>
32+
33+
</body>
34+
</html>
Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111

1212
def QuitApplication(windowID, msg, wparam, lparam):
1313

14-
browserID = windowID # yes, they are the same!
14+
browserID = cefpython.GetBrowserByWindowID(windowID)
1515
cefpython.CloseBrowser(browserID)
1616
cefwindow.DestroyWindow(windowID)
1717
win32gui.PostQuitMessage(0)
1818

1919

20-
def CefExample():
20+
def CefAdvanced():
2121

2222
# Programming API:
2323
# http://code.google.com/p/cefpython/wiki/API
@@ -27,14 +27,15 @@ def CefExample():
2727

2828
appSettings = {} # See: http://code.google.com/p/cefpython/wiki/AppSettings
2929
appSettings["multi_threaded_message_loop"] = False
30+
appSettings["log_severity"] = cefpython.LOGSEVERITY_VERBOSE # LOGSEVERITY_DISABLE - will not create "debug.log" file.
3031
cefpython.Initialize(appSettings)
3132

3233
wndproc = {win32con.WM_CLOSE: QuitApplication}
33-
windowID = cefwindow.CreateWindow("CefExample", "cefexample", 800, 600, None, None, wndproc)
34+
windowID = cefwindow.CreateWindow("CefAdvanced", "cefadvanced", 800, 600, None, None, "icon.ico", wndproc)
3435

3536
browserSettings = {} # See: http://code.google.com/p/cefpython/wiki/BrowserSettings
36-
url = "%s/cefexample.html" % os.getcwd()
37-
browserID = cefpython.CreateBrowser(windowID, browserSettings, url)
37+
browserSettings["history_disabled"] = False
38+
browserID = cefpython.CreateBrowser(windowID, browserSettings, "cefadvanced.html")
3839

3940
cefpython.MessageLoop()
4041
cefpython.Shutdown()
@@ -67,11 +68,6 @@ def MoveWindow():
6768
pass
6869

6970

70-
def ApplicationIcon():
71-
# This is just a reminder, a way to change application's icon should be possible.
72-
pass
73-
74-
7571
def DeveloperTools():
7672
pass
7773

@@ -92,4 +88,4 @@ def LoadContentFromEncryptedZip():
9288

9389
if __name__ == "__main__":
9490

95-
CefExample()
91+
CefAdvanced()

cefexample/cefexample.html

Lines changed: 0 additions & 3 deletions
This file was deleted.

cefexample/cefsimple.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<style>
5+
body { font: 13px Arial; }
6+
</style>
7+
</head>
8+
<body>
9+
10+
Welcome to <b>CEF Python</b> - bindings for the Chromium Embedded Framework.<br>
11+
12+
<br>
13+
14+
Project's website: <a href="http://code.google.com/p/cefpython/">http://code.google.com/p/cefpython/</a><br>
15+
Programming API: <a href="http://code.google.com/p/cefpython/wiki/API">http://code.google.com/p/cefpython/wiki/API</a><br>
16+
17+
<br>
18+
19+
navigator.userAgent: <span style="background:#eee"><script>document.write(navigator.userAgent)</script></span><br>
20+
21+
</body>
22+
</html>

cefexample/cefsimple.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Simple CEF Python application,
2+
# for more advanced features see "cefadvanced.py"
3+
4+
import cefpython
5+
import cefwindow
6+
import win32con
7+
import win32gui
8+
import os
9+
10+
def QuitApplication(windowID, msg, wparam, lparam):
11+
12+
cefpython.CloseBrowser(cefpython.GetBrowserByWindowID(windowID))
13+
cefwindow.DestroyWindow(windowID)
14+
win32gui.PostQuitMessage(0)
15+
16+
def CefSimple():
17+
18+
cefpython.Initialize({"multi_threaded_message_loop": False})
19+
windowID = cefwindow.CreateWindow("CefSimple", "cefsimple", 800, 600, None, None, "icon.ico", {win32con.WM_CLOSE: QuitApplication})
20+
browserID = cefpython.CreateBrowser(windowID, {}, "cefsimple.html")
21+
cefpython.MessageLoop()
22+
cefpython.Shutdown()
23+
24+
if __name__ == "__main__":
25+
26+
CefSimple()

0 commit comments

Comments
 (0)