Browse Source

Linux WebView work

JoshEngebretson 10 years ago
parent
commit
ad31070f53

+ 8 - 0
Build/CMake/Modules/AtomicWebView.cmake

@@ -45,6 +45,14 @@ if(OS_WINDOWS)
     set(CEF_RESOURCE_DIR "${CMAKE_SOURCE_DIR}/Submodules/CEF/Windows/64bit/Resources")
 endif()
 
+if(OS_LINUX)
+    set(CEF_BINARY_DIR_RELEASE "${CMAKE_SOURCE_DIR}/Submodules/CEF/Linux/Release")
+    set(CEF_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/libcef.so")
+    set(CEF_BINARY_DIR "${CMAKE_SOURCE_DIR}/Submodules/CEF/Linux/Release")
+    set(CEF_RESOURCE_DIR "${CMAKE_SOURCE_DIR}/Submodules/CEF/Linux/Resources")
+endif()
+
+
 #
 # Shared macros.
 #

+ 4 - 1
CMakeLists.txt

@@ -74,9 +74,12 @@ if (ATOMIC_WEBVIEW)
   if(APPLE)
     include_directories (${CMAKE_SOURCE_DIR}/Submodules/CEF/MacOSX/)
     add_subdirectory(Submodules/CEF/MacOSX/libcef_dll)
-  else()
+  elseif(MSVC)
     include_directories (${CMAKE_SOURCE_DIR}/Submodules/CEF/Windows/64bit)
     add_subdirectory(Submodules/CEF/Windows/64bit/libcef_dll)
+  else()
+    include_directories (${CMAKE_SOURCE_DIR}/Submodules/CEF/Linux)
+    add_subdirectory(Submodules/CEF/Linux/libcef_dll)
   endif()
 endif()
 

+ 1 - 1
Script/Packages/WebView/Package.json

@@ -4,5 +4,5 @@
   "namespace" : "Atomic",
   "dependencies" : ["Script/Packages/Atomic"],
   "modules" : ["WebView"],
-  "platforms" : ["WINDOWS", "MACOSX"]
+  "platforms" : ["WINDOWS", "MACOSX", "LINUX"]
 }

+ 4 - 0
Source/AtomicEditor/CMakeLists.txt

@@ -58,6 +58,10 @@ if (OS_WINDOWS)
     target_link_libraries(AtomicEditor AtomicWebView libcef_dll_wrapper "${CEF_LIB_RELEASE}")
 endif()
 
+if (OS_LINUX)
+    target_link_libraries(AtomicEditor AtomicWebView libcef_dll_wrapper "${CEF_LIB_RELEASE}")
+endif()
+
 if(OS_MACOSX)
 
   # Logical target used to link the libcef library.

+ 3 - 3
Source/AtomicWebView/WebClient.cpp

@@ -1,7 +1,4 @@
 
-#include <SDL/include/SDL.h>
-#include <ThirdParty/SDL/include/SDL_syswm.h>
-
 #include <include/cef_app.h>
 #include <include/cef_client.h>
 #include <include/cef_browser.h>
@@ -24,6 +21,9 @@
 #include "WebViewEvents.h"
 #include "WebString.h"
 
+#include <SDL/include/SDL.h>
+#include <ThirdParty/SDL/include/SDL_syswm.h>
+
 namespace Atomic
 {
 

+ 28 - 0
Source/AtomicWebView/WebKeyboardLinux.cpp

@@ -0,0 +1,28 @@
+
+#ifdef ATOMIC_PLATFORM_LINUX
+
+#include <include/cef_client.h>
+
+#include <Atomic/Core/Variant.h>
+#include <Atomic/Input/InputEvents.h>
+#include <Atomic/Input/Input.h>
+#include <Atomic/IO/Log.h>
+
+#include "WebKeyboard.h"
+
+namespace Atomic
+{
+
+bool ConvertKeyEvent(Input* input, const StringHash eventType, VariantMap& eventData, CefKeyEvent& keyEvent)
+{
+    return false;
+}
+
+bool ConvertTextInputEvent(StringHash eventType, VariantMap& eventData, CefKeyEvent& keyEvent)
+{
+    return false;
+}
+
+}
+
+#endif

+ 1 - 1
Source/AtomicWebView/WebTexture2D.cpp

@@ -91,7 +91,7 @@ public:
         return true;
     }
 
-#ifdef ATOMIC_PLATFORM_OSX
+#ifndef ATOMIC_PLATFORM_WINDOWS
 
     void OnPaint(CefRefPtr<CefBrowser> browser, PaintElementType type, const RectList &dirtyRects,
                  const void *buffer, int width, int height) OVERRIDE