Skip to content

Commit

Permalink
Build v55 on Windows PART 2 (#294)...
Browse files Browse the repository at this point in the history
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 (#299). Moved
to tools/installer/make.py .

Update docs.
Update requirements.txt.

Update tkinter example on Windows, doesn't support PNG images.
  • Loading branch information
cztomczak committed Feb 20, 2017
1 parent 7491576 commit 60ebfb8
Show file tree
Hide file tree
Showing 47 changed files with 1,178 additions and 1,637 deletions.
2 changes: 2 additions & 0 deletions api/ApplicationSettings.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ Custom flags that will be used when initializing the V8 Javascript engine.
The consequences of using custom flags may not be well tested. Also
configurable using the --js-flags switch.

To enable WebAssembly support set the `--expose-wasm` flag.


### locale

Expand Down
3 changes: 3 additions & 0 deletions docs/Build-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ __Windows__

* Install an appropriate MS compiler for a specific Python version:
https://wiki.python.org/moin/WindowsCompilers
* When using "Visual C++ compiler for Python 2.7" you have to install
"Microsoft Visual C++ 2008 Redistributable Package (x64)" from
[here](https://www.microsoft.com/en-us/download/details.aspx?id=15336)
* To build CEF from sources:
* Use Win7 x64 or later. 32-bit OS'es are not supported. For more details
see [here](https://www.chromium.org/developers/how-tos/build-instructions-windows).
Expand Down
Binary file added examples/resources/back.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/resources/forward.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/resources/reload.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/resources/tkinter.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/resources/tkinter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 13 additions & 5 deletions examples/tkinter_.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@
import Tkinter as tk
import sys
import os
import platform
import logging as _logging

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


def main():
Expand Down Expand Up @@ -112,7 +115,7 @@ def get_browser_frame(self):

def setup_icon(self):
resources = os.path.join(os.path.dirname(__file__), "resources")
icon_path = os.path.join(resources, "tkinter.png")
icon_path = os.path.join(resources, "tkinter"+IMAGE_EXT)
if os.path.exists(icon_path):
self.icon = tk.PhotoImage(file=icon_path)
# noinspection PyProtectedMember
Expand All @@ -132,23 +135,23 @@ def __init__(self, master):
resources = os.path.join(os.path.dirname(__file__), "resources")

# Back button
back_png = os.path.join(resources, "back.png")
back_png = os.path.join(resources, "back"+IMAGE_EXT)
if os.path.exists(back_png):
self.back_image = tk.PhotoImage(file=back_png)
self.back_button = tk.Button(self, image=self.back_image,
command=self.go_back)
self.back_button.grid(row=0, column=0)

# Forward button
forward_png = os.path.join(resources, "forward.png")
forward_png = os.path.join(resources, "forward"+IMAGE_EXT)
if os.path.exists(forward_png):
self.forward_image = tk.PhotoImage(file=forward_png)
self.forward_button = tk.Button(self, image=self.forward_image,
command=self.go_forward)
self.forward_button.grid(row=0, column=1)

# Reload button
reload_png = os.path.join(resources, "reload.png")
reload_png = os.path.join(resources, "reload"+IMAGE_EXT)
if os.path.exists(reload_png):
self.reload_image = tk.PhotoImage(file=reload_png)
self.reload_button = tk.Button(self, image=self.reload_image,
Expand Down Expand Up @@ -255,6 +258,7 @@ def embed_browser(self):
window_info.SetAsChild(self.winfo_id())
self.browser = cef.CreateBrowserSync(window_info,
url="https://www.google.com/")
assert self.browser
self.browser.SetClientHandler(LoadHandler(self))
self.browser.SetClientHandler(FocusHandler(self))
self.message_loop_work()
Expand All @@ -274,7 +278,11 @@ def on_root_configure(self):

def on_mainframe_configure(self, width, height):
if self.browser:
self.browser.SetBounds(0, 0, width, height)
if platform.system() == "Windows":
# noinspection PyUnresolvedReferences
cef.WindowUtils.OnSize(self.winfo_id(), 0, 0, 0)
elif platform.system() == "Linux":
self.browser.SetBounds(0, 0, width, height)
self.browser.NotifyMoveOrResizeStarted()

def on_focus_in(self, _):
Expand Down
1 change: 1 addition & 0 deletions examples/wxpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def OnSize(self, _):
(width, height) = self.browser_panel.GetSizeTuple()
# noinspection PyUnresolvedReferences
self.browser.SetBounds(x, y, width, height)
self.browser.NotifyMoveOrResizeStarted()

def OnClose(self, event):
# In cefpython3.wx.chromectrl example calling browser.CloseBrowser()
Expand Down
4 changes: 2 additions & 2 deletions src/client_handler/client_handler_py27_win32.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Version="9.00"
Name="client_handler_py27_win32"
RootNamespace="client_handler_py27_win32"
ProjectGUID="{15AD928F-FFD0-4FA5-B469-E42ABB0B4196}"
ProjectGUID="{15AD928F-FFD0-4FA5-B469-E42AAA0B4196}"
Keyword="Win32Proj"
TargetFrameworkVersion="0"
>
Expand All @@ -27,7 +27,7 @@
<Tool Name="VCMIDLTool" />
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../;$(PYTHON_INCLUDE_PATH);C:\Python27\include"
AdditionalIncludeDirectories="$(INCLUDE);..\;..\common"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;"
ExceptionHandling="1"
RuntimeLibrary="2"
Expand Down
2 changes: 2 additions & 0 deletions src/client_handler/lifespan_handler.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) 2016 CEF Python. See the Authors and License files.

#include "lifespan_handler.h"
#include "dpi_aware.h"
#include "LOG_DEBUG.h"


bool LifespanHandler::OnBeforePopup(CefRefPtr<CefBrowser> browser,
Expand Down
1 change: 1 addition & 0 deletions src/cpp_utils/cpp_utils_win32.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<Tool Name="VCMIDLTool" />
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="$(INCLUDE)"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
Expand Down
7 changes: 0 additions & 7 deletions src/linux/installer/build-n-run-wx-chromectrl.sh

This file was deleted.

3 changes: 0 additions & 3 deletions src/mac/installer/.gitignore

This file was deleted.

28 changes: 0 additions & 28 deletions src/mac/installer/__init__.py.template

This file was deleted.

47 changes: 0 additions & 47 deletions src/mac/installer/build_all.sh

This file was deleted.

31 changes: 0 additions & 31 deletions src/mac/installer/build_run_chromectrl.sh

This file was deleted.

Loading

0 comments on commit 60ebfb8

Please sign in to comment.