Title: [133643] trunk/Source/WebKit2
Revision
133643
Author
[email protected]
Date
2012-11-06 11:08:35 -0800 (Tue, 06 Nov 2012)

Log Message

[EFL][WK2] Declare all smart callbacks in EwkViewCallbacks.h
https://bugs.webkit.org/show_bug.cgi?id=101360

Patch by Christophe Dumez <[email protected]> on 2012-11-06
Reviewed by Kenneth Rohde Christiansen.

Declare all EwkView smart callbacks in EwkViewCallbacks.h
and remove remaining calls to evas_object_smart_callback_call().
It is a good idea to have all the callbacks declared in one
place for convenience and consistency. We also have better
argument type checking if we use the new callback mechanism.

* UIProcess/API/efl/EwkViewCallbacks.h:
(EwkViewCallbacks::CallBack::call):
(CallBack):
(EwkViewCallbacks):
* UIProcess/API/efl/EwkViewImpl.cpp:
(EwkViewImpl::informIconChange):
(EwkViewImpl::informURLChange):
(EwkViewImpl::createNewPage):
(EwkViewImpl::closePage):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (133642 => 133643)


--- trunk/Source/WebKit2/ChangeLog	2012-11-06 19:04:26 UTC (rev 133642)
+++ trunk/Source/WebKit2/ChangeLog	2012-11-06 19:08:35 UTC (rev 133643)
@@ -1,3 +1,26 @@
+2012-11-06  Christophe Dumez  <[email protected]>
+
+        [EFL][WK2] Declare all smart callbacks in EwkViewCallbacks.h
+        https://bugs.webkit.org/show_bug.cgi?id=101360
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Declare all EwkView smart callbacks in EwkViewCallbacks.h
+        and remove remaining calls to evas_object_smart_callback_call().
+        It is a good idea to have all the callbacks declared in one
+        place for convenience and consistency. We also have better
+        argument type checking if we use the new callback mechanism.
+
+        * UIProcess/API/efl/EwkViewCallbacks.h:
+        (EwkViewCallbacks::CallBack::call):
+        (CallBack):
+        (EwkViewCallbacks):
+        * UIProcess/API/efl/EwkViewImpl.cpp:
+        (EwkViewImpl::informIconChange):
+        (EwkViewImpl::informURLChange):
+        (EwkViewImpl::createNewPage):
+        (EwkViewImpl::closePage):
+
 2012-11-05  Anders Carlsson  <[email protected]>
 
         Hook up the remote layer tree drawing area to an environment variable

Modified: trunk/Source/WebKit2/UIProcess/API/efl/EwkViewCallbacks.h (133642 => 133643)


--- trunk/Source/WebKit2/UIProcess/API/efl/EwkViewCallbacks.h	2012-11-06 19:04:26 UTC (rev 133642)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EwkViewCallbacks.h	2012-11-06 19:08:35 UTC (rev 133643)
@@ -26,6 +26,7 @@
 #ifndef EwkViewCallbacks_h
 #define EwkViewCallbacks_h
 
+#include "WKEinaSharedString.h"
 #include "ewk_private.h"
 #include <Evas.h>
 #include <wtf/text/CString.h>
@@ -54,12 +55,15 @@
 enum CallbackType {
     AuthenticationRequest,
     BackForwardListChange,
+    CloseWindow,
+    CreateWindow,
     DownloadJobCancelled,
     DownloadJobFailed,
     DownloadJobFinished,
     DownloadJobRequested,
     FileChooserRequest,
     NewFormSubmissionRequest,
+    IconChanged,
     LoadError,
     LoadFinished,
     LoadProgress,
@@ -77,6 +81,7 @@
     TitleChange,
     TooltipTextUnset,
     TooltipTextSet,
+    URLChanged,
     WebProcessCrashed,
 #if ENABLE(WEB_INTENTS)
     IntentRequest,
@@ -136,6 +141,11 @@
         call(const_cast<char*>(arg.utf8().data()));
     }
 
+    void call(const WKEinaSharedString& arg)
+    {
+        call(const_cast<char*>(static_cast<const char*>(arg)));
+    }
+
 private:
     Evas_Object* m_view;
 };
@@ -150,12 +160,15 @@
 // Note: type 'void' means that no arguments are expected.
 DECLARE_EWK_VIEW_CALLBACK(AuthenticationRequest, "authentication,request", Ewk_Auth_Request);
 DECLARE_EWK_VIEW_CALLBACK(BackForwardListChange, "back,forward,list,changed", void);
+DECLARE_EWK_VIEW_CALLBACK(CloseWindow, "close,window", void);
+DECLARE_EWK_VIEW_CALLBACK(CreateWindow, "create,window", Evas_Object*);
 DECLARE_EWK_VIEW_CALLBACK(DownloadJobCancelled, "download,cancelled", Ewk_Download_Job);
 DECLARE_EWK_VIEW_CALLBACK(DownloadJobFailed, "download,failed", Ewk_Download_Job_Error);
 DECLARE_EWK_VIEW_CALLBACK(DownloadJobFinished, "download,finished", Ewk_Download_Job);
 DECLARE_EWK_VIEW_CALLBACK(DownloadJobRequested, "download,request", Ewk_Download_Job);
 DECLARE_EWK_VIEW_CALLBACK(FileChooserRequest, "file,chooser,request", Ewk_File_Chooser_Request);
 DECLARE_EWK_VIEW_CALLBACK(NewFormSubmissionRequest, "form,submission,request", Ewk_Form_Submission_Request);
+DECLARE_EWK_VIEW_CALLBACK(IconChanged, "icon,changed", void);
 DECLARE_EWK_VIEW_CALLBACK(LoadError, "load,error", Ewk_Error);
 DECLARE_EWK_VIEW_CALLBACK(LoadFinished, "load,finished", void);
 DECLARE_EWK_VIEW_CALLBACK(LoadProgress, "load,progress", double);
@@ -173,6 +186,7 @@
 DECLARE_EWK_VIEW_CALLBACK(TitleChange, "title,changed", char);
 DECLARE_EWK_VIEW_CALLBACK(TooltipTextUnset, "tooltip,text,unset", void);
 DECLARE_EWK_VIEW_CALLBACK(TooltipTextSet, "tooltip,text,set", char);
+DECLARE_EWK_VIEW_CALLBACK(URLChanged, "url,changed", char);
 DECLARE_EWK_VIEW_CALLBACK(WebProcessCrashed, "webprocess,crashed", bool);
 #if ENABLE(WEB_INTENTS)
 DECLARE_EWK_VIEW_CALLBACK(IntentRequest, "intent,request,new", Ewk_Intent);

Modified: trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp (133642 => 133643)


--- trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp	2012-11-06 19:04:26 UTC (rev 133642)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp	2012-11-06 19:08:35 UTC (rev 133643)
@@ -64,6 +64,7 @@
 #include <Evas_GL.h>
 #endif
 
+using namespace EwkViewCallbacks;
 using namespace WebCore;
 using namespace WebKit;
 
@@ -495,7 +496,7 @@
     ASSERT(iconDatabase);
 
     m_faviconURL = ewk_favicon_database_icon_url_get(iconDatabase, m_url);
-    evas_object_smart_callback_call(m_view, "icon,changed", 0);
+    smartCallback<IconChanged>().call();
 }
 
 #if USE(ACCELERATED_COMPOSITING)
@@ -726,8 +727,7 @@
         return;
 
     m_url = rawActiveURL.data();
-    const char* callbackArgument = static_cast<const char*>(m_url);
-    evas_object_smart_callback_call(m_view, "url,changed", const_cast<char*>(callbackArgument));
+    smartCallback<URLChanged>().call(m_url);
 
     // Update the view's favicon.
     informIconChange();
@@ -736,7 +736,7 @@
 WKPageRef EwkViewImpl::createNewPage()
 {
     Evas_Object* newEwkView = 0;
-    evas_object_smart_callback_call(m_view, "create,window", &newEwkView);
+    smartCallback<CreateWindow>().call(&newEwkView);
 
     if (!newEwkView)
         return 0;
@@ -749,7 +749,7 @@
 
 void EwkViewImpl::closePage()
 {
-    evas_object_smart_callback_call(m_view, "close,window", 0);
+    smartCallback<CloseWindow>().call();
 }
 
 void EwkViewImpl::onMouseDown(void* data, Evas*, Evas_Object*, void* eventInfo)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to