X Tutup
Skip to content

Commit 1be7046

Browse files
committed
Version 0.36 released on 2012-08-29.
* Support for Http Authentication (Issue 8). * [RequestHandler] is now partially implemented. * Support for unicode strings and tuples when passing data to javascript (Issue 10). There is a new option in [ApplicationSettings] "unicode_to_bytes_string" that is used when converting unicode string to bytes string. Some minor changes to ClientHandler.cpp, v8functionhandler.cpp - they are now as separate projects, compiled in VS as a static library. This was required as Cython 0.17 beta3 rc couldn't work with Python 3.
1 parent 8fa6ed9 commit 1be7046

28 files changed

+1138
-24
lines changed

.gitignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,13 @@
1010

1111
# WingIDE project files
1212
/wingide.wpr
13-
/wingide.wpu
13+
/wingide.wpu
14+
15+
*.ncb
16+
*.suo
17+
*.user
18+
*.aps
19+
*.sdf
20+
21+
Debug/
22+
Release/

cefexample/README.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ icon.ico
4343

4444
CHANGELOG.
4545

46+
Version 0.36 released on 2012-08-29.
47+
* Support for Http Authentication (Issue 8).
48+
* [RequestHandler] is now partially implemented.
49+
* Support for unicode strings and tuples when passing data to javascript (Issue 10). There is a new option in [ApplicationSettings] "unicode_to_bytes_string" that is used when converting unicode string to bytes string.
50+
4651
Version 0.35 released on 2012-08-23.
4752
* Fixed a bug that caused retrieving garbage data when passing an empty string from JS to Python (Issue 7).
4853
* Fixed windows 2003 error when closing window, LoadHandler_OnLoadEnd was still called, but browser was already destroyed.

cefexample/cefadvanced.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@
2626

2727
<br>
2828

29+
<h3>Basic authentication</h3>
30+
31+
<input type=text value="http://127.0.0.1/cefpython/src/tests/httpauthentication.php" size=60 id=httpauth>
32+
<input type=button value="Go" onclick="location.href=httpauth.value">
33+
34+
<br>
35+
2936
<h3>Frame.ExecuteJavascript()</h3>
3037

3138
<textarea id=jscode>alert('test me')</textarea><br>

cefexample/cefadvanced.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def CefAdvanced():
4040
wndproc = {
4141
win32con.WM_CLOSE: CloseApplication,
4242
win32con.WM_DESTROY: QuitApplication,
43-
win32con.WM_TIMER: WMTIMER,
4443
win32con.WM_SIZE: cefpython.wm_Size,
4544
win32con.WM_SETFOCUS: cefpython.wm_SetFocus,
4645
win32con.WM_ERASEBKGND: cefpython.wm_EraseBkgnd
@@ -87,7 +86,7 @@ def CefAdvanced():
8786
# http://127.0.0.1/cefpython/src/tests/httpauthentication.php
8887
__browser = cefpython.CreateBrowser(windowID, browserSettings, "cefadvanced.html", handlers, bindings)
8988

90-
print "CefAdvanced(): browser created"
89+
print("CefAdvanced(): browser created")
9190

9291
cefpython.MessageLoop()
9392
cefpython.Shutdown()
@@ -138,7 +137,12 @@ def TestJavascriptCallback(jsCallback):
138137
if isinstance(jsCallback, cefpython.JavascriptCallback):
139138
print("TestJavascriptCallback(): jsCallback.GetName(): %s" % jsCallback.GetName())
140139
print("jsCallback.Call(1, [2,3], ('tuple', 'tuple'), 'unicode string')")
141-
jsCallback.Call(1, [2,3], ('tuple', 'tuple'), unicode('unicode string'))
140+
if bytes == str:
141+
# Python 2.7
142+
jsCallback.Call(1, [2,3], ('tuple', 'tuple'), unicode('unicode string'))
143+
else:
144+
# Python 3.2 - there is no "unicode()" in python 3
145+
jsCallback.Call(1, [2,3], ('tuple', 'tuple'), 'bytes string'.encode('utf-8'))
142146
else:
143147
raise Exception("TestJavascriptCallback() failed: given argument is not a javascript callback function")
144148

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@
22
// License: New BSD License.
33
// Website: http://code.google.com/p/cefpython/
44

5+
#pragma once
6+
57
// d:\cefpython\src\setup/cefpython.h(22) : warning C4190: 'RequestHandler_GetCookieManager'
68
// has C-linkage specified, but returns UDT 'CefRefPtr<T>' which is incompatible with C
7-
8-
// A function or pointer to function has a UDT (user-defined type, which is a class, structure, enum,
9-
// union, or __value type) as return type and extern "C" linkage. This is legal if:
10-
// - All calls to this function occur from C++.
11-
// - The definition of the function is in C++.
12-
139
#pragma warning(disable:4190)
1410

1511
#include "include/cef_client.h"

clienthandler/clienthandler.sln

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 10.00
3+
# Visual Studio 2008
4+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clienthandler", "clienthandler.vcproj", "{15AD928F-FFD0-4FA5-B469-E42ABB0B4196}"
5+
EndProject
6+
Global
7+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8+
Debug|Win32 = Debug|Win32
9+
Release|Win32 = Release|Win32
10+
EndGlobalSection
11+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
12+
{15AD928F-FFD0-4FA5-B469-E42ABB0B4196}.Debug|Win32.ActiveCfg = Debug|Win32
13+
{15AD928F-FFD0-4FA5-B469-E42ABB0B4196}.Debug|Win32.Build.0 = Debug|Win32
14+
{15AD928F-FFD0-4FA5-B469-E42ABB0B4196}.Release|Win32.ActiveCfg = Release|Win32
15+
{15AD928F-FFD0-4FA5-B469-E42ABB0B4196}.Release|Win32.Build.0 = Release|Win32
16+
EndGlobalSection
17+
GlobalSection(SolutionProperties) = preSolution
18+
HideSolutionNode = FALSE
19+
EndGlobalSection
20+
EndGlobal

clienthandler/clienthandler.vcproj

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<VisualStudioProject
3+
ProjectType="Visual C++"
4+
Version="9,00"
5+
Name="clienthandler"
6+
ProjectGUID="{15AD928F-FFD0-4FA5-B469-E42ABB0B4196}"
7+
Keyword="Win32Proj"
8+
TargetFrameworkVersion="0"
9+
>
10+
<Platforms>
11+
<Platform
12+
Name="Win32"
13+
/>
14+
</Platforms>
15+
<ToolFiles>
16+
</ToolFiles>
17+
<Configurations>
18+
<Configuration
19+
Name="Debug|Win32"
20+
OutputDirectory="Debug"
21+
IntermediateDirectory="Debug"
22+
ConfigurationType="4"
23+
>
24+
<Tool
25+
Name="VCPreBuildEventTool"
26+
/>
27+
<Tool
28+
Name="VCCustomBuildTool"
29+
/>
30+
<Tool
31+
Name="VCXMLDataGeneratorTool"
32+
/>
33+
<Tool
34+
Name="VCWebServiceProxyGeneratorTool"
35+
/>
36+
<Tool
37+
Name="VCMIDLTool"
38+
/>
39+
<Tool
40+
Name="VCCLCompilerTool"
41+
Optimization="0"
42+
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;"
43+
MinimalRebuild="true"
44+
BasicRuntimeChecks="3"
45+
RuntimeLibrary="3"
46+
UsePrecompiledHeader="0"
47+
WarningLevel="3"
48+
Detect64BitPortabilityProblems="true"
49+
DebugInformationFormat="4"
50+
/>
51+
<Tool
52+
Name="VCManagedResourceCompilerTool"
53+
/>
54+
<Tool
55+
Name="VCResourceCompilerTool"
56+
/>
57+
<Tool
58+
Name="VCPreLinkEventTool"
59+
/>
60+
<Tool
61+
Name="VCLibrarianTool"
62+
/>
63+
<Tool
64+
Name="VCALinkTool"
65+
/>
66+
<Tool
67+
Name="VCXDCMakeTool"
68+
/>
69+
<Tool
70+
Name="VCBscMakeTool"
71+
/>
72+
<Tool
73+
Name="VCFxCopTool"
74+
/>
75+
<Tool
76+
Name="VCPostBuildEventTool"
77+
/>
78+
</Configuration>
79+
<Configuration
80+
Name="Release|Win32"
81+
OutputDirectory="Release"
82+
IntermediateDirectory="Release"
83+
ConfigurationType="4"
84+
>
85+
<Tool
86+
Name="VCPreBuildEventTool"
87+
/>
88+
<Tool
89+
Name="VCCustomBuildTool"
90+
/>
91+
<Tool
92+
Name="VCXMLDataGeneratorTool"
93+
/>
94+
<Tool
95+
Name="VCWebServiceProxyGeneratorTool"
96+
/>
97+
<Tool
98+
Name="VCMIDLTool"
99+
/>
100+
<Tool
101+
Name="VCCLCompilerTool"
102+
AdditionalIncludeDirectories="D:\python27_d\PC;D:\python27_d\Include;../"
103+
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;"
104+
RuntimeLibrary="0"
105+
UsePrecompiledHeader="0"
106+
WarningLevel="3"
107+
Detect64BitPortabilityProblems="false"
108+
DebugInformationFormat="3"
109+
/>
110+
<Tool
111+
Name="VCManagedResourceCompilerTool"
112+
/>
113+
<Tool
114+
Name="VCResourceCompilerTool"
115+
/>
116+
<Tool
117+
Name="VCPreLinkEventTool"
118+
/>
119+
<Tool
120+
Name="VCLibrarianTool"
121+
/>
122+
<Tool
123+
Name="VCALinkTool"
124+
/>
125+
<Tool
126+
Name="VCXDCMakeTool"
127+
/>
128+
<Tool
129+
Name="VCBscMakeTool"
130+
/>
131+
<Tool
132+
Name="VCFxCopTool"
133+
/>
134+
<Tool
135+
Name="VCPostBuildEventTool"
136+
/>
137+
</Configuration>
138+
</Configurations>
139+
<References>
140+
</References>
141+
<Files>
142+
<Filter
143+
Name="Header Files"
144+
Filter="h;hpp;hxx;hm;inl;inc;xsd"
145+
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
146+
>
147+
<File
148+
RelativePath=".\clienthandler.h"
149+
>
150+
</File>
151+
</Filter>
152+
<Filter
153+
Name="Resource Files"
154+
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
155+
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
156+
>
157+
</Filter>
158+
<Filter
159+
Name="Source Files"
160+
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
161+
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
162+
>
163+
<File
164+
RelativePath=".\clienthandler.cpp"
165+
>
166+
</File>
167+
</Filter>
168+
</Files>
169+
<Globals>
170+
</Globals>
171+
</VisualStudioProject>

httpauth/AuthCredentials.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#include "AuthCredentials.h"
2+
3+
AuthCredentialsDataMap AuthCredentials::data;

httpauth/AuthCredentials.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#pragma once
2+
3+
#include <windows.h>
4+
#include <string>
5+
#include <map>
6+
#include <stdio.h>
7+
8+
typedef struct
9+
{
10+
std::string username;
11+
std::string password;
12+
} AuthCredentialsData;
13+
14+
typedef std::map<HWND, AuthCredentialsData*> AuthCredentialsDataMap;
15+
16+
class AuthCredentials
17+
{
18+
public:
19+
static void SetData(HWND hwnd, AuthCredentialsData* newData)
20+
{
21+
data[hwnd] = newData;
22+
}
23+
static AuthCredentialsData* GetData(HWND hwnd)
24+
{
25+
if (data.find(hwnd) == data.end()) {
26+
return NULL;
27+
}
28+
return data[hwnd];
29+
}
30+
protected:
31+
static AuthCredentialsDataMap data;
32+
};

0 commit comments

Comments
 (0)
X Tutup