diff options
Diffstat (limited to 'Source/WebKit/efl/ewk')
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_contextmenu.cpp | 203 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_contextmenu.h | 37 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_cookies.cpp | 4 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_cookies.h | 6 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_frame.cpp | 9 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_history.cpp | 7 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_main.cpp | 5 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_private.h | 9 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_settings.cpp | 67 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_settings.h | 11 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_view.cpp | 44 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_view.h | 2 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_window_features.cpp | 67 | ||||
-rw-r--r-- | Source/WebKit/efl/ewk/ewk_window_features.h | 6 |
14 files changed, 370 insertions, 107 deletions
diff --git a/Source/WebKit/efl/ewk/ewk_contextmenu.cpp b/Source/WebKit/efl/ewk/ewk_contextmenu.cpp index 40bd2ba..128208d 100644 --- a/Source/WebKit/efl/ewk/ewk_contextmenu.cpp +++ b/Source/WebKit/efl/ewk/ewk_contextmenu.cpp @@ -31,33 +31,53 @@ #include <eina_safety_checks.h> #include <wtf/text/CString.h> +/** + * \struct _Ewk_Context_Menu + * @brief Contains the context menu data. + */ struct _Ewk_Context_Menu { - unsigned int __ref; + unsigned int __ref; /**< the reference count of the object */ #if ENABLE(CONTEXT_MENUS) - WebCore::ContextMenuController* controller; + WebCore::ContextMenuController* controller; /**< the WebCore's object which is responsible for the context menu */ #endif - Evas_Object* view; + Evas_Object* view; /**< the view object */ - Eina_List* items; + Eina_List* items; /**< the list of items */ }; +/** + * \struct _Ewk_Context_Menu_Item + * @brief Represents one item of the context menu object. + */ struct _Ewk_Context_Menu_Item { - Ewk_Context_Menu_Item_Type type; - Ewk_Context_Menu_Action action; + Ewk_Context_Menu_Item_Type type; /**< contains the type of the item */ + Ewk_Context_Menu_Action action; /**< contains the action of the item */ - const char* title; - Ewk_Context_Menu* submenu; + const char* title; /**< contains the title of the item */ + Ewk_Context_Menu* submenu; /**< contains the pointer to the submenu of the item */ Eina_Bool checked:1; Eina_Bool enabled:1; }; +/** + * Increases the reference count of the given object. + * + * @param menu the context menu object to increase the reference count + */ void ewk_context_menu_ref(Ewk_Context_Menu* menu) { EINA_SAFETY_ON_NULL_RETURN(menu); menu->__ref++; } +/** + * Decreases the reference count of the given object, possibly freeing it. + * + * When the reference count it's reached 0, the menu with all items are freed. + * + * @param menu the context menu object to decrease the reference count + */ void ewk_context_menu_unref(Ewk_Context_Menu* menu) { EINA_SAFETY_ON_NULL_RETURN(menu); @@ -72,6 +92,14 @@ void ewk_context_menu_unref(Ewk_Context_Menu* menu) free(menu); } +/** + * Destroys the context menu object. + * + * @param menu the context menu object to destroy + * @return @c EINA_TRUE on success, @c EINA_FALSE on failure + * + * @see ewk_context_menu_item_free + */ Eina_Bool ewk_context_menu_destroy(Ewk_Context_Menu* menu) { EINA_SAFETY_ON_NULL_RETURN_VAL(menu, EINA_FALSE); @@ -84,6 +112,12 @@ Eina_Bool ewk_context_menu_destroy(Ewk_Context_Menu* menu) return EINA_TRUE; } +/** + * Gets the list of items. + * + * @param o the context menu object to get list of the items + * @return the list of the items on success or @c 0 on failure + */ const Eina_List* ewk_context_menu_item_list_get(Ewk_Context_Menu* o) { EINA_SAFETY_ON_NULL_RETURN_VAL(o, 0); @@ -91,6 +125,19 @@ const Eina_List* ewk_context_menu_item_list_get(Ewk_Context_Menu* o) return o->items; } +/** + * Creates a new item of the context menu. + * + * @param type specifies a type of the item + * @param action specifies a action of the item + * @param submenu specifies a submenu of the item + * @param title specifies a title of the item + * @param checked + * @param enabled @c EINA_TRUE to enable the item or @c EINA_FALSE to disable + * @return the pointer to the new item on success or @c 0 on failure + * + * @note The return value @b should @b be freed after use. + */ Ewk_Context_Menu_Item* ewk_context_menu_item_new(Ewk_Context_Menu_Item_Type type, Ewk_Context_Menu_Action action, Ewk_Context_Menu* submenu, const char* title, Eina_Bool checked, Eina_Bool enabled) @@ -109,6 +156,13 @@ Ewk_Context_Menu_Item* ewk_context_menu_item_new(Ewk_Context_Menu_Item_Type type return item; } +/** + * Selects the item from the context menu object. + * + * @param menu the context menu object + * @param item the item is selected + * @return @c EINA_TRUE on success or @c EINA_FALSE on failure + */ Eina_Bool ewk_context_menu_item_select(Ewk_Context_Menu* menu, Ewk_Context_Menu_Item* item) { #if ENABLE(CONTEXT_MENUS) @@ -120,11 +174,20 @@ Eina_Bool ewk_context_menu_item_select(Ewk_Context_Menu* menu, Ewk_Context_Menu_ // Don't care about title and submenu as they're not used after this point. WebCore::ContextMenuItem core(type, action, WTF::String()); menu->controller->contextMenuItemSelected(&core); -#endif - return EINA_TRUE; +#else + return EINA_FALSE; +#endif } +/** + * Destroys the item of the context menu object. + * + * @param item the item to destroy + * + * @see ewk_context_menu_destroy + * @see ewk_context_menu_unref + */ void ewk_context_menu_item_free(Ewk_Context_Menu_Item* item) { EINA_SAFETY_ON_NULL_RETURN(item); @@ -133,12 +196,29 @@ void ewk_context_menu_item_free(Ewk_Context_Menu_Item* item) free(item); } +/** + * Gets type of the item. + * + * @param o the item to get the type + * @return type of the item on success or @c EWK_ACTION_TYPE on failure + * + * @see ewk_context_menu_item_type_set + */ Ewk_Context_Menu_Item_Type ewk_context_menu_item_type_get(Ewk_Context_Menu_Item* o) { EINA_SAFETY_ON_NULL_RETURN_VAL(o, EWK_ACTION_TYPE); return o->type; } +/** + * Sets the type of item. + * + * @param o the item to set the type + * @param type a new type for the item object + * @return @c EINA_TRUE on success, or @c EINA_FALSE on failure + * + * @see ewk_context_menu_item_type_get + */ Eina_Bool ewk_context_menu_item_type_set(Ewk_Context_Menu_Item* o, Ewk_Context_Menu_Item_Type type) { EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE); @@ -146,12 +226,29 @@ Eina_Bool ewk_context_menu_item_type_set(Ewk_Context_Menu_Item* o, Ewk_Context_M return EINA_TRUE; } +/** + * Gets an action of the item. + * + * @param o the item to get the action + * @return an action of the item on success or @c EWK_CONTEXT_MENU_ITEM_TAG_NO_ACTION on failure + * + * @see ewk_context_menu_item_action_set + */ Ewk_Context_Menu_Action ewk_context_menu_item_action_get(Ewk_Context_Menu_Item* o) { EINA_SAFETY_ON_NULL_RETURN_VAL(o, EWK_CONTEXT_MENU_ITEM_TAG_NO_ACTION); return o->action; } +/** + * Sets an action of the item. + * + * @param o the item to set the action + * @param action a new action for the item object + * @return @c EINA_TRUE on success, or @c EINA_FALSE on failure + * + * @see ewk_context_menu_item_action_get + */ Eina_Bool ewk_context_menu_item_action_set(Ewk_Context_Menu_Item* o, Ewk_Context_Menu_Action action) { EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE); @@ -159,12 +256,29 @@ Eina_Bool ewk_context_menu_item_action_set(Ewk_Context_Menu_Item* o, Ewk_Context return EINA_TRUE; } +/** + * Gets a title of the item. + * + * @param o the item to get the title + * @return a title of the item on success, or @c 0 on failure + * + * @see ewk_context_menu_item_title_set + */ const char* ewk_context_menu_item_title_get(Ewk_Context_Menu_Item* o) { EINA_SAFETY_ON_NULL_RETURN_VAL(o, 0); return o->title; } +/** + * Sets a title of the item. + * + * @param o the item to set the title + * @param title a new title for the item object + * @return a new title of the item on success or @c 0 on failure + * + * @see ewk_context_menu_item_title_get + */ const char* ewk_context_menu_item_title_set(Ewk_Context_Menu_Item* o, const char* title) { EINA_SAFETY_ON_NULL_RETURN_VAL(o, 0); @@ -185,12 +299,29 @@ Eina_Bool ewk_context_menu_item_checked_set(Ewk_Context_Menu_Item* o, Eina_Bool return EINA_TRUE; } +/** + * Gets if the item is enabled. + * + * @param o the item to get enabled state + * @return @c EINA_TRUE if it's enabled, @c EINA_FALSE if not or on failure + * + * @see ewk_context_menu_item_enabled_set + */ Eina_Bool ewk_context_menu_item_enabled_get(Ewk_Context_Menu_Item* o) { EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE); return o->enabled; } +/** + * Enables/disables the item. + * + * @param o the item to enable/disable + * @param enabled @c EINA_TRUE to enable the item or @c EINA_FALSE to disable + * @return @c EINA_TRUE on success, or @c EINA_FALSE on failure + * + * @see ewk_context_menu_item_enabled_get + */ Eina_Bool ewk_context_menu_item_enabled_set(Ewk_Context_Menu_Item *o, Eina_Bool enabled) { EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE); @@ -205,12 +336,13 @@ Eina_Bool ewk_context_menu_item_enabled_set(Ewk_Context_Menu_Item *o, Eina_Bool /** * @internal * - * Creates context on view. + * Creates an empty context menu on view. * - * @param view View. - * @param Controller Context Menu Controller. + * @param view the view object + * @param controller the WebCore's context menu controller + * @return newly allocated the context menu on success or @c 0 on errors * - * @return newly allocated context menu or @c 0 on errors. + * @note emits a signal "contextmenu,new" */ Ewk_Context_Menu* ewk_context_menu_new(Evas_Object* view, WebCore::ContextMenuController* controller) { @@ -233,6 +365,19 @@ Ewk_Context_Menu* ewk_context_menu_new(Evas_Object* view, WebCore::ContextMenuCo return menu; } +/** + * @internal + * + * Frees the context menu. + * + * @param o the view object + * @return @c EINA_TRUE on success, or @c EINA_FALSE on failure + * + * @note emits a signal "contextmenu,free" + * + * @see ewk_context_menu_unref + * @see ewk_context_menu_destroy + */ Eina_Bool ewk_context_menu_free(Ewk_Context_Menu* o) { EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE); @@ -241,6 +386,17 @@ Eina_Bool ewk_context_menu_free(Ewk_Context_Menu* o) return EINA_TRUE; } +/** + * @internal + * + * Appends the WebCore's item to the context menu object. + * + * @param o the context menu object + * @param core the WebCore's context menu item that will be added to the context menu + * @note emits a signal "contextmenu,item,appended" + * + * @see ewk_context_menu_item_new + */ void ewk_context_menu_item_append(Ewk_Context_Menu* o, WebCore::ContextMenuItem& core) { Ewk_Context_Menu_Item_Type type = static_cast<Ewk_Context_Menu_Item_Type>(core.type()); @@ -255,6 +411,18 @@ void ewk_context_menu_item_append(Ewk_Context_Menu* o, WebCore::ContextMenuItem& evas_object_smart_callback_call(o->view, "contextmenu,item,appended", o); } +/** + * @internal + * + * Emits a signal with the items of the context menu. + * + * @param o the context menu object + * @return the same context menu object that was given through parameter + * + * @note emits a signal "contextmenu,customize" + * + * @see ewk_context_menu_item_list_get + */ Ewk_Context_Menu* ewk_context_menu_custom_get(Ewk_Context_Menu* o) { EINA_SAFETY_ON_NULL_RETURN_VAL(o, 0); @@ -263,6 +431,13 @@ Ewk_Context_Menu* ewk_context_menu_custom_get(Ewk_Context_Menu* o) return o; } +/** + * @internal + * + * Emits a signal "contextmenu,show" + * + * @param o the context menu object + */ void ewk_context_menu_show(Ewk_Context_Menu* o) { EINA_SAFETY_ON_NULL_RETURN(o); diff --git a/Source/WebKit/efl/ewk/ewk_contextmenu.h b/Source/WebKit/efl/ewk/ewk_contextmenu.h index c5adb48..7b60410 100644 --- a/Source/WebKit/efl/ewk/ewk_contextmenu.h +++ b/Source/WebKit/efl/ewk/ewk_contextmenu.h @@ -18,6 +18,11 @@ Boston, MA 02110-1301, USA. */ +/** + * @file ewk_contextmenu.h + * @brief Describes the context menu API. + */ + #ifndef ewk_contextmenu_h #define ewk_contextmenu_h @@ -30,7 +35,11 @@ extern "C" { #endif -// keep this in sync with ContextMenuItem.h +/** + * \enum _Ewk_Context_Menu_Action + * @brief Provides the actions of items for the context menu. + * @info Keep this in sync with ContextMenuItem.h + */ enum _Ewk_Context_Menu_Action { EWK_CONTEXT_MENU_ITEM_TAG_NO_ACTION = 0, // this item is not actually in web_uidelegate.h EWK_CONTEXT_MENU_ITEM_TAG_OPEN_LINK_IN_NEW_WINDOW = 1, @@ -67,12 +76,12 @@ enum _Ewk_Context_Menu_Action { EWK_CONTEXT_MENU_ITEM_PDFPREVIOUS_PAGE, EWK_CONTEXT_MENU_ITEM_TAG_OPEN_LINK = 2000, EWK_CONTEXT_MENU_ITEM_TAG_IGNORE_GRAMMAR, - EWK_CONTEXT_MENU_ITEM_TAG_SPELLING_MENU, // spelling or spelling/grammar sub-menu + EWK_CONTEXT_MENU_ITEM_TAG_SPELLING_MENU, /**< spelling or spelling/grammar sub-menu */ EWK_CONTEXT_MENU_ITEM_TAG_SHOW_SPELLING_PANEL, EWK_CONTEXT_MENU_ITEM_TAG_CHECK_SPELLING, EWK_CONTEXT_MENU_ITEM_TAG_CHECK_SPELLING_WHILE_TYPING, EWK_CONTEXT_MENU_ITEM_TAG_CHECK_GRAMMAR_WITH_SPELLING, - EWK_CONTEXT_MENU_ITEM_TAG_FONT_MENU, // font sub-menu + EWK_CONTEXT_MENU_ITEM_TAG_FONT_MENU, /**< font sub-menu */ EWK_CONTEXT_MENU_ITEM_TAG_SHOW_FONTS, EWK_CONTEXT_MENU_ITEM_TAG_BOLD, EWK_CONTEXT_MENU_ITEM_TAG_ITALIC, @@ -80,41 +89,43 @@ enum _Ewk_Context_Menu_Action { EWK_CONTEXT_MENU_ITEM_TAG_OUTLINE, EWK_CONTEXT_MENU_ITEM_TAG_STYLES, EWK_CONTEXT_MENU_ITEM_TAG_SHOW_COLORS, - EWK_CONTEXT_MENU_ITEM_TAG_SPEECH_MENU, // speech sub-menu + EWK_CONTEXT_MENU_ITEM_TAG_SPEECH_MENU, /**< speech sub-menu */ EWK_CONTEXT_MENU_ITEM_TAG_START_SPEAKING, EWK_CONTEXT_MENU_ITEM_TAG_STOP_SPEAKING, - EWK_CONTEXT_MENU_ITEM_TAG_WRITING_DIRECTION_MENU, // writing direction sub-menu + EWK_CONTEXT_MENU_ITEM_TAG_WRITING_DIRECTION_MENU, /**< writing direction sub-menu */ EWK_CONTEXT_MENU_ITEM_TAG_DEFAULT_DIRECTION, EWK_CONTEXT_MENU_ITEM_TAG_LEFT_TO_RIGHT, EWK_CONTEXT_MENU_ITEM_TAG_RIGHT_TO_LEFT, EWK_CONTEXT_MENU_ITEM_TAG_PDFSINGLE_PAGE_SCROLLING, EWK_CONTEXT_MENU_ITEM_TAG_PDFFACING_PAGES_SCROLLING, - EWK_CONTEXT_MENU_ITEM_TAG_TEXT_DIRECTION_MENU, // text direction sub-menu + EWK_CONTEXT_MENU_ITEM_TAG_TEXT_DIRECTION_MENU, /**< text direction sub-menu */ EWK_CONTEXT_MENU_ITEM_TAG_TEXT_DIRECTION_DEFAULT, EWK_CONTEXT_MENU_ITEM_TAG_TEXT_DIRECTION_LEFT_TO_RIGHT, EWK_CONTEXT_MENU_ITEM_TAG_TEXT_DIRECTION_RIGHT_TO_LEFT, EWK_CONTEXT_MENU_ITEM_BASE_CUSTOM_TAG = 5000, EWK_CONTEXT_MENU_ITEM_BASE_APPLICATION_TAG = 10000 }; +/** Creates a type name for _Ewk_Context_Menu_Action */ typedef enum _Ewk_Context_Menu_Action Ewk_Context_Menu_Action; -// keep this in sync with ContextMenuItem.h +/** + * \enum _Ewk_Context_Menu_Item_Type + * @brief Defines the types of the items for the context menu. + * @info Keep this in sync with ContextMenuItem.h + */ enum _Ewk_Context_Menu_Item_Type { EWK_ACTION_TYPE, EWK_CHECKABLE_ACTION_TYPE, EWK_SEPARATOR_TYPE, EWK_SUBMENU_TYPE }; +/** Creates a type name for _Ewk_Context_Menu_Item_Type */ typedef enum _Ewk_Context_Menu_Item_Type Ewk_Context_Menu_Item_Type; -/** - * The structure to contain Context Menu data - */ +/** Creates a type name for _Ewk_Context_Menu */ typedef struct _Ewk_Context_Menu Ewk_Context_Menu; -/** - * Represents one item from Ewk_Context_Menu - */ +/** Creates a type name for _Ewk_Context_Menu_Item */ typedef struct _Ewk_Context_Menu_Item Ewk_Context_Menu_Item; diff --git a/Source/WebKit/efl/ewk/ewk_cookies.cpp b/Source/WebKit/efl/ewk/ewk_cookies.cpp index 7558154..048886b 100644 --- a/Source/WebKit/efl/ewk/ewk_cookies.cpp +++ b/Source/WebKit/efl/ewk/ewk_cookies.cpp @@ -76,7 +76,7 @@ EAPI Eina_Bool ewk_cookies_file_set(const char *filename) /** * Clears all the cookies from the cookie jar. */ -EAPI void ewk_cookies_clear() +EAPI void ewk_cookies_clear(void) { #if USE(SOUP) GSList* l; @@ -207,7 +207,7 @@ EAPI void ewk_cookies_policy_set(Ewk_Cookie_Policy p) * @return the current acceptance policy * @see Ewk_Cookie_Policy */ -EAPI Ewk_Cookie_Policy ewk_cookies_policy_get() +EAPI Ewk_Cookie_Policy ewk_cookies_policy_get(void) { Ewk_Cookie_Policy ewk_policy = EWK_COOKIE_JAR_ACCEPT_ALWAYS; #if USE(SOUP) diff --git a/Source/WebKit/efl/ewk/ewk_cookies.h b/Source/WebKit/efl/ewk/ewk_cookies.h index 19eac0f..ec0e84f 100644 --- a/Source/WebKit/efl/ewk/ewk_cookies.h +++ b/Source/WebKit/efl/ewk/ewk_cookies.h @@ -76,12 +76,12 @@ typedef enum _Ewk_Cookie_Policy Ewk_Cookie_Policy; /************************** Exported functions ***********************/ EAPI Eina_Bool ewk_cookies_file_set(const char *filename); -EAPI void ewk_cookies_clear(); -EAPI Eina_List* ewk_cookies_get_all(); +EAPI void ewk_cookies_clear(void); +EAPI Eina_List* ewk_cookies_get_all(void); EAPI void ewk_cookies_cookie_del(Ewk_Cookie *cookie); EAPI void ewk_cookies_cookie_free(Ewk_Cookie *cookie); EAPI void ewk_cookies_policy_set(Ewk_Cookie_Policy p); -EAPI Ewk_Cookie_Policy ewk_cookies_policy_get(); +EAPI Ewk_Cookie_Policy ewk_cookies_policy_get(void); #ifdef __cplusplus } diff --git a/Source/WebKit/efl/ewk/ewk_frame.cpp b/Source/WebKit/efl/ewk/ewk_frame.cpp index 0e2f903..4e52b56 100644 --- a/Source/WebKit/efl/ewk/ewk_frame.cpp +++ b/Source/WebKit/efl/ewk/ewk_frame.cpp @@ -1484,9 +1484,14 @@ Eina_Bool ewk_frame_feed_touch_event(Evas_Object* o, Ewk_Touch_Event_Type action Eina_Bool ret = EINA_FALSE; #if ENABLE(TOUCH_EVENTS) - EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); - EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(points, EINA_FALSE); + EWK_FRAME_SD_GET(o, sd); + + if (!sd || !sd->frame || !ewk_view_need_touch_events_get(sd->view)) { + void* point; + EINA_LIST_FREE(points, point); + return EINA_FALSE; + } Evas_Coord x, y; evas_object_geometry_get(sd->view, &x, &y, 0, 0); diff --git a/Source/WebKit/efl/ewk/ewk_history.cpp b/Source/WebKit/efl/ewk/ewk_history.cpp index 0a9d349..fb70903 100644 --- a/Source/WebKit/efl/ewk/ewk_history.cpp +++ b/Source/WebKit/efl/ewk/ewk_history.cpp @@ -24,7 +24,9 @@ #include "BackForwardListImpl.h" #include "EWebKit.h" #include "HistoryItem.h" +#include "IconDatabaseBase.h" #include "Image.h" +#include "IntSize.h" #include "ewk_private.h" #include <wtf/text/CString.h> @@ -578,7 +580,8 @@ double ewk_history_item_time_last_visited_get(const Ewk_History_Item* item) cairo_surface_t* ewk_history_item_icon_surface_get(const Ewk_History_Item* item) { EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0); - WebCore::Image* icon = core->icon(); + + WebCore::Image* icon = WebCore::iconDatabase().synchronousIconForPageURL(core->url(), WebCore::IntSize(16, 16)); if (!icon) { ERR("icon is NULL."); return 0; @@ -606,7 +609,7 @@ Evas_Object* ewk_history_item_icon_object_add(const Ewk_History_Item* item, Evas { EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0); EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, 0); - WebCore::Image* icon = core->icon(); + WebCore::Image* icon = WebCore::iconDatabase().synchronousIconForPageURL(core->url(), WebCore::IntSize(16, 16)); cairo_surface_t* surface; if (!icon) { diff --git a/Source/WebKit/efl/ewk/ewk_main.cpp b/Source/WebKit/efl/ewk/ewk_main.cpp index c1c8e02..0c7cc70 100644 --- a/Source/WebKit/efl/ewk/ewk_main.cpp +++ b/Source/WebKit/efl/ewk/ewk_main.cpp @@ -26,7 +26,6 @@ #include "Logging.h" #include "PageCache.h" #include "PageGroup.h" -#include "appcache/ApplicationCacheStorage.h" #include "ewk_private.h" #include "ewk_settings.h" #include "runtime/InitializeThreading.h" @@ -175,7 +174,9 @@ Eina_Bool _ewk_init_body(void) ewk_settings_web_database_path_set(wkdir.utf8().data()); ewk_settings_icon_database_path_set(wkdir.utf8().data()); - WebCore::cacheStorage().setCacheDirectory(wkdir); +#if ENABLE(OFFLINE_WEB_APPLICATIONS) + ewk_settings_cache_directory_path_set(wkdir.utf8().data()); +#endif } // TODO: this should move to WebCore, already reported to webkit-gtk folks: diff --git a/Source/WebKit/efl/ewk/ewk_private.h b/Source/WebKit/efl/ewk/ewk_private.h index 496efdb..114c39e 100644 --- a/Source/WebKit/efl/ewk/ewk_private.h +++ b/Source/WebKit/efl/ewk/ewk_private.h @@ -106,7 +106,12 @@ void ewk_view_viewport_attributes_set(Evas_Object *o, const WebCore::ViewportArg void ewk_view_download_request(Evas_Object *o, Ewk_Download *download); -int ewk_view_dpi_get(); +int ewk_view_dpi_get(void); + +#if ENABLE(TOUCH_EVENTS) +void ewk_view_need_touch_events_set(Evas_Object*, bool needed); +Eina_Bool ewk_view_need_touch_events_get(Evas_Object*); +#endif Ewk_History *ewk_history_new(WebCore::BackForwardListImpl *history); void ewk_history_free(Ewk_History *history); @@ -160,7 +165,7 @@ void ewk_view_contents_size_changed(Evas_Object *o, Evas_Coord w, Evas_Coord h); WebCore::FloatRect ewk_view_page_rect_get(Evas_Object *o); -const char* ewk_settings_default_user_agent_get(); +const char* ewk_settings_default_user_agent_get(void); #ifdef __cplusplus diff --git a/Source/WebKit/efl/ewk/ewk_settings.cpp b/Source/WebKit/efl/ewk/ewk_settings.cpp index 69934c0..3a185d9 100644 --- a/Source/WebKit/efl/ewk/ewk_settings.cpp +++ b/Source/WebKit/efl/ewk/ewk_settings.cpp @@ -47,6 +47,12 @@ #include <libsoup/soup.h> #endif +#if ENABLE(OFFLINE_WEB_APPLICATIONS) +#include "appcache/ApplicationCacheStorage.h" + +static const char* _ewk_cache_directory_path = 0; +#endif + static const char* _ewk_default_web_database_path = 0; static const char* _ewk_icon_database_path = 0; static uint64_t _ewk_default_web_database_quota = 1 * 1024 * 1024; @@ -81,7 +87,7 @@ static WTF::String _ewk_settings_webkit_os_version_get() * * @return the current default database quota in bytes */ -uint64_t ewk_settings_web_database_default_quota_get() +uint64_t ewk_settings_web_database_default_quota_get(void) { return _ewk_default_web_database_quota; } @@ -114,7 +120,7 @@ void ewk_settings_web_database_path_set(const char *path) * * @return database path or @c 0 if none or web database is not supported */ -const char *ewk_settings_web_database_path_get() +const char *ewk_settings_web_database_path_get(void) { #if ENABLE(DATABASE) return _ewk_default_web_database_path; @@ -133,7 +139,7 @@ const char *ewk_settings_web_database_path_get() */ Eina_Bool ewk_settings_icon_database_path_set(const char *directory) { - WebCore::iconDatabase().delayDatabaseCleanup(); + WebCore::IconDatabase::delayDatabaseCleanup(); if (directory) { struct stat st; @@ -155,7 +161,7 @@ Eina_Bool ewk_settings_icon_database_path_set(const char *directory) } WebCore::iconDatabase().setEnabled(true); - WebCore::iconDatabase().open(WTF::String::fromUTF8(directory)); + WebCore::iconDatabase().open(WTF::String::fromUTF8(directory), WebCore::IconDatabase::defaultDatabaseFilename()); if (!_ewk_icon_database_path) _ewk_icon_database_path = eina_stringshare_add(directory); else @@ -225,7 +231,7 @@ cairo_surface_t* ewk_settings_icon_database_icon_surface_get(const char *url) EINA_SAFETY_ON_NULL_RETURN_VAL(url, 0); WebCore::KURL kurl(WebCore::KURL(), WTF::String::fromUTF8(url)); - WebCore::Image *icon = WebCore::iconDatabase().iconForPageURL(kurl.string(), WebCore::IntSize(16, 16)); + WebCore::Image *icon = WebCore::iconDatabase().synchronousIconForPageURL(kurl.string(), WebCore::IntSize(16, 16)); if (!icon) { ERR("no icon for url %s", url); @@ -257,7 +263,7 @@ Evas_Object* ewk_settings_icon_database_icon_object_add(const char* url, Evas* c EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, 0); WebCore::KURL kurl(WebCore::KURL(), WTF::String::fromUTF8(url)); - WebCore::Image* icon = WebCore::iconDatabase().iconForPageURL(kurl.string(), WebCore::IntSize(16, 16)); + WebCore::Image* icon = WebCore::iconDatabase().synchronousIconForPageURL(kurl.string(), WebCore::IntSize(16, 16)); cairo_surface_t* surface; if (!icon) { @@ -300,7 +306,7 @@ void ewk_settings_proxy_uri_set(const char* proxy) * * @return current proxy URI or @c 0 if it's not set */ -const char* ewk_settings_proxy_uri_get() +const char* ewk_settings_proxy_uri_get(void) { #if USE(SOUP) SoupURI* uri; @@ -315,7 +321,7 @@ const char* ewk_settings_proxy_uri_get() WTF::String proxy = soup_uri_to_string(uri, EINA_FALSE); return eina_stringshare_add(proxy.utf8().data()); #elif USE(CURL) - EINA_SAFETY_ON_TRUE_RETURN_VAL(1, NULL); + EINA_SAFETY_ON_TRUE_RETURN_VAL(1, 0); #endif } @@ -326,10 +332,53 @@ const char* ewk_settings_proxy_uri_get() * * @return a pointer to an eina_stringshare containing the user agent string */ -const char* ewk_settings_default_user_agent_get() +const char* ewk_settings_default_user_agent_get(void) { WTF::String ua_version = makeString(String::number(WEBKIT_USER_AGENT_MAJOR_VERSION), '.', String::number(WEBKIT_USER_AGENT_MINOR_VERSION), '+'); WTF::String static_ua = makeString("Mozilla/5.0 (", _ewk_settings_webkit_platform_get(), "; ", _ewk_settings_webkit_os_version_get(), ") AppleWebKit/", ua_version) + makeString(" (KHTML, like Gecko) Version/5.0 Safari/", ua_version); return eina_stringshare_add(static_ua.utf8().data()); } + +/** + * Sets cache directory. + * + * @param path where to store cache, must be write-able. + * + * @return @c EINA_TRUE on success, @c EINA_FALSE if path is NULL or offline + * web application is not supported. + */ +Eina_Bool ewk_settings_cache_directory_path_set(const char *path) +{ +#if ENABLE(OFFLINE_WEB_APPLICATIONS) + if (!path) + return EINA_FALSE; + + WebCore::cacheStorage().setCacheDirectory(WTF::String::fromUTF8(path)); + if (!_ewk_cache_directory_path) + _ewk_cache_directory_path = eina_stringshare_add(path); + else + eina_stringshare_replace(&_ewk_cache_directory_path, path); + return EINA_TRUE; +#else + EINA_SAFETY_ON_TRUE_RETURN_VAL(1, EINA_FALSE); +#endif +} + +/** + * Return cache directory path. + * + * This is guaranteed to be eina_stringshare, so whenever possible + * save yourself some cpu cycles and use eina_stringshare_ref() + * instead of eina_stringshare_add() or strdup(). + * + * @return cache directory path. + */ +const char *ewk_settings_cache_directory_path_get() +{ +#if ENABLE(OFFLINE_WEB_APPLICATIONS) + return _ewk_cache_directory_path; +#else + EINA_SAFETY_ON_TRUE_RETURN_VAL(1, 0); +#endif +} diff --git a/Source/WebKit/efl/ewk/ewk_settings.h b/Source/WebKit/efl/ewk/ewk_settings.h index 0a495da..3e5ca47 100644 --- a/Source/WebKit/efl/ewk/ewk_settings.h +++ b/Source/WebKit/efl/ewk/ewk_settings.h @@ -37,9 +37,9 @@ extern "C" { * @brief General purpose settings, not tied to any view object. */ -EAPI uint64_t ewk_settings_web_database_default_quota_get(); +EAPI uint64_t ewk_settings_web_database_default_quota_get(void); EAPI void ewk_settings_web_database_path_set(const char *path); -EAPI const char *ewk_settings_web_database_path_get(); +EAPI const char *ewk_settings_web_database_path_get(void); EAPI Eina_Bool ewk_settings_icon_database_path_set(const char *path); EAPI const char *ewk_settings_icon_database_path_get(void); @@ -48,8 +48,11 @@ EAPI Eina_Bool ewk_settings_icon_database_clear(void); EAPI cairo_surface_t *ewk_settings_icon_database_icon_surface_get(const char *url); EAPI Evas_Object *ewk_settings_icon_database_icon_object_add(const char *url, Evas *canvas); -EAPI void ewk_settings_proxy_uri_set(const char* proxy); -EAPI const char* ewk_settings_proxy_uri_get(); +EAPI Eina_Bool ewk_settings_cache_directory_path_set(const char *path); +EAPI const char *ewk_settings_cache_directory_path_get(void); + +EAPI void ewk_settings_proxy_uri_set(const char* proxy); +EAPI const char* ewk_settings_proxy_uri_get(void); #ifdef __cplusplus } diff --git a/Source/WebKit/efl/ewk/ewk_view.cpp b/Source/WebKit/efl/ewk/ewk_view.cpp index ab0629a..8a3b04d 100644 --- a/Source/WebKit/efl/ewk/ewk_view.cpp +++ b/Source/WebKit/efl/ewk/ewk_view.cpp @@ -43,7 +43,6 @@ #include "PlatformMouseEvent.h" #include "PopupMenuClient.h" #include "ProgressTracker.h" -#include "appcache/ApplicationCacheStorage.h" #include "ewk_private.h" #include <Ecore.h> @@ -95,13 +94,13 @@ struct _Ewk_View_Private_Data { unsigned int imh; /**< input method hints */ struct { Eina_Bool view_cleared:1; + Eina_Bool need_touch_events:1; } flags; struct { const char* user_agent; const char* user_stylesheet; const char* encoding_default; const char* encoding_custom; - const char* cache_directory; const char* theme; const char* local_storage_database_path; int font_minimum_size; @@ -584,9 +583,6 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* sd) (priv->page_settings->defaultTextEncodingName().utf8().data()); priv->settings.encoding_custom = 0; - priv->settings.cache_directory = eina_stringshare_add - (WebCore::cacheStorage().cacheDirectory().utf8().data()); - s = priv->page_settings->localStorageDatabasePath(); priv->settings.local_storage_database_path = eina_stringshare_add(s.string().utf8().data()); @@ -672,7 +668,6 @@ static void _ewk_view_priv_del(Ewk_View_Private_Data* priv) eina_stringshare_del(priv->settings.user_stylesheet); eina_stringshare_del(priv->settings.encoding_default); eina_stringshare_del(priv->settings.encoding_custom); - eina_stringshare_del(priv->settings.cache_directory); eina_stringshare_del(priv->settings.font_standard); eina_stringshare_del(priv->settings.font_cursive); eina_stringshare_del(priv->settings.font_monospace); @@ -2723,22 +2718,6 @@ Eina_Bool ewk_view_setting_encoding_detector_get(Evas_Object* o) return priv->settings.encoding_detector; } -const char* ewk_view_setting_cache_directory_get(const Evas_Object* o) -{ - EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0); - EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0); - return priv->settings.cache_directory; -} - -Eina_Bool ewk_view_setting_cache_directory_set(Evas_Object* o, const char* path) -{ - EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE); - EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); - if (eina_stringshare_replace(&priv->settings.cache_directory, path)) - WebCore::cacheStorage().setCacheDirectory(String::fromUTF8(path)); - return EINA_TRUE; -} - int ewk_view_setting_font_minimum_size_get(const Evas_Object* o) { EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0); @@ -4305,7 +4284,7 @@ void ewk_view_viewport_attributes_get(Evas_Object *o, float* w, float* h, float* if (device_pixel_ratio) *device_pixel_ratio = attributes.devicePixelRatio; if (user_scalable) - *user_scalable = attributes.userScalable; + *user_scalable = static_cast<bool>(attributes.userScalable); } /** @@ -4508,7 +4487,7 @@ WebCore::FloatRect ewk_view_page_rect_get(Evas_Object *o) * * @return device's dpi value. */ -int ewk_view_dpi_get() +int ewk_view_dpi_get(void) { #ifdef HAVE_ECORE_X return ecore_x_dpi_get(); @@ -4516,3 +4495,20 @@ int ewk_view_dpi_get() return 160; #endif } + +#if ENABLE(TOUCH_EVENTS) +void ewk_view_need_touch_events_set(Evas_Object* o, bool needed) +{ + EWK_VIEW_SD_GET(o, sd); + EWK_VIEW_PRIV_GET(sd, priv); + + priv->flags.need_touch_events = needed; +} + +Eina_Bool ewk_view_need_touch_events_get(Evas_Object* o) +{ + EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); + return priv->flags.need_touch_events; +} +#endif diff --git a/Source/WebKit/efl/ewk/ewk_view.h b/Source/WebKit/efl/ewk/ewk_view.h index e487f5e..84beecd 100644 --- a/Source/WebKit/efl/ewk/ewk_view.h +++ b/Source/WebKit/efl/ewk/ewk_view.h @@ -450,8 +450,6 @@ EAPI const char *ewk_view_setting_encoding_custom_get(const Evas_Object *o); EAPI Eina_Bool ewk_view_setting_encoding_custom_set(Evas_Object *o, const char *encoding); EAPI const char *ewk_view_setting_encoding_default_get(const Evas_Object *o); EAPI Eina_Bool ewk_view_setting_encoding_default_set(Evas_Object *o, const char *encoding); -EAPI const char *ewk_view_setting_cache_directory_get(const Evas_Object *o); -EAPI Eina_Bool ewk_view_setting_cache_directory_set(Evas_Object *o, const char *path); EAPI int ewk_view_setting_font_minimum_size_get(const Evas_Object *o); EAPI Eina_Bool ewk_view_setting_font_minimum_size_set(Evas_Object *o, int size); diff --git a/Source/WebKit/efl/ewk/ewk_window_features.cpp b/Source/WebKit/efl/ewk/ewk_window_features.cpp index 3855e89..4a311dc 100644 --- a/Source/WebKit/efl/ewk/ewk_window_features.cpp +++ b/Source/WebKit/efl/ewk/ewk_window_features.cpp @@ -26,17 +26,21 @@ #include <Eina.h> +/** + * \struct _Ewk_Window_Features + * @brief Contains the window features data. + */ struct _Ewk_Window_Features { unsigned int __ref; WebCore::WindowFeatures* core; }; /** - * Decrease the ref count of an Ewk_Window_Features, possibly freeing it. + * Decreases the referece count of an Ewk_Window_Features, possibly freeing it. * - * When its ref count reaches 0, @param window_features is freed. + * When the reference count of the object reaches 0, the one is freed. * - * @param window_features The window's features. + * @param window_features the object to decrease reference count */ EAPI void ewk_window_features_unref(Ewk_Window_Features* window_features) { @@ -52,9 +56,9 @@ EAPI void ewk_window_features_unref(Ewk_Window_Features* window_features) } /** - * Increase the ref count of an Ewk_Window_Features + * Increases the reference count of an Ewk_Window_Features. * - * @param window_features The window's features. + * @param window_features the object to increase reference count */ EAPI void ewk_window_features_ref(Ewk_Window_Features* window_features) { @@ -63,15 +67,20 @@ EAPI void ewk_window_features_ref(Ewk_Window_Features* window_features) } /** - * Get boolean properties + * Gets boolean properties of an Ewk_Window_Features. + * + * Properties are returned in the respective pointers. Passing @c 0 to any of + * these pointers will make that property to not be returned. * - * @param window_features A window_features. - * @param toolbar_visible pointer to store if toolbar is visible. - * @param statusbar_visible pointer to store if statusbar is visible. - * @param scrollbars_visible pointer to store if scrollbars is visible. - * @param menubar_visible pointer to store if menubar is visible. - * @param locationbar_visible pointer to store if locationbar is visible. - * @param fullscreen pointer to store if fullscreen is enabled. + * @param window_features the object to get boolean properties + * @param toolbar_visible the pointer to store if toolbar is visible + * @param statusbar_visible the pointer to store if statusbar is visible + * @param scrollbars_visible the pointer to store if scrollbars is visible + * @param menubar_visible the pointer to store if menubar is visible + * @param locationbar_visible the pointer to store if locationbar is visible + * @param fullscreen the pointer to store if fullscreen is enabled + * + * @see ewk_window_features_int_property_get */ EAPI void ewk_window_features_bool_property_get(Ewk_Window_Features* window_features, Eina_Bool* toolbar_visible, Eina_Bool* statusbar_visible, Eina_Bool* scrollbars_visible, Eina_Bool* menubar_visible, Eina_Bool* locationbar_visible, Eina_Bool* fullscreen) { @@ -98,18 +107,21 @@ EAPI void ewk_window_features_bool_property_get(Ewk_Window_Features* window_feat } /** - * Get int properties + * Gets int properties of an Ewk_Window_Features. + * + * Properties are returned in the respective pointers. Passing @c 0 to any of + * these pointers will make that property to not be returned. + * + * Make sure to check if the value returned is less than 0 before using it, since in + * that case it means that property was not set in winwdow_features object. * - * Properties are returned in the respective pointers. Passing NULL to any of - * these pointers will make that property to not be returned. Make sure to check - * if the value returned is less than 0 before using it, since in that case it - * means that property was not set in @param winwdow_features. + * @param window_features the window's features + * @param x the pointer to store x position + * @param y the pointer to store y position + * @param w the pointer to store width + * @param h the pointer to store height * - * @param window_features A window_features. - * @param x pointer to store x position or -1 if it's not set in window_features. - * @param y pointer to store y position or-1 if it's not set in window_features. - * @param w pointer to store width or-1 if it's not set in window_features. - * @param h pointer to store height or-1 if it's not set in window_features. + * @see ewk_window_features_bool_property_get */ EAPI void ewk_window_features_int_property_get(Ewk_Window_Features* window_features, int* x, int* y, int* w, int* h) { @@ -133,13 +145,12 @@ EAPI void ewk_window_features_int_property_get(Ewk_Window_Features* window_featu /** * @internal - * Create a new Ewk_Window_Features from a WebCore::WindowFeatures if @param - * core is not NULL or a new one with default features. * - * A new WebCore::WindowFeatures is allocated copying @param core features and - * it is embedded inside an Ewk_Window_Features whose ref count is initialized. + * Creates a new Ewk_Window_Features object. * - * @returns a new allocated Ewk_Window_Features + * @param core if not @c 0 a new WebCore::WindowFeatures is allocated copying core features and + * it is embedded inside the Ewk_Window_Features whose ref count is initialized, if core is @c 0 a new one is created with the default features. + * @returns a new allocated the Ewk_Window_Features object */ Ewk_Window_Features* ewk_window_features_new_from_core(const WebCore::WindowFeatures* core) { diff --git a/Source/WebKit/efl/ewk/ewk_window_features.h b/Source/WebKit/efl/ewk/ewk_window_features.h index b579dc4..0501881 100644 --- a/Source/WebKit/efl/ewk/ewk_window_features.h +++ b/Source/WebKit/efl/ewk/ewk_window_features.h @@ -18,6 +18,11 @@ Boston, MA 02110-1301, USA. */ +/** + * @file ewk_window_features.h + * @brief Access to the features of window. + */ + #ifndef ewk_window_features_h #define ewk_window_features_h @@ -29,6 +34,7 @@ extern "C" { #endif +/** Creates a type name for _Ewk_Window_Features. */ typedef struct _Ewk_Window_Features Ewk_Window_Features; EAPI void ewk_window_features_unref(Ewk_Window_Features* window_features); |