Browse Source

AtomicWebView compile delta

Josh Engebretson 9 years ago
parent
commit
22bbd58041

+ 6 - 0
Source/Atomic/IO/Log.h

@@ -108,6 +108,12 @@ public:
     /// Write raw output to the log.
     static void WriteRaw(const String& message, bool error = false);
 
+    // ATOMIC BEGIN
+
+    const File* GetLogFile() const { return logFile_; }
+
+    // ATOMIC END
+
 private:
     /// Handle end of frame. Process the threaded log messages.
     void HandleEndFrame(StringHash eventType, VariantMap& eventData);

+ 3 - 3
Source/AtomicWebView/UIWebView.cpp

@@ -177,9 +177,9 @@ UIWebView::UIWebView(Context* context, const String &initialURL) : UIWidget(cont
 
     initialURL_ = initialURL;
 
-    SubscribeToEvent(E_KEYDOWN, HANDLER(UIWebView, HandleKeyDown));
-    SubscribeToEvent(E_KEYUP, HANDLER(UIWebView, HandleKeyUp));
-    SubscribeToEvent(E_TEXTINPUT, HANDLER(UIWebView, HandleTextInput));
+    SubscribeToEvent(E_KEYDOWN, ATOMIC_HANDLER(UIWebView, HandleKeyDown));
+    SubscribeToEvent(E_KEYUP, ATOMIC_HANDLER(UIWebView, HandleKeyUp));
+    SubscribeToEvent(E_TEXTINPUT, ATOMIC_HANDLER(UIWebView, HandleTextInput));
 }
 
 UIWebView::~UIWebView()

+ 1 - 1
Source/AtomicWebView/UIWebView.h

@@ -40,7 +40,7 @@ class UIWebView : public UIWidget
 {
     friend class WebViewWidget;
 
-    OBJECT(UIWebView)
+    ATOMIC_OBJECT(UIWebView, UIWidget)
 
 public:
 

+ 2 - 2
Source/AtomicWebView/WebBrowserHost.cpp

@@ -212,7 +212,7 @@ WebBrowserHost::WebBrowserHost(Context* context) : Object (context)
     // before initializing graphics subsystem
     if (!CefInitialize(args, settings, d_->app_, nullptr))
     {
-        LOGERROR("CefInitialize - Error");
+        ATOMIC_LOGERROR("CefInitialize - Error");
     }
 
     RegisterWebSchemeHandlers(this);
@@ -220,7 +220,7 @@ WebBrowserHost::WebBrowserHost(Context* context) : Object (context)
     // Ensure cookie manager is created
     CefCookieManager::GetGlobalManager(nullptr);
 
-    SubscribeToEvent(E_UPDATE, HANDLER(WebBrowserHost, HandleUpdate));
+    SubscribeToEvent(E_UPDATE, ATOMIC_HANDLER(WebBrowserHost, HandleUpdate));
 
     instance_ = this;
 

+ 1 - 1
Source/AtomicWebView/WebBrowserHost.h

@@ -35,7 +35,7 @@ typedef HashMap<String, HashMap<String, Variant>> GlobalPropertyMap;
 /// Browser host subsystem, responsible for initializing CEF
 class ATOMIC_API WebBrowserHost : public Object
 {
-    OBJECT(WebBrowserHost);
+    ATOMIC_OBJECT(WebBrowserHost, Object);
 
 public:
     /// Construct.

+ 8 - 8
Source/AtomicWebView/WebClient.cpp

@@ -320,7 +320,7 @@ public:
         String _source;
         ConvertCEFString(source, _source);
 
-        LOGINFOF("WebViewJS: %s (%s:%i)", _message.CString(), _source.CString(), line);
+        ATOMIC_LOGINFOF("WebViewJS: %s (%s:%i)", _message.CString(), _source.CString(), line);
 
         return false;
     }
@@ -329,13 +329,13 @@ public:
     {
         if (browser_.get())
         {
-            LOGERROR("WebClient::CreateBrowser - Browser already created");
+            ATOMIC_LOGERROR("WebClient::CreateBrowser - Browser already created");
             return false;
         }
 
         if (webClient_->renderHandler_.Null())
         {
-            LOGERROR("WebClient::CreateBrowser - No render handler specified");
+            ATOMIC_LOGERROR("WebClient::CreateBrowser - No render handler specified");
             return false;
         }
 
@@ -519,7 +519,7 @@ WebClient::WebClient(Context* context) : Object(context)
     d_ = new WebClientPrivate(this);
     d_->AddRef();
 
-    SubscribeToEvent(E_WEBVIEWGLOBALPROPERTIESCHANGED, HANDLER(WebClient, HandleWebViewGlobalPropertiesChanged));
+    SubscribeToEvent(E_WEBVIEWGLOBALPROPERTIESCHANGED, ATOMIC_HANDLER(WebClient, HandleWebViewGlobalPropertiesChanged));
 }
 
 WebClient::~WebClient()
@@ -771,13 +771,13 @@ void WebClient::AddMessageHandler(WebMessageHandler* handler, bool first)
 
     if (handler->GetWebClient())
     {
-        LOGWARNING("WebClient::AddMessageHandler - message handler already added to another client");
+        ATOMIC_LOGWARNING("WebClient::AddMessageHandler - message handler already added to another client");
         return;
     }
 
     if (messageHandlers_.Contains(_handler))
     {
-        LOGWARNING("WebClient::AddMessageHandler - message handler already added to this client");
+        ATOMIC_LOGWARNING("WebClient::AddMessageHandler - message handler already added to this client");
         return;
     }
 
@@ -796,7 +796,7 @@ void WebClient::RemoveMessageHandler(WebMessageHandler* handler)
 
     if (itr == messageHandlers_.End())
     {
-        LOGWARNING("WebClient::RemoveMessageHandler - message handler not found");
+        ATOMIC_LOGWARNING("WebClient::RemoveMessageHandler - message handler not found");
         return;
     }
 
@@ -968,7 +968,7 @@ void WebClient::UpdateGlobalProperties()
     // Send the process message to the render process.
     if (!d_->browser_->SendProcessMessage(PID_RENDERER, msg))
     {
-        LOGERROR("WebClient::UpdateGlobalProperties - Failed to send message");
+        ATOMIC_LOGERROR("WebClient::UpdateGlobalProperties - Failed to send message");
     }
 
 }

+ 1 - 1
Source/AtomicWebView/WebClient.h

@@ -40,7 +40,7 @@ class ATOMIC_API WebClient : public Object
     friend class WebBrowserHost;
     friend class WebClientPrivate;
 
-    OBJECT(WebClient)
+    ATOMIC_OBJECT(WebClient, Object)
 
 public:
 

+ 6 - 2
Source/AtomicWebView/WebKeyboard.h

@@ -54,7 +54,9 @@ struct WebKeyEvent
             repeat = eventData[KeyDown::P_REPEAT].GetBool();
             key = eventData[KeyDown::P_KEY].GetInt();
             scanCode = eventData[KeyDown::P_SCANCODE].GetInt();
-            raw = eventData[KeyDown::P_RAW].GetUInt();
+// ATOMIC_UPDATE_FIX_BEGIN
+            //raw = eventData[KeyDown::P_RAW].GetUInt();
+// ATOMIC_UPDATE_FIX_END
             buttons = eventData[KeyDown::P_BUTTONS].GetInt();
             qual = eventData[KeyDown::P_QUALIFIERS].GetInt();
         }
@@ -63,7 +65,9 @@ struct WebKeyEvent
             keyDown = false;
             key = eventData[KeyUp::P_KEY].GetInt();
             scanCode = eventData[KeyUp::P_SCANCODE].GetInt();
-            raw = eventData[KeyUp::P_RAW].GetUInt();
+// ATOMIC_UPDATE_FIX_BEGIN
+//            raw = eventData[KeyUp::P_RAW].GetUInt();
+// ATOMIC_UPDATE_FIX_END
             buttons = eventData[KeyUp::P_BUTTONS].GetInt();
             qual = eventData[KeyUp::P_QUALIFIERS].GetInt();
         }

+ 2 - 2
Source/AtomicWebView/WebKeyboardMac.cpp

@@ -68,7 +68,7 @@ bool ConvertKeyEvent(Input* input, const StringHash eventType, VariantMap& event
 {
     if (eventType != "KeyDown" && eventType != "KeyUp")
     {
-        LOGERROR("ConvertKeyEvent - Unknown event type");
+        ATOMIC_LOGERROR("ConvertKeyEvent - Unknown event type");
         return false;
     }
 
@@ -123,7 +123,7 @@ bool ConvertTextInputEvent(StringHash eventType, VariantMap& eventData, CefKeyEv
 {
     if (eventType != "TextInput")
     {
-        LOGERROR("ConvertTextInputEvent - Unknown event type");
+        ATOMIC_LOGERROR("ConvertTextInputEvent - Unknown event type");
         return false;
     }
 

+ 4 - 4
Source/AtomicWebView/WebMessageHandler.cpp

@@ -45,7 +45,7 @@ public:
     {
         if (!currentCallback_)
         {
-            LOGERROR("WebMessageHandlerPrivate::Success - Called with no current callback");
+            ATOMIC_LOGERROR("WebMessageHandlerPrivate::Success - Called with no current callback");
             return;
         }
 
@@ -58,7 +58,7 @@ public:
     {
         if (!currentCallback_)
         {
-            LOGERROR("WebMessageHandlerPrivate::Failure - Called with no current callback");
+            ATOMIC_LOGERROR("WebMessageHandlerPrivate::Failure - Called with no current callback");
             return;
         }
 
@@ -105,7 +105,7 @@ public:
             if (!queryHandled_)
             {
                 currentCallback_ = nullptr;
-                LOGERROR("WebMessageHandlerPrivate::OnQuery - WebQuery was not handled");
+                ATOMIC_LOGERROR("WebMessageHandlerPrivate::OnQuery - WebQuery was not handled");
                 return false;
             }
         }
@@ -139,7 +139,7 @@ public:
 
         if (itr == deferredWebMessages_.End())
         {
-            LOGERRORF("WebMessageHandlerPrivate::HandleDeferredResponse - unable to find queryid: %d", queryID);
+            ATOMIC_LOGERRORF("WebMessageHandlerPrivate::HandleDeferredResponse - unable to find queryid: %d", queryID);
             return;
         }
 

+ 1 - 1
Source/AtomicWebView/WebMessageHandler.h

@@ -33,7 +33,7 @@ class WebMessageHandlerPrivate;
 class WebMessageHandler : public Object
 {
 
-    OBJECT(WebMessageHandler);
+    ATOMIC_OBJECT(WebMessageHandler, Object);
 
 public:
 

+ 1 - 1
Source/AtomicWebView/WebRenderHandler.h

@@ -36,7 +36,7 @@ class WebClient;
 /// Base class for various WebRenderHandlers
 class ATOMIC_API WebRenderHandler : public Object
 {
-    OBJECT(WebRenderHandler);
+    ATOMIC_OBJECT(WebRenderHandler, Object);
 
 public:
 

+ 3 - 3
Source/AtomicWebView/WebTexture2D.cpp

@@ -121,7 +121,7 @@ public:
 
         if (type == PET_VIEW)
         {
-            glBindTexture(GL_TEXTURE_2D, webTexture2D_->GetTexture2D()->GetGPUObject());
+            glBindTexture(GL_TEXTURE_2D, (GLuint) ((GPUObjectHandle*)webTexture2D_->GetTexture2D()->GetGPUObject())->name_);
 
             glPixelStorei(GL_UNPACK_ROW_LENGTH, width);
 
@@ -186,7 +186,7 @@ public:
                 h -= y + h - viewheight;
             }
 
-            glBindTexture(GL_TEXTURE_2D, webTexture2D_->GetTexture2D()->GetGPUObject());
+            glBindTexture(GL_TEXTURE_2D, (GLuint) ((GPUObjectHandle*)webTexture2D_->GetTexture2D()->GetGPUObject())->name_);
 
             // Update the popup rectangle.
             glPixelStorei(GL_UNPACK_ROW_LENGTH, width);
@@ -362,7 +362,7 @@ void WebTexture2D::SetSize(int width, int height)
     }
     else
     {
-        LOGERRORF("Unable to set WebTexture2D size to %i x %i", width, height);
+        ATOMIC_LOGERRORF("Unable to set WebTexture2D size to %i x %i", width, height);
     }
 
 }

+ 1 - 1
Source/AtomicWebView/WebTexture2D.h

@@ -38,7 +38,7 @@ class ATOMIC_API WebTexture2D : public WebRenderHandler
 {
     friend class WebTexture2DPrivate;
 
-    OBJECT(WebTexture2D)
+    ATOMIC_OBJECT(WebTexture2D, WebRenderHandler)
 
 public:
 

+ 34 - 34
Source/AtomicWebView/WebViewEvents.h

@@ -28,75 +28,75 @@ namespace Atomic
 {
 
 /// WebView load state change
-EVENT(E_WEBVIEWLOADSTATECHANGE, WebViewLoadStateChange)
+ATOMIC_EVENT(E_WEBVIEWLOADSTATECHANGE, WebViewLoadStateChange)
 {
-    PARAM(P_CLIENT, Client);   // WebClient*
-    PARAM(P_LOADING, Loading);   // Boolean
-    PARAM(P_CANGOBACK, CanGoBack);   // Boolean
-    PARAM(P_CANGOFORWARD, CanGoForward);   // Boolean
+    ATOMIC_PARAM(P_CLIENT, Client);   // WebClient*
+    ATOMIC_PARAM(P_LOADING, Loading);   // Boolean
+    ATOMIC_PARAM(P_CANGOBACK, CanGoBack);   // Boolean
+    ATOMIC_PARAM(P_CANGOFORWARD, CanGoForward);   // Boolean
 }
 
 /// WebView load start
-EVENT(E_WEBVIEWLOADSTART, WebViewLoadStart)
+ATOMIC_EVENT(E_WEBVIEWLOADSTART, WebViewLoadStart)
 {
-    PARAM(P_CLIENT, Client);   // WebClient*
-    PARAM(P_URL, Url);   // String
+    ATOMIC_PARAM(P_CLIENT, Client);   // WebClient*
+    ATOMIC_PARAM(P_URL, Url);   // String
 }
 
 /// WebView load end
-EVENT(E_WEBVIEWLOADEND, WebViewLoadEnd)
+ATOMIC_EVENT(E_WEBVIEWLOADEND, WebViewLoadEnd)
 {
-    PARAM(P_CLIENT, Client);   // WebClient*
-    PARAM(P_URL, Url);   // String
+    ATOMIC_PARAM(P_CLIENT, Client);   // WebClient*
+    ATOMIC_PARAM(P_URL, Url);   // String
 }
 
 /// WebView address change
-EVENT(E_WEBVIEWADDRESSCHANGE, WebViewAddressChange)
+ATOMIC_EVENT(E_WEBVIEWADDRESSCHANGE, WebViewAddressChange)
 {
-    PARAM(P_CLIENT, Client);   // WebClient*
-    PARAM(P_URL, Url);   // String
+    ATOMIC_PARAM(P_CLIENT, Client);   // WebClient*
+    ATOMIC_PARAM(P_URL, Url);   // String
 }
 
 /// WebView title change
-EVENT(E_WEBVIEWTITLECHANGE, WebViewTitleChange)
+ATOMIC_EVENT(E_WEBVIEWTITLECHANGE, WebViewTitleChange)
 {
-    PARAM(P_CLIENT, Client);   // WebClient*
-    PARAM(P_TITLE, Title);   // String
+    ATOMIC_PARAM(P_CLIENT, Client);   // WebClient*
+    ATOMIC_PARAM(P_TITLE, Title);   // String
 }
 
 /// WebView title change
-EVENT(E_WEBVIEWJSEVALRESULT, WebViewJSEvalResult)
+ATOMIC_EVENT(E_WEBVIEWJSEVALRESULT, WebViewJSEvalResult)
 {
-    PARAM(P_CLIENT, Client);   // WebClient*
-    PARAM(P_EVALID, EvalID);   // unsigned
-    PARAM(P_RESULT, Result);   // boolean (true: success, false: error)
-    PARAM(P_VALUE, Value);   // String (sucess: eval's value, error: exception message)
+    ATOMIC_PARAM(P_CLIENT, Client);   // WebClient*
+    ATOMIC_PARAM(P_EVALID, EvalID);   // unsigned
+    ATOMIC_PARAM(P_RESULT, Result);   // boolean (true: success, false: error)
+    ATOMIC_PARAM(P_VALUE, Value);   // String (sucess: eval's value, error: exception message)
 }
 
 /// WebView popup request
-EVENT(E_WEBVIEWPOPUPREQUEST, WebViewPopupRequest)
+ATOMIC_EVENT(E_WEBVIEWPOPUPREQUEST, WebViewPopupRequest)
 {
-    PARAM(P_CLIENT, Client);   // WebClient*
-    PARAM(P_URL, Url);   // String
+    ATOMIC_PARAM(P_CLIENT, Client);   // WebClient*
+    ATOMIC_PARAM(P_URL, Url);   // String
 }
 
 /// WebView load state change
-EVENT(E_WEBVIEWGLOBALPROPERTIESCHANGED, WebViewGlobalPropertiesChanged)
+ATOMIC_EVENT(E_WEBVIEWGLOBALPROPERTIESCHANGED, WebViewGlobalPropertiesChanged)
 {
 }
 
 /// WebView title change
-EVENT(E_WEBMESSAGE, WebMessage)
+ATOMIC_EVENT(E_WEBMESSAGE, WebMessage)
 {
-    PARAM(P_HANDLER, Handler);          // WebMessageHandler*
-    PARAM(P_QUERYID, QueryID);          // Double (Int64 CEF Side)
-    PARAM(P_REQUEST, Request);          // String
-    PARAM(P_PERSISTENT, Persistent);    // Bool
+    ATOMIC_PARAM(P_HANDLER, Handler);          // WebMessageHandler*
+    ATOMIC_PARAM(P_QUERYID, QueryID);          // Double (Int64 CEF Side)
+    ATOMIC_PARAM(P_REQUEST, Request);          // String
+    ATOMIC_PARAM(P_PERSISTENT, Persistent);    // Bool
 
-    PARAM(P_CEFBROWSER, Browser);       // CefBrowser*
-    PARAM(P_CEFFRAME, Frame);           // CefFrame*
+    ATOMIC_PARAM(P_CEFBROWSER, Browser);       // CefBrowser*
+    ATOMIC_PARAM(P_CEFFRAME, Frame);           // CefFrame*
 
-    PARAM(P_DEFERRED, Deferred);        // Return Value: Bool
+    ATOMIC_PARAM(P_DEFERRED, Deferred);        // Return Value: Bool
 }