X Tutup
Skip to content

Commit 60ebfb8

Browse files
committed
Build v55 on Windows PART 2 (cztomczak#294)...
There are still issues with unittests and examples. Tkinter example launches fine, but crashes sometimes. Update vcproj files and other fixes. Add additional linker flag /LARGEADDRESSAWARE to Allow 32-bit processes to access 3GB of RAM. Set UNICODE for subprocess. Update build tools. Update module comments with great details on how these tools work. Refactor make-setup.py and make it work cross-platform (cztomczak#299). Moved to tools/installer/make.py . Update docs. Update requirements.txt. Update tkinter example on Windows, doesn't support PNG images.
1 parent 7491576 commit 60ebfb8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1178
-1637
lines changed

api/ApplicationSettings.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ Custom flags that will be used when initializing the V8 Javascript engine.
216216
The consequences of using custom flags may not be well tested. Also
217217
configurable using the --js-flags switch.
218218

219+
To enable WebAssembly support set the `--expose-wasm` flag.
220+
219221

220222
### locale
221223

docs/Build-instructions.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ __Windows__
6969

7070
* Install an appropriate MS compiler for a specific Python version:
7171
https://wiki.python.org/moin/WindowsCompilers
72+
* When using "Visual C++ compiler for Python 2.7" you have to install
73+
"Microsoft Visual C++ 2008 Redistributable Package (x64)" from
74+
[here](https://www.microsoft.com/en-us/download/details.aspx?id=15336)
7275
* To build CEF from sources:
7376
* Use Win7 x64 or later. 32-bit OS'es are not supported. For more details
7477
see [here](https://www.chromium.org/developers/how-tos/build-instructions-windows).

examples/resources/back.gif

1.12 KB
Loading

examples/resources/forward.gif

1.11 KB
Loading

examples/resources/reload.gif

1.15 KB
Loading

examples/resources/tkinter.gif

5.53 KB
Loading

examples/resources/tkinter.png

29 Bytes
Loading

examples/tkinter_.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@
1414
import Tkinter as tk
1515
import sys
1616
import os
17+
import platform
1718
import logging as _logging
1819

1920
# Globals
2021
logger = _logging.getLogger("tkinter_.py")
22+
# Python 2.7 on Windows comes with Tk 8.5 which doesn't support PNG images
23+
IMAGE_EXT = ".gif" if platform.system() == "Windows" else ".png"
2124

2225

2326
def main():
@@ -112,7 +115,7 @@ def get_browser_frame(self):
112115

113116
def setup_icon(self):
114117
resources = os.path.join(os.path.dirname(__file__), "resources")
115-
icon_path = os.path.join(resources, "tkinter.png")
118+
icon_path = os.path.join(resources, "tkinter"+IMAGE_EXT)
116119
if os.path.exists(icon_path):
117120
self.icon = tk.PhotoImage(file=icon_path)
118121
# noinspection PyProtectedMember
@@ -132,23 +135,23 @@ def __init__(self, master):
132135
resources = os.path.join(os.path.dirname(__file__), "resources")
133136

134137
# Back button
135-
back_png = os.path.join(resources, "back.png")
138+
back_png = os.path.join(resources, "back"+IMAGE_EXT)
136139
if os.path.exists(back_png):
137140
self.back_image = tk.PhotoImage(file=back_png)
138141
self.back_button = tk.Button(self, image=self.back_image,
139142
command=self.go_back)
140143
self.back_button.grid(row=0, column=0)
141144

142145
# Forward button
143-
forward_png = os.path.join(resources, "forward.png")
146+
forward_png = os.path.join(resources, "forward"+IMAGE_EXT)
144147
if os.path.exists(forward_png):
145148
self.forward_image = tk.PhotoImage(file=forward_png)
146149
self.forward_button = tk.Button(self, image=self.forward_image,
147150
command=self.go_forward)
148151
self.forward_button.grid(row=0, column=1)
149152

150153
# Reload button
151-
reload_png = os.path.join(resources, "reload.png")
154+
reload_png = os.path.join(resources, "reload"+IMAGE_EXT)
152155
if os.path.exists(reload_png):
153156
self.reload_image = tk.PhotoImage(file=reload_png)
154157
self.reload_button = tk.Button(self, image=self.reload_image,
@@ -255,6 +258,7 @@ def embed_browser(self):
255258
window_info.SetAsChild(self.winfo_id())
256259
self.browser = cef.CreateBrowserSync(window_info,
257260
url="https://www.google.com/")
261+
assert self.browser
258262
self.browser.SetClientHandler(LoadHandler(self))
259263
self.browser.SetClientHandler(FocusHandler(self))
260264
self.message_loop_work()
@@ -274,7 +278,11 @@ def on_root_configure(self):
274278

275279
def on_mainframe_configure(self, width, height):
276280
if self.browser:
277-
self.browser.SetBounds(0, 0, width, height)
281+
if platform.system() == "Windows":
282+
# noinspection PyUnresolvedReferences
283+
cef.WindowUtils.OnSize(self.winfo_id(), 0, 0, 0)
284+
elif platform.system() == "Linux":
285+
self.browser.SetBounds(0, 0, width, height)
278286
self.browser.NotifyMoveOrResizeStarted()
279287

280288
def on_focus_in(self, _):

examples/wxpython.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def OnSize(self, _):
111111
(width, height) = self.browser_panel.GetSizeTuple()
112112
# noinspection PyUnresolvedReferences
113113
self.browser.SetBounds(x, y, width, height)
114+
self.browser.NotifyMoveOrResizeStarted()
114115

115116
def OnClose(self, event):
116117
# In cefpython3.wx.chromectrl example calling browser.CloseBrowser()

src/client_handler/client_handler_py27_win32.vcproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Version="9.00"
55
Name="client_handler_py27_win32"
66
RootNamespace="client_handler_py27_win32"
7-
ProjectGUID="{15AD928F-FFD0-4FA5-B469-E42ABB0B4196}"
7+
ProjectGUID="{15AD928F-FFD0-4FA5-B469-E42AAA0B4196}"
88
Keyword="Win32Proj"
99
TargetFrameworkVersion="0"
1010
>
@@ -27,7 +27,7 @@
2727
<Tool Name="VCMIDLTool" />
2828
<Tool
2929
Name="VCCLCompilerTool"
30-
AdditionalIncludeDirectories="../;$(PYTHON_INCLUDE_PATH);C:\Python27\include"
30+
AdditionalIncludeDirectories="$(INCLUDE);..\;..\common"
3131
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;"
3232
ExceptionHandling="1"
3333
RuntimeLibrary="2"

0 commit comments

Comments
 (0)
X Tutup