Permalink
Browse files

add libcef_sll_wrapper and make the code compile

  • Loading branch information...
1 parent b29aae3 commit d368bd437faee59f43c32bb517886e02f6b6c6e0 U-yong-THINK\yong committed Jan 12, 2012
Showing with 13,776 additions and 1,731 deletions.
  1. +2 −0 .gitignore
  2. +0 −1 cefclient/cefclient.cpp
  3. +0 −145 cefclient/cefclient_win.cpp
  4. +0 −4 cefclient/client_handler.cpp
  5. +0 −201 cefclient/clientplugin.cpp
  6. +0 −100 cefclient/clientplugin.h
  7. +0 −905 cefclient/osrplugin.cpp
  8. +0 −29 cefclient/osrplugin.h
  9. +0 −293 cefclient/uiplugin.cpp
  10. +0 −29 cefclient/uiplugin.h
  11. +2 −0 h54d.sln
  12. +0 −6 h54d.vcxproj
  13. +0 −18 h54d.vcxproj.filters
  14. +15 −0 libcef_dll/cef_logging.h
  15. +48 −0 libcef_dll/cpptoc/app_cpptoc.cc
  16. +36 −0 libcef_dll/cpptoc/app_cpptoc.h
  17. +156 −0 libcef_dll/cpptoc/base_cpptoc.h
  18. +290 −0 libcef_dll/cpptoc/client_cpptoc.cc
  19. +36 −0 libcef_dll/cpptoc/client_cpptoc.h
  20. +113 −0 libcef_dll/cpptoc/content_filter_cpptoc.cc
  21. +37 −0 libcef_dll/cpptoc/content_filter_cpptoc.h
  22. +73 −0 libcef_dll/cpptoc/cookie_visitor_cpptoc.cc
  23. +37 −0 libcef_dll/cpptoc/cookie_visitor_cpptoc.h
  24. +171 −0 libcef_dll/cpptoc/cpptoc.h
  25. +219 −0 libcef_dll/cpptoc/display_handler_cpptoc.cc
  26. +37 −0 libcef_dll/cpptoc/display_handler_cpptoc.h
  27. +52 −0 libcef_dll/cpptoc/domevent_listener_cpptoc.cc
  28. +37 −0 libcef_dll/cpptoc/domevent_listener_cpptoc.h
  29. +51 −0 libcef_dll/cpptoc/domvisitor_cpptoc.cc
  30. +36 −0 libcef_dll/cpptoc/domvisitor_cpptoc.h
  31. +70 −0 libcef_dll/cpptoc/download_handler_cpptoc.cc
  32. +37 −0 libcef_dll/cpptoc/download_handler_cpptoc.h
  33. +92 −0 libcef_dll/cpptoc/drag_handler_cpptoc.cc
  34. +36 −0 libcef_dll/cpptoc/drag_handler_cpptoc.h
  35. +64 −0 libcef_dll/cpptoc/find_handler_cpptoc.cc
  36. +36 −0 libcef_dll/cpptoc/find_handler_cpptoc.h
  37. +104 −0 libcef_dll/cpptoc/focus_handler_cpptoc.cc
  38. +37 −0 libcef_dll/cpptoc/focus_handler_cpptoc.h
  39. +172 −0 libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc
  40. +37 −0 libcef_dll/cpptoc/jsdialog_handler_cpptoc.h
  41. +62 −0 libcef_dll/cpptoc/keyboard_handler_cpptoc.cc
  42. +37 −0 libcef_dll/cpptoc/keyboard_handler_cpptoc.h
  43. +202 −0 libcef_dll/cpptoc/life_span_handler_cpptoc.cc
  44. +37 −0 libcef_dll/cpptoc/life_span_handler_cpptoc.h
  45. +127 −0 libcef_dll/cpptoc/load_handler_cpptoc.cc
  46. +36 −0 libcef_dll/cpptoc/load_handler_cpptoc.h
  47. +117 −0 libcef_dll/cpptoc/menu_handler_cpptoc.cc
  48. +36 −0 libcef_dll/cpptoc/menu_handler_cpptoc.h
  49. +169 −0 libcef_dll/cpptoc/print_handler_cpptoc.cc
  50. +37 −0 libcef_dll/cpptoc/print_handler_cpptoc.h
  51. +66 −0 libcef_dll/cpptoc/proxy_handler_cpptoc.cc
  52. +37 −0 libcef_dll/cpptoc/proxy_handler_cpptoc.h
  53. +109 −0 libcef_dll/cpptoc/read_handler_cpptoc.cc
  54. +36 −0 libcef_dll/cpptoc/read_handler_cpptoc.h
  55. +264 −0 libcef_dll/cpptoc/render_handler_cpptoc.cc
  56. +37 −0 libcef_dll/cpptoc/render_handler_cpptoc.h
  57. +385 −0 libcef_dll/cpptoc/request_handler_cpptoc.cc
  58. +37 −0 libcef_dll/cpptoc/request_handler_cpptoc.h
  59. +159 −0 libcef_dll/cpptoc/scheme_handler_cpptoc.cc
  60. +37 −0 libcef_dll/cpptoc/scheme_handler_cpptoc.h
  61. +70 −0 libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc
  62. +37 −0 libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h
  63. +81 −0 libcef_dll/cpptoc/storage_visitor_cpptoc.cc
  64. +37 −0 libcef_dll/cpptoc/storage_visitor_cpptoc.h
  65. +45 −0 libcef_dll/cpptoc/task_cpptoc.cc
  66. +36 −0 libcef_dll/cpptoc/task_cpptoc.h
  67. +131 −0 libcef_dll/cpptoc/v8accessor_cpptoc.cc
  68. +36 −0 libcef_dll/cpptoc/v8accessor_cpptoc.h
  69. +96 −0 libcef_dll/cpptoc/v8context_handler_cpptoc.cc
  70. +37 −0 libcef_dll/cpptoc/v8context_handler_cpptoc.h
  71. +102 −0 libcef_dll/cpptoc/v8handler_cpptoc.cc
  72. +36 −0 libcef_dll/cpptoc/v8handler_cpptoc.h
  73. +187 −0 libcef_dll/cpptoc/web_urlrequest_client_cpptoc.cc
  74. +37 −0 libcef_dll/cpptoc/web_urlrequest_client_cpptoc.h
  75. +110 −0 libcef_dll/cpptoc/write_handler_cpptoc.cc
  76. +37 −0 libcef_dll/cpptoc/write_handler_cpptoc.h
  77. +106 −0 libcef_dll/ctocpp/base_ctocpp.h
  78. +660 −0 libcef_dll/ctocpp/browser_ctocpp.cc
  79. +82 −0 libcef_dll/ctocpp/browser_ctocpp.h
  80. +322 −0 libcef_dll/ctocpp/command_line_ctocpp.cc
  81. +55 −0 libcef_dll/ctocpp/command_line_ctocpp.h
  82. +122 −0 libcef_dll/ctocpp/ctocpp.h
  83. +286 −0 libcef_dll/ctocpp/domdocument_ctocpp.cc
  84. +56 −0 libcef_dll/ctocpp/domdocument_ctocpp.h
  85. +147 −0 libcef_dll/ctocpp/domevent_ctocpp.cc
  86. +47 −0 libcef_dll/ctocpp/domevent_ctocpp.h
  87. +473 −0 libcef_dll/ctocpp/domnode_ctocpp.cc
  88. +66 −0 libcef_dll/ctocpp/domnode_ctocpp.h
  89. +234 −0 libcef_dll/ctocpp/drag_data_ctocpp.cc
  90. +51 −0 libcef_dll/ctocpp/drag_data_ctocpp.h
  91. +417 −0 libcef_dll/ctocpp/frame_ctocpp.cc
  92. +67 −0 libcef_dll/ctocpp/frame_ctocpp.h
  93. +148 −0 libcef_dll/ctocpp/post_data_ctocpp.cc
  94. +44 −0 libcef_dll/ctocpp/post_data_ctocpp.h
  95. +156 −0 libcef_dll/ctocpp/post_data_element_ctocpp.cc
  96. +48 −0 libcef_dll/ctocpp/post_data_element_ctocpp.h
  97. +292 −0 libcef_dll/ctocpp/request_ctocpp.cc
  98. +53 −0 libcef_dll/ctocpp/request_ctocpp.h
  99. +194 −0 libcef_dll/ctocpp/response_ctocpp.cc
  100. +48 −0 libcef_dll/ctocpp/response_ctocpp.h
  101. +59 −0 libcef_dll/ctocpp/scheme_handler_callback_ctocpp.cc
  102. +44 −0 libcef_dll/ctocpp/scheme_handler_callback_ctocpp.h
  103. +155 −0 libcef_dll/ctocpp/stream_reader_ctocpp.cc
  104. +45 −0 libcef_dll/ctocpp/stream_reader_ctocpp.h
  105. +135 −0 libcef_dll/ctocpp/stream_writer_ctocpp.cc
  106. +45 −0 libcef_dll/ctocpp/stream_writer_ctocpp.h
  107. +161 −0 libcef_dll/ctocpp/v8context_ctocpp.cc
  108. +45 −0 libcef_dll/ctocpp/v8context_ctocpp.h
  109. +149 −0 libcef_dll/ctocpp/v8exception_ctocpp.cc
  110. +48 −0 libcef_dll/ctocpp/v8exception_ctocpp.h
  111. +870 −0 libcef_dll/ctocpp/v8value_ctocpp.cc
  112. +78 −0 libcef_dll/ctocpp/v8value_ctocpp.h
  113. +79 −0 libcef_dll/ctocpp/web_urlrequest_ctocpp.cc
  114. +43 −0 libcef_dll/ctocpp/web_urlrequest_ctocpp.h
  115. +561 −0 libcef_dll/ctocpp/xml_reader_ctocpp.cc
  116. +70 −0 libcef_dll/ctocpp/xml_reader_ctocpp.h
  117. +245 −0 libcef_dll/ctocpp/zip_reader_ctocpp.cc
  118. +52 −0 libcef_dll/ctocpp/zip_reader_ctocpp.h
  119. +72 −0 libcef_dll/transfer_util.cpp
  120. +35 −0 libcef_dll/transfer_util.h
  121. +62 −0 libcef_dll/wrapper/cef_byte_read_handler.cc
  122. +489 −0 libcef_dll/wrapper/cef_xml_object.cc
  123. +168 −0 libcef_dll/wrapper/cef_zip_archive.cc
  124. +602 −0 libcef_dll/wrapper/libcef_dll_wrapper.cc
  125. +13 −0 libcef_dll/wrapper/libcef_dll_wrapper2.cc
  126. +1 −0 libcef_dll_wrapper.vcxproj
  127. +1 −0 libcef_dll_wrapper.vcxproj.filters
View
@@ -0,0 +1,2 @@
+*.opensdf
+*.vcxproj.user
@@ -8,7 +8,6 @@
#include "cefclient.h"
#include "cefclient_switches.h"
#include "client_handler.h"
-#include "binding_test.h"
#include "string_util.h"
#include "util.h"
#include <cstdlib>
@@ -5,15 +5,9 @@
#include "include/cef.h"
#include "include/cef_runnable.h"
#include "cefclient.h"
-#include "binding_test.h"
#include "client_handler.h"
-#include "extension_test.h"
-#include "osrplugin_test.h"
-#include "plugin_test.h"
#include "resource.h"
-#include "scheme_test.h"
#include "string_util.h"
-#include "uiplugin_test.h"
#include <commdlg.h>
#include <direct.h>
#include <sstream>
@@ -73,21 +67,6 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
// Initialize CEF.
CefInitialize(settings, app);
- // Register the internal client plugin.
- InitPluginTest();
-
- // Register the internal UI client plugin.
- InitUIPluginTest();
-
- // Register the internal OSR client plugin.
- InitOSRPluginTest();
-
- // Register the V8 extension handler.
- InitExtensionTest();
-
- // Register the scheme handler.
- InitSchemeTest();
-
HACCEL hAccelTable;
// Initialize global strings
@@ -452,130 +431,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
if(browser.get())
browser->StopLoad();
return 0;
- case ID_TESTS_GETSOURCE: // Test the GetSource function
- if(browser.get())
- RunGetSourceTest(browser);
- return 0;
- case ID_TESTS_GETTEXT: // Test the GetText function
- if(browser.get())
- RunGetTextTest(browser);
- return 0;
- case ID_TESTS_JAVASCRIPT_BINDING: // Test the V8 binding handler
- if(browser.get())
- RunBindingTest(browser);
- return 0;
- case ID_TESTS_JAVASCRIPT_EXTENSION: // Test the V8 extension handler
- if(browser.get())
- RunExtensionTest(browser);
- return 0;
- case ID_TESTS_JAVASCRIPT_PERFORMANCE: // Test the V8 performance
- if(browser.get())
- RunExtensionPerfTest(browser);
- return 0;
- case ID_TESTS_JAVASCRIPT_EXECUTE: // Test execution of javascript
- if(browser.get())
- RunJavaScriptExecuteTest(browser);
- return 0;
- case ID_TESTS_JAVASCRIPT_INVOKE:
- if(browser.get())
- RunJavaScriptInvokeTest(browser);
- return 0;
- case ID_TESTS_PLUGIN: // Test the custom plugin
- if(browser.get())
- RunPluginTest(browser);
- return 0;
- case ID_TESTS_POPUP: // Test a popup window
- if(browser.get())
- RunPopupTest(browser);
- return 0;
- case ID_TESTS_TRANSPARENT_POPUP: // Test a transparent popup window
- if(browser.get())
- RunTransparentPopupTest(browser);
- return 0;
- case ID_TESTS_REQUEST: // Test a request
- if(browser.get())
- RunRequestTest(browser);
- return 0;
- case ID_TESTS_SCHEME_HANDLER: // Test the scheme handler
- if(browser.get())
- RunSchemeTest(browser);
- return 0;
- case ID_TESTS_UIAPP: // Test the UI app
- if(browser.get())
- RunUIPluginTest(browser);
- return 0;
- case ID_TESTS_OSRAPP: // Test the OSR app
- if(browser.get())
- RunOSRPluginTest(browser, false);
- return 0;
- case ID_TESTS_TRANSPARENT_OSRAPP: // Test the OSR app with transparency
- if(browser.get())
- RunOSRPluginTest(browser, true);
- return 0;
- case ID_TESTS_DOMACCESS: // Test DOM access
- if(browser.get())
- RunDOMAccessTest(browser);
- return 0;
- case ID_TESTS_LOCALSTORAGE: // Test localStorage
- if(browser.get())
- RunLocalStorageTest(browser);
- return 0;
- case ID_TESTS_ACCELERATED2DCANVAS: // Test accelerated 2d canvas
- if(browser.get())
- RunAccelerated2DCanvasTest(browser);
- return 0;
- case ID_TESTS_ACCELERATEDLAYERS: // Test accelerated layers
- if(browser.get())
- RunAcceleratedLayersTest(browser);
- return 0;
- case ID_TESTS_WEBGL: // Test WebGL
- if(browser.get())
- RunWebGLTest(browser);
- return 0;
- case ID_TESTS_HTML5VIDEO: // Test HTML5 video
- if(browser.get())
- RunHTML5VideoTest(browser);
- return 0;
- case ID_TESTS_DRAGDROP: // Test drag & drop
- if(browser.get())
- RunDragDropTest(browser);
- return 0;
- case ID_TESTS_XMLHTTPREQUEST: // Test XMLHttpRequest
- if(browser.get())
- RunXMLHTTPRequestTest(browser);
- return 0;
- case ID_TESTS_WEBURLREQUEST:
- if (browser.get())
- RunWebURLRequestTest(browser);
- return 0;
- case ID_TESTS_ZOOM_IN:
- if(browser.get())
- browser->SetZoomLevel(browser->GetZoomLevel() + 0.5);
- return 0;
- case ID_TESTS_ZOOM_OUT:
- if(browser.get())
- browser->SetZoomLevel(browser->GetZoomLevel() - 0.5);
- return 0;
- case ID_TESTS_ZOOM_RESET:
- if(browser.get())
- browser->SetZoomLevel(0.0);
- return 0;
- case ID_TESTS_DEVTOOLS_SHOW:
- if (browser.get())
- browser->ShowDevTools();
- return 0;
- case ID_TESTS_DEVTOOLS_CLOSE:
- if (browser.get())
- browser->CloseDevTools();
- return 0;
- case ID_TESTS_MODALDIALOG:
- if(browser.get())
- RunModalDialogTest(browser);
- return 0;
- case ID_TESTS_GETIMAGE:
- if(browser.get())
- RunGetImageTest(browser);
- return 0;
}
}
break;
@@ -4,7 +4,6 @@
#include "include/cef.h"
#include "client_handler.h"
-#include "binding_test.h"
#include "cefclient.h"
#include "download_handler.h"
#include "string_util.h"
@@ -268,9 +267,6 @@ void ClientHandler::OnContextCreated(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefV8Context> context)
{
REQUIRE_UI_THREAD();
-
- // Add the V8 bindings.
- InitBindingTest(browser, frame, context->GetGlobal());
}
bool ClientHandler::OnDragStart(CefRefPtr<CefBrowser> browser,
@@ -1,201 +0,0 @@
-// Copyright (c) 2008 The Chromium Embedded Framework Authors.
-// Portions copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "clientplugin.h"
-
-#if defined(OS_WIN)
-
-// Initialized in NP_Initialize.
-NPNetscapeFuncs* g_browser = NULL;
-
-namespace {
-
-NPError NPP_ClientNew(NPMIMEType plugin_type, NPP instance, uint16_t mode,
- int16_t argc, char* argn[], char* argv[], NPSavedData* saved) {
- if (instance == NULL)
- return NPERR_INVALID_INSTANCE_ERROR;
-
- ClientPlugin* plugin_impl = new ClientPlugin(mode);
- plugin_impl->Initialize(GetModuleHandle(NULL), instance, plugin_type, argc,
- argn, argv);
- instance->pdata = reinterpret_cast<void*>(plugin_impl);
- return NPERR_NO_ERROR;
-}
-
-NPError NPP_ClientDestroy(NPP instance, NPSavedData** save) {
- ClientPlugin* plugin_impl = reinterpret_cast<ClientPlugin*>(instance->pdata);
-
- if (plugin_impl) {
- plugin_impl->Shutdown();
- delete plugin_impl;
- }
-
- return NPERR_NO_ERROR;
-}
-
-NPError NPP_ClientSetWindow(NPP instance, NPWindow* window_info) {
- if (instance == NULL)
- return NPERR_INVALID_INSTANCE_ERROR;
-
- if (window_info == NULL)
- return NPERR_GENERIC_ERROR;
-
- ClientPlugin* plugin_impl = reinterpret_cast<ClientPlugin*>(instance->pdata);
-
- if (plugin_impl == NULL)
- return NPERR_GENERIC_ERROR;
-
- HWND window_handle = reinterpret_cast<HWND>(window_info->window);
- if (!plugin_impl->SetWindow(window_handle)) {
- delete plugin_impl;
- return NPERR_GENERIC_ERROR;
- }
-
- return NPERR_NO_ERROR;
-}
-
-} // anonymous
-
-NPError API_CALL NP_ClientGetEntryPoints(NPPluginFuncs* pFuncs)
-{
- pFuncs->newp = NPP_ClientNew;
- pFuncs->destroy = NPP_ClientDestroy;
- pFuncs->setwindow = NPP_ClientSetWindow;
- return NPERR_NO_ERROR;
-}
-
-NPError API_CALL NP_ClientInitialize(NPNetscapeFuncs* pFuncs)
-{
- g_browser = pFuncs;
- return NPERR_NO_ERROR;
-}
-
-NPError API_CALL NP_ClientShutdown(void)
-{
- g_browser = NULL;
- return NPERR_NO_ERROR;
-}
-
-
-// ClientPlugin Implementation
-
-ClientPlugin::ClientPlugin(int16 mode)
- : mode_(mode)
-{
-}
-
-ClientPlugin::~ClientPlugin()
-{
-}
-
-bool ClientPlugin::Initialize(HINSTANCE module_handle, NPP instance,
- NPMIMEType mime_type, int16 argc, char* argn[],
- char* argv[])
-{
- RefreshDisplay();
- return true;
-}
-
-bool ClientPlugin::SetWindow(HWND parent_window)
-{
- if (!::IsWindow(parent_window)) {
- // No window created yet. Ignore this call.
- if (!IsWindow())
- return true;
- // Parent window has been destroyed.
- Shutdown();
- return true;
- }
-
- RECT parent_rect;
-
- if (IsWindow()) {
- ::GetClientRect(parent_window, &parent_rect);
- SetWindowPos(NULL, &parent_rect, SWP_SHOWWINDOW);
- return true;
- }
- // First time in -- no window created by plugin yet.
- ::GetClientRect(parent_window, &parent_rect);
- Create(parent_window, parent_rect, NULL, WS_CHILD | WS_BORDER);
-
- UpdateWindow();
- ShowWindow(SW_SHOW);
-
- return true;
-}
-
-void ClientPlugin::Shutdown()
-{
- if (IsWindow()) {
- DestroyWindow();
- }
-}
-
-LRESULT ClientPlugin::OnPaint(UINT message, WPARAM wparam, LPARAM lparam,
- BOOL& handled)
-{
- PAINTSTRUCT paint_struct;
- BeginPaint(&paint_struct);
- Paint(paint_struct.hdc);
- EndPaint(&paint_struct);
- return 0;
-}
-
-// PrintClient is necessary to support off-screen rendering.
-LRESULT ClientPlugin::OnPrintClient(UINT message, WPARAM wparam, LPARAM lparam,
- BOOL& handled)
-{
- Paint(reinterpret_cast<HDC>(wparam));
- return 0;
-}
-
-LRESULT ClientPlugin::OnEraseBackGround(UINT message, WPARAM wparam,
- LPARAM lparam, BOOL& handled)
-{
- HDC paint_device_context = reinterpret_cast<HDC>(wparam);
- RECT erase_rect;
- GetClipBox(paint_device_context, &erase_rect);
- HBRUSH brush = CreateSolidBrush(RGB(0, 255, 0));
- FillRect(paint_device_context, &erase_rect, brush);
- DeleteObject(brush);
- return 1;
-}
-
-LRESULT ClientPlugin::OnLButtonDown(UINT message, WPARAM wparam, LPARAM lparam,
- BOOL& handled)
-{
- MessageBox(L"You clicked on the client plugin!", L"Client Plugin", MB_OK);
- return 0;
-}
-
-void ClientPlugin::RefreshDisplay() {
- if (!IsWindow())
- return;
-
- InvalidateRect(NULL, TRUE);
- UpdateWindow();
-}
-
-void ClientPlugin::Paint(HDC hdc) {
- static LPCWSTR text = L"Left click in the green area for a message box!";
-
- RECT client_rect;
- GetClientRect(&client_rect);
-
- int old_mode = SetBkMode(hdc, TRANSPARENT);
- COLORREF old_color = SetTextColor(hdc, RGB(0, 0, 255));
-
- RECT text_rect = client_rect;
- DrawText(hdc, text, -1, &text_rect, DT_CENTER | DT_CALCRECT);
-
- client_rect.top = ((client_rect.bottom - client_rect.top)
- - (text_rect.bottom - text_rect.top)) / 2;
- DrawText(hdc, text, -1, &client_rect, DT_CENTER);
-
- SetBkMode(hdc, old_mode);
- SetTextColor(hdc, old_color);
-}
-
-#endif // OS_WIN
Oops, something went wrong.

0 comments on commit d368bd4

Please sign in to comment.