diff options
Diffstat (limited to 'Source/WebKit2/UIProcess/API')
81 files changed, 721 insertions, 729 deletions
diff --git a/Source/WebKit2/UIProcess/API/efl/VibrationProvider.cpp b/Source/WebKit2/UIProcess/API/efl/VibrationProvider.cpp index 13d4de6d6..9d8feb1fe 100644 --- a/Source/WebKit2/UIProcess/API/efl/VibrationProvider.cpp +++ b/Source/WebKit2/UIProcess/API/efl/VibrationProvider.cpp @@ -36,15 +36,15 @@ using namespace WebCore; /** - * \struct _Ewk_Vibration_Client + * \struct Ewk_Vibration_Client * @brief Contains the vibration client callbacks. */ -struct _Ewk_Vibration_Client { +struct Ewk_Vibration_Client { Ewk_Vibration_Client_Vibrate_Cb vibrate; Ewk_Vibration_Client_Vibration_Cancel_Cb cancelVibration; void* userData; - _Ewk_Vibration_Client(Ewk_Vibration_Client_Vibrate_Cb vibrate, Ewk_Vibration_Client_Vibration_Cancel_Cb cancelVibration, void* userData) + Ewk_Vibration_Client(Ewk_Vibration_Client_Vibrate_Cb vibrate, Ewk_Vibration_Client_Vibration_Cancel_Cb cancelVibration, void* userData) : vibrate(vibrate) , cancelVibration(cancelVibration) , userData(userData) diff --git a/Source/WebKit2/UIProcess/API/efl/VibrationProvider.h b/Source/WebKit2/UIProcess/API/efl/VibrationProvider.h index 6b2db4eec..fadd58a1b 100644 --- a/Source/WebKit2/UIProcess/API/efl/VibrationProvider.h +++ b/Source/WebKit2/UIProcess/API/efl/VibrationProvider.h @@ -33,7 +33,7 @@ #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> -typedef struct _Ewk_Vibration_Client Ewk_Vibration_Client; +typedef struct Ewk_Vibration_Client Ewk_Vibration_Client; class VibrationProvider : public RefCounted<VibrationProvider> { public: diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list.h b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list.h index c58476140..09dbc5ab6 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list.h @@ -37,8 +37,8 @@ extern "C" { #endif -/** Creates a type name for _Ewk_Back_Forward_List */ -typedef struct _Ewk_Back_Forward_List Ewk_Back_Forward_List; +/** Creates a type name for Ewk_Back_Forward_List */ +typedef struct Ewk_Back_Forward_List Ewk_Back_Forward_List; /** * Returns the current item in the @a list. diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.h b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.h index 3c544f3ef..8d0724d4a 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item.h @@ -37,8 +37,8 @@ extern "C" { #endif -/** Creates a type name for _Ewk_Back_Forward_List_Item */ -typedef struct _Ewk_Back_Forward_List_Item Ewk_Back_Forward_List_Item; +/** Creates a type name for Ewk_Back_Forward_List_Item */ +typedef struct Ewk_Back_Forward_List_Item Ewk_Back_Forward_List_Item; /** * Increases the reference count of the given object. diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item_private.h index 254074ab5..a300a305e 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item_private.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_item_private.h @@ -32,27 +32,25 @@ #include <wtf/RefCounted.h> /** - * \struct _Ewk_Back_Forward_List + * \struct Ewk_Back_Forward_List * @brief Contains the Back Forward List data. */ -class _Ewk_Back_Forward_List_Item : public RefCounted<_Ewk_Back_Forward_List_Item> { +class Ewk_Back_Forward_List_Item : public RefCounted<Ewk_Back_Forward_List_Item> { public: WKRetainPtr<WKBackForwardListItemRef> wkItem; mutable WKEinaSharedString url; mutable WKEinaSharedString title; mutable WKEinaSharedString originalURL; - static PassRefPtr<_Ewk_Back_Forward_List_Item> create(WKBackForwardListItemRef itemRef) + static PassRefPtr<Ewk_Back_Forward_List_Item> create(WKBackForwardListItemRef itemRef) { - return adoptRef(new _Ewk_Back_Forward_List_Item(itemRef)); + return adoptRef(new Ewk_Back_Forward_List_Item(itemRef)); } private: - explicit _Ewk_Back_Forward_List_Item(WKBackForwardListItemRef itemRef) + explicit Ewk_Back_Forward_List_Item(WKBackForwardListItemRef itemRef) : wkItem(itemRef) { } }; -typedef struct _Ewk_Back_Forward_List_Item Ewk_Back_Forward_List_Item; - #endif // ewk_back_forward_list_private_h diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_private.h index 26b050d82..fcf25f6cc 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_private.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_back_forward_list_private.h @@ -32,22 +32,20 @@ #include <wtf/HashMap.h> #include <wtf/PassOwnPtr.h> -typedef struct _Ewk_Back_Forward_List Ewk_Back_Forward_List; - typedef HashMap<WKBackForwardListItemRef, RefPtr<Ewk_Back_Forward_List_Item> > ItemsMap; -class _Ewk_Back_Forward_List { +class Ewk_Back_Forward_List { public: WKRetainPtr<WKBackForwardListRef> wkList; mutable ItemsMap wrapperCache; - static PassOwnPtr<_Ewk_Back_Forward_List> create(WKBackForwardListRef listRef) + static PassOwnPtr<Ewk_Back_Forward_List> create(WKBackForwardListRef listRef) { - return adoptPtr(new _Ewk_Back_Forward_List(listRef)); + return adoptPtr(new Ewk_Back_Forward_List(listRef)); } private: - explicit _Ewk_Back_Forward_List(WKBackForwardListRef listRef) + explicit Ewk_Back_Forward_List(WKBackForwardListRef listRef) : wkList(listRef) { } }; diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp index 6338eac82..b7617dab2 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp @@ -30,6 +30,7 @@ #include "WKRetainPtr.h" #include "WKString.h" #include "WebContext.h" +#include "WebIconDatabase.h" #include "ewk_context_download_client_private.h" #include "ewk_context_history_client_private.h" #include "ewk_context_private.h" @@ -52,24 +53,24 @@ using namespace WebCore; using namespace WebKit; -struct _Ewk_Url_Scheme_Handler { +struct Ewk_Url_Scheme_Handler { Ewk_Url_Scheme_Request_Cb callback; void* userData; - _Ewk_Url_Scheme_Handler() + Ewk_Url_Scheme_Handler() : callback(0) , userData(0) { } - _Ewk_Url_Scheme_Handler(Ewk_Url_Scheme_Request_Cb callback, void* userData) + Ewk_Url_Scheme_Handler(Ewk_Url_Scheme_Request_Cb callback, void* userData) : callback(callback) , userData(userData) { } }; -typedef HashMap<String, _Ewk_Url_Scheme_Handler> URLSchemeHandlerMap; +typedef HashMap<String, Ewk_Url_Scheme_Handler> URLSchemeHandlerMap; -struct _Ewk_Context { +struct Ewk_Context { unsigned __ref; /**< the reference count of the object */ WKRetainPtr<WKContextRef> context; @@ -91,7 +92,7 @@ struct _Ewk_Context { Ewk_Context_History_Client historyClient; - _Ewk_Context(WKRetainPtr<WKContextRef> contextRef) + Ewk_Context(WKRetainPtr<WKContextRef> contextRef) : __ref(1) , context(contextRef) , requestManager(WKContextGetSoupRequestManager(contextRef.get())) @@ -166,12 +167,14 @@ Ewk_Favicon_Database* ewk_context_favicon_database_get(const Ewk_Context* ewkCon EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0); if (!ewkContext->faviconDatabase) { - // Set database path. - WebContext* webContext = toImpl(ewkContext->context.get()); - String databasePath = webContext->iconDatabasePath() + "/" + WebCore::IconDatabase::defaultDatabaseFilename(); - webContext->setIconDatabasePath(databasePath); - - const_cast<Ewk_Context*>(ewkContext)->faviconDatabase = Ewk_Favicon_Database::create(WKContextGetIconDatabase(ewkContext->context.get())); + WKRetainPtr<WKIconDatabaseRef> iconDatabase = WKContextGetIconDatabase(ewkContext->context.get()); + // Set the database path if it is not open yet. + if (!toImpl(iconDatabase.get())->isOpen()) { + WebContext* webContext = toImpl(ewkContext->context.get()); + String databasePath = webContext->iconDatabasePath() + "/" + WebCore::IconDatabase::defaultDatabaseFilename(); + webContext->setIconDatabasePath(databasePath); + } + const_cast<Ewk_Context*>(ewkContext)->faviconDatabase = Ewk_Favicon_Database::create(iconDatabase.get()); } return ewkContext->faviconDatabase.get(); @@ -254,7 +257,7 @@ void ewk_context_url_scheme_request_received(Ewk_Context* ewkContext, Ewk_Url_Sc EINA_SAFETY_ON_NULL_RETURN(ewkContext); EINA_SAFETY_ON_NULL_RETURN(schemeRequest); - _Ewk_Url_Scheme_Handler handler = ewkContext->urlSchemeHandlers.get(ewk_url_scheme_request_scheme_get(schemeRequest)); + Ewk_Url_Scheme_Handler handler = ewkContext->urlSchemeHandlers.get(ewk_url_scheme_request_scheme_get(schemeRequest)); if (!handler.callback) return; @@ -290,7 +293,7 @@ Eina_Bool ewk_context_url_scheme_register(Ewk_Context* ewkContext, const char* s EINA_SAFETY_ON_NULL_RETURN_VAL(scheme, false); EINA_SAFETY_ON_NULL_RETURN_VAL(callback, false); - ewkContext->urlSchemeHandlers.set(String::fromUTF8(scheme), _Ewk_Url_Scheme_Handler(callback, userData)); + ewkContext->urlSchemeHandlers.set(String::fromUTF8(scheme), Ewk_Url_Scheme_Handler(callback, userData)); WKRetainPtr<WKStringRef> wkScheme(AdoptWK, WKStringCreateWithUTF8CString(scheme)); WKSoupRequestManagerRegisterURIScheme(ewkContext->requestManager.get(), wkScheme.get()); diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_context.h b/Source/WebKit2/UIProcess/API/efl/ewk_context.h index 0cb413363..f6b8bb67d 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_context.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_context.h @@ -47,15 +47,15 @@ extern "C" { #endif -/** Creates a type name for @a _Ewk_Context. */ -typedef struct _Ewk_Context Ewk_Context; +/** Creates a type name for @a Ewk_Context. */ +typedef struct Ewk_Context Ewk_Context; /** - * \enum _Ewk_Cache_Model + * \enum Ewk_Cache_Model * * @brief Contains option for cache model */ -enum _Ewk_Cache_Model { +enum Ewk_Cache_Model { /// Use the smallest cache capacity. EWK_CACHE_MODEL_DOCUMENT_VIEWER, /// Use bigger cache capacity than EWK_CACHE_MODEL_DOCUMENT_VIEWER. @@ -64,8 +64,8 @@ enum _Ewk_Cache_Model { EWK_CACHE_MODEL_PRIMARY_WEBBROWSER }; -/// Creates a type name for the _Ewk_Cache_Model. -typedef enum _Ewk_Cache_Model Ewk_Cache_Model; +/// Creates a type name for the Ewk_Cache_Model. +typedef enum Ewk_Cache_Model Ewk_Cache_Model; /** * @typedef Ewk_Url_Scheme_Request_Cb Ewk_Url_Scheme_Request_Cb diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_context_download_client.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_context_download_client.cpp index 8822e6ae1..088bd6a79 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_context_download_client.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_context_download_client.cpp @@ -69,8 +69,7 @@ static void didReceiveResponse(WKContextRef, WKDownloadRef wkDownload, WKURLResp { Ewk_Download_Job* download = ewk_context_download_job_get(toEwkContext(clientInfo), toImpl(wkDownload)->downloadID()); ASSERT(download); - RefPtr<Ewk_Url_Response> response = Ewk_Url_Response::create(wkResponse); - ewk_download_job_response_set(download, response.get()); + ewk_download_job_response_set(download, Ewk_Url_Response::create(wkResponse)); } static void didCreateDestination(WKContextRef, WKDownloadRef wkDownload, WKStringRef /*path*/, const void* clientInfo) diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_context_download_client_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_context_download_client_private.h index f7017a863..e056aafe6 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_context_download_client_private.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_context_download_client_private.h @@ -26,7 +26,7 @@ #ifndef ewk_context_download_client_private_h #define ewk_context_download_client_private_h -typedef struct _Ewk_Context Ewk_Context; +typedef struct Ewk_Context Ewk_Context; void ewk_context_download_client_attach(Ewk_Context*); diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_context_history_client_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_context_history_client_private.h index d9518ced9..0b470dcaf 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_context_history_client_private.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_context_history_client_private.h @@ -28,7 +28,7 @@ #include "ewk_context.h" -struct _Ewk_Context_History_Client { +struct Ewk_Context_History_Client { void* user_data; Ewk_History_Navigation_Cb navigate_func; Ewk_History_Client_Redirection_Cb client_redirect_func; @@ -37,8 +37,6 @@ struct _Ewk_Context_History_Client { Ewk_History_Populate_Visited_Links_Cb populate_visited_links_func; }; -typedef struct _Ewk_Context_History_Client Ewk_Context_History_Client; - void ewk_context_history_client_attach(Ewk_Context*); #endif // ewk_context_history_client_private_h diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_context_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_context_private.h index 29f74a184..705739a16 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_context_private.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_context_private.h @@ -22,10 +22,10 @@ #include <WebKit2/WKBase.h> -typedef struct _Ewk_Context Ewk_Context; -typedef struct _Ewk_Download_Job Ewk_Download_Job; +typedef struct Ewk_Context Ewk_Context; +typedef struct Ewk_Download_Job Ewk_Download_Job; typedef struct Ewk_Url_Scheme_Request Ewk_Url_Scheme_Request; -typedef struct _Ewk_Context_History_Client Ewk_Context_History_Client; +typedef struct Ewk_Context_History_Client Ewk_Context_History_Client; WKContextRef ewk_context_WKContext_get(const Ewk_Context*); Ewk_Context* ewk_context_new_from_WKContext(WKContextRef); diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_context_request_manager_client_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_context_request_manager_client_private.h index 689bbf622..311343890 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_context_request_manager_client_private.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_context_request_manager_client_private.h @@ -26,7 +26,7 @@ #ifndef ewk_context_request_manager_client_private_h #define ewk_context_request_manager_client_private_h -typedef struct _Ewk_Context Ewk_Context; +typedef struct Ewk_Context Ewk_Context; void ewk_context_request_manager_client_attach(Ewk_Context* context); diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_cookie_manager.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_cookie_manager.cpp index 52b7ca7cc..3cbf7fef0 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_cookie_manager.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_cookie_manager.cpp @@ -42,7 +42,7 @@ using namespace WebKit; static void cookiesDidChange(WKCookieManagerRef, const void* clientInfo); -_Ewk_Cookie_Manager::_Ewk_Cookie_Manager(WKCookieManagerRef cookieManagerRef) +Ewk_Cookie_Manager::Ewk_Cookie_Manager(WKCookieManagerRef cookieManagerRef) : wkCookieManager(cookieManagerRef) { WKCookieManagerClient wkCookieManagerClient = { @@ -53,7 +53,7 @@ _Ewk_Cookie_Manager::_Ewk_Cookie_Manager(WKCookieManagerRef cookieManagerRef) WKCookieManagerSetClient(wkCookieManager.get(), &wkCookieManagerClient); } -_Ewk_Cookie_Manager::~_Ewk_Cookie_Manager() +Ewk_Cookie_Manager::~Ewk_Cookie_Manager() { if (changeHandler.callback) WKCookieManagerStopObservingCookieChanges(wkCookieManager.get()); diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_cookie_manager.h b/Source/WebKit2/UIProcess/API/efl/ewk_cookie_manager.h index c31b90018..0d2a4c64f 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_cookie_manager.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_cookie_manager.h @@ -38,15 +38,15 @@ extern "C" { #endif -/** Creates a type name for _Ewk_Cookie_Manager */ -typedef struct _Ewk_Cookie_Manager Ewk_Cookie_Manager; +/** Creates a type name for Ewk_Cookie_Manager */ +typedef struct Ewk_Cookie_Manager Ewk_Cookie_Manager; /** - * \enum _Ewk_Cookie_Accept_Policy + * \enum Ewk_Cookie_Accept_Policy * * @brief Contains accept policies for the cookies. */ -enum _Ewk_Cookie_Accept_Policy { +enum Ewk_Cookie_Accept_Policy { /// Accepts every cookie sent from any page. EWK_COOKIE_ACCEPT_POLICY_ALWAYS, /// Rejects all cookies. @@ -55,23 +55,23 @@ enum _Ewk_Cookie_Accept_Policy { EWK_COOKIE_ACCEPT_POLICY_NO_THIRD_PARTY }; -/// Creates a type name for the _Ewk_Cookie_Accept_Policy. -typedef enum _Ewk_Cookie_Accept_Policy Ewk_Cookie_Accept_Policy; +/// Creates a type name for the Ewk_Cookie_Accept_Policy. +typedef enum Ewk_Cookie_Accept_Policy Ewk_Cookie_Accept_Policy; /** - * \enum _Ewk_Cookie_Persistent_Storage + * \enum Ewk_Cookie_Persistent_Storage * * @brief Enum values to denote cookies persistent storage type. */ -enum _Ewk_Cookie_Persistent_Storage { +enum Ewk_Cookie_Persistent_Storage { /// Cookies are stored in a text file in the Mozilla "cookies.txt" format. EWK_COOKIE_PERSISTENT_STORAGE_TEXT, /// Cookies are stored in a SQLite file in the current Mozilla format. EWK_COOKIE_PERSISTENT_STORAGE_SQLITE }; -/// Creates a type name for the _Ewk_Cookie_Persistent_Storage. -typedef enum _Ewk_Cookie_Persistent_Storage Ewk_Cookie_Persistent_Storage; +/// Creates a type name for the Ewk_Cookie_Persistent_Storage. +typedef enum Ewk_Cookie_Persistent_Storage Ewk_Cookie_Persistent_Storage; /** * @typedef Ewk_Cookie_Manager_Async_Policy_Get_Cb Ewk_Cookie_Manager_Async_Policy_Get_Cb diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_cookie_manager_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_cookie_manager_private.h index 691322b6c..b7579aa99 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_cookie_manager_private.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_cookie_manager_private.h @@ -47,23 +47,20 @@ struct Cookie_Change_Handler { { } }; - -typedef struct _Ewk_Cookie_Manager Ewk_Cookie_Manager; - -class _Ewk_Cookie_Manager { +class Ewk_Cookie_Manager { public: WKRetainPtr<WKCookieManagerRef> wkCookieManager; Cookie_Change_Handler changeHandler; - static PassOwnPtr<_Ewk_Cookie_Manager> create(WKCookieManagerRef cookieManagerRef) + static PassOwnPtr<Ewk_Cookie_Manager> create(WKCookieManagerRef cookieManagerRef) { - return adoptPtr(new _Ewk_Cookie_Manager(cookieManagerRef)); + return adoptPtr(new Ewk_Cookie_Manager(cookieManagerRef)); } - ~_Ewk_Cookie_Manager(); + ~Ewk_Cookie_Manager(); private: - explicit _Ewk_Cookie_Manager(WKCookieManagerRef cookieManagerRef); + explicit Ewk_Cookie_Manager(WKCookieManagerRef cookieManagerRef); }; #endif // ewk_cookie_manager_private_h diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_download_job.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_download_job.cpp index de8f597e0..46a198dc7 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_download_job.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_download_job.cpp @@ -174,12 +174,12 @@ double ewk_download_job_elapsed_time_get(const Ewk_Download_Job* download) * @internal * Sets the URL @a response for this @a download. */ -void ewk_download_job_response_set(Ewk_Download_Job* download, Ewk_Url_Response* response) +void ewk_download_job_response_set(Ewk_Download_Job* download, PassRefPtr<Ewk_Url_Response> response) { EINA_SAFETY_ON_NULL_RETURN(download); EINA_SAFETY_ON_NULL_RETURN(response); - download->response = ewk_url_response_ref(response); + download->response = response; } /** diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_download_job.h b/Source/WebKit2/UIProcess/API/efl/ewk_download_job.h index 388276c9c..0cad5c2ed 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_download_job.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_download_job.h @@ -43,11 +43,11 @@ extern "C" { #endif -/** Creates a type name for _Ewk_Download_Job_Job */ -typedef struct _Ewk_Download_Job Ewk_Download_Job; +/** Creates a type name for Ewk_Download_Job_Job */ +typedef struct Ewk_Download_Job Ewk_Download_Job; /// Defines the possible states of a download. -enum _Ewk_Download_Job_State { +enum Ewk_Download_Job_State { /// The download state is unknown EWK_DOWNLOAD_JOB_STATE_UNKNOWN = -1, /// The download has not started yet @@ -63,8 +63,8 @@ enum _Ewk_Download_Job_State { /// The download completed successfully. EWK_DOWNLOAD_JOB_STATE_FINISHED }; -/// Creates a type name for @a _Ewk_Download_Job_State. -typedef enum _Ewk_Download_Job_State Ewk_Download_Job_State; +/// Creates a type name for @a Ewk_Download_Job_State. +typedef enum Ewk_Download_Job_State Ewk_Download_Job_State; /** * Increases the reference count of the given object. diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_download_job_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_download_job_private.h index a4a40c0f6..5fac47db0 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_download_job_private.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_download_job_private.h @@ -38,10 +38,10 @@ class DownloadProxy; } /** - * \struct _Ewk_Download_Job + * \struct Ewk_Download_Job * @brief Contains the download data. */ -class _Ewk_Download_Job : public RefCounted<_Ewk_Download_Job> { +class Ewk_Download_Job : public RefCounted<Ewk_Download_Job> { public: WebKit::DownloadProxy* downloadProxy; Evas_Object* view; @@ -54,13 +54,13 @@ public: WKEinaSharedString destination; WKEinaSharedString suggestedFilename; - static PassRefPtr<_Ewk_Download_Job> create(WebKit::DownloadProxy* download, Evas_Object* ewkView) + static PassRefPtr<Ewk_Download_Job> create(WebKit::DownloadProxy* download, Evas_Object* ewkView) { - return adoptRef(new _Ewk_Download_Job(download, ewkView)); + return adoptRef(new Ewk_Download_Job(download, ewkView)); } private: - _Ewk_Download_Job(WebKit::DownloadProxy* download, Evas_Object* ewkView) + Ewk_Download_Job(WebKit::DownloadProxy* download, Evas_Object* ewkView) : downloadProxy(download) , view(ewkView) , state(EWK_DOWNLOAD_JOB_STATE_NOT_STARTED) @@ -70,20 +70,13 @@ private: { } }; -typedef struct _Ewk_Download_Job Ewk_Download_Job; -typedef struct _Ewk_Error Ewk_Error; +typedef struct Ewk_Error Ewk_Error; uint64_t ewk_download_job_id_get(const Ewk_Download_Job*); Evas_Object* ewk_download_job_view_get(const Ewk_Download_Job*); - void ewk_download_job_state_set(Ewk_Download_Job*, Ewk_Download_Job_State); -void ewk_download_job_cancelled(Ewk_Download_Job*); -void ewk_download_job_failed(Ewk_Download_Job*); -void ewk_download_job_finished(Ewk_Download_Job*); -void ewk_download_job_started(Ewk_Download_Job*); - void ewk_download_job_received_data(Ewk_Download_Job*, uint64_t length); -void ewk_download_job_response_set(Ewk_Download_Job*, Ewk_Url_Response*); +void ewk_download_job_response_set(Ewk_Download_Job*, PassRefPtr<Ewk_Url_Response>); void ewk_download_job_suggested_filename_set(Ewk_Download_Job*, const char* suggestedFilename); #endif // ewk_download_job_private_h diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_error.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_error.cpp index fed8e2cc3..5bcfd81f9 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_error.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_error.cpp @@ -36,7 +36,7 @@ using namespace WebCore; using namespace WebKit; -_Ewk_Error::_Ewk_Error(WKErrorRef errorRef) +Ewk_Error::Ewk_Error(WKErrorRef errorRef) : wkError(errorRef) , url(AdoptWK, WKErrorCopyFailingURL(errorRef)) , description(AdoptWK, WKErrorCopyLocalizedDescription(errorRef)) diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_error.h b/Source/WebKit2/UIProcess/API/efl/ewk_error.h index 01214d121..d151543e9 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_error.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_error.h @@ -38,7 +38,7 @@ extern "C" { #endif /** Creates a type name for @a Ewk_Error. */ -typedef struct _Ewk_Error Ewk_Error; +typedef struct Ewk_Error Ewk_Error; /// Creates a type name for Ewk_Error_Type. typedef enum { diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_error_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_error_private.h index 5ae457bf0..a26e0fc4f 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_error_private.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_error_private.h @@ -31,24 +31,22 @@ #include <WKRetainPtr.h> #include <wtf/PassOwnPtr.h> -typedef struct _Ewk_Error Ewk_Error; - -class _Ewk_Error { +class Ewk_Error { public: WKRetainPtr<WKErrorRef> wkError; WKEinaSharedString url; WKEinaSharedString description; - static PassOwnPtr<_Ewk_Error> create(WKErrorRef errorRef) + static PassOwnPtr<Ewk_Error> create(WKErrorRef errorRef) { if (!errorRef) return nullptr; - return adoptPtr(new _Ewk_Error(errorRef)); + return adoptPtr(new Ewk_Error(errorRef)); } private: - explicit _Ewk_Error(WKErrorRef errorRef); + explicit Ewk_Error(WKErrorRef errorRef); }; #endif // ewk_error_private_h diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_favicon_database.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_favicon_database.cpp index 6e52c3510..9e059e2c4 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_favicon_database.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_favicon_database.cpp @@ -41,7 +41,7 @@ using namespace WebKit; static void didChangeIconForPageURL(WKIconDatabaseRef iconDatabase, WKURLRef pageURL, const void* clientInfo); static void iconDataReadyForPageURL(WKIconDatabaseRef iconDatabase, WKURLRef pageURL, const void* clientInfo); -_Ewk_Favicon_Database::_Ewk_Favicon_Database(WKIconDatabaseRef iconDatabaseRef) +Ewk_Favicon_Database::Ewk_Favicon_Database(WKIconDatabaseRef iconDatabaseRef) : wkIconDatabase(iconDatabaseRef) { WKIconDatabaseClient iconDatabaseClient; diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_favicon_database.h b/Source/WebKit2/UIProcess/API/efl/ewk_favicon_database.h index c3d44e47e..8ceaf5b23 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_favicon_database.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_favicon_database.h @@ -37,8 +37,8 @@ extern "C" { #endif -/** Creates a type name for @a _Ewk_Favicon_Database. */ -typedef struct _Ewk_Favicon_Database Ewk_Favicon_Database; +/** Creates a type name for @a Ewk_Favicon_Database. */ +typedef struct Ewk_Favicon_Database Ewk_Favicon_Database; /** * @typedef Ewk_Favicon_Database_Icon_Change_Cb Ewk_Favicon_Database_Icon_Change_Cb diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_favicon_database_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_favicon_database_private.h index c58842430..9d90902c5 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_favicon_database_private.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_favicon_database_private.h @@ -69,19 +69,19 @@ typedef HashMap<Ewk_Favicon_Database_Icon_Change_Cb, IconChangeCallbackData> Cha typedef Vector<IconRequestCallbackData> PendingIconRequestVector; typedef HashMap<String /* pageURL */, PendingIconRequestVector> PendingIconRequestMap; -class _Ewk_Favicon_Database { +class Ewk_Favicon_Database { public: WKRetainPtr<WKIconDatabaseRef> wkIconDatabase; ChangeListenerMap changeListeners; PendingIconRequestMap iconRequests; - static PassOwnPtr<_Ewk_Favicon_Database> create(WKIconDatabaseRef iconDatabaseRef) + static PassOwnPtr<Ewk_Favicon_Database> create(WKIconDatabaseRef iconDatabaseRef) { - return adoptPtr(new _Ewk_Favicon_Database(iconDatabaseRef)); + return adoptPtr(new Ewk_Favicon_Database(iconDatabaseRef)); } private: - explicit _Ewk_Favicon_Database(WKIconDatabaseRef iconDatabaseRef); + explicit Ewk_Favicon_Database(WKIconDatabaseRef iconDatabaseRef); }; #endif // ewk_favicon_database_private_h diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request.h b/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request.h index 9521e741c..b7fd0c6a8 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request.h @@ -40,8 +40,8 @@ extern "C" { #endif -/** Creates a type name for _Ewk_Form_Submission_Request */ -typedef struct _Ewk_Form_Submission_Request Ewk_Form_Submission_Request; +/** Creates a type name for Ewk_Form_Submission_Request */ +typedef struct Ewk_Form_Submission_Request Ewk_Form_Submission_Request; /** * Increases the reference count of the given object. diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request_private.h index b9bf57a14..993b53357 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request_private.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_form_submission_request_private.h @@ -32,28 +32,26 @@ #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> -typedef struct _Ewk_Form_Submission_Request Ewk_Form_Submission_Request; - -class _Ewk_Form_Submission_Request : public RefCounted<_Ewk_Form_Submission_Request> { +class Ewk_Form_Submission_Request : public RefCounted<Ewk_Form_Submission_Request> { public: WKRetainPtr<WKDictionaryRef> wkValues; WKRetainPtr<WKFormSubmissionListenerRef> wkListener; bool handledRequest; - ~_Ewk_Form_Submission_Request() + ~Ewk_Form_Submission_Request() { // Make sure the request is always handled before destroying. if (!handledRequest) WKFormSubmissionListenerContinue(wkListener.get()); } - static PassRefPtr<_Ewk_Form_Submission_Request> create(WKDictionaryRef values, WKFormSubmissionListenerRef listener) + static PassRefPtr<Ewk_Form_Submission_Request> create(WKDictionaryRef values, WKFormSubmissionListenerRef listener) { - return adoptRef(new _Ewk_Form_Submission_Request(values, listener)); + return adoptRef(new Ewk_Form_Submission_Request(values, listener)); } private: - _Ewk_Form_Submission_Request(WKDictionaryRef values, WKFormSubmissionListenerRef listener) + Ewk_Form_Submission_Request(WKDictionaryRef values, WKFormSubmissionListenerRef listener) : wkValues(values) , wkListener(listener) , handledRequest(false) diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_intent.h b/Source/WebKit2/UIProcess/API/efl/ewk_intent.h index 5b869023f..a23696da7 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_intent.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_intent.h @@ -37,8 +37,8 @@ extern "C" { #endif -/** Creates a type name for _Ewk_Intent */ -typedef struct _Ewk_Intent Ewk_Intent; +/** Creates a type name for Ewk_Intent */ +typedef struct Ewk_Intent Ewk_Intent; /** * Increases the reference count of the given object. diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_intent_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_intent_private.h index 95ffbb248..166a8a4f0 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_intent_private.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_intent_private.h @@ -35,26 +35,24 @@ #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> -typedef struct _Ewk_Intent Ewk_Intent; - /** - * \struct _Ewk_Intent + * \struct Ewk_Intent * @brief Contains the intent data. */ -class _Ewk_Intent : public RefCounted<_Ewk_Intent> { +class Ewk_Intent : public RefCounted<Ewk_Intent> { public: WKRetainPtr<WKIntentDataRef> wkIntent; WKEinaSharedString action; WKEinaSharedString type; WKEinaSharedString service; - static PassRefPtr<_Ewk_Intent> create(WKIntentDataRef intentRef) + static PassRefPtr<Ewk_Intent> create(WKIntentDataRef intentRef) { - return adoptRef(new _Ewk_Intent(intentRef)); + return adoptRef(new Ewk_Intent(intentRef)); } private: - explicit _Ewk_Intent(WKIntentDataRef intentRef) + explicit Ewk_Intent(WKIntentDataRef intentRef) : wkIntent(intentRef) , action(AdoptWK, WKIntentDataCopyAction(intentRef)) , type(AdoptWK, WKIntentDataCopyType(intentRef)) diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.h b/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.h index db946d247..a7d3d1a14 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_intent_service.h @@ -37,8 +37,8 @@ extern "C" { #endif -/** Creates a type name for _Ewk_Intent_Service */ -typedef struct _Ewk_Intent_Service Ewk_Intent_Service; +/** Creates a type name for Ewk_Intent_Service */ +typedef struct Ewk_Intent_Service Ewk_Intent_Service; /** * Increases the reference count of the given object. diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_intent_service_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_intent_service_private.h index ca561c548..119d6703a 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_intent_service_private.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_intent_service_private.h @@ -34,13 +34,11 @@ #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> -typedef struct _Ewk_Intent_Service Ewk_Intent_Service; - /** - * \struct _Ewk_Intent_Service + * \struct Ewk_Intent_Service * @brief Contains the intent service data. */ -class _Ewk_Intent_Service : public RefCounted<_Ewk_Intent_Service> { +class Ewk_Intent_Service : public RefCounted<Ewk_Intent_Service> { public: WKEinaSharedString action; WKEinaSharedString type; @@ -48,13 +46,13 @@ public: WKEinaSharedString title; WKEinaSharedString disposition; - static PassRefPtr<_Ewk_Intent_Service> create(WKIntentServiceInfoRef serviceRef) + static PassRefPtr<Ewk_Intent_Service> create(WKIntentServiceInfoRef serviceRef) { - return adoptRef(new _Ewk_Intent_Service(serviceRef)); + return adoptRef(new Ewk_Intent_Service(serviceRef)); } private: - explicit _Ewk_Intent_Service(WKIntentServiceInfoRef serviceRef) + explicit Ewk_Intent_Service(WKIntentServiceInfoRef serviceRef) : action(AdoptWK, WKIntentServiceInfoCopyAction(serviceRef)) , type(AdoptWK, WKIntentServiceInfoCopyType(serviceRef)) , href(AdoptWK, WKIntentServiceInfoCopyHref(serviceRef)) diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_navigation_data.h b/Source/WebKit2/UIProcess/API/efl/ewk_navigation_data.h index 1a1e60732..b3b5c26fc 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_navigation_data.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_navigation_data.h @@ -38,8 +38,8 @@ extern "C" { #endif -/** Creates a type name for _Ewk_Navigation_Data */ -typedef struct _Ewk_Navigation_Data Ewk_Navigation_Data; +/** Creates a type name for Ewk_Navigation_Data */ +typedef struct Ewk_Navigation_Data Ewk_Navigation_Data; /** * Increases the reference count of the given object. diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_navigation_data_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_navigation_data_private.h index 08ad0ce16..e06016da4 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_navigation_data_private.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_navigation_data_private.h @@ -36,28 +36,26 @@ #include <wtf/RefCounted.h> /** - * \struct _Ewk_Navigation_Data + * \struct Ewk_Navigation_Data * @brief Contains the navigation data details. */ -class _Ewk_Navigation_Data : public RefCounted<_Ewk_Navigation_Data> { +class Ewk_Navigation_Data : public RefCounted<Ewk_Navigation_Data> { public: RefPtr<Ewk_Url_Request> request; WKEinaSharedString title; WKEinaSharedString url; - static PassRefPtr<_Ewk_Navigation_Data> create(WKNavigationDataRef dataRef) + static PassRefPtr<Ewk_Navigation_Data> create(WKNavigationDataRef dataRef) { - return adoptRef(new _Ewk_Navigation_Data(dataRef)); + return adoptRef(new Ewk_Navigation_Data(dataRef)); } private: - explicit _Ewk_Navigation_Data(WKNavigationDataRef dataRef) + explicit Ewk_Navigation_Data(WKNavigationDataRef dataRef) : request(Ewk_Url_Request::create(adoptWK(WKNavigationDataCopyOriginalRequest(dataRef)).get())) , title(AdoptWK, WKNavigationDataCopyTitle(dataRef)) , url(AdoptWK, WKNavigationDataCopyURL(dataRef)) { } }; -typedef struct _Ewk_Navigation_Data Ewk_Navigation_Data; - #endif // ewk_navigation_data_private_h diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.h b/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.h index 9f3c045ae..166b1dc8d 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision.h @@ -38,8 +38,8 @@ extern "C" { #endif -/** Creates a type name for _Ewk_Navigation_Policy_Decision */ -typedef struct _Ewk_Navigation_Policy_Decision Ewk_Navigation_Policy_Decision; +/** Creates a type name for Ewk_Navigation_Policy_Decision */ +typedef struct Ewk_Navigation_Policy_Decision Ewk_Navigation_Policy_Decision; /// Enum containing navigation types typedef enum { diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision_private.h index be1a8df5b..e7e454979 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision_private.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_navigation_policy_decision_private.h @@ -37,10 +37,10 @@ #include <wtf/PassRefPtr.h> /** - * \struct _Ewk_Navigation_Policy_Decision + * \struct Ewk_Navigation_Policy_Decision * @brief Contains the navigation policy decision data. */ -class _Ewk_Navigation_Policy_Decision : public RefCounted<_Ewk_Navigation_Policy_Decision> { +class Ewk_Navigation_Policy_Decision : public RefCounted<Ewk_Navigation_Policy_Decision> { public: WKRetainPtr<WKFramePolicyListenerRef> listener; bool actedUponByClient; @@ -50,21 +50,21 @@ public: RefPtr<Ewk_Url_Request> request; WKEinaSharedString frameName; - ~_Ewk_Navigation_Policy_Decision() + ~Ewk_Navigation_Policy_Decision() { // This is the default choice for all policy decisions in WebPageProxy.cpp. if (!actedUponByClient) WKFramePolicyListenerUse(listener.get()); } - static PassRefPtr<_Ewk_Navigation_Policy_Decision> create(WKFrameNavigationType navigationType, WKEventMouseButton mouseButton, WKEventModifiers modifiers, WKURLRequestRef requestRef, const char* frameName, WKFramePolicyListenerRef listener) + static PassRefPtr<Ewk_Navigation_Policy_Decision> create(WKFrameNavigationType navigationType, WKEventMouseButton mouseButton, WKEventModifiers modifiers, WKURLRequestRef requestRef, const char* frameName, WKFramePolicyListenerRef listener) { RefPtr<Ewk_Url_Request> request = Ewk_Url_Request::create(requestRef); - return adoptRef(new _Ewk_Navigation_Policy_Decision(listener, static_cast<Ewk_Navigation_Type>(navigationType), static_cast<Event_Mouse_Button>(mouseButton), static_cast<Event_Modifier_Keys>(modifiers), request.release(), frameName)); + return adoptRef(new Ewk_Navigation_Policy_Decision(listener, static_cast<Ewk_Navigation_Type>(navigationType), static_cast<Event_Mouse_Button>(mouseButton), static_cast<Event_Modifier_Keys>(modifiers), request.release(), frameName)); } private: - _Ewk_Navigation_Policy_Decision(WKFramePolicyListenerRef listener, Ewk_Navigation_Type navigationType, Event_Mouse_Button mouseButton, Event_Modifier_Keys modifiers, PassRefPtr<Ewk_Url_Request> request, const char* frameName) + Ewk_Navigation_Policy_Decision(WKFramePolicyListenerRef listener, Ewk_Navigation_Type navigationType, Event_Mouse_Button mouseButton, Event_Modifier_Keys modifiers, PassRefPtr<Ewk_Url_Request> request, const char* frameName) : listener(listener) , actedUponByClient(false) , navigationType(navigationType) @@ -75,6 +75,4 @@ private: { } }; -typedef struct _Ewk_Navigation_Policy_Decision Ewk_Navigation_Policy_Decision; - #endif // ewk_navigation_policy_decision_private_h diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_popup_menu_item.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_popup_menu_item.cpp index d0a3f6061..4b229be83 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_popup_menu_item.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_popup_menu_item.cpp @@ -32,7 +32,7 @@ using namespace WebKit; -_Ewk_Popup_Menu_Item::_Ewk_Popup_Menu_Item(const WebKit::WebPopupItem& item) +Ewk_Popup_Menu_Item::Ewk_Popup_Menu_Item(const WebKit::WebPopupItem& item) : type(static_cast<Ewk_Popup_Menu_Item_Type>(item.m_type)) , textDirection(static_cast<Ewk_Text_Direction>(item.m_textDirection)) , hasTextDirectionOverride(item.m_hasTextDirectionOverride) diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_popup_menu_item.h b/Source/WebKit2/UIProcess/API/efl/ewk_popup_menu_item.h index b96d4366d..5efe6fe0e 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_popup_menu_item.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_popup_menu_item.h @@ -45,8 +45,8 @@ typedef enum { EWK_POPUP_MENU_UNKNOWN = -1 } Ewk_Popup_Menu_Item_Type; -/** Creates a type name for _Ewk_Popup_Menu_Item */ -typedef struct _Ewk_Popup_Menu_Item Ewk_Popup_Menu_Item; +/** Creates a type name for Ewk_Popup_Menu_Item */ +typedef struct Ewk_Popup_Menu_Item Ewk_Popup_Menu_Item; /** * Returns type of the popup menu item. diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_popup_menu_item_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_popup_menu_item_private.h index ec2ec36a8..ad215dcaf 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_popup_menu_item_private.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_popup_menu_item_private.h @@ -32,10 +32,10 @@ #include <wtf/PassOwnPtr.h> /** - * \struct _Ewk_Popup_Menu_Item + * \struct Ewk_Popup_Menu_Item * @brief Contains the popup menu data. */ -class _Ewk_Popup_Menu_Item { +class Ewk_Popup_Menu_Item { public: Ewk_Popup_Menu_Item_Type type; Ewk_Text_Direction textDirection; @@ -49,13 +49,13 @@ public: WKEinaSharedString toolTip; WKEinaSharedString accessibilityText; - static PassOwnPtr<_Ewk_Popup_Menu_Item> create(const WebKit::WebPopupItem& item) + static PassOwnPtr<Ewk_Popup_Menu_Item> create(const WebKit::WebPopupItem& item) { - return adoptPtr(new _Ewk_Popup_Menu_Item(item)); + return adoptPtr(new Ewk_Popup_Menu_Item(item)); } private: - explicit _Ewk_Popup_Menu_Item(const WebKit::WebPopupItem& item); + explicit Ewk_Popup_Menu_Item(const WebKit::WebPopupItem& item); }; #endif // ewk_popup_menu_item_private_h diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_resource.h b/Source/WebKit2/UIProcess/API/efl/ewk_resource.h index a2f4786b8..5ec40bb7a 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_resource.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_resource.h @@ -38,7 +38,7 @@ extern "C" { #endif /** Creates a type name for @a Ewk_Resource. */ -typedef struct _Ewk_Resource Ewk_Resource; +typedef struct Ewk_Resource Ewk_Resource; /** * Increases the reference count of the given object. diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_resource_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_resource_private.h index d86d67be8..99cc9333b 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_resource_private.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_resource_private.h @@ -33,20 +33,18 @@ #include <wtf/text/CString.h> #include <wtf/text/WTFString.h> -typedef struct _Ewk_Resource Ewk_Resource; - -class _Ewk_Resource : public RefCounted<_Ewk_Resource> { +class Ewk_Resource : public RefCounted<Ewk_Resource> { public: WKEinaSharedString url; bool isMainResource; - static PassRefPtr<_Ewk_Resource> create(WKURLRef url, bool isMainResource) + static PassRefPtr<Ewk_Resource> create(WKURLRef url, bool isMainResource) { - return adoptRef(new _Ewk_Resource(url, isMainResource)); + return adoptRef(new Ewk_Resource(url, isMainResource)); } private: - _Ewk_Resource(WKURLRef url, bool isMainResource) + Ewk_Resource(WKURLRef url, bool isMainResource) : url(url) , isMainResource(isMainResource) { } diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_settings.h b/Source/WebKit2/UIProcess/API/efl/ewk_settings.h index 1f178b6ae..861b9917f 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_settings.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_settings.h @@ -40,8 +40,8 @@ extern "C" { #endif -/** Creates a type name for _Ewk_Settings */ -typedef struct _Ewk_Settings Ewk_Settings; +/** Creates a type name for Ewk_Settings */ +typedef struct Ewk_Settings Ewk_Settings; /** * Creates a type name for the callback function used to notify the client when diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_settings_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_settings_private.h index 2c9da0d7c..40ae3b781 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_settings_private.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_settings_private.h @@ -31,17 +31,14 @@ #include <WebKit2/WKRetainPtr.h> #include <wtf/PassOwnPtr.h> -/** Creates a type name for _Ewk_Settings */ -typedef struct _Ewk_Settings Ewk_Settings; - /** - * \struct _Ewk_Settings + * \struct Ewk_Settings * @brief Contains the settings data. */ -struct _Ewk_Settings { +struct Ewk_Settings { WKRetainPtr<WKPreferencesRef> preferences; - explicit _Ewk_Settings(WKPreferencesRef wkPreferences) + explicit Ewk_Settings(WKPreferencesRef wkPreferences) : preferences(wkPreferences) { } }; diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_text_checker_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_text_checker_private.h index d45505ad9..e74810613 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_text_checker_private.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_text_checker_private.h @@ -35,7 +35,7 @@ * * @internal */ -struct _Ewk_Text_Checker { +struct Ewk_Text_Checker { Ewk_Text_Checker_Unique_Spell_Document_Tag_Get_Cb unique_spell_document_tag_get; Ewk_Text_Checker_Unique_Spell_Document_Tag_Close_Cb unique_spell_document_tag_close; Ewk_Text_Checker_String_Spelling_Check_Cb string_spelling_check; @@ -43,7 +43,6 @@ struct _Ewk_Text_Checker { Ewk_Text_Checker_Word_Learn_Cb word_learn; Ewk_Text_Checker_Word_Ignore_Cb word_ignore; }; -typedef _Ewk_Text_Checker Ewk_Text_Checker; Ewk_Text_Checker* ewk_text_checker_callbacks_get(); diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_touch.h b/Source/WebKit2/UIProcess/API/efl/ewk_touch.h index 1c9cdd59d..f2971a639 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_touch.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_touch.h @@ -40,11 +40,11 @@ typedef enum { EWK_TOUCH_CANCEL } Ewk_Touch_Event_Type; -/// Creates a type name for _Ewk_Touch_Point. -typedef struct _Ewk_Touch_Point Ewk_Touch_Point; +/// Creates a type name for Ewk_Touch_Point. +typedef struct Ewk_Touch_Point Ewk_Touch_Point; /// Represents a touch point. -struct _Ewk_Touch_Point { +struct Ewk_Touch_Point { int id; /**< identifier of the touch event */ int x; /**< the horizontal position of the touch event */ int y; /**< the vertical position of the touch event */ diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_url_request.h b/Source/WebKit2/UIProcess/API/efl/ewk_url_request.h index f61b88af9..987bd8f05 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_url_request.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_url_request.h @@ -37,8 +37,8 @@ extern "C" { #endif -/** Creates a type name for _Ewk_Url_Request */ -typedef struct _Ewk_Url_Request Ewk_Url_Request; +/** Creates a type name for Ewk_Url_Request */ +typedef struct Ewk_Url_Request Ewk_Url_Request; /** * Increases the reference count of the given object. diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_url_request_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_url_request_private.h index b1bc13318..6fafb8876 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_url_request_private.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_url_request_private.h @@ -33,28 +33,26 @@ #include <wtf/PassRefPtr.h> /** - * \struct _Ewk_Url_Request + * \struct Ewk_Url_Request * @brief Contains the URL request data. */ -class _Ewk_Url_Request : public RefCounted<_Ewk_Url_Request> { +class Ewk_Url_Request : public RefCounted<Ewk_Url_Request> { public: WKEinaSharedString url; WKEinaSharedString firstParty; WKEinaSharedString httpMethod; - static PassRefPtr<_Ewk_Url_Request> create(WKURLRequestRef requestRef) + static PassRefPtr<Ewk_Url_Request> create(WKURLRequestRef requestRef) { - return adoptRef(new _Ewk_Url_Request(requestRef)); + return adoptRef(new Ewk_Url_Request(requestRef)); } private: - explicit _Ewk_Url_Request(WKURLRequestRef requestRef) + explicit Ewk_Url_Request(WKURLRequestRef requestRef) : url(AdoptWK, WKURLRequestCopyURL(requestRef)) , firstParty(AdoptWK, WKURLRequestCopyFirstPartyForCookies(requestRef)) , httpMethod(AdoptWK, WKURLRequestCopyHTTPMethod(requestRef)) { } }; -typedef struct _Ewk_Url_Request Ewk_Url_Request; - #endif // ewk_url_request_private_h diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_url_response.h b/Source/WebKit2/UIProcess/API/efl/ewk_url_response.h index 25814d21d..cad8e0f76 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_url_response.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_url_response.h @@ -37,8 +37,8 @@ extern "C" { #endif -/** Creates a type name for _Ewk_Url_Response */ -typedef struct _Ewk_Url_Response Ewk_Url_Response; +/** Creates a type name for Ewk_Url_Response */ +typedef struct Ewk_Url_Response Ewk_Url_Response; /** * Increases the reference count of the given object. diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_url_response_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_url_response_private.h index 885d32bec..357c1c64e 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_url_response_private.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_url_response_private.h @@ -33,31 +33,29 @@ #include <wtf/PassRefPtr.h> /** - * \struct _Ewk_Url_Response + * \struct Ewk_Url_Response * @brief Contains the URL response data. */ -class _Ewk_Url_Response : public RefCounted<_Ewk_Url_Response> { +class Ewk_Url_Response : public RefCounted<Ewk_Url_Response> { public: WebCore::ResourceResponse coreResponse; WKEinaSharedString url; WKEinaSharedString mimeType; - static PassRefPtr<_Ewk_Url_Response> create(WKURLResponseRef wkResponse) + static PassRefPtr<Ewk_Url_Response> create(WKURLResponseRef wkResponse) { if (!wkResponse) return 0; - return adoptRef(new _Ewk_Url_Response(WebKit::toImpl(wkResponse)->resourceResponse())); + return adoptRef(new Ewk_Url_Response(WebKit::toImpl(wkResponse)->resourceResponse())); } private: - explicit _Ewk_Url_Response(const WebCore::ResourceResponse& _coreResponse) + explicit Ewk_Url_Response(const WebCore::ResourceResponse& _coreResponse) : coreResponse(_coreResponse) , url(AdoptWK, WKURLResponseCopyURL(WebKit::toAPI(coreResponse))) , mimeType(AdoptWK, WKURLResponseCopyMIMEType(WebKit::toAPI(coreResponse))) { } }; -typedef struct _Ewk_Url_Response Ewk_Url_Response; - #endif // ewk_url_response_private_h diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.h b/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.h index 94b502913..f36ea4fcd 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request.h @@ -37,7 +37,7 @@ extern "C" { #endif -/** Creates a type name for _Ewk_Url_Scheme_Request */ +/** Creates a type name for Ewk_Url_Scheme_Request */ typedef struct Ewk_Url_Scheme_Request Ewk_Url_Scheme_Request; /** diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request_private.h index 8c781022e..6bcba947e 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request_private.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_url_scheme_request_private.h @@ -34,7 +34,7 @@ #include "WKSoupRequestManager.h" /** - * \struct _Ewk_Url_Scheme_Request + * \struct Ewk_Url_Scheme_Request * @brief Contains the URL scheme request data. */ struct Ewk_Url_Scheme_Request : public RefCounted<Ewk_Url_Scheme_Request> { diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp index 95b084e10..ee4507c9f 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp @@ -25,6 +25,7 @@ #include "NativeWebMouseEvent.h" #include "NativeWebWheelEvent.h" #include "PageClientImpl.h" +#include "RefPtrEfl.h" #include "WKAPICast.h" #include "WKColorPickerResultListener.h" #include "WKEinaSharedString.h" @@ -111,7 +112,7 @@ static inline void removeFromPageViewMap(const Evas_Object* ewkView) pageViewMap().remove(ewk_view_page_get(ewkView)); } -struct _Ewk_View_Private_Data { +struct Ewk_View_Private_Data { OwnPtr<PageClientImpl> pageClient; #if USE(COORDINATED_GRAPHICS) OwnPtr<EflViewportHandler> viewportHandler; @@ -124,12 +125,12 @@ struct _Ewk_View_Private_Data { WKEinaSharedString customEncoding; WKEinaSharedString cursorGroup; WKEinaSharedString faviconURL; - Evas_Object* cursorObject; + RefPtr<Evas_Object> cursorObject; LoadingResourcesMap loadingResourcesMap; OwnPtr<Ewk_Back_Forward_List> backForwardList; OwnPtr<Ewk_Settings> settings; bool areMouseEventsEnabled; - WKColorPickerResultListenerRef colorPickerResultListener; + WKRetainPtr<WKColorPickerResultListenerRef> colorPickerResultListener; Ewk_Context* context; #if ENABLE(TOUCH_EVENTS) bool areTouchEventsEnabled; @@ -148,10 +149,8 @@ struct _Ewk_View_Private_Data { Evas_GL_Surface* evasGlSurface; #endif - _Ewk_View_Private_Data() - : cursorObject(0) - , areMouseEventsEnabled(false) - , colorPickerResultListener(0) + Ewk_View_Private_Data() + : areMouseEventsEnabled(false) , context(0) #if ENABLE(TOUCH_EVENTS) , areTouchEventsEnabled(false) @@ -168,15 +167,12 @@ struct _Ewk_View_Private_Data { #endif { } - ~_Ewk_View_Private_Data() + ~Ewk_View_Private_Data() { /* Unregister icon change callback */ Ewk_Favicon_Database* iconDatabase = ewk_context_favicon_database_get(context); ewk_favicon_database_icon_change_callback_del(iconDatabase, _ewk_view_on_favicon_changed); - if (cursorObject) - evas_object_del(cursorObject); - void* item; EINA_LIST_FREE(popupMenuItems, item) delete static_cast<Ewk_Popup_Menu_Item*>(item); @@ -507,7 +503,7 @@ static void _ewk_view_smart_add(Evas_Object* ewkView) smartData->priv = _ewk_view_priv_new(smartData); if (!smartData->priv) { - EINA_LOG_CRIT("could not allocate _Ewk_View_Private_Data"); + EINA_LOG_CRIT("could not allocate Ewk_View_Private_Data"); evas_object_smart_data_set(ewkView, 0); free(smartData); return; @@ -659,11 +655,14 @@ static void _ewk_view_smart_calculate(Evas_Object* ewkView) { EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData); EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv); - Evas_Coord x, y, width, height; + +#if USE(ACCELERATED_COMPOSITING) bool needsNewSurface = false; +#endif smartData->changed.any = false; + Evas_Coord x, y, width, height; evas_object_geometry_get(ewkView, &x, &y, &width, &height); if (smartData->changed.size) { @@ -1248,15 +1247,11 @@ void ewk_view_cursor_set(Evas_Object* ewkView, const Cursor& cursor) return; priv->cursorGroup = group; - - if (priv->cursorObject) - evas_object_del(priv->cursorObject); - priv->cursorObject = edje_object_add(smartData->base.evas); + priv->cursorObject = adoptRef(edje_object_add(smartData->base.evas)); Ecore_Evas* ecoreEvas = ecore_evas_ecore_evas_get(smartData->base.evas); - if (!priv->theme || !edje_object_file_set(priv->cursorObject, priv->theme, group)) { - evas_object_del(priv->cursorObject); - priv->cursorObject = 0; + if (!priv->theme || !edje_object_file_set(priv->cursorObject.get(), priv->theme, group)) { + priv->cursorObject.clear(); ecore_evas_object_cursor_set(ecoreEvas, 0, 0, 0, 0); #ifdef HAVE_ECORE_X @@ -1267,27 +1262,27 @@ void ewk_view_cursor_set(Evas_Object* ewkView, const Cursor& cursor) } Evas_Coord width, height; - edje_object_size_min_get(priv->cursorObject, &width, &height); + edje_object_size_min_get(priv->cursorObject.get(), &width, &height); if (width <= 0 || height <= 0) - edje_object_size_min_calc(priv->cursorObject, &width, &height); + edje_object_size_min_calc(priv->cursorObject.get(), &width, &height); if (width <= 0 || height <= 0) { width = defaultCursorSize; height = defaultCursorSize; } - evas_object_resize(priv->cursorObject, width, height); + evas_object_resize(priv->cursorObject.get(), width, height); const char* data; int hotspotX = 0; - data = edje_object_data_get(priv->cursorObject, "hot.x"); + data = edje_object_data_get(priv->cursorObject.get(), "hot.x"); if (data) hotspotX = atoi(data); int hotspotY = 0; - data = edje_object_data_get(priv->cursorObject, "hot.y"); + data = edje_object_data_get(priv->cursorObject.get(), "hot.y"); if (data) hotspotY = atoi(data); - ecore_evas_object_cursor_set(ecoreEvas, priv->cursorObject, EVAS_LAYER_MAX, hotspotX, hotspotY); + ecore_evas_object_cursor_set(ecoreEvas, priv->cursorObject.get(), EVAS_LAYER_MAX, hotspotX, hotspotY); } void ewk_view_display(Evas_Object* ewkView, const IntRect& rect) @@ -1909,7 +1904,7 @@ WKEinaSharedString ewk_view_run_javascript_prompt(Evas_Object* ewkView, const WK #if ENABLE(INPUT_TYPE_COLOR) /** * @internal - * Reqeusts to show external color picker. + * Requests to show external color picker. */ void ewk_view_color_picker_request(Evas_Object* ewkView, int r, int g, int b, int a, WKColorPickerResultListenerRef listener) { @@ -1924,7 +1919,7 @@ void ewk_view_color_picker_request(Evas_Object* ewkView, int r, int g, int b, in /** * @internal - * Reqeusts to hide external color picker. + * Requests to hide external color picker. */ void ewk_view_color_picker_dismiss(Evas_Object* ewkView) { @@ -1932,7 +1927,7 @@ void ewk_view_color_picker_dismiss(Evas_Object* ewkView) EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv); EINA_SAFETY_ON_NULL_RETURN(smartData->api->input_picker_color_dismiss); - priv->colorPickerResultListener = 0; + priv->colorPickerResultListener.clear(); smartData->api->input_picker_color_dismiss(smartData); } @@ -1947,8 +1942,8 @@ Eina_Bool ewk_view_color_picker_color_set(Evas_Object* ewkView, int r, int g, in WebCore::Color color = WebCore::Color(r, g, b, a); const WKStringRef colorString = WKStringCreateWithUTF8CString(color.serialized().utf8().data()); - WKColorPickerResultListenerSetColor(priv->colorPickerResultListener, colorString); - priv->colorPickerResultListener = 0; + WKColorPickerResultListenerSetColor(priv->colorPickerResultListener.get(), colorString); + priv->colorPickerResultListener.clear(); return true; #else diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.h b/Source/WebKit2/UIProcess/API/efl/ewk_view.h index 7d8bb6acb..34a0817ba 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_view.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.h @@ -96,11 +96,11 @@ typedef enum { EWK_TEXT_DIRECTION_LEFT_TO_RIGHT } Ewk_Text_Direction; -typedef struct _Ewk_View_Smart_Data Ewk_View_Smart_Data; -typedef struct _Ewk_View_Smart_Class Ewk_View_Smart_Class; +typedef struct Ewk_View_Smart_Data Ewk_View_Smart_Data; +typedef struct Ewk_View_Smart_Class Ewk_View_Smart_Class; /// Ewk view's class, to be overridden by sub-classes. -struct _Ewk_View_Smart_Class { +struct Ewk_View_Smart_Class { Evas_Smart_Class sc; /**< all but 'data' is free to be changed. */ unsigned long version; @@ -182,14 +182,14 @@ struct _Ewk_View_Smart_Class { */ #define EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION(name) EWK_VIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name)) -typedef struct _Ewk_View_Private_Data Ewk_View_Private_Data; +typedef struct Ewk_View_Private_Data Ewk_View_Private_Data; /** * @brief Contains an internal View data. * * It is to be considered private by users, but may be extended or * changed by sub-classes (that's why it's in public header file). */ -struct _Ewk_View_Smart_Data { +struct Ewk_View_Smart_Data { Evas_Object_Smart_Clipped_Data base; const Ewk_View_Smart_Class* api; /**< reference to casted class instance */ Evas_Object* self; /**< reference to owner object */ @@ -205,49 +205,49 @@ struct _Ewk_View_Smart_Data { } changed; }; -/// Creates a type name for _Ewk_Resource_Request. -typedef struct _Ewk_Resource_Request Ewk_Resource_Request; +/// Creates a type name for Ewk_Resource_Request. +typedef struct Ewk_Resource_Request Ewk_Resource_Request; /** * @brief Structure containing details about a resource request. */ -struct _Ewk_Resource_Request { +struct Ewk_Resource_Request { Ewk_Resource *resource; /**< resource being requested */ Ewk_Url_Request *request; /**< URL request for the resource */ Ewk_Url_Response *redirect_response; /**< Possible redirect response for the resource or @c NULL */ }; -/// Creates a type name for _Ewk_Resource_Load_Response. -typedef struct _Ewk_Resource_Load_Response Ewk_Resource_Load_Response; +/// Creates a type name for Ewk_Resource_Load_Response. +typedef struct Ewk_Resource_Load_Response Ewk_Resource_Load_Response; /** * @brief Structure containing details about a response to a resource request. */ -struct _Ewk_Resource_Load_Response { +struct Ewk_Resource_Load_Response { Ewk_Resource *resource; /**< resource requested */ Ewk_Url_Response *response; /**< resource load response */ }; -/// Creates a type name for _Ewk_Resource_Load_Error. -typedef struct _Ewk_Resource_Load_Error Ewk_Resource_Load_Error; +/// Creates a type name for Ewk_Resource_Load_Error. +typedef struct Ewk_Resource_Load_Error Ewk_Resource_Load_Error; /** * @brief Structure containing details about a resource load error. * * Details given about a resource load failure. */ -struct _Ewk_Resource_Load_Error { +struct Ewk_Resource_Load_Error { Ewk_Resource *resource; /**< resource that failed loading */ Ewk_Error *error; /**< load error */ }; -/// Creates a type name for _Ewk_Download_Job_Error. -typedef struct _Ewk_Download_Job_Error Ewk_Download_Job_Error; +/// Creates a type name for Ewk_Download_Job_Error. +typedef struct Ewk_Download_Job_Error Ewk_Download_Job_Error; /** * @brief Structure containing details about a download failure. */ -struct _Ewk_Download_Job_Error { +struct Ewk_Download_Job_Error { Ewk_Download_Job *download_job; /**< download that failed */ Ewk_Error *error; /**< download error */ }; @@ -257,7 +257,7 @@ struct _Ewk_Download_Job_Error { * @brief Provides option to find text * @info Keep this in sync with WKFindOptions.h */ -enum _Ewk_Find_Options { +enum Ewk_Find_Options { EWK_FIND_OPTIONS_NONE, /**< no search flags, this means a case sensitive, no wrap, forward only search. */ EWK_FIND_OPTIONS_CASE_INSENSITIVE = 1 << 0, /**< case insensitive search. */ EWK_FIND_OPTIONS_AT_WORD_STARTS = 1 << 1, /**< search text only at the beginning of the words. */ @@ -268,7 +268,7 @@ enum _Ewk_Find_Options { EWK_FIND_OPTIONS_SHOW_FIND_INDICATOR = 1 << 6, /**< show indicator */ EWK_FIND_OPTIONS_SHOW_HIGHLIGHT = 1 << 7 /**< show highlight */ }; -typedef enum _Ewk_Find_Options Ewk_Find_Options; +typedef enum Ewk_Find_Options Ewk_Find_Options; /** * Sets the smart class APIs, enabling view to be inherited. diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_view_private.h index 64f7e8d5e..61c7bd41a 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_view_private.h +++ b/Source/WebKit2/UIProcess/API/efl/ewk_view_private.h @@ -39,18 +39,18 @@ class WebPopupItem; class WebPopupMenuProxyEfl; } -typedef struct _Ewk_Download_Job Ewk_Download_Job; -typedef struct _Ewk_Form_Submission_Request Ewk_Form_Submission_Request; -typedef struct _Ewk_Url_Request Ewk_Url_Request; -typedef struct _Ewk_Url_Response Ewk_Url_Response; -typedef struct _Ewk_Error Ewk_Error; -typedef struct _Ewk_Resource Ewk_Resource; -typedef struct _Ewk_Navigation_Policy_Decision Ewk_Navigation_Policy_Decision; +typedef struct Ewk_Download_Job Ewk_Download_Job; +typedef struct Ewk_Form_Submission_Request Ewk_Form_Submission_Request; +typedef struct Ewk_Url_Request Ewk_Url_Request; +typedef struct Ewk_Url_Response Ewk_Url_Response; +typedef struct Ewk_Error Ewk_Error; +typedef struct Ewk_Resource Ewk_Resource; +typedef struct Ewk_Navigation_Policy_Decision Ewk_Navigation_Policy_Decision; #if ENABLE(WEB_INTENTS) -typedef struct _Ewk_Intent Ewk_Intent; +typedef struct Ewk_Intent Ewk_Intent; #endif #if ENABLE(WEB_INTENTS_TAG) -typedef struct _Ewk_Intent_Service Ewk_Intent_Service; +typedef struct Ewk_Intent_Service Ewk_Intent_Service; #endif void ewk_view_cursor_set(Evas_Object* ewkView, const WebCore::Cursor& cursor); diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardList.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardList.cpp index ebeb92034..d600d7816 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardList.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardList.cpp @@ -52,10 +52,10 @@ enum { LAST_SIGNAL }; -typedef HashMap<WKBackForwardListItemRef, GRefPtr<WebKitBackForwardListItem> > BackForwardListItemsMap; +typedef HashMap<WebBackForwardListItem*, GRefPtr<WebKitBackForwardListItem> > BackForwardListItemsMap; struct _WebKitBackForwardListPrivate { - WKBackForwardListRef wkList; + WebBackForwardList* backForwardItems; BackForwardListItemsMap itemsMap; }; @@ -107,55 +107,55 @@ static void webkit_back_forward_list_class_init(WebKitBackForwardListClass* list g_type_class_add_private(listClass, sizeof(WebKitBackForwardListPrivate)); } -static WebKitBackForwardListItem* webkitBackForwardListGetOrCreateItem(WebKitBackForwardList* list, WKBackForwardListItemRef wkListItem) +static WebKitBackForwardListItem* webkitBackForwardListGetOrCreateItem(WebKitBackForwardList* list, WebBackForwardListItem* webListItem) { - if (!wkListItem) + if (!webListItem) return 0; WebKitBackForwardListPrivate* priv = list->priv; - GRefPtr<WebKitBackForwardListItem> listItem = priv->itemsMap.get(wkListItem); + GRefPtr<WebKitBackForwardListItem> listItem = priv->itemsMap.get(webListItem); if (listItem) return listItem.get(); - listItem = webkitBackForwardListItemGetOrCreate(wkListItem); - priv->itemsMap.set(wkListItem, listItem); + listItem = webkitBackForwardListItemGetOrCreate(webListItem); + priv->itemsMap.set(webListItem, listItem); return listItem.get(); } -static GList* webkitBackForwardListCreateList(WebKitBackForwardList* list, WKArrayRef wkList) +static GList* webkitBackForwardListCreateList(WebKitBackForwardList* list, ImmutableArray* backForwardItems) { - if (!wkList) + if (!backForwardItems) return 0; GList* returnValue = 0; - for (size_t i = 0; i < WKArrayGetSize(wkList); ++i) { - WKBackForwardListItemRef wkItem = static_cast<WKBackForwardListItemRef>(WKArrayGetItemAtIndex(wkList, i)); - returnValue = g_list_prepend(returnValue, webkitBackForwardListGetOrCreateItem(list, wkItem)); + for (size_t i = 0; i < backForwardItems->size(); ++i) { + WebBackForwardListItem* webItem = static_cast<WebBackForwardListItem*>(backForwardItems->at(i)); + returnValue = g_list_prepend(returnValue, webkitBackForwardListGetOrCreateItem(list, webItem)); } return returnValue; } -WebKitBackForwardList* webkitBackForwardListCreate(WKBackForwardListRef wkList) +WebKitBackForwardList* webkitBackForwardListCreate(WebBackForwardList* backForwardItems) { WebKitBackForwardList* list = WEBKIT_BACK_FORWARD_LIST(g_object_new(WEBKIT_TYPE_BACK_FORWARD_LIST, NULL)); - list->priv->wkList = wkList; + list->priv->backForwardItems = backForwardItems; return list; } -void webkitBackForwardListChanged(WebKitBackForwardList* backForwardList, WKBackForwardListItemRef wkAddedItem, WKArrayRef wkRemovedItems) +void webkitBackForwardListChanged(WebKitBackForwardList* backForwardList, WebBackForwardListItem* webAddedItem, ImmutableArray* webRemovedItems) { - WebKitBackForwardListItem* addedItem = webkitBackForwardListGetOrCreateItem(backForwardList, wkAddedItem); + WebKitBackForwardListItem* addedItem = webkitBackForwardListGetOrCreateItem(backForwardList, webAddedItem); GList* removedItems = 0; - size_t removedItemsSize = wkRemovedItems ? WKArrayGetSize(wkRemovedItems) : 0; + size_t removedItemsSize = webRemovedItems ? webRemovedItems->size() : 0; WebKitBackForwardListPrivate* priv = backForwardList->priv; for (size_t i = 0; i < removedItemsSize; ++i) { - WKBackForwardListItemRef wkItem = static_cast<WKBackForwardListItemRef>(WKArrayGetItemAtIndex(wkRemovedItems, i)); - removedItems = g_list_prepend(removedItems, g_object_ref(G_OBJECT(priv->itemsMap.get(wkItem).get()))); - priv->itemsMap.remove(wkItem); + WebBackForwardListItem* webItem = static_cast<WebBackForwardListItem*>(webRemovedItems->at(i)); + removedItems = g_list_prepend(removedItems, g_object_ref(G_OBJECT(priv->itemsMap.get(webItem).get()))); + priv->itemsMap.remove(webItem); } g_signal_emit(backForwardList, signals[CHANGED], 0, addedItem, removedItems, NULL); @@ -175,7 +175,7 @@ WebKitBackForwardListItem* webkit_back_forward_list_get_current_item(WebKitBackF { g_return_val_if_fail(WEBKIT_IS_BACK_FORWARD_LIST(backForwardList), 0); - return webkitBackForwardListGetOrCreateItem(backForwardList, WKBackForwardListGetCurrentItem(backForwardList->priv->wkList)); + return webkitBackForwardListGetOrCreateItem(backForwardList, backForwardList->priv->backForwardItems->currentItem()); } /** @@ -191,7 +191,7 @@ WebKitBackForwardListItem* webkit_back_forward_list_get_back_item(WebKitBackForw { g_return_val_if_fail(WEBKIT_IS_BACK_FORWARD_LIST(backForwardList), 0); - return webkitBackForwardListGetOrCreateItem(backForwardList, WKBackForwardListGetBackItem(backForwardList->priv->wkList)); + return webkitBackForwardListGetOrCreateItem(backForwardList, backForwardList->priv->backForwardItems->backItem()); } /** @@ -207,7 +207,7 @@ WebKitBackForwardListItem* webkit_back_forward_list_get_forward_item(WebKitBackF { g_return_val_if_fail(WEBKIT_IS_BACK_FORWARD_LIST(backForwardList), 0); - return webkitBackForwardListGetOrCreateItem(backForwardList, WKBackForwardListGetForwardItem(backForwardList->priv->wkList)); + return webkitBackForwardListGetOrCreateItem(backForwardList, backForwardList->priv->backForwardItems->forwardItem()); } /** @@ -224,7 +224,7 @@ WebKitBackForwardListItem* webkit_back_forward_list_get_nth_item(WebKitBackForwa { g_return_val_if_fail(WEBKIT_IS_BACK_FORWARD_LIST(backForwardList), 0); - return webkitBackForwardListGetOrCreateItem(backForwardList, WKBackForwardListGetItemAtIndex(backForwardList->priv->wkList, index)); + return webkitBackForwardListGetOrCreateItem(backForwardList, backForwardList->priv->backForwardItems->itemAtIndex(index)); } /** @@ -239,7 +239,7 @@ guint webkit_back_forward_list_get_length(WebKitBackForwardList* backForwardList WebKitBackForwardListPrivate* priv = backForwardList->priv; guint currentItem = webkit_back_forward_list_get_current_item(backForwardList) ? 1 : 0; - return WKBackForwardListGetBackListCount(priv->wkList) + WKBackForwardListGetForwardListCount(priv->wkList) + currentItem; + return priv->backForwardItems->backListCount() + priv->backForwardItems->forwardListCount() + currentItem; } /** @@ -253,9 +253,7 @@ GList* webkit_back_forward_list_get_back_list(WebKitBackForwardList* backForward { g_return_val_if_fail(WEBKIT_IS_BACK_FORWARD_LIST(backForwardList), 0); - guint limit = WKBackForwardListGetBackListCount(backForwardList->priv->wkList); - WKRetainPtr<WKArrayRef> wkList(AdoptWK, WKBackForwardListCopyBackListWithLimit(backForwardList->priv->wkList, limit)); - return webkitBackForwardListCreateList(backForwardList, wkList.get()); + return webkit_back_forward_list_get_back_list_with_limit(backForwardList, backForwardList->priv->backForwardItems->backListCount()); } /** @@ -270,8 +268,8 @@ GList* webkit_back_forward_list_get_back_list_with_limit(WebKitBackForwardList* { g_return_val_if_fail(WEBKIT_IS_BACK_FORWARD_LIST(backForwardList), 0); - WKRetainPtr<WKArrayRef> wkList(AdoptWK, WKBackForwardListCopyBackListWithLimit(backForwardList->priv->wkList, limit)); - return webkitBackForwardListCreateList(backForwardList, wkList.get()); + WebKitBackForwardListPrivate* priv = backForwardList->priv; + return webkitBackForwardListCreateList(backForwardList, priv->backForwardItems->backListAsImmutableArrayWithLimit(limit).leakRef()); } /** @@ -285,9 +283,7 @@ GList* webkit_back_forward_list_get_forward_list(WebKitBackForwardList* backForw { g_return_val_if_fail(WEBKIT_IS_BACK_FORWARD_LIST(backForwardList), 0); - guint limit = WKBackForwardListGetForwardListCount(backForwardList->priv->wkList); - WKRetainPtr<WKArrayRef> wkList(AdoptWK, WKBackForwardListCopyForwardListWithLimit(backForwardList->priv->wkList, limit)); - return webkitBackForwardListCreateList(backForwardList, wkList.get()); + return webkit_back_forward_list_get_forward_list_with_limit(backForwardList, backForwardList->priv->backForwardItems->forwardListCount()); } /** @@ -302,6 +298,6 @@ GList* webkit_back_forward_list_get_forward_list_with_limit(WebKitBackForwardLis { g_return_val_if_fail(WEBKIT_IS_BACK_FORWARD_LIST(backForwardList), 0); - WKRetainPtr<WKArrayRef> wkList(AdoptWK, WKBackForwardListCopyForwardListWithLimit(backForwardList->priv->wkList, limit)); - return webkitBackForwardListCreateList(backForwardList, wkList.get()); + WebKitBackForwardListPrivate* priv = backForwardList->priv; + return webkitBackForwardListCreateList(backForwardList, priv->backForwardItems->forwardListAsImmutableArrayWithLimit(limit).leakRef()); } diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListItem.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListItem.cpp index c6a4b598c..8b22afc46 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListItem.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListItem.cpp @@ -29,7 +29,7 @@ using namespace WebKit; struct _WebKitBackForwardListItemPrivate { - WKRetainPtr<WKBackForwardListItemRef> wkListItem; + RefPtr<WebBackForwardListItem> webListItem; CString uri; CString title; CString originalURI; @@ -59,7 +59,7 @@ static void webkit_back_forward_list_item_class_init(WebKitBackForwardListItemCl g_type_class_add_private(listItemClass, sizeof(WebKitBackForwardListItemPrivate)); } -typedef HashMap<WKBackForwardListItemRef, WebKitBackForwardListItem*> HistoryItemsMap; +typedef HashMap<WebBackForwardListItem*, WebKitBackForwardListItem*> HistoryItemsMap; static HistoryItemsMap& historyItemsMap() { @@ -67,34 +67,33 @@ static HistoryItemsMap& historyItemsMap() return itemsMap; } -static void webkitBackForwardListItemFinalized(gpointer wkListItem, GObject* finalizedListItem) +static void webkitBackForwardListItemFinalized(gpointer webListItem, GObject* finalizedListItem) { - ASSERT(G_OBJECT(historyItemsMap().get(static_cast<WKBackForwardListItemRef>(wkListItem))) == finalizedListItem); - historyItemsMap().remove(static_cast<WKBackForwardListItemRef>(wkListItem)); + ASSERT(G_OBJECT(historyItemsMap().get(static_cast<WebBackForwardListItem*>(webListItem))) == finalizedListItem); + historyItemsMap().remove(static_cast<WebBackForwardListItem*>(webListItem)); } -WebKitBackForwardListItem* webkitBackForwardListItemGetOrCreate(WKBackForwardListItemRef wkListItem) +WebKitBackForwardListItem* webkitBackForwardListItemGetOrCreate(WebBackForwardListItem* webListItem) { - if (!wkListItem) + if (!webListItem) return 0; - WebKitBackForwardListItem* listItem = historyItemsMap().get(wkListItem); + WebKitBackForwardListItem* listItem = historyItemsMap().get(webListItem); if (listItem) return listItem; listItem = WEBKIT_BACK_FORWARD_LIST_ITEM(g_object_new(WEBKIT_TYPE_BACK_FORWARD_LIST_ITEM, NULL)); - listItem->priv->wkListItem = wkListItem; + listItem->priv->webListItem = webListItem; - g_object_weak_ref(G_OBJECT(listItem), webkitBackForwardListItemFinalized, - const_cast<OpaqueWKBackForwardListItem*>(wkListItem)); - historyItemsMap().set(wkListItem, listItem); + g_object_weak_ref(G_OBJECT(listItem), webkitBackForwardListItemFinalized, webListItem); + historyItemsMap().set(webListItem, listItem); return listItem; } -WKBackForwardListItemRef webkitBackForwardListItemGetWKItem(WebKitBackForwardListItem* listItem) +WebBackForwardListItem* webkitBackForwardListItemGetItem(WebKitBackForwardListItem* listItem) { - return listItem->priv->wkListItem.get(); + return listItem->priv->webListItem.get(); } /** @@ -113,11 +112,11 @@ const gchar* webkit_back_forward_list_item_get_uri(WebKitBackForwardListItem* li g_return_val_if_fail(WEBKIT_IS_BACK_FORWARD_LIST_ITEM(listItem), 0); WebKitBackForwardListItemPrivate* priv = listItem->priv; - WKRetainPtr<WKURLRef> wkURI(AdoptWK, WKBackForwardListItemCopyURL(priv->wkListItem.get())); - if (toImpl(wkURI.get())->string().isEmpty()) + String url = priv->webListItem->url(); + if (url.isEmpty()) return 0; - priv->uri = toImpl(wkURI.get())->string().utf8(); + priv->uri = url.utf8(); return priv->uri.data(); } @@ -133,11 +132,11 @@ const gchar* webkit_back_forward_list_item_get_title(WebKitBackForwardListItem* g_return_val_if_fail(WEBKIT_IS_BACK_FORWARD_LIST_ITEM(listItem), 0); WebKitBackForwardListItemPrivate* priv = listItem->priv; - WKRetainPtr<WKStringRef> wkTitle(AdoptWK, WKBackForwardListItemCopyTitle(priv->wkListItem.get())); - if (toImpl(wkTitle.get())->string().isEmpty()) + String title = priv->webListItem->title(); + if (title.isEmpty()) return 0; - priv->title = toImpl(wkTitle.get())->string().utf8(); + priv->title = title.utf8(); return priv->title.data(); } @@ -155,10 +154,10 @@ const gchar* webkit_back_forward_list_item_get_original_uri(WebKitBackForwardLis g_return_val_if_fail(WEBKIT_IS_BACK_FORWARD_LIST_ITEM(listItem), 0); WebKitBackForwardListItemPrivate* priv = listItem->priv; - WKRetainPtr<WKURLRef> wkOriginalURI(AdoptWK, WKBackForwardListItemCopyOriginalURL(priv->wkListItem.get())); - if (toImpl(wkOriginalURI.get())->string().isEmpty()) + String originalURL = priv->webListItem->originalURL(); + if (originalURL.isEmpty()) return 0; - priv->originalURI = toImpl(wkOriginalURI.get())->string().utf8(); + priv->originalURI = originalURL.utf8(); return priv->originalURI.data(); } diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListPrivate.h index 333e68d18..e3ec77a3d 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListPrivate.h +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListPrivate.h @@ -28,11 +28,12 @@ #include "WebBackForwardList.h" #include "WebKitBackForwardList.h" -#include <WebKit2/WebKit2_C.h> -WebKitBackForwardList* webkitBackForwardListCreate(WKBackForwardListRef); -WebKitBackForwardListItem* webkitBackForwardListItemGetOrCreate(WKBackForwardListItemRef); -WKBackForwardListItemRef webkitBackForwardListItemGetWKItem(WebKitBackForwardListItem*); -void webkitBackForwardListChanged(WebKitBackForwardList*, WKBackForwardListItemRef wkAddedItem, WKArrayRef wkRemovedItems); +using namespace WebKit; + +WebKitBackForwardList* webkitBackForwardListCreate(WebBackForwardList*); +WebKitBackForwardListItem* webkitBackForwardListItemGetOrCreate(WebBackForwardListItem*); +WebBackForwardListItem* webkitBackForwardListItemGetItem(WebKitBackForwardListItem*); +void webkitBackForwardListChanged(WebKitBackForwardList*, WebBackForwardListItem* webAddedItem, ImmutableArray* webRemovedItems); #endif // WebKitBackForwardListPrivate_h diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenu.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenu.cpp index f05fbf93f..510c25dbc 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenu.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenu.cpp @@ -20,10 +20,11 @@ #include "config.h" #include "WebKitContextMenu.h" +#include "ImmutableArray.h" +#include "WebContextMenuItem.h" #include "WebKitContextMenuItemPrivate.h" #include "WebKitContextMenuPrivate.h" -using namespace WebKit; using namespace WebCore; struct _WebKitContextMenuPrivate { @@ -64,12 +65,12 @@ void webkitContextMenuPopulate(WebKitContextMenu* menu, Vector<ContextMenuItem>& } } -WebKitContextMenu* webkitContextMenuCreate(WKArrayRef wkItems) +WebKitContextMenu* webkitContextMenuCreate(ImmutableArray* items) { WebKitContextMenu* menu = webkit_context_menu_new(); - for (size_t i = 0; i < WKArrayGetSize(wkItems); ++i) { - WKContextMenuItemRef wkItem = static_cast<WKContextMenuItemRef>(WKArrayGetItemAtIndex(wkItems, i)); - webkit_context_menu_prepend(menu, webkitContextMenuItemCreate(wkItem)); + for (size_t i = 0; i < items->size(); ++i) { + WebContextMenuItem* item = static_cast<WebContextMenuItem*>(items->at(i)); + webkit_context_menu_prepend(menu, webkitContextMenuItemCreate(item)); } menu->priv->items = g_list_reverse(menu->priv->items); diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItem.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItem.cpp index b2b22fe41..0887f7749 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItem.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItem.cpp @@ -34,7 +34,6 @@ #include <wtf/gobject/GOwnPtr.h> #include <wtf/gobject/GRefPtr.h> -using namespace WebKit; using namespace WebCore; struct _WebKitContextMenuItemPrivate { @@ -91,10 +90,10 @@ static void webkitContextMenuItemSetSubMenu(WebKitContextMenuItem* item, GRefPtr webkitContextMenuSetParentItem(subMenu.get(), item); } -WebKitContextMenuItem* webkitContextMenuItemCreate(WKContextMenuItemRef wkItem) +WebKitContextMenuItem* webkitContextMenuItemCreate(WebContextMenuItem* webItem) { WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(g_object_new(WEBKIT_TYPE_CONTEXT_MENU_ITEM, NULL)); - WebContextMenuItemData* itemData = toImpl(wkItem)->data(); + WebContextMenuItemData* itemData = webItem->data(); item->priv->menuItem = WTF::adoptPtr(new ContextMenuItem(itemData->type(), itemData->action(), itemData->title(), itemData->enabled(), itemData->checked())); const Vector<WebContextMenuItemData>& subMenu = itemData->submenu(); if (!subMenu.size()) @@ -104,7 +103,7 @@ WebKitContextMenuItem* webkitContextMenuItemCreate(WKContextMenuItemRef wkItem) subMenuItems->reserveCapacity(subMenu.size()); for (size_t i = 0; i < subMenu.size(); ++i) subMenuItems->append(WebContextMenuItem::create(subMenu[i]).get()); - webkitContextMenuItemSetSubMenu(item, adoptGRef(webkitContextMenuCreate(toAPI(subMenuItems.get())))); + webkitContextMenuItemSetSubMenu(item, adoptGRef(webkitContextMenuCreate(subMenuItems.get()))); return item; } diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItemPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItemPrivate.h index 9c88003bf..022fcec88 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItemPrivate.h +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItemPrivate.h @@ -23,7 +23,9 @@ #include "WebKitContextMenuItem.h" #include "WebKitPrivate.h" -WebKitContextMenuItem* webkitContextMenuItemCreate(WKContextMenuItemRef); +using namespace WebKit; + +WebKitContextMenuItem* webkitContextMenuItemCreate(WebContextMenuItem*); GtkMenuItem* webkitContextMenuItemRelease(WebKitContextMenuItem*); void webkitContextMenuItemSetSubMenuFromGtkMenu(WebKitContextMenuItem*, GtkMenu*); diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuPrivate.h index 6d3f18015..3a39dff00 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuPrivate.h +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuPrivate.h @@ -23,7 +23,9 @@ #include "WebKitContextMenu.h" #include "WebKitPrivate.h" -WebKitContextMenu* webkitContextMenuCreate(WKArrayRef wkItems); +using namespace WebKit; + +WebKitContextMenu* webkitContextMenuCreate(ImmutableArray* items); void webkitContextMenuPopulate(WebKitContextMenu*, Vector<WebCore::ContextMenuItem>&); void webkitContextMenuSetParentItem(WebKitContextMenu*, WebKitContextMenuItem*); WebKitContextMenuItem* webkitContextMenuGetParentItem(WebKitContextMenu*); diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp index 8790c7cbf..037b69171 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp @@ -27,8 +27,6 @@ #include <wtf/gobject/GRefPtr.h> #include <wtf/text/CString.h> -using namespace WebKit; - enum { CHANGED, @@ -36,7 +34,7 @@ enum { }; struct _WebKitCookieManagerPrivate { - WKRetainPtr<WKCookieManagerRef> wkCookieManager; + RefPtr<WebCookieManagerProxy> webCookieManager; }; static guint signals[LAST_SIGNAL] = { 0, }; @@ -46,9 +44,9 @@ G_DEFINE_TYPE(WebKitCookieManager, webkit_cookie_manager, G_TYPE_OBJECT) COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_COOKIE_PERSISTENT_STORAGE_TEXT, SoupCookiePersistentStorageText); COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_COOKIE_PERSISTENT_STORAGE_SQLITE, SoupCookiePersistentStorageSQLite); -COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS, kWKHTTPCookieAcceptPolicyAlways); -COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_COOKIE_POLICY_ACCEPT_NEVER, kWKHTTPCookieAcceptPolicyNever); -COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY, kWKHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain); +COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS, HTTPCookieAcceptPolicyAlways); +COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_COOKIE_POLICY_ACCEPT_NEVER, HTTPCookieAcceptPolicyNever); +COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY, HTTPCookieAcceptPolicyOnlyFromMainDocumentDomain); static void webkit_cookie_manager_init(WebKitCookieManager* manager) { @@ -60,7 +58,7 @@ static void webkit_cookie_manager_init(WebKitCookieManager* manager) static void webkitCookieManagerFinalize(GObject* object) { WebKitCookieManagerPrivate* priv = WEBKIT_COOKIE_MANAGER(object)->priv; - WKCookieManagerStopObservingCookieChanges(priv->wkCookieManager.get()); + priv->webCookieManager->stopObservingCookieChanges(); priv->~WebKitCookieManagerPrivate(); G_OBJECT_CLASS(webkit_cookie_manager_parent_class)->finalize(object); } @@ -92,18 +90,18 @@ static void cookiesDidChange(WKCookieManagerRef, const void* clientInfo) g_signal_emit(WEBKIT_COOKIE_MANAGER(clientInfo), signals[CHANGED], 0); } -WebKitCookieManager* webkitCookieManagerCreate(WKCookieManagerRef wkCookieManager) +WebKitCookieManager* webkitCookieManagerCreate(WebCookieManagerProxy* webCookieManager) { WebKitCookieManager* manager = WEBKIT_COOKIE_MANAGER(g_object_new(WEBKIT_TYPE_COOKIE_MANAGER, NULL)); - manager->priv->wkCookieManager = wkCookieManager; + manager->priv->webCookieManager = webCookieManager; WKCookieManagerClient wkCookieManagerClient = { kWKCookieManagerClientCurrentVersion, manager, // clientInfo cookiesDidChange }; - WKCookieManagerSetClient(wkCookieManager, &wkCookieManagerClient); - WKCookieManagerStartObservingCookieChanges(wkCookieManager); + WKCookieManagerSetClient(toAPI(webCookieManager), &wkCookieManagerClient); + manager->priv->webCookieManager->startObservingCookieChanges(); return manager; } @@ -127,9 +125,9 @@ void webkit_cookie_manager_set_persistent_storage(WebKitCookieManager* manager, g_return_if_fail(WEBKIT_IS_COOKIE_MANAGER(manager)); g_return_if_fail(filename); - WKCookieManagerStopObservingCookieChanges(manager->priv->wkCookieManager.get()); - toImpl(manager->priv->wkCookieManager.get())->setCookiePersistentStorage(String::fromUTF8(filename), storage); - WKCookieManagerStartObservingCookieChanges(manager->priv->wkCookieManager.get()); + manager->priv->webCookieManager->stopObservingCookieChanges(); + manager->priv->webCookieManager->setCookiePersistentStorage(String::fromUTF8(filename), storage); + manager->priv->webCookieManager->startObservingCookieChanges(); } /** @@ -143,7 +141,7 @@ void webkit_cookie_manager_set_accept_policy(WebKitCookieManager* manager, WebKi { g_return_if_fail(WEBKIT_IS_COOKIE_MANAGER(manager)); - WKCookieManagerSetHTTPCookieAcceptPolicy(manager->priv->wkCookieManager.get(), policy); + manager->priv->webCookieManager->setHTTPCookieAcceptPolicy(policy); } struct GetAcceptPolicyAsyncData { @@ -186,7 +184,7 @@ void webkit_cookie_manager_get_accept_policy(WebKitCookieManager* manager, GCanc data->cancellable = cancellable; g_simple_async_result_set_op_res_gpointer(result, data, reinterpret_cast<GDestroyNotify>(destroyGetAcceptPolicyAsyncData)); - WKCookieManagerGetHTTPCookieAcceptPolicy(manager->priv->wkCookieManager.get(), result, webkitCookieManagerGetAcceptPolicyCallback); + manager->priv->webCookieManager->getHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicyCallback::create(result, webkitCookieManagerGetAcceptPolicyCallback)); } /** @@ -228,10 +226,11 @@ static void webkitCookieManagerGetDomainsWithCookiesCallback(WKArrayRef wkDomain if (g_cancellable_set_error_if_cancelled(data->cancellable.get(), &error)) g_simple_async_result_take_error(result.get(), error); else { + ImmutableArray* domains = toImpl(wkDomains); data->domains = adoptGRef(g_ptr_array_new_with_free_func(g_free)); - for (size_t i = 0; i < WKArrayGetSize(wkDomains); ++i) { - WKStringRef wkDomain = static_cast<WKStringRef>(WKArrayGetItemAtIndex(wkDomains, i)); - String domain = toImpl(wkDomain)->string(); + for (size_t i = 0; i < domains->size(); ++i) { + WebString* domainString = static_cast<WebString*>(domains->at(i)); + String domain = domainString->string(); if (domain.isEmpty()) continue; g_ptr_array_add(data->domains.get(), g_strdup(domain.utf8().data())); @@ -262,7 +261,7 @@ void webkit_cookie_manager_get_domains_with_cookies(WebKitCookieManager* manager GetDomainsWithCookiesAsyncData* data = createGetDomainsWithCookiesAsyncData(); data->cancellable = cancellable; g_simple_async_result_set_op_res_gpointer(result, data, reinterpret_cast<GDestroyNotify>(destroyGetDomainsWithCookiesAsyncData)); - WKCookieManagerGetHostnamesWithCookies(manager->priv->wkCookieManager.get(), result, webkitCookieManagerGetDomainsWithCookiesCallback); + manager->priv->webCookieManager->getHostnamesWithCookies(ArrayCallback::create(result, webkitCookieManagerGetDomainsWithCookiesCallback)); } /** @@ -305,8 +304,7 @@ void webkit_cookie_manager_delete_cookies_for_domain(WebKitCookieManager* manage g_return_if_fail(WEBKIT_IS_COOKIE_MANAGER(manager)); g_return_if_fail(domain); - WKRetainPtr<WKStringRef> wkDomain(AdoptWK, WKStringCreateWithUTF8CString(domain)); - WKCookieManagerDeleteCookiesForHostname(manager->priv->wkCookieManager.get(), wkDomain.get()); + manager->priv->webCookieManager->deleteCookiesForHostname(String::fromUTF8(domain)); } /** @@ -319,5 +317,5 @@ void webkit_cookie_manager_delete_all_cookies(WebKitCookieManager* manager) { g_return_if_fail(WEBKIT_IS_COOKIE_MANAGER(manager)); - WKCookieManagerDeleteAllCookies(manager->priv->wkCookieManager.get()); + manager->priv->webCookieManager->deleteAllCookies(); } diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitCookieManagerPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitCookieManagerPrivate.h index a387af907..528d1fa29 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitCookieManagerPrivate.h +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitCookieManagerPrivate.h @@ -23,6 +23,8 @@ #include "WebKitCookieManager.h" #include "WebKitPrivate.h" -WebKitCookieManager* webkitCookieManagerCreate(WKCookieManagerRef); +using namespace WebKit; + +WebKitCookieManager* webkitCookieManagerCreate(WebCookieManagerProxy*); #endif // WebKitCookieManagerPrivate_h diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp index aa2623783..620ac96db 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp @@ -31,7 +31,6 @@ #include <wtf/gobject/GOwnPtr.h> #include <wtf/gobject/GRefPtr.h> -using namespace WebKit; using namespace WebCore; enum { @@ -53,7 +52,7 @@ enum { }; struct _WebKitDownloadPrivate { - WKRetainPtr<WKDownloadRef> wkDownload; + RefPtr<DownloadProxy> download; GRefPtr<WebKitURIRequest> request; GRefPtr<WebKitURIResponse> response; @@ -264,11 +263,11 @@ static void webkit_download_class_init(WebKitDownloadClass* downloadClass) g_type_class_add_private(downloadClass, sizeof(WebKitDownloadPrivate)); } -WebKitDownload* webkitDownloadCreate(WKDownloadRef wkDownload) +WebKitDownload* webkitDownloadCreate(DownloadProxy* downloadProxy) { - ASSERT(wkDownload); + ASSERT(downloadProxy); WebKitDownload* download = WEBKIT_DOWNLOAD(g_object_new(WEBKIT_TYPE_DOWNLOAD, NULL)); - download->priv->wkDownload = wkDownload; + download->priv->download = downloadProxy; return download; } @@ -379,8 +378,8 @@ WebKitURIRequest* webkit_download_get_request(WebKitDownload* download) WebKitDownloadPrivate* priv = download->priv; if (!priv->request) - priv->request = adoptGRef(webkitURIRequestCreateForResourceRequest(toImpl(priv->wkDownload.get())->request())); - return download->priv->request.get(); + priv->request = adoptGRef(webkitURIRequestCreateForResourceRequest(priv->download->request())); + return priv->request.get(); } /** @@ -465,7 +464,7 @@ void webkit_download_cancel(WebKitDownload* download) g_return_if_fail(WEBKIT_IS_DOWNLOAD(download)); download->priv->isCancelled = true; - WKDownloadCancel(download->priv->wkDownload.get()); + download->priv->download->cancel(); } /** diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitDownloadPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitDownloadPrivate.h index 6f4b5363c..ce429d28e 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitDownloadPrivate.h +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitDownloadPrivate.h @@ -25,7 +25,9 @@ #include <WebCore/ResourceError.h> #include <wtf/text/CString.h> -WebKitDownload* webkitDownloadCreate(WKDownloadRef); +using namespace WebKit; + +WebKitDownload* webkitDownloadCreate(DownloadProxy*); bool webkitDownloadIsCancelled(WebKitDownload*); void webkitDownloadSetResponse(WebKitDownload*, WebKitURIResponse*); void webkitDownloadNotifyProgress(WebKitDownload*, guint64 bytesReceived); diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp index 51f186842..1079af778 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp @@ -20,6 +20,7 @@ #include "config.h" #include "WebKitGeolocationPermissionRequest.h" +#include "GeolocationPermissionRequestProxy.h" #include "WebKitGeolocationPermissionRequestPrivate.h" #include "WebKitPermissionRequest.h" @@ -39,7 +40,7 @@ G_DEFINE_TYPE_WITH_CODE(WebKitGeolocationPermissionRequest, webkit_geolocation_p webkit_permission_request_interface_init)) struct _WebKitGeolocationPermissionRequestPrivate { - WKRetainPtr<WKGeolocationPermissionRequestRef> wkRequest; + RefPtr<GeolocationPermissionRequestProxy> request; bool madeDecision; }; @@ -53,7 +54,7 @@ static void webkitGeolocationPermissionRequestAllow(WebKitPermissionRequest* req if (priv->madeDecision) return; - WKGeolocationPermissionRequestAllow(priv->wkRequest.get()); + priv->request->allow(); priv->madeDecision = true; } @@ -67,7 +68,7 @@ static void webkitGeolocationPermissionRequestDeny(WebKitPermissionRequest* requ if (priv->madeDecision) return; - WKGeolocationPermissionRequestDeny(priv->wkRequest.get()); + priv->request->deny(); priv->madeDecision = true; } @@ -89,7 +90,7 @@ static void webkitGeolocationPermissionRequestFinalize(GObject* object) // Default behaviour when no decision has been made is denying the request. if (!priv->madeDecision) - WKGeolocationPermissionRequestDeny(priv->wkRequest.get()); + priv->request->deny(); priv->~WebKitGeolocationPermissionRequestPrivate(); G_OBJECT_CLASS(webkit_geolocation_permission_request_parent_class)->finalize(object); @@ -102,9 +103,9 @@ static void webkit_geolocation_permission_request_class_init(WebKitGeolocationPe g_type_class_add_private(klass, sizeof(WebKitGeolocationPermissionRequestPrivate)); } -WebKitGeolocationPermissionRequest* webkitGeolocationPermissionRequestCreate(WKGeolocationPermissionRequestRef wkRequest) +WebKitGeolocationPermissionRequest* webkitGeolocationPermissionRequestCreate(GeolocationPermissionRequestProxy* request) { WebKitGeolocationPermissionRequest* geolocationPermissionRequest = WEBKIT_GEOLOCATION_PERMISSION_REQUEST(g_object_new(WEBKIT_TYPE_GEOLOCATION_PERMISSION_REQUEST, NULL)); - geolocationPermissionRequest->priv->wkRequest = wkRequest; + geolocationPermissionRequest->priv->request = request; return geolocationPermissionRequest; } diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h index e6de68753..94f5cba4a 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h @@ -23,6 +23,8 @@ #include "WebKitGeolocationPermissionRequest.h" #include "WebKitPrivate.h" -WebKitGeolocationPermissionRequest* webkitGeolocationPermissionRequestCreate(WKGeolocationPermissionRequestRef); +using namespace WebKit; + +WebKitGeolocationPermissionRequest* webkitGeolocationPermissionRequestCreate(GeolocationPermissionRequestProxy*); #endif // WebKitGeolocationPermissionRequestPrivate_h diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.cpp index 648c8093b..36f0f23fd 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.cpp @@ -26,6 +26,9 @@ #include "config.h" #include "WebKitGeolocationProvider.h" +#include "WebGeolocationManagerProxy.h" +#include "WebGeolocationPosition.h" + #if ENABLE(GEOLOCATION) static inline WebKitGeolocationProvider* toGeolocationProvider(const void* clientInfo) @@ -48,16 +51,16 @@ WebKitGeolocationProvider::~WebKitGeolocationProvider() m_provider.stopUpdating(); } -PassRefPtr<WebKitGeolocationProvider> WebKitGeolocationProvider::create(WKGeolocationManagerRef wkGeolocationManager) +PassRefPtr<WebKitGeolocationProvider> WebKitGeolocationProvider::create(WebGeolocationManagerProxy* geolocationManager) { - return adoptRef(new WebKitGeolocationProvider(wkGeolocationManager)); + return adoptRef(new WebKitGeolocationProvider(geolocationManager)); } -WebKitGeolocationProvider::WebKitGeolocationProvider(WKGeolocationManagerRef wkGeolocationManager) - : m_wkGeolocationManager(wkGeolocationManager) +WebKitGeolocationProvider::WebKitGeolocationProvider(WebGeolocationManagerProxy* geolocationManager) + : m_geolocationManager(geolocationManager) , m_provider(this) { - ASSERT(wkGeolocationManager); + ASSERT(geolocationManager); WKGeolocationProvider wkGeolocationProvider = { kWKGeolocationProviderCurrentVersion, @@ -65,7 +68,7 @@ WebKitGeolocationProvider::WebKitGeolocationProvider(WKGeolocationManagerRef wkG startUpdatingCallback, stopUpdatingCallback }; - WKGeolocationManagerSetProvider(m_wkGeolocationManager.get(), &wkGeolocationProvider); + WKGeolocationManagerSetProvider(toAPI(geolocationManager), &wkGeolocationProvider); } void WebKitGeolocationProvider::startUpdating() @@ -80,13 +83,13 @@ void WebKitGeolocationProvider::stopUpdating() void WebKitGeolocationProvider::notifyPositionChanged(int timestamp, double latitude, double longitude, double altitude, double accuracy, double altitudeAccuracy) { - WKRetainPtr<WKGeolocationPositionRef> wkGeolocationPosition(AdoptWK, WKGeolocationPositionCreate(timestamp, latitude, longitude, accuracy)); - WKGeolocationManagerProviderDidChangePosition(m_wkGeolocationManager.get(), wkGeolocationPosition.get()); + RefPtr<WebGeolocationPosition> position = WebGeolocationPosition::create(timestamp, latitude, longitude, accuracy, true, altitude, true, altitudeAccuracy, false, 0, false, 0); + m_geolocationManager->providerDidChangePosition(position.get()); } void WebKitGeolocationProvider::notifyErrorOccurred(const char* message) { - WKGeolocationManagerProviderDidFailToDeterminePosition(m_wkGeolocationManager.get()); + m_geolocationManager->providerDidFailToDeterminePosition(); } #endif // ENABLE(GEOLOCATION) diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.h b/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.h index a02bfcb08..11c7c1a2f 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.h +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.h @@ -28,22 +28,24 @@ #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> +using namespace WebKit; + class WebKitGeolocationProvider : public RefCounted<WebKitGeolocationProvider>, public WebCore::GeolocationProviderGeoclueClient { public: virtual ~WebKitGeolocationProvider(); - static PassRefPtr<WebKitGeolocationProvider> create(WKGeolocationManagerRef); + static PassRefPtr<WebKitGeolocationProvider> create(WebGeolocationManagerProxy*); void startUpdating(); void stopUpdating(); private: - WebKitGeolocationProvider(WKGeolocationManagerRef); + WebKitGeolocationProvider(WebGeolocationManagerProxy*); // GeolocationProviderGeoclueClient interface. virtual void notifyPositionChanged(int, double, double, double, double, double); virtual void notifyErrorOccurred(const char*); - WKRetainPtr<WKGeolocationManagerRef> m_wkGeolocationManager; + RefPtr<WebGeolocationManagerProxy> m_geolocationManager; WebCore::GeolocationProviderGeoclue m_provider; }; diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp index 457c40141..0b9275fdf 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp @@ -112,7 +112,7 @@ static void didChangeProgress(WKPageRef page, const void* clientInfo) static void didChangeBackForwardList(WKPageRef page, WKBackForwardListItemRef addedItem, WKArrayRef removedItems, const void* clientInfo) { - webkitBackForwardListChanged(webkit_web_view_get_back_forward_list(WEBKIT_WEB_VIEW(clientInfo)), addedItem, removedItems); + webkitBackForwardListChanged(webkit_web_view_get_back_forward_list(WEBKIT_WEB_VIEW(clientInfo)), toImpl(addedItem), toImpl(removedItems)); } void attachLoaderClientToView(WebKitWebView* webView) diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.cpp index babafe651..3bb2434ce 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.cpp @@ -29,7 +29,7 @@ using namespace WebKit; static void didReceiveURIRequest(WKSoupRequestManagerRef soupRequestManagerRef, WKURLRef urlRef, WKPageRef initiatingPageRef, uint64_t requestID, const void* clientInfo) { WebKitWebContext* webContext = WEBKIT_WEB_CONTEXT(clientInfo); - GRefPtr<WebKitURISchemeRequest> request = adoptGRef(webkitURISchemeRequestCreate(webContext, soupRequestManagerRef, urlRef, initiatingPageRef, requestID)); + GRefPtr<WebKitURISchemeRequest> request = adoptGRef(webkitURISchemeRequestCreate(webContext, toImpl(soupRequestManagerRef), toImpl(urlRef), toImpl(initiatingPageRef), requestID)); webkitWebContextReceivedURIRequest(webContext, request.get()); } diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp index 1925e6a21..1ca453b2e 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp @@ -148,7 +148,7 @@ static void runOpenPanel(WKPageRef page, WKFrameRef frame, WKOpenPanelParameters static void decidePolicyForGeolocationPermissionRequest(WKPageRef, WKFrameRef, WKSecurityOriginRef, WKGeolocationPermissionRequestRef request, const void* clientInfo) { - GRefPtr<WebKitGeolocationPermissionRequest> geolocationPermissionRequest = adoptGRef(webkitGeolocationPermissionRequestCreate(request)); + GRefPtr<WebKitGeolocationPermissionRequest> geolocationPermissionRequest = adoptGRef(webkitGeolocationPermissionRequestCreate(toImpl(request))); webkitWebViewMakePermissionRequest(WEBKIT_WEB_VIEW(clientInfo), WEBKIT_PERMISSION_REQUEST(geolocationPermissionRequest.get())); } diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp index e69831f29..6f46dbeda 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp @@ -20,25 +20,25 @@ #include "config.h" #include "WebKitURISchemeRequest.h" +#include "WebData.h" #include "WebKitURISchemeRequestPrivate.h" #include "WebKitWebContextPrivate.h" #include "WebKitWebView.h" #include "WebPageProxy.h" +#include "WebSoupRequestManagerProxy.h" #include <WebCore/GOwnPtrSoup.h> #include <libsoup/soup.h> #include <wtf/gobject/GRefPtr.h> #include <wtf/text/CString.h> -using namespace WebKit; - static const unsigned int gReadBufferSize = 8192; G_DEFINE_TYPE(WebKitURISchemeRequest, webkit_uri_scheme_request, G_TYPE_OBJECT) struct _WebKitURISchemeRequestPrivate { WebKitWebContext* webContext; - WKRetainPtr<WKSoupRequestManagerRef> wkRequestManager; - WKRetainPtr<WKPageRef> wkInitiatingPage; + RefPtr<WebSoupRequestManagerProxy> webRequestManager; + RefPtr<WebPageProxy> initiatingPage; uint64_t requestID; CString uri; GOwnPtr<SoupURI> soupURI; @@ -71,13 +71,13 @@ static void webkit_uri_scheme_request_class_init(WebKitURISchemeRequestClass* re g_type_class_add_private(requestClass, sizeof(WebKitURISchemeRequestPrivate)); } -WebKitURISchemeRequest* webkitURISchemeRequestCreate(WebKitWebContext* webContext, WKSoupRequestManagerRef wkRequestManager, WKURLRef wkURL, WKPageRef wkInitiatingPage, uint64_t requestID) +WebKitURISchemeRequest* webkitURISchemeRequestCreate(WebKitWebContext* webContext, WebSoupRequestManagerProxy* webRequestManager, WebURL* webURL, WebPageProxy* initiatingPage, uint64_t requestID) { WebKitURISchemeRequest* request = WEBKIT_URI_SCHEME_REQUEST(g_object_new(WEBKIT_TYPE_URI_SCHEME_REQUEST, NULL)); request->priv->webContext = webContext; - request->priv->wkRequestManager = wkRequestManager; - request->priv->uri = toImpl(wkURL)->string().utf8(); - request->priv->wkInitiatingPage = wkInitiatingPage; + request->priv->webRequestManager = webRequestManager; + request->priv->uri = webURL->string().utf8(); + request->priv->initiatingPage = initiatingPage; request->priv->requestID = requestID; return request; } @@ -154,7 +154,7 @@ WebKitWebView* webkit_uri_scheme_request_get_web_view(WebKitURISchemeRequest* re { g_return_val_if_fail(WEBKIT_IS_URI_SCHEME_REQUEST(request), 0); - return WEBKIT_WEB_VIEW(toImpl(request->priv->wkInitiatingPage.get())->viewWidget()); + return WEBKIT_WEB_VIEW(request->priv->initiatingPage->viewWidget()); } static void webkitURISchemeRequestReadCallback(GInputStream* inputStream, GAsyncResult* result, WebKitURISchemeRequest* schemeRequest) @@ -168,14 +168,13 @@ static void webkitURISchemeRequestReadCallback(GInputStream* inputStream, GAsync } WebKitURISchemeRequestPrivate* priv = request->priv; - WKRetainPtr<WKDataRef> wkData(AdoptWK, WKDataCreate(bytesRead ? reinterpret_cast<const unsigned char*>(priv->readBuffer) : 0, bytesRead)); + RefPtr<WebData> webData = WebData::create(reinterpret_cast<const unsigned char*>(priv->readBuffer), bytesRead); if (!priv->bytesRead) { - // First chunk read. In case of empty reply an empty WKDataRef is sent to the WebProcess. - WKRetainPtr<WKStringRef> wkMimeType = !priv->mimeType.isNull() ? adoptWK(WKStringCreateWithUTF8CString(priv->mimeType.data())) : 0; - WKSoupRequestManagerDidHandleURIRequest(priv->wkRequestManager.get(), wkData.get(), priv->streamLength, wkMimeType.get(), priv->requestID); + // First chunk read. In case of empty reply an empty WebData is sent to the WebProcess. + priv->webRequestManager->didHandleURIRequest(webData.get(), priv->streamLength, String::fromUTF8(priv->mimeType.data()), priv->requestID); } else if (bytesRead || (!bytesRead && !priv->streamLength)) { - // Subsequent chunk read. We only send an empty WKDataRef to the WebProcess when stream length is unknown. - WKSoupRequestManagerDidReceiveURIRequestData(priv->wkRequestManager.get(), wkData.get(), priv->requestID); + // Subsequent chunk read. We only send an empty WebData to the WebProcess when stream length is unknown. + priv->webRequestManager->didReceiveURIRequestData(webData.get(), priv->requestID); } if (!bytesRead) { diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h index b7c011f66..ef3dd53d6 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h @@ -23,9 +23,10 @@ #include "WebKitPrivate.h" #include "WebKitURISchemeRequest.h" #include "WebKitWebContext.h" -#include <WebKit2/WKSoupRequestManager.h> -WebKitURISchemeRequest* webkitURISchemeRequestCreate(WebKitWebContext*, WKSoupRequestManagerRef, WKURLRef, WKPageRef, uint64_t requestID); +using namespace WebKit; + +WebKitURISchemeRequest* webkitURISchemeRequestCreate(WebKitWebContext*, WebSoupRequestManagerProxy*, WebURL*, WebPageProxy*, uint64_t requestID); uint64_t webkitURISchemeRequestGetID(WebKitURISchemeRequest*); void webkitURISchemeRequestCancel(WebKitURISchemeRequest*); diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp index dab18a87d..0c29b2440 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp @@ -164,7 +164,7 @@ static gpointer createDefaultWebContext(gpointer) attachRequestManagerClientToContext(webContext.get()); #if ENABLE(GEOLOCATION) - priv->geolocationProvider = WebKitGeolocationProvider::create(toAPI(priv->context->geolocationManagerProxy())); + priv->geolocationProvider = WebKitGeolocationProvider::create(priv->context->geolocationManagerProxy()); #endif #if ENABLE(SPELLCHECK) priv->textChecker = WebKitTextChecker::create(); @@ -299,7 +299,7 @@ WebKitDownload* webkit_web_context_download_uri(WebKitWebContext* context, const g_return_val_if_fail(uri, 0); DownloadProxy* downloadProxy = context->priv->context->download(0, WebCore::ResourceRequest(String::fromUTF8(uri))); - WebKitDownload* download = webkitDownloadCreate(toAPI(downloadProxy)); + WebKitDownload* download = webkitDownloadCreate(downloadProxy); downloadsMap().set(downloadProxy, download); return download; } @@ -318,7 +318,7 @@ WebKitCookieManager* webkit_web_context_get_cookie_manager(WebKitWebContext* con WebKitWebContextPrivate* priv = context->priv; if (!priv->cookieManager) - priv->cookieManager = adoptGRef(webkitCookieManagerCreate(toAPI(priv->context->cookieManagerProxy()))); + priv->cookieManager = adoptGRef(webkitCookieManagerCreate(priv->context->cookieManagerProxy())); return priv->cookieManager.get(); } @@ -688,7 +688,7 @@ WebKitDownload* webkitWebContextGetOrCreateDownload(DownloadProxy* downloadProxy if (download) return download.get(); - download = adoptGRef(webkitDownloadCreate(toAPI(downloadProxy))); + download = adoptGRef(webkitDownloadCreate(downloadProxy)); downloadsMap().set(downloadProxy, download.get()); return download.get(); } diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebInspector.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWebInspector.cpp index 25023cf94..d384ac067 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebInspector.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebInspector.cpp @@ -27,8 +27,6 @@ #include <wtf/gobject/GRefPtr.h> #include <wtf/text/CString.h> -using namespace WebKit; - enum { OPEN_WINDOW, BRING_TO_FRONT, @@ -47,7 +45,7 @@ enum { }; struct _WebKitWebInspectorPrivate { - WKRetainPtr<WKInspectorRef> wkInspector; + RefPtr<WebInspectorProxy> webInspector; CString inspectedURI; unsigned attachedHeight; }; @@ -75,7 +73,7 @@ static void webkitWebInspectorGetProperty(GObject* object, guint propId, GValue* static void webkitWebInspectorFinalize(GObject* object) { WebKitWebInspectorPrivate* priv = WEBKIT_WEB_INSPECTOR(object)->priv; - WKInspectorSetInspectorClientGtk(priv->wkInspector.get(), 0); + WKInspectorSetInspectorClientGtk(toAPI(priv->webInspector.get()), 0); priv->~WebKitWebInspectorPrivate(); G_OBJECT_CLASS(webkit_web_inspector_parent_class)->finalize(object); } @@ -295,10 +293,10 @@ static void didChangeAttachedHeight(WKInspectorRef, unsigned height, const void* g_object_notify(G_OBJECT(inspector), "attached-height"); } -WebKitWebInspector* webkitWebInspectorCreate(WKInspectorRef wkInspector) +WebKitWebInspector* webkitWebInspectorCreate(WebInspectorProxy* webInspector) { WebKitWebInspector* inspector = WEBKIT_WEB_INSPECTOR(g_object_new(WEBKIT_TYPE_WEB_INSPECTOR, NULL)); - inspector->priv->wkInspector = wkInspector; + inspector->priv->webInspector = webInspector; WKInspectorClientGtk wkInspectorClientGtk = { kWKInspectorClientGtkCurrentVersion, @@ -311,7 +309,7 @@ WebKitWebInspector* webkitWebInspectorCreate(WKInspectorRef wkInspector) detach, didChangeAttachedHeight }; - WKInspectorSetInspectorClientGtk(wkInspector, &wkInspectorClientGtk); + WKInspectorSetInspectorClientGtk(toAPI(webInspector), &wkInspectorClientGtk); return inspector; } @@ -330,7 +328,7 @@ WebKitWebViewBase* webkit_web_inspector_get_web_view(WebKitWebInspector* inspect { g_return_val_if_fail(WEBKIT_IS_WEB_INSPECTOR(inspector), 0); - return WEBKIT_WEB_VIEW_BASE(toImpl(inspector->priv->wkInspector.get())->inspectorView()); + return WEBKIT_WEB_VIEW_BASE(inspector->priv->webInspector->inspectorView()); } /** @@ -364,7 +362,7 @@ gboolean webkit_web_inspector_is_attached(WebKitWebInspector* inspector) { g_return_val_if_fail(WEBKIT_IS_WEB_INSPECTOR(inspector), FALSE); - return WKInspectorIsAttached(inspector->priv->wkInspector.get()); + return inspector->priv->webInspector->isAttached(); } /** @@ -378,9 +376,9 @@ void webkit_web_inspector_attach(WebKitWebInspector* inspector) { g_return_if_fail(WEBKIT_IS_WEB_INSPECTOR(inspector)); - if (WKInspectorIsAttached(inspector->priv->wkInspector.get())) + if (inspector->priv->webInspector->isAttached()) return; - WKInspectorAttach(inspector->priv->wkInspector.get()); + inspector->priv->webInspector->attach(); } /** @@ -394,9 +392,9 @@ void webkit_web_inspector_detach(WebKitWebInspector* inspector) { g_return_if_fail(WEBKIT_IS_WEB_INSPECTOR(inspector)); - if (!WKInspectorIsAttached(inspector->priv->wkInspector.get())) + if (!inspector->priv->webInspector->isAttached()) return; - WKInspectorDetach(inspector->priv->wkInspector.get()); + inspector->priv->webInspector->detach(); } /** @@ -409,7 +407,7 @@ void webkit_web_inspector_show(WebKitWebInspector* inspector) { g_return_if_fail(WEBKIT_IS_WEB_INSPECTOR(inspector)); - WKInspectorShow(inspector->priv->wkInspector.get()); + inspector->priv->webInspector->show(); } /** @@ -422,7 +420,7 @@ void webkit_web_inspector_close(WebKitWebInspector* inspector) { g_return_if_fail(WEBKIT_IS_WEB_INSPECTOR(inspector)); - WKInspectorClose(inspector->priv->wkInspector.get()); + inspector->priv->webInspector->close(); } /** @@ -439,7 +437,7 @@ guint webkit_web_inspector_get_attached_height(WebKitWebInspector* inspector) { g_return_val_if_fail(WEBKIT_IS_WEB_INSPECTOR(inspector), 0); - if (!WKInspectorIsAttached(inspector->priv->wkInspector.get())) + if (!inspector->priv->webInspector->isAttached()) return 0; return inspector->priv->attachedHeight; } diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebInspectorPrivate.h b/Source/WebKit2/UIProcess/API/gtk/WebKitWebInspectorPrivate.h index 703472137..5424e6006 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebInspectorPrivate.h +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebInspectorPrivate.h @@ -23,6 +23,8 @@ #include "WebKitPrivate.h" #include "WebKitWebInspector.h" -WebKitWebInspector* webkitWebInspectorCreate(WKInspectorRef); +using namespace WebKit; + +WebKitWebInspector* webkitWebInspectorCreate(WebInspectorProxy*); #endif // WebKitWebInspectorPrivate_h diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp index 236a4f304..46c4bd464 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp @@ -408,7 +408,7 @@ static void webkitWebViewConstructed(GObject* object) attachContextMenuClientToView(webView); attachFormClientToView(webView); - priv->backForwardList = adoptGRef(webkitBackForwardListCreate(toAPI(getPage(webView)->backForwardList()))); + priv->backForwardList = adoptGRef(webkitBackForwardListCreate(getPage(webView)->backForwardList())); GRefPtr<WebKitSettings> settings = adoptGRef(webkit_settings_new()); webkitWebViewSetSettings(webView, settings.get()); @@ -1577,7 +1577,7 @@ void webkitWebViewPopulateContextMenu(WebKitWebView* webView, ImmutableArray* pr WebContextMenuProxyGtk* contextMenuProxy = webkitWebViewBaseGetActiveContextMenuProxy(webViewBase); ASSERT(contextMenuProxy); - GRefPtr<WebKitContextMenu> contextMenu = adoptGRef(webkitContextMenuCreate(toAPI(proposedMenu))); + GRefPtr<WebKitContextMenu> contextMenu = adoptGRef(webkitContextMenuCreate(proposedMenu)); if (webHitTestResult->isContentEditable()) webkitWebViewCreateAndAppendInputMethodsMenuItem(webView, contextMenu.get()); @@ -2057,7 +2057,7 @@ void webkit_web_view_go_to_back_forward_list_item(WebKitWebView* webView, WebKit g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView)); g_return_if_fail(WEBKIT_IS_BACK_FORWARD_LIST_ITEM(listItem)); - getPage(webView)->goToBackForwardItem(toImpl(webkitBackForwardListItemGetWKItem(listItem))); + getPage(webView)->goToBackForwardItem(webkitBackForwardListItemGetItem(listItem)); } /** @@ -2569,7 +2569,7 @@ WebKitWebInspector* webkit_web_view_get_inspector(WebKitWebView* webView) g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 0); if (!webView->priv->inspector) - webView->priv->inspector = adoptGRef(webkitWebInspectorCreate(toAPI(getPage(webView)->inspector()))); + webView->priv->inspector = adoptGRef(webkitWebInspectorCreate(getPage(webView)->inspector())); return webView->priv->inspector.get(); } diff --git a/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm b/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm index 7b54b4bd7..ba88107e1 100644 --- a/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm +++ b/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm @@ -139,7 +139,7 @@ PageClientImpl::~PageClientImpl() PassOwnPtr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy() { - return [m_wkView _createDrawingAreaProxy]; + return [m_wkView _wk_createDrawingAreaProxy]; } void PageClientImpl::setViewNeedsDisplay(const WebCore::IntRect& rect) @@ -156,7 +156,7 @@ void PageClientImpl::scrollView(const IntRect& scrollRect, const IntSize& scroll { NSRect clippedScrollRect = NSIntersectionRect(scrollRect, NSOffsetRect(scrollRect, -scrollOffset.width(), -scrollOffset.height())); - [m_wkView _cacheWindowBottomCornerRect]; + [m_wkView _wk_cacheWindowBottomCornerRect]; [m_wkView translateRectsNeedingDisplayInRect:clippedScrollRect by:scrollOffset]; [m_wkView scrollRect:clippedScrollRect by:scrollOffset]; @@ -174,7 +174,7 @@ bool PageClientImpl::isViewWindowActive() bool PageClientImpl::isViewFocused() { - return [m_wkView _isFocused]; + return [m_wkView _wk_isFocused]; } void PageClientImpl::makeFirstResponder() @@ -220,17 +220,17 @@ LayerHostingMode PageClientImpl::viewLayerHostingMode() ColorSpaceData PageClientImpl::colorSpace() { - return [m_wkView _colorSpace]; + return [m_wkView _wk_colorSpace]; } void PageClientImpl::processDidCrash() { - [m_wkView _processDidCrash]; + [m_wkView _wk_processDidCrash]; } void PageClientImpl::pageClosed() { - [m_wkView _pageClosed]; + [m_wkView _wk_pageClosed]; #if USE(DICTATION_ALTERNATIVES) m_alternativeTextUIController->clear(); #endif @@ -238,18 +238,18 @@ void PageClientImpl::pageClosed() void PageClientImpl::didRelaunchProcess() { - [m_wkView _didRelaunchProcess]; + [m_wkView _wk_didRelaunchProcess]; } void PageClientImpl::toolTipChanged(const String& oldToolTip, const String& newToolTip) { - [m_wkView _toolTipChangedFrom:nsStringFromWebCoreString(oldToolTip) to:nsStringFromWebCoreString(newToolTip)]; + [m_wkView _wk_toolTipChangedFrom:nsStringFromWebCoreString(oldToolTip) to:nsStringFromWebCoreString(newToolTip)]; } void PageClientImpl::setCursor(const WebCore::Cursor& cursor) { if (![NSApp _cursorRectCursor]) - [m_wkView _setCursor:cursor.platformCursor()]; + [m_wkView _wk_setCursor:cursor.platformCursor()]; } void PageClientImpl::setCursorHiddenUntilMouseMoves(bool hiddenUntilMouseMoves) @@ -291,7 +291,7 @@ void PageClientImpl::executeUndoRedo(WebPageProxy::UndoOrRedo undoOrRedo) bool PageClientImpl::interpretKeyEvent(const NativeWebKeyboardEvent& event, Vector<WebCore::KeypressCommand>& commands) { - return [m_wkView _interpretKeyEvent:event.nativeEvent() savingCommandsTo:commands]; + return [m_wkView _wk_interpretKeyEvent:event.nativeEvent() savingCommandsTo:commands]; } void PageClientImpl::setDragImage(const IntPoint& clientPosition, PassRefPtr<ShareableBitmap> dragImage, bool isLinkDrag) @@ -299,34 +299,34 @@ void PageClientImpl::setDragImage(const IntPoint& clientPosition, PassRefPtr<Sha RetainPtr<CGImageRef> dragCGImage = dragImage->makeCGImage(); RetainPtr<NSImage> dragNSImage(AdoptNS, [[NSImage alloc] initWithCGImage:dragCGImage.get() size:dragImage->size()]); - [m_wkView _setDragImage:dragNSImage.get() at:clientPosition linkDrag:isLinkDrag]; + [m_wkView _wk_setDragImage:dragNSImage.get() at:clientPosition linkDrag:isLinkDrag]; } void PageClientImpl::setPromisedData(const String& pasteboardName, PassRefPtr<SharedBuffer> imageBuffer, const String& filename, const String& extension, const String& title, const String& url, const String& visibleUrl, PassRefPtr<SharedBuffer> archiveBuffer) { RefPtr<Image> image = BitmapImage::create(); image->setData(imageBuffer.get(), true); - [m_wkView _setPromisedData:image.get() withFileName:filename withExtension:extension withTitle:title withURL:url withVisibleURL:visibleUrl withArchive:archiveBuffer.get() forPasteboard:pasteboardName]; + [m_wkView _wk_setPromisedData:image.get() withFileName:filename withExtension:extension withTitle:title withURL:url withVisibleURL:visibleUrl withArchive:archiveBuffer.get() forPasteboard:pasteboardName]; } void PageClientImpl::updateTextInputState(bool updateSecureInputState) { - [m_wkView _updateTextInputStateIncludingSecureInputState:updateSecureInputState]; + [m_wkView _wk_updateTextInputStateIncludingSecureInputState:updateSecureInputState]; } void PageClientImpl::resetTextInputState() { - [m_wkView _resetTextInputState]; + [m_wkView _wk_resetTextInputState]; } FloatRect PageClientImpl::convertToDeviceSpace(const FloatRect& rect) { - return [m_wkView _convertToDeviceSpace:rect]; + return [m_wkView _wk_convertToDeviceSpace:rect]; } FloatRect PageClientImpl::convertToUserSpace(const FloatRect& rect) { - return [m_wkView _convertToUserSpace:rect]; + return [m_wkView _wk_convertToUserSpace:rect]; } IntPoint PageClientImpl::screenToWindow(const IntPoint& point) @@ -352,7 +352,7 @@ void PageClientImpl::doneWithGestureEvent(const WebGestureEvent&, bool wasEventH void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool eventWasHandled) { - [m_wkView _doneWithKeyEvent:event.nativeEvent() eventWasHandled:eventWasHandled]; + [m_wkView _wk_doneWithKeyEvent:event.nativeEvent() eventWasHandled:eventWasHandled]; } PassRefPtr<WebPopupMenuProxy> PageClientImpl::createPopupMenuProxy(WebPageProxy* page) @@ -375,40 +375,40 @@ PassRefPtr<WebColorChooserProxy> PageClientImpl::createColorChooserProxy(WebPage void PageClientImpl::setFindIndicator(PassRefPtr<FindIndicator> findIndicator, bool fadeOut, bool animate) { - [m_wkView _setFindIndicator:findIndicator fadeOut:fadeOut animate:animate]; + [m_wkView _wk_setFindIndicator:findIndicator fadeOut:fadeOut animate:animate]; } void PageClientImpl::accessibilityWebProcessTokenReceived(const CoreIPC::DataReference& data) { - NSData* remoteToken = [NSData dataWithBytes:data.data() length:data.size()]; - [m_wkView _setAccessibilityWebProcessToken:remoteToken]; + NSData *remoteToken = [NSData dataWithBytes:data.data() length:data.size()]; + [m_wkView _wk_setAccessibilityWebProcessToken:remoteToken]; } #if USE(ACCELERATED_COMPOSITING) void PageClientImpl::enterAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext) { - [m_wkView _enterAcceleratedCompositingMode:layerTreeContext]; + [m_wkView _wk_enterAcceleratedCompositingMode:layerTreeContext]; } void PageClientImpl::exitAcceleratedCompositingMode() { - [m_wkView _exitAcceleratedCompositingMode]; + [m_wkView _wk_exitAcceleratedCompositingMode]; } void PageClientImpl::updateAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext) { - [m_wkView _updateAcceleratedCompositingMode:layerTreeContext]; + [m_wkView _wk_updateAcceleratedCompositingMode:layerTreeContext]; } #endif // USE(ACCELERATED_COMPOSITING) void PageClientImpl::pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus) { - [m_wkView _pluginFocusOrWindowFocusChanged:pluginHasFocusAndWindowHasFocus pluginComplexTextInputIdentifier:pluginComplexTextInputIdentifier]; + [m_wkView _wk_pluginFocusOrWindowFocusChanged:pluginHasFocusAndWindowHasFocus pluginComplexTextInputIdentifier:pluginComplexTextInputIdentifier]; } void PageClientImpl::setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, PluginComplexTextInputState pluginComplexTextInputState) { - [m_wkView _setPluginComplexTextInputState:pluginComplexTextInputState pluginComplexTextInputIdentifier:pluginComplexTextInputIdentifier]; + [m_wkView _wk_setPluginComplexTextInputState:pluginComplexTextInputState pluginComplexTextInputIdentifier:pluginComplexTextInputIdentifier]; } CGContextRef PageClientImpl::containingWindowGraphicsContext() @@ -424,37 +424,37 @@ CGContextRef PageClientImpl::containingWindowGraphicsContext() void PageClientImpl::didChangeScrollbarsForMainFrame() const { - [m_wkView _didChangeScrollbarsForMainFrame]; + [m_wkView _wk_didChangeScrollbarsForMainFrame]; } void PageClientImpl::didCommitLoadForMainFrame(bool useCustomRepresentation) { - [m_wkView _setPageHasCustomRepresentation:useCustomRepresentation]; + [m_wkView _wk_setPageHasCustomRepresentation:useCustomRepresentation]; } void PageClientImpl::didFinishLoadingDataForCustomRepresentation(const String& suggestedFilename, const CoreIPC::DataReference& dataReference) { - [m_wkView _didFinishLoadingDataForCustomRepresentationWithSuggestedFilename:suggestedFilename dataReference:dataReference]; + [m_wkView _wk_didFinishLoadingDataForCustomRepresentationWithSuggestedFilename:suggestedFilename dataReference:dataReference]; } double PageClientImpl::customRepresentationZoomFactor() { - return [m_wkView _customRepresentationZoomFactor]; + return [m_wkView _wk_customRepresentationZoomFactor]; } void PageClientImpl::setCustomRepresentationZoomFactor(double zoomFactor) { - [m_wkView _setCustomRepresentationZoomFactor:zoomFactor]; + [m_wkView _wk_setCustomRepresentationZoomFactor:zoomFactor]; } void PageClientImpl::findStringInCustomRepresentation(const String& string, FindOptions options, unsigned maxMatchCount) { - [m_wkView _findStringInCustomRepresentation:string withFindOptions:options maxMatchCount:maxMatchCount]; + [m_wkView _wk_findStringInCustomRepresentation:string withFindOptions:options maxMatchCount:maxMatchCount]; } void PageClientImpl::countStringMatchesInCustomRepresentation(const String& string, FindOptions options, unsigned maxMatchCount) { - [m_wkView _countStringMatchesInCustomRepresentation:string withFindOptions:options maxMatchCount:maxMatchCount]; + [m_wkView _wk_countStringMatchesInCustomRepresentation:string withFindOptions:options maxMatchCount:maxMatchCount]; } void PageClientImpl::flashBackingStoreUpdates(const Vector<IntRect>&) @@ -555,10 +555,11 @@ void PageClientImpl::recommendedScrollbarStyleDidChange(int32_t newStyle) bool PageClientImpl::executeSavedCommandBySelector(const String& selectorString) { - return [m_wkView _executeSavedCommandBySelector:NSSelectorFromString(selectorString)]; + return [m_wkView _wk_executeSavedCommandBySelector:NSSelectorFromString(selectorString)]; } #if USE(DICTATION_ALTERNATIVES) + uint64_t PageClientImpl::addDictationAlternatives(const RetainPtr<NSTextAlternatives>& alternatives) { return m_alternativeTextUIController->addAlternatives(alternatives); @@ -574,7 +575,7 @@ void PageClientImpl::showDictationAlternativeUI(const WebCore::FloatRect& boundi if (!isViewVisible() || !isViewInWindow()) return; m_alternativeTextUIController->showAlternatives(m_wkView, boundingBoxOfDictatedText, dictationContext, ^(NSString* acceptedAlternative){ - [m_wkView handleAcceptedAlternativeText:acceptedAlternative]; + [m_wkView _wk_handleAcceptedAlternativeText:acceptedAlternative]; }); } @@ -587,6 +588,7 @@ void PageClientImpl::dismissDictationAlternativeUI() { m_alternativeTextUIController->dismissAlternatives(); } + #endif } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/API/mac/WKView.mm b/Source/WebKit2/UIProcess/API/mac/WKView.mm index d4b301298..e4a6e6b4b 100644 --- a/Source/WebKit2/UIProcess/API/mac/WKView.mm +++ b/Source/WebKit2/UIProcess/API/mac/WKView.mm @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. + * Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,9 +26,9 @@ #import "config.h" #import "WKView.h" -#if USE(DICTATION_ALTERNATIVES) -#import <AppKit/NSTextAlternatives.h> -#import <AppKit/NSAttributedString.h> +#if USE(DICTATION_ALTERNATIVES) +#import <AppKit/NSTextAlternatives.h> +#import <AppKit/NSAttributedString.h> #endif #import "AttributedString.h" @@ -51,8 +51,11 @@ #import "TextCheckerState.h" #import "TiledCoreAnimationDrawingAreaProxy.h" #import "WKAPICast.h" +#import "WKBrowsingContextControllerInternal.h" +#import "WKBrowsingContextGroupInternal.h" #import "WKFullScreenWindowController.h" #import "WKPrintingView.h" +#import "WKProcessGroupInternal.h" #import "WKStringCF.h" #import "WKTextInputWindowController.h" #import "WKViewInternal.h" @@ -69,6 +72,7 @@ #import <WebCore/DragController.h> #import <WebCore/DragData.h> #import <WebCore/DragSession.h> +#import <WebCore/FileSystem.h> #import <WebCore/FloatRect.h> #import <WebCore/Image.h> #import <WebCore/IntRect.h> @@ -81,18 +85,11 @@ #import <WebCore/SharedBuffer.h> #import <WebCore/TextAlternativeWithRange.h> #import <WebCore/WebCoreNSStringExtras.h> -#import <WebCore/FileSystem.h> #import <WebKitSystemInterface.h> #import <sys/stat.h> #import <wtf/RefPtr.h> #import <wtf/RetainPtr.h> -/* API internals. */ -#import "WKBrowsingContextControllerInternal.h" -#import "WKBrowsingContextGroupInternal.h" -#import "WKProcessGroupInternal.h" - - @interface NSApplication (WKNSApplicationDetails) - (void)speakString:(NSString *)string; - (void)_setCurrentEvent:(NSEvent *)event; @@ -134,13 +131,18 @@ struct WKViewInterpretKeyEventsParameters { }; @interface WKView () -- (void)_accessibilityRegisterUIProcessTokens; -- (void)_disableComplexTextInputIfNecessary; -- (float)_intrinsicDeviceScaleFactor; -- (void)_postFakeMouseMovedEventForFlagsChangedEvent:(NSEvent *)flagsChangedEvent; -- (void)_setDrawingAreaSize:(NSSize)size; -- (void)_setPluginComplexTextInputState:(PluginComplexTextInputState)pluginComplexTextInputState; -- (BOOL)_shouldUseTiledDrawingArea; +- (void)_wk_accessibilityRegisterUIProcessTokens; +- (void)_wk_disableComplexTextInputIfNecessary; +- (float)_wk_intrinsicDeviceScaleFactor; +- (void)_wk_postFakeMouseMovedEventForFlagsChangedEvent:(NSEvent *)flagsChangedEvent; +- (void)_wk_setDrawingAreaSize:(NSSize)size; +- (void)_wk_setPluginComplexTextInputState:(PluginComplexTextInputState)pluginComplexTextInputState; +@end + +@interface WKToolTipDelegate : NSObject { + RefPtr<WebPageProxy> _page; +} +- (id)initWithPage:(WebPageProxy *)page; @end @interface WKViewData : NSObject { @@ -214,6 +216,9 @@ struct WKViewInterpretKeyEventsParameters { RefPtr<WebCore::Image> _promisedImage; String _promisedFilename; String _promisedURL; + + RetainPtr<WKToolTipDelegate> _toolTipDelegate; + RetainPtr<NSMutableArray> _observers; } @end @@ -221,7 +226,6 @@ struct WKViewInterpretKeyEventsParameters { @implementation WKViewData @end - @interface WKResponderChainSink : NSResponder { NSResponder *_lastResponderInChain; bool _didReceiveUnhandledCommand; @@ -307,7 +311,7 @@ struct WKViewInterpretKeyEventsParameters { _data->_inBecomeFirstResponder = true; - [self _updateSecureInputState]; + [self _wk_updateSecureInputState]; _data->_page->viewStateDidChange(WebPageProxy::ViewIsFocused); _data->_inBecomeFirstResponder = false; @@ -328,7 +332,7 @@ struct WKViewInterpretKeyEventsParameters { if (_data->_page->editorState().hasComposition && !_data->_page->editorState().shouldIgnoreCompositionSelectionChange) _data->_page->cancelComposition(); - [self _resetTextInputState]; + [self _wk_resetTextInputState]; if (!_data->_page->maintainsInactiveSelection()) _data->_page->clearSelection(); @@ -363,10 +367,10 @@ struct WKViewInterpretKeyEventsParameters { [super setFrameSize:size]; if (![self frameSizeUpdatesDisabled]) - [self _setDrawingAreaSize:size]; + [self _wk_setDrawingAreaSize:size]; } -- (void)_updateWindowAndViewFrames +- (void)_wk_updateWindowAndViewFrames { NSWindow *window = [self window]; ASSERT(window); @@ -385,12 +389,12 @@ struct WKViewInterpretKeyEventsParameters { // Update the view frame. if ([self window]) - [self _updateWindowAndViewFrames]; + [self _wk_updateWindowAndViewFrames]; [super renewGState]; } -- (void)_setPluginComplexTextInputState:(PluginComplexTextInputState)pluginComplexTextInputState +- (void)_wk_setPluginComplexTextInputState:(PluginComplexTextInputState)pluginComplexTextInputState { _data->_pluginComplexTextInputState = pluginComplexTextInputState; @@ -653,7 +657,7 @@ static void validateCommandCallback(WKStringRef commandName, bool isEnabled, int WKView* wkView = static_cast<WKView*>(context); ASSERT(wkView); - [wkView _setUserInterfaceItemState:nsStringFromWebCoreString(toImpl(commandName)->string()) enabled:isEnabled state:state]; + [wkView _wk_setUserInterfaceItemState:nsStringFromWebCoreString(toImpl(commandName)->string()) enabled:isEnabled state:state]; } - (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item @@ -964,7 +968,7 @@ static void speakString(WKStringRef string, WKErrorRef error, void*) { #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 // FIXME: We should remove this code when <rdar://problem/9362085> is resolved. In the meantime, - // it is necessary to disable scren updates so we get a chance to redraw the corners before this + // it is necessary to disable screen updates so we get a chance to redraw the corners before this // display is visible. NSWindow *window = [self window]; BOOL shouldMaskWindow = window && !NSIsEmptyRect(_data->_windowBottomCornerIntersectionRect); @@ -992,7 +996,7 @@ static void speakString(WKStringRef string, WKErrorRef error, void*) return YES; } -- (void)_setMouseDownEvent:(NSEvent *)event +- (void)_wk_setMouseDownEvent:(NSEvent *)event { ASSERT(!event || [event type] == NSLeftMouseDown || [event type] == NSRightMouseDown || [event type] == NSOtherMouseDown); @@ -1016,10 +1020,10 @@ static void speakString(WKStringRef string, WKErrorRef error, void*) NATIVE_MOUSE_EVENT_HANDLER(mouseEntered) NATIVE_MOUSE_EVENT_HANDLER(mouseExited) -NATIVE_MOUSE_EVENT_HANDLER(mouseMovedInternal) -NATIVE_MOUSE_EVENT_HANDLER(mouseDownInternal) -NATIVE_MOUSE_EVENT_HANDLER(mouseUpInternal) -NATIVE_MOUSE_EVENT_HANDLER(mouseDraggedInternal) +NATIVE_MOUSE_EVENT_HANDLER(_wk_mouseMovedInternal) +NATIVE_MOUSE_EVENT_HANDLER(_wk_mouseDownInternal) +NATIVE_MOUSE_EVENT_HANDLER(_wk_mouseUpInternal) +NATIVE_MOUSE_EVENT_HANDLER(_wk_mouseDraggedInternal) NATIVE_MOUSE_EVENT_HANDLER(otherMouseDown) NATIVE_MOUSE_EVENT_HANDLER(otherMouseDragged) NATIVE_MOUSE_EVENT_HANDLER(otherMouseMoved) @@ -1047,27 +1051,27 @@ NATIVE_EVENT_HANDLER(scrollWheel, Wheel) if (self == [[self window] firstResponder] && !NSPointInRect([self convertPoint:[event locationInWindow] fromView:nil], [self visibleRect])) return; - [self mouseMovedInternal:event]; + [self _wk_mouseMovedInternal:event]; } - (void)mouseDown:(NSEvent *)event { - [self _setMouseDownEvent:event]; + [self _wk_setMouseDownEvent:event]; _data->_ignoringMouseDraggedEvents = NO; - [self mouseDownInternal:event]; + [self _wk_mouseDownInternal:event]; } - (void)mouseUp:(NSEvent *)event { - [self _setMouseDownEvent:nil]; - [self mouseUpInternal:event]; + [self _wk_setMouseDownEvent:nil]; + [self _wk_mouseUpInternal:event]; } - (void)mouseDragged:(NSEvent *)event { if (_data->_ignoringMouseDraggedEvents) return; - [self mouseDraggedInternal:event]; + [self _wk_mouseDraggedInternal:event]; } - (BOOL)acceptsFirstMouse:(NSEvent *)event @@ -1080,9 +1084,9 @@ NATIVE_EVENT_HANDLER(scrollWheel, Wheel) if (![self hitTest:[event locationInWindow]]) return NO; - [self _setMouseDownEvent:event]; + [self _wk_setMouseDownEvent:event]; bool result = _data->_page->acceptsFirstMouse([event eventNumber], WebEventFactory::createWebMouseEvent(event, self)); - [self _setMouseDownEvent:nil]; + [self _wk_setMouseDownEvent:nil]; return result; } @@ -1101,9 +1105,9 @@ NATIVE_EVENT_HANDLER(scrollWheel, Wheel) if (![self hitTest:[event locationInWindow]]) return NO; - [self _setMouseDownEvent:event]; + [self _wk_setMouseDownEvent:event]; bool result = _data->_page->shouldDelayWindowOrderingForEvent(WebEventFactory::createWebMouseEvent(event, self)); - [self _setMouseDownEvent:nil]; + [self _wk_setMouseDownEvent:nil]; return result; } @@ -1140,6 +1144,7 @@ static const short kIOHIDEventTypeScroll = 6; }]; } } + #endif - (void)doCommandBySelector:(SEL)selector @@ -1226,7 +1231,7 @@ static const short kIOHIDEventTypeScroll = 6; parameters->eventInterpretationHadSideEffects |= eventHandled; } -- (BOOL)_handleStyleKeyEquivalent:(NSEvent *)event +- (BOOL)_wk_handleStyleKeyEquivalent:(NSEvent *)event { if (!_data->_page->editorState().isContentEditable) return NO; @@ -1262,7 +1267,7 @@ static const short kIOHIDEventTypeScroll = 6; BOOL eventWasSentToWebCore = (_data->_keyDownEventBeingResent == event); if (!eventWasSentToWebCore) - [self _disableComplexTextInputIfNecessary]; + [self _wk_disableComplexTextInputIfNecessary]; // Pass key combos through WebCore if there is a key binding available for // this event. This lets web pages have a crack at intercepting key-modified keypresses. @@ -1273,7 +1278,7 @@ static const short kIOHIDEventTypeScroll = 6; return YES; } - return [self _handleStyleKeyEquivalent:event] || [super performKeyEquivalent:event]; + return [self _wk_handleStyleKeyEquivalent:event] || [super performKeyEquivalent:event]; } - (void)keyUp:(NSEvent *)theEvent @@ -1282,7 +1287,7 @@ static const short kIOHIDEventTypeScroll = 6; _data->_page->handleKeyboardEvent(NativeWebKeyboardEvent(theEvent, self)); } -- (void)_disableComplexTextInputIfNecessary +- (void)_wk_disableComplexTextInputIfNecessary { if (!_data->_pluginComplexTextInputIdentifier) return; @@ -1292,10 +1297,10 @@ static const short kIOHIDEventTypeScroll = 6; // Check if the text input window has been dismissed. if (![[WKTextInputWindowController sharedTextInputWindowController] hasMarkedText]) - [self _setPluginComplexTextInputState:PluginComplexTextInputDisabled]; + [self _wk_setPluginComplexTextInputState:PluginComplexTextInputDisabled]; } -- (BOOL)_handlePluginComplexTextInputKeyDown:(NSEvent *)event +- (BOOL)_wk_handlePluginComplexTextInputKeyDown:(NSEvent *)event { ASSERT(_data->_pluginComplexTextInputIdentifier); ASSERT(_data->_pluginComplexTextInputState != PluginComplexTextInputDisabled); @@ -1315,18 +1320,18 @@ static const short kIOHIDEventTypeScroll = 6; return didHandleEvent; } -- (BOOL)_tryHandlePluginComplexTextInputKeyDown:(NSEvent *)event +- (BOOL)_wk_tryHandlePluginComplexTextInputKeyDown:(NSEvent *)event { if (!_data->_pluginComplexTextInputIdentifier || _data->_pluginComplexTextInputState == PluginComplexTextInputDisabled) return NO; // Check if the text input window has been dismissed and let the plug-in process know. // This is only valid with the updated Cocoa text input spec. - [self _disableComplexTextInputIfNecessary]; + [self _wk_disableComplexTextInputIfNecessary]; // Try feeding the keyboard event directly to the plug-in. if (_data->_pluginComplexTextInputState == PluginComplexTextInputEnabledLegacy) - return [self _handlePluginComplexTextInputKeyDown:event]; + return [self _wk_handlePluginComplexTextInputKeyDown:event]; return NO; } @@ -1340,7 +1345,7 @@ static const short kIOHIDEventTypeScroll = 6; // the current event prevents that from causing a problem inside WebKit or AppKit code. [[theEvent retain] autorelease]; - if ([self _tryHandlePluginComplexTextInputKeyDown:theEvent]) { + if ([self _wk_tryHandlePluginComplexTextInputKeyDown:theEvent]) { LOG(TextInput, "...handled by plug-in"); return; } @@ -1374,7 +1379,7 @@ static const short kIOHIDEventTypeScroll = 6; _data->_page->handleKeyboardEvent(NativeWebKeyboardEvent(theEvent, self)); } -- (void)_executeSavedKeypressCommands +- (void)_wk_executeSavedKeypressCommands { WKViewInterpretKeyEventsParameters* parameters = _data->_interpretKeyEventsParameters; if (!parameters || parameters->commands->isEmpty()) @@ -1395,7 +1400,7 @@ static const short kIOHIDEventTypeScroll = 6; LOG(TextInput, "...done executing saved keypress commands."); } -- (void)_notifyInputContextAboutDiscardedComposition +- (void)_wk_notifyInputContextAboutDiscardedComposition { // <rdar://problem/9359055>: -discardMarkedText can only be called for active contexts. // FIXME: We fail to ever notify the input context if something (e.g. a navigation) happens while the window is not key. @@ -1423,7 +1428,7 @@ static const short kIOHIDEventTypeScroll = 6; - (NSRange)selectedRange { - [self _executeSavedKeypressCommands]; + [self _wk_executeSavedKeypressCommands]; uint64_t selectionStart; uint64_t selectionLength; @@ -1447,7 +1452,7 @@ static const short kIOHIDEventTypeScroll = 6; result = _data->_page->editorState().hasComposition; if (result) { // A saved command can confirm a composition, but it cannot start a new one. - [self _executeSavedKeypressCommands]; + [self _wk_executeSavedKeypressCommands]; result = _data->_page->editorState().hasComposition; } } else { @@ -1463,7 +1468,7 @@ static const short kIOHIDEventTypeScroll = 6; - (void)unmarkText { - [self _executeSavedKeypressCommands]; + [self _wk_executeSavedKeypressCommands]; LOG(TextInput, "unmarkText"); @@ -1522,7 +1527,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde - (void)setMarkedText:(id)string selectedRange:(NSRange)newSelRange replacementRange:(NSRange)replacementRange { - [self _executeSavedKeypressCommands]; + [self _wk_executeSavedKeypressCommands]; BOOL isAttributedString = [string isKindOfClass:[NSAttributedString class]]; ASSERT(isAttributedString || [string isKindOfClass:[NSString class]]); @@ -1551,7 +1556,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde // In password fields, we only allow ASCII dead keys, and don't allow inline input, matching NSSecureTextInputField. // Allowing ASCII dead keys is necessary to enable full Roman input when using a Vietnamese keyboard. ASSERT(!_data->_page->editorState().hasComposition); - [self _notifyInputContextAboutDiscardedComposition]; + [self _wk_notifyInputContextAboutDiscardedComposition]; if ([text length] == 1 && [[text decomposedStringWithCanonicalMapping] characterAtIndex:0] < 0x80) { _data->_page->insertText(text, replacementRange.location, NSMaxRange(replacementRange)); } else @@ -1564,7 +1569,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde - (NSRange)markedRange { - [self _executeSavedKeypressCommands]; + [self _wk_executeSavedKeypressCommands]; uint64_t location; uint64_t length; @@ -1576,7 +1581,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde - (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)nsRange actualRange:(NSRangePointer)actualRange { - [self _executeSavedKeypressCommands]; + [self _wk_executeSavedKeypressCommands]; if (!_data->_page->editorState().isContentEditable) { LOG(TextInput, "attributedSubstringFromRange:(%u, %u) -> nil", nsRange.location, nsRange.length); @@ -1600,7 +1605,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde - (NSUInteger)characterIndexForPoint:(NSPoint)thePoint { - [self _executeSavedKeypressCommands]; + [self _wk_executeSavedKeypressCommands]; NSWindow *window = [self window]; @@ -1615,7 +1620,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde - (NSRect)firstRectForCharacterRange:(NSRange)theRange actualRange:(NSRangePointer)actualRange { - [self _executeSavedKeypressCommands]; + [self _wk_executeSavedKeypressCommands]; // Just to match NSTextView's behavior. Regression tests cannot detect this; // to reproduce, use a test application from http://bugs.webkit.org/show_bug.cgi?id=4682 @@ -1640,6 +1645,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde } #if ENABLE(DRAG_SUPPORT) + - (void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint operation:(NSDragOperation)operation { NSPoint windowImageLoc = [[self window] convertScreenToBase:aPoint]; @@ -1781,6 +1787,7 @@ static void createSandboxExtensionsForFileUpload(NSPasteboard *pasteboard, Sandb return self; return nil; } + #endif // ENABLE(DRAG_SUPPORT) - (BOOL)_windowResizeMouseLocationIsInVisibleScrollerThumb:(NSPoint)loc @@ -1790,13 +1797,14 @@ static void createSandboxExtensionsForFileUpload(NSPasteboard *pasteboard, Sandb return NSMouseInRect(localPoint, visibleThumbRect, [self isFlipped]); } -- (void)_updateWindowVisibility +- (void)_wk_updateWindowVisibility { _data->_page->updateWindowIsVisible([[self window] isVisible]); } #if __MAC_OS_X_VERSION_MIN_REQUIRED == 1060 + - (BOOL)_ownsWindowGrowBox { NSWindow* window = [self window]; @@ -1845,54 +1853,45 @@ static void createSandboxExtensionsForFileUpload(NSPasteboard *pasteboard, Sandb return ownsGrowBox; } + #endif // FIXME: Use AppKit constants for these when they are available. +static NSString * const windowDidBecomeVisibleNotification = @"_NSWindowDidBecomeVisible"; +static NSString * const windowDidOrderOffScreenNotification = @"NSWindowDidOrderOffScreenNotification"; static NSString * const windowDidChangeBackingPropertiesNotification = @"NSWindowDidChangeBackingPropertiesNotification"; static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOldScaleFactorKey"; -- (void)addWindowObserversForWindow:(NSWindow *)window -{ - if (window) { - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidBecomeKey:) - name:NSWindowDidBecomeKeyNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidResignKey:) - name:NSWindowDidResignKeyNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidMiniaturize:) - name:NSWindowDidMiniaturizeNotification object:window]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidDeminiaturize:) - name:NSWindowDidDeminiaturizeNotification object:window]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidMove:) - name:NSWindowDidMoveNotification object:window]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidResize:) - name:NSWindowDidResizeNotification object:window]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidOrderOffScreen:) - name:@"NSWindowDidOrderOffScreenNotification" object:window]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidOrderOnScreen:) - name:@"_NSWindowDidBecomeVisible" object:window]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidChangeBackingProperties:) - name:windowDidChangeBackingPropertiesNotification object:window]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidChangeScreen:) - name:NSWindowDidChangeScreenNotification object:window]; - } -} - -- (void)removeWindowObservers +- (void)_wk_updateWindowObserversForWindow:(NSWindow *)window { - NSWindow *window = [self window]; + for (id observer in _data->_observers.get()) + [[NSNotificationCenter defaultCenter] removeObserver:observer]; + [_data->_observers.get() removeAllObjects]; + if (!window) return; - [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidBecomeKeyNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidResignKeyNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidMiniaturizeNotification object:window]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidDeminiaturizeNotification object:window]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidMoveNotification object:window]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidResizeNotification object:window]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:@"NSWindowDidOrderOffScreenNotification" object:window]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:@"_NSWindowDidBecomeVisible" object:window]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:windowDidChangeBackingPropertiesNotification object:window]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidChangeScreenNotification object:window]; + if (!_data->_observers) + _data->_observers = adoptNS([[NSMutableArray alloc] init]); + + #define ADD_OBSERVER(selectorName, notificationName, notificationObject) \ + [_data->_observers.get() addObject:[[NSNotificationCenter defaultCenter] \ + addObserverForName:notificationName object:notificationObject queue:[NSOperationQueue mainQueue] \ + usingBlock:^(NSNotification *notification){ [self selectorName:notification]; }] \ + ]; + + ADD_OBSERVER(_wk_windowDidBecomeKey, NSWindowDidBecomeKeyNotification, nil); + ADD_OBSERVER(_wk_windowDidChangeBackingProperties, windowDidChangeBackingPropertiesNotification, window); + ADD_OBSERVER(_wk_windowDidChangeScreen, NSWindowDidChangeScreenNotification, window); + ADD_OBSERVER(_wk_windowDidDeminiaturize, NSWindowDidDeminiaturizeNotification, window); + ADD_OBSERVER(_wk_windowDidMiniaturize, NSWindowDidMiniaturizeNotification, window); + ADD_OBSERVER(_wk_windowDidMove, NSWindowDidMoveNotification, window); + ADD_OBSERVER(_wk_windowDidOrderOffScreen, windowDidOrderOffScreenNotification, window); + ADD_OBSERVER(_wk_windowDidOrderOnScreen, windowDidBecomeVisibleNotification, window); + ADD_OBSERVER(_wk_windowDidResignKey, NSWindowDidResignKeyNotification, nil); + ADD_OBSERVER(_wk_windowDidResize, NSWindowDidResizeNotification, window); + + #undef ADD_OBSERVER } - (void)viewWillMoveToWindow:(NSWindow *)window @@ -1912,8 +1911,7 @@ static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOl #endif _data->_pageClient->viewWillMoveToAnotherWindow(); - [self removeWindowObservers]; - [self addWindowObserversForWindow:window]; + [self _wk_updateWindowObserversForWindow:window]; #if __MAC_OS_X_VERSION_MIN_REQUIRED == 1060 if ([currentWindow _growBoxOwner] == self) @@ -1928,21 +1926,21 @@ static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOl // update the active state. if ([self window]) { _data->_windowHasValidBackingStore = NO; - [self _updateWindowVisibility]; + [self _wk_updateWindowVisibility]; _data->_page->viewStateDidChange(WebPageProxy::ViewWindowIsActive); _data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible | WebPageProxy::ViewIsInWindow); - [self _updateWindowAndViewFrames]; + [self _wk_updateWindowAndViewFrames]; if (!_data->_flagsChangedEventMonitor) { _data->_flagsChangedEventMonitor = [NSEvent addLocalMonitorForEventsMatchingMask:NSFlagsChangedMask handler:^(NSEvent *flagsChangedEvent) { - [self _postFakeMouseMovedEventForFlagsChangedEvent:flagsChangedEvent]; + [self _wk_postFakeMouseMovedEventForFlagsChangedEvent:flagsChangedEvent]; return flagsChangedEvent; }]; } - [self _accessibilityRegisterUIProcessTokens]; + [self _wk_accessibilityRegisterUIProcessTokens]; } else { - [self _updateWindowVisibility]; + [self _wk_updateWindowVisibility]; _data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible); _data->_page->viewStateDidChange(WebPageProxy::ViewWindowIsActive | WebPageProxy::ViewIsInWindow); @@ -1960,67 +1958,67 @@ static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOl #endif } - _data->_page->setIntrinsicDeviceScaleFactor([self _intrinsicDeviceScaleFactor]); + _data->_page->setIntrinsicDeviceScaleFactor([self _wk_intrinsicDeviceScaleFactor]); } -- (void)doWindowDidChangeScreen +- (void)_wk_windowScreenDidChange { _data->_page->windowScreenDidChange((PlatformDisplayID)[[[[[self window] screen] deviceDescription] objectForKey:@"NSScreenNumber"] intValue]); } -- (void)_windowDidBecomeKey:(NSNotification *)notification +- (void)_wk_windowDidBecomeKey:(NSNotification *)notification { NSWindow *keyWindow = [notification object]; if (keyWindow == [self window] || keyWindow == [[self window] attachedSheet]) { - [self _updateSecureInputState]; + [self _wk_updateSecureInputState]; _data->_page->viewStateDidChange(WebPageProxy::ViewWindowIsActive); } // Send a change screen to make sure the initial displayID is set - [self doWindowDidChangeScreen]; + [self _wk_windowScreenDidChange]; } -- (void)_windowDidChangeScreen:(NSNotification *)notification +- (void)_wk_windowDidChangeScreen:(NSNotification *)notification { - [self doWindowDidChangeScreen]; + [self _wk_windowScreenDidChange]; } -- (void)_windowDidResignKey:(NSNotification *)notification +- (void)_wk_windowDidResignKey:(NSNotification *)notification { NSWindow *formerKeyWindow = [notification object]; if (formerKeyWindow == [self window] || formerKeyWindow == [[self window] attachedSheet]) { - [self _updateSecureInputState]; + [self _wk_updateSecureInputState]; _data->_page->viewStateDidChange(WebPageProxy::ViewWindowIsActive); } } -- (void)_windowDidMiniaturize:(NSNotification *)notification +- (void)_wk_windowDidMiniaturize:(NSNotification *)notification { _data->_windowHasValidBackingStore = NO; - [self _updateWindowVisibility]; + [self _wk_updateWindowVisibility]; } -- (void)_windowDidDeminiaturize:(NSNotification *)notification +- (void)_wk_windowDidDeminiaturize:(NSNotification *)notification { - [self _updateWindowVisibility]; + [self _wk_updateWindowVisibility]; } -- (void)_windowDidMove:(NSNotification *)notification +- (void)_wk_windowDidMove:(NSNotification *)notification { - [self _updateWindowAndViewFrames]; + [self _wk_updateWindowAndViewFrames]; } -- (void)_windowDidResize:(NSNotification *)notification +- (void)_wk_windowDidResize:(NSNotification *)notification { _data->_windowHasValidBackingStore = NO; - [self _updateWindowAndViewFrames]; + [self _wk_updateWindowAndViewFrames]; } -- (void)_windowDidOrderOffScreen:(NSNotification *)notification +- (void)_wk_windowDidOrderOffScreen:(NSNotification *)notification { - [self _updateWindowVisibility]; + [self _wk_updateWindowVisibility]; // We want to make sure to update the active state while hidden, so since the view is about to be hidden, // we hide it first and then update the active state. @@ -2028,9 +2026,9 @@ static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOl _data->_page->viewStateDidChange(WebPageProxy::ViewWindowIsActive); } -- (void)_windowDidOrderOnScreen:(NSNotification *)notification +- (void)_wk_windowDidOrderOnScreen:(NSNotification *)notification { - [self _updateWindowVisibility]; + [self _wk_updateWindowVisibility]; // We want to make sure to update the active state while hidden, so since the view is about to become visible, // we update the active state first and then make it visible. @@ -2038,10 +2036,10 @@ static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOl _data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible); } -- (void)_windowDidChangeBackingProperties:(NSNotification *)notification +- (void)_wk_windowDidChangeBackingProperties:(NSNotification *)notification { CGFloat oldBackingScaleFactor = [[notification.userInfo objectForKey:backingPropertyOldScaleFactorKey] doubleValue]; - CGFloat newBackingScaleFactor = [self _intrinsicDeviceScaleFactor]; + CGFloat newBackingScaleFactor = [self _wk_intrinsicDeviceScaleFactor]; if (oldBackingScaleFactor == newBackingScaleFactor) return; @@ -2138,7 +2136,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I drawingArea->colorSpaceDidChange(); } -- (void)_accessibilityRegisterUIProcessTokens +- (void)_wk_accessibilityRegisterUIProcessTokens { // Initialize remote accessibility when the window connection has been established. NSData *remoteElementToken = WKAXRemoteTokenForElement(self); @@ -2148,7 +2146,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I _data->_page->registerUIProcessAccessibilityTokens(elementToken, windowToken); } -- (void)_updateRemoteAccessibilityRegistration:(BOOL)registerProcess +- (void)_wk_updateRemoteAccessibilityRegistration:(BOOL)registerProcess { // When the tree is connected/disconnected, the remote accessibility registration // needs to be updated with the pid of the remote process. If the process is going @@ -2220,7 +2218,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I return hitView; } -- (void)_postFakeMouseMovedEventForFlagsChangedEvent:(NSEvent *)flagsChangedEvent +- (void)_wk_postFakeMouseMovedEventForFlagsChangedEvent:(NSEvent *)flagsChangedEvent { NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved location:[[flagsChangedEvent window] convertScreenToBase:[NSEvent mouseLocation]] modifierFlags:[flagsChangedEvent modifierFlags] timestamp:[flagsChangedEvent timestamp] windowNumber:[flagsChangedEvent windowNumber] @@ -2234,7 +2232,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I return (NSInteger)self; } -- (float)_intrinsicDeviceScaleFactor +- (float)_wk_intrinsicDeviceScaleFactor { NSWindow *window = [self window]; #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 @@ -2248,7 +2246,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I #endif } -- (void)_setDrawingAreaSize:(NSSize)size +- (void)_wk_setDrawingAreaSize:(NSSize)size { if (!_data->_page->drawingArea()) return; @@ -2257,11 +2255,6 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I _data->_resizeScrollOffset = NSZeroSize; } -- (BOOL)_shouldUseTiledDrawingArea -{ - return NO; -} - #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 - (void)quickLookWithEvent:(NSEvent *)event { @@ -2274,7 +2267,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I @implementation WKView (Internal) -- (PassOwnPtr<WebKit::DrawingAreaProxy>)_createDrawingAreaProxy +- (PassOwnPtr<WebKit::DrawingAreaProxy>)_wk_createDrawingAreaProxy { #if ENABLE(THREADED_SCROLLING) if ([self _shouldUseTiledDrawingArea]) @@ -2284,7 +2277,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I return DrawingAreaProxyImpl::create(_data->_page.get()); } -- (BOOL)_isFocused +- (BOOL)_wk_isFocused { if (_data->_inBecomeFirstResponder) return YES; @@ -2293,7 +2286,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I return [[self window] firstResponder] == self; } -- (WebKit::ColorSpaceData)_colorSpace +- (WebKit::ColorSpaceData)_wk_colorSpace { if (!_data->_colorSpace) { if ([self window]) @@ -2308,32 +2301,32 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I return colorSpaceData; } -- (void)_processDidCrash +- (void)_wk_processDidCrash { if (_data->_layerHostingView) - [self _exitAcceleratedCompositingMode]; + [self _wk_exitAcceleratedCompositingMode]; - [self _updateRemoteAccessibilityRegistration:NO]; + [self _wk_updateRemoteAccessibilityRegistration:NO]; } -- (void)_pageClosed +- (void)_wk_pageClosed { - [self _updateRemoteAccessibilityRegistration:NO]; + [self _wk_updateRemoteAccessibilityRegistration:NO]; } -- (void)_didRelaunchProcess +- (void)_wk_didRelaunchProcess { - [self _accessibilityRegisterUIProcessTokens]; + [self _wk_accessibilityRegisterUIProcessTokens]; } -- (void)_setCursor:(NSCursor *)cursor +- (void)_wk_setCursor:(NSCursor *)cursor { if ([NSCursor currentCursor] == cursor) return; [cursor set]; } -- (void)_setUserInterfaceItemState:(NSString *)commandName enabled:(BOOL)isEnabled state:(int)newState +- (void)_wk_setUserInterfaceItemState:(NSString *)commandName enabled:(BOOL)isEnabled state:(int)newState { ValidationVector items = _data->_validationMap.take(commandName); size_t size = items.size(); @@ -2346,7 +2339,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I } } -- (BOOL)_tryPostProcessPluginComplexTextInputKeyDown:(NSEvent *)event +- (BOOL)_wk_tryPostProcessPluginComplexTextInputKeyDown:(NSEvent *)event { if (!_data->_pluginComplexTextInputIdentifier || _data->_pluginComplexTextInputState == PluginComplexTextInputDisabled) return NO; @@ -2355,15 +2348,15 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I if (_data->_pluginComplexTextInputState == PluginComplexTextInputEnabledLegacy) return NO; - return [self _handlePluginComplexTextInputKeyDown:event]; + return [self _wk_handlePluginComplexTextInputKeyDown:event]; } -- (void)_doneWithKeyEvent:(NSEvent *)event eventWasHandled:(BOOL)eventWasHandled +- (void)_wk_doneWithKeyEvent:(NSEvent *)event eventWasHandled:(BOOL)eventWasHandled { if ([event type] != NSKeyDown) return; - if ([self _tryPostProcessPluginComplexTextInputKeyDown:event]) + if ([self _wk_tryPostProcessPluginComplexTextInputKeyDown:event]) return; if (eventWasHandled) { @@ -2382,7 +2375,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I _data->_keyDownEventBeingResent = nullptr; } -- (BOOL)_interpretKeyEvent:(NSEvent *)event savingCommandsTo:(Vector<WebCore::KeypressCommand>&)commands +- (BOOL)_wk_interpretKeyEvent:(NSEvent *)event savingCommandsTo:(Vector<WebCore::KeypressCommand>&)commands { ASSERT(!_data->_interpretKeyEventsParameters); ASSERT(commands.isEmpty()); @@ -2417,12 +2410,12 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I return parameters.eventInterpretationHadSideEffects; } -- (NSRect)_convertToDeviceSpace:(NSRect)rect +- (NSRect)_wk_convertToDeviceSpace:(NSRect)rect { return toDeviceSpace(rect, [self window]); } -- (NSRect)_convertToUserSpace:(NSRect)rect +- (NSRect)_wk_convertToUserSpace:(NSRect)rect { return toUserSpace(rect, [self window]); } @@ -2438,7 +2431,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I return TRACKING_RECT_TAG; } -- (NSTrackingRectTag)_addTrackingRect:(NSRect)rect owner:(id)owner userData:(void *)data assumeInside:(BOOL)assumeInside useTrackingNum:(int)tag +- (NSTrackingRectTag)_wk_addTrackingRect:(NSRect)rect owner:(id)owner userData:(void *)data assumeInside:(BOOL)assumeInside useTrackingNum:(int)tag { ASSERT(tag == 0 || tag == TRACKING_RECT_TAG); ASSERT(_data->_trackingRectOwner == nil); @@ -2447,7 +2440,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I return TRACKING_RECT_TAG; } -- (void)_addTrackingRects:(NSRect *)rects owner:(id)owner userDataList:(void **)userDataList assumeInsideList:(BOOL *)assumeInsideList trackingNums:(NSTrackingRectTag *)trackingNums count:(int)count +- (void)_wk_addTrackingRects:(NSRect *)rects owner:(id)owner userDataList:(void **)userDataList assumeInsideList:(BOOL *)assumeInsideList trackingNums:(NSTrackingRectTag *)trackingNums count:(int)count { ASSERT(count == 1); ASSERT(trackingNums[0] == 0 || trackingNums[0] == TRACKING_RECT_TAG); @@ -2481,7 +2474,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I ASSERT_NOT_REACHED(); } -- (void)_removeTrackingRects:(NSTrackingRectTag *)tags count:(int)count +- (void)_wk_removeTrackingRects:(NSTrackingRectTag *)tags count:(int)count { int i; for (i = 0; i < count; ++i) { @@ -2495,7 +2488,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I } } -- (void)_sendToolTipMouseExited +- (void)_wk_sendToolTipMouseExited { // Nothing matters except window, trackingNumber, and userData. NSEvent *fakeEvent = [NSEvent enterExitEventWithType:NSMouseExited @@ -2510,7 +2503,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I [_data->_trackingRectOwner mouseExited:fakeEvent]; } -- (void)_sendToolTipMouseEntered +- (void)_wk_sendToolTipMouseEntered { // Nothing matters except window, trackingNumber, and userData. NSEvent *fakeEvent = [NSEvent enterExitEventWithType:NSMouseEntered @@ -2525,26 +2518,23 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I [_data->_trackingRectOwner mouseEntered:fakeEvent]; } -- (NSString *)view:(NSView *)view stringForToolTip:(NSToolTipTag)tag point:(NSPoint)point userData:(void *)data -{ - return nsStringFromWebCoreString(_data->_page->toolTip()); -} - -- (void)_toolTipChangedFrom:(NSString *)oldToolTip to:(NSString *)newToolTip +- (void)_wk_toolTipChangedFrom:(NSString *)oldToolTip to:(NSString *)newToolTip { if (oldToolTip) - [self _sendToolTipMouseExited]; + [self _wk_sendToolTipMouseExited]; if (newToolTip && [newToolTip length] > 0) { // See radar 3500217 for why we remove all tooltips rather than just the single one we created. [self removeAllToolTips]; NSRect wideOpenRect = NSMakeRect(-100000, -100000, 200000, 200000); - _data->_lastToolTipTag = [self addToolTipRect:wideOpenRect owner:self userData:NULL]; - [self _sendToolTipMouseEntered]; + if (!_data->_toolTipDelegate) + _data->_toolTipDelegate = adoptNS([[WKToolTipDelegate alloc] initWithPage:_data->_page.get()]); + _data->_lastToolTipTag = [self addToolTipRect:wideOpenRect owner:_data->_toolTipDelegate.get() userData:NULL]; + [self _wk_sendToolTipMouseEntered]; } } -- (void)_setFindIndicator:(PassRefPtr<FindIndicator>)findIndicator fadeOut:(BOOL)fadeOut animate:(BOOL)animate +- (void)_wk_setFindIndicator:(PassRefPtr<FindIndicator>)findIndicator fadeOut:(BOOL)fadeOut animate:(BOOL)animate { if (!findIndicator) { _data->_findIndicatorWindow = nullptr; @@ -2557,7 +2547,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I _data->_findIndicatorWindow->setFindIndicator(findIndicator, fadeOut, animate); } -- (void)_enterAcceleratedCompositingMode:(const LayerTreeContext&)layerTreeContext +- (void)_wk_enterAcceleratedCompositingMode:(const LayerTreeContext&)layerTreeContext { ASSERT(!_data->_layerHostingView); ASSERT(!layerTreeContext.isEmpty()); @@ -2586,7 +2576,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I [CATransaction commit]; } -- (void)_exitAcceleratedCompositingMode +- (void)_wk_exitAcceleratedCompositingMode { ASSERT(_data->_layerHostingView); @@ -2597,7 +2587,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I _data->_layerHostingView = nullptr; } -- (void)_updateAcceleratedCompositingMode:(const WebKit::LayerTreeContext&)layerTreeContext +- (void)_wk_updateAcceleratedCompositingMode:(const WebKit::LayerTreeContext&)layerTreeContext { if (_data->_layerHostingView) { // Wrap the call to setSublayers: in a CATransaction with actions disabled to @@ -2610,18 +2600,18 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I [CATransaction commit]; } else { - [self _exitAcceleratedCompositingMode]; - [self _enterAcceleratedCompositingMode:layerTreeContext]; + [self _wk_exitAcceleratedCompositingMode]; + [self _wk_enterAcceleratedCompositingMode:layerTreeContext]; } } -- (void)_setAccessibilityWebProcessToken:(NSData *)data +- (void)_wk_setAccessibilityWebProcessToken:(NSData *)data { _data->_remoteAccessibilityChild = WKAXRemoteElementForToken(data); - [self _updateRemoteAccessibilityRegistration:YES]; + [self _wk_updateRemoteAccessibilityRegistration:YES]; } -- (void)_pluginFocusOrWindowFocusChanged:(BOOL)pluginHasFocusAndWindowHasFocus pluginComplexTextInputIdentifier:(uint64_t)pluginComplexTextInputIdentifier +- (void)_wk_pluginFocusOrWindowFocusChanged:(BOOL)pluginHasFocusAndWindowHasFocus pluginComplexTextInputIdentifier:(uint64_t)pluginComplexTextInputIdentifier { BOOL inputSourceChanged = _data->_pluginComplexTextInputIdentifier; @@ -2649,17 +2639,17 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I [NSApp updateWindows]; } -- (void)_setPluginComplexTextInputState:(PluginComplexTextInputState)pluginComplexTextInputState pluginComplexTextInputIdentifier:(uint64_t)pluginComplexTextInputIdentifier +- (void)_wk_setPluginComplexTextInputState:(PluginComplexTextInputState)pluginComplexTextInputState pluginComplexTextInputIdentifier:(uint64_t)pluginComplexTextInputIdentifier { if (pluginComplexTextInputIdentifier != _data->_pluginComplexTextInputIdentifier) { // We're asked to update the state for a plug-in that doesn't have focus. return; } - [self _setPluginComplexTextInputState:pluginComplexTextInputState]; + [self _wk_setPluginComplexTextInputState:pluginComplexTextInputState]; } -- (void)_setPageHasCustomRepresentation:(BOOL)pageHasCustomRepresentation +- (void)_wk_setPageHasCustomRepresentation:(BOOL)pageHasCustomRepresentation { bool hadPDFView = _data->_pdfViewController; _data->_pdfViewController = nullptr; @@ -2671,14 +2661,14 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I _data->_page->drawingArea()->pageCustomRepresentationChanged(); } -- (void)_didFinishLoadingDataForCustomRepresentationWithSuggestedFilename:(const String&)suggestedFilename dataReference:(const CoreIPC::DataReference&)dataReference +- (void)_wk_didFinishLoadingDataForCustomRepresentationWithSuggestedFilename:(const String&)suggestedFilename dataReference:(const CoreIPC::DataReference&)dataReference { ASSERT(_data->_pdfViewController); _data->_pdfViewController->setPDFDocumentData(_data->_page->mainFrame()->mimeType(), suggestedFilename, dataReference); } -- (double)_customRepresentationZoomFactor +- (double)_wk_customRepresentationZoomFactor { if (!_data->_pdfViewController) return 1; @@ -2686,7 +2676,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I return _data->_pdfViewController->zoomFactor(); } -- (void)_setCustomRepresentationZoomFactor:(double)zoomFactor +- (void)_wk_setCustomRepresentationZoomFactor:(double)zoomFactor { if (!_data->_pdfViewController) return; @@ -2694,7 +2684,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I _data->_pdfViewController->setZoomFactor(zoomFactor); } -- (void)_findStringInCustomRepresentation:(NSString *)string withFindOptions:(WebKit::FindOptions)options maxMatchCount:(NSUInteger)count +- (void)_wk_findStringInCustomRepresentation:(NSString *)string withFindOptions:(WebKit::FindOptions)options maxMatchCount:(NSUInteger)count { if (!_data->_pdfViewController) return; @@ -2702,7 +2692,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I _data->_pdfViewController->findString(string, options, count); } -- (void)_countStringMatchesInCustomRepresentation:(NSString *)string withFindOptions:(WebKit::FindOptions)options maxMatchCount:(NSUInteger)count +- (void)_wk_countStringMatchesInCustomRepresentation:(NSString *)string withFindOptions:(WebKit::FindOptions)options maxMatchCount:(NSUInteger)count { if (!_data->_pdfViewController) return; @@ -2710,7 +2700,7 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I _data->_pdfViewController->countStringMatches(string, options, count); } -- (void)_setDragImage:(NSImage *)image at:(NSPoint)clientPoint linkDrag:(BOOL)linkDrag +- (void)_wk_setDragImage:(NSImage *)image at:(NSPoint)clientPoint linkDrag:(BOOL)linkDrag { IntSize size([image size]); size.scale(1.0 / _data->_page->deviceScaleFactor()); @@ -2735,7 +2725,7 @@ static bool matchesExtensionOrEquivalent(NSString *filename, NSString *extension && hasCaseInsensitiveSuffix(filename, @".jpg")); } -- (void)_setPromisedData:(WebCore::Image *)image withFileName:(NSString *)filename withExtension:(NSString *)extension withTitle:(NSString *)title withURL:(NSString *)url withVisibleURL:(NSString *)visibleUrl withArchive:(WebCore::SharedBuffer*) archiveBuffer forPasteboard:(NSString *)pasteboardName +- (void)_wk_setPromisedData:(WebCore::Image *)image withFileName:(NSString *)filename withExtension:(NSString *)extension withTitle:(NSString *)title withURL:(NSString *)url withVisibleURL:(NSString *)visibleUrl withArchive:(WebCore::SharedBuffer*) archiveBuffer forPasteboard:(NSString *)pasteboardName { NSPasteboard *pasteboard = [NSPasteboard pasteboardWithName:pasteboardName]; @@ -2843,9 +2833,9 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path) return [NSArray arrayWithObject:[path lastPathComponent]]; } -- (void)_updateSecureInputState +- (void)_wk_updateSecureInputState { - if (![[self window] isKeyWindow] || ![self _isFocused]) { + if (![[self window] isKeyWindow] || ![self _wk_isFocused]) { if (_data->_inSecureInputState) { DisableSecureEventInput(); _data->_inSecureInputState = NO; @@ -2871,13 +2861,13 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path) _data->_inSecureInputState = isInPasswordField; } -- (void)_updateTextInputStateIncludingSecureInputState:(BOOL)updateSecureInputState +- (void)_wk_updateTextInputStateIncludingSecureInputState:(BOOL)updateSecureInputState { const EditorState& editorState = _data->_page->editorState(); if (updateSecureInputState) { // This is a temporary state when editing. Flipping secure input state too quickly can expose race conditions. if (!editorState.selectionIsNone) - [self _updateSecureInputState]; + [self _wk_updateSecureInputState]; } if (!editorState.hasComposition || editorState.shouldIgnoreCompositionSelectionChange) @@ -2885,12 +2875,12 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path) _data->_page->cancelComposition(); - [self _notifyInputContextAboutDiscardedComposition]; + [self _wk_notifyInputContextAboutDiscardedComposition]; } -- (void)_resetTextInputState +- (void)_wk_resetTextInputState { - [self _notifyInputContextAboutDiscardedComposition]; + [self _wk_notifyInputContextAboutDiscardedComposition]; if (_data->_inSecureInputState) { DisableSecureEventInput(); @@ -2898,7 +2888,7 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path) } } -- (void)_didChangeScrollbarsForMainFrame +- (void)_wk_didChangeScrollbarsForMainFrame { #if __MAC_OS_X_VERSION_MIN_REQUIRED == 1060 [self _updateGrowBoxForWindowFrameChange]; @@ -2906,12 +2896,13 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path) } #if ENABLE(FULLSCREEN_API) -- (BOOL)hasFullScreenWindowController + +- (BOOL)_wk_hasFullScreenWindowController { return (bool)_data->_fullScreenWindowController; } -- (WKFullScreenWindowController*)fullScreenWindowController +- (WKFullScreenWindowController*)_wk_fullScreenWindowController { if (!_data->_fullScreenWindowController) { _data->_fullScreenWindowController.adoptNS([[WKFullScreenWindowController alloc] init]); @@ -2920,16 +2911,17 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path) return _data->_fullScreenWindowController.get(); } -- (void)closeFullScreenWindowController +- (void)_wk_closeFullScreenWindowController { if (!_data->_fullScreenWindowController) return; [_data->_fullScreenWindowController.get() close]; _data->_fullScreenWindowController = nullptr; } + #endif -- (bool)_executeSavedCommandBySelector:(SEL)selector +- (bool)_wk_executeSavedCommandBySelector:(SEL)selector { // The sink does two things: 1) Tells us if the responder went unhandled, and // 2) prevents any NSBeep; we don't ever want to beep here. @@ -2939,7 +2931,7 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path) return ![sink.get() didReceiveUnhandledCommand]; } -- (void)_cacheWindowBottomCornerRect +- (void)_wk_cacheWindowBottomCornerRect { #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 // FIXME: We should remove this code when <rdar://problem/9362085> is resolved. @@ -2953,7 +2945,7 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path) #endif } -- (NSInteger)spellCheckerDocumentTag +- (NSInteger)_wk_spellCheckerDocumentTag { if (!_data->_hasSpellCheckerDocumentTag) { _data->_spellCheckerDocumentTag = [NSSpellChecker uniqueSpellDocumentTag]; @@ -2962,17 +2954,17 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path) return _data->_spellCheckerDocumentTag; } -- (void)handleAcceptedAlternativeText:(NSString*)text +- (void)_wk_handleAcceptedAlternativeText:(NSString*)text { _data->_page->handleAlternativeTextUIResult(text); } -- (void)_setSuppressVisibilityUpdates:(BOOL)suppressVisibilityUpdates +- (void)_wk_setSuppressVisibilityUpdates:(BOOL)suppressVisibilityUpdates { _data->_page->setSuppressVisibilityUpdates(suppressVisibilityUpdates); } -- (BOOL)_suppressVisibilityUpdates +- (BOOL)_wk_suppressVisibilityUpdates { return _data->_page->suppressVisibilityUpdates(); } @@ -2981,7 +2973,7 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path) @implementation WKView (Private) -- (void)_registerDraggedTypes +- (void)_wk_registerDraggedTypes { NSMutableSet *types = [[NSMutableSet alloc] initWithArray:PasteboardTypes::forEditing()]; [types addObjectsFromArray:PasteboardTypes::forURL()]; @@ -3027,7 +3019,7 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path) _data->_pageClient = PageClientImpl::create(self); _data->_page = toImpl(contextRef)->createWebPage(_data->_pageClient.get(), toImpl(pageGroupRef), toImpl(relatedPage)); - _data->_page->setIntrinsicDeviceScaleFactor([self _intrinsicDeviceScaleFactor]); + _data->_page->setIntrinsicDeviceScaleFactor([self _wk_intrinsicDeviceScaleFactor]); _data->_page->initializeWebPage(); #if ENABLE(FULLSCREEN_API) _data->_page->fullScreenManager()->setWebView(self); @@ -3035,7 +3027,7 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path) _data->_mouseDownEvent = nil; _data->_ignoringMouseDraggedEvents = NO; - [self _registerDraggedTypes]; + [self _wk_registerDraggedTypes]; if ([self _shouldUseTiledDrawingArea]) { self.wantsLayer = YES; @@ -3050,6 +3042,7 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path) } #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 + - (BOOL)wantsUpdateLayer { return [self _shouldUseTiledDrawingArea]; @@ -3062,6 +3055,7 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path) if (DrawingAreaProxy* drawingArea = _data->_page->drawingArea()) drawingArea->waitForPossibleGeometryUpdate(); } + #endif - (WKPageRef)pageRef @@ -3116,7 +3110,7 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path) return; if (!(--_data->_frameSizeUpdatesDisabledCount)) - [self _setDrawingAreaSize:[self frame].size]; + [self _wk_setDrawingAreaSize:[self frame].size]; } - (BOOL)frameSizeUpdatesDisabled @@ -3140,6 +3134,11 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path) #endif } +- (BOOL)_shouldUseTiledDrawingArea +{ + return NO; +} + @end @implementation WKResponderChainSink @@ -3197,3 +3196,21 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path) } @end + +@implementation WKToolTipDelegate + +- (id)initWithPage:(WebPageProxy *)page +{ + self = [super init]; + if (!self) + return nil; + _page = page; + return self; +} + +- (NSString *)view:(NSView *)view stringForToolTip:(NSToolTipTag)tag point:(NSPoint)point userData:(void *)data +{ + return nsStringFromWebCoreString(_page->toolTip()); +} + +@end diff --git a/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h b/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h index 2e99e7976..f2b681649 100644 --- a/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h +++ b/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -50,58 +50,59 @@ namespace WebKit { @class WKFullScreenWindowController; @interface WKView (Internal) -- (PassOwnPtr<WebKit::DrawingAreaProxy>)_createDrawingAreaProxy; -- (BOOL)_isFocused; -- (void)_processDidCrash; -- (void)_pageClosed; -- (void)_didRelaunchProcess; -- (void)_toolTipChangedFrom:(NSString *)oldToolTip to:(NSString *)newToolTip; -- (void)_setCursor:(NSCursor *)cursor; -- (void)_setUserInterfaceItemState:(NSString *)commandName enabled:(BOOL)isEnabled state:(int)newState; -- (BOOL)_interpretKeyEvent:(NSEvent *)theEvent savingCommandsTo:(Vector<WebCore::KeypressCommand>&)commands; -- (void)_doneWithKeyEvent:(NSEvent *)event eventWasHandled:(BOOL)eventWasHandled; -- (bool)_executeSavedCommandBySelector:(SEL)selector; -- (NSRect)_convertToDeviceSpace:(NSRect)rect; -- (NSRect)_convertToUserSpace:(NSRect)rect; -- (void)_setFindIndicator:(PassRefPtr<WebKit::FindIndicator>)findIndicator fadeOut:(BOOL)fadeOut animate:(BOOL)animate; - -- (void)_enterAcceleratedCompositingMode:(const WebKit::LayerTreeContext&)layerTreeContext; -- (void)_exitAcceleratedCompositingMode; -- (void)_updateAcceleratedCompositingMode:(const WebKit::LayerTreeContext&)layerTreeContext; - -- (void)_setAccessibilityWebProcessToken:(NSData *)data; - -- (void)_pluginFocusOrWindowFocusChanged:(BOOL)pluginHasFocusAndWindowHasFocus pluginComplexTextInputIdentifier:(uint64_t)pluginComplexTextInputIdentifier; -- (void)_setPluginComplexTextInputState:(WebKit::PluginComplexTextInputState)pluginComplexTextInputState pluginComplexTextInputIdentifier:(uint64_t)pluginComplexTextInputIdentifier; - -- (void)_setPageHasCustomRepresentation:(BOOL)pageHasCustomRepresentation; -- (void)_didFinishLoadingDataForCustomRepresentationWithSuggestedFilename:(const String&)suggestedFilename dataReference:(const CoreIPC::DataReference&)dataReference; -- (double)_customRepresentationZoomFactor; -- (void)_setCustomRepresentationZoomFactor:(double)zoomFactor; -- (void)_findStringInCustomRepresentation:(NSString *)string withFindOptions:(WebKit::FindOptions)options maxMatchCount:(NSUInteger)count; -- (void)_countStringMatchesInCustomRepresentation:(NSString *)string withFindOptions:(WebKit::FindOptions)options maxMatchCount:(NSUInteger)count; -- (void)_setDragImage:(NSImage *)image at:(NSPoint)clientPoint linkDrag:(BOOL)linkDrag; -- (void)_setPromisedData:(WebCore::Image *)image withFileName:(NSString *)filename withExtension:(NSString *)extension withTitle:(NSString *)title withURL:(NSString *)url withVisibleURL:(NSString *)visibleUrl withArchive:(WebCore::SharedBuffer*) archiveBuffer forPasteboard:(NSString *)pasteboardName; -- (void)_updateSecureInputState; -- (void)_updateTextInputStateIncludingSecureInputState:(BOOL)updateSecureInputState; -- (void)_resetTextInputState; - -- (void)_didChangeScrollbarsForMainFrame; - -- (WebKit::ColorSpaceData)_colorSpace; + +- (PassOwnPtr<WebKit::DrawingAreaProxy>)_wk_createDrawingAreaProxy; +- (BOOL)_wk_isFocused; +- (void)_wk_processDidCrash; +- (void)_wk_pageClosed; +- (void)_wk_didRelaunchProcess; +- (void)_wk_toolTipChangedFrom:(NSString *)oldToolTip to:(NSString *)newToolTip; +- (void)_wk_setCursor:(NSCursor *)cursor; +- (void)_wk_setUserInterfaceItemState:(NSString *)commandName enabled:(BOOL)isEnabled state:(int)newState; +- (BOOL)_wk_interpretKeyEvent:(NSEvent *)theEvent savingCommandsTo:(Vector<WebCore::KeypressCommand>&)commands; +- (void)_wk_doneWithKeyEvent:(NSEvent *)event eventWasHandled:(BOOL)eventWasHandled; +- (bool)_wk_executeSavedCommandBySelector:(SEL)selector; +- (NSRect)_wk_convertToDeviceSpace:(NSRect)rect; +- (NSRect)_wk_convertToUserSpace:(NSRect)rect; +- (void)_wk_setFindIndicator:(PassRefPtr<WebKit::FindIndicator>)findIndicator fadeOut:(BOOL)fadeOut animate:(BOOL)animate; + +- (void)_wk_enterAcceleratedCompositingMode:(const WebKit::LayerTreeContext&)layerTreeContext; +- (void)_wk_exitAcceleratedCompositingMode; +- (void)_wk_updateAcceleratedCompositingMode:(const WebKit::LayerTreeContext&)layerTreeContext; + +- (void)_wk_setAccessibilityWebProcessToken:(NSData *)data; + +- (void)_wk_pluginFocusOrWindowFocusChanged:(BOOL)pluginHasFocusAndWindowHasFocus pluginComplexTextInputIdentifier:(uint64_t)pluginComplexTextInputIdentifier; +- (void)_wk_setPluginComplexTextInputState:(WebKit::PluginComplexTextInputState)pluginComplexTextInputState pluginComplexTextInputIdentifier:(uint64_t)pluginComplexTextInputIdentifier; + +- (void)_wk_setPageHasCustomRepresentation:(BOOL)pageHasCustomRepresentation; +- (void)_wk_didFinishLoadingDataForCustomRepresentationWithSuggestedFilename:(const String&)suggestedFilename dataReference:(const CoreIPC::DataReference&)dataReference; +- (double)_wk_customRepresentationZoomFactor; +- (void)_wk_setCustomRepresentationZoomFactor:(double)zoomFactor; +- (void)_wk_findStringInCustomRepresentation:(NSString *)string withFindOptions:(WebKit::FindOptions)options maxMatchCount:(NSUInteger)count; +- (void)_wk_countStringMatchesInCustomRepresentation:(NSString *)string withFindOptions:(WebKit::FindOptions)options maxMatchCount:(NSUInteger)count; +- (void)_wk_setDragImage:(NSImage *)image at:(NSPoint)clientPoint linkDrag:(BOOL)linkDrag; +- (void)_wk_setPromisedData:(WebCore::Image *)image withFileName:(NSString *)filename withExtension:(NSString *)extension withTitle:(NSString *)title withURL:(NSString *)url withVisibleURL:(NSString *)visibleUrl withArchive:(WebCore::SharedBuffer*) archiveBuffer forPasteboard:(NSString *)pasteboardName; +- (void)_wk_updateSecureInputState; +- (void)_wk_updateTextInputStateIncludingSecureInputState:(BOOL)updateSecureInputState; +- (void)_wk_resetTextInputState; + +- (void)_wk_didChangeScrollbarsForMainFrame; + +- (WebKit::ColorSpaceData)_wk_colorSpace; #if ENABLE(FULLSCREEN_API) -- (BOOL)hasFullScreenWindowController; -- (WKFullScreenWindowController*)fullScreenWindowController; -- (void)closeFullScreenWindowController; +- (BOOL)_wk_hasFullScreenWindowController; +- (WKFullScreenWindowController*)_wk_fullScreenWindowController; +- (void)_wk_closeFullScreenWindowController; #endif -- (void)_cacheWindowBottomCornerRect; +- (void)_wk_cacheWindowBottomCornerRect; -- (NSInteger)spellCheckerDocumentTag; -- (void)handleAcceptedAlternativeText:(NSString*)text; +- (NSInteger)_wk_spellCheckerDocumentTag; +- (void)_wk_handleAcceptedAlternativeText:(NSString*)text; -- (void)_setSuppressVisibilityUpdates:(BOOL)suppressVisibilityUpdates; -- (BOOL)_suppressVisibilityUpdates; +- (void)_wk_setSuppressVisibilityUpdates:(BOOL)suppressVisibilityUpdates; +- (BOOL)_wk_suppressVisibilityUpdates; @end diff --git a/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h b/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h index 51578764f..035b1ea2c 100644 --- a/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h +++ b/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Apple Inc. All rights reserved. + * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -50,4 +50,8 @@ - (void)performDictionaryLookupAtCurrentMouseLocation; + (void)hideWordDefinitionWindow; +// FIXME: This method currently overridden by Safari to turn tiled drawing area on. +// We should come up with a cleaner SPI or API for this. +- (BOOL)_shouldUseTiledDrawingArea; + @end |