Changeset 97329 in webkit
- Timestamp:
- Oct 12, 2011 6:23:06 PM (13 years ago)
- Location:
- trunk/Source/WebKit/efl
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/efl/ChangeLog
r97080 r97329 1 2011-10-12 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 3 [EFL] Change efl style parameter variables with WebKit coding Style 4 https://bugs.webkit.org/show_bug.cgi?id=69073 5 6 Reviewed by Antonio Gomes. 7 8 This is a third step in order to be more compliant with WebKit coding style. 9 We have used one-letter| two-letter parameter according to efl style. However, it's more difficult 10 for other reviewers to review EFL patches. So, this patch changes efl style parameters 11 with meaningful one. 12 13 Majors changes are listed below, 14 15 - Use ewkFrame instead of o parameter in ewk_frame.cpp. 16 - Use ewkView instead of o parameter in ewk_view.cpp. 17 - Use menu and item instead of o parameter in ewk_contextmenu.cpp. 18 - Use ewkTile instead of o parameter in ewk_tile_xxx.cpp. 19 - Use tile parameter name instead of t parameter in ewk_tile_xxx.cpp. 20 - Use smartData instead of sd parameter for Ewk_XXXX_Smart_Data struct. 21 - Use width, height instead of w, h parameter. 22 - Use xxxEvent instead of ev parameter for event. (e.g. downEvent, upEvent, wheelEvent) 23 - Use scrollX, scrollY, scrollWidth, scrollHeight, centerX, centerY, deltaX, deltaY instead of sx, xy, sw, 24 sh, cx, cy, dx, dy. 25 - Use tileUnusedCache instead of tuc parameter in tiled backing store. 26 - Use red, green, blue and alpha instead of r,g,b,a. 27 - Remove "_" from parameter variable. 28 - Run demarchi's coding style script for ewk_tile_xxx.cpp files. 29 - Remove *void* parameter in ewk_tile_xxx.cpp's internal functions. 30 31 * ewk/ewk_auth_soup.cpp: 32 * ewk/ewk_contextmenu.cpp: 33 * ewk/ewk_cookies.cpp: 34 * ewk/ewk_frame.cpp: 35 * ewk/ewk_history.cpp: 36 * ewk/ewk_js.cpp: 37 * ewk/ewk_protocol_handler_soup.cpp: 38 * ewk/ewk_settings.cpp: 39 * ewk/ewk_tiled_backing_store.cpp: 40 * ewk/ewk_tiled_backing_store.h: 41 * ewk/ewk_tiled_matrix.cpp: 42 * ewk/ewk_tiled_matrix.h: 43 * ewk/ewk_tiled_model.cpp: 44 * ewk/ewk_tiled_model.h: 45 * ewk/ewk_view.cpp: 46 * ewk/ewk_view_single.cpp: 47 * ewk/ewk_view_tiled.cpp: 48 * ewk/ewk_window_features.cpp: 49 1 50 2011-10-10 Raphael Kubo da Costa <kubo@profusion.mobi> 2 51 … … 2058 2107 * ewk/ewk_view.cpp: 2059 2108 (ewk_view_run_open_panel): 2060 * ewk/ewk_view.h 2109 * ewk/ewk_view.h: 2061 2110 2062 2111 2011-06-27 Gyuyoung Kim <gyuyoung.kim@samsung.com> -
trunk/Source/WebKit/efl/ewk/ewk_auth_soup.cpp
r96382 r97329 64 64 } 65 65 66 static void ewk_auth_soup_dialog_session_feature_init(SoupSessionFeatureInterface* feature _interface, gpointer interface_data)66 static void ewk_auth_soup_dialog_session_feature_init(SoupSessionFeatureInterface* featureInterface, gpointer interfaceData) 67 67 { 68 feature _interface->attach = attach;69 feature _interface->detach = detach;68 featureInterface->attach = attach; 69 featureInterface->detach = detach; 70 70 } 71 71 -
trunk/Source/WebKit/efl/ewk/ewk_contextmenu.cpp
r96382 r97329 93 93 } 94 94 95 const Eina_List* ewk_context_menu_item_list_get(const Ewk_Context_Menu* o)96 { 97 EINA_SAFETY_ON_NULL_RETURN_VAL( o, 0);98 99 return o->items;95 const Eina_List* ewk_context_menu_item_list_get(const Ewk_Context_Menu* menu) 96 { 97 EINA_SAFETY_ON_NULL_RETURN_VAL(menu, 0); 98 99 return menu->items; 100 100 } 101 101 … … 143 143 } 144 144 145 Ewk_Context_Menu_Item_Type ewk_context_menu_item_type_get(const Ewk_Context_Menu_Item* o)146 { 147 EINA_SAFETY_ON_NULL_RETURN_VAL( o, EWK_ACTION_TYPE);148 return o->type;149 } 150 151 Eina_Bool ewk_context_menu_item_type_set(Ewk_Context_Menu_Item* o, Ewk_Context_Menu_Item_Type type)152 { 153 EINA_SAFETY_ON_NULL_RETURN_VAL( o, EINA_FALSE);154 o->type = type;155 return EINA_TRUE; 156 } 157 158 Ewk_Context_Menu_Action ewk_context_menu_item_action_get(const Ewk_Context_Menu_Item* o)159 { 160 EINA_SAFETY_ON_NULL_RETURN_VAL( o, EWK_CONTEXT_MENU_ITEM_TAG_NO_ACTION);161 return o->action;162 } 163 164 Eina_Bool ewk_context_menu_item_action_set(Ewk_Context_Menu_Item* o, Ewk_Context_Menu_Action action)165 { 166 EINA_SAFETY_ON_NULL_RETURN_VAL( o, EINA_FALSE);167 o->action = action;168 return EINA_TRUE; 169 } 170 171 const char* ewk_context_menu_item_title_get(const Ewk_Context_Menu_Item* o)172 { 173 EINA_SAFETY_ON_NULL_RETURN_VAL( o, 0);174 return o->title;175 } 176 177 const char* ewk_context_menu_item_title_set(Ewk_Context_Menu_Item* o, const char* title)178 { 179 EINA_SAFETY_ON_NULL_RETURN_VAL( o, 0);180 eina_stringshare_replace(& o->title, title);181 return o->title;182 } 183 184 Eina_Bool ewk_context_menu_item_checked_get(const Ewk_Context_Menu_Item* o)185 { 186 EINA_SAFETY_ON_NULL_RETURN_VAL( o, EINA_FALSE);187 return o->checked;188 } 189 190 Eina_Bool ewk_context_menu_item_checked_set(Ewk_Context_Menu_Item* o, Eina_Bool checked)191 { 192 EINA_SAFETY_ON_NULL_RETURN_VAL( o, EINA_FALSE);193 o->checked = checked;194 return EINA_TRUE; 195 } 196 197 Eina_Bool ewk_context_menu_item_enabled_get(const Ewk_Context_Menu_Item* o)198 { 199 EINA_SAFETY_ON_NULL_RETURN_VAL( o, EINA_FALSE);200 return o->enabled;201 } 202 203 Eina_Bool ewk_context_menu_item_enabled_set(Ewk_Context_Menu_Item* o, Eina_Bool enabled)204 { 205 EINA_SAFETY_ON_NULL_RETURN_VAL( o, EINA_FALSE);206 o->enabled = enabled;145 Ewk_Context_Menu_Item_Type ewk_context_menu_item_type_get(const Ewk_Context_Menu_Item* item) 146 { 147 EINA_SAFETY_ON_NULL_RETURN_VAL(item, EWK_ACTION_TYPE); 148 return item->type; 149 } 150 151 Eina_Bool ewk_context_menu_item_type_set(Ewk_Context_Menu_Item* item, Ewk_Context_Menu_Item_Type type) 152 { 153 EINA_SAFETY_ON_NULL_RETURN_VAL(item, EINA_FALSE); 154 item->type = type; 155 return EINA_TRUE; 156 } 157 158 Ewk_Context_Menu_Action ewk_context_menu_item_action_get(const Ewk_Context_Menu_Item* item) 159 { 160 EINA_SAFETY_ON_NULL_RETURN_VAL(item, EWK_CONTEXT_MENU_ITEM_TAG_NO_ACTION); 161 return item->action; 162 } 163 164 Eina_Bool ewk_context_menu_item_action_set(Ewk_Context_Menu_Item* item, Ewk_Context_Menu_Action action) 165 { 166 EINA_SAFETY_ON_NULL_RETURN_VAL(item, EINA_FALSE); 167 item->action = action; 168 return EINA_TRUE; 169 } 170 171 const char* ewk_context_menu_item_title_get(const Ewk_Context_Menu_Item* item) 172 { 173 EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0); 174 return item->title; 175 } 176 177 const char* ewk_context_menu_item_title_set(Ewk_Context_Menu_Item* item, const char* title) 178 { 179 EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0); 180 eina_stringshare_replace(&item->title, title); 181 return item->title; 182 } 183 184 Eina_Bool ewk_context_menu_item_checked_get(const Ewk_Context_Menu_Item* item) 185 { 186 EINA_SAFETY_ON_NULL_RETURN_VAL(item, EINA_FALSE); 187 return item->checked; 188 } 189 190 Eina_Bool ewk_context_menu_item_checked_set(Ewk_Context_Menu_Item* item, Eina_Bool checked) 191 { 192 EINA_SAFETY_ON_NULL_RETURN_VAL(item, EINA_FALSE); 193 item->checked = checked; 194 return EINA_TRUE; 195 } 196 197 Eina_Bool ewk_context_menu_item_enabled_get(const Ewk_Context_Menu_Item* item) 198 { 199 EINA_SAFETY_ON_NULL_RETURN_VAL(item, EINA_FALSE); 200 return item->enabled; 201 } 202 203 Eina_Bool ewk_context_menu_item_enabled_set(Ewk_Context_Menu_Item* item, Eina_Bool enabled) 204 { 205 EINA_SAFETY_ON_NULL_RETURN_VAL(item, EINA_FALSE); 206 item->enabled = enabled; 207 207 return EINA_TRUE; 208 208 } … … 257 257 * @see ewk_context_menu_destroy 258 258 */ 259 Eina_Bool ewk_context_menu_free(Ewk_Context_Menu* o)260 { 261 EINA_SAFETY_ON_NULL_RETURN_VAL( o, EINA_FALSE);262 evas_object_smart_callback_call( o->view, "contextmenu,free", o);263 ewk_context_menu_unref( o);259 Eina_Bool ewk_context_menu_free(Ewk_Context_Menu* menu) 260 { 261 EINA_SAFETY_ON_NULL_RETURN_VAL(menu, EINA_FALSE); 262 evas_object_smart_callback_call(menu->view, "contextmenu,free", menu); 263 ewk_context_menu_unref(menu); 264 264 return EINA_TRUE; 265 265 } … … 276 276 * @see ewk_context_menu_item_new 277 277 */ 278 void ewk_context_menu_item_append(Ewk_Context_Menu* o, WebCore::ContextMenuItem& core)278 void ewk_context_menu_item_append(Ewk_Context_Menu* menu, WebCore::ContextMenuItem& core) 279 279 { 280 280 Ewk_Context_Menu_Item_Type type = static_cast<Ewk_Context_Menu_Item_Type>(core.type()); … … 286 286 EINA_SAFETY_ON_NULL_RETURN(menu_item); 287 287 288 o->items = eina_list_append(o->items, menu_item);289 evas_object_smart_callback_call( o->view, "contextmenu,item,appended", o);288 menu->items = eina_list_append(menu->items, menu_item); 289 evas_object_smart_callback_call(menu->view, "contextmenu,item,appended", menu); 290 290 } 291 291 … … 302 302 * @see ewk_context_menu_item_list_get 303 303 */ 304 Ewk_Context_Menu* ewk_context_menu_custom_get(const Ewk_Context_Menu* o)305 { 306 EINA_SAFETY_ON_NULL_RETURN_VAL( o, 0);307 308 evas_object_smart_callback_call( o->view, "contextmenu,customize", o->items);309 return o;304 Ewk_Context_Menu* ewk_context_menu_custom_get(const Ewk_Context_Menu* menu) 305 { 306 EINA_SAFETY_ON_NULL_RETURN_VAL(menu, 0); 307 308 evas_object_smart_callback_call(menu->view, "contextmenu,customize", menu->items); 309 return menu; 310 310 } 311 311 … … 317 317 * @param o the context menu object 318 318 */ 319 void ewk_context_menu_show(const Ewk_Context_Menu* o)320 { 321 EINA_SAFETY_ON_NULL_RETURN( o);322 323 evas_object_smart_callback_call( o->view, "contextmenu,show", o);319 void ewk_context_menu_show(const Ewk_Context_Menu* menu) 320 { 321 EINA_SAFETY_ON_NULL_RETURN(menu); 322 323 evas_object_smart_callback_call(menu->view, "contextmenu,show", menu); 324 324 } 325 325 -
trunk/Source/WebKit/efl/ewk/ewk_cookies.cpp
r95901 r97329 143 143 } 144 144 145 void ewk_cookies_policy_set(Ewk_Cookie_Policy p)145 void ewk_cookies_policy_set(Ewk_Cookie_Policy cookiePolicy) 146 146 { 147 147 #if USE(SOUP) … … 150 150 151 151 policy = SOUP_COOKIE_JAR_ACCEPT_ALWAYS; 152 switch ( p) {152 switch (cookiePolicy) { 153 153 case EWK_COOKIE_JAR_ACCEPT_NEVER: 154 154 policy = SOUP_COOKIE_JAR_ACCEPT_NEVER; -
trunk/Source/WebKit/efl/ewk/ewk_frame.cpp
r97080 r97329 83 83 84 84 #ifndef EWK_TYPE_CHECK 85 #define EWK_FRAME_TYPE_CHECK( o, ...) do { } while (0)85 #define EWK_FRAME_TYPE_CHECK(ewkFrame, ...) do { } while (0) 86 86 #else 87 #define EWK_FRAME_TYPE_CHECK( o, ...) \87 #define EWK_FRAME_TYPE_CHECK(ewkFrame, ...) \ 88 88 do { \ 89 const char* _tmp_otype = evas_object_type_get( o); \89 const char* _tmp_otype = evas_object_type_get(ewkFrame); \ 90 90 if (EINA_UNLIKELY(_tmp_otype != EWK_FRAME_TYPE_STR)) { \ 91 91 EINA_LOG_CRIT \ 92 ("%p (%s) is not of an ewk_frame!", o, \92 ("%p (%s) is not of an ewk_frame!", ewkFrame, \ 93 93 _tmp_otype ? _tmp_otype : "(null)"); \ 94 94 return __VA_ARGS__; \ … … 97 97 #endif 98 98 99 #define EWK_FRAME_SD_GET( o, ptr) \100 Ewk_Frame_Smart_Data* ptr = static_cast<Ewk_Frame_Smart_Data*>(evas_object_smart_data_get( o))101 102 #define EWK_FRAME_SD_GET_OR_RETURN( o, ptr, ...) \103 EWK_FRAME_TYPE_CHECK( o, __VA_ARGS__); \104 EWK_FRAME_SD_GET( o, ptr); \99 #define EWK_FRAME_SD_GET(ewkFrame, ptr) \ 100 Ewk_Frame_Smart_Data* ptr = static_cast<Ewk_Frame_Smart_Data*>(evas_object_smart_data_get(ewkFrame)) 101 102 #define EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, ptr, ...) \ 103 EWK_FRAME_TYPE_CHECK(ewkFrame, __VA_ARGS__); \ 104 EWK_FRAME_SD_GET(ewkFrame, ptr); \ 105 105 if (!ptr) { \ 106 106 CRITICAL("no smart data for object %p (%s)", \ 107 o, evas_object_type_get(o)); \107 ewkFrame, evas_object_type_get(ewkFrame)); \ 108 108 return __VA_ARGS__; \ 109 109 } … … 112 112 113 113 #ifdef EWK_FRAME_DEBUG 114 static inline void _ewk_frame_debug(Evas_Object* o)114 static inline void _ewk_frame_debug(Evas_Object* ewkFrame) 115 115 { 116 116 Evas_Object* clip, * parent; … … 118 118 int r, g, b, a, cr, cg, cb, ca; 119 119 120 evas_object_color_get( o, &r, &g, &b, &a);121 evas_object_geometry_get( o, &x, &y, &w, &h);122 123 clip = evas_object_clip_get( o);120 evas_object_color_get(ewkFrame, &r, &g, &b, &a); 121 evas_object_geometry_get(ewkFrame, &x, &y, &w, &h); 122 123 clip = evas_object_clip_get(ewkFrame); 124 124 evas_object_color_get(clip, &cr, &cg, &cb, &ca); 125 125 evas_object_geometry_get(clip, &cx, &cy, &cw, &ch); 126 126 127 127 fprintf(stderr, "%p: type=%s name=%s, visible=%d, color=%02x%02x%02x%02x, %d,%d+%dx%d, clipper=%p (%d, %02x%02x%02x%02x, %d,%d+%dx%d)\n", 128 o, evas_object_type_get(o), evas_object_name_get(o), evas_object_visible_get(o),128 ewkFrame, evas_object_type_get(ewkFrame), evas_object_name_get(ewkFrame), evas_object_visible_get(ewkFrame), 129 129 r, g, b, a, x, y, w, h, 130 130 clip, evas_object_visible_get(clip), cr, cg, cb, ca, cx, cy, cw, ch); 131 parent = evas_object_smart_parent_get( o);131 parent = evas_object_smart_parent_get(ewkFrame); 132 132 if (!parent) 133 133 fprintf(stderr, "\n"); … … 168 168 } 169 169 170 static Evas_Object* _ewk_frame_children_iterator_get_container(Eina_Iterator_Ewk_Frame* it )171 { 172 return it ->obj;173 } 174 175 static void _ewk_frame_smart_add(Evas_Object* o)176 { 177 EWK_FRAME_SD_GET( o, sd);170 static Evas_Object* _ewk_frame_children_iterator_get_container(Eina_Iterator_Ewk_Frame* iterator) 171 { 172 return iterator->obj; 173 } 174 175 static void _ewk_frame_smart_add(Evas_Object* ewkFrame) 176 { 177 EWK_FRAME_SD_GET(ewkFrame, sd); 178 178 179 179 if (!sd) { … … 183 183 return; 184 184 } 185 evas_object_smart_data_set( o, sd);186 } 187 188 sd->self = o;189 190 _parent_sc.add( o);185 evas_object_smart_data_set(ewkFrame, sd); 186 } 187 188 sd->self = ewkFrame; 189 190 _parent_sc.add(ewkFrame); 191 191 evas_object_static_clip_set(sd->base.clipper, EINA_FALSE); 192 192 evas_object_move(sd->base.clipper, 0, 0); … … 225 225 i = 0; 226 226 227 evas_object_smart_member_add(sd->region, o);227 evas_object_smart_member_add(sd->region, ewkFrame); 228 228 evas_object_hide(sd->region); 229 229 #endif 230 230 } 231 231 232 static void _ewk_frame_smart_del(Evas_Object* o)233 { 234 WRN(" o=%p", o); // XXX REMOVE ME LATER235 EWK_FRAME_SD_GET( o, sd);232 static void _ewk_frame_smart_del(Evas_Object* ewkFrame) 233 { 234 WRN("ewkFrame=%p", ewkFrame); // XXX REMOVE ME LATER 235 EWK_FRAME_SD_GET(ewkFrame, sd); 236 236 237 237 if (sd) { … … 249 249 } 250 250 251 _parent_sc.del( o);252 } 253 254 static void _ewk_frame_smart_resize(Evas_Object* o, Evas_Coord w, Evas_Coord h)255 { 256 EWK_FRAME_SD_GET( o, sd);257 evas_object_resize(sd->base.clipper, w , h);251 _parent_sc.del(ewkFrame); 252 } 253 254 static void _ewk_frame_smart_resize(Evas_Object* ewkFrame, Evas_Coord width, Evas_Coord height) 255 { 256 EWK_FRAME_SD_GET(ewkFrame, sd); 257 evas_object_resize(sd->base.clipper, width, height); 258 258 259 259 #ifdef EWK_FRAME_DEBUG 260 evas_object_resize(sd->region, w , h);260 evas_object_resize(sd->region, width, height); 261 261 Evas_Coord x, y; 262 evas_object_geometry_get(sd->region, &x, &y, &w , &h);262 evas_object_geometry_get(sd->region, &x, &y, &width, &height); 263 263 INF("region=%p, visible=%d, geo=%d,%d + %dx%d", 264 sd->region, evas_object_visible_get(sd->region), x, y, w , h);265 _ewk_frame_debug( o);264 sd->region, evas_object_visible_get(sd->region), x, y, width, height); 265 _ewk_frame_debug(ewkFrame); 266 266 #endif 267 267 } … … 289 289 } 290 290 291 Evas_Object* ewk_frame_view_get(const Evas_Object* o)292 { 293 EWK_FRAME_SD_GET_OR_RETURN( o, sd, 0);291 Evas_Object* ewk_frame_view_get(const Evas_Object* ewkFrame) 292 { 293 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, 0); 294 294 return sd->view; 295 295 } 296 296 297 Eina_Iterator* ewk_frame_children_iterator_new(Evas_Object* o)298 { 299 EWK_FRAME_SD_GET_OR_RETURN( o, sd, 0);297 Eina_Iterator* ewk_frame_children_iterator_new(Evas_Object* ewkFrame) 298 { 299 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, 0); 300 300 Eina_Iterator_Ewk_Frame* it = static_cast<Eina_Iterator_Ewk_Frame*> 301 301 (calloc(1, sizeof(Eina_Iterator_Ewk_Frame))); … … 307 307 it->base.get_container = FUNC_ITERATOR_GET_CONTAINER(_ewk_frame_children_iterator_get_container); 308 308 it->base.free = FUNC_ITERATOR_FREE(free); 309 it->obj = o;309 it->obj = ewkFrame; 310 310 it->currentIndex = 0; 311 311 return &it->base; 312 312 } 313 313 314 Evas_Object* ewk_frame_child_find(Evas_Object* o, const char* name)315 { 316 EWK_FRAME_SD_GET_OR_RETURN( o, sd, 0);314 Evas_Object* ewk_frame_child_find(Evas_Object* ewkFrame, const char* name) 315 { 316 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, 0); 317 317 EINA_SAFETY_ON_NULL_RETURN_VAL(name, 0); 318 318 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, 0); … … 321 321 } 322 322 323 Eina_Bool ewk_frame_uri_set(Evas_Object* o, const char* uri)324 { 325 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);323 Eina_Bool ewk_frame_uri_set(Evas_Object* ewkFrame, const char* uri) 324 { 325 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 326 326 WebCore::KURL kurl(WebCore::KURL(), WTF::String::fromUTF8(uri)); 327 327 WebCore::ResourceRequest req(kurl); … … 331 331 } 332 332 333 const char* ewk_frame_uri_get(const Evas_Object* o)334 { 335 EWK_FRAME_SD_GET_OR_RETURN( o, sd, 0);333 const char* ewk_frame_uri_get(const Evas_Object* ewkFrame) 334 { 335 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, 0); 336 336 return sd->uri; 337 337 } 338 338 339 const char* ewk_frame_title_get(const Evas_Object* o)340 { 341 EWK_FRAME_SD_GET_OR_RETURN( o, sd, 0);339 const char* ewk_frame_title_get(const Evas_Object* ewkFrame) 340 { 341 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, 0); 342 342 return sd->title; 343 343 } 344 344 345 const char* ewk_frame_name_get(const Evas_Object* o)346 { 347 EWK_FRAME_SD_GET_OR_RETURN( o, sd, 0);345 const char* ewk_frame_name_get(const Evas_Object* ewkFrame) 346 { 347 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, 0); 348 348 349 349 if (!sd->frame) { … … 362 362 } 363 363 364 Eina_Bool ewk_frame_contents_size_get(const Evas_Object* o, Evas_Coord* w, Evas_Coord* h) 365 { 366 if (w) 367 *w = 0; 368 if (h) 369 *h = 0; 370 EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); 371 if (!sd->frame || !sd->frame->view()) 372 return EINA_FALSE; 373 if (w) 374 *w = sd->frame->view()->contentsWidth(); 375 if (h) 376 *h = sd->frame->view()->contentsHeight(); 377 return EINA_TRUE; 378 } 379 380 static Eina_Bool _ewk_frame_contents_set_internal(Ewk_Frame_Smart_Data* sd, const char* contents, size_t contents_size, const char* mime_type, const char* encoding, const char* base_uri, const char* unreachable_uri) 364 Eina_Bool ewk_frame_contents_size_get(const Evas_Object* ewkFrame, Evas_Coord* width, Evas_Coord* height) 365 { 366 if (width) 367 *width = 0; 368 if (height) 369 *height = 0; 370 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 371 if (width) 372 *width = sd->frame->view()->contentsWidth(); 373 if (height) 374 *height = sd->frame->view()->contentsHeight(); 375 return EINA_TRUE; 376 } 377 378 static Eina_Bool _ewk_frame_contents_set_internal(Ewk_Frame_Smart_Data* smartData, const char* contents, size_t contentsSize, const char* mimeType, const char* encoding, const char* baseUri, const char* unreachableUri) 381 379 { 382 380 size_t len = strlen(contents); 383 if (contents _size < 1 || contents_size > len)384 contents _size = len;385 if (!mime _type)386 mime _type = "text/html";381 if (contentsSize < 1 || contentsSize > len) 382 contentsSize = len; 383 if (!mimeType) 384 mimeType = "text/html"; 387 385 if (!encoding) 388 386 encoding = "UTF-8"; 389 if (!base _uri)390 base _uri = "about:blank";391 392 WebCore::KURL baseKURL(WebCore::KURL(), WTF::String::fromUTF8(base _uri));387 if (!baseUri) 388 baseUri = "about:blank"; 389 390 WebCore::KURL baseKURL(WebCore::KURL(), WTF::String::fromUTF8(baseUri)); 393 391 WebCore::KURL unreachableKURL; 394 if (unreachable _uri)395 unreachableKURL = WebCore::KURL(WebCore::KURL(), WTF::String::fromUTF8(unreachable _uri));392 if (unreachableUri) 393 unreachableKURL = WebCore::KURL(WebCore::KURL(), WTF::String::fromUTF8(unreachableUri)); 396 394 else 397 395 unreachableKURL = WebCore::KURL(); 398 396 399 WTF::RefPtr<WebCore::SharedBuffer> buffer = WebCore::SharedBuffer::create(contents, contents _size);397 WTF::RefPtr<WebCore::SharedBuffer> buffer = WebCore::SharedBuffer::create(contents, contentsSize); 400 398 WebCore::SubstituteData substituteData 401 399 (buffer.release(), 402 WTF::String::fromUTF8(mime _type),400 WTF::String::fromUTF8(mimeType), 403 401 WTF::String::fromUTF8(encoding), 404 402 baseKURL, unreachableKURL); 405 403 WebCore::ResourceRequest request(baseKURL); 406 404 407 s d->frame->loader()->load(request, substituteData, false);408 return EINA_TRUE; 409 } 410 411 Eina_Bool ewk_frame_contents_set(Evas_Object* o, const char* contents, size_t contents_size, const char* mime_type, const char* encoding, const char* base_uri)412 { 413 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);405 smartData->frame->loader()->load(request, substituteData, false); 406 return EINA_TRUE; 407 } 408 409 Eina_Bool ewk_frame_contents_set(Evas_Object* ewkFrame, const char* contents, size_t contentsSize, const char* mimeType, const char* encoding, const char* baseUri) 410 { 411 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 414 412 EINA_SAFETY_ON_FALSE_RETURN_VAL(sd->frame, EINA_FALSE); 415 413 EINA_SAFETY_ON_NULL_RETURN_VAL(contents, EINA_FALSE); 416 414 return _ewk_frame_contents_set_internal 417 (sd, contents, contents _size, mime_type, encoding, base_uri, 0);418 } 419 420 Eina_Bool ewk_frame_contents_alternate_set(Evas_Object* o, const char* contents, size_t contents_size, const char* mime_type, const char* encoding, const char* base_uri, const char* unreachable_uri)421 { 422 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);415 (sd, contents, contentsSize, mimeType, encoding, baseUri, 0); 416 } 417 418 Eina_Bool ewk_frame_contents_alternate_set(Evas_Object* ewkFrame, const char* contents, size_t contentsSize, const char* mimeType, const char* encoding, const char* baseUri, const char* unreachableUri) 419 { 420 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 423 421 EINA_SAFETY_ON_FALSE_RETURN_VAL(sd->frame, EINA_FALSE); 424 422 EINA_SAFETY_ON_NULL_RETURN_VAL(contents, EINA_FALSE); 425 EINA_SAFETY_ON_NULL_RETURN_VAL(unreachable _uri, EINA_FALSE);423 EINA_SAFETY_ON_NULL_RETURN_VAL(unreachableUri, EINA_FALSE); 426 424 return _ewk_frame_contents_set_internal 427 (sd, contents, contents _size, mime_type, encoding, base_uri,428 unreachable _uri);429 } 430 431 Eina_Bool ewk_frame_script_execute(Evas_Object* o, const char* script)432 { 433 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);425 (sd, contents, contentsSize, mimeType, encoding, baseUri, 426 unreachableUri); 427 } 428 429 Eina_Bool ewk_frame_script_execute(Evas_Object* ewkFrame, const char* script) 430 { 431 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 434 432 EINA_SAFETY_ON_FALSE_RETURN_VAL(sd->frame, EINA_FALSE); 435 433 EINA_SAFETY_ON_NULL_RETURN_VAL(script, EINA_FALSE); … … 438 436 } 439 437 440 Eina_Bool ewk_frame_editable_get(const Evas_Object* o)441 { 442 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);438 Eina_Bool ewk_frame_editable_get(const Evas_Object* ewkFrame) 439 { 440 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 443 441 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 444 442 return sd->editable; 445 443 } 446 444 447 Eina_Bool ewk_frame_editable_set(Evas_Object* o, Eina_Bool editable)448 { 449 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);445 Eina_Bool ewk_frame_editable_set(Evas_Object* ewkFrame, Eina_Bool editable) 446 { 447 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 450 448 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 451 449 editable = !!editable; … … 457 455 } 458 456 459 char* ewk_frame_selection_get(const Evas_Object* o)460 { 461 EWK_FRAME_SD_GET_OR_RETURN( o, sd, 0);457 char* ewk_frame_selection_get(const Evas_Object* ewkFrame) 458 { 459 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, 0); 462 460 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, 0); 463 461 WTF::CString s = sd->frame->editor()->selectedText().utf8(); … … 467 465 } 468 466 469 Eina_Bool ewk_frame_text_search(const Evas_Object* o, const char* string, Eina_Bool case_sensitive, Eina_Bool forward, Eina_Bool wrap)470 { 471 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);472 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 473 EINA_SAFETY_ON_NULL_RETURN_VAL( string, EINA_FALSE);474 475 return sd->frame->editor()->findString(WTF::String::fromUTF8( string), forward, case_sensitive, wrap, true);476 } 477 478 unsigned int ewk_frame_text_matches_mark(Evas_Object* o, const char* string, Eina_Bool case_sensitive, Eina_Bool highlight, unsigned int limit)479 { 480 EWK_FRAME_SD_GET_OR_RETURN( o, sd, 0);467 Eina_Bool ewk_frame_text_search(const Evas_Object* ewkFrame, const char* text, Eina_Bool caseSensitive, Eina_Bool forward, Eina_Bool wrap) 468 { 469 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 470 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 471 EINA_SAFETY_ON_NULL_RETURN_VAL(text, EINA_FALSE); 472 473 return sd->frame->editor()->findString(WTF::String::fromUTF8(text), forward, caseSensitive, wrap, true); 474 } 475 476 unsigned int ewk_frame_text_matches_mark(Evas_Object* ewkFrame, const char* string, Eina_Bool caseSensitive, Eina_Bool highlight, unsigned int limit) 477 { 478 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, 0); 481 479 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 482 480 EINA_SAFETY_ON_NULL_RETURN_VAL(string, 0); 483 481 484 482 sd->frame->editor()->setMarkedTextMatchesAreHighlighted(highlight); 485 return sd->frame->editor()->countMatchesForText(WTF::String::fromUTF8(string), case _sensitive, limit, true);486 } 487 488 Eina_Bool ewk_frame_text_matches_unmark_all(Evas_Object* o)489 { 490 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);483 return sd->frame->editor()->countMatchesForText(WTF::String::fromUTF8(string), caseSensitive, limit, true); 484 } 485 486 Eina_Bool ewk_frame_text_matches_unmark_all(Evas_Object* ewkFrame) 487 { 488 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 491 489 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 492 490 … … 495 493 } 496 494 497 Eina_Bool ewk_frame_text_matches_highlight_set(Evas_Object* o, Eina_Bool highlight)498 { 499 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);495 Eina_Bool ewk_frame_text_matches_highlight_set(Evas_Object* ewkFrame, Eina_Bool highlight) 496 { 497 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 500 498 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 501 499 sd->frame->editor()->setMarkedTextMatchesAreHighlighted(highlight); … … 503 501 } 504 502 505 Eina_Bool ewk_frame_text_matches_highlight_get(const Evas_Object* o)506 { 507 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);503 Eina_Bool ewk_frame_text_matches_highlight_get(const Evas_Object* ewkFrame) 504 { 505 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 508 506 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 509 507 return sd->frame->editor()->markedTextMatchesAreHighlighted(); … … 513 511 * Comparison function used by ewk_frame_text_matches_nth_pos_get 514 512 */ 515 static bool _ewk_frame_rect_cmp_less_than(const WebCore::IntRect& i, const WebCore::IntRect& j)516 { 517 return ( i.y() < j.y() || (i.y() == j.y() && i.x() < j.x()));513 static bool _ewk_frame_rect_cmp_less_than(const WebCore::IntRect& begin, const WebCore::IntRect& end) 514 { 515 return (begin.y() < end.y() || (begin.y() == end.y() && begin.x() < end.x())); 518 516 } 519 517 … … 521 519 * Predicate used by ewk_frame_text_matches_nth_pos_get 522 520 */ 523 static bool _ewk_frame_rect_is_negative_value(const WebCore::IntRect& i)524 { 525 return ( i.x() < 0 || i.y() < 0);526 } 527 528 Eina_Bool ewk_frame_text_matches_nth_pos_get(const Evas_Object* o, size_t n, int* x, int* y)529 { 530 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);521 static bool _ewk_frame_rect_is_negative_value(const WebCore::IntRect& rect) 522 { 523 return (rect.x() < 0 || rect.y() < 0); 524 } 525 526 Eina_Bool ewk_frame_text_matches_nth_pos_get(const Evas_Object* ewkFrame, size_t number, int* x, int* y) 527 { 528 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 531 529 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 532 530 … … 536 534 std::remove_if(intRects.begin(), intRects.end(), _ewk_frame_rect_is_negative_value); 537 535 538 if (intRects.isEmpty() || n > intRects.size())536 if (intRects.isEmpty() || number > intRects.size()) 539 537 return EINA_FALSE; 540 538 … … 542 540 543 541 if (x) 544 *x = intRects[n - 1].x();542 *x = intRects[number - 1].x(); 545 543 if (y) 546 *y = intRects[n - 1].y();547 return EINA_TRUE; 548 } 549 550 Eina_Bool ewk_frame_stop(Evas_Object* o)551 { 552 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);544 *y = intRects[number - 1].y(); 545 return EINA_TRUE; 546 } 547 548 Eina_Bool ewk_frame_stop(Evas_Object* ewkFrame) 549 { 550 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 553 551 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 554 552 sd->frame->loader()->stopAllLoaders(); … … 556 554 } 557 555 558 Eina_Bool ewk_frame_reload(Evas_Object* o)559 { 560 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);556 Eina_Bool ewk_frame_reload(Evas_Object* ewkFrame) 557 { 558 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 561 559 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 562 560 sd->frame->loader()->reload(); … … 564 562 } 565 563 566 Eina_Bool ewk_frame_reload_full(Evas_Object* o)567 { 568 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);564 Eina_Bool ewk_frame_reload_full(Evas_Object* ewkFrame) 565 { 566 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 569 567 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 570 568 sd->frame->loader()->reload(true); … … 572 570 } 573 571 574 Eina_Bool ewk_frame_back(Evas_Object* o)575 { 576 return ewk_frame_navigate( o, -1);577 } 578 579 Eina_Bool ewk_frame_forward(Evas_Object* o)580 { 581 return ewk_frame_navigate( o, 1);582 } 583 584 Eina_Bool ewk_frame_navigate(Evas_Object* o, int steps)585 { 586 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);572 Eina_Bool ewk_frame_back(Evas_Object* ewkFrame) 573 { 574 return ewk_frame_navigate(ewkFrame, -1); 575 } 576 577 Eina_Bool ewk_frame_forward(Evas_Object* ewkFrame) 578 { 579 return ewk_frame_navigate(ewkFrame, 1); 580 } 581 582 Eina_Bool ewk_frame_navigate(Evas_Object* ewkFrame, int steps) 583 { 584 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 587 585 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 588 586 WebCore::Page* page = sd->frame->page(); … … 593 591 } 594 592 595 Eina_Bool ewk_frame_back_possible(Evas_Object* o)596 { 597 return ewk_frame_navigate_possible( o, -1);598 } 599 600 Eina_Bool ewk_frame_forward_possible(Evas_Object* o)601 { 602 return ewk_frame_navigate_possible( o, 1);603 } 604 605 Eina_Bool ewk_frame_navigate_possible(Evas_Object* o, int steps)606 { 607 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);593 Eina_Bool ewk_frame_back_possible(Evas_Object* ewkFrame) 594 { 595 return ewk_frame_navigate_possible(ewkFrame, -1); 596 } 597 598 Eina_Bool ewk_frame_forward_possible(Evas_Object* ewkFrame) 599 { 600 return ewk_frame_navigate_possible(ewkFrame, 1); 601 } 602 603 Eina_Bool ewk_frame_navigate_possible(Evas_Object* ewkFrame, int steps) 604 { 605 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 608 606 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 609 607 WebCore::Page* page = sd->frame->page(); … … 641 639 } 642 640 643 void ewk_frame_hit_test_free(Ewk_Hit_Test* hit _test)644 { 645 EINA_SAFETY_ON_NULL_RETURN(hit _test);646 eina_stringshare_del(hit _test->title);647 eina_stringshare_del(hit _test->alternate_text);648 eina_stringshare_del(hit _test->link.text);649 eina_stringshare_del(hit _test->link.url);650 eina_stringshare_del(hit _test->link.title);651 eina_stringshare_del(hit _test->image_uri);652 eina_stringshare_del(hit _test->media_uri);653 free(hit _test);654 } 655 656 Ewk_Hit_Test* ewk_frame_hit_test_new(const Evas_Object* o, int x, int y)657 { 658 EWK_FRAME_SD_GET_OR_RETURN( o, sd, 0);641 void ewk_frame_hit_test_free(Ewk_Hit_Test* hitTest) 642 { 643 EINA_SAFETY_ON_NULL_RETURN(hitTest); 644 eina_stringshare_del(hitTest->title); 645 eina_stringshare_del(hitTest->alternate_text); 646 eina_stringshare_del(hitTest->link.text); 647 eina_stringshare_del(hitTest->link.url); 648 eina_stringshare_del(hitTest->link.title); 649 eina_stringshare_del(hitTest->image_uri); 650 eina_stringshare_del(hitTest->media_uri); 651 free(hitTest); 652 } 653 654 Ewk_Hit_Test* ewk_frame_hit_test_new(const Evas_Object* ewkFrame, int x, int y) 655 { 656 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, 0); 659 657 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, 0); 660 658 … … 727 725 728 726 Eina_Bool 729 ewk_frame_scroll_add(Evas_Object* o, int dx, int dy)730 { 731 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);727 ewk_frame_scroll_add(Evas_Object* ewkFrame, int deltaX, int deltaY) 728 { 729 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 732 730 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 733 731 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame->view(), EINA_FALSE); 734 sd->frame->view()->scrollBy(WebCore::IntSize(d x, dy));732 sd->frame->view()->scrollBy(WebCore::IntSize(deltaX, deltaY)); 735 733 return EINA_TRUE; 736 734 } 737 735 738 736 Eina_Bool 739 ewk_frame_scroll_set(Evas_Object* o, int x, int y)740 { 741 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);737 ewk_frame_scroll_set(Evas_Object* ewkFrame, int x, int y) 738 { 739 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 742 740 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 743 741 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame->view(), EINA_FALSE); … … 747 745 748 746 Eina_Bool 749 ewk_frame_scroll_size_get(const Evas_Object* o, int* w, int* h)750 { 751 if (w )752 *w = 0;753 if (h )754 *h = 0;755 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);747 ewk_frame_scroll_size_get(const Evas_Object* ewkFrame, int* width, int* height) 748 { 749 if (width) 750 *width = 0; 751 if (height) 752 *height = 0; 753 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 756 754 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 757 755 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame->view(), EINA_FALSE); 758 756 WebCore::IntPoint point = sd->frame->view()->maximumScrollPosition(); 759 if (w )760 *w = point.x();761 if (h )762 *h = point.y();757 if (width) 758 *width = point.x(); 759 if (height) 760 *height = point.y(); 763 761 return EINA_TRUE; 764 762 } 765 763 766 764 Eina_Bool 767 ewk_frame_scroll_pos_get(const Evas_Object* o, int* x, int* y)765 ewk_frame_scroll_pos_get(const Evas_Object* ewkFrame, int* x, int* y) 768 766 { 769 767 if (x) … … 771 769 if (y) 772 770 *y = 0; 773 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);771 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 774 772 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 775 773 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame->view(), EINA_FALSE); … … 782 780 } 783 781 784 Eina_Bool ewk_frame_visible_content_geometry_get(const Evas_Object* o, Eina_Bool include_scrollbars, int* x, int* y, int* w, int* h)782 Eina_Bool ewk_frame_visible_content_geometry_get(const Evas_Object* ewkFrame, Eina_Bool includeScrollbars, int* x, int* y, int* width, int* height) 785 783 { 786 784 if (x) … … 788 786 if (y) 789 787 *y = 0; 790 if (w )791 *w = 0;792 if (h )793 *h = 0;794 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);788 if (width) 789 *width = 0; 790 if (height) 791 *height = 0; 792 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 795 793 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 796 794 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame->view(), EINA_FALSE); 797 WebCore::IntRect rect = sd->frame->view()->visibleContentRect(include _scrollbars);795 WebCore::IntRect rect = sd->frame->view()->visibleContentRect(includeScrollbars); 798 796 if (x) 799 797 *x = rect.x(); 800 798 if (y) 801 799 *y = rect.y(); 802 if (w )803 *w = rect.width();804 if (h )805 *h = rect.height();806 return EINA_TRUE; 807 } 808 809 Eina_Bool ewk_frame_paint_full_get(const Evas_Object* o)810 { 811 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);800 if (width) 801 *width = rect.width(); 802 if (height) 803 *height = rect.height(); 804 return EINA_TRUE; 805 } 806 807 Eina_Bool ewk_frame_paint_full_get(const Evas_Object* ewkFrame) 808 { 809 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 812 810 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 813 811 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame->view(), EINA_FALSE); … … 815 813 } 816 814 817 void ewk_frame_paint_full_set(Evas_Object* o, Eina_Bool flag)818 { 819 EWK_FRAME_SD_GET_OR_RETURN( o, sd);815 void ewk_frame_paint_full_set(Evas_Object* ewkFrame, Eina_Bool flag) 816 { 817 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd); 820 818 EINA_SAFETY_ON_NULL_RETURN(sd->frame); 821 819 EINA_SAFETY_ON_NULL_RETURN(sd->frame->view()); … … 823 821 } 824 822 825 Eina_Bool ewk_frame_feed_focus_in(Evas_Object* o)826 { 827 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);823 Eina_Bool ewk_frame_feed_focus_in(Evas_Object* ewkFrame) 824 { 825 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 828 826 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 829 827 WebCore::FocusController* c = sd->frame->page()->focusController(); … … 832 830 } 833 831 834 Eina_Bool ewk_frame_feed_focus_out(Evas_Object* o)832 Eina_Bool ewk_frame_feed_focus_out(Evas_Object* ewkFrame) 835 833 { 836 834 // TODO: what to do on focus out? … … 839 837 } 840 838 841 Eina_Bool ewk_frame_feed_mouse_wheel(Evas_Object* o, const Evas_Event_Mouse_Wheel* ev)842 { 843 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);844 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 845 EINA_SAFETY_ON_NULL_RETURN_VAL( ev, EINA_FALSE);839 Eina_Bool ewk_frame_feed_mouse_wheel(Evas_Object* ewkFrame, const Evas_Event_Mouse_Wheel* wheelEvent) 840 { 841 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 842 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 843 EINA_SAFETY_ON_NULL_RETURN_VAL(wheelEvent, EINA_FALSE); 846 844 847 845 WebCore::FrameView* view = sd->frame->view(); 848 DBG(" o=%p, view=%p, direction=%d, z=%d, pos=%d,%d",849 o, view, ev->direction, ev->z, ev->canvas.x, ev->canvas.y);846 DBG("ewkFrame=%p, view=%p, direction=%d, z=%d, pos=%d,%d", 847 ewkFrame, view, wheelEvent->direction, wheelEvent->z, wheelEvent->canvas.x, wheelEvent->canvas.y); 850 848 EINA_SAFETY_ON_NULL_RETURN_VAL(view, EINA_FALSE); 851 849 852 WebCore::PlatformWheelEvent event( ev);850 WebCore::PlatformWheelEvent event(wheelEvent); 853 851 return sd->frame->eventHandler()->handleWheelEvent(event); 854 852 } 855 853 856 Eina_Bool ewk_frame_feed_mouse_down(Evas_Object* o, const Evas_Event_Mouse_Down* ev)857 { 858 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);859 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 860 EINA_SAFETY_ON_NULL_RETURN_VAL( ev, EINA_FALSE);854 Eina_Bool ewk_frame_feed_mouse_down(Evas_Object* ewkFrame, const Evas_Event_Mouse_Down* downEvent) 855 { 856 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 857 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 858 EINA_SAFETY_ON_NULL_RETURN_VAL(downEvent, EINA_FALSE); 861 859 862 860 WebCore::FrameView* view = sd->frame->view(); 863 DBG(" o=%p, view=%p, button=%d, pos=%d,%d",864 o, view, ev->button, ev->canvas.x, ev->canvas.y);861 DBG("ewkFrame=%p, view=%p, button=%d, pos=%d,%d", 862 ewkFrame, view, downEvent->button, downEvent->canvas.x, downEvent->canvas.y); 865 863 EINA_SAFETY_ON_NULL_RETURN_VAL(view, EINA_FALSE); 866 864 … … 868 866 evas_object_geometry_get(sd->view, &x, &y, 0, 0); 869 867 870 WebCore::PlatformMouseEvent event( ev, WebCore::IntPoint(x, y));868 WebCore::PlatformMouseEvent event(downEvent, WebCore::IntPoint(x, y)); 871 869 return sd->frame->eventHandler()->handleMousePressEvent(event); 872 870 } 873 871 874 Eina_Bool ewk_frame_feed_mouse_up(Evas_Object* o, const Evas_Event_Mouse_Up* ev)875 { 876 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);877 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 878 EINA_SAFETY_ON_NULL_RETURN_VAL( ev, EINA_FALSE);872 Eina_Bool ewk_frame_feed_mouse_up(Evas_Object* ewkFrame, const Evas_Event_Mouse_Up* upEvent) 873 { 874 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 875 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 876 EINA_SAFETY_ON_NULL_RETURN_VAL(upEvent, EINA_FALSE); 879 877 880 878 WebCore::FrameView* view = sd->frame->view(); 881 DBG(" o=%p, view=%p, button=%d, pos=%d,%d",882 o, view, ev->button, ev->canvas.x, ev->canvas.y);879 DBG("ewkFrame=%p, view=%p, button=%d, pos=%d,%d", 880 ewkFrame, view, upEvent->button, upEvent->canvas.x, upEvent->canvas.y); 883 881 EINA_SAFETY_ON_NULL_RETURN_VAL(view, EINA_FALSE); 884 882 … … 886 884 evas_object_geometry_get(sd->view, &x, &y, 0, 0); 887 885 888 WebCore::PlatformMouseEvent event( ev, WebCore::IntPoint(x, y));886 WebCore::PlatformMouseEvent event(upEvent, WebCore::IntPoint(x, y)); 889 887 return sd->frame->eventHandler()->handleMouseReleaseEvent(event); 890 888 } 891 889 892 Eina_Bool ewk_frame_feed_mouse_move(Evas_Object* o, const Evas_Event_Mouse_Move* ev)893 { 894 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);895 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 896 EINA_SAFETY_ON_NULL_RETURN_VAL( ev, EINA_FALSE);890 Eina_Bool ewk_frame_feed_mouse_move(Evas_Object* ewkFrame, const Evas_Event_Mouse_Move* moveEvent) 891 { 892 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 893 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 894 EINA_SAFETY_ON_NULL_RETURN_VAL(moveEvent, EINA_FALSE); 897 895 898 896 WebCore::FrameView* view = sd->frame->view(); 899 DBG(" o=%p, view=%p, pos: old=%d,%d, new=%d,%d, buttons=%d",900 o, view, ev->cur.canvas.x, ev->cur.canvas.y,901 ev->prev.canvas.x, ev->prev.canvas.y, ev->buttons);897 DBG("ewkFrame=%p, view=%p, pos: old=%d,%d, new=%d,%d, buttons=%d", 898 ewkFrame, view, moveEvent->cur.canvas.x, moveEvent->cur.canvas.y, 899 moveEvent->prev.canvas.x, moveEvent->prev.canvas.y, moveEvent->buttons); 902 900 EINA_SAFETY_ON_NULL_RETURN_VAL(view, EINA_FALSE); 903 901 … … 905 903 evas_object_geometry_get(sd->view, &x, &y, 0, 0); 906 904 907 WebCore::PlatformMouseEvent event( ev, WebCore::IntPoint(x, y));905 WebCore::PlatformMouseEvent event(moveEvent, WebCore::IntPoint(x, y)); 908 906 return sd->frame->eventHandler()->mouseMoved(event); 909 907 } 910 908 911 Eina_Bool ewk_frame_feed_touch_event(Evas_Object* o, Ewk_Touch_Event_Type action, Eina_List* points, int metaState)909 Eina_Bool ewk_frame_feed_touch_event(Evas_Object* ewkFrame, Ewk_Touch_Event_Type action, Eina_List* points, int metaState) 912 910 { 913 911 Eina_Bool ret = EINA_FALSE; … … 915 913 #if ENABLE(TOUCH_EVENTS) 916 914 EINA_SAFETY_ON_NULL_RETURN_VAL(points, EINA_FALSE); 917 EWK_FRAME_SD_GET( o, sd);915 EWK_FRAME_SD_GET(ewkFrame, sd); 918 916 919 917 if (!sd || !sd->frame || !ewk_view_need_touch_events_get(sd->view)) … … 947 945 } 948 946 949 static inline Eina_Bool _ewk_frame_handle_key_scrolling(WebCore::Frame* frame, const WebCore::PlatformKeyboardEvent& event)947 static inline Eina_Bool _ewk_frame_handle_key_scrolling(WebCore::Frame* frame, const WebCore::PlatformKeyboardEvent& keyEvent) 950 948 { 951 949 WebCore::ScrollDirection direction; 952 950 WebCore::ScrollGranularity granularity; 953 951 954 int keyCode = event.windowsVirtualKeyCode();952 int keyCode = keyEvent.windowsVirtualKeyCode(); 955 953 956 954 switch (keyCode) { 957 955 case VK_SPACE: 958 956 granularity = WebCore::ScrollByPage; 959 if ( event.shiftKey())957 if (keyEvent.shiftKey()) 960 958 direction = WebCore::ScrollUp; 961 959 else … … 988 986 case VK_UP: 989 987 direction = WebCore::ScrollUp; 990 if ( event.ctrlKey())988 if (keyEvent.ctrlKey()) 991 989 granularity = WebCore::ScrollByDocument; 992 990 else … … 995 993 case VK_DOWN: 996 994 direction = WebCore::ScrollDown; 997 if ( event.ctrlKey())995 if (keyEvent.ctrlKey()) 998 996 granularity = WebCore::ScrollByDocument; 999 997 else … … 1011 1009 } 1012 1010 1013 Eina_Bool ewk_frame_feed_key_down(Evas_Object* o, const Evas_Event_Key_Down* ev)1014 { 1015 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1016 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 1017 EINA_SAFETY_ON_NULL_RETURN_VAL( ev, EINA_FALSE);1018 1019 DBG(" o=%p keyname=%s (key=%s, string=%s)",1020 o, ev->keyname, ev->key ? ev->key : "", ev->string ? ev->string : "");1021 1022 WebCore::PlatformKeyboardEvent event( ev);1011 Eina_Bool ewk_frame_feed_key_down(Evas_Object* ewkFrame, const Evas_Event_Key_Down* downEvent) 1012 { 1013 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 1014 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 1015 EINA_SAFETY_ON_NULL_RETURN_VAL(downEvent, EINA_FALSE); 1016 1017 DBG("ewkFrame=%p keyname=%s (key=%s, string=%s)", 1018 ewkFrame, downEvent->keyname, downEvent->key ? downEvent->key : "", downEvent->string ? downEvent->string : ""); 1019 1020 WebCore::PlatformKeyboardEvent event(downEvent); 1023 1021 if (sd->frame->eventHandler()->keyEvent(event)) 1024 1022 return EINA_TRUE; … … 1027 1025 } 1028 1026 1029 Eina_Bool ewk_frame_feed_key_up(Evas_Object* o, const Evas_Event_Key_Up* ev)1030 { 1031 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1032 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 1033 EINA_SAFETY_ON_NULL_RETURN_VAL( ev, EINA_FALSE);1034 1035 DBG(" o=%p keyname=%s (key=%s, string=%s)",1036 o, ev->keyname, ev->key ? ev->key : "", ev->string ? ev->string : "");1037 1038 WebCore::PlatformKeyboardEvent event( ev);1027 Eina_Bool ewk_frame_feed_key_up(Evas_Object* ewkFrame, const Evas_Event_Key_Up* upEvent) 1028 { 1029 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 1030 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 1031 EINA_SAFETY_ON_NULL_RETURN_VAL(upEvent, EINA_FALSE); 1032 1033 DBG("ewkFrame=%p keyname=%s (key=%s, string=%s)", 1034 ewkFrame, upEvent->keyname, upEvent->key ? upEvent->key : "", upEvent->string ? upEvent->string : ""); 1035 1036 WebCore::PlatformKeyboardEvent event(upEvent); 1039 1037 return sd->frame->eventHandler()->keyEvent(event); 1040 1038 } 1041 1039 1042 Ewk_Text_Selection_Type ewk_frame_text_selection_type_get(const Evas_Object* o)1043 { 1044 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EWK_TEXT_SELECTION_NONE);1040 Ewk_Text_Selection_Type ewk_frame_text_selection_type_get(const Evas_Object* ewkFrame) 1041 { 1042 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EWK_TEXT_SELECTION_NONE); 1045 1043 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EWK_TEXT_SELECTION_NONE); 1046 1044 … … 1070 1068 * frame. 1071 1069 * 1072 * @param ecanvas where to create the frame object1070 * @param canvas canvas where to create the frame object 1073 1071 * 1074 1072 * @return a new frame object or @c 0 on failure 1075 1073 */ 1076 Evas_Object* ewk_frame_add(Evas* e)1077 { 1078 return evas_object_smart_add( e, _ewk_frame_smart_class_new());1074 Evas_Object* ewk_frame_add(Evas* canvas) 1075 { 1076 return evas_object_smart_add(canvas, _ewk_frame_smart_class_new()); 1079 1077 } 1080 1078 … … 1086 1084 * This is internal and should never be called by external users. 1087 1085 */ 1088 Eina_Bool ewk_frame_init(Evas_Object* o, Evas_Object* view, WebCore::Frame* frame)1089 { 1090 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1086 Eina_Bool ewk_frame_init(Evas_Object* ewkFrame, Evas_Object* view, WebCore::Frame* frame) 1087 { 1088 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 1091 1089 if (!sd->frame) { 1092 1090 WebCore::FrameLoaderClientEfl* flc = _ewk_frame_loader_efl_get(frame); 1093 flc->setWebFrame( o);1091 flc->setWebFrame(ewkFrame); 1094 1092 sd->frame = frame; 1095 1093 sd->view = view; … … 1099 1097 1100 1098 ERR("frame %p already set for %p, ignored new %p", 1101 sd->frame, o, frame);1099 sd->frame, ewkFrame, frame); 1102 1100 return EINA_FALSE; 1103 1101 } … … 1108 1106 * Adds child to the frame. 1109 1107 */ 1110 Eina_Bool ewk_frame_child_add(Evas_Object* o, WTF::PassRefPtr<WebCore::Frame> child, const WTF::String& name, const WebCore::KURL& url, const WTF::String& referrer)1111 { 1112 EWK_FRAME_SD_GET_OR_RETURN( o, sd, 0);1108 Eina_Bool ewk_frame_child_add(Evas_Object* ewkFrame, WTF::PassRefPtr<WebCore::Frame> child, const WTF::String& name, const WebCore::KURL& url, const WTF::String& referrer) 1109 { 1110 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, 0); 1113 1111 char buf[256]; 1114 1112 Evas_Object* frame; … … 1134 1132 snprintf(buf, sizeof(buf), "EWK_Frame:child/%s", name.utf8().data()); 1135 1133 evas_object_name_set(frame, buf); 1136 evas_object_smart_member_add(frame, o);1134 evas_object_smart_member_add(frame, ewkFrame); 1137 1135 evas_object_show(frame); 1138 1136 … … 1163 1161 * @param newParent The new view that will be set as the parent of the frame. 1164 1162 */ 1165 void ewk_frame_view_set(Evas_Object* o, Evas_Object* newParent)1166 { 1167 EWK_FRAME_SD_GET_OR_RETURN( o, sd);1168 1169 evas_object_smart_member_del( o);1170 evas_object_smart_member_add( o, newParent);1163 void ewk_frame_view_set(Evas_Object* ewkFrame, Evas_Object* newParent) 1164 { 1165 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd); 1166 1167 evas_object_smart_member_del(ewkFrame); 1168 evas_object_smart_member_add(ewkFrame, newParent); 1171 1169 1172 1170 sd->view = newParent; … … 1177 1175 * Frame was destroyed by loader, remove internal reference. 1178 1176 */ 1179 void ewk_frame_core_gone(Evas_Object* o)1180 { 1181 DBG(" o=%p", o);1182 EWK_FRAME_SD_GET_OR_RETURN( o, sd);1177 void ewk_frame_core_gone(Evas_Object* ewkFrame) 1178 { 1179 DBG("ewkFrame=%p", ewkFrame); 1180 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd); 1183 1181 sd->frame = 0; 1184 1182 } … … 1191 1189 * actions instead. 1192 1190 */ 1193 WebCore::Frame* ewk_frame_core_get(const Evas_Object* o)1194 { 1195 EWK_FRAME_SD_GET_OR_RETURN( o, sd, 0);1191 WebCore::Frame* ewk_frame_core_get(const Evas_Object* ewkFrame) 1192 { 1193 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, 0); 1196 1194 return sd->frame; 1197 1195 } … … 1210 1208 * Emits signal: "resource,request,willsend" 1211 1209 */ 1212 void ewk_frame_request_will_send(Evas_Object* o, Ewk_Frame_Resource_Request* request)1213 { 1214 evas_object_smart_callback_call( o, "resource,request,willsend", request);1210 void ewk_frame_request_will_send(Evas_Object* ewkFrame, Ewk_Frame_Resource_Request* request) 1211 { 1212 evas_object_smart_callback_call(ewkFrame, "resource,request,willsend", request); 1215 1213 } 1216 1214 … … 1224 1222 * Emits signal: "resource,request,new" 1225 1223 */ 1226 void ewk_frame_request_assign_identifier(Evas_Object* o, const Ewk_Frame_Resource_Request* request)1227 { 1228 evas_object_smart_callback_call( o, "resource,request,new", (void*)request);1224 void ewk_frame_request_assign_identifier(Evas_Object* ewkFrame, const Ewk_Frame_Resource_Request* request) 1225 { 1226 evas_object_smart_callback_call(ewkFrame, "resource,request,new", (void*)request); 1229 1227 } 1230 1228 … … 1237 1235 * Emits signal: "navigation,first" 1238 1236 */ 1239 void ewk_frame_did_perform_first_navigation(Evas_Object* o)1240 { 1241 evas_object_smart_callback_call( o, "navigation,first", 0);1237 void ewk_frame_did_perform_first_navigation(Evas_Object* ewkFrame) 1238 { 1239 evas_object_smart_callback_call(ewkFrame, "navigation,first", 0); 1242 1240 } 1243 1241 … … 1251 1249 * Emits signal: "state,save" 1252 1250 */ 1253 void ewk_frame_view_state_save(Evas_Object* o, WebCore::HistoryItem* item)1254 { 1255 evas_object_smart_callback_call( o, "state,save", 0);1251 void ewk_frame_view_state_save(Evas_Object* ewkFrame, WebCore::HistoryItem* item) 1252 { 1253 evas_object_smart_callback_call(ewkFrame, "state,save", 0); 1256 1254 } 1257 1255 … … 1262 1260 * Emits signal: "load,started" with no parameters. 1263 1261 */ 1264 void ewk_frame_load_started(Evas_Object* o)1262 void ewk_frame_load_started(Evas_Object* ewkFrame) 1265 1263 { 1266 1264 Evas_Object* main_frame; 1267 DBG(" o=%p", o);1268 evas_object_smart_callback_call( o, "load,started", 0);1269 EWK_FRAME_SD_GET_OR_RETURN( o, sd);1265 DBG("ewkFrame=%p", ewkFrame); 1266 evas_object_smart_callback_call(ewkFrame, "load,started", 0); 1267 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd); 1270 1268 ewk_view_load_started(sd->view); 1271 1269 1272 1270 main_frame = ewk_view_frame_main_get(sd->view); 1273 if (main_frame == o)1271 if (main_frame == ewkFrame) 1274 1272 ewk_view_frame_main_load_started(sd->view); 1275 1273 } … … 1283 1281 * Emits signal: "load,provisional" with no parameters. 1284 1282 */ 1285 void ewk_frame_load_provisional(Evas_Object* o)1286 { 1287 evas_object_smart_callback_call( o, "load,provisional", 0);1283 void ewk_frame_load_provisional(Evas_Object* ewkFrame) 1284 { 1285 evas_object_smart_callback_call(ewkFrame, "load,provisional", 0); 1288 1286 } 1289 1287 … … 1296 1294 * Emits signal: "load,firstlayout,finished" with no parameters. 1297 1295 */ 1298 void ewk_frame_load_firstlayout_finished(Evas_Object* o)1299 { 1300 evas_object_smart_callback_call( o, "load,firstlayout,finished", 0);1296 void ewk_frame_load_firstlayout_finished(Evas_Object* ewkFrame) 1297 { 1298 evas_object_smart_callback_call(ewkFrame, "load,firstlayout,finished", 0); 1301 1299 } 1302 1300 … … 1309 1307 * Emits signal: "load,nonemptylayout,finished" with no parameters. 1310 1308 */ 1311 void ewk_frame_load_firstlayout_nonempty_finished(Evas_Object* o)1312 { 1313 evas_object_smart_callback_call( o, "load,nonemptylayout,finished", 0);1309 void ewk_frame_load_firstlayout_nonempty_finished(Evas_Object* ewkFrame) 1310 { 1311 evas_object_smart_callback_call(ewkFrame, "load,nonemptylayout,finished", 0); 1314 1312 } 1315 1313 … … 1322 1320 * Emits signal: "load,document,finished" with no parameters. 1323 1321 */ 1324 void ewk_frame_load_document_finished(Evas_Object* o)1325 { 1326 evas_object_smart_callback_call( o, "load,document,finished", 0);1327 EWK_FRAME_SD_GET_OR_RETURN( o, sd);1328 ewk_view_load_document_finished(sd->view, o);1322 void ewk_frame_load_document_finished(Evas_Object* ewkFrame) 1323 { 1324 evas_object_smart_callback_call(ewkFrame, "load,document,finished", 0); 1325 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd); 1326 ewk_view_load_document_finished(sd->view, ewkFrame); 1329 1327 } 1330 1328 … … 1339 1337 * compatible with previous WebKit. 1340 1338 */ 1341 void ewk_frame_load_finished(Evas_Object* o, const char* error_domain, int error_code, Eina_Bool is_cancellation, const char* error_description, const char* failing_url)1342 { 1343 Ewk_Frame_Load_Error buf, * 1344 if (!error _domain) {1345 DBG(" o=%p, success.", o);1339 void ewk_frame_load_finished(Evas_Object* ewkFrame, const char* errorDomain, int errorCode, Eina_Bool isCancellation, const char* errorDescription, const char* failingUrl) 1340 { 1341 Ewk_Frame_Load_Error buf, *error; 1342 if (!errorDomain) { 1343 DBG("ewkFrame=%p, success.", ewkFrame); 1346 1344 error = 0; 1347 1345 } else { 1348 DBG(" o=%p, error=%s (%d, cancellation=%hhu) \"%s\", url=%s",1349 o, error_domain, error_code, is_cancellation,1350 error _description, failing_url);1351 1352 buf.domain = error _domain;1353 buf.code = error _code;1354 buf.is_cancellation = is _cancellation;1355 buf.description = error _description;1356 buf.failing_url = failing _url;1357 buf.frame = o;1346 DBG("ewkFrame=%p, error=%s (%d, cancellation=%hhu) \"%s\", url=%s", 1347 ewkFrame, errorDomain, errorCode, isCancellation, 1348 errorDescription, failingUrl); 1349 1350 buf.domain = errorDomain; 1351 buf.code = errorCode; 1352 buf.is_cancellation = isCancellation; 1353 buf.description = errorDescription; 1354 buf.failing_url = failingUrl; 1355 buf.frame = ewkFrame; 1358 1356 error = &buf; 1359 1357 } 1360 evas_object_smart_callback_call( o, "load,finished", error);1361 EWK_FRAME_SD_GET_OR_RETURN( o, sd);1358 evas_object_smart_callback_call(ewkFrame, "load,finished", error); 1359 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd); 1362 1360 ewk_view_load_finished(sd->view, error); 1363 1361 } … … 1369 1367 * Emits signal: "load,error" with pointer to Ewk_Frame_Load_Error. 1370 1368 */ 1371 void ewk_frame_load_error(Evas_Object* o, const char* error_domain, int error_code, Eina_Bool is_cancellation, const char* error_description, const char* failing_url)1369 void ewk_frame_load_error(Evas_Object* ewkFrame, const char* errorDomain, int errorCode, Eina_Bool isCancellation, const char* errorDescription, const char* failingUrl) 1372 1370 { 1373 1371 Ewk_Frame_Load_Error error; 1374 1372 1375 DBG(" o=%p, error=%s (%d, cancellation=%hhu) \"%s\", url=%s",1376 o, error_domain, error_code, is_cancellation,1377 error _description, failing_url);1378 1379 EINA_SAFETY_ON_NULL_RETURN(error _domain);1380 1381 error.code = error _code;1382 error.is_cancellation = is _cancellation;1383 error.domain = error _domain;1384 error.description = error _description;1385 error.failing_url = failing _url;1386 error.frame = o;1387 evas_object_smart_callback_call( o, "load,error", &error);1388 EWK_FRAME_SD_GET_OR_RETURN( o, sd);1373 DBG("ewkFrame=%p, error=%s (%d, cancellation=%hhu) \"%s\", url=%s", 1374 ewkFrame, errorDomain, errorCode, isCancellation, 1375 errorDescription, failingUrl); 1376 1377 EINA_SAFETY_ON_NULL_RETURN(errorDomain); 1378 1379 error.code = errorCode; 1380 error.is_cancellation = isCancellation; 1381 error.domain = errorDomain; 1382 error.description = errorDescription; 1383 error.failing_url = failingUrl; 1384 error.frame = ewkFrame; 1385 evas_object_smart_callback_call(ewkFrame, "load,error", &error); 1386 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd); 1389 1387 ewk_view_load_error(sd->view, &error); 1390 1388 } … … 1396 1394 * Emits signal: "load,progress" with pointer to a double from 0.0 to 1.0. 1397 1395 */ 1398 void ewk_frame_load_progress_changed(Evas_Object* o)1399 { 1400 EWK_FRAME_SD_GET_OR_RETURN( o, sd);1396 void ewk_frame_load_progress_changed(Evas_Object* ewkFrame) 1397 { 1398 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd); 1401 1399 EINA_SAFETY_ON_NULL_RETURN(sd->frame); 1402 1400 … … 1404 1402 double progress = sd->frame->page()->progress()->estimatedProgress(); 1405 1403 1406 DBG(" o=%p (p=%0.3f)", o, progress);1407 1408 evas_object_smart_callback_call( o, "load,progress", &progress);1404 DBG("ewkFrame=%p (p=%0.3f)", ewkFrame, progress); 1405 1406 evas_object_smart_callback_call(ewkFrame, "load,progress", &progress); 1409 1407 ewk_view_load_progress_changed(sd->view); 1410 1408 } … … 1416 1414 * Reports contents size changed. 1417 1415 */ 1418 void ewk_frame_contents_size_changed(Evas_Object* o, Evas_Coord w, Evas_Coord h)1419 { 1420 Evas_Coord size[2] = {w , h};1421 evas_object_smart_callback_call( o, "contents,size,changed", size);1416 void ewk_frame_contents_size_changed(Evas_Object* ewkFrame, Evas_Coord width, Evas_Coord height) 1417 { 1418 Evas_Coord size[2] = {width, height}; 1419 evas_object_smart_callback_call(ewkFrame, "contents,size,changed", size); 1422 1420 } 1423 1421 … … 1427 1425 * Reports title changed. 1428 1426 */ 1429 void ewk_frame_title_set(Evas_Object* o, const char* title)1430 { 1431 DBG(" o=%p, title=%s", o, title ? title : "(null)");1432 EWK_FRAME_SD_GET_OR_RETURN( o, sd);1427 void ewk_frame_title_set(Evas_Object* ewkFrame, const char* title) 1428 { 1429 DBG("ewkFrame=%p, title=%s", ewkFrame, title ? title : "(null)"); 1430 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd); 1433 1431 if (!eina_stringshare_replace(&sd->title, title)) 1434 1432 return; 1435 evas_object_smart_callback_call( o, "title,changed", (void*)sd->title);1433 evas_object_smart_callback_call(ewkFrame, "title,changed", (void*)sd->title); 1436 1434 } 1437 1435 … … 1441 1439 * Creates a view. 1442 1440 */ 1443 void ewk_frame_view_create_for_view(Evas_Object* o, Evas_Object* view)1444 { 1445 DBG(" o=%p, view=%p", o, view);1446 EWK_FRAME_SD_GET_OR_RETURN( o, sd);1441 void ewk_frame_view_create_for_view(Evas_Object* ewkFrame, Evas_Object* view) 1442 { 1443 DBG("ewkFrame=%p, view=%p", ewkFrame, view); 1444 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd); 1447 1445 EINA_SAFETY_ON_NULL_RETURN(sd->frame); 1448 1446 Evas_Coord w, h; … … 1468 1466 const char* theme = ewk_view_theme_get(view); 1469 1467 sd->frame->view()->setEdjeTheme(theme); 1470 sd->frame->view()->setEvasObject( o);1471 } 1472 1473 ssize_t ewk_frame_source_get(const Evas_Object* o, char** frame_source)1474 { 1475 EWK_FRAME_SD_GET_OR_RETURN( o, sd, -1);1468 sd->frame->view()->setEvasObject(ewkFrame); 1469 } 1470 1471 ssize_t ewk_frame_source_get(const Evas_Object* ewkFrame, char** frameSource) 1472 { 1473 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, -1); 1476 1474 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, -1); 1477 1475 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame->document(), -1); 1478 EINA_SAFETY_ON_NULL_RETURN_VAL(frame _source, -1);1476 EINA_SAFETY_ON_NULL_RETURN_VAL(frameSource, -1); 1479 1477 1480 1478 WTF::String source; 1481 *frame _source = 0; // Saves 0 to pointer until it's not allocated.1479 *frameSource = 0; // Saves 0 to pointer until it's not allocated. 1482 1480 1483 1481 if (!sd->frame->document()->isHTMLDocument()) { … … 1509 1507 1510 1508 size_t source_length = strlen(source.utf8().data()); 1511 *frame _source = static_cast<char*>(malloc(source_length + 1));1512 if (!*frame _source) {1509 *frameSource = static_cast<char*>(malloc(source_length + 1)); 1510 if (!*frameSource) { 1513 1511 CRITICAL("Could not allocate memory."); 1514 1512 return -1; 1515 1513 } 1516 1514 1517 strncpy(*frame _source, source.utf8().data(), source_length);1518 (*frame _source)[source_length] = '\0';1515 strncpy(*frameSource, source.utf8().data(), source_length); 1516 (*frameSource)[source_length] = '\0'; 1519 1517 1520 1518 return source_length; 1521 1519 } 1522 1520 1523 Eina_List* ewk_frame_resources_location_get(const Evas_Object* o)1524 { 1525 EWK_FRAME_SD_GET_OR_RETURN( o, sd, 0);1521 Eina_List* ewk_frame_resources_location_get(const Evas_Object* ewkFrame) 1522 { 1523 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, 0); 1526 1524 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, 0); 1527 1525 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame->document(), 0); … … 1587 1585 * Emits signal: "uri,changed" with new uri as parameter. 1588 1586 */ 1589 Eina_Bool ewk_frame_uri_changed(Evas_Object* o)1590 { 1591 EWK_FRAME_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1587 Eina_Bool ewk_frame_uri_changed(Evas_Object* ewkFrame) 1588 { 1589 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd, EINA_FALSE); 1592 1590 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); 1593 1591 WTF::CString uri(sd->frame->document()->url().string().utf8()); … … 1600 1598 1601 1599 eina_stringshare_replace(&sd->uri, uri.data()); 1602 evas_object_smart_callback_call( o, "uri,changed", (void*)sd->uri);1600 evas_object_smart_callback_call(ewkFrame, "uri,changed", (void*)sd->uri); 1603 1601 return EINA_TRUE; 1604 1602 } … … 1609 1607 * Forces layout for frame. 1610 1608 */ 1611 void ewk_frame_force_layout(Evas_Object* o)1612 { 1613 DBG(" o=%p", o);1614 EWK_FRAME_SD_GET_OR_RETURN( o, sd);1609 void ewk_frame_force_layout(Evas_Object* ewkFrame) 1610 { 1611 DBG("ewkFrame=%p", ewkFrame); 1612 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd); 1615 1613 EINA_SAFETY_ON_NULL_RETURN(sd->frame); 1616 1614 WebCore::FrameView* view = sd->frame->view(); … … 1624 1622 * Creates plugin. 1625 1623 */ 1626 WTF::PassRefPtr<WebCore::Widget> ewk_frame_plugin_create(Evas_Object* o, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues, const WTF::String& mimeType, bool loadManually)1624 WTF::PassRefPtr<WebCore::Widget> ewk_frame_plugin_create(Evas_Object* ewkFrame, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues, const WTF::String& mimeType, bool loadManually) 1627 1625 { 1628 1626 return 0; … … 1637 1635 * Emits signal: "editorclientselection,changed" with no parameters. 1638 1636 */ 1639 void ewk_frame_editor_client_selection_changed(Evas_Object* o)1640 { 1641 evas_object_smart_callback_call( o, "editorclient,selection,changed", 0);1642 EWK_FRAME_SD_GET_OR_RETURN( o, sd);1637 void ewk_frame_editor_client_selection_changed(Evas_Object* ewkFrame) 1638 { 1639 evas_object_smart_callback_call(ewkFrame, "editorclient,selection,changed", 0); 1640 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd); 1643 1641 ewk_view_editor_client_selection_changed(sd->view); 1644 1642 } … … 1652 1650 * Emits signal: "editorclient,contents,changed" with no parameters. 1653 1651 */ 1654 void ewk_frame_editor_client_contents_changed(Evas_Object* o)1655 { 1656 evas_object_smart_callback_call( o, "editorclient,contents,changed", 0);1657 EWK_FRAME_SD_GET_OR_RETURN( o, sd);1652 void ewk_frame_editor_client_contents_changed(Evas_Object* ewkFrame) 1653 { 1654 evas_object_smart_callback_call(ewkFrame, "editorclient,contents,changed", 0); 1655 EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, sd); 1658 1656 ewk_view_editor_client_contents_changed(sd->view); 1659 1657 } -
trunk/Source/WebKit/efl/ewk/ewk_history.cpp
r96382 r97329 96 96 } 97 97 98 static inline Eina_List* _ewk_history_item_list_get(const WebCore::HistoryItemVector& core _items)98 static inline Eina_List* _ewk_history_item_list_get(const WebCore::HistoryItemVector& coreItems) 99 99 { 100 100 Eina_List* ret = 0; 101 101 unsigned int i, size; 102 102 103 size = core _items.size();103 size = coreItems.size(); 104 104 for (i = 0; i < size; i++) { 105 Ewk_History_Item* item = _ewk_history_item_new(core _items[i].get());105 Ewk_History_Item* item = _ewk_history_item_new(coreItems[i].get()); 106 106 if (item) 107 107 ret = eina_list_append(ret, item); -
trunk/Source/WebKit/efl/ewk/ewk_js.cpp
r95901 r97329 84 84 85 85 // These methods are used by NPAI, thats the reason to use bool instead of Eina_Bool. 86 static bool ewk_js_property_has(NPObject* np _obj, NPIdentifier name)87 { 88 Ewk_JS_Object* obj = reinterpret_cast<Ewk_JS_Object*>(np _obj);89 90 EINA_SAFETY_ON_NULL_RETURN_VAL(np _obj, false);86 static bool ewk_js_property_has(NPObject* npObject, NPIdentifier name) 87 { 88 Ewk_JS_Object* obj = reinterpret_cast<Ewk_JS_Object*>(npObject); 89 90 EINA_SAFETY_ON_NULL_RETURN_VAL(npObject, false); 91 91 EINA_MAGIC_CHECK_OR_RETURN(obj, false); 92 92 … … 103 103 } 104 104 105 static bool ewk_js_property_get(NPObject* np _obj, NPIdentifier name, NPVariant* result)106 { 107 Ewk_JS_Object* obj = reinterpret_cast<Ewk_JS_Object*>(np _obj);105 static bool ewk_js_property_get(NPObject* npObject, NPIdentifier name, NPVariant* result) 106 { 107 Ewk_JS_Object* obj = reinterpret_cast<Ewk_JS_Object*>(npObject); 108 108 Ewk_JS_Variant* value; 109 109 Ewk_JS_Property* prop; 110 110 bool fail = false; 111 111 112 EINA_SAFETY_ON_NULL_RETURN_VAL(np _obj, false);112 EINA_SAFETY_ON_NULL_RETURN_VAL(npObject, false); 113 113 EINA_MAGIC_CHECK_OR_RETURN(obj, false); 114 114 … … 146 146 } 147 147 148 static bool ewk_js_property_set(NPObject* np _obj, NPIdentifier name, const NPVariant* np_value)149 { 150 Ewk_JS_Object* obj = reinterpret_cast<Ewk_JS_Object*>(np _obj);148 static bool ewk_js_property_set(NPObject* npObject, NPIdentifier name, const NPVariant* npValue) 149 { 150 Ewk_JS_Object* obj = reinterpret_cast<Ewk_JS_Object*>(npObject); 151 151 Ewk_JS_Variant* value; 152 152 Ewk_JS_Property* prop; 153 153 bool fail = false; 154 154 155 EINA_SAFETY_ON_NULL_RETURN_VAL(np _obj, false);155 EINA_SAFETY_ON_NULL_RETURN_VAL(npObj, false); 156 156 EINA_MAGIC_CHECK_OR_RETURN(obj, false); 157 157 … … 167 167 } 168 168 169 ewk_js_npvariant_to_variant(value, np _value);169 ewk_js_npvariant_to_variant(value, npValue); 170 170 char* prop_name = _NPN_UTF8FromIdentifier(name); 171 171 prop = static_cast<Ewk_JS_Property*>(eina_hash_find(obj->cls->properties, prop_name)); … … 184 184 } 185 185 186 static bool ewk_js_property_remove(NPObject* np _obj, NPIdentifier name)187 { 188 Ewk_JS_Object* obj = reinterpret_cast<Ewk_JS_Object*>(np _obj);186 static bool ewk_js_property_remove(NPObject* npObject, NPIdentifier name) 187 { 188 Ewk_JS_Object* obj = reinterpret_cast<Ewk_JS_Object*>(npObject); 189 189 Ewk_JS_Property* prop; 190 190 bool fail = false; 191 191 192 EINA_SAFETY_ON_NULL_RETURN_VAL(np _obj, false);192 EINA_SAFETY_ON_NULL_RETURN_VAL(npObject, false); 193 193 EINA_MAGIC_CHECK_OR_RETURN(obj, false); 194 194 … … 211 211 } 212 212 213 static bool ewk_js_properties_enumerate(NPObject* np _obj, NPIdentifier** value, uint32_t* count)214 { 215 Ewk_JS_Object* obj = reinterpret_cast<Ewk_JS_Object*>(np _obj);213 static bool ewk_js_properties_enumerate(NPObject* npObject, NPIdentifier** value, uint32_t* count) 214 { 215 Ewk_JS_Object* obj = reinterpret_cast<Ewk_JS_Object*>(npObject); 216 216 Eina_Iterator* it; 217 217 char* key; 218 218 int i = 0; 219 219 220 EINA_SAFETY_ON_NULL_RETURN_VAL(np _obj, false);220 EINA_SAFETY_ON_NULL_RETURN_VAL(npObject, false); 221 221 EINA_MAGIC_CHECK_OR_RETURN(obj, false); 222 222 … … 236 236 } 237 237 238 static bool ewk_js_method_has(NPObject* np _obj, NPIdentifier name)239 { 240 Ewk_JS_Object* obj = reinterpret_cast<Ewk_JS_Object*>(np _obj);241 242 EINA_SAFETY_ON_NULL_RETURN_VAL(np _obj, false);238 static bool ewk_js_method_has(NPObject* npObject, NPIdentifier name) 239 { 240 Ewk_JS_Object* obj = reinterpret_cast<Ewk_JS_Object*>(npObject); 241 242 EINA_SAFETY_ON_NULL_RETURN_VAL(npObject, false); 243 243 EINA_MAGIC_CHECK_OR_RETURN(obj, false); 244 244 … … 250 250 } 251 251 252 static bool ewk_js_method_invoke(NPObject* np _obj, NPIdentifier name, const NPVariant* np_args, uint32_t np_arg_count, NPVariant* result)253 { 254 Ewk_JS_Object* obj = reinterpret_cast<Ewk_JS_Object*>(np _obj);252 static bool ewk_js_method_invoke(NPObject* npObject, NPIdentifier name, const NPVariant* npArgs, uint32_t npArgCount, NPVariant* result) 253 { 254 Ewk_JS_Object* obj = reinterpret_cast<Ewk_JS_Object*>(npObject); 255 255 Ewk_JS_Method* method; 256 256 Ewk_JS_Variant* args; 257 257 Ewk_JS_Variant* ret_val; 258 258 259 EINA_SAFETY_ON_NULL_RETURN_VAL(np _obj, false);259 EINA_SAFETY_ON_NULL_RETURN_VAL(npObject, false); 260 260 EINA_MAGIC_CHECK_OR_RETURN(obj, false); 261 261 … … 269 269 return false; 270 270 271 args = static_cast<Ewk_JS_Variant*>(malloc(sizeof(Ewk_JS_Variant) *np _arg_count));271 args = static_cast<Ewk_JS_Variant*>(malloc(sizeof(Ewk_JS_Variant) *npArgCount)); 272 272 if (!args) { 273 273 ERR("Could not allocate memory for ewk_js_variant"); … … 275 275 } 276 276 277 for (uint32_t i = 0; i < np _arg_count; i++)278 ewk_js_npvariant_to_variant(&args[i], &np _args[i]);279 ret_val = method->invoke(obj, args, np _arg_count);277 for (uint32_t i = 0; i < npArgCount; i++) 278 ewk_js_npvariant_to_variant(&args[i], &npArgs[i]); 279 ret_val = method->invoke(obj, args, npArgCount); 280 280 ewk_js_variant_to_npvariant(ret_val, result); 281 281 … … 285 285 } 286 286 287 static Eina_Bool ewk_js_npobject_property_get(Ewk_JS_Object* obj, const char* name, Ewk_JS_Variant* value)287 static Eina_Bool ewk_js_npobject_property_get(Ewk_JS_Object* jsObject, const char* name, Ewk_JS_Variant* value) 288 288 { 289 289 NPIdentifier id = _NPN_GetStringIdentifier(name); 290 290 NPVariant var; 291 bool fail = _NPN_GetProperty(0, reinterpret_cast<NPObject*>( obj), id, &var);291 bool fail = _NPN_GetProperty(0, reinterpret_cast<NPObject*>(jsObject), id, &var); 292 292 if (!fail) 293 293 fail = ewk_js_npvariant_to_variant(value, &var); … … 295 295 } 296 296 297 static Eina_Bool ewk_js_npobject_property_set(Ewk_JS_Object* obj, const char* name, const Ewk_JS_Variant* value)297 static Eina_Bool ewk_js_npobject_property_set(Ewk_JS_Object* jsObject, const char* name, const Ewk_JS_Variant* value) 298 298 { 299 299 NPIdentifier id = _NPN_GetStringIdentifier(name); … … 301 301 bool fail = ewk_js_variant_to_npvariant(value, &var); 302 302 if (fail) 303 fail = _NPN_SetProperty(0, reinterpret_cast<NPObject*>( obj), id, &var);303 fail = _NPN_SetProperty(0, reinterpret_cast<NPObject*>(jsObject), id, &var); 304 304 return fail; 305 305 } 306 306 307 static Eina_Bool ewk_js_npobject_property_del(Ewk_JS_Object* obj, const char* name)307 static Eina_Bool ewk_js_npobject_property_del(Ewk_JS_Object* jsObject, const char* name) 308 308 { 309 309 NPIdentifier id = _NPN_GetStringIdentifier(name); 310 return _NPN_RemoveProperty(0, reinterpret_cast<NPObject*>( obj), id);310 return _NPN_RemoveProperty(0, reinterpret_cast<NPObject*>(jsObject), id); 311 311 } 312 312 … … 328 328 * @return The Ewk_JS_Class created. 329 329 */ 330 Ewk_JS_Class* ewk_js_class_new(const Ewk_JS_Class_Meta* meta)330 Ewk_JS_Class* ewk_js_class_new(const Ewk_JS_Class_Meta* jsMetaClass) 331 331 { 332 332 Ewk_JS_Class* cls; 333 333 334 EINA_SAFETY_ON_NULL_RETURN_VAL( meta, 0);334 EINA_SAFETY_ON_NULL_RETURN_VAL(jsMetaClass, 0); 335 335 336 336 cls = static_cast<Ewk_JS_Class*>(malloc(sizeof(Ewk_JS_Class))); … … 340 340 } 341 341 342 cls->meta = meta;342 cls->meta = jsMetaClass; 343 343 cls->default_prop = meta->default_prop; 344 344 … … 365 365 * @param cls @a Ewk_JS_Class to be released. 366 366 */ 367 void ewk_js_class_free(Ewk_JS_Class* cls)368 { 369 EINA_SAFETY_ON_NULL_RETURN( cls);370 eina_hash_free( cls->methods);371 eina_hash_free( cls->properties);372 free( cls);367 void ewk_js_class_free(Ewk_JS_Class* jsClass) 368 { 369 EINA_SAFETY_ON_NULL_RETURN(jsClass); 370 eina_hash_free(jsClass->methods); 371 eina_hash_free(jsClass->properties); 372 free(jsClass); 373 373 } 374 374 … … 389 389 }; 390 390 391 static Ewk_JS_Object* ewk_js_npobject_to_object(NPObject* np _obj)391 static Ewk_JS_Object* ewk_js_npobject_to_object(NPObject* npObject) 392 392 { 393 393 NPIdentifier* values; … … 399 399 JavaScriptObject* jso; 400 400 401 if (EINA_MAGIC_CHECK(reinterpret_cast<Ewk_JS_Object*>(np _obj), EWK_JS_OBJECT_MAGIC))402 return reinterpret_cast<Ewk_JS_Object*>(np _obj);401 if (EINA_MAGIC_CHECK(reinterpret_cast<Ewk_JS_Object*>(npObject), EWK_JS_OBJECT_MAGIC)) 402 return reinterpret_cast<Ewk_JS_Object*>(npObject); 403 403 404 404 if (!_NPN_Enumerate(0, np_obj, &values, &np_props_count)) … … 449 449 obj->view = 0; 450 450 451 jso = reinterpret_cast<JavaScriptObject*>(np _obj);451 jso = reinterpret_cast<JavaScriptObject*>(npObject); 452 452 if (!strcmp("Array", jso->imp->className().ascii().data())) 453 453 obj->type = EWK_JS_OBJECT_ARRAY; … … 470 470 471 471 eina_iterator_free(it); 472 obj->base = *reinterpret_cast<JavaScriptObject*>(np _obj);472 obj->base = *reinterpret_cast<JavaScriptObject*>(npObject); 473 473 474 474 return obj; … … 526 526 } 527 527 528 Ewk_JS_Object* ewk_js_object_new(const Ewk_JS_Class_Meta* meta_cls)528 Ewk_JS_Object* ewk_js_object_new(const Ewk_JS_Class_Meta* jsMetaClass) 529 529 { 530 530 Ewk_JS_Object* obj; … … 539 539 540 540 EINA_MAGIC_SET(obj, EWK_JS_OBJECT_MAGIC); 541 obj->cls = ewk_js_class_new( meta_cls);541 obj->cls = ewk_js_class_new(jsMetaClass); 542 542 obj->view = 0; 543 543 obj->name = 0; … … 595 595 } 596 596 597 void ewk_js_object_free(Ewk_JS_Object* obj)598 { 599 EINA_SAFETY_ON_NULL_RETURN( obj);600 EINA_MAGIC_CHECK_OR_RETURN( obj);601 Eina_Bool script_obj = ! obj->cls->meta;602 603 eina_hash_free( obj->properties);604 eina_stringshare_del( obj->name);605 606 ewk_js_class_free(const_cast<Ewk_JS_Class*>( obj->cls));607 608 EINA_MAGIC_SET( obj, EINA_MAGIC_NONE);597 void ewk_js_object_free(Ewk_JS_Object* jsObject) 598 { 599 EINA_SAFETY_ON_NULL_RETURN(jsObject); 600 EINA_MAGIC_CHECK_OR_RETURN(jsObject); 601 Eina_Bool script_obj = !jsObject->cls->meta; 602 603 eina_hash_free(jsObject->properties); 604 eina_stringshare_del(jsObject->name); 605 606 ewk_js_class_free(const_cast<Ewk_JS_Class*>(jsObject->cls)); 607 608 EINA_MAGIC_SET(jsObject, EINA_MAGIC_NONE); 609 609 610 610 if (script_obj) 611 free( obj);612 } 613 614 Eina_Hash* ewk_js_object_properties_get(const Ewk_JS_Object* obj)615 { 616 EINA_SAFETY_ON_NULL_RETURN_VAL( obj, 0);617 EINA_MAGIC_CHECK_OR_RETURN( obj, 0);618 return obj->properties;619 } 620 621 const char* ewk_js_object_name_get(const Ewk_JS_Object* obj)622 { 623 EINA_SAFETY_ON_NULL_RETURN_VAL( obj, 0);624 EINA_MAGIC_CHECK_OR_RETURN( obj, 0);625 return obj->name;626 } 627 628 Eina_Bool ewk_js_object_invoke(Ewk_JS_Object* obj, Ewk_JS_Variant* args, int arg_count, Ewk_JS_Variant* result)611 free(jsObject); 612 } 613 614 Eina_Hash* ewk_js_object_properties_get(const Ewk_JS_Object* jsObject) 615 { 616 EINA_SAFETY_ON_NULL_RETURN_VAL(jsObject, 0); 617 EINA_MAGIC_CHECK_OR_RETURN(jsObject, 0); 618 return jsObject->properties; 619 } 620 621 const char* ewk_js_object_name_get(const Ewk_JS_Object* jsObject) 622 { 623 EINA_SAFETY_ON_NULL_RETURN_VAL(jsObject, 0); 624 EINA_MAGIC_CHECK_OR_RETURN(jsObject, 0); 625 return jsObject->name; 626 } 627 628 Eina_Bool ewk_js_object_invoke(Ewk_JS_Object* jsObject, Ewk_JS_Variant* args, int argCount, Ewk_JS_Variant* result) 629 629 { 630 630 NPVariant* np_args; … … 632 632 bool fail = EINA_FALSE; 633 633 634 EINA_MAGIC_CHECK_OR_RETURN( obj, EINA_FALSE);635 if (ewk_js_object_type_get( obj) != EWK_JS_OBJECT_FUNCTION)634 EINA_MAGIC_CHECK_OR_RETURN(jsObject, EINA_FALSE); 635 if (ewk_js_object_type_get(jsObject) != EWK_JS_OBJECT_FUNCTION) 636 636 return EINA_FALSE; 637 if (arg _count)637 if (argCount) 638 638 EINA_SAFETY_ON_NULL_RETURN_VAL(args, EINA_FALSE); 639 639 … … 644 644 } 645 645 646 for (int i = 0; i < arg _count; i++)646 for (int i = 0; i < argCount; i++) 647 647 if (!ewk_js_variant_to_npvariant(&args[i], &np_args[i])) 648 648 goto end; 649 649 650 if (!(fail = _NPN_InvokeDefault(0, reinterpret_cast<NPObject*>( obj), np_args, arg_count, &np_result)))650 if (!(fail = _NPN_InvokeDefault(0, reinterpret_cast<NPObject*>(jsObject), np_args, argCount, &np_result))) 651 651 goto end; 652 652 if (result) … … 658 658 } 659 659 660 Ewk_JS_Object_Type ewk_js_object_type_get(Ewk_JS_Object* obj)661 { 662 EINA_SAFETY_ON_NULL_RETURN_VAL( obj, EWK_JS_OBJECT_OBJECT);663 EINA_MAGIC_CHECK_OR_RETURN( obj, EWK_JS_OBJECT_OBJECT);660 Ewk_JS_Object_Type ewk_js_object_type_get(Ewk_JS_Object* jsObject) 661 { 662 EINA_SAFETY_ON_NULL_RETURN_VAL(jsObject, EWK_JS_OBJECT_OBJECT); 663 EINA_MAGIC_CHECK_OR_RETURN(jsOobject, EWK_JS_OBJECT_OBJECT); 664 664 665 665 return obj->type; 666 666 } 667 667 668 void ewk_js_object_type_set(Ewk_JS_Object* obj, Ewk_JS_Object_Type type)669 { 670 EINA_SAFETY_ON_NULL_RETURN( obj);671 EINA_MAGIC_CHECK_OR_RETURN( obj);672 673 obj ->type = type;674 } 675 676 void ewk_js_variant_free(Ewk_JS_Variant* var)677 { 678 EINA_SAFETY_ON_NULL_RETURN( var);679 if (var ->type == EWK_JS_VARIANT_STRING)680 free( var->value.s);681 else if ( var->type == EWK_JS_VARIANT_OBJECT)682 ewk_js_object_free( var->value.o);683 free( var);684 } 685 686 void ewk_js_variant_array_free(Ewk_JS_Variant* var, int count)687 { 688 EINA_SAFETY_ON_NULL_RETURN( var);668 void ewk_js_object_type_set(Ewk_JS_Object* jsObject, Ewk_JS_Object_Type type) 669 { 670 EINA_SAFETY_ON_NULL_RETURN(jsObject); 671 EINA_MAGIC_CHECK_OR_RETURN(jsObject); 672 673 object->type = type; 674 } 675 676 void ewk_js_variant_free(Ewk_JS_Variant* jsVariant) 677 { 678 EINA_SAFETY_ON_NULL_RETURN(jsVariant); 679 if (variant->type == EWK_JS_VARIANT_STRING) 680 free(jsVariant->value.s); 681 else if (jsVariant->type == EWK_JS_VARIANT_OBJECT) 682 ewk_js_object_free(jsVariant->value.o); 683 free(jsVariant); 684 } 685 686 void ewk_js_variant_array_free(Ewk_JS_Variant* jsVariant, int count) 687 { 688 EINA_SAFETY_ON_NULL_RETURN(jsVariant); 689 689 for (int i = 0; i < count; i++) { 690 if ( var[i].type == EWK_JS_VARIANT_STRING)691 free( var[i].value.s);692 else if ( var[i].type == EWK_JS_VARIANT_OBJECT)693 ewk_js_object_free( var[i].value.o);694 } 695 free( var);690 if (jsVariant[i].type == EWK_JS_VARIANT_STRING) 691 free(jsVariant[i].value.s); 692 else if (jsVariant[i].type == EWK_JS_VARIANT_OBJECT) 693 ewk_js_object_free(jsVariant[i].value.o); 694 } 695 free(jsVariant); 696 696 } 697 697 698 698 #else 699 699 700 Eina_Hash* ewk_js_object_properties_get(const Ewk_JS_Object* obj)700 Eina_Hash* ewk_js_object_properties_get(const Ewk_JS_Object* jsObject) 701 701 { 702 702 return 0; 703 703 } 704 704 705 const char* ewk_js_object_name_get(const Ewk_JS_Object* obj)705 const char* ewk_js_object_name_get(const Ewk_JS_Object* jsObject) 706 706 { 707 707 return 0; 708 708 } 709 709 710 void ewk_js_variant_free(Ewk_JS_Variant* var)711 { 712 } 713 714 void ewk_js_variant_array_free(Ewk_JS_Variant* var, int count)715 { 716 } 717 718 Ewk_JS_Object* ewk_js_object_new(const Ewk_JS_Class_Meta* meta_cls)710 void ewk_js_variant_free(Ewk_JS_Variant* jsVariant) 711 { 712 } 713 714 void ewk_js_variant_array_free(Ewk_JS_Variant* jsVariant, int count) 715 { 716 } 717 718 Ewk_JS_Object* ewk_js_object_new(const Ewk_JS_Class_Meta* jsMetaClass) 719 719 { 720 720 return 0; 721 721 } 722 722 723 void ewk_js_object_free(Ewk_JS_Object* obj)724 { 725 } 726 727 Eina_Bool ewk_js_object_invoke(Ewk_JS_Object* obj, Ewk_JS_Variant* args, int arg_count, Ewk_JS_Variant* result)723 void ewk_js_object_free(Ewk_JS_Object* jsObject) 724 { 725 } 726 727 Eina_Bool ewk_js_object_invoke(Ewk_JS_Object* jsObject, Ewk_JS_Variant* args, int argCount, Ewk_JS_Variant* result) 728 728 { 729 729 return EINA_FALSE; 730 730 } 731 731 732 Ewk_JS_Object_Type ewk_js_object_type_get(Ewk_JS_Object* obj)732 Ewk_JS_Object_Type ewk_js_object_type_get(Ewk_JS_Object* jsObject) 733 733 { 734 734 return EWK_JS_OBJECT_INVALID; 735 735 } 736 736 737 void ewk_js_object_type_set(Ewk_JS_Object* obj, Ewk_JS_Object_Type type)737 void ewk_js_object_type_set(Ewk_JS_Object* jsObject, Ewk_JS_Object_Type type) 738 738 { 739 739 } -
trunk/Source/WebKit/efl/ewk/ewk_protocol_handler_soup.cpp
r95901 r97329 52 52 } 53 53 54 static void ewk_custom_protocol_handler_finalize(GObject* obj )54 static void ewk_custom_protocol_handler_finalize(GObject* object) 55 55 { 56 EwkProtocolHandlerPrivate* priv = G_TYPE_INSTANCE_GET_PRIVATE(obj , EWK_TYPE_CUSTOM_PROTOCOL_HANDLER,56 EwkProtocolHandlerPrivate* priv = G_TYPE_INSTANCE_GET_PRIVATE(object, EWK_TYPE_CUSTOM_PROTOCOL_HANDLER, 57 57 EwkProtocolHandlerPrivate); 58 58 if (priv) 59 59 free(priv->mime); 60 60 61 G_OBJECT_CLASS(ewk_custom_protocol_handler_parent_class)->finalize(obj );61 G_OBJECT_CLASS(ewk_custom_protocol_handler_parent_class)->finalize(object); 62 62 } 63 63 -
trunk/Source/WebKit/efl/ewk/ewk_settings.cpp
r96217 r97329 32 32 #include "KURL.h" 33 33 #include "MemoryCache.h" 34 // FIXME: Why is there a directory in this include? 35 #include "appcache/ApplicationCacheStorage.h" 34 36 #include "ewk_private.h" 35 37 … … 44 46 #include <wtf/text/CString.h> 45 47 #include <wtf/text/StringConcatenate.h> 46 47 // FIXME: Why is there a directory in this include?48 #include "appcache/ApplicationCacheStorage.h"49 48 50 49 static const char* _ewk_cache_directory_path = 0; … … 230 229 } 231 230 232 void ewk_settings_repaint_throttling_set(double deferred _repaint_delay, double initial_deferred_repaint_delay_during_loading, double max_deferred_repaint_delay_during_loading, double deferred_repaint_delay_increment_during_loading)233 { 234 WebCore::FrameView::setRepaintThrottlingDeferredRepaintDelay(deferred _repaint_delay);235 WebCore::FrameView::setRepaintThrottlingnInitialDeferredRepaintDelayDuringLoading(initial _deferred_repaint_delay_during_loading);236 WebCore::FrameView::setRepaintThrottlingMaxDeferredRepaintDelayDuringLoading(max _deferred_repaint_delay_during_loading);237 WebCore::FrameView::setRepaintThrottlingDeferredRepaintDelayIncrementDuringLoading(deferred _repaint_delay_increment_during_loading);231 void ewk_settings_repaint_throttling_set(double deferredRepaintDelay, double initialDeferredRepaintDelayDuringLoading, double maxDeferredRepaintDelayDuringLoading, double deferredRepaintDelayIncrementDuringLoading) 232 { 233 WebCore::FrameView::setRepaintThrottlingDeferredRepaintDelay(deferredRepaintDelay); 234 WebCore::FrameView::setRepaintThrottlingnInitialDeferredRepaintDelayDuringLoading(initialDeferredRepaintDelayDuringLoading); 235 WebCore::FrameView::setRepaintThrottlingMaxDeferredRepaintDelayDuringLoading(maxDeferredRepaintDelayDuringLoading); 236 WebCore::FrameView::setRepaintThrottlingDeferredRepaintDelayIncrementDuringLoading(deferredRepaintDelayIncrementDuringLoading); 238 237 } 239 238 -
trunk/Source/WebKit/efl/ewk/ewk_tiled_backing_store.cpp
r96495 r97329 47 47 struct _Ewk_Tiled_Backing_Store_Item { 48 48 EINA_INLIST; 49 Ewk_Tile *tile;49 Ewk_Tile* tile; 50 50 struct { 51 Evas_Coord x, y, w , h;51 Evas_Coord x, y, width, height; 52 52 } geometry; 53 53 Eina_Bool smooth_scale; … … 62 62 struct _Ewk_Tiled_Backing_Store_Data { 63 63 Evas_Object_Smart_Clipped_Data base; 64 Evas_Object *self;65 Evas_Object *contents_clipper;64 Evas_Object* self; 65 Evas_Object* contents_clipper; 66 66 struct { 67 Eina_Inlist **items;68 Evas_Coord x, y, w , h;67 Eina_Inlist** items; 68 Evas_Coord x, y, width, height; 69 69 long cols, rows; 70 70 struct { 71 Evas_Coord w , h;71 Evas_Coord width, height; 72 72 float zoom; 73 Eina_Bool zoom_weak_smooth_scale :1;73 Eina_Bool zoom_weak_smooth_scale : 1; 74 74 } tile; 75 75 struct { … … 81 81 Evas_Colorspace cspace; 82 82 struct { 83 Ewk_Tile_Matrix *matrix;83 Ewk_Tile_Matrix* matrix; 84 84 struct { 85 85 unsigned long col, row; … … 91 91 } model; 92 92 struct { 93 Eina_Bool (*cb)(void *data, Ewk_Tile *t, const Eina_Rectangle *area);94 void *data;95 Eina_Inlist *pre_render_requests;96 Ecore_Idler *idler;93 Eina_Bool (*cb)(void* data, Ewk_Tile* tile, const Eina_Rectangle* area); 94 void* data; 95 Eina_Inlist* pre_render_requests; 96 Ecore_Idler* idler; 97 97 Eina_Bool disabled; 98 Eina_Bool suspend :1;98 Eina_Bool suspend : 1; 99 99 } render; 100 100 struct { 101 void *(*pre_cb)(void *data, Evas_Object *o);102 void *pre_data;103 void *(*post_cb)(void *data, void *pre_data, Evas_Object *o);104 void *post_data;101 void* (*pre_cb)(void* data, Evas_Object* ewkTile); 102 void* pre_data; 103 void* (*post_cb)(void* data, void* pre_data, Evas_Object* ewkTile); 104 void* post_data; 105 105 } process; 106 106 struct { 107 Eina_Bool any :1;108 Eina_Bool pos :1;109 Eina_Bool size :1;110 Eina_Bool model :1;111 Eina_Bool offset :1;107 Eina_Bool any : 1; 108 Eina_Bool pos : 1; 109 Eina_Bool size : 1; 110 Eina_Bool model : 1; 111 Eina_Bool offset : 1; 112 112 } changed; 113 113 #ifdef DEBUG_MEM_LEAKS 114 Ecore_Event_Handler *sig_usr;114 Ecore_Event_Handler* sig_usr; 115 115 #endif 116 116 }; … … 126 126 } 127 127 128 static void _ewk_tiled_backing_store_fill_renderers(Ewk_Tiled_Backing_Store_Data *priv);129 static inline void _ewk_tiled_backing_store_view_dbg(const Ewk_Tiled_Backing_Store_Data *priv);130 static inline void _ewk_tiled_backing_store_changed(Ewk_Tiled_Backing_Store_Data *priv);131 132 static inline void _ewk_tiled_backing_store_updates_process(Ewk_Tiled_Backing_Store_Data *priv)133 { 134 void *data = 0;128 static void _ewk_tiled_backing_store_fill_renderers(Ewk_Tiled_Backing_Store_Data* priv); 129 static inline void _ewk_tiled_backing_store_view_dbg(const Ewk_Tiled_Backing_Store_Data* priv); 130 static inline void _ewk_tiled_backing_store_changed(Ewk_Tiled_Backing_Store_Data* priv); 131 132 static inline void _ewk_tiled_backing_store_updates_process(Ewk_Tiled_Backing_Store_Data* priv) 133 { 134 void* data = 0; 135 135 136 136 /* Do not process updates. Note that we still want to get updates requests … … 150 150 } 151 151 152 static int _ewk_tiled_backing_store_flush(void *data)152 static int _ewk_tiled_backing_store_flush(void* data) 153 153 { 154 154 Ewk_Tiled_Backing_Store_Data* priv = static_cast<Ewk_Tiled_Backing_Store_Data*>(data); 155 Ewk_Tile_Unused_Cache *tuc = ewk_tile_matrix_unused_cache_get(priv->model.matrix);155 Ewk_Tile_Unused_Cache* tuc = ewk_tile_matrix_unused_cache_get(priv->model.matrix); 156 156 157 157 if (tuc) { … … 164 164 } 165 165 166 static Ewk_Tile *_ewk_tiled_backing_store_tile_new(Ewk_Tiled_Backing_Store_Data *priv, unsigned long col, unsigned long row, float zoom)167 { 168 Ewk_Tile *t;169 Evas *evas = evas_object_evas_get(priv->self);166 static Ewk_Tile* _ewk_tiled_backing_store_tile_new(Ewk_Tiled_Backing_Store_Data* priv, unsigned long column, unsigned long row, float zoom) 167 { 168 Ewk_Tile* tile; 169 Evas* evas = evas_object_evas_get(priv->self); 170 170 if (!evas) { 171 171 CRITICAL("evas_object_evas_get failed!"); … … 173 173 } 174 174 175 t = ewk_tile_matrix_tile_new176 (priv->model.matrix, evas, col, row, zoom);177 178 if (!t ) {175 tile = ewk_tile_matrix_tile_new 176 (priv->model.matrix, evas, column, row, zoom); 177 178 if (!tile) { 179 179 CRITICAL("ewk_tile_matrix_tile_new failed!"); 180 180 return 0; 181 181 } 182 182 183 return t ;184 } 185 186 static void _ewk_tiled_backing_store_item_move(Ewk_Tiled_Backing_Store_Item *it, Evas_Coord x, Evas_Coord y)187 { 188 it ->geometry.x = x;189 it ->geometry.y = y;190 191 if (it ->tile)192 evas_object_move(it ->tile->image, x, y);193 } 194 195 static void _ewk_tiled_backing_store_item_resize(Ewk_Tiled_Backing_Store_Item *it, Evas_Coord w, Evas_Coord h)196 { 197 it ->geometry.w = w;198 it ->geometry.h = h;199 200 if (it ->tile) {201 evas_object_resize(it ->tile->image, w, h);202 evas_object_image_fill_set(it ->tile->image, 0, 0, w, h);203 } 204 } 205 206 static void _ewk_tiled_backing_store_tile_associate(Ewk_Tiled_Backing_Store_Data *priv, Ewk_Tile *t, Ewk_Tiled_Backing_Store_Item *it)207 { 208 if (it ->tile)209 CRITICAL("it->tile=%p, but it should be 0!", it ->tile);210 it ->tile = t;211 evas_object_move(it ->tile->image, it->geometry.x, it->geometry.y);212 evas_object_resize(it ->tile->image, it->geometry.w, it->geometry.h);183 return tile; 184 } 185 186 static void _ewk_tiled_backing_store_item_move(Ewk_Tiled_Backing_Store_Item* item, Evas_Coord x, Evas_Coord y) 187 { 188 item->geometry.x = x; 189 item->geometry.y = y; 190 191 if (item->tile) 192 evas_object_move(item->tile->image, x, y); 193 } 194 195 static void _ewk_tiled_backing_store_item_resize(Ewk_Tiled_Backing_Store_Item* item, Evas_Coord width, Evas_Coord height) 196 { 197 item->geometry.width = width; 198 item->geometry.height = height; 199 200 if (item->tile) { 201 evas_object_resize(item->tile->image, width, height); 202 evas_object_image_fill_set(item->tile->image, 0, 0, width, height); 203 } 204 } 205 206 static void _ewk_tiled_backing_store_tile_associate(Ewk_Tiled_Backing_Store_Data* priv, Ewk_Tile* tile, Ewk_Tiled_Backing_Store_Item* item) 207 { 208 if (item->tile) 209 CRITICAL("it->tile=%p, but it should be 0!", item->tile); 210 item->tile = tile; 211 evas_object_move(item->tile->image, item->geometry.x, item->geometry.y); 212 evas_object_resize(item->tile->image, item->geometry.width, item->geometry.height); 213 213 evas_object_image_fill_set 214 (it ->tile->image, 0, 0, it->geometry.w, it->geometry.h);215 evas_object_image_smooth_scale_set(it ->tile->image, it->smooth_scale);216 217 if (!ewk_tile_visible_get(t ))218 evas_object_smart_member_add(t ->image, priv->self);219 220 ewk_tile_show(t );221 } 222 223 static void _ewk_tiled_backing_store_tile_dissociate(Ewk_Tiled_Backing_Store_Data *priv, Ewk_Tiled_Backing_Store_Item *it, double last_used)224 { 225 Ewk_Tile_Unused_Cache *tuc;226 ewk_tile_hide(it ->tile);227 if (!ewk_tile_visible_get(it ->tile))228 evas_object_smart_member_del(it ->tile->image);229 ewk_tile_matrix_tile_put(priv->model.matrix, it ->tile, last_used);214 (item->tile->image, 0, 0, item->geometry.width, item->geometry.height); 215 evas_object_image_smooth_scale_set(item->tile->image, item->smooth_scale); 216 217 if (!ewk_tile_visible_get(tile)) 218 evas_object_smart_member_add(tile->image, priv->self); 219 220 ewk_tile_show(tile); 221 } 222 223 static void _ewk_tiled_backing_store_tile_dissociate(Ewk_Tiled_Backing_Store_Data* priv, Ewk_Tiled_Backing_Store_Item* item, double lastUsed) 224 { 225 Ewk_Tile_Unused_Cache* tuc; 226 ewk_tile_hide(item->tile); 227 if (!ewk_tile_visible_get(item->tile)) 228 evas_object_smart_member_del(item->tile->image); 229 ewk_tile_matrix_tile_put(priv->model.matrix, item->tile, lastUsed); 230 230 tuc = ewk_tile_matrix_unused_cache_get(priv->model.matrix); 231 231 ewk_tile_unused_cache_auto_flush(tuc); 232 232 233 it ->tile = 0;234 } 235 236 static void _ewk_tiled_backing_store_tile_dissociate_all(Ewk_Tiled_Backing_Store_Data *priv)237 { 238 Eina_Inlist *it;239 Ewk_Tiled_Backing_Store_Item *item;233 item->tile = 0; 234 } 235 236 static void _ewk_tiled_backing_store_tile_dissociate_all(Ewk_Tiled_Backing_Store_Data* priv) 237 { 238 Eina_Inlist* it; 239 Ewk_Tiled_Backing_Store_Item* item; 240 240 int i; 241 241 double last_used = ecore_loop_time_get(); … … 249 249 } 250 250 251 static inline Eina_Bool _ewk_tiled_backing_store_pre_render_request_add(Ewk_Tiled_Backing_Store_Data *priv, unsigned long col, unsigned long row, float zoom, Ewk_Tiled_Backing_Store_Pre_Render_Priority priority)252 { 253 Ewk_Tiled_Backing_Store_Pre_Render_Request *r;251 static inline Eina_Bool _ewk_tiled_backing_store_pre_render_request_add(Ewk_Tiled_Backing_Store_Data* priv, unsigned long column, unsigned long row, float zoom, Ewk_Tiled_Backing_Store_Pre_Render_Priority priority) 252 { 253 Ewk_Tiled_Backing_Store_Pre_Render_Request* r; 254 254 255 255 r = static_cast<Ewk_Tiled_Backing_Store_Pre_Render_Request*>(malloc(sizeof(*r))); … … 259 259 if (priority == PRE_RENDER_PRIORITY_HIGH) 260 260 priv->render.pre_render_requests = eina_inlist_prepend 261 (priv->render.pre_render_requests, EINA_INLIST_GET(r));261 (priv->render.pre_render_requests, EINA_INLIST_GET(r)); 262 262 else 263 263 priv->render.pre_render_requests = eina_inlist_append 264 (priv->render.pre_render_requests, EINA_INLIST_GET(r));265 266 r->col = col ;264 (priv->render.pre_render_requests, EINA_INLIST_GET(r)); 265 266 r->col = column; 267 267 r->row = row; 268 268 r->zoom = zoom; … … 271 271 } 272 272 273 static inline void _ewk_tiled_backing_store_pre_render_request_del(Ewk_Tiled_Backing_Store_Data *priv, Ewk_Tiled_Backing_Store_Pre_Render_Request *r)273 static inline void _ewk_tiled_backing_store_pre_render_request_del(Ewk_Tiled_Backing_Store_Data* priv, Ewk_Tiled_Backing_Store_Pre_Render_Request* request) 274 274 { 275 275 priv->render.pre_render_requests = eina_inlist_remove 276 (priv->render.pre_render_requests, EINA_INLIST_GET(r));277 free(r );278 } 279 280 static inline Ewk_Tiled_Backing_Store_Pre_Render_Request *_ewk_tiled_backing_store_pre_render_request_first(const Ewk_Tiled_Backing_Store_Data *priv)276 (priv->render.pre_render_requests, EINA_INLIST_GET(request)); 277 free(request); 278 } 279 280 static inline Ewk_Tiled_Backing_Store_Pre_Render_Request* _ewk_tiled_backing_store_pre_render_request_first(const Ewk_Tiled_Backing_Store_Data* priv) 281 281 { 282 282 return EINA_INLIST_CONTAINER_GET( 283 priv->render.pre_render_requests,284 Ewk_Tiled_Backing_Store_Pre_Render_Request);285 } 286 287 static void _ewk_tiled_backing_store_pre_render_request_flush(Ewk_Tiled_Backing_Store_Data *priv)288 { 289 Eina_Inlist **pl = &priv->render.pre_render_requests;283 priv->render.pre_render_requests, 284 Ewk_Tiled_Backing_Store_Pre_Render_Request); 285 } 286 287 static void _ewk_tiled_backing_store_pre_render_request_flush(Ewk_Tiled_Backing_Store_Data* priv) 288 { 289 Eina_Inlist** pl = &priv->render.pre_render_requests; 290 290 while (*pl) { 291 Ewk_Tiled_Backing_Store_Pre_Render_Request *r;291 Ewk_Tiled_Backing_Store_Pre_Render_Request* r; 292 292 r = _ewk_tiled_backing_store_pre_render_request_first(priv); 293 293 *pl = eina_inlist_remove(*pl, *pl); … … 296 296 } 297 297 298 static void _ewk_tiled_backing_store_pre_render_request_clear(Ewk_Tiled_Backing_Store_Data *priv)299 { 300 Eina_Inlist **pl = &priv->render.pre_render_requests;301 Eina_Inlist *iter = *pl, *tmp;298 static void _ewk_tiled_backing_store_pre_render_request_clear(Ewk_Tiled_Backing_Store_Data* priv) 299 { 300 Eina_Inlist** pl = &priv->render.pre_render_requests; 301 Eina_Inlist* iter = *pl, * tmp; 302 302 while (iter) { 303 Ewk_Tiled_Backing_Store_Pre_Render_Request *r =303 Ewk_Tiled_Backing_Store_Pre_Render_Request* r = 304 304 EINA_INLIST_CONTAINER_GET( 305 305 iter, Ewk_Tiled_Backing_Store_Pre_Render_Request); … … 312 312 313 313 /* assumes priv->process.pre_cb was called if required! */ 314 static void _ewk_tiled_backing_store_pre_render_request_process_single(Ewk_Tiled_Backing_Store_Data *priv)315 { 316 Ewk_Tiled_Backing_Store_Pre_Render_Request *req;314 static void _ewk_tiled_backing_store_pre_render_request_process_single(Ewk_Tiled_Backing_Store_Data* priv) 315 { 316 Ewk_Tiled_Backing_Store_Pre_Render_Request* req; 317 317 Eina_Rectangle area; 318 Ewk_Tile_Matrix *tm = priv->model.matrix;319 Ewk_Tile *t;320 Ewk_Tile_Unused_Cache *tuc;318 Ewk_Tile_Matrix* tm = priv->model.matrix; 319 Ewk_Tile* tile; 320 Ewk_Tile_Unused_Cache* tuc; 321 321 unsigned long col, row; 322 322 float zoom; … … 336 336 } 337 337 338 t = _ewk_tiled_backing_store_tile_new(priv, col, row, zoom);339 if (!t )338 tile = _ewk_tiled_backing_store_tile_new(priv, col, row, zoom); 339 if (!tile) 340 340 goto end; 341 341 342 342 area.x = 0; 343 343 area.y = 0; 344 area.w = priv->view.tile.w ;345 area.h = priv->view.tile.h ;346 347 priv->render.cb(priv->render.data, t , &area);344 area.w = priv->view.tile.width; 345 area.h = priv->view.tile.height; 346 347 priv->render.cb(priv->render.data, tile, &area); 348 348 evas_object_image_data_update_add( 349 t ->image,349 tile->image, 350 350 area.x, area.y, area.w, area.h); 351 ewk_tile_matrix_tile_updates_clear(tm, t );352 353 ewk_tile_matrix_tile_put(tm, t , last_used);351 ewk_tile_matrix_tile_updates_clear(tm, tile); 352 353 ewk_tile_matrix_tile_put(tm, tile, last_used); 354 354 355 355 end: … … 359 359 } 360 360 361 static Eina_Bool _ewk_tiled_backing_store_item_process_idler_cb(void *data)361 static Eina_Bool _ewk_tiled_backing_store_item_process_idler_cb(void* data) 362 362 { 363 363 Ewk_Tiled_Backing_Store_Data* priv = static_cast<Ewk_Tiled_Backing_Store_Data*>(data); … … 379 379 } 380 380 381 static inline void _ewk_tiled_backing_store_item_process_idler_stop(Ewk_Tiled_Backing_Store_Data *priv)381 static inline void _ewk_tiled_backing_store_item_process_idler_stop(Ewk_Tiled_Backing_Store_Data* priv) 382 382 { 383 383 if (!priv->render.idler) … … 388 388 } 389 389 390 static inline void _ewk_tiled_backing_store_item_process_idler_start(Ewk_Tiled_Backing_Store_Data *priv)390 static inline void _ewk_tiled_backing_store_item_process_idler_start(Ewk_Tiled_Backing_Store_Data* priv) 391 391 { 392 392 if (priv->render.idler) … … 396 396 } 397 397 398 static Eina_Bool _ewk_tiled_backing_store_disable_render(Ewk_Tiled_Backing_Store_Data *priv)398 static Eina_Bool _ewk_tiled_backing_store_disable_render(Ewk_Tiled_Backing_Store_Data* priv) 399 399 { 400 400 if (priv->render.suspend) … … 406 406 } 407 407 408 static Eina_Bool _ewk_tiled_backing_store_enable_render(Ewk_Tiled_Backing_Store_Data *priv)408 static Eina_Bool _ewk_tiled_backing_store_enable_render(Ewk_Tiled_Backing_Store_Data* priv) 409 409 { 410 410 if (!priv->render.suspend) … … 419 419 } 420 420 421 static inline Eina_Bool _ewk_tiled_backing_store_item_fill(Ewk_Tiled_Backing_Store_Data *priv, Ewk_Tiled_Backing_Store_Item *it, unsigned long col, unsigned long row)422 { 423 unsigned long m_col = priv->model.base.col + col ;421 static inline Eina_Bool _ewk_tiled_backing_store_item_fill(Ewk_Tiled_Backing_Store_Data* priv, Ewk_Tiled_Backing_Store_Item* item, unsigned long column, unsigned long row) 422 { 423 unsigned long m_col = priv->model.base.col + column; 424 424 unsigned long m_row = priv->model.base.row + row; 425 425 double last_used = ecore_loop_time_get(); 426 426 427 427 if (m_col >= priv->model.cur.cols || m_row >= priv->model.cur.rows) { 428 if (it ->tile)429 _ewk_tiled_backing_store_tile_dissociate(priv, it , last_used);428 if (item->tile) 429 _ewk_tiled_backing_store_tile_dissociate(priv, item, last_used); 430 430 } else { 431 Ewk_Tile *t;431 Ewk_Tile* tile; 432 432 const float zoom = priv->view.tile.zoom; 433 433 434 if (it ->tile) {435 Ewk_Tile *old = it->tile;434 if (item->tile) { 435 Ewk_Tile* old = item->tile; 436 436 if (old->row != m_row || old->col != m_col || old->zoom != zoom) 437 _ewk_tiled_backing_store_tile_dissociate(priv, it , last_used);437 _ewk_tiled_backing_store_tile_dissociate(priv, item, last_used); 438 438 else if (old->row == m_row && old->col == m_col && old->zoom == zoom) 439 439 goto end; 440 440 } 441 441 442 t = ewk_tile_matrix_tile_exact_get(priv->model.matrix, m_col, m_row, zoom);443 444 if (!t ) {442 tile = ewk_tile_matrix_tile_exact_get(priv->model.matrix, m_col, m_row, zoom); 443 444 if (!tile) { 445 445 /* NOTE: it never returns 0 if it->tile was set! */ 446 if (it ->tile) {447 CRITICAL("it->tile=%p, but it should be 0!", it ->tile);448 _ewk_tiled_backing_store_tile_dissociate(priv, it ,446 if (item->tile) { 447 CRITICAL("it->tile=%p, but it should be 0!", item->tile); 448 _ewk_tiled_backing_store_tile_dissociate(priv, item, 449 449 last_used); 450 450 } … … 452 452 /* Do not add new requests to the render queue */ 453 453 if (!priv->render.suspend) { 454 t = _ewk_tiled_backing_store_tile_new(priv, m_col, m_row, zoom);455 if (!t )454 tile = _ewk_tiled_backing_store_tile_new(priv, m_col, m_row, zoom); 455 if (!tile) 456 456 return EINA_FALSE; 457 _ewk_tiled_backing_store_tile_associate(priv, t , it);457 _ewk_tiled_backing_store_tile_associate(priv, tile, item); 458 458 } 459 } else if (t != it->tile) {460 if (it ->tile)459 } else if (tile != item->tile) { 460 if (item->tile) 461 461 _ewk_tiled_backing_store_tile_dissociate(priv, 462 it, last_used);463 _ewk_tiled_backing_store_tile_associate(priv, t , it);462 item, last_used); 463 _ewk_tiled_backing_store_tile_associate(priv, tile, item); 464 464 } 465 465 466 466 end: 467 467 468 468 return EINA_TRUE; … … 472 472 } 473 473 474 static Ewk_Tiled_Backing_Store_Item *_ewk_tiled_backing_store_item_add(Ewk_Tiled_Backing_Store_Data *priv, unsigned long col, unsigned long row)475 { 476 Ewk_Tiled_Backing_Store_Item *it;474 static Ewk_Tiled_Backing_Store_Item* _ewk_tiled_backing_store_item_add(Ewk_Tiled_Backing_Store_Data* priv, unsigned long column, unsigned long row) 475 { 476 Ewk_Tiled_Backing_Store_Item* it; 477 477 Evas_Coord x, y, tw, th; 478 478 … … 483 483 return 0; 484 484 485 tw = priv->view.tile.w ;486 th = priv->view.tile.h ;487 x = priv->view.offset.base.x + priv->view.x + tw *col ;485 tw = priv->view.tile.width; 486 th = priv->view.tile.height; 487 x = priv->view.offset.base.x + priv->view.x + tw *column; 488 488 y = priv->view.offset.base.y + priv->view.y + th *row; 489 489 … … 493 493 _ewk_tiled_backing_store_item_move(it, x, y); 494 494 _ewk_tiled_backing_store_item_resize(it, tw, th); 495 if (!_ewk_tiled_backing_store_item_fill(priv, it, col , row)) {495 if (!_ewk_tiled_backing_store_item_fill(priv, it, column, row)) { 496 496 free(it); 497 497 return 0; … … 501 501 } 502 502 503 static void _ewk_tiled_backing_store_item_del(Ewk_Tiled_Backing_Store_Data *priv, Ewk_Tiled_Backing_Store_Item *it)504 { 505 if (it ->tile) {503 static void _ewk_tiled_backing_store_item_del(Ewk_Tiled_Backing_Store_Data* priv, Ewk_Tiled_Backing_Store_Item* item) 504 { 505 if (item->tile) { 506 506 double last_used = ecore_loop_time_get(); 507 _ewk_tiled_backing_store_tile_dissociate(priv, it , last_used);508 } 509 510 free(it );511 } 512 513 static void _ewk_tiled_backing_store_item_smooth_scale_set(Ewk_Tiled_Backing_Store_Item *it, Eina_Bool smooth_scale)514 { 515 if (it ->smooth_scale == smooth_scale)516 return; 517 518 if (it ->tile)519 evas_object_image_smooth_scale_set(it ->tile->image, smooth_scale);520 } 521 522 static inline void _ewk_tiled_backing_store_changed(Ewk_Tiled_Backing_Store_Data *priv)507 _ewk_tiled_backing_store_tile_dissociate(priv, item, last_used); 508 } 509 510 free(item); 511 } 512 513 static void _ewk_tiled_backing_store_item_smooth_scale_set(Ewk_Tiled_Backing_Store_Item* item, Eina_Bool smoothScale) 514 { 515 if (item->smooth_scale == smoothScale) 516 return; 517 518 if (item->tile) 519 evas_object_image_smooth_scale_set(item->tile->image, smoothScale); 520 } 521 522 static inline void _ewk_tiled_backing_store_changed(Ewk_Tiled_Backing_Store_Data* priv) 523 523 { 524 524 if (priv->changed.any) … … 528 528 } 529 529 530 static void _ewk_tiled_backing_store_view_cols_end_del(Ewk_Tiled_Backing_Store_Data *priv, Eina_Inlist **p_row, unsigned int count)531 { 532 Eina_Inlist *n;530 static void _ewk_tiled_backing_store_view_cols_end_del(Ewk_Tiled_Backing_Store_Data* priv, Eina_Inlist** p_row, unsigned int count) 531 { 532 Eina_Inlist* n; 533 533 unsigned int i; 534 534 … … 539 539 540 540 for (i = 0; i < count; i++) { 541 Ewk_Tiled_Backing_Store_Item *it;541 Ewk_Tiled_Backing_Store_Item* it; 542 542 it = EINA_INLIST_CONTAINER_GET(n, Ewk_Tiled_Backing_Store_Item); 543 543 n = n->prev; … … 547 547 } 548 548 549 static Eina_Bool _ewk_tiled_backing_store_view_cols_end_add(Ewk_Tiled_Backing_Store_Data *priv, Eina_Inlist **p_row, unsigned int base_col, unsigned int count)549 static Eina_Bool _ewk_tiled_backing_store_view_cols_end_add(Ewk_Tiled_Backing_Store_Data* priv, Eina_Inlist** p_row, unsigned int base_column, unsigned int count) 550 550 { 551 551 unsigned int i, r = p_row - priv->view.items; 552 552 553 for (i = 0; i < count; i++, base_col ++) {554 Ewk_Tiled_Backing_Store_Item *it;555 556 it = _ewk_tiled_backing_store_item_add(priv, base_col , r);553 for (i = 0; i < count; i++, base_column++) { 554 Ewk_Tiled_Backing_Store_Item* it; 555 556 it = _ewk_tiled_backing_store_item_add(priv, base_column, r); 557 557 if (!it) { 558 558 CRITICAL("failed to add column %u of %u in row %u.", i, count, r); … … 566 566 } 567 567 568 static void _ewk_tiled_backing_store_view_row_del(Ewk_Tiled_Backing_Store_Data *priv, Eina_Inlist *row)568 static void _ewk_tiled_backing_store_view_row_del(Ewk_Tiled_Backing_Store_Data* priv, Eina_Inlist* row) 569 569 { 570 570 while (row) { 571 Ewk_Tiled_Backing_Store_Item *it;571 Ewk_Tiled_Backing_Store_Item* it; 572 572 it = EINA_INLIST_CONTAINER_GET(row, Ewk_Tiled_Backing_Store_Item); 573 573 row = row->next; … … 576 576 } 577 577 578 static void _ewk_tiled_backing_store_view_rows_range_del(Ewk_Tiled_Backing_Store_Data *priv, Eina_Inlist **start, Eina_Inlist **end)578 static void _ewk_tiled_backing_store_view_rows_range_del(Ewk_Tiled_Backing_Store_Data* priv, Eina_Inlist** start, Eina_Inlist** end) 579 579 { 580 580 for (; start < end; start++) { … … 584 584 } 585 585 586 static void _ewk_tiled_backing_store_view_rows_all_del(Ewk_Tiled_Backing_Store_Data *priv)587 { 588 Eina_Inlist **start;589 Eina_Inlist **end;586 static void _ewk_tiled_backing_store_view_rows_all_del(Ewk_Tiled_Backing_Store_Data* priv) 587 { 588 Eina_Inlist** start; 589 Eina_Inlist** end; 590 590 591 591 start = priv->view.items; … … 599 599 } 600 600 601 static void _ewk_tiled_backing_store_render(void *data, Ewk_Tile *t, const Eina_Rectangle *area)601 static void _ewk_tiled_backing_store_render(void* data, Ewk_Tile* tile, const Eina_Rectangle* area) 602 602 { 603 603 Ewk_Tiled_Backing_Store_Data* priv = static_cast<Ewk_Tiled_Backing_Store_Data*>(data); 604 604 605 605 INF("TODO %p (visible? %d) [%lu,%lu] %d,%d + %dx%d", 606 t , t->visible, t->col, t->row, area->x, area->y, area->w, area->h);607 608 if (!t ->visible)609 return; 610 611 if (priv->view.tile.w != t->w || priv->view.tile.h != t->h)606 tile, tile->visible, tile->col, tile->row, area->x, area->y, area->w, area->h); 607 608 if (!tile->visible) 609 return; 610 611 if (priv->view.tile.width != tile->width || priv->view.tile.height != tile->height) 612 612 return; // todo: remove me later, don't even flag as dirty! 613 613 614 614 EINA_SAFETY_ON_NULL_RETURN(priv->render.cb); 615 if (!priv->render.cb(priv->render.data, t , area))616 return; 617 618 evas_object_image_data_update_add(t ->image, area->x, area->y, area->w, area->h);619 } 620 621 static inline void _ewk_tiled_backing_store_model_matrix_create(Ewk_Tiled_Backing_Store_Data *priv, Ewk_Tile_Unused_Cache *tuc)615 if (!priv->render.cb(priv->render.data, tile, area)) 616 return; 617 618 evas_object_image_data_update_add(tile->image, area->x, area->y, area->w, area->h); 619 } 620 621 static inline void _ewk_tiled_backing_store_model_matrix_create(Ewk_Tiled_Backing_Store_Data* priv, Ewk_Tile_Unused_Cache* tileUnusedCache) 622 622 { 623 623 if (priv->model.matrix) { … … 630 630 } 631 631 632 priv->model.matrix = ewk_tile_matrix_new(t uc, priv->model.cur.cols, priv->model.cur.rows, priv->cspace, _ewk_tiled_backing_store_render, priv);633 } 634 635 static void _ewk_tiled_backing_store_smart_member_del(Evas_Object *o, Evas_Object *member)636 { 637 PRIV_DATA_GET_OR_RETURN( o, priv);632 priv->model.matrix = ewk_tile_matrix_new(tileUnusedCache, priv->model.cur.cols, priv->model.cur.rows, priv->cspace, _ewk_tiled_backing_store_render, priv); 633 } 634 635 static void _ewk_tiled_backing_store_smart_member_del(Evas_Object* ewkTile, Evas_Object* member) 636 { 637 PRIV_DATA_GET_OR_RETURN(ewkTile, priv); 638 638 if (!priv->contents_clipper) 639 639 return; … … 643 643 } 644 644 645 static void _ewk_tiled_backing_store_smart_member_add(Evas_Object *o, Evas_Object *member)646 { 647 PRIV_DATA_GET_OR_RETURN( o, priv);645 static void _ewk_tiled_backing_store_smart_member_add(Evas_Object* ewkTile, Evas_Object* member) 646 { 647 PRIV_DATA_GET_OR_RETURN(ewkTile, priv); 648 648 if (!priv->contents_clipper) 649 649 return; 650 650 evas_object_clip_set(member, priv->contents_clipper); 651 if (evas_object_visible_get( o))651 if (evas_object_visible_get(ewkTile)) 652 652 evas_object_show(priv->contents_clipper); 653 653 } 654 654 655 655 #ifdef DEBUG_MEM_LEAKS 656 static void _ewk_tiled_backing_store_mem_dbg(Ewk_Tiled_Backing_Store_Data *priv)656 static void _ewk_tiled_backing_store_mem_dbg(Ewk_Tiled_Backing_Store_Data* priv) 657 657 { 658 658 static int run = 0; … … 671 671 } 672 672 673 static Eina_Bool _ewk_tiled_backing_store_sig_usr(void *data, int type, void *event)674 { 675 Ecore_Event_Signal_User *sig = (Ecore_Event_Signal_User*)event;676 Ewk_Tiled_Backing_Store_Data *priv = (Ewk_Tiled_Backing_Store_Data*)data;673 static Eina_Bool _ewk_tiled_backing_store_sig_usr(void* data, int type, void* event) 674 { 675 Ecore_Event_Signal_User* sig = (Ecore_Event_Signal_User*)event; 676 Ewk_Tiled_Backing_Store_Data* priv = (Ewk_Tiled_Backing_Store_Data*)data; 677 677 678 678 if (sig->number == 2) { 679 Ewk_Tile_Unused_Cache *tuc;679 Ewk_Tile_Unused_Cache* tuc; 680 680 tuc = ewk_tile_matrix_unused_cache_get(priv->model.matrix); 681 681 ewk_tile_unused_cache_auto_flush(tuc); … … 688 688 #endif 689 689 690 static void _ewk_tiled_backing_store_smart_add(Evas_Object *o)691 { 692 Ewk_Tiled_Backing_Store_Data *priv;693 694 DBG("o=%p", o);690 static void _ewk_tiled_backing_store_smart_add(Evas_Object* ewkTile) 691 { 692 Ewk_Tiled_Backing_Store_Data* priv; 693 694 DBG("o=%p", ewkTile); 695 695 696 696 priv = static_cast<Ewk_Tiled_Backing_Store_Data*>(calloc(1, sizeof(*priv))); … … 698 698 return; 699 699 700 priv->self = o;700 priv->self = ewkTile; 701 701 priv->view.tile.zoom = 1.0; 702 priv->view.tile.w = DEFAULT_TILE_W;703 priv->view.tile.h = DEFAULT_TILE_H;702 priv->view.tile.width = DEFAULT_TILE_W; 703 priv->view.tile.height = DEFAULT_TILE_H; 704 704 priv->view.offset.cur.x = 0; 705 705 priv->view.offset.cur.y = 0; … … 720 720 priv->cspace = EVAS_COLORSPACE_ARGB8888; // TODO: detect it. 721 721 722 evas_object_smart_data_set( o, priv);723 _parent_sc.add( o);722 evas_object_smart_data_set(ewkTile, priv); 723 _parent_sc.add(ewkTile); 724 724 725 725 priv->contents_clipper = evas_object_rectangle_add( 726 evas_object_evas_get( o));726 evas_object_evas_get(ewkTile)); 727 727 evas_object_move(priv->contents_clipper, 0, 0); 728 728 evas_object_resize(priv->contents_clipper, … … 730 730 evas_object_color_set(priv->contents_clipper, 255, 255, 255, 255); 731 731 evas_object_show(priv->contents_clipper); 732 evas_object_smart_member_add(priv->contents_clipper, o);732 evas_object_smart_member_add(priv->contents_clipper, ewkTile); 733 733 734 734 _ewk_tiled_backing_store_model_matrix_create(priv, 0); … … 739 739 #ifdef DEBUG_MEM_LEAKS 740 740 priv->sig_usr = ecore_event_handler_add 741 (ECORE_EVENT_SIGNAL_USER, _ewk_tiled_backing_store_sig_usr, priv);741 (ECORE_EVENT_SIGNAL_USER, _ewk_tiled_backing_store_sig_usr, priv); 742 742 #endif 743 743 } 744 744 745 static void _ewk_tiled_backing_store_smart_del(Evas_Object *o)746 { 747 PRIV_DATA_GET_OR_RETURN( o, priv);748 DBG("o=%p", o);749 Ewk_Tile_Unused_Cache *tuc;745 static void _ewk_tiled_backing_store_smart_del(Evas_Object* ewkTile) 746 { 747 PRIV_DATA_GET_OR_RETURN(ewkTile, priv); 748 DBG("o=%p", ewkTile); 749 Ewk_Tile_Unused_Cache* tuc; 750 750 751 751 tuc = ewk_tile_matrix_unused_cache_get(priv->model.matrix); … … 768 768 evas_object_del(priv->contents_clipper); 769 769 770 _parent_sc.del( o);770 _parent_sc.del(ewkTile); 771 771 772 772 #ifdef DEBUG_MEM_LEAKS … … 776 776 } 777 777 778 static void _ewk_tiled_backing_store_smart_move(Evas_Object *o, Evas_Coord x, Evas_Coord y)779 { 780 DBG("o=%p, new pos: %dx%d", o, x, y);781 782 PRIV_DATA_GET_OR_RETURN( o, priv);778 static void _ewk_tiled_backing_store_smart_move(Evas_Object* ewkTile, Evas_Coord x, Evas_Coord y) 779 { 780 DBG("o=%p, new pos: %dx%d", ewkTile, x, y); 781 782 PRIV_DATA_GET_OR_RETURN(ewkTile, priv); 783 783 784 784 if (priv->changed.pos) … … 792 792 } 793 793 794 static void _ewk_tiled_backing_store_smart_resize(Evas_Object *o, Evas_Coord w, Evas_Coord h)795 { 796 DBG("o=%p, new size: %dx%d", o, w, h);797 798 PRIV_DATA_GET_OR_RETURN( o, priv);794 static void _ewk_tiled_backing_store_smart_resize(Evas_Object* ewkTile, Evas_Coord width, Evas_Coord height) 795 { 796 DBG("o=%p, new size: %dx%d", ewkTile, width, height); 797 798 PRIV_DATA_GET_OR_RETURN(ewkTile, priv); 799 799 800 800 if (priv->changed.size) 801 801 return; 802 802 803 if (priv->view.w == w && priv->view.h == h)803 if (priv->view.width == width && priv->view.height == height) 804 804 return; 805 805 … … 808 808 } 809 809 810 static void _ewk_tiled_backing_store_recalc_renderers(Ewk_Tiled_Backing_Store_Data *priv, Evas_Coord w, Evas_Coord h, Evas_Coord tw, Evas_Coord th)810 static void _ewk_tiled_backing_store_recalc_renderers(Ewk_Tiled_Backing_Store_Data* priv, Evas_Coord width, Evas_Coord height, Evas_Coord tileWidth, Evas_Coord tileHeight) 811 811 { 812 812 long cols, rows, old_rows, old_cols; 813 INF("o=%p, new size: %dx%d", priv->self, w , h);814 815 cols = 1 + (int)ceil((float)w / (float)tw);816 rows = 1 + (int)ceil((float)h / (float)th);813 INF("o=%p, new size: %dx%d", priv->self, width, height); 814 815 cols = 1 + static_cast<int>(ceil(static_cast<float>(width / tileWidth))); 816 rows = 1 + static_cast<int>(ceil(static_cast<float>(height / tileHeight))); 817 817 818 818 INF("o=%p new grid size cols: %ld, rows: %ld, was %ld, %ld", … … 826 826 827 827 if (rows < old_rows) { 828 Eina_Inlist **start, **end;828 Eina_Inlist** start, **end; 829 829 start = priv->view.items + rows; 830 830 end = priv->view.items + old_rows; … … 840 840 priv->view.cols = cols; 841 841 if (rows > old_rows) { 842 Eina_Inlist **start, **end; 843 start = priv->view.items + old_rows; 844 end = priv->view.items + rows; 842 Eina_Inlist** start = priv->view.items + old_rows; 843 Eina_Inlist** end = priv->view.items + rows; 845 844 for (; start < end; start++) { 846 Eina_Bool r;847 845 *start = 0; 848 r = _ewk_tiled_backing_store_view_cols_end_add 849 (priv, start, 0, cols); 846 Eina_Bool r = _ewk_tiled_backing_store_view_cols_end_add(priv, start, 0, cols); 850 847 if (!r) { 851 848 CRITICAL("failed to allocate %ld columns", cols); 852 _ewk_tiled_backing_store_view_rows_range_del 853 (priv, priv->view.items + old_rows, start); 849 _ewk_tiled_backing_store_view_rows_range_del(priv, priv->view.items + old_rows, start); 854 850 priv->view.rows = old_rows; 855 851 return; … … 859 855 860 856 if (cols != old_cols) { 861 Eina_Inlist **start, **end;862 857 int todo = cols - old_cols; 863 start = priv->view.items;864 end = start + std::min(old_rows, rows);858 Eina_Inlist** start = priv->view.items; 859 Eina_Inlist** end = start + std::min(old_rows, rows); 865 860 if (todo > 0) { 866 861 for (; start < end; start++) { 867 Eina_Bool r; 868 r = _ewk_tiled_backing_store_view_cols_end_add 869 (priv, start, old_cols, todo); 862 Eina_Bool r = _ewk_tiled_backing_store_view_cols_end_add(priv, start, old_cols, todo); 870 863 if (!r) { 871 864 CRITICAL("failed to allocate %d columns!", todo); … … 892 885 } 893 886 894 static void _ewk_tiled_backing_store_smart_calculate_size(Ewk_Tiled_Backing_Store_Data *priv, Evas_Coord w, Evas_Coord h)895 { 896 evas_object_resize(priv->base.clipper, w , h);897 898 priv->view.w = w;899 priv->view.h = h;887 static void _ewk_tiled_backing_store_smart_calculate_size(Ewk_Tiled_Backing_Store_Data* priv, Evas_Coord width, Evas_Coord height) 888 { 889 evas_object_resize(priv->base.clipper, width, height); 890 891 priv->view.width = width; 892 priv->view.height = height; 900 893 901 894 _ewk_tiled_backing_store_recalc_renderers( 902 priv, w , h, priv->view.tile.w, priv->view.tile.h);895 priv, width, height, priv->view.tile.width, priv->view.tile.height); 903 896 } 904 897 905 898 // TODO: remove me later. 906 static inline void _ewk_tiled_backing_store_view_dbg(const Ewk_Tiled_Backing_Store_Data *priv)907 { 908 Eina_Inlist **start, **end;899 static inline void _ewk_tiled_backing_store_view_dbg(const Ewk_Tiled_Backing_Store_Data* priv) 900 { 901 Eina_Inlist** start, **end; 909 902 printf("tiles=%2ld,%2ld model=%2ld,%2ld [%dx%d] base=%+3ld,%+4ld offset=%+4d,%+4d old=%+4d,%+4d base=%+3d,%+3d\n", 910 903 priv->view.cols, priv->view.rows, … … 919 912 end = priv->view.items + priv->view.rows; 920 913 for (; start < end; start++) { 921 const Ewk_Tiled_Backing_Store_Item *it;914 const Ewk_Tiled_Backing_Store_Item* it; 922 915 923 916 EINA_INLIST_FOREACH(*start, it) { … … 947 940 * @param count the number of times to repeat the process. 948 941 */ 949 static void _ewk_tiled_backing_store_view_wrap_up(Ewk_Tiled_Backing_Store_Data *priv, Evas_Coord x, Evas_Coord y, unsigned int count)942 static void _ewk_tiled_backing_store_view_wrap_up(Ewk_Tiled_Backing_Store_Data* priv, Evas_Coord x, Evas_Coord y, unsigned int count) 950 943 { 951 944 unsigned int last_row = priv->view.rows - 1; 952 Evas_Coord tw = priv->view.tile.w ;953 Evas_Coord th = priv->view.tile.h ;945 Evas_Coord tw = priv->view.tile.width; 946 Evas_Coord th = priv->view.tile.height; 954 947 Evas_Coord off_y = priv->view.offset.base.y + count * th; 955 948 Evas_Coord oy = y + (last_row - count + 1) * th + off_y; 956 Eina_Inlist **itr_start, **itr_end;949 Eina_Inlist** itr_start, **itr_end; 957 950 958 951 itr_start = priv->view.items; … … 960 953 961 954 for (; count > 0; count--) { 962 Eina_Inlist **itr;963 Eina_Inlist *tmp = *itr_start;964 Ewk_Tiled_Backing_Store_Item *it;955 Eina_Inlist** itr; 956 Eina_Inlist* tmp = *itr_start; 957 Ewk_Tiled_Backing_Store_Item* it; 965 958 Evas_Coord ox = x + priv->view.offset.base.x; 966 959 int c = 0; … … 995 988 * @param count the number of times to repeat the process. 996 989 */ 997 static void _ewk_tiled_backing_store_view_wrap_down(Ewk_Tiled_Backing_Store_Data *priv, Evas_Coord x, Evas_Coord y, unsigned int count)998 { 999 Evas_Coord tw = priv->view.tile.w ;1000 Evas_Coord th = priv->view.tile.h ;990 static void _ewk_tiled_backing_store_view_wrap_down(Ewk_Tiled_Backing_Store_Data* priv, Evas_Coord x, Evas_Coord y, unsigned int count) 991 { 992 Evas_Coord tw = priv->view.tile.width; 993 Evas_Coord th = priv->view.tile.height; 1001 994 Evas_Coord off_y = priv->view.offset.base.y - count * th; 1002 995 Evas_Coord oy = y + off_y + (count - 1) * th; 1003 Eina_Inlist **itr_start, **itr_end;996 Eina_Inlist** itr_start, **itr_end; 1004 997 1005 998 itr_start = priv->view.items + priv->view.rows - 1; … … 1007 1000 1008 1001 for (; count > 0; count--) { 1009 Eina_Inlist **itr;1010 Eina_Inlist *tmp = *itr_start;1011 Ewk_Tiled_Backing_Store_Item *it;1002 Eina_Inlist** itr; 1003 Eina_Inlist* tmp = *itr_start; 1004 Ewk_Tiled_Backing_Store_Item* it; 1012 1005 Evas_Coord ox = x + priv->view.offset.base.x; 1013 1006 int c = 0; … … 1042 1035 * @param count the number of times to repeat the process. 1043 1036 */ 1044 static void _ewk_tiled_backing_store_view_wrap_left(Ewk_Tiled_Backing_Store_Data *priv, Evas_Coord x, Evas_Coord y, unsigned int count)1037 static void _ewk_tiled_backing_store_view_wrap_left(Ewk_Tiled_Backing_Store_Data* priv, Evas_Coord x, Evas_Coord y, unsigned int count) 1045 1038 { 1046 1039 unsigned int r, last_col = priv->view.cols - 1; 1047 Evas_Coord tw = priv->view.tile.w ;1048 Evas_Coord th = priv->view.tile.h ;1040 Evas_Coord tw = priv->view.tile.width; 1041 Evas_Coord th = priv->view.tile.height; 1049 1042 Evas_Coord off_x = priv->view.offset.base.x + count * tw; 1050 1043 Evas_Coord oy = y + priv->view.offset.base.y; 1051 Eina_Inlist **itr;1052 Eina_Inlist **itr_end;1044 Eina_Inlist** itr; 1045 Eina_Inlist** itr_end; 1053 1046 1054 1047 itr = priv->view.items; … … 1063 1056 1064 1057 for (i = 0; i < count; i++, c++, ox += tw) { 1065 Ewk_Tiled_Backing_Store_Item *it;1058 Ewk_Tiled_Backing_Store_Item* it; 1066 1059 it = EINA_INLIST_CONTAINER_GET(*itr, Ewk_Tiled_Backing_Store_Item); 1067 1060 *itr = eina_inlist_demote(*itr, *itr); … … 1089 1082 * @param count the number of times to repeat the process. 1090 1083 */ 1091 static void _ewk_tiled_backing_store_view_wrap_right(Ewk_Tiled_Backing_Store_Data *priv, Evas_Coord x, Evas_Coord y, unsigned int count)1084 static void _ewk_tiled_backing_store_view_wrap_right(Ewk_Tiled_Backing_Store_Data* priv, Evas_Coord x, Evas_Coord y, unsigned int count) 1092 1085 { 1093 1086 unsigned int r; 1094 Evas_Coord tw = priv->view.tile.w ;1095 Evas_Coord th = priv->view.tile.h ;1087 Evas_Coord tw = priv->view.tile.width; 1088 Evas_Coord th = priv->view.tile.height; 1096 1089 Evas_Coord off_x = priv->view.offset.base.x - count * tw; 1097 1090 Evas_Coord oy = y + priv->view.offset.base.y; 1098 Eina_Inlist **itr, **itr_end;1091 Eina_Inlist** itr, ** itr_end; 1099 1092 1100 1093 itr = priv->view.items; … … 1109 1102 1110 1103 for (i = 0; i < count; i++, c--, ox -= tw) { 1111 Ewk_Tiled_Backing_Store_Item *it;1104 Ewk_Tiled_Backing_Store_Item* it; 1112 1105 it = EINA_INLIST_CONTAINER_GET((*itr)->last, Ewk_Tiled_Backing_Store_Item); 1113 1106 *itr = eina_inlist_promote(*itr, (*itr)->last); … … 1122 1115 } 1123 1116 1124 static void _ewk_tiled_backing_store_view_refill(Ewk_Tiled_Backing_Store_Data *priv, Evas_Coord x, Evas_Coord y, int step_x, int step_y)1125 { 1126 Eina_Inlist **itr, **itr_end;1117 static void _ewk_tiled_backing_store_view_refill(Ewk_Tiled_Backing_Store_Data* priv, Evas_Coord x, Evas_Coord y, int stepX, int stepY) 1118 { 1119 Eina_Inlist** itr, **itr_end; 1127 1120 Evas_Coord base_ox, oy, tw, th; 1128 1121 unsigned int r; … … 1130 1123 evas_object_move(priv->base.clipper, x, y); 1131 1124 1132 tw = priv->view.tile.w ;1133 th = priv->view.tile.h ;1125 tw = priv->view.tile.width; 1126 th = priv->view.tile.height; 1134 1127 1135 1128 base_ox = x + priv->view.offset.base.x; … … 1140 1133 r = 0; 1141 1134 1142 priv->model.base.col -= step _x;1143 priv->model.base.row -= step _y;1135 priv->model.base.col -= stepX; 1136 priv->model.base.row -= stepY; 1144 1137 1145 1138 for (; itr < itr_end; itr++, r++) { 1146 Ewk_Tiled_Backing_Store_Item *it;1139 Ewk_Tiled_Backing_Store_Item* it; 1147 1140 Evas_Coord ox = base_ox; 1148 1141 unsigned int c = 0; … … 1157 1150 } 1158 1151 1159 static void _ewk_tiled_backing_store_view_pos_apply(Ewk_Tiled_Backing_Store_Data *priv, Evas_Coord x, Evas_Coord y)1160 { 1161 Eina_Inlist **itr, **itr_end;1152 static void _ewk_tiled_backing_store_view_pos_apply(Ewk_Tiled_Backing_Store_Data* priv, Evas_Coord x, Evas_Coord y) 1153 { 1154 Eina_Inlist** itr, **itr_end; 1162 1155 Evas_Coord base_ox, oy, tw, th; 1163 1156 1164 1157 evas_object_move(priv->base.clipper, x, y); 1165 1158 1166 tw = priv->view.tile.w ;1167 th = priv->view.tile.h ;1159 tw = priv->view.tile.width; 1160 th = priv->view.tile.height; 1168 1161 1169 1162 base_ox = x + priv->view.offset.base.x; … … 1173 1166 itr_end = itr + priv->view.rows; 1174 1167 for (; itr < itr_end; itr++) { 1175 Ewk_Tiled_Backing_Store_Item *it;1168 Ewk_Tiled_Backing_Store_Item* it; 1176 1169 Evas_Coord ox = base_ox; 1177 1170 EINA_INLIST_FOREACH(*itr, it) { … … 1183 1176 } 1184 1177 1185 static void _ewk_tiled_backing_store_smart_calculate_offset_force(Ewk_Tiled_Backing_Store_Data *priv)1178 static void _ewk_tiled_backing_store_smart_calculate_offset_force(Ewk_Tiled_Backing_Store_Data* priv) 1186 1179 { 1187 1180 Evas_Coord dx = priv->view.offset.cur.x - priv->view.offset.old.x; … … 1193 1186 priv->self, dx, dy, priv->view.offset.cur.x, priv->view.offset.cur.y); 1194 1187 1195 tw = priv->view.tile.w ;1196 th = priv->view.tile.h ;1188 tw = priv->view.tile.width; 1189 th = priv->view.tile.height; 1197 1190 1198 1191 long new_col = -priv->view.offset.cur.x / tw; … … 1215 1208 } 1216 1209 1217 static void _ewk_tiled_backing_store_smart_calculate_offset(Ewk_Tiled_Backing_Store_Data *priv, Evas_Coord x, Evas_Coord y)1210 static void _ewk_tiled_backing_store_smart_calculate_offset(Ewk_Tiled_Backing_Store_Data* priv, Evas_Coord x, Evas_Coord y) 1218 1211 { 1219 1212 Evas_Coord dx = priv->view.offset.cur.x - priv->view.offset.old.x; … … 1228 1221 return; 1229 1222 1230 tw = priv->view.tile.w ;1231 th = priv->view.tile.h ;1223 tw = priv->view.tile.width; 1224 th = priv->view.tile.height; 1232 1225 1233 1226 long new_col = -priv->view.offset.cur.x / tw; … … 1272 1265 } 1273 1266 1274 static void _ewk_tiled_backing_store_smart_calculate_pos(Ewk_Tiled_Backing_Store_Data *priv, Evas_Coord x, Evas_Coord y)1267 static void _ewk_tiled_backing_store_smart_calculate_pos(Ewk_Tiled_Backing_Store_Data* priv, Evas_Coord x, Evas_Coord y) 1275 1268 { 1276 1269 _ewk_tiled_backing_store_view_pos_apply(priv, x, y); … … 1283 1276 } 1284 1277 1285 static void _ewk_tiled_backing_store_fill_renderers(Ewk_Tiled_Backing_Store_Data *priv)1286 { 1287 Eina_Inlist *it;1288 Ewk_Tiled_Backing_Store_Item *item;1278 static void _ewk_tiled_backing_store_fill_renderers(Ewk_Tiled_Backing_Store_Data* priv) 1279 { 1280 Eina_Inlist* it; 1281 Ewk_Tiled_Backing_Store_Item* item; 1289 1282 int i, j; 1290 1283 … … 1297 1290 } 1298 1291 1299 static void _ewk_tiled_backing_store_smart_calculate(Evas_Object *o)1292 static void _ewk_tiled_backing_store_smart_calculate(Evas_Object* ewkTile) 1300 1293 { 1301 1294 Evas_Coord x, y, w, h; 1302 1295 1303 evas_object_geometry_get( o, &x, &y, &w, &h);1304 DBG("o=%p at %d,%d + %dx%d", o, x, y, w, h);1305 1306 PRIV_DATA_GET_OR_RETURN( o, priv);1296 evas_object_geometry_get(ewkTile, &x, &y, &w, &h); 1297 DBG("o=%p at %d,%d + %dx%d", ewkTile, x, y, w, h); 1298 1299 PRIV_DATA_GET_OR_RETURN(ewkTile, priv); 1307 1300 1308 1301 priv->changed.any = EINA_FALSE; … … 1313 1306 unsigned long cols, rows; 1314 1307 1315 cols = priv->model.width / priv->view.tile.w + 1;1316 rows = priv->model.height / priv->view.tile.h + 1;1308 cols = priv->model.width / priv->view.tile.width + 1; 1309 rows = priv->model.height / priv->view.tile.height + 1; 1317 1310 1318 1311 priv->model.old.cols = priv->model.cur.cols; … … 1349 1342 _ewk_tiled_backing_store_fill_renderers(priv); 1350 1343 ewk_tile_matrix_resize(priv->model.matrix, 1351 priv->model.cur.cols,1352 priv->model.cur.rows);1344 priv->model.cur.cols, 1345 priv->model.cur.rows); 1353 1346 priv->changed.model = EINA_FALSE; 1354 1347 evas_object_resize(priv->contents_clipper, priv->model.width, priv->model.height); … … 1358 1351 * repainting the whole viewport */ 1359 1352 const Eina_Rectangle r = 1360 1353 { 0, 0, priv->model.width, priv->model.height }; 1361 1354 ewk_tile_matrix_update(priv->model.matrix, &r, 1362 1355 priv->view.tile.zoom); … … 1368 1361 1369 1362 if (priv->view.offset.base.x > 0 1370 || priv->view.offset.base.x <= - priv->view.tile.w 1363 || priv->view.offset.base.x <= - priv->view.tile.width 1371 1364 || priv->view.offset.base.y > 0 1372 || priv->view.offset.base.y <= - priv->view.tile.h )1365 || priv->view.offset.base.y <= - priv->view.tile.height) 1373 1366 ERR("incorrect base offset %+4d,%+4d, tile=%dx%d, cur=%+4d,%+4d\n", 1374 1367 priv->view.offset.base.x, priv->view.offset.base.y, 1375 priv->view.tile.w , priv->view.tile.h,1368 priv->view.tile.width, priv->view.tile.height, 1376 1369 priv->view.offset.cur.x, priv->view.offset.cur.y); 1377 1370 1378 1371 } 1379 1372 1380 Evas_Object *ewk_tiled_backing_store_add(Evas *e)1381 { 1382 static Evas_Smart *smart = 0;1373 Evas_Object* ewk_tiled_backing_store_add(Evas* canvas) 1374 { 1375 static Evas_Smart* smart = 0; 1383 1376 1384 1377 if (_ewk_tiled_log_dom < 0) … … 1403 1396 } 1404 1397 1405 return evas_object_smart_add( e, smart);1406 } 1407 1408 void ewk_tiled_backing_store_render_cb_set(Evas_Object *o, Eina_Bool (*cb)(void *data, Ewk_Tile *t, const Eina_Rectangle *area), const void *data)1409 { 1410 EINA_SAFETY_ON_NULL_RETURN(c b);1411 PRIV_DATA_GET_OR_RETURN( o, priv);1412 priv->render.cb = c b;1398 return evas_object_smart_add(canvas, smart); 1399 } 1400 1401 void ewk_tiled_backing_store_render_cb_set(Evas_Object* ewkTile, Eina_Bool (*callback)(void* data, Ewk_Tile* tile, const Eina_Rectangle* area), const void* data) 1402 { 1403 EINA_SAFETY_ON_NULL_RETURN(callback); 1404 PRIV_DATA_GET_OR_RETURN(ewkTile, priv); 1405 priv->render.cb = callback; 1413 1406 priv->render.data = (void*)data; 1414 1407 } 1415 1408 1416 Ewk_Tile_Unused_Cache *ewk_tiled_backing_store_tile_unused_cache_get(const Evas_Object *o)1417 { 1418 PRIV_DATA_GET_OR_RETURN( o, priv, 0);1409 Ewk_Tile_Unused_Cache* ewk_tiled_backing_store_tile_unused_cache_get(const Evas_Object* ewkTile) 1410 { 1411 PRIV_DATA_GET_OR_RETURN(ewkTile, priv, 0); 1419 1412 return ewk_tile_matrix_unused_cache_get(priv->model.matrix); 1420 1413 } 1421 1414 1422 void ewk_tiled_backing_store_tile_unused_cache_set(Evas_Object *o, Ewk_Tile_Unused_Cache *tuc)1423 { 1424 PRIV_DATA_GET_OR_RETURN( o, priv);1425 1426 if (ewk_tile_matrix_unused_cache_get(priv->model.matrix) == t uc)1427 return; 1428 1429 _ewk_tiled_backing_store_model_matrix_create(priv, t uc);1430 } 1431 1432 static Eina_Bool _ewk_tiled_backing_store_scroll_full_offset_set_internal(Ewk_Tiled_Backing_Store_Data *priv, Evas_Coord x, Evas_Coord y)1415 void ewk_tiled_backing_store_tile_unused_cache_set(Evas_Object* ewkTile, Ewk_Tile_Unused_Cache* tileUnusedCache) 1416 { 1417 PRIV_DATA_GET_OR_RETURN(ewkTile, priv); 1418 1419 if (ewk_tile_matrix_unused_cache_get(priv->model.matrix) == tileUnusedCache) 1420 return; 1421 1422 _ewk_tiled_backing_store_model_matrix_create(priv, tileUnusedCache); 1423 } 1424 1425 static Eina_Bool _ewk_tiled_backing_store_scroll_full_offset_set_internal(Ewk_Tiled_Backing_Store_Data* priv, Evas_Coord x, Evas_Coord y) 1433 1426 { 1434 1427 /* TODO: check offset go out of bounds, clamp */ … … 1445 1438 } 1446 1439 1447 Eina_Bool ewk_tiled_backing_store_scroll_full_offset_set(Evas_Object *o, Evas_Coord x, Evas_Coord y)1448 { 1449 DBG("o=%p, x=%d, y=%d", o, x, y);1450 1451 PRIV_DATA_GET_OR_RETURN( o, priv, EINA_FALSE);1440 Eina_Bool ewk_tiled_backing_store_scroll_full_offset_set(Evas_Object* ewkTile, Evas_Coord x, Evas_Coord y) 1441 { 1442 DBG("o=%p, x=%d, y=%d", ewkTile, x, y); 1443 1444 PRIV_DATA_GET_OR_RETURN(ewkTile, priv, EINA_FALSE); 1452 1445 if (x == priv->view.offset.cur.x && y == priv->view.offset.cur.y) 1453 1446 return EINA_TRUE; … … 1456 1449 } 1457 1450 1458 Eina_Bool ewk_tiled_backing_store_scroll_full_offset_add(Evas_Object *o, Evas_Coord dx, Evas_Coord dy)1459 { 1460 DBG("o=%p, dx=%d, dy=%d", o, dx, dy);1461 1462 PRIV_DATA_GET_OR_RETURN( o, priv, EINA_FALSE);1451 Eina_Bool ewk_tiled_backing_store_scroll_full_offset_add(Evas_Object* ewkTile, Evas_Coord dx, Evas_Coord dy) 1452 { 1453 DBG("o=%p, dx=%d, dy=%d", ewkTile, dx, dy); 1454 1455 PRIV_DATA_GET_OR_RETURN(ewkTile, priv, EINA_FALSE); 1463 1456 if (!dx && !dy) 1464 1457 return EINA_TRUE; 1465 1458 1466 1459 return _ewk_tiled_backing_store_scroll_full_offset_set_internal 1467 (priv, priv->view.offset.cur.x + dx, priv->view.offset.cur.y + dy);1468 } 1469 1470 static Eina_Bool _ewk_tiled_backing_store_zoom_set_internal(Ewk_Tiled_Backing_Store_Data *priv, float *zoom, Evas_Coord cx, Evas_Coord cy, Evas_Coord *offx, Evas_Coord *offy)1471 { 1472 *off x= priv->view.offset.cur.x;1473 *off y= priv->view.offset.cur.y;1460 (priv, priv->view.offset.cur.x + dx, priv->view.offset.cur.y + dy); 1461 } 1462 1463 static Eina_Bool _ewk_tiled_backing_store_zoom_set_internal(Ewk_Tiled_Backing_Store_Data* priv, float* zoom, Evas_Coord currentX, Evas_Coord currentY, Evas_Coord* offsetX, Evas_Coord* offsetY) 1464 { 1465 *offsetX = priv->view.offset.cur.x; 1466 *offsetY = priv->view.offset.cur.y; 1474 1467 1475 1468 if (fabsf(priv->view.tile.zoom - *zoom) < ZOOM_STEP_MIN) { … … 1482 1475 Evas_Coord tw, th; 1483 1476 1484 *zoom = ROUNDED_ZOOM(priv->view.tile.w , *zoom);1485 1486 tw = priv->view.tile.w ;1487 th = priv->view.tile.h ;1477 *zoom = ROUNDED_ZOOM(priv->view.tile.width, *zoom); 1478 1479 tw = priv->view.tile.width; 1480 th = priv->view.tile.height; 1488 1481 1489 1482 float scale = *zoom / priv->view.tile.zoom; 1490 1483 1491 1484 priv->view.tile.zoom = *zoom; 1492 // todo: check c x[0, w]...1493 priv->view.offset.zoom_center.x = c x;1494 priv->view.offset.zoom_center.y = c y;1495 1496 1497 if (!priv->view.w || !priv->view.h) {1485 // todo: check currentX [0, w]... 1486 priv->view.offset.zoom_center.x = currentX; 1487 priv->view.offset.zoom_center.y = currentY; 1488 1489 1490 if (!priv->view.width || !priv->view.height) { 1498 1491 priv->view.offset.base.x = 0; 1499 1492 priv->view.offset.base.y = 0; 1500 1493 return EINA_TRUE; 1501 1494 } 1502 Eina_Inlist **itr, **itr_end;1503 Ewk_Tiled_Backing_Store_Item *it;1504 1505 Evas_Coord new_x = c x + (priv->view.offset.cur.x - cx) * scale;1506 Evas_Coord new_y = c y + (priv->view.offset.cur.y - cy) * scale;1507 1508 Evas_Coord model_w idth= priv->model.width * scale;1509 Evas_Coord model_h eight= priv->model.height * scale;1510 1511 if (model_w idth < priv->view.w|| new_x >= 0)1495 Eina_Inlist** itr, **itr_end; 1496 Ewk_Tiled_Backing_Store_Item* it; 1497 1498 Evas_Coord new_x = currentX + (priv->view.offset.cur.x - currentX) * scale; 1499 Evas_Coord new_y = currentY + (priv->view.offset.cur.y - currentY) * scale; 1500 1501 Evas_Coord model_w = priv->model.width * scale; 1502 Evas_Coord model_h = priv->model.height * scale; 1503 1504 if (model_w < priv->view.width || new_x >= 0) 1512 1505 new_x = 0; 1513 else if (-new_x + priv->view.w >= model_width)1514 new_x = -model_w idth + priv->view.w;1515 1516 if (model_h eight < priv->view.h|| new_y >= 0)1506 else if (-new_x + priv->view.width >= model_w) 1507 new_x = -model_w + priv->view.width; 1508 1509 if (model_h < priv->view.height || new_y >= 0) 1517 1510 new_y = 0; 1518 else if (-new_y + priv->view.h >= model_height)1519 new_y = -model_h eight + priv->view.h;1511 else if (-new_y + priv->view.height >= model_h) 1512 new_y = -model_h + priv->view.height; 1520 1513 1521 1514 Evas_Coord bx = new_x % tw; … … 1535 1528 priv->view.offset.old.x = priv->view.offset.cur.x; 1536 1529 priv->view.offset.old.y = priv->view.offset.cur.y; 1537 *off x= priv->view.offset.cur.x;1538 *off y= priv->view.offset.cur.y;1530 *offsetX = priv->view.offset.cur.x; 1531 *offsetY = priv->view.offset.cur.y; 1539 1532 1540 1533 evas_object_move( … … 1553 1546 for (; itr < itr_end; itr++) { 1554 1547 Evas_Coord ox = base_ox; 1555 Eina_Inlist *lst = *itr;1548 Eina_Inlist* lst = *itr; 1556 1549 1557 1550 EINA_INLIST_FOREACH(lst, it) { … … 1566 1559 } 1567 1560 1568 Eina_Bool ewk_tiled_backing_store_zoom_set(Evas_Object *o, float *zoom, Evas_Coord cx, Evas_Coord cy, Evas_Coord *offx, Evas_Coord *offy)1569 { 1570 DBG("o=%p, zoom=%f", o, (double)*zoom);1571 1572 PRIV_DATA_GET_OR_RETURN( o, priv, EINA_FALSE);1573 1574 return _ewk_tiled_backing_store_zoom_set_internal(priv, zoom, c x, cy, offx, offy);1575 } 1576 1577 Eina_Bool ewk_tiled_backing_store_zoom_weak_set(Evas_Object *o, float zoom, Evas_Coord cx, Evas_Coord cy)1578 { 1579 DBG("o=%p, zoom=%f", o, (double)zoom);1580 PRIV_DATA_GET_OR_RETURN( o, priv, EINA_FALSE);1581 if (!priv->view.w || !priv->view.h)1561 Eina_Bool ewk_tiled_backing_store_zoom_set(Evas_Object* ewkTile, float* zoom, Evas_Coord currentX, Evas_Coord currentY, Evas_Coord* offsetX, Evas_Coord* offsetY) 1562 { 1563 DBG("o=%p, zoom=%f", ewkTile, *zoom); 1564 1565 PRIV_DATA_GET_OR_RETURN(ewkTile, priv, EINA_FALSE); 1566 1567 return _ewk_tiled_backing_store_zoom_set_internal(priv, zoom, currentX, currentY, offsetX, offsetY); 1568 } 1569 1570 Eina_Bool ewk_tiled_backing_store_zoom_weak_set(Evas_Object* ewkTile, float zoom, Evas_Coord currentX, Evas_Coord currentY) 1571 { 1572 DBG("o=%p, zoom=%f", ewkTile, zoom); 1573 PRIV_DATA_GET_OR_RETURN(ewkTile, priv, EINA_FALSE); 1574 if (!priv->view.width || !priv->view.height) 1582 1575 return EINA_FALSE; 1583 Eina_Inlist **itr, **itr_end;1584 Ewk_Tiled_Backing_Store_Item *it;1576 Eina_Inlist** itr, ** itr_end; 1577 Ewk_Tiled_Backing_Store_Item* it; 1585 1578 Evas_Coord tw, th; 1586 1579 Eina_Bool recalc = EINA_FALSE; … … 1588 1581 float scale = zoom / priv->view.tile.zoom; 1589 1582 1590 tw = TILE_SIZE_AT_ZOOM(priv->view.tile.w , scale);1591 scale = TILE_ZOOM_AT_SIZE(tw, priv->view.tile.w );1592 th = TILE_SIZE_AT_ZOOM(priv->view.tile.h , scale);1583 tw = TILE_SIZE_AT_ZOOM(priv->view.tile.width, scale); 1584 scale = TILE_ZOOM_AT_SIZE(tw, priv->view.tile.width); 1585 th = TILE_SIZE_AT_ZOOM(priv->view.tile.height, scale); 1593 1586 zoom = scale * priv->view.tile.zoom; 1594 1587 1595 Evas_Coord model_w idth= priv->model.width * scale;1596 Evas_Coord model_h eight= priv->model.height * scale;1597 1598 evas_object_resize(priv->contents_clipper, model_w idth, model_height);1599 1600 int vrows = ceil((float)priv->view.h / (float)th) + 1;1601 int vcols = ceil((float)priv->view.w / (float)tw) + 1;1602 Evas_Coord new_x = c x + (priv->view.offset.cur.x - cx) * scale;1603 Evas_Coord new_y = c y + (priv->view.offset.cur.y - cy) * scale;1588 Evas_Coord model_w = priv->model.width * scale; 1589 Evas_Coord model_h = priv->model.height * scale; 1590 1591 evas_object_resize(priv->contents_clipper, model_w, model_h); 1592 1593 int vrows = static_cast<int>(ceil(static_cast<float>(priv->view.height / th)) + 1); 1594 int vcols = static_cast<int>(ceil(static_cast<float>(priv->view.width / tw)) + 1); 1595 Evas_Coord new_x = currentX + (priv->view.offset.cur.x - currentX) * scale; 1596 Evas_Coord new_y = currentY + (priv->view.offset.cur.y - currentY) * scale; 1604 1597 Evas_Coord bx = new_x % tw; 1605 1598 Evas_Coord by = new_y % th; … … 1617 1610 1618 1611 if (recalc) { 1619 Evas_Coord w , h;1620 evas_object_geometry_get( o, 0, 0, &w, &h);1621 _ewk_tiled_backing_store_recalc_renderers(priv, w , h, tw, th);1612 Evas_Coord width, height; 1613 evas_object_geometry_get(ewkTile, 0, 0, &width, &height); 1614 _ewk_tiled_backing_store_recalc_renderers(priv, width, height, tw, th); 1622 1615 _ewk_tiled_backing_store_fill_renderers(priv); 1623 1616 _ewk_tiled_backing_store_updates_process(priv); … … 1636 1629 for (; itr < itr_end; itr++) { 1637 1630 Evas_Coord ox = base_ox; 1638 Eina_Inlist *lst = *itr;1631 Eina_Inlist* lst = *itr; 1639 1632 1640 1633 EINA_INLIST_FOREACH(lst, it) { … … 1649 1642 } 1650 1643 1651 void ewk_tiled_backing_store_fix_offsets(Evas_Object *o, Evas_Coord w, Evas_Coord h)1652 { 1653 PRIV_DATA_GET_OR_RETURN( o, priv);1654 Eina_Inlist **itr, **itr_end;1655 Ewk_Tiled_Backing_Store_Item *it;1644 void ewk_tiled_backing_store_fix_offsets(Evas_Object* ewkTile, Evas_Coord width, Evas_Coord height) 1645 { 1646 PRIV_DATA_GET_OR_RETURN(ewkTile, priv); 1647 Eina_Inlist** itr, **itr_end; 1648 Ewk_Tiled_Backing_Store_Item* it; 1656 1649 Evas_Coord new_x = priv->view.offset.cur.x; 1657 1650 Evas_Coord new_y = priv->view.offset.cur.y; 1658 1651 Evas_Coord bx = priv->view.offset.base.x; 1659 1652 Evas_Coord by = priv->view.offset.base.y; 1660 Evas_Coord tw = priv->view.tile.w ;1661 Evas_Coord th = priv->view.tile.h ;1662 1663 if (-new_x > w ) {1664 new_x = -w ;1653 Evas_Coord tw = priv->view.tile.width; 1654 Evas_Coord th = priv->view.tile.height; 1655 1656 if (-new_x > width) { 1657 new_x = -width; 1665 1658 bx = new_x % tw; 1666 1659 priv->model.base.col = -new_x / tw; 1667 1660 } 1668 1661 1669 if (-new_y > h ) {1670 new_y = -h ;1662 if (-new_y > height) { 1663 new_y = -height; 1671 1664 by = new_y % th; 1672 1665 priv->model.base.row = -new_y / th; 1673 1666 } 1674 1667 1675 if (bx >= 0 || bx <= -2 * priv->view.tile.w ) {1668 if (bx >= 0 || bx <= -2 * priv->view.tile.width) { 1676 1669 bx = new_x % tw; 1677 1670 priv->model.base.col = -new_x / tw; 1678 1671 } 1679 1672 1680 if (by >= 0 || by <= -2 * priv->view.tile.h ) {1673 if (by >= 0 || by <= -2 * priv->view.tile.height) { 1681 1674 by = new_y % th; 1682 1675 priv->model.base.row = -new_y / th; … … 1701 1694 for (; itr < itr_end; itr++) { 1702 1695 Evas_Coord ox = base_ox; 1703 Eina_Inlist *lst = *itr;1696 Eina_Inlist* lst = *itr; 1704 1697 1705 1698 EINA_INLIST_FOREACH(lst, it) { … … 1712 1705 } 1713 1706 1714 void ewk_tiled_backing_store_zoom_weak_smooth_scale_set(Evas_Object *o, Eina_Bool smooth_scale)1715 { 1716 PRIV_DATA_GET_OR_RETURN( o, priv);1717 Eina_Inlist **itr, **itr_end;1707 void ewk_tiled_backing_store_zoom_weak_smooth_scale_set(Evas_Object* ewkTile, Eina_Bool smoothScale) 1708 { 1709 PRIV_DATA_GET_OR_RETURN(ewkTile, priv); 1710 Eina_Inlist** itr, **itr_end; 1718 1711 1719 1712 itr = priv->view.items; 1720 1713 itr_end = itr + priv->view.rows; 1721 priv->view.tile.zoom_weak_smooth_scale = smooth _scale;1714 priv->view.tile.zoom_weak_smooth_scale = smoothScale; 1722 1715 1723 1716 for (; itr< itr_end; itr++) { 1724 Ewk_Tiled_Backing_Store_Item *it;1717 Ewk_Tiled_Backing_Store_Item* it; 1725 1718 EINA_INLIST_FOREACH(*itr, it) 1726 1719 if (it->tile) 1727 1720 _ewk_tiled_backing_store_item_smooth_scale_set 1728 (it, smooth _scale);1729 } 1730 } 1731 1732 Eina_Bool ewk_tiled_backing_store_update(Evas_Object *o, const Eina_Rectangle *update)1733 { 1734 PRIV_DATA_GET_OR_RETURN( o, priv, EINA_FALSE);1721 (it, smoothScale); 1722 } 1723 } 1724 1725 Eina_Bool ewk_tiled_backing_store_update(Evas_Object* ewkTile, const Eina_Rectangle* update) 1726 { 1727 PRIV_DATA_GET_OR_RETURN(ewkTile, priv, EINA_FALSE); 1735 1728 1736 1729 if (priv->render.disabled) … … 1741 1734 } 1742 1735 1743 void ewk_tiled_backing_store_updates_process_pre_set(Evas_Object *o, void *(*cb)(void *data, Evas_Object *o), const void *data)1744 { 1745 PRIV_DATA_GET_OR_RETURN( o, priv);1746 priv->process.pre_cb = c b;1736 void ewk_tiled_backing_store_updates_process_pre_set(Evas_Object* ewkTile, void* (*callback)(void* data, Evas_Object *ewkTile), const void* data) 1737 { 1738 PRIV_DATA_GET_OR_RETURN(ewkTile, priv); 1739 priv->process.pre_cb = callback; 1747 1740 priv->process.pre_data = (void*)data; 1748 1741 } 1749 1742 1750 void ewk_tiled_backing_store_updates_process_post_set(Evas_Object *o, void *(*cb)(void *data, void *pre_data, Evas_Object *o), const void *data)1751 { 1752 PRIV_DATA_GET_OR_RETURN( o, priv);1753 priv->process.post_cb = c b;1743 void ewk_tiled_backing_store_updates_process_post_set(Evas_Object* ewkTile, void* (*callback)(void* data, void* pre_data, Evas_Object *ewkTile), const void* data) 1744 { 1745 PRIV_DATA_GET_OR_RETURN(ewkTile, priv); 1746 priv->process.post_cb = callback; 1754 1747 priv->process.post_data = (void*)data; 1755 1748 } 1756 1749 1757 void ewk_tiled_backing_store_updates_process(Evas_Object *o)1758 { 1759 PRIV_DATA_GET_OR_RETURN( o, priv);1750 void ewk_tiled_backing_store_updates_process(Evas_Object* ewkTile) 1751 { 1752 PRIV_DATA_GET_OR_RETURN(ewkTile, priv); 1760 1753 _ewk_tiled_backing_store_updates_process(priv); 1761 1754 } 1762 1755 1763 void ewk_tiled_backing_store_updates_clear(Evas_Object *o)1764 { 1765 PRIV_DATA_GET_OR_RETURN( o, priv);1756 void ewk_tiled_backing_store_updates_clear(Evas_Object* ewkTile) 1757 { 1758 PRIV_DATA_GET_OR_RETURN(ewkTile, priv); 1766 1759 1767 1760 ewk_tile_matrix_updates_clear(priv->model.matrix); 1768 1761 } 1769 1762 1770 void ewk_tiled_backing_store_contents_resize(Evas_Object *o, Evas_Coord width, Evas_Coord height)1771 { 1772 PRIV_DATA_GET_OR_RETURN( o, priv);1763 void ewk_tiled_backing_store_contents_resize(Evas_Object* ewkTile, Evas_Coord width, Evas_Coord height) 1764 { 1765 PRIV_DATA_GET_OR_RETURN(ewkTile, priv); 1773 1766 1774 1767 if (width == priv->model.width && height == priv->model.height) … … 1779 1772 priv->changed.model = EINA_TRUE; 1780 1773 1781 DBG("w idth,height=%d, %d", width, height);1774 DBG("w,h=%d, %d", width, height); 1782 1775 _ewk_tiled_backing_store_changed(priv); 1783 1776 } 1784 1777 1785 void ewk_tiled_backing_store_disabled_update_set(Evas_Object *o, Eina_Bool value)1786 { 1787 PRIV_DATA_GET_OR_RETURN( o, priv);1778 void ewk_tiled_backing_store_disabled_update_set(Evas_Object* ewkTile, Eina_Bool value) 1779 { 1780 PRIV_DATA_GET_OR_RETURN(ewkTile, priv); 1788 1781 1789 1782 if (value != priv->render.disabled) … … 1791 1784 } 1792 1785 1793 void ewk_tiled_backing_store_flush(Evas_Object *o)1794 { 1795 PRIV_DATA_GET_OR_RETURN( o, priv);1796 Ewk_Tile_Unused_Cache *tuc = 0;1786 void ewk_tiled_backing_store_flush(Evas_Object* ewkTile) 1787 { 1788 PRIV_DATA_GET_OR_RETURN(ewkTile, priv); 1789 Ewk_Tile_Unused_Cache* tuc = 0; 1797 1790 1798 1791 priv->view.offset.cur.x = 0; … … 1826 1819 } 1827 1820 1828 Eina_Bool ewk_tiled_backing_store_pre_render_region(Evas_Object *o, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, float zoom)1829 { 1830 PRIV_DATA_GET_OR_RETURN( o, priv, EINA_FALSE);1821 Eina_Bool ewk_tiled_backing_store_pre_render_region(Evas_Object* ewkTile, Evas_Coord x, Evas_Coord y, Evas_Coord width, Evas_Coord height, float zoom) 1822 { 1823 PRIV_DATA_GET_OR_RETURN(ewkTile, priv, EINA_FALSE); 1831 1824 Eina_Tile_Grid_Slicer slicer; 1832 const Eina_Tile_Grid_Info *info;1825 const Eina_Tile_Grid_Info* info; 1833 1826 Evas_Coord tw, th; 1834 Ewk_Tile_Unused_Cache *tuc;1835 1836 tw = priv->view.tile.w ;1837 th = priv->view.tile.h ;1838 zoom = ROUNDED_ZOOM(priv->view.tile.w , zoom);1839 1840 if (!eina_tile_grid_slicer_setup(&slicer, x, y, w , h, tw, th)) {1827 Ewk_Tile_Unused_Cache* tuc; 1828 1829 tw = priv->view.tile.width; 1830 th = priv->view.tile.height; 1831 zoom = ROUNDED_ZOOM(priv->view.tile.width, zoom); 1832 1833 if (!eina_tile_grid_slicer_setup(&slicer, x, y, width, height, tw, th)) { 1841 1834 ERR("could not setup grid slicer for %d,%d+%dx%d tile=%dx%d", 1842 x, y, w , h, tw, th);1835 x, y, width, height, tw, th); 1843 1836 return EINA_FALSE; 1844 1837 } … … 1854 1847 1855 1848 tuc = ewk_tile_matrix_unused_cache_get(priv->model.matrix); 1856 ewk_tile_unused_cache_lock_area(tuc, x, y, w , h, zoom);1849 ewk_tile_unused_cache_lock_area(tuc, x, y, width, height, zoom); 1857 1850 return EINA_TRUE; 1858 1851 } 1859 1852 1860 Eina_Bool ewk_tiled_backing_store_pre_render_relative_radius(Evas_Object *o, unsigned int n, float zoom)1861 { 1862 PRIV_DATA_GET_OR_RETURN( o, priv, EINA_FALSE);1863 unsigned long start_row, end_row, start_col, end_col, i, j, w , h;1864 Ewk_Tile_Unused_Cache *tuc;1853 Eina_Bool ewk_tiled_backing_store_pre_render_relative_radius(Evas_Object* ewkTile, unsigned int n, float zoom) 1854 { 1855 PRIV_DATA_GET_OR_RETURN(ewkTile, priv, EINA_FALSE); 1856 unsigned long start_row, end_row, start_col, end_col, i, j, width, height; 1857 Ewk_Tile_Unused_Cache* tuc; 1865 1858 1866 1859 INF("priv->model.base.row =%ld, n=%u priv->view.rows=%lu", 1867 1860 priv->model.base.row, n, priv->view.rows); 1868 1861 start_row = (long)priv->model.base.row - n; 1869 1862 start_col = (long)priv->model.base.col - n; 1870 1863 end_row = std::min(priv->model.cur.rows - 1, 1871 priv->model.base.row + priv->view.rows + n - 1);1864 priv->model.base.row + priv->view.rows + n - 1); 1872 1865 end_col = std::min(priv->model.cur.cols - 1, 1873 priv->model.base.col + priv->view.cols + n - 1);1866 priv->model.base.col + priv->view.cols + n - 1); 1874 1867 1875 1868 INF("start_row=%lu, end_row=%lu, start_col=%lu, end_col=%lu", 1876 1877 1878 zoom = ROUNDED_ZOOM(priv->view.tile.w , zoom);1869 start_row, end_row, start_col, end_col); 1870 1871 zoom = ROUNDED_ZOOM(priv->view.tile.width, zoom); 1879 1872 1880 1873 for (i = start_row; i <= end_row; i++) … … 1887 1880 1888 1881 tuc = ewk_tile_matrix_unused_cache_get(priv->model.matrix); 1889 h = (end_row - start_row + 1) * TILE_SIZE_AT_ZOOM(priv->view.tile.h, zoom);1890 w = (end_col - start_col + 1) * TILE_SIZE_AT_ZOOM(priv->view.tile.w, zoom);1882 height = (end_row - start_row + 1) * TILE_SIZE_AT_ZOOM(priv->view.tile.height, zoom); 1883 width = (end_col - start_col + 1) * TILE_SIZE_AT_ZOOM(priv->view.tile.width, zoom); 1891 1884 ewk_tile_unused_cache_lock_area(tuc, 1892 start_col * TILE_SIZE_AT_ZOOM(priv->view.tile.w, zoom),1893 start_row * TILE_SIZE_AT_ZOOM(priv->view.tile.h, zoom), w, h, zoom);1885 start_col * TILE_SIZE_AT_ZOOM(priv->view.tile.width, zoom), 1886 start_row * TILE_SIZE_AT_ZOOM(priv->view.tile.height, zoom), width, height, zoom); 1894 1887 1895 1888 return EINA_TRUE; 1896 1889 } 1897 1890 1898 void ewk_tiled_backing_store_pre_render_cancel(Evas_Object *o)1899 { 1900 PRIV_DATA_GET_OR_RETURN( o, priv);1901 Ewk_Tile_Unused_Cache *tuc;1891 void ewk_tiled_backing_store_pre_render_cancel(Evas_Object* ewkTile) 1892 { 1893 PRIV_DATA_GET_OR_RETURN(ewkTile, priv); 1894 Ewk_Tile_Unused_Cache* tuc; 1902 1895 1903 1896 _ewk_tiled_backing_store_pre_render_request_clear(priv); … … 1907 1900 } 1908 1901 1909 Eina_Bool ewk_tiled_backing_store_disable_render(Evas_Object *o)1910 { 1911 PRIV_DATA_GET_OR_RETURN( o, priv, EINA_FALSE);1902 Eina_Bool ewk_tiled_backing_store_disable_render(Evas_Object* ewkTile) 1903 { 1904 PRIV_DATA_GET_OR_RETURN(ewkTile, priv, EINA_FALSE); 1912 1905 return _ewk_tiled_backing_store_disable_render(priv); 1913 1906 } 1914 1907 1915 Eina_Bool ewk_tiled_backing_store_enable_render(Evas_Object *o)1916 { 1917 PRIV_DATA_GET_OR_RETURN( o, priv, EINA_FALSE);1908 Eina_Bool ewk_tiled_backing_store_enable_render(Evas_Object* ewkTile) 1909 { 1910 PRIV_DATA_GET_OR_RETURN(ewkTile, priv, EINA_FALSE); 1918 1911 _ewk_tiled_backing_store_changed(priv); 1919 1912 return _ewk_tiled_backing_store_enable_render(priv); -
trunk/Source/WebKit/efl/ewk/ewk_tiled_backing_store.h
r96495 r97329 73 73 74 74 /** Never ever change those after tile is created (respect const!) */ 75 const Evas_Coord w , h; /**< tile size (see TILE_SIZE_AT_ZOOM()) */75 const Evas_Coord width, height; /**< tile size (see TILE_SIZE_AT_ZOOM()) */ 76 76 const Evas_Colorspace cspace; /**< colorspace */ 77 77 const float zoom; /**< zoom level contents were rendered at */ … … 91 91 Evas_Object* ewk_tiled_backing_store_add(Evas* e); 92 92 93 void ewk_tiled_backing_store_render_cb_set(Evas_Object *o, Eina_Bool (* 93 void ewk_tiled_backing_store_render_cb_set(Evas_Object *o, Eina_Bool (*cb)(void* data, Ewk_Tile* t, const Eina_Rectangle* area), const void* data); 94 94 95 95 Eina_Bool ewk_tiled_backing_store_scroll_full_offset_set(Evas_Object* o, Evas_Coord x, Evas_Coord y); -
trunk/Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp
r96495 r97329 33 33 34 34 struct _Ewk_Tile_Matrix { 35 Eina_Matrixsparse *matrix;36 Ewk_Tile_Unused_Cache *tuc;35 Eina_Matrixsparse* matrix; 36 Ewk_Tile_Unused_Cache* tuc; 37 37 Evas_Colorspace cspace; 38 38 struct { 39 void (*cb)(void *data, Ewk_Tile *t, const Eina_Rectangle *update);40 void *data;39 void (*cb)(void* data, Ewk_Tile* tile, const Eina_Rectangle* update); 40 void* data; 41 41 } render; 42 42 unsigned int frozen; 43 Eina_List *updates;43 Eina_List* updates; 44 44 struct { 45 Evas_Coord w , h;45 Evas_Coord width, height; 46 46 } tile; 47 47 #ifdef DEBUG_MEM_LEAKS … … 60 60 61 61 /* called when matrixsparse is resized or freed */ 62 static void _ewk_tile_matrix_cell_free(void *user_data, void *cell_data)63 { 64 Ewk_Tile_Matrix* tm = static_cast<Ewk_Tile_Matrix*>(user _data);65 Ewk_Tile* t = static_cast<Ewk_Tile*>(cell_data);66 67 if (!t )62 static void _ewk_tile_matrix_cell_free(void* userData, void* cellData) 63 { 64 Ewk_Tile_Matrix* tm = static_cast<Ewk_Tile_Matrix*>(userData); 65 Ewk_Tile* tile = static_cast<Ewk_Tile*>(cellData); 66 67 if (!tile) 68 68 return; 69 69 70 70 ewk_tile_unused_cache_freeze(tm->tuc); 71 71 72 if (t ->updates || t->stats.full_update)73 tm->updates = eina_list_remove(tm->updates, t );74 75 if (t ->visible)76 ERR("freeing cell that is visible, leaking tile %p", t );72 if (tile->updates || tile->stats.full_update) 73 tm->updates = eina_list_remove(tm->updates, tile); 74 75 if (tile->visible) 76 ERR("freeing cell that is visible, leaking tile %p", tile); 77 77 else { 78 if (!ewk_tile_unused_cache_tile_get(tm->tuc, t ))79 ERR("tile %p was not in cache %p? leaking...", t , tm->tuc);78 if (!ewk_tile_unused_cache_tile_get(tm->tuc, tile)) 79 ERR("tile %p was not in cache %p? leaking...", tile, tm->tuc); 80 80 else { 81 DBG("tile cell does not exist anymore, free it %p", t );82 #ifdef DEBUG_MEM_LEAKS 83 tm->stats.bytes.freed += t ->bytes;81 DBG("tile cell does not exist anymore, free it %p", tile); 82 #ifdef DEBUG_MEM_LEAKS 83 tm->stats.bytes.freed += tile->bytes; 84 84 tm->stats.tiles.freed++; 85 85 #endif 86 ewk_tile_free(t );86 ewk_tile_free(tile); 87 87 } 88 88 } … … 92 92 93 93 /* called when cache of unused tile is flushed */ 94 static void _ewk_tile_matrix_tile_free(void *data, Ewk_Tile *t)94 static void _ewk_tile_matrix_tile_free(void* data, Ewk_Tile* tile) 95 95 { 96 96 Ewk_Tile_Matrix* tm = static_cast<Ewk_Tile_Matrix*>(data); 97 Eina_Matrixsparse_Cell *cell;98 99 if (!eina_matrixsparse_cell_idx_get(tm->matrix, t ->row, t->col, &cell)) {100 ERR("removing tile %p that was not in the matrix? Leaking...", t );97 Eina_Matrixsparse_Cell* cell; 98 99 if (!eina_matrixsparse_cell_idx_get(tm->matrix, tile->row, tile->col, &cell)) { 100 ERR("removing tile %p that was not in the matrix? Leaking...", tile); 101 101 return; 102 102 } 103 103 104 104 if (!cell) { 105 ERR("removing tile %p that was not in the matrix? Leaking...", t );105 ERR("removing tile %p that was not in the matrix? Leaking...", tile); 106 106 return; 107 107 } 108 108 109 if (t ->updates || t->stats.full_update)110 tm->updates = eina_list_remove(tm->updates, t );109 if (tile->updates || tile->stats.full_update) 110 tm->updates = eina_list_remove(tm->updates, tile); 111 111 112 112 /* set to null to avoid double free */ … … 114 114 eina_matrixsparse_cell_clear(cell); 115 115 116 if (EINA_UNLIKELY(!!t ->visible)) {116 if (EINA_UNLIKELY(!!tile->visible)) { 117 117 ERR("cache of unused tiles requesting deletion of used tile %p? " 118 "Leaking...", t );118 "Leaking...", tile); 119 119 return; 120 120 } 121 121 122 122 #ifdef DEBUG_MEM_LEAKS 123 tm->stats.bytes.freed += t ->bytes;123 tm->stats.bytes.freed += tile->bytes; 124 124 tm->stats.tiles.freed++; 125 125 #endif 126 126 127 ewk_tile_free(t );127 ewk_tile_free(tile); 128 128 } 129 129 … … 138 138 * @param tuc cache of unused tiles or @c 0 to create one 139 139 * automatically. 140 * @param col s number of columns in the matrix.140 * @param columns number of columns in the matrix. 141 141 * @param rows number of rows in the matrix. 142 142 * @param cspace the color space used to create tiles in this matrix. … … 146 146 * @return newly allocated instance on success, @c 0 on failure. 147 147 */ 148 Ewk_Tile_Matrix *ewk_tile_matrix_new(Ewk_Tile_Unused_Cache *tuc, unsigned long cols, unsigned long rows, Evas_Colorspace cspace, void (*render_cb)(void *data, Ewk_Tile *t, const Eina_Rectangle *update), const void *render_data)148 Ewk_Tile_Matrix* ewk_tile_matrix_new(Ewk_Tile_Unused_Cache* tileUnusedCache, unsigned long columns, unsigned long rows, Evas_Colorspace colorSpace, void (*render_callback)(void* data, Ewk_Tile* tile, const Eina_Rectangle* update), const void* renderData) 149 149 { 150 150 Ewk_Tile_Matrix* tm = static_cast<Ewk_Tile_Matrix*>(calloc(1, sizeof(Ewk_Tile_Matrix))); … … 152 152 return 0; 153 153 154 tm->matrix = eina_matrixsparse_new(rows, col s, _ewk_tile_matrix_cell_free, tm);154 tm->matrix = eina_matrixsparse_new(rows, columns, _ewk_tile_matrix_cell_free, tm); 155 155 if (!tm->matrix) { 156 156 ERR("could not create sparse matrix."); … … 159 159 } 160 160 161 if (t uc)162 tm->tuc = ewk_tile_unused_cache_ref(t uc);161 if (tileUnusedCache) 162 tm->tuc = ewk_tile_unused_cache_ref(tileUnusedCache); 163 163 else { 164 164 tm->tuc = ewk_tile_unused_cache_new(40960000); … … 171 171 } 172 172 173 tm->cspace = c space;174 tm->render.cb = render_c b;175 tm->render.data = (void *)render_data;176 tm->tile.w = DEFAULT_TILE_W;177 tm->tile.h = DEFAULT_TILE_H;173 tm->cspace = colorSpace; 174 tm->render.cb = render_callback; 175 tm->render.data = (void*)renderData; 176 tm->tile.width = DEFAULT_TILE_W; 177 tm->tile.height = DEFAULT_TILE_H; 178 178 179 179 return tm; … … 185 185 * The cache instance is unreferenced, possibly freeing it. 186 186 */ 187 void ewk_tile_matrix_free(Ewk_Tile_Matrix *tm)187 void ewk_tile_matrix_free(Ewk_Tile_Matrix* tileMatrix) 188 188 { 189 189 #ifdef DEBUG_MEM_LEAKS … … 191 191 #endif 192 192 193 EINA_SAFETY_ON_NULL_RETURN(t m);194 ewk_tile_unused_cache_freeze(t m->tuc);195 196 eina_matrixsparse_free(t m->matrix);197 198 ewk_tile_unused_cache_thaw(t m->tuc);199 ewk_tile_unused_cache_unref(t m->tuc);200 201 #ifdef DEBUG_MEM_LEAKS 202 tiles = t m->stats.tiles.allocated - tm->stats.tiles.freed;203 bytes = t m->stats.bytes.allocated - tm->stats.bytes.freed;193 EINA_SAFETY_ON_NULL_RETURN(tileMatrix); 194 ewk_tile_unused_cache_freeze(tileMatrix->tuc); 195 196 eina_matrixsparse_free(tileMatrix->matrix); 197 198 ewk_tile_unused_cache_thaw(tileMatrix->tuc); 199 ewk_tile_unused_cache_unref(tileMatrix->tuc); 200 201 #ifdef DEBUG_MEM_LEAKS 202 tiles = tileMatrix->stats.tiles.allocated - tileMatrix->stats.tiles.freed; 203 bytes = tileMatrix->stats.bytes.allocated - tileMatrix->stats.bytes.freed; 204 204 205 205 tiles_leaked += tiles; … … 207 207 208 208 if (tiles || bytes) 209 ERR("tiled matrix leaked: tiles[+%" PRIu64",-%"PRIu64":%"PRIu64"] "210 "bytes[+%"PRIu64",-%"PRIu64":%"PRIu64"]",211 t m->stats.tiles.allocated, tm->stats.tiles.freed, tiles,212 t m->stats.bytes.allocated, tm->stats.bytes.freed, bytes);209 ERR("tiled matrix leaked: tiles[+%" PRIu64 ",-%" PRIu64 ":%" PRIu64 "] " 210 "bytes[+%" PRIu64 ",-%" PRIu64 ":%" PRIu64 "]", 211 tileMatrix->stats.tiles.allocated, tileMatrix->stats.tiles.freed, tiles, 212 tileMatrix->stats.bytes.allocated, tileMatrix->stats.bytes.freed, bytes); 213 213 else if (tiles_leaked || bytes_leaked) 214 WRN("tiled matrix had no leaks: tiles[+%" PRIu64",-%"PRIu64"] "215 "bytes[+%"PRIu64",-%"PRIu64"], but some other leaked "216 "%" PRIu64" tiles (%"PRIu64" bytes)",217 t m->stats.tiles.allocated, tm->stats.tiles.freed,218 t m->stats.bytes.allocated, tm->stats.bytes.freed,214 WRN("tiled matrix had no leaks: tiles[+%" PRIu64 ",-%" PRIu64 "] " 215 "bytes[+%" PRIu64 ",-%" PRIu64 "], but some other leaked " 216 "%" PRIu64 " tiles (%" PRIu64 " bytes)", 217 tileMatrix->stats.tiles.allocated, tileMatrix->stats.tiles.freed, 218 tileMatrix->stats.bytes.allocated, tileMatrixm->stats.bytes.freed, 219 219 tiles_leaked, bytes_leaked); 220 220 else 221 INF("tiled matrix had no leaks: tiles[+%" PRIu64",-%"PRIu64"] "222 "bytes[+%"PRIu64",-%"PRIu64"]",223 t m->stats.tiles.allocated, tm->stats.tiles.freed,224 t m->stats.bytes.allocated, tm->stats.bytes.freed);225 #endif 226 227 free(t m);221 INF("tiled matrix had no leaks: tiles[+%" PRIu64 ",-%" PRIu64 "] " 222 "bytes[+%" PRIu64 ",-%" PRIu64 "]", 223 tileMatrix->stats.tiles.allocated, tileMatrix->stats.tiles.freed, 224 tileMatrix->stats.bytes.allocated, tileMatrix->stats.bytes.freed); 225 #endif 226 227 free(tileMatrix); 228 228 } 229 229 … … 231 231 * Resize matrix to given number of rows and columns. 232 232 */ 233 void ewk_tile_matrix_resize(Ewk_Tile_Matrix *tm, unsigned long cols, unsigned long rows)234 { 235 EINA_SAFETY_ON_NULL_RETURN(t m);236 eina_matrixsparse_size_set(t m->matrix, rows, cols);233 void ewk_tile_matrix_resize(Ewk_Tile_Matrix* tileMatrix, unsigned long cols, unsigned long rows) 234 { 235 EINA_SAFETY_ON_NULL_RETURN(tileMatrix); 236 eina_matrixsparse_size_set(tileMatrix->matrix, rows, cols); 237 237 } 238 238 … … 242 242 * No reference is taken to the cache. 243 243 */ 244 Ewk_Tile_Unused_Cache *ewk_tile_matrix_unused_cache_get(const Ewk_Tile_Matrix *tm)245 { 246 EINA_SAFETY_ON_NULL_RETURN_VAL(t m, 0);247 return t m->tuc;244 Ewk_Tile_Unused_Cache* ewk_tile_matrix_unused_cache_get(const Ewk_Tile_Matrix* tileMatrix) 245 { 246 EINA_SAFETY_ON_NULL_RETURN_VAL(tileMatrix, 0); 247 return tileMatrix->tuc; 248 248 } 249 249 … … 251 251 * Get the exact tile for the given position and zoom. 252 252 * 253 * If the tile was unused then it's removed from the cache.253 * If the tile.widthas unused then it's removed from the cache. 254 254 * 255 255 * After usage, please give it back using … … 257 257 * then use ewk_tile_matrix_tile_exact_exists(). 258 258 * 259 * @param t mthe tile matrix to get tile from.260 * @param col the column number.259 * @param tileMatrix the tile matrix to get tile from. 260 * @param column the column number. 261 261 * @param row the row number. 262 262 * @param zoom the exact zoom to use. … … 269 269 * @see ewk_tile_matrix_tile_exact_get() 270 270 */ 271 Ewk_Tile *ewk_tile_matrix_tile_exact_get(Ewk_Tile_Matrix *tm, unsigned long col, unsigned long row, float zoom)272 { 273 Ewk_Tile* t = static_cast<Ewk_Tile*>(eina_matrixsparse_data_idx_get(tm->matrix, row, col));274 if (!t )271 Ewk_Tile* ewk_tile_matrix_tile_exact_get(Ewk_Tile_Matrix* tileMatrix, unsigned long column, unsigned long row, float zoom) 272 { 273 Ewk_Tile* tile = static_cast<Ewk_Tile*>(eina_matrixsparse_data_idx_get(tileMatrix->matrix, row, column)); 274 if (!tile) 275 275 return 0; 276 276 277 if (t ->zoom == zoom)277 if (tile->zoom == zoom) 278 278 goto end; 279 279 280 281 if (!t ->visible) {282 if (!ewk_tile_unused_cache_tile_get(t m->tuc, t))280 end: 281 if (!tile->visible) { 282 if (!ewk_tile_unused_cache_tile_get(tileMatrix->tuc, tile)) 283 283 WRN("Ewk_Tile was unused but not in cache? bug!"); 284 284 } 285 285 286 return t ;286 return tile; 287 287 } 288 288 … … 290 290 * Checks if tile of given zoom exists in matrix. 291 291 * 292 * @param t mthe tile matrix to check tile existence.293 * @param col the column number.292 * @param tileMatrix the tile matrix to check tile existence. 293 * @param column the column number. 294 294 * @param row the row number. 295 295 * @param zoom the exact zoom to query. … … 299 299 * @see ewk_tile_matrix_tile_exact_get() 300 300 */ 301 Eina_Bool ewk_tile_matrix_tile_exact_exists(Ewk_Tile_Matrix *tm, unsigned long col, unsigned long row, float zoom)302 { 303 if (!eina_matrixsparse_data_idx_get(t m->matrix, row, col))301 Eina_Bool ewk_tile_matrix_tile_exact_exists(Ewk_Tile_Matrix* tileMatrix, unsigned long column, unsigned long row, float zoom) 302 { 303 if (!eina_matrixsparse_data_idx_get(tileMatrix->matrix, row, column)) 304 304 return EINA_FALSE; 305 305 … … 314 314 * ewk_tile_matrix_tile_put() to give it back to matrix. 315 315 * 316 * @param t mthe tile matrix to create tile on.317 * @param col the column number.316 * @param tileMatrix the tile matrix to create tile on. 317 * @param column the column number. 318 318 * @param row the row number. 319 319 * @param zoom the level to create tile, used to determine tile size. 320 320 */ 321 Ewk_Tile *ewk_tile_matrix_tile_new(Ewk_Tile_Matrix *tm, Evas *evas, unsigned long col, unsigned long row, float zoom)321 Ewk_Tile* ewk_tile_matrix_tile_new(Ewk_Tile_Matrix* tileMatrix, Evas* canvas, unsigned long column, unsigned long row, float zoom) 322 322 { 323 323 Evas_Coord tw, th; 324 Ewk_Tile *t;325 326 EINA_SAFETY_ON_NULL_RETURN_VAL(t m, 0);324 Ewk_Tile* tile; 325 326 EINA_SAFETY_ON_NULL_RETURN_VAL(tileMatrix, 0); 327 327 EINA_SAFETY_ON_FALSE_RETURN_VAL(zoom > 0.0, 0); 328 328 329 tw = t m->tile.w;330 th = t m->tile.h;331 332 t = ewk_tile_new(evas, tw, th, zoom, tm->cspace);333 if (!t ) {334 ERR("could not create tile %dx%d at %f, cspace=%d", tw, th, (double)zoom, t m->cspace);329 tw = tileMatrix->tile.width; 330 th = tileMatrix->tile.height; 331 332 tile = ewk_tile_new(canvas, tw, th, zoom, tileMatrix->cspace); 333 if (!tile) { 334 ERR("could not create tile %dx%d at %f, cspace=%d", tw, th, (double)zoom, tileMatrix->cspace); 335 335 return 0; 336 336 } 337 337 338 if (!eina_matrixsparse_data_idx_set(t m->matrix, row, col, t)) {338 if (!eina_matrixsparse_data_idx_set(tileMatrix->matrix, row, column, tile)) { 339 339 ERR("could not set matrix cell, row/col outside matrix dimensions!"); 340 ewk_tile_free(t );340 ewk_tile_free(tile); 341 341 return 0; 342 342 } 343 343 344 t ->col = col;345 t ->row = row;346 t ->x = col* tw;347 t ->y = row * th;348 349 cairo_translate(t ->cairo, -t->x, -t->y);350 351 t ->stats.full_update = EINA_TRUE;352 t m->updates = eina_list_append(tm->updates, t);353 354 #ifdef DEBUG_MEM_LEAKS 355 t m->stats.bytes.allocated += t->bytes;356 t m->stats.tiles.allocated++;357 #endif 358 359 return t ;344 tile->col = column; 345 tile->row = row; 346 tile->x = column * tw; 347 tile->y = row * th; 348 349 cairo_translate(tile->cairo, -tile->x, -tile->y); 350 351 tile->stats.full_update = EINA_TRUE; 352 tileMatrix->updates = eina_list_append(tileMatrix->updates, tile); 353 354 #ifdef DEBUG_MEM_LEAKS 355 tileMatrix->stats.bytes.allocated += tile->bytes; 356 tileMatrix->stats.tiles.allocated++; 357 #endif 358 359 return tile; 360 360 } 361 361 … … 367 367 * 368 368 * Any previous reference to tile should be released 369 * (ewk_tile _hide()) before calling this function, so it will369 * (ewk_tile.heightide()) before calling this function, so it will 370 370 * be known if it is not visibile anymore and thus can be put into the 371 371 * unused cache. 372 372 * 373 * @param t mthe tile matrix to return tile to.373 * @param tileMatrix the tile matrix to return tile to. 374 374 * @param t the tile instance to return, must @b not be @c 0. 375 * @param last_used time in which tile was last used.375 * @param last_used time in which tile.widthas last used. 376 376 * 377 377 * @return #EINA_TRUE on success or #EINA_FALSE on failure. 378 378 */ 379 Eina_Bool ewk_tile_matrix_tile_put(Ewk_Tile_Matrix *tm, Ewk_Tile *t, double last_used)380 { 381 EINA_SAFETY_ON_NULL_RETURN_VAL(t m, EINA_FALSE);382 EINA_SAFETY_ON_NULL_RETURN_VAL(t , EINA_FALSE);383 384 if (t ->visible)379 Eina_Bool ewk_tile_matrix_tile_put(Ewk_Tile_Matrix* tileMatrix, Ewk_Tile* tile, double lastUsed) 380 { 381 EINA_SAFETY_ON_NULL_RETURN_VAL(tileMatrix, EINA_FALSE); 382 EINA_SAFETY_ON_NULL_RETURN_VAL(tile, EINA_FALSE); 383 384 if (tile->visible) 385 385 return EINA_TRUE; 386 386 387 t ->stats.last_used = last_used;388 return ewk_tile_unused_cache_tile_put(t m->tuc, t, _ewk_tile_matrix_tile_free, tm);389 } 390 391 Eina_Bool ewk_tile_matrix_tile_update(Ewk_Tile_Matrix *tm, unsigned long col, unsigned long row, const Eina_Rectangle *update)387 tile->stats.last_used = lastUsed; 388 return ewk_tile_unused_cache_tile_put(tileMatrix->tuc, tile, _ewk_tile_matrix_tile_free, tileMatrix); 389 } 390 391 Eina_Bool ewk_tile_matrix_tile_update(Ewk_Tile_Matrix* tileMatrix, unsigned long col, unsigned long row, const Eina_Rectangle* update) 392 392 { 393 393 Eina_Rectangle new_update; 394 EINA_SAFETY_ON_NULL_RETURN_VAL(t m, EINA_FALSE);394 EINA_SAFETY_ON_NULL_RETURN_VAL(tileMatrix, EINA_FALSE); 395 395 EINA_SAFETY_ON_NULL_RETURN_VAL(update, EINA_FALSE); 396 396 … … 402 402 } 403 403 404 if (update->x + update->w - 1 >= t m->tile.w)405 new_update.w = t m->tile.w- update->x;406 if (update->y + update->h - 1 >= t m->tile.h)407 new_update.h = t m->tile.h- update->y;408 409 Ewk_Tile* t = static_cast<Ewk_Tile*>(eina_matrixsparse_data_idx_get(tm->matrix, row, col));410 if (!t )404 if (update->x + update->w - 1 >= tileMatrix->tile.width) 405 new_update.w = tileMatrix->tile.width - update->x; 406 if (update->y + update->h - 1 >= tileMatrix->tile.height) 407 new_update.h = tileMatrix->tile.height - update->y; 408 409 Ewk_Tile* tile = static_cast<Ewk_Tile*>(eina_matrixsparse_data_idx_get(tileMatrix->matrix, row, col)); 410 if (!tile) 411 411 return EINA_TRUE; 412 412 413 if (!t ->updates && !t->stats.full_update)414 t m->updates = eina_list_append(tm->updates, t);415 ewk_tile_update_area(t , &new_update);413 if (!tile->updates && !tile->stats.full_update) 414 tileMatrix->updates = eina_list_append(tileMatrix->updates, tile); 415 ewk_tile_update_area(tile, &new_update); 416 416 417 417 return EINA_TRUE; 418 418 } 419 419 420 Eina_Bool ewk_tile_matrix_tile_update_full(Ewk_Tile_Matrix *tm, unsigned long col, unsigned long row)421 { 422 Eina_Matrixsparse_Cell *cell;423 EINA_SAFETY_ON_NULL_RETURN_VAL(t m, EINA_FALSE);424 425 if (!eina_matrixsparse_cell_idx_get(t m->matrix, row, col, &cell))420 Eina_Bool ewk_tile_matrix_tile_update_full(Ewk_Tile_Matrix* tileMatrix, unsigned long column, unsigned long row) 421 { 422 Eina_Matrixsparse_Cell* cell; 423 EINA_SAFETY_ON_NULL_RETURN_VAL(tileMatrix, EINA_FALSE); 424 425 if (!eina_matrixsparse_cell_idx_get(tileMatrix->matrix, row, column, &cell)) 426 426 return EINA_FALSE; 427 427 … … 429 429 return EINA_TRUE; 430 430 431 Ewk_Tile* t = static_cast<Ewk_Tile*>(eina_matrixsparse_cell_data_get(cell));432 if (!t ) {431 Ewk_Tile* tile = static_cast<Ewk_Tile*>(eina_matrixsparse_cell_data_get(cell)); 432 if (!tile) { 433 433 CRITICAL("matrix cell with no tile!"); 434 434 return EINA_TRUE; 435 435 } 436 436 437 if (!t ->updates && !t->stats.full_update)438 t m->updates = eina_list_append(tm->updates, t);439 ewk_tile_update_full(t );437 if (!tile->updates && !tile->stats.full_update) 438 tileMatrix->updates = eina_list_append(tileMatrix->updates, tile); 439 ewk_tile_update_full(tile); 440 440 441 441 return EINA_TRUE; 442 442 } 443 443 444 void ewk_tile_matrix_tile_updates_clear(Ewk_Tile_Matrix *tm, Ewk_Tile *t)445 { 446 EINA_SAFETY_ON_NULL_RETURN(t m);447 if (!t ->updates && !t->stats.full_update)444 void ewk_tile_matrix_tile_updates_clear(Ewk_Tile_Matrix* tileMatrix, Ewk_Tile* tile) 445 { 446 EINA_SAFETY_ON_NULL_RETURN(tileMatrix); 447 if (!tile->updates && !tile->stats.full_update) 448 448 return; 449 ewk_tile_updates_clear(t );450 t m->updates = eina_list_remove(tm->updates, t);451 } 452 453 static Eina_Bool _ewk_tile_matrix_slicer_setup(Ewk_Tile_Matrix *tm, const Eina_Rectangle *area, float zoom, Eina_Tile_Grid_Slicer *slicer)449 ewk_tile_updates_clear(tile); 450 tileMatrix->updates = eina_list_remove(tileMatrix->updates, tile); 451 } 452 453 static Eina_Bool _ewk_tile_matrix_slicer_setup(Ewk_Tile_Matrix* tileMatrix, const Eina_Rectangle* area, float zoom, Eina_Tile_Grid_Slicer* slicer) 454 454 { 455 455 unsigned long rows, cols; 456 Evas_Coord x, y, w , h, tw, th;456 Evas_Coord x, y, width, height, tw, th; 457 457 458 458 if (area->w <= 0 || area->h <= 0) { … … 464 464 x = area->x; 465 465 y = area->y; 466 w = area->w;467 h = area->h;468 469 tw = t m->tile.w;470 th = t m->tile.h;466 width = area->w; 467 height = area->h; 468 469 tw = tileMatrix->tile.width; 470 th = tileMatrix->tile.height; 471 471 472 472 // cropping area region to fit matrix 473 eina_matrixsparse_size_get(t m->matrix, &rows, &cols);473 eina_matrixsparse_size_get(tileMatrix->matrix, &rows, &cols); 474 474 if (x < 0) { 475 w += x;475 width += x; 476 476 x = 0; 477 477 } 478 478 if (y < 0) { 479 h += y;479 height += y; 480 480 y = 0; 481 481 } 482 482 483 if (y + h - 1 > (long)(rows * th))484 h = rows * th - y;485 if (x + w - 1 > (long)(cols * tw))486 w = cols * tw - x;487 488 return eina_tile_grid_slicer_setup(slicer, x, y, w , h, tw, th);489 } 490 491 492 Eina_Bool ewk_tile_matrix_update(Ewk_Tile_Matrix *tm, const Eina_Rectangle *update, float zoom)493 { 494 const Eina_Tile_Grid_Info *info;483 if (y + height - 1 > (long)(rows * th)) 484 height = rows * th - y; 485 if (x + width - 1 > (long)(cols * tw)) 486 width = cols * tw - x; 487 488 return eina_tile_grid_slicer_setup(slicer, x, y, width, height, tw, th); 489 } 490 491 492 Eina_Bool ewk_tile_matrix_update(Ewk_Tile_Matrix* tileMatrix, const Eina_Rectangle* update, float zoom) 493 { 494 const Eina_Tile_Grid_Info* info; 495 495 Eina_Tile_Grid_Slicer slicer; 496 EINA_SAFETY_ON_NULL_RETURN_VAL(t m, EINA_FALSE);496 EINA_SAFETY_ON_NULL_RETURN_VAL(tileMatrix, EINA_FALSE); 497 497 EINA_SAFETY_ON_NULL_RETURN_VAL(update, EINA_FALSE); 498 498 … … 503 503 } 504 504 505 if (!_ewk_tile_matrix_slicer_setup(t m, update, zoom, &slicer)) {505 if (!_ewk_tile_matrix_slicer_setup(tileMatrix, update, zoom, &slicer)) { 506 506 ERR("Could not setup slicer for update %d,%d+%dx%d at zoom %f", 507 507 update->x, update->y, update->w, update->h, zoom); … … 514 514 row = info->row; 515 515 516 Ewk_Tile* t = static_cast<Ewk_Tile*>(eina_matrixsparse_data_idx_get(tm->matrix, row, col));517 if (!t )516 Ewk_Tile* tile = static_cast<Ewk_Tile*>(eina_matrixsparse_data_idx_get(tileMatrix->matrix, row, col)); 517 if (!tile) 518 518 continue; 519 519 520 if (!t ->updates && !t->stats.full_update)521 t m->updates = eina_list_append(tm->updates, t);520 if (!tile->updates && !tile->stats.full_update) 521 tileMatrix->updates = eina_list_append(tileMatrix->updates, tile); 522 522 if (info->full) 523 ewk_tile_update_full(t );523 ewk_tile_update_full(tile); 524 524 else 525 ewk_tile_update_area(t , &info->rect);525 ewk_tile_update_area(tile, &info->rect); 526 526 } 527 527 … … 530 530 } 531 531 532 void ewk_tile_matrix_updates_process(Ewk_Tile_Matrix *tm)533 { 534 Eina_List *l, *l_next;532 void ewk_tile_matrix_updates_process(Ewk_Tile_Matrix* tileMatrix) 533 { 534 Eina_List* l, * l_next; 535 535 void* item; 536 EINA_SAFETY_ON_NULL_RETURN(t m);536 EINA_SAFETY_ON_NULL_RETURN(tileMatrix); 537 537 538 538 // process updates, unflag tiles 539 EINA_LIST_FOREACH_SAFE(t m->updates, l, l_next, item) {539 EINA_LIST_FOREACH_SAFE(tileMatrix->updates, l, l_next, item) { 540 540 Ewk_Tile* tile = static_cast<Ewk_Tile*>(item); 541 ewk_tile_updates_process(tile, t m->render.cb, tm->render.data);541 ewk_tile_updates_process(tile, tileMatrix->render.cb, tileMatrix->render.data); 542 542 if (tile->visible) { 543 543 ewk_tile_updates_clear(tile); 544 t m->updates = eina_list_remove_list(tm->updates, l);544 tileMatrix->updates = eina_list_remove_list(tileMatrix->updates, l); 545 545 } 546 546 } 547 547 } 548 548 549 void ewk_tile_matrix_updates_clear(Ewk_Tile_Matrix *tm)549 void ewk_tile_matrix_updates_clear(Ewk_Tile_Matrix* tileMatrix) 550 550 { 551 551 void* item; 552 EINA_SAFETY_ON_NULL_RETURN(t m);553 554 EINA_LIST_FREE(t m->updates, item)552 EINA_SAFETY_ON_NULL_RETURN(tileMatrix); 553 554 EINA_LIST_FREE(tileMatrix->updates, item) 555 555 ewk_tile_updates_clear(static_cast<Ewk_Tile*>(item)); 556 t m->updates = 0;556 tileMatrix->updates = 0; 557 557 } 558 558 559 559 // remove me later! 560 void ewk_tile_matrix_dbg(const Ewk_Tile_Matrix *tm)561 { 562 Eina_Iterator *it = eina_matrixsparse_iterator_complete_new(tm->matrix);563 Eina_Matrixsparse_Cell *cell;560 void ewk_tile_matrix_dbg(const Ewk_Tile_Matrix* tileMatrix) 561 { 562 Eina_Iterator* it = eina_matrixsparse_iterator_complete_new(tileMatrix->matrix); 563 Eina_Matrixsparse_Cell* cell; 564 564 Eina_Bool last_empty = EINA_FALSE; 565 565 566 566 #ifdef DEBUG_MEM_LEAKS 567 printf("Ewk_Tile Matrix: tiles[+%" PRIu64",-%"PRIu64":%"PRIu64"] "568 "bytes[+%" PRIu64",-%"PRIu64":%"PRIu64"]\n",567 printf("Ewk_Tile Matrix: tiles[+%" PRIu64 ",-%" PRIu64 ":%" PRIu64 "] " 568 "bytes[+%" PRIu64 ",-%" PRIu64 ":%" PRIu64 "]\n", 569 569 tm->stats.tiles.allocated, tm->stats.tiles.freed, 570 570 tm->stats.tiles.allocated - tm->stats.tiles.freed, … … 579 579 eina_matrixsparse_cell_position_get(cell, &row, &col); 580 580 581 Ewk_Tile* t = static_cast<Ewk_Tile*>(eina_matrixsparse_cell_data_get(cell));582 if (!t ) {581 Ewk_Tile* tile = static_cast<Ewk_Tile*>(eina_matrixsparse_cell_data_get(cell)); 582 if (!tile) { 583 583 if (!last_empty) { 584 584 last_empty = EINA_TRUE; … … 591 591 printf("\n"); 592 592 } 593 printf("%3lu,%3lu %10p:", col, row, t );594 printf(" [%3lu,%3lu + %dx%d @ %0.3f]%c", t ->col, t->row, t->w, t->h, t->zoom, t->visible ? '*': ' ');593 printf("%3lu,%3lu %10p:", col, row, tile); 594 printf(" [%3lu,%3lu + %dx%d @ %0.3f]%c", tile->col, tile->row, tile->width, tile->height, tile->zoom, tile->visible ? '*' : ' '); 595 595 printf("\n"); 596 596 } … … 600 600 eina_iterator_free(it); 601 601 602 ewk_tile_unused_cache_dbg(t m->tuc);602 ewk_tile_unused_cache_dbg(tileMatrix->tuc); 603 603 } 604 604 … … 612 612 * @see ewk_tile_matrix_thaw() 613 613 */ 614 void ewk_tile_matrix_freeze(Ewk_Tile_Matrix *tm)615 { 616 EINA_SAFETY_ON_NULL_RETURN(t m);617 if (!t m->frozen)618 ewk_tile_unused_cache_freeze(t m->tuc);619 t m->frozen++;614 void ewk_tile_matrix_freeze(Ewk_Tile_Matrix* tileMatrix) 615 { 616 EINA_SAFETY_ON_NULL_RETURN(tileMatrix); 617 if (!tileMatrix->frozen) 618 ewk_tile_unused_cache_freeze(tileMatrix->tuc); 619 tileMatrix->frozen++; 620 620 } 621 621 … … 626 626 * will run immediately. 627 627 */ 628 void ewk_tile_matrix_thaw(Ewk_Tile_Matrix *tm)629 { 630 EINA_SAFETY_ON_NULL_RETURN(t m);631 if (!t m->frozen) {628 void ewk_tile_matrix_thaw(Ewk_Tile_Matrix* tileMatrix) 629 { 630 EINA_SAFETY_ON_NULL_RETURN(tileMatrix); 631 if (!tileMatrix->frozen) { 632 632 ERR("thawing more than freezing!"); 633 633 return; 634 634 } 635 635 636 t m->frozen--;637 if (!t m->frozen)638 ewk_tile_unused_cache_thaw(t m->tuc);639 } 636 tileMatrix->frozen--; 637 if (!tileMatrix->frozen) 638 ewk_tile_unused_cache_thaw(tileMatrix->tuc); 639 } -
trunk/Source/WebKit/efl/ewk/ewk_tiled_matrix.h
r95901 r97329 53 53 void ewk_tile_matrix_dbg(const Ewk_Tile_Matrix* tm); 54 54 void ewk_tile_unused_cache_dbg(const Ewk_Tile_Unused_Cache* tuc); 55 void ewk_tile_accounting_dbg( void);55 void ewk_tile_accounting_dbg(); 56 56 57 57 -
trunk/Source/WebKit/efl/ewk/ewk_tiled_model.cpp
r96495 r97329 37 37 #endif 38 38 39 #define IDX(col, row, rowspan) (col + (row * rowspan))39 #define IDX(col, row, rowspan) (col + (rowidth * rowspan)) 40 40 41 41 #ifdef DEBUG_MEM_LEAKS … … 54 54 55 55 static size_t accounting_len = 0; 56 static struct tile_account *accounting = 0;57 58 static inline struct tile_account *_ewk_tile_account_get(const Ewk_Tile *t)59 { 60 struct tile_account *acc;56 static struct tile_account* accounting = 0; 57 58 static inline struct tile_account* _ewk_tile_account_get(const Ewk_Tile* tile) 59 { 60 struct tile_account* acc; 61 61 size_t i; 62 62 63 63 for (i = 0; i < accounting_len; i++) { 64 if (accounting[i].size == t ->w)64 if (accounting[i].size == tile->width) 65 65 return accounting + i; 66 66 } … … 70 70 71 71 acc = accounting + accounting_len; 72 acc->size = t ->w;72 acc->size = tile->width; 73 73 acc->tiles.allocated = 0; 74 74 acc->tiles.freed = 0; … … 81 81 } 82 82 83 static inline void _ewk_tile_account_allocated(const Ewk_Tile *t)84 { 85 struct tile_account *acc = _ewk_tile_account_get(t);83 static inline void _ewk_tile_account_allocated(const Ewk_Tile* tile) 84 { 85 struct tile_account* acc = _ewk_tile_account_get(tile); 86 86 if (!acc) 87 87 return; 88 acc->bytes.allocated += t ->bytes;88 acc->bytes.allocated += tile->bytes; 89 89 acc->tiles.allocated++; 90 90 91 bytes_allocated += t ->bytes;91 bytes_allocated += tile->bytes; 92 92 tiles_allocated++; 93 93 } 94 94 95 static inline void _ewk_tile_account_freed(const Ewk_Tile *t)96 { 97 struct tile_account *acc = _ewk_tile_account_get(t);95 static inline void _ewk_tile_account_freed(const Ewk_Tile* tile) 96 { 97 struct tile_account* acc = _ewk_tile_account_get(tile); 98 98 if (!acc) 99 99 return; 100 100 101 acc->bytes.freed += t ->bytes;101 acc->bytes.freed += tile->bytes; 102 102 acc->tiles.freed++; 103 103 104 bytes_freed += t ->bytes;104 bytes_freed += tile->bytes; 105 105 tiles_freed++; 106 106 } 107 107 108 void ewk_tile_accounting_dbg( void)109 { 110 struct tile_account *acc;111 struct tile_account *acc_end;112 113 printf("TILE BALANCE: tiles[+%" PRIu64",-%"PRIu64":%"PRIu64"] "114 "bytes[+%" PRIu64",-%"PRIu64":%"PRIu64"]\n",115 116 108 void ewk_tile_accounting_dbg() 109 { 110 struct tile_account* acc; 111 struct tile_account* acc_end; 112 113 printf("TILE BALANCE: tiles[+%" PRIu64 ",-%" PRIu64 ":%" PRIu64 "] " 114 "bytes[+%" PRIu64 ",-%" PRIu64 ":%" PRIu64 "]\n", 115 tiles_allocated, tiles_freed, tiles_allocated - tiles_freed, 116 bytes_allocated, bytes_freed, bytes_allocated - bytes_freed); 117 117 118 118 if (!accounting_len) … … 128 128 bytes = acc->bytes.allocated - acc->bytes.freed; 129 129 130 printf(" %4d: tiles[+%4" PRIu64",-%4"PRIu64":%4"PRIu64"] "131 "bytes[+%8" PRIu64",-%8"PRIu64":%8"PRIu64"]%s\n",130 printf(" %4d: tiles[+%4" PRIu64 ",-%4" PRIu64 ":%4" PRIu64 "] " 131 "bytes[+%8" PRIu64 ",-%8" PRIu64 ":%8" PRIu64 "]%s\n", 132 132 acc->size, 133 133 acc->tiles.allocated, acc->tiles.freed, tiles, … … 139 139 #else 140 140 141 static inline void _ewk_tile_account_allocated(const Ewk_Tile *t) { }142 static inline void _ewk_tile_account_freed(const Ewk_Tile *t) { }143 144 void ewk_tile_accounting_dbg( void)141 static inline void _ewk_tile_account_allocated(const Ewk_Tile* tile) { } 142 static inline void _ewk_tile_account_freed(const Ewk_Tile* tile) { } 143 144 void ewk_tile_accounting_dbg() 145 145 { 146 146 printf("compile webkit with DEBUG_MEM_LEAKS defined!\n"); … … 148 148 #endif 149 149 150 static inline void _ewk_tile_paint_rgb888(Ewk_Tile *t, uint8_t r, uint8_t g, uint8_t b) 151 { 152 uint32_t *dst32, *dst32_end, c1; 153 uint64_t *dst64, *dst64_end, c2; 154 155 c1 = 0xff000000 | ((uint32_t)r << 16) | ((uint32_t)g << 8) | b; 156 c2 = ((uint64_t)c1 << 32) | c1; 157 158 dst64 = (uint64_t *)t->pixels; 159 dst64_end = dst64 + ((t->bytes / 8) & ~7); 150 static inline void _ewk_tile_paint_rgb888(Ewk_Tile* tile, uint8_t red, uint8_t green, uint8_t blue) 151 { 152 uint32_t c1 = 0xff000000 | ((uint32_t)red << 16) | ((uint32_t)green << 8) | blue; 153 uint32_t c2 = ((uint64_t)c1 << 32) | c1; 154 155 uint64_t* dst64 = (uint64_t*)tile->pixels; 156 uint64_t* dst64_end = dst64 + ((tile->bytes / 8) & ~7); 160 157 for (; dst64 < dst64_end; dst64 += 8) { 161 158 /* TODO: ARM add pld or NEON instructions */ … … 170 167 } 171 168 172 dst32 = (uint32_t*)dst64_end;173 dst32_end = (uint32_t *)(t->pixels + t->bytes);169 uint32_t* dst32 = (uint32_t*)dst64_end; 170 uint32_t* dst32_end = (uint32_t*)(tile->pixels + tile->bytes); 174 171 for (; dst32 < dst32_end; dst32++) 175 172 *dst32 = c1; 176 173 } 177 174 178 static inline void _ewk_tile_paint_rgb565(Ewk_Tile *t, uint8_t r, uint8_t g, uint8_t b)179 { 180 uint16_t *dst16, *dst16_end, c1;181 uint64_t *dst64, *dst64_end, c2;182 183 c1 = ((((r >> 3) & 0x1f) << 11) |184 (((g >> 2) & 0x3f) << 5) |185 ((b >> 3) & 0x1f));175 static inline void _ewk_tile_paint_rgb565(Ewk_Tile* tile, uint8_t red, uint8_t green, uint8_t blue) 176 { 177 uint16_t* dst16, * dst16_end, c1; 178 uint64_t* dst64, * dst64_end, c2; 179 180 c1 = ((((red >> 3) & 0x1f) << 11) | 181 (((green >> 2) & 0x3f) << 5) | 182 ((blue >> 3) & 0x1f)); 186 183 187 184 c2 = (((uint64_t)c1 << 48) | ((uint64_t)c1 << 32) | 188 185 ((uint64_t)c1 << 16) | c1); 189 186 190 dst64 = (uint64_t *)t->pixels;191 dst64_end = dst64 + ((t ->bytes / 8) & ~7);187 dst64 = (uint64_t*)tile->pixels; 188 dst64_end = dst64 + ((tile->bytes / 8) & ~7); 192 189 for (; dst64 < dst64_end; dst64 += 8) { 193 190 /* TODO: ARM add pld or NEON instructions */ … … 202 199 } 203 200 204 dst16 = (uint16_t 205 dst16_end = (uint16_t *)(t->pixels + t->bytes);201 dst16 = (uint16_t*)dst16_end; 202 dst16_end = (uint16_t*)(tile->pixels + tile->bytes); 206 203 for (; dst16 < dst16_end; dst16++) 207 204 *dst16 = c1; 208 205 } 209 206 210 static inline void _ewk_tile_paint(Ewk_Tile *t, uint8_t r, uint8_t g, uint8_t b)211 { 212 if (t ->cspace == EVAS_COLORSPACE_ARGB8888)213 _ewk_tile_paint_rgb888(t , r, g, b);214 else if (t ->cspace == EVAS_COLORSPACE_RGB565_A5P)215 _ewk_tile_paint_rgb565(t , r, g, b);207 static inline void _ewk_tile_paint(Ewk_Tile* tile, uint8_t red, uint8_t green, uint8_t blue) 208 { 209 if (tile->cspace == EVAS_COLORSPACE_ARGB8888) 210 _ewk_tile_paint_rgb888(tile, red, green, blue); 211 else if (tile->cspace == EVAS_COLORSPACE_RGB565_A5P) 212 _ewk_tile_paint_rgb565(tile, red, green, blue); 216 213 else 217 ERR("unknown color space: %d", t ->cspace);214 ERR("unknown color space: %d", tile->cspace); 218 215 } 219 216 … … 233 230 * @c stats.full_update and @c updates. 234 231 */ 235 Ewk_Tile *ewk_tile_new(Evas *evas, Evas_Coord w, Evas_Coord h, float zoom, Evas_Colorspace cspace)236 { 237 Evas_Coord *ec;238 Evas_Colorspace *ecs;239 float *f;240 size_t *s;241 Ewk_Tile *t;232 Ewk_Tile* ewk_tile_new(Evas* evas, Evas_Coord width, Evas_Coord height, float zoom, Evas_Colorspace colorSpace) 233 { 234 Evas_Coord* ec; 235 Evas_Colorspace* ecs; 236 float* f; 237 size_t* s; 238 Ewk_Tile* tile; 242 239 unsigned int area; 243 240 size_t bytes; … … 245 242 cairo_status_t status; 246 243 int stride; 247 Ecore_Evas *ee;248 const char *engine;249 250 area = w * h;251 252 if (c space == EVAS_COLORSPACE_ARGB8888) {244 Ecore_Evas* ee; 245 const char* engine; 246 247 area = width * height; 248 249 if (colorSpace == EVAS_COLORSPACE_ARGB8888) { 253 250 bytes = area * 4; 254 stride = w * 4;251 stride = width * 4; 255 252 format = CAIRO_FORMAT_ARGB32; 256 } else if (c space == EVAS_COLORSPACE_RGB565_A5P) {253 } else if (colorSpace == EVAS_COLORSPACE_RGB565_A5P) { 257 254 bytes = area * 2; 258 stride = w * 2;255 stride = width * 2; 259 256 format = CAIRO_FORMAT_RGB16_565; 260 257 } else { 261 ERR("unknown color space: %d", c space);258 ERR("unknown color space: %d", colorSpace); 262 259 return 0; 263 260 } 264 261 265 DBG("size: %dx%d (%d), zoom: %f, cspace=%d", w , h, area, (double)zoom, cspace);266 267 t = static_cast<Ewk_Tile*>(malloc(sizeof(Ewk_Tile)));268 if (!t )262 DBG("size: %dx%d (%d), zoom: %f, cspace=%d", width, height, area, (double)zoom, colorSpace); 263 264 tile = static_cast<Ewk_Tile*>(malloc(sizeof(Ewk_Tile))); 265 if (!tile) 269 266 return 0; 270 267 271 t ->image = evas_object_image_add(evas);268 tile->image = evas_object_image_add(evas); 272 269 273 270 ee = ecore_evas_ecore_evas_get(evas); 274 271 engine = ecore_evas_engine_name_get(ee); 275 272 if (engine && !strcmp(engine, "opengl_x11")) 276 evas_object_image_content_hint_set(t ->image, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);277 278 t ->visible = 0;279 t ->updates = 0;280 281 memset(&t ->stats, 0, sizeof(Ewk_Tile_Stats));282 t ->stats.area = area;273 evas_object_image_content_hint_set(tile->image, EVAS_IMAGE_CONTENT_HINT_DYNAMIC); 274 275 tile->visible = 0; 276 tile->updates = 0; 277 278 memset(&tile->stats, 0, sizeof(Ewk_Tile_Stats)); 279 tile->stats.area = area; 283 280 284 281 /* ugly, but let's avoid at all costs having users to modify those */ 285 ec = (Evas_Coord *)&t->w;286 *ec = w ;287 288 ec = (Evas_Coord *)&t->h;289 *ec = h ;290 291 ecs = (Evas_Colorspace *)&t->cspace;292 *ecs = c space;293 294 f = (float *)&t->zoom;282 ec = (Evas_Coord*)&tile->width; 283 *ec = width; 284 285 ec = (Evas_Coord*)&tile->height; 286 *ec = height; 287 288 ecs = (Evas_Colorspace*)&tile->cspace; 289 *ecs = colorSpace; 290 291 f = (float*)&tile->zoom; 295 292 *f = zoom; 296 293 297 s = (size_t *)&t->bytes;294 s = (size_t*)&tile->bytes; 298 295 *s = bytes; 299 296 300 evas_object_image_size_set(t ->image, t->w, t->h);301 evas_object_image_colorspace_set(t ->image, t->cspace);302 t ->pixels = static_cast<uint8_t*>(evas_object_image_data_get(t->image, EINA_TRUE));303 t ->surface = cairo_image_surface_create_for_data(t->pixels, format, w, h, stride);304 status = cairo_surface_status(t ->surface);297 evas_object_image_size_set(tile->image, tile->width, tile->height); 298 evas_object_image_colorspace_set(tile->image, tile->cspace); 299 tile->pixels = static_cast<uint8_t*>(evas_object_image_data_get(tile->image, EINA_TRUE)); 300 tile->surface = cairo_image_surface_create_for_data(tile->pixels, format, width, height, stride); 301 status = cairo_surface_status(tile->surface); 305 302 if (status != CAIRO_STATUS_SUCCESS) { 306 303 ERR("failed to create cairo surface: %s", 307 304 cairo_status_to_string(status)); 308 free(t );305 free(tile); 309 306 return 0; 310 307 } 311 308 312 t ->cairo = cairo_create(t->surface);313 status = cairo_status(t ->cairo);309 tile->cairo = cairo_create(tile->surface); 310 status = cairo_status(tile->cairo); 314 311 if (status != CAIRO_STATUS_SUCCESS) { 315 312 ERR("failed to create cairo: %s", cairo_status_to_string(status)); 316 cairo_surface_destroy(t ->surface);317 evas_object_del(t ->image);318 free(t );313 cairo_surface_destroy(tile->surface); 314 evas_object_del(tile->image); 315 free(tile); 319 316 return 0; 320 317 } 321 318 322 _ewk_tile_account_allocated(t );323 324 return t ;319 _ewk_tile_account_allocated(tile); 320 321 return tile; 325 322 } 326 323 … … 328 325 * Free tile memory. 329 326 */ 330 void ewk_tile_free(Ewk_Tile *t)331 { 332 _ewk_tile_account_freed(t );333 334 if (t ->updates)335 eina_tiler_free(t ->updates);336 337 cairo_surface_destroy(t ->surface);338 cairo_destroy(t ->cairo);339 evas_object_del(t ->image);340 free(t );327 void ewk_tile_free(Ewk_Tile* tile) 328 { 329 _ewk_tile_account_freed(tile); 330 331 if (tile->updates) 332 eina_tiler_free(tile->updates); 333 334 cairo_surface_destroy(tile->surface); 335 cairo_destroy(tile->cairo); 336 evas_object_del(tile->image); 337 free(tile); 341 338 } 342 339 … … 344 341 * Make the tile visible, incrementing its counter. 345 342 */ 346 void ewk_tile_show(Ewk_Tile *t)347 { 348 t ->visible++;349 evas_object_show(t ->image);343 void ewk_tile_show(Ewk_Tile* tile) 344 { 345 tile->visible++; 346 evas_object_show(tile->image); 350 347 } 351 348 … … 353 350 * Decrement the visibility counter, making it invisible if necessary. 354 351 */ 355 void ewk_tile_hide(Ewk_Tile *t)356 { 357 t ->visible--;358 if (!t ->visible)359 evas_object_hide(t ->image);352 void ewk_tile_hide(Ewk_Tile* tile) 353 { 354 tile->visible--; 355 if (!tile->visible) 356 evas_object_hide(tile->image); 360 357 } 361 358 … … 363 360 * Returns EINA_TRUE if the tile is visible, EINA_FALSE otherwise. 364 361 */ 365 Eina_Bool ewk_tile_visible_get(Ewk_Tile *t)366 { 367 return !!t ->visible;362 Eina_Bool ewk_tile_visible_get(Ewk_Tile* tile) 363 { 364 return !!tile->visible; 368 365 } 369 366 … … 371 368 * Mark whole tile as dirty and requiring update. 372 369 */ 373 void ewk_tile_update_full(Ewk_Tile *t)370 void ewk_tile_update_full(Ewk_Tile* tile) 374 371 { 375 372 /* TODO: list of tiles pending updates? */ 376 t ->stats.misses++;377 378 if (!t ->stats.full_update) {379 t ->stats.full_update = EINA_TRUE;380 if (t ->updates) {381 eina_tiler_free(t ->updates);382 t ->updates = 0;373 tile->stats.misses++; 374 375 if (!tile->stats.full_update) { 376 tile->stats.full_update = EINA_TRUE; 377 if (tile->updates) { 378 eina_tiler_free(tile->updates); 379 tile->updates = 0; 383 380 } 384 381 } … … 388 385 * Mark the specific subarea as dirty and requiring update. 389 386 */ 390 void ewk_tile_update_area(Ewk_Tile *t, const Eina_Rectangle *r)387 void ewk_tile_update_area(Ewk_Tile* tile, const Eina_Rectangle* rect) 391 388 { 392 389 /* TODO: list of tiles pending updates? */ 393 t ->stats.misses++;394 395 if (t ->stats.full_update)390 tile->stats.misses++; 391 392 if (tile->stats.full_update) 396 393 return; 397 394 398 if (!r ->x && !r->y && r->w == t->w && r->h == t->h) {399 t ->stats.full_update = EINA_TRUE;400 if (t ->updates) {401 eina_tiler_free(t ->updates);402 t ->updates = 0;395 if (!rect->x && !rect->y && rect->w == tile->width && rect->h == tile->height) { 396 tile->stats.full_update = EINA_TRUE; 397 if (tile->updates) { 398 eina_tiler_free(tile->updates); 399 tile->updates = 0; 403 400 } 404 401 return; 405 402 } 406 403 407 if (!t ->updates) {408 t ->updates = eina_tiler_new(t->w, t->h);409 if (!t ->updates) {410 CRITICAL("could not create eina_tiler %dx%d.", t ->w, t->h);404 if (!tile->updates) { 405 tile->updates = eina_tiler_new(tile->width, tile->height); 406 if (!tile->updates) { 407 CRITICAL("could not create eina_tiler %dx%d.", tile->width, tile->height); 411 408 return; 412 409 } 413 410 } 414 411 415 eina_tiler_rect_add(t ->updates, r);412 eina_tiler_rect_add(tile->updates, rect); 416 413 } 417 414 … … 422 419 * updates, use ewk_tile_updates_clear() for that. 423 420 */ 424 void ewk_tile_updates_process(Ewk_Tile *t, void (*cb)(void *data, Ewk_Tile *t, const Eina_Rectangle *update), const void *data)425 { 426 if (t ->stats.full_update) {427 Eina_Rectangle r ;428 r .x = 0;429 r .y = 0;430 r .w = t->w;431 r .h = t->h;421 void ewk_tile_updates_process(Ewk_Tile* tile, void (*callback)(void* data, Ewk_Tile* tile, const Eina_Rectangle* update), const void* data) 422 { 423 if (tile->stats.full_update) { 424 Eina_Rectangle rect; 425 rect.x = 0; 426 rect.y = 0; 427 rect.w = tile->width; 428 rect.h = tile->height; 432 429 #ifdef TILE_STATS_ACCOUNT_RENDER_TIME 433 430 struct timeval timev; 434 431 double render_start; 435 432 gettimeofday(&timev, 0); 436 render_start = (double)timev.tv_sec +437 (((double)timev.tv_usec) / 1000000);433 render_startile = (double)timev.tv_sec + 434 (((double)timev.tv_usec) / 1000000); 438 435 #endif 439 c b((void *)data, t, &r);436 callback((void*)data, tile, &rect); 440 437 #ifdef TILE_STATS_ACCOUNT_RENDER_TIME 441 438 gettimeofday(&timev, 0); 442 t ->stats.render_time = (double)timev.tv_sec +443 (((double)timev.tv_usec) / 1000000) - render_start;439 tile->stats.render_time = (double)timev.tv_sec + 440 (((double)timev.tv_usec) / 1000000) - render_start; 444 441 #endif 445 } else if (t ->updates) {446 Eina_Iterator *itr = eina_tiler_iterator_new(t->updates);447 Eina_Rectangle *r;442 } else if (tile->updates) { 443 Eina_Iterator* itr = eina_tiler_iterator_new(tile->updates); 444 Eina_Rectangle* rect; 448 445 if (!itr) { 449 446 CRITICAL("could not create tiler iterator!"); 450 447 return; 451 448 } 452 EINA_ITERATOR_FOREACH(itr, r )453 c b((void *)data, t, r);449 EINA_ITERATOR_FOREACH(itr, rect) 450 callback((void*)data, tile, rect); 454 451 eina_iterator_free(itr); 455 452 } … … 460 457 * 461 458 * This will change the tile statistics, specially zero stat.misses 462 * and unset stats.full_update. If t ->updates existed, then it will be459 * and unset stats.full_update. If tile->updates existed, then it will be 463 460 * destroyed. 464 461 * … … 466 463 * called. 467 464 */ 468 void ewk_tile_updates_clear(Ewk_Tile *t)465 void ewk_tile_updates_clear(Ewk_Tile* tile) 469 466 { 470 467 /* TODO: remove from list of pending updates? */ 471 t ->stats.misses = 0;472 473 if (t ->stats.full_update)474 t ->stats.full_update = 0;475 else if (t ->updates) {476 eina_tiler_free(t ->updates);477 t ->updates = 0;468 tile->stats.misses = 0; 469 470 if (tile->stats.full_update) 471 tile->stats.full_update = 0; 472 else if (tile->updates) { 473 eina_tiler_free(tile->updates); 474 tile->updates = 0; 478 475 } 479 476 } … … 481 478 typedef struct _Ewk_Tile_Unused_Cache_Entry Ewk_Tile_Unused_Cache_Entry; 482 479 struct _Ewk_Tile_Unused_Cache_Entry { 483 Ewk_Tile *tile;480 Ewk_Tile* tile; 484 481 int weight; 485 482 struct { 486 void (*cb)(void *data, Ewk_Tile *t);487 void *data;483 void (*cb)(void* data, Ewk_Tile* tile); 484 void* data; 488 485 } tile_free; 489 486 }; … … 491 488 struct _Ewk_Tile_Unused_Cache { 492 489 struct { 493 Eina_List *list;490 Eina_List* list; 494 491 size_t count; 495 492 size_t allocated; … … 523 520 * possible to allocate memory, @c 0 is returned. 524 521 */ 525 Ewk_Tile_Unused_Cache *ewk_tile_unused_cache_new(size_t max)526 { 527 Ewk_Tile_Unused_Cache *tuc;528 529 t uc= static_cast<Ewk_Tile_Unused_Cache*>(calloc(1, sizeof(Ewk_Tile_Unused_Cache)));530 if (!t uc)522 Ewk_Tile_Unused_Cache* ewk_tile_unused_cache_new(size_t max) 523 { 524 Ewk_Tile_Unused_Cache* tileUnusedCache; 525 526 tileUnusedCache = static_cast<Ewk_Tile_Unused_Cache*>(calloc(1, sizeof(Ewk_Tile_Unused_Cache))); 527 if (!tileUnusedCache) 531 528 return 0; 532 529 533 DBG("t uc=%p", tuc);534 t uc->memory.max = max;535 t uc->references = 1;536 return t uc;537 } 538 539 void ewk_tile_unused_cache_lock_area(Ewk_Tile_Unused_Cache *tuc, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, float zoom)540 { 541 EINA_SAFETY_ON_NULL_RETURN(t uc);542 543 t uc->locked.locked = EINA_TRUE;544 t uc->locked.x = x;545 t uc->locked.y = y;546 t uc->locked.w = w;547 t uc->locked.h = h;548 t uc->locked.zoom = zoom;549 } 550 551 void ewk_tile_unused_cache_unlock_area(Ewk_Tile_Unused_Cache *tuc)552 { 553 EINA_SAFETY_ON_NULL_RETURN(t uc);554 555 t uc->locked.locked = EINA_FALSE;530 DBG("tileUnusedCache=%p", tileUnusedCache); 531 tileUnusedCache->memory.max = max; 532 tileUnusedCache->references = 1; 533 return tileUnusedCache; 534 } 535 536 void ewk_tile_unused_cache_lock_area(Ewk_Tile_Unused_Cache* tileUnusedCache, Evas_Coord x, Evas_Coord y, Evas_Coord width, Evas_Coord height, float zoom) 537 { 538 EINA_SAFETY_ON_NULL_RETURN(tileUnusedCache); 539 540 tileUnusedCache->locked.locked = EINA_TRUE; 541 tileUnusedCache->locked.x = x; 542 tileUnusedCache->locked.y = y; 543 tileUnusedCache->locked.w = width; 544 tileUnusedCache->locked.h = height; 545 tileUnusedCache->locked.zoom = zoom; 546 } 547 548 void ewk_tile_unused_cache_unlock_area(Ewk_Tile_Unused_Cache* tileUnusedCache) 549 { 550 EINA_SAFETY_ON_NULL_RETURN(tileUnusedCache); 551 552 tileUnusedCache->locked.locked = EINA_FALSE; 556 553 } 557 554 … … 568 565 * @see ewk_tile_unused_cache_unref() 569 566 */ 570 static void _ewk_tile_unused_cache_free(Ewk_Tile_Unused_Cache *tuc)571 { 572 EINA_SAFETY_ON_NULL_RETURN(t uc);573 574 DBG("t uc=%p, "567 static void _ewk_tile_unused_cache_free(Ewk_Tile_Unused_Cache* tileUnusedCache) 568 { 569 EINA_SAFETY_ON_NULL_RETURN(tileUnusedCache); 570 571 DBG("tileUnusedCache=%p, " 575 572 "entries=(count:%zd, allocated:%zd), " 576 573 "memory=(max:%zd, used:%zd)", 577 t uc, tuc->entries.count, tuc->entries.allocated,578 t uc->memory.max, tuc->memory.used);579 580 ewk_tile_unused_cache_clear(t uc);581 free(t uc);574 tileUnusedCache, tileUnusedCache->entries.count, tileUnusedCache->entries.allocated, 575 tileUnusedCache->memory.max, tileUnusedCache->memory.used); 576 577 ewk_tile_unused_cache_clear(tileUnusedCache); 578 free(tileUnusedCache); 582 579 } 583 580 … … 588 585 * kept are those that aren't in the cache (i.e. that are visible). 589 586 */ 590 void ewk_tile_unused_cache_clear(Ewk_Tile_Unused_Cache *tuc)591 { 592 EINA_SAFETY_ON_NULL_RETURN(t uc);593 594 if (!t uc->entries.count)587 void ewk_tile_unused_cache_clear(Ewk_Tile_Unused_Cache* tileUnusedCache) 588 { 589 EINA_SAFETY_ON_NULL_RETURN(tileUnusedCache); 590 591 if (!tileUnusedCache->entries.count) 595 592 return; 596 593 597 594 void* item; 598 EINA_LIST_FREE(t uc->entries.list, item) {595 EINA_LIST_FREE(tileUnusedCache->entries.list, item) { 599 596 Ewk_Tile_Unused_Cache_Entry* itr = static_cast<Ewk_Tile_Unused_Cache_Entry*>(item); 600 597 itr->tile_free.cb(itr->tile_free.data, itr->tile); … … 602 599 } 603 600 604 t uc->memory.used = 0;605 t uc->entries.count = 0;606 } 607 608 /** 609 * Hold reference to cache.601 tileUnusedCache->memory.used = 0; 602 tileUnusedCache->entries.count = 0; 603 } 604 605 /** 606 * heightold reference to cache. 610 607 * 611 608 * @return same pointer as taken. … … 613 610 * @see ewk_tile_unused_cache_unref() 614 611 */ 615 Ewk_Tile_Unused_Cache *ewk_tile_unused_cache_ref(Ewk_Tile_Unused_Cache *tuc)616 { 617 EINA_SAFETY_ON_NULL_RETURN_VAL(t uc, 0);618 t uc->references++;619 return t uc;612 Ewk_Tile_Unused_Cache* ewk_tile_unused_cache_ref(Ewk_Tile_Unused_Cache* tileUnusedCache) 613 { 614 EINA_SAFETY_ON_NULL_RETURN_VAL(tileUnusedCache, 0); 615 tileUnusedCache->references++; 616 return tileUnusedCache; 620 617 } 621 618 … … 626 623 * @see ewk_tile_unused_cache_free() 627 624 */ 628 void ewk_tile_unused_cache_unref(Ewk_Tile_Unused_Cache *tuc)629 { 630 EINA_SAFETY_ON_NULL_RETURN(t uc);631 t uc->references--;632 if (!t uc->references)633 _ewk_tile_unused_cache_free(t uc);634 } 635 636 void ewk_tile_unused_cache_max_set(Ewk_Tile_Unused_Cache *tuc, size_t max)637 { 638 EINA_SAFETY_ON_NULL_RETURN(t uc);639 t uc->memory.max = max;640 } 641 642 size_t ewk_tile_unused_cache_max_get(const Ewk_Tile_Unused_Cache *tuc)643 { 644 EINA_SAFETY_ON_NULL_RETURN_VAL(t uc, 0);645 return t uc->memory.max;646 } 647 648 size_t ewk_tile_unused_cache_used_get(const Ewk_Tile_Unused_Cache *tuc)649 { 650 EINA_SAFETY_ON_NULL_RETURN_VAL(t uc, 0);651 return t uc->memory.used;652 } 653 654 size_t ewk_tile_unused_cache_flush(Ewk_Tile_Unused_Cache *tuc, size_t bytes)655 { 656 Eina_List *l, *l_next;657 EINA_SAFETY_ON_NULL_RETURN_VAL(t uc, 0);625 void ewk_tile_unused_cache_unref(Ewk_Tile_Unused_Cache* tileUnusedCache) 626 { 627 EINA_SAFETY_ON_NULL_RETURN(tileUnusedCache); 628 tileUnusedCache->references--; 629 if (!tileUnusedCache->references) 630 _ewk_tile_unused_cache_free(tileUnusedCache); 631 } 632 633 void ewk_tile_unused_cache_max_set(Ewk_Tile_Unused_Cache* tileUnusedCache, size_t max) 634 { 635 EINA_SAFETY_ON_NULL_RETURN(tileUnusedCache); 636 tileUnusedCache->memory.max = max; 637 } 638 639 size_t ewk_tile_unused_cache_max_get(const Ewk_Tile_Unused_Cache* tileUnusedCache) 640 { 641 EINA_SAFETY_ON_NULL_RETURN_VAL(tileUnusedCache, 0); 642 return tileUnusedCache->memory.max; 643 } 644 645 size_t ewk_tile_unused_cache_used_get(const Ewk_Tile_Unused_Cache* tileUnusedCache) 646 { 647 EINA_SAFETY_ON_NULL_RETURN_VAL(tileUnusedCache, 0); 648 return tileUnusedCache->memory.used; 649 } 650 651 size_t ewk_tile_unused_cache_flush(Ewk_Tile_Unused_Cache* tileUnusedCache, size_t bytes) 652 { 653 Eina_List* l, * l_next; 654 EINA_SAFETY_ON_NULL_RETURN_VAL(tileUnusedCache, 0); 658 655 size_t done; 659 656 unsigned int count; 660 657 661 if (!t uc->entries.count)658 if (!tileUnusedCache->entries.count) 662 659 return 0; 663 660 if (bytes < 1) … … 672 669 done = 0; 673 670 count = 0; 674 EINA_LIST_FOREACH_SAFE(t uc->entries.list, l, l_next, item) {671 EINA_LIST_FOREACH_SAFE(tileUnusedCache->entries.list, l, l_next, item) { 675 672 Ewk_Tile_Unused_Cache_Entry* itr = static_cast<Ewk_Tile_Unused_Cache_Entry*>(item); 676 Ewk_Tile *t= itr->tile;673 Ewk_Tile* tile = itr->tile; 677 674 if (done > bytes) 678 675 break; 679 if (t uc->locked.locked680 && t ->x + t->w > tuc->locked.x681 && t ->y + t->h > tuc->locked.y682 && t ->x < tuc->locked.x + tuc->locked.w683 && t ->y < tuc->locked.y + tuc->locked.h684 && t ->zoom == tuc->locked.zoom) {676 if (tileUnusedCache->locked.locked 677 && tile->x + tile->width > tileUnusedCache->locked.x 678 && tile->y + tile->height > tileUnusedCache->locked.y 679 && tile->x < tileUnusedCache->locked.x + tileUnusedCache->locked.w 680 && tile->y < tileUnusedCache->locked.y + tileUnusedCache->locked.h 681 && tile->zoom == tileUnusedCache->locked.zoom) { 685 682 continue; 686 683 } 687 684 done += sizeof(Ewk_Tile) + itr->tile->bytes; 688 685 itr->tile_free.cb(itr->tile_free.data, itr->tile); 689 t uc->entries.list = eina_list_remove_list(tuc->entries.list, l);686 tileUnusedCache->entries.list = eina_list_remove_list(tileUnusedCache->entries.list, l); 690 687 free(itr); 691 688 count++; 692 689 } 693 690 694 t uc->memory.used -= done;695 t uc->entries.count -= count;691 tileUnusedCache->memory.used -= done; 692 tileUnusedCache->entries.count -= count; 696 693 697 694 return done; 698 695 } 699 696 700 void ewk_tile_unused_cache_auto_flush(Ewk_Tile_Unused_Cache *tuc)701 { 702 EINA_SAFETY_ON_NULL_RETURN(t uc);703 if (t uc->memory.used <= tuc->memory.max)697 void ewk_tile_unused_cache_auto_flush(Ewk_Tile_Unused_Cache* tileUnusedCache) 698 { 699 EINA_SAFETY_ON_NULL_RETURN(tileUnusedCache); 700 if (tileUnusedCache->memory.used <= tileUnusedCache->memory.max) 704 701 return; 705 ewk_tile_unused_cache_flush(t uc, tuc->memory.used - tuc->memory.max);706 if (t uc->memory.used > tuc->memory.max)702 ewk_tile_unused_cache_flush(tileUnusedCache, tileUnusedCache->memory.used - tileUnusedCache->memory.max); 703 if (tileUnusedCache->memory.used > tileUnusedCache->memory.max) 707 704 CRITICAL("Cache still using too much memory: %zd KB; max: %zd KB", 708 t uc->memory.used, tuc->memory.max);705 tileUnusedCache->memory.used, tileUnusedCache->memory.max); 709 706 } 710 707 … … 713 710 * 714 711 * Maintenance tasks optimize cache usage, but maybe we know we should 715 * h old on them until we do the last operation, in this case we freeze712 * heightold on them until we do the last operation, in this case we freeze 716 713 * while operating and then thaw when we're done. 717 714 * 718 715 * @see ewk_tile_unused_cache_thaw() 719 716 */ 720 void ewk_tile_unused_cache_freeze(Ewk_Tile_Unused_Cache *tuc)721 { 722 t uc->frozen++;717 void ewk_tile_unused_cache_freeze(Ewk_Tile_Unused_Cache* tileUnusedCache) 718 { 719 tileUnusedCache->frozen++; 723 720 } 724 721 … … 729 726 * will run immediately. 730 727 */ 731 void ewk_tile_unused_cache_thaw(Ewk_Tile_Unused_Cache *tuc)732 { 733 if (!t uc->frozen) {728 void ewk_tile_unused_cache_thaw(Ewk_Tile_Unused_Cache* tileUnusedCache) 729 { 730 if (!tileUnusedCache->frozen) { 734 731 ERR("thawing more than freezing!"); 735 732 return; 736 733 } 737 734 738 t uc->frozen--;735 tileUnusedCache->frozen--; 739 736 } 740 737 … … 746 743 * ewk_tile_unused_cache_tile_put(). 747 744 * 748 * @param t uccache of unused tiles745 * @param tileUnusedCache cache of unused tiles 749 746 * @param t the tile to be removed from Ewk_Tile_Unused_Cache. 750 747 * 751 748 * @return #EINA_TRUE on success, #EINA_FALSE otherwise. 752 749 */ 753 Eina_Bool ewk_tile_unused_cache_tile_get(Ewk_Tile_Unused_Cache *tuc, Ewk_Tile *t)754 { 755 Eina_List *e, *l;750 Eina_Bool ewk_tile_unused_cache_tile_get(Ewk_Tile_Unused_Cache* tileUnusedCache, Ewk_Tile* tile) 751 { 752 Eina_List* e, * l; 756 753 757 754 void* item; 758 755 e = 0; 759 EINA_LIST_FOREACH(t uc->entries.list, l, item) {756 EINA_LIST_FOREACH(tileUnusedCache->entries.list, l, item) { 760 757 Ewk_Tile_Unused_Cache_Entry* entry = static_cast<Ewk_Tile_Unused_Cache_Entry*>(item); 761 if (entry->tile == t ) {758 if (entry->tile == tile) { 762 759 e = l; 763 760 break; … … 765 762 } 766 763 if (!e) { 767 ERR("tile %p not found in cache %p", t , tuc);764 ERR("tile %p not found in cache %p", tile, tileUnusedCache); 768 765 return EINA_FALSE; 769 766 } 770 767 771 t uc->entries.count--;772 t uc->memory.used -= sizeof(Ewk_Tile) + t->bytes;773 t uc->entries.list = eina_list_remove_list(tuc->entries.list, e);768 tileUnusedCache->entries.count--; 769 tileUnusedCache->memory.used -= sizeof(Ewk_Tile) + tile->bytes; 770 tileUnusedCache->entries.list = eina_list_remove_list(tileUnusedCache->entries.list, e); 774 771 free(item); 775 772 … … 780 777 * Put tile into cache of unused tiles, adding it to the cache. 781 778 * 782 * This should be called when @c t ->visible is @c 0 and no objects are779 * This should be called when @c tile->visible is @c 0 and no objects are 783 780 * using the tile anymore, making it available to be expired and have 784 781 * its memory replaced. … … 789 786 * because usually we want a lazy operation for better performance. 790 787 * 791 * @param t uccache of unused tiles788 * @param tileUnusedCache cache of unused tiles 792 789 * @param t tile to be added to cache. 793 790 * @param tile_free_cb function used to free tiles. 794 791 * @param data context to give back to @a tile_free_cb as first argument. 795 792 * 796 * @return #EINA_TRUE on success, #EINA_FALSE otherwise. If @c t ->visible793 * @return #EINA_TRUE on success, #EINA_FALSE otherwise. If @c tile->visible 797 794 * is not #EINA_FALSE, then it will return #EINA_FALSE. 798 795 * 799 796 * @see ewk_tile_unused_cache_auto_flush() 800 797 */ 801 Eina_Bool ewk_tile_unused_cache_tile_put(Ewk_Tile_Unused_Cache *tuc, Ewk_Tile *t, void (*tile_free_cb)(void *data, Ewk_Tile *t), const void *data)802 { 803 Ewk_Tile_Unused_Cache_Entry *e;804 805 if (t ->visible) {806 ERR("tile=%p is not unused (visible=%d)", t , t->visible);798 Eina_Bool ewk_tile_unused_cache_tile_put(Ewk_Tile_Unused_Cache* tileUnusedCache, Ewk_Tile* tile, void (* tile_free_cb)(void* data, Ewk_Tile* tile), const void* data) 799 { 800 Ewk_Tile_Unused_Cache_Entry* uce; 801 802 if (tile->visible) { 803 ERR("tile=%p is not unused (visible=%d)", tile, tile->visible); 807 804 return EINA_FALSE; 808 805 } 809 806 810 e = static_cast<Ewk_Tile_Unused_Cache_Entry*>(malloc(sizeof(Ewk_Tile_Unused_Cache_Entry)));811 if (! e)807 uce = static_cast<Ewk_Tile_Unused_Cache_Entry*>(malloc(sizeof(Ewk_Tile_Unused_Cache_Entry))); 808 if (!uce) 812 809 return EINA_FALSE; 813 810 814 t uc->entries.list = eina_list_append(tuc->entries.list,e);811 tileUnusedCache->entries.list = eina_list_append(tileUnusedCache->entries.list, uce); 815 812 if (eina_error_get()) { 816 813 ERR("List allocation failed"); … … 818 815 } 819 816 820 e->tile = t;821 e->weight = 0; /* calculated just before sort */822 e->tile_free.cb = tile_free_cb;823 e->tile_free.data = (void*)data;824 825 t uc->entries.count++;826 t uc->memory.used += sizeof(Ewk_Tile) + t->bytes;817 uce->tile = tile; 818 uce->weight = 0; /* calculated just before sort */ 819 uce->tile_free.cb = tile_free_cb; 820 uce->tile_free.data = (void*)data; 821 822 tileUnusedCache->entries.count++; 823 tileUnusedCache->memory.used += sizeof(Ewk_Tile) + tile->bytes; 827 824 828 825 return EINA_TRUE; 829 826 } 830 827 831 void ewk_tile_unused_cache_dbg(const Ewk_Tile_Unused_Cache *tuc)828 void ewk_tile_unused_cache_dbg(const Ewk_Tile_Unused_Cache* tileUnusedCache) 832 829 { 833 830 void* item; 834 Eina_List *l;831 Eina_List* l; 835 832 int count = 0; 836 833 printf("Cache of unused tiles: entries: %zu/%zu, memory: %zu/%zu\n", 837 t uc->entries.count, tuc->entries.allocated,838 t uc->memory.used, tuc->memory.max);839 840 EINA_LIST_FOREACH(t uc->entries.list, l, item) {841 const Ewk_Tile *t= static_cast<Ewk_Tile_Unused_Cache_Entry*>(item)->tile;834 tileUnusedCache->entries.count, tileUnusedCache->entries.allocated, 835 tileUnusedCache->memory.used, tileUnusedCache->memory.max); 836 837 EINA_LIST_FOREACH(tileUnusedCache->entries.list, l, item) { 838 const Ewk_Tile* tile = static_cast<Ewk_Tile_Unused_Cache_Entry*>(item)->tile; 842 839 printf(" [%3lu,%3lu + %dx%d @ %0.3f]%c", 843 t ->col, t->row, t->w, t->h, t->zoom,844 t ->visible ? '*': ' ');840 tile->col, tile->row, tile->width, tile->height, tile->zoom, 841 tile->visible ? '*' : ' '); 845 842 846 843 if (!(count % 4)) -
trunk/Source/WebKit/efl/ewk/ewk_tiled_model.h
r95901 r97329 35 35 void ewk_tile_update_full(Ewk_Tile* t); 36 36 void ewk_tile_update_area(Ewk_Tile* t, const Eina_Rectangle* r); 37 void ewk_tile_updates_process(Ewk_Tile* t, void (* 37 void ewk_tile_updates_process(Ewk_Tile* t, void (*cb)(void* data, Ewk_Tile* t, const Eina_Rectangle* update), const void* data); 38 38 void ewk_tile_updates_clear(Ewk_Tile* t); 39 39 -
trunk/Source/WebKit/efl/ewk/ewk_view.cpp
r97043 r97329 179 179 180 180 #ifndef EWK_TYPE_CHECK 181 #define EWK_VIEW_TYPE_CHECK( o, ...) do { } while (0)181 #define EWK_VIEW_TYPE_CHECK(ewkView, ...) do { } while (0) 182 182 #else 183 #define EWK_VIEW_TYPE_CHECK( o, ...) \183 #define EWK_VIEW_TYPE_CHECK(ewkView, ...) \ 184 184 do { \ 185 const char* _tmp_otype = evas_object_type_get( o); \186 const Evas_Smart* _tmp_s = evas_object_smart_smart_get( o); \185 const char* _tmp_otype = evas_object_type_get(ewkView); \ 186 const Evas_Smart* _tmp_s = evas_object_smart_smart_get(ewkView); \ 187 187 if (EINA_UNLIKELY(!_tmp_s)) { \ 188 188 EINA_LOG_CRIT \ 189 ("%p (%s) is not a smart object!", o, \189 ("%p (%s) is not a smart object!", ewkView, \ 190 190 _tmp_otype ? _tmp_otype : "(null)"); \ 191 191 return __VA_ARGS__; \ … … 194 194 if (EINA_UNLIKELY(!_tmp_sc)) { \ 195 195 EINA_LOG_CRIT \ 196 ("%p (%s) is not a smart object!", o, \196 ("%p (%s) is not a smart object!", ewkView, \ 197 197 _tmp_otype ? _tmp_otype : "(null)"); \ 198 198 return __VA_ARGS__; \ … … 201 201 EINA_LOG_CRIT \ 202 202 ("%p (%s) is not of an ewk_view (need %p, got %p)!", \ 203 o, _tmp_otype ? _tmp_otype : "(null)", \203 ewkView, _tmp_otype ? _tmp_otype : "(null)", \ 204 204 EWK_VIEW_TYPE_STR, _tmp_sc->data); \ 205 205 return __VA_ARGS__; \ … … 208 208 #endif 209 209 210 #define EWK_VIEW_SD_GET( o, ptr) \211 Ewk_View_Smart_Data* ptr = static_cast<Ewk_View_Smart_Data*>(evas_object_smart_data_get( o))212 213 #define EWK_VIEW_SD_GET_OR_RETURN( o, ptr, ...) \214 EWK_VIEW_TYPE_CHECK( o, __VA_ARGS__); \215 EWK_VIEW_SD_GET( o, ptr); \210 #define EWK_VIEW_SD_GET(ewkView, ptr) \ 211 Ewk_View_Smart_Data* ptr = static_cast<Ewk_View_Smart_Data*>(evas_object_smart_data_get(ewkView)) 212 213 #define EWK_VIEW_SD_GET_OR_RETURN(ewkView, ptr, ...) \ 214 EWK_VIEW_TYPE_CHECK(ewkView, __VA_ARGS__); \ 215 EWK_VIEW_SD_GET(ewkView, ptr); \ 216 216 if (!ptr) { \ 217 217 CRITICAL("no smart data for object %p (%s)", \ 218 o, evas_object_type_get(o)); \218 ewkView, evas_object_type_get(ewkView)); \ 219 219 return __VA_ARGS__; \ 220 220 } … … 231 231 } 232 232 233 static void _ewk_view_smart_changed(Ewk_View_Smart_Data* s d)234 { 235 if (s d->changed.any)233 static void _ewk_view_smart_changed(Ewk_View_Smart_Data* smartData) 234 { 235 if (smartData->changed.any) 236 236 return; 237 s d->changed.any = EINA_TRUE;238 evas_object_smart_changed(s d->self);237 smartData->changed.any = EINA_TRUE; 238 evas_object_smart_changed(smartData->self); 239 239 } 240 240 … … 251 251 } 252 252 253 static void _ewk_view_repaint_add(Ewk_View_Private_Data* priv, Evas_Coord x, Evas_Coord y, Evas_Coord w , Evas_Coord h)253 static void _ewk_view_repaint_add(Ewk_View_Private_Data* priv, Evas_Coord x, Evas_Coord y, Evas_Coord width, Evas_Coord height) 254 254 { 255 255 Eina_Rectangle* r; … … 271 271 r->x = x; 272 272 r->y = y; 273 r->w = w ;274 r->h = h ;275 276 DBG("add repaint %d, %d+%dx%d", x, y, w , h);273 r->w = width; 274 r->h = height; 275 276 DBG("add repaint %d, %d+%dx%d", x, y, width, height); 277 277 } 278 278 … … 297 297 } 298 298 299 static void _ewk_view_scroll_add(Ewk_View_Private_Data* priv, Evas_Coord dx, Evas_Coord dy, Evas_Coord x, Evas_Coord y, Evas_Coord w , Evas_Coord h, Eina_Bool main_scroll)299 static void _ewk_view_scroll_add(Ewk_View_Private_Data* priv, Evas_Coord dx, Evas_Coord dy, Evas_Coord x, Evas_Coord y, Evas_Coord width, Evas_Coord height, Eina_Bool mainScroll) 300 300 { 301 301 Ewk_Scroll_Request* r; 302 302 Ewk_Scroll_Request* r_end; 303 Evas_Coord x2 = x + w , y2 = y + h;303 Evas_Coord x2 = x + width, y2 = y + height; 304 304 305 305 r = priv->scrolls.array; 306 306 r_end = r + priv->scrolls.count; 307 307 for (; r < r_end; r++) { 308 if (r->x == x && r->y == y && r->w == w && r->h == h) {308 if (r->x == x && r->y == y && r->w == width && r->h == height) { 309 309 DBG("region already scrolled %d,%d+%dx%d %+03d,%+03d add " 310 310 "%+03d,%+03d", … … 338 338 r->x = x; 339 339 r->y = y; 340 r->w = w ;341 r->h = h ;340 r->w = width; 341 r->h = height; 342 342 r->x2 = x2; 343 343 r->y2 = y2; 344 344 r->dx = dx; 345 345 r->dy = dy; 346 r->main_scroll = main _scroll;347 DBG("add scroll in region: %d, %d+%dx%d %+03d, %+03d", x, y, w , h, dx, dy);346 r->main_scroll = mainScroll; 347 DBG("add scroll in region: %d, %d+%dx%d %+03d, %+03d", x, y, width, height, dx, dy); 348 348 349 349 Eina_Rectangle* pr; … … 368 368 369 369 // Default Event Handling ////////////////////////////////////////////// 370 static Eina_Bool _ewk_view_smart_focus_in(Ewk_View_Smart_Data* s d)371 { 372 EWK_VIEW_PRIV_GET(s d, priv);370 static Eina_Bool _ewk_view_smart_focus_in(Ewk_View_Smart_Data* smartData) 371 { 372 EWK_VIEW_PRIV_GET(smartData, priv); 373 373 WebCore::FocusController* fc = priv->page->focusController(); 374 DBG(" o=%p, fc=%p", sd->self, fc);374 DBG("ewkView=%p, fc=%p", smartData->self, fc); 375 375 EINA_SAFETY_ON_NULL_RETURN_VAL(fc, EINA_FALSE); 376 376 … … 380 380 } 381 381 382 static Eina_Bool _ewk_view_smart_focus_out(Ewk_View_Smart_Data* s d)383 { 384 EWK_VIEW_PRIV_GET(s d, priv);382 static Eina_Bool _ewk_view_smart_focus_out(Ewk_View_Smart_Data* smartData) 383 { 384 EWK_VIEW_PRIV_GET(smartData, priv); 385 385 WebCore::FocusController* fc = priv->page->focusController(); 386 DBG(" o=%p, fc=%p", sd->self, fc);386 DBG("ewkView=%p, fc=%p", smartData->self, fc); 387 387 EINA_SAFETY_ON_NULL_RETURN_VAL(fc, EINA_FALSE); 388 388 … … 392 392 } 393 393 394 static Eina_Bool _ewk_view_smart_mouse_wheel(Ewk_View_Smart_Data* s d, const Evas_Event_Mouse_Wheel* ev)395 { 396 return ewk_frame_feed_mouse_wheel(s d->main_frame, ev);397 } 398 399 static Eina_Bool _ewk_view_smart_mouse_down(Ewk_View_Smart_Data* s d, const Evas_Event_Mouse_Down* ev)400 { 401 return ewk_frame_feed_mouse_down(s d->main_frame, ev);402 } 403 404 static Eina_Bool _ewk_view_smart_mouse_up(Ewk_View_Smart_Data* s d, const Evas_Event_Mouse_Up* ev)405 { 406 return ewk_frame_feed_mouse_up(s d->main_frame, ev);407 } 408 409 static Eina_Bool _ewk_view_smart_mouse_move(Ewk_View_Smart_Data* s d, const Evas_Event_Mouse_Move* ev)410 { 411 return ewk_frame_feed_mouse_move(s d->main_frame, ev);412 } 413 414 static Eina_Bool _ewk_view_smart_key_down(Ewk_View_Smart_Data* s d, const Evas_Event_Key_Down* ev)415 { 416 Evas_Object* frame = ewk_view_frame_focused_get(s d->self);394 static Eina_Bool _ewk_view_smart_mouse_wheel(Ewk_View_Smart_Data* smartData, const Evas_Event_Mouse_Wheel* wheelEvent) 395 { 396 return ewk_frame_feed_mouse_wheel(smartData->main_frame, wheelEvent); 397 } 398 399 static Eina_Bool _ewk_view_smart_mouse_down(Ewk_View_Smart_Data* smartData, const Evas_Event_Mouse_Down* downEvent) 400 { 401 return ewk_frame_feed_mouse_down(smartData->main_frame, downEvent); 402 } 403 404 static Eina_Bool _ewk_view_smart_mouse_up(Ewk_View_Smart_Data* smartData, const Evas_Event_Mouse_Up* upEvent) 405 { 406 return ewk_frame_feed_mouse_up(smartData->main_frame, upEvent); 407 } 408 409 static Eina_Bool _ewk_view_smart_mouse_move(Ewk_View_Smart_Data* smartData, const Evas_Event_Mouse_Move* moveEvent) 410 { 411 return ewk_frame_feed_mouse_move(smartData->main_frame, moveEvent); 412 } 413 414 static Eina_Bool _ewk_view_smart_key_down(Ewk_View_Smart_Data* smartData, const Evas_Event_Key_Down* downEvent) 415 { 416 Evas_Object* frame = ewk_view_frame_focused_get(smartData->self); 417 417 418 418 if (!frame) 419 frame = s d->main_frame;420 421 return ewk_frame_feed_key_down(frame, ev);422 } 423 424 static Eina_Bool _ewk_view_smart_key_up(Ewk_View_Smart_Data* s d, const Evas_Event_Key_Up* ev)425 { 426 Evas_Object* frame = ewk_view_frame_focused_get(s d->self);419 frame = smartData->main_frame; 420 421 return ewk_frame_feed_key_down(frame, downEvent); 422 } 423 424 static Eina_Bool _ewk_view_smart_key_up(Ewk_View_Smart_Data* smartData, const Evas_Event_Key_Up* upEvent) 425 { 426 Evas_Object* frame = ewk_view_frame_focused_get(smartData->self); 427 427 428 428 if (!frame) 429 frame = s d->main_frame;430 431 return ewk_frame_feed_key_up(frame, ev);432 } 433 434 static void _ewk_view_smart_add_console_message(Ewk_View_Smart_Data* s d, const char* message, unsigned int lineNumber, const char* sourceID)429 frame = smartData->main_frame; 430 431 return ewk_frame_feed_key_up(frame, upEvent); 432 } 433 434 static void _ewk_view_smart_add_console_message(Ewk_View_Smart_Data* smartData, const char* message, unsigned int lineNumber, const char* sourceID) 435 435 { 436 436 INF("console message: %s @%d: %s\n", sourceID, lineNumber, message); 437 437 } 438 438 439 static void _ewk_view_smart_run_javascript_alert(Ewk_View_Smart_Data* s d, Evas_Object* frame, const char* message)439 static void _ewk_view_smart_run_javascript_alert(Ewk_View_Smart_Data* smartData, Evas_Object* frame, const char* message) 440 440 { 441 441 INF("javascript alert: %s\n", message); 442 442 } 443 443 444 static Eina_Bool _ewk_view_smart_run_javascript_confirm(Ewk_View_Smart_Data* s d, Evas_Object* frame, const char* message)444 static Eina_Bool _ewk_view_smart_run_javascript_confirm(Ewk_View_Smart_Data* smartData, Evas_Object* frame, const char* message) 445 445 { 446 446 INF("javascript confirm: %s", message); … … 449 449 } 450 450 451 static Eina_Bool _ewk_view_smart_should_interrupt_javascript(Ewk_View_Smart_Data* s d)451 static Eina_Bool _ewk_view_smart_should_interrupt_javascript(Ewk_View_Smart_Data* smartData) 452 452 { 453 453 INF("should interrupt javascript?\n" … … 456 456 } 457 457 458 static Eina_Bool _ewk_view_smart_run_javascript_prompt(Ewk_View_Smart_Data* s d, Evas_Object* frame, const char* message, const char* defaultValue, char** value)458 static Eina_Bool _ewk_view_smart_run_javascript_prompt(Ewk_View_Smart_Data* smartData, Evas_Object* frame, const char* message, const char* defaultValue, char** value) 459 459 { 460 460 *value = strdup("test"); … … 470 470 471 471 // Event Handling ////////////////////////////////////////////////////// 472 static void _ewk_view_on_focus_in(void* data, Evas* e , Evas_Object* o, void* event_info)472 static void _ewk_view_on_focus_in(void* data, Evas* eventType, Evas_Object* callback, void* eventInfo) 473 473 { 474 474 Ewk_View_Smart_Data* sd = static_cast<Ewk_View_Smart_Data*>(data); … … 478 478 } 479 479 480 static void _ewk_view_on_focus_out(void* data, Evas* e , Evas_Object* o, void* event_info)480 static void _ewk_view_on_focus_out(void* data, Evas* eventType, Evas_Object* callback, void* eventInfo) 481 481 { 482 482 Ewk_View_Smart_Data* sd = static_cast<Ewk_View_Smart_Data*>(data); … … 486 486 } 487 487 488 static void _ewk_view_on_mouse_wheel(void* data, Evas* e , Evas_Object* o, void* event_info)489 { 490 Evas_Event_Mouse_Wheel* ev = static_cast<Evas_Event_Mouse_Wheel*>(event _info);488 static void _ewk_view_on_mouse_wheel(void* data, Evas* eventType, Evas_Object* callback, void* eventInfo) 489 { 490 Evas_Event_Mouse_Wheel* ev = static_cast<Evas_Event_Mouse_Wheel*>(eventInfo); 491 491 Ewk_View_Smart_Data* sd = static_cast<Ewk_View_Smart_Data*>(data); 492 492 EINA_SAFETY_ON_NULL_RETURN(sd->api); … … 495 495 } 496 496 497 static void _ewk_view_on_mouse_down(void* data, Evas* e , Evas_Object* o, void* event_info)498 { 499 Evas_Event_Mouse_Down* ev = static_cast<Evas_Event_Mouse_Down*>(event _info);497 static void _ewk_view_on_mouse_down(void* data, Evas* eventType, Evas_Object* callback, void* eventInfo) 498 { 499 Evas_Event_Mouse_Down* ev = static_cast<Evas_Event_Mouse_Down*>(eventInfo); 500 500 Ewk_View_Smart_Data* sd = static_cast<Ewk_View_Smart_Data*>(data); 501 501 EINA_SAFETY_ON_NULL_RETURN(sd->api); … … 504 504 } 505 505 506 static void _ewk_view_on_mouse_up(void* data, Evas* e , Evas_Object* o, void* event_info)507 { 508 Evas_Event_Mouse_Up* ev = static_cast<Evas_Event_Mouse_Up*>(event _info);506 static void _ewk_view_on_mouse_up(void* data, Evas* eventType, Evas_Object* callback, void* eventInfo) 507 { 508 Evas_Event_Mouse_Up* ev = static_cast<Evas_Event_Mouse_Up*>(eventInfo); 509 509 Ewk_View_Smart_Data* sd = static_cast<Ewk_View_Smart_Data*>(data); 510 510 EINA_SAFETY_ON_NULL_RETURN(sd->api); … … 513 513 } 514 514 515 static void _ewk_view_on_mouse_move(void* data, Evas* e , Evas_Object* o, void* event_info)516 { 517 Evas_Event_Mouse_Move* ev = static_cast<Evas_Event_Mouse_Move*>(event _info);515 static void _ewk_view_on_mouse_move(void* data, Evas* eventType, Evas_Object* callback, void* eventInfo) 516 { 517 Evas_Event_Mouse_Move* ev = static_cast<Evas_Event_Mouse_Move*>(eventInfo); 518 518 Ewk_View_Smart_Data* sd = static_cast<Ewk_View_Smart_Data*>(data); 519 519 EINA_SAFETY_ON_NULL_RETURN(sd->api); … … 522 522 } 523 523 524 static void _ewk_view_on_key_down(void* data, Evas* e , Evas_Object* o, void* event_info)525 { 526 Evas_Event_Key_Down* ev = static_cast<Evas_Event_Key_Down*>(event _info);524 static void _ewk_view_on_key_down(void* data, Evas* eventType, Evas_Object* callback, void* eventInfo) 525 { 526 Evas_Event_Key_Down* ev = static_cast<Evas_Event_Key_Down*>(eventInfo); 527 527 Ewk_View_Smart_Data* sd = static_cast<Ewk_View_Smart_Data*>(data); 528 528 EINA_SAFETY_ON_NULL_RETURN(sd->api); … … 531 531 } 532 532 533 static void _ewk_view_on_key_up(void* data, Evas* e , Evas_Object* o, void* event_info)534 { 535 Evas_Event_Key_Up* ev = static_cast<Evas_Event_Key_Up*>(event _info);533 static void _ewk_view_on_key_up(void* data, Evas* eventType, Evas_Object* callback, void* eventInfo) 534 { 535 Evas_Event_Key_Up* ev = static_cast<Evas_Event_Key_Up*>(eventInfo); 536 536 Ewk_View_Smart_Data* sd = static_cast<Ewk_View_Smart_Data*>(data); 537 537 EINA_SAFETY_ON_NULL_RETURN(sd->api); … … 540 540 } 541 541 542 static WTF::PassRefPtr<WebCore::Frame> _ewk_view_core_frame_new(Ewk_View_Smart_Data* s d, Ewk_View_Private_Data* priv, WebCore::HTMLFrameOwnerElement* owner)543 { 544 WebCore::FrameLoaderClientEfl* flc = new WebCore::FrameLoaderClientEfl(s d->self);542 static WTF::PassRefPtr<WebCore::Frame> _ewk_view_core_frame_new(Ewk_View_Smart_Data* smartData, Ewk_View_Private_Data* priv, WebCore::HTMLFrameOwnerElement* owner) 543 { 544 WebCore::FrameLoaderClientEfl* flc = new WebCore::FrameLoaderClientEfl(smartData->self); 545 545 if (!flc) { 546 546 CRITICAL("Could not create frame loader client."); … … 554 554 static Evas_Smart_Class _parent_sc = EVAS_SMART_CLASS_INIT_NULL; 555 555 556 static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* s d)556 static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData) 557 557 { 558 558 Ewk_View_Private_Data* priv = … … 567 567 568 568 WebCore::Page::PageClients pageClients; 569 pageClients.chromeClient = static_cast<WebCore::ChromeClient*>(new WebCore::ChromeClientEfl(s d->self));570 pageClients.editorClient = static_cast<WebCore::EditorClient*>(new WebCore::EditorClientEfl(s d->self));569 pageClients.chromeClient = static_cast<WebCore::ChromeClient*>(new WebCore::ChromeClientEfl(smartData->self)); 570 pageClients.editorClient = static_cast<WebCore::EditorClient*>(new WebCore::EditorClientEfl(smartData->self)); 571 571 pageClients.dragClient = static_cast<WebCore::DragClient*>(new WebCore::DragClientEfl); 572 572 pageClients.inspectorClient = static_cast<WebCore::InspectorClient*>(new WebCore::InspectorClientEfl); … … 596 596 597 597 priv->page_settings->setLoadsImagesAutomatically(true); 598 priv->page_settings->setDefaultFixedFontSize(1 2);599 priv->page_settings->setDefaultFontSize(1 6);598 priv->page_settings->setDefaultFixedFontSize(10); 599 priv->page_settings->setDefaultFontSize(13); 600 600 priv->page_settings->setSerifFontFamily("serif"); 601 601 priv->page_settings->setFixedFontFamily("monotype"); … … 667 667 priv->settings.dom_timer_interval = priv->page_settings->defaultMinDOMTimerInterval(); 668 668 669 priv->main_frame = _ewk_view_core_frame_new(s d, priv, 0).get();669 priv->main_frame = _ewk_view_core_frame_new(smartData, priv, 0).get(); 670 670 if (!priv->main_frame) { 671 671 CRITICAL("Could not create main frame."); … … 722 722 } 723 723 724 static void _ewk_view_smart_add(Evas_Object* o)725 { 726 const Evas_Smart* smart = evas_object_smart_smart_get( o);724 static void _ewk_view_smart_add(Evas_Object* ewkView) 725 { 726 const Evas_Smart* smart = evas_object_smart_smart_get(ewkView); 727 727 const Evas_Smart_Class* sc = evas_smart_class_get(smart); 728 728 const Ewk_View_Smart_Class* api = reinterpret_cast<const Ewk_View_Smart_Class*>(sc); 729 729 EINA_SAFETY_ON_NULL_RETURN(api->backing_store_add); 730 EWK_VIEW_SD_GET( o, sd);730 EWK_VIEW_SD_GET(ewkView, sd); 731 731 732 732 if (!sd) { … … 736 736 return; 737 737 } 738 evas_object_smart_data_set( o, sd);738 evas_object_smart_data_set(ewkView, sd); 739 739 } 740 740 … … 744 744 sd->bg_color.a = 255; 745 745 746 sd->self = o;746 sd->self = ewkView; 747 747 sd->_priv = _ewk_view_priv_new(sd); 748 748 sd->api = api; 749 749 750 _parent_sc.add( o);750 _parent_sc.add(ewkView); 751 751 752 752 if (!sd->_priv) … … 761 761 } 762 762 763 evas_object_smart_member_add(sd->backing_store, o);763 evas_object_smart_member_add(sd->backing_store, ewkView); 764 764 evas_object_show(sd->backing_store); 765 765 evas_object_pass_events_set(sd->backing_store, EINA_TRUE); … … 767 767 sd->events_rect = evas_object_rectangle_add(sd->base.evas); 768 768 evas_object_color_set(sd->events_rect, 0, 0, 0, 0); 769 evas_object_smart_member_add(sd->events_rect, o);769 evas_object_smart_member_add(sd->events_rect, ewkView); 770 770 evas_object_show(sd->events_rect); 771 771 … … 776 776 } 777 777 778 if (!ewk_frame_init(sd->main_frame, o, priv->main_frame)) {778 if (!ewk_frame_init(sd->main_frame, ewkView, priv->main_frame)) { 779 779 ERR("Could not initialize main frme object."); 780 780 evas_object_del(sd->main_frame); … … 787 787 788 788 evas_object_name_set(sd->main_frame, "EWK_Frame:main"); 789 evas_object_smart_member_add(sd->main_frame, o);789 evas_object_smart_member_add(sd->main_frame, ewkView); 790 790 evas_object_show(sd->main_frame); 791 791 792 #define CONNECT(s, c) evas_object_event_callback_add( o, s, c, sd)792 #define CONNECT(s, c) evas_object_event_callback_add(ewkView, s, c, sd) 793 793 CONNECT(EVAS_CALLBACK_FOCUS_IN, _ewk_view_on_focus_in); 794 794 CONNECT(EVAS_CALLBACK_FOCUS_OUT, _ewk_view_on_focus_out); … … 802 802 } 803 803 804 static void _ewk_view_smart_del(Evas_Object* o)805 { 806 EWK_VIEW_SD_GET( o, sd);804 static void _ewk_view_smart_del(Evas_Object* ewkView) 805 { 806 EWK_VIEW_SD_GET(ewkView, sd); 807 807 Ewk_View_Private_Data* priv = sd ? sd->_priv : 0; 808 808 809 ewk_view_stop( o);810 _parent_sc.del( o);809 ewk_view_stop(ewkView); 810 _parent_sc.del(ewkView); 811 811 _ewk_view_priv_del(priv); 812 812 } 813 813 814 static void _ewk_view_smart_resize(Evas_Object* o, Evas_Coord w, Evas_Coord h)815 { 816 EWK_VIEW_SD_GET_OR_RETURN( o, sd);814 static void _ewk_view_smart_resize(Evas_Object* ewkView, Evas_Coord w, Evas_Coord h) 815 { 816 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 817 817 818 818 // these should be queued and processed in calculate as well! … … 823 823 } 824 824 825 static void _ewk_view_smart_move(Evas_Object* o, Evas_Coord x, Evas_Coord y)826 { 827 EWK_VIEW_SD_GET_OR_RETURN( o, sd);825 static void _ewk_view_smart_move(Evas_Object* ewkView, Evas_Coord x, Evas_Coord y) 826 { 827 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 828 828 sd->changed.position = EINA_TRUE; 829 829 _ewk_view_smart_changed(sd); 830 830 } 831 831 832 static void _ewk_view_smart_calculate(Evas_Object* o)833 { 834 EWK_VIEW_SD_GET( o, sd);832 static void _ewk_view_smart_calculate(Evas_Object* ewkView) 833 { 834 EWK_VIEW_SD_GET(ewkView, sd); 835 835 EWK_VIEW_PRIV_GET(sd, priv); 836 836 EINA_SAFETY_ON_NULL_RETURN(sd->api->contents_resize); … … 844 844 return; 845 845 846 evas_object_geometry_get( o, &x, &y, &w, &h);847 848 DBG(" o=%p geo=[%d, %d + %dx%d], changed: size=%hhu, "846 evas_object_geometry_get(ewkView, &x, &y, &w, &h); 847 848 DBG("ewkView=%p geo=[%d, %d + %dx%d], changed: size=%hhu, " 849 849 "scrolls=%zu, repaints=%zu", 850 o, x, y, w, h, sd->changed.size,850 ewkView, x, y, w, h, sd->changed.size, 851 851 priv->scrolls.count, priv->repaints.count); 852 852 … … 867 867 868 868 // This callback is a good place e.g. to change fixed layout size (ewk_view_fixed_layout_size_set). 869 evas_object_smart_callback_call( o, "view,resized", 0);869 evas_object_smart_callback_call(ewkView, "view,resized", 0); 870 870 } 871 871 sd->changed.size = EINA_FALSE; … … 896 896 } 897 897 898 static void _ewk_view_smart_show(Evas_Object* o)899 { 900 EWK_VIEW_SD_GET_OR_RETURN( o, sd);898 static void _ewk_view_smart_show(Evas_Object* ewkView) 899 { 900 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 901 901 902 902 if (evas_object_clipees_get(sd->base.clipper)) … … 905 905 } 906 906 907 static void _ewk_view_smart_hide(Evas_Object* o)908 { 909 EWK_VIEW_SD_GET_OR_RETURN( o, sd);907 static void _ewk_view_smart_hide(Evas_Object* ewkView) 908 { 909 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 910 910 911 911 evas_object_hide(sd->base.clipper); … … 913 913 } 914 914 915 static Eina_Bool _ewk_view_smart_contents_resize(Ewk_View_Smart_Data* s d, int w, int h)916 { 917 return EINA_TRUE; 918 } 919 920 static Eina_Bool _ewk_view_smart_zoom_set(Ewk_View_Smart_Data* s d, float zoom, Evas_Coord cx, Evas_Coord cy)915 static Eina_Bool _ewk_view_smart_contents_resize(Ewk_View_Smart_Data* smartData, int width, int height) 916 { 917 return EINA_TRUE; 918 } 919 920 static Eina_Bool _ewk_view_smart_zoom_set(Ewk_View_Smart_Data* smartData, float zoom, Evas_Coord centerX, Evas_Coord centerY) 921 921 { 922 922 double px, py; … … 924 924 Eina_Bool ret; 925 925 926 ewk_frame_scroll_size_get(s d->main_frame, &w, &h);927 ewk_frame_scroll_pos_get(s d->main_frame, &x, &y);928 929 if (w + s d->view.w > 0)930 px = static_cast<double>(x + c x) / (w + sd->view.w);926 ewk_frame_scroll_size_get(smartData->main_frame, &w, &h); 927 ewk_frame_scroll_pos_get(smartData->main_frame, &x, &y); 928 929 if (w + smartData->view.w > 0) 930 px = static_cast<double>(x + centerX) / (w + smartData->view.w); 931 931 else 932 932 px = 0.0; 933 933 934 if (h + s d->view.h > 0)935 py = static_cast<double>(y + c y) / (h + sd->view.h);934 if (h + smartData->view.h > 0) 935 py = static_cast<double>(y + centerY) / (h + smartData->view.h); 936 936 else 937 937 py = 0.0; 938 938 939 ret = ewk_frame_page_zoom_set(s d->main_frame, zoom);940 941 ewk_frame_scroll_size_get(s d->main_frame, &w, &h);942 x = (w + s d->view.w) * px - cx;943 y = (h + s d->view.h) * py - cy;944 ewk_frame_scroll_set(s d->main_frame, x, y);939 ret = ewk_frame_page_zoom_set(smartData->main_frame, zoom); 940 941 ewk_frame_scroll_size_get(smartData->main_frame, &w, &h); 942 x = (w + smartData->view.w) * px - centerX; 943 y = (h + smartData->view.h) * py - centerY; 944 ewk_frame_scroll_set(smartData->main_frame, x, y); 945 945 return ret; 946 946 } 947 947 948 static void _ewk_view_smart_flush(Ewk_View_Smart_Data* s d)949 { 950 EWK_VIEW_PRIV_GET_OR_RETURN(s d, priv);948 static void _ewk_view_smart_flush(Ewk_View_Smart_Data* smartData) 949 { 950 EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv); 951 951 _ewk_view_repaints_flush(priv); 952 952 _ewk_view_scrolls_flush(priv); 953 953 } 954 954 955 static Eina_Bool _ewk_view_smart_pre_render_region(Ewk_View_Smart_Data* s d, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, float zoom)955 static Eina_Bool _ewk_view_smart_pre_render_region(Ewk_View_Smart_Data* smartData, Evas_Coord x, Evas_Coord y, Evas_Coord width, Evas_Coord height, float zoom) 956 956 { 957 957 WRN("not supported by engine. sd=%p area=%d,%d+%dx%d, zoom=%f", 958 s d, x, y, w, h, zoom);958 smartData, x, y, width, height, zoom); 959 959 return EINA_FALSE; 960 960 } 961 961 962 static Eina_Bool _ewk_view_smart_pre_render_relative_radius(Ewk_View_Smart_Data* s d, unsigned int n, float zoom)962 static Eina_Bool _ewk_view_smart_pre_render_relative_radius(Ewk_View_Smart_Data* smartData, unsigned int number, float zoom) 963 963 { 964 964 WRN("not supported by engine. sd=%p, n=%u zoom=%f", 965 s d, n, zoom);965 smartData, number, zoom); 966 966 return EINA_FALSE; 967 967 } 968 968 969 static void _ewk_view_smart_pre_render_cancel(Ewk_View_Smart_Data* s d)970 { 971 WRN("not supported by engine. sd=%p", s d);972 } 973 974 static void _ewk_view_zoom_animated_mark_stop(Ewk_View_Smart_Data* s d)975 { 976 s d->animated_zoom.zoom.start = 0.0;977 s d->animated_zoom.zoom.end = 0.0;978 s d->animated_zoom.zoom.current = 0.0;979 } 980 981 static void _ewk_view_zoom_animated_finish(Ewk_View_Smart_Data* s d)982 { 983 EWK_VIEW_PRIV_GET(s d, priv);969 static void _ewk_view_smart_pre_render_cancel(Ewk_View_Smart_Data* smartData) 970 { 971 WRN("not supported by engine. sd=%p", smartData); 972 } 973 974 static void _ewk_view_zoom_animated_mark_stop(Ewk_View_Smart_Data* smartData) 975 { 976 smartData->animated_zoom.zoom.start = 0.0; 977 smartData->animated_zoom.zoom.end = 0.0; 978 smartData->animated_zoom.zoom.current = 0.0; 979 } 980 981 static void _ewk_view_zoom_animated_finish(Ewk_View_Smart_Data* smartData) 982 { 983 EWK_VIEW_PRIV_GET(smartData, priv); 984 984 ecore_animator_del(priv->animated_zoom.animator); 985 985 priv->animated_zoom.animator = 0; 986 _ewk_view_zoom_animated_mark_stop(s d);987 evas_object_smart_callback_call(s d->self, "zoom,animated,end", 0);986 _ewk_view_zoom_animated_mark_stop(smartData); 987 evas_object_smart_callback_call(smartData->self, "zoom,animated,end", 0); 988 988 } 989 989 … … 1033 1033 } 1034 1034 1035 static void _ewk_view_zoom_animation_start(Ewk_View_Smart_Data* s d)1036 { 1037 EWK_VIEW_PRIV_GET_OR_RETURN(s d, priv);1035 static void _ewk_view_zoom_animation_start(Ewk_View_Smart_Data* smartData) 1036 { 1037 EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv); 1038 1038 if (priv->animated_zoom.animator) 1039 1039 return; 1040 1040 priv->animated_zoom.animator = ecore_animator_add 1041 (_ewk_view_zoom_animator_cb, s d);1042 } 1043 1044 static WebCore::ViewportAttributes _ewk_view_viewport_attributes_compute(const Evas_Object* o)1045 { 1046 EWK_VIEW_SD_GET( o, sd);1041 (_ewk_view_zoom_animator_cb, smartData); 1042 } 1043 1044 static WebCore::ViewportAttributes _ewk_view_viewport_attributes_compute(const Evas_Object* ewkView) 1045 { 1046 EWK_VIEW_SD_GET(ewkView, sd); 1047 1047 EWK_VIEW_PRIV_GET(sd, priv); 1048 1048 … … 1058 1058 } 1059 1059 1060 static Eina_Bool _ewk_view_smart_disable_render(Ewk_View_Smart_Data* s d)1061 { 1062 WRN("not supported by engine. sd=%p", s d);1060 static Eina_Bool _ewk_view_smart_disable_render(Ewk_View_Smart_Data* smartData) 1061 { 1062 WRN("not supported by engine. sd=%p", smartData); 1063 1063 return EINA_FALSE; 1064 1064 } 1065 1065 1066 static Eina_Bool _ewk_view_smart_enable_render(Ewk_View_Smart_Data* s d)1067 { 1068 WRN("not supported by engine. sd=%p", s d);1066 static Eina_Bool _ewk_view_smart_enable_render(Ewk_View_Smart_Data* smartData) 1067 { 1068 WRN("not supported by engine. sd=%p", smartData); 1069 1069 return EINA_FALSE; 1070 1070 } … … 1121 1121 } 1122 1122 1123 void ewk_view_fixed_layout_size_set(Evas_Object* o, Evas_Coord w, Evas_Coord h)1124 { 1125 EWK_VIEW_SD_GET_OR_RETURN( o, sd);1123 void ewk_view_fixed_layout_size_set(Evas_Object* ewkView, Evas_Coord width, Evas_Coord height) 1124 { 1125 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 1126 1126 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv); 1127 1127 1128 1128 WebCore::FrameView* view = priv->main_frame->view(); 1129 if (w <= 0 && h<= 0) {1129 if (width <= 0 && height <= 0) { 1130 1130 if (!view->useFixedLayout()) 1131 1131 return; … … 1133 1133 } else { 1134 1134 WebCore::IntSize size = view->fixedLayoutSize(); 1135 if (size.width() == w && size.height() == h)1135 if (size.width() == width && size.height() == height) 1136 1136 return; 1137 1137 if (view) 1138 view->setFixedLayoutSize(WebCore::IntSize(w , h));1138 view->setFixedLayoutSize(WebCore::IntSize(width, height)); 1139 1139 } 1140 1140 … … 1145 1145 } 1146 1146 1147 void ewk_view_fixed_layout_size_get(const Evas_Object* o, Evas_Coord* w, Evas_Coord* h)1148 { 1149 if (w )1150 *w = 0;1151 if (h )1152 *h = 0;1153 EWK_VIEW_SD_GET_OR_RETURN( o, sd);1147 void ewk_view_fixed_layout_size_get(const Evas_Object* ewkView, Evas_Coord* width, Evas_Coord* height) 1148 { 1149 if (width) 1150 *width = 0; 1151 if (height) 1152 *height = 0; 1153 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 1154 1154 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv); 1155 1155 WebCore::FrameView* view = priv->main_frame->view(); 1156 1156 if (view->useFixedLayout()) { 1157 1157 WebCore::IntSize size = view->fixedLayoutSize(); 1158 if (w )1159 *w = size.width();1160 if (h )1161 *h = size.height();1162 } 1163 } 1164 1165 void ewk_view_theme_set(Evas_Object* o, const char* path)1166 { 1167 EWK_VIEW_SD_GET_OR_RETURN( o, sd);1158 if (width) 1159 *width = size.width(); 1160 if (height) 1161 *height = size.height(); 1162 } 1163 } 1164 1165 void ewk_view_theme_set(Evas_Object* ewkView, const char* path) 1166 { 1167 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 1168 1168 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv); 1169 1169 if (!eina_stringshare_replace(&priv->settings.theme, path)) … … 1178 1178 } 1179 1179 1180 const char* ewk_view_theme_get(const Evas_Object* o)1181 { 1182 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);1180 const char* ewk_view_theme_get(const Evas_Object* ewkView) 1181 { 1182 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 1183 1183 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0); 1184 1184 return priv->settings.theme; 1185 1185 } 1186 1186 1187 Evas_Object* ewk_view_frame_main_get(const Evas_Object* o)1188 { 1189 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);1187 Evas_Object* ewk_view_frame_main_get(const Evas_Object* ewkView) 1188 { 1189 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 1190 1190 return sd->main_frame; 1191 1191 } 1192 1192 1193 Evas_Object* ewk_view_frame_focused_get(const Evas_Object* o)1194 { 1195 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);1193 Evas_Object* ewk_view_frame_focused_get(const Evas_Object* ewkView) 1194 { 1195 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 1196 1196 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0); 1197 1197 … … 1206 1206 } 1207 1207 1208 Eina_Bool ewk_view_uri_set(Evas_Object* o, const char* uri)1209 { 1210 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1208 Eina_Bool ewk_view_uri_set(Evas_Object* ewkView, const char* uri) 1209 { 1210 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1211 1211 return ewk_frame_uri_set(sd->main_frame, uri); 1212 1212 } 1213 1213 1214 const char* ewk_view_uri_get(const Evas_Object* o)1215 { 1216 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);1214 const char* ewk_view_uri_get(const Evas_Object* ewkView) 1215 { 1216 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 1217 1217 return ewk_frame_uri_get(sd->main_frame); 1218 1218 } 1219 1219 1220 const char* ewk_view_title_get(const Evas_Object* o)1221 { 1222 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);1220 const char* ewk_view_title_get(const Evas_Object* ewkView) 1221 { 1222 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 1223 1223 return ewk_frame_title_get(sd->main_frame); 1224 1224 } 1225 1225 1226 Eina_Bool ewk_view_editable_get(const Evas_Object* o)1227 { 1228 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1226 Eina_Bool ewk_view_editable_get(const Evas_Object* ewkView) 1227 { 1228 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1229 1229 return ewk_frame_editable_get(sd->main_frame); 1230 1230 } 1231 1231 1232 void ewk_view_bg_color_set(Evas_Object* o, int r, int g, int b, inta)1233 { 1234 EWK_VIEW_SD_GET_OR_RETURN( o, sd);1232 void ewk_view_bg_color_set(Evas_Object* ewkView, int red, int green, int blue, int alpha) 1233 { 1234 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 1235 1235 EINA_SAFETY_ON_NULL_RETURN(sd->api); 1236 1236 EINA_SAFETY_ON_NULL_RETURN(sd->api->bg_color_set); 1237 1237 1238 if (a < 0) {1239 WRN("Alpha less than zero (%d).", a );1240 a = 0;1241 } else if (a > 255) {1242 WRN("Alpha is larger than 255 (%d).", a );1243 a = 255;1238 if (alpha < 0) { 1239 WRN("Alpha less than zero (%d).", alpha); 1240 alpha = 0; 1241 } else if (alpha > 255) { 1242 WRN("Alpha is larger than 255 (%d).", alpha); 1243 alpha = 255; 1244 1244 } 1245 1245 … … 1253 1253 c = a; \ 1254 1254 } 1255 CHECK_PREMUL_COLOR(r ,a);1256 CHECK_PREMUL_COLOR(g ,a);1257 CHECK_PREMUL_COLOR(b ,a);1255 CHECK_PREMUL_COLOR(red, alpha); 1256 CHECK_PREMUL_COLOR(green, alpha); 1257 CHECK_PREMUL_COLOR(blue, alpha); 1258 1258 #undef CHECK_PREMUL_COLOR 1259 1259 1260 sd->bg_color.r = r ;1261 sd->bg_color.g = g ;1262 sd->bg_color.b = b ;1263 sd->bg_color.a = a ;1264 1265 sd->api->bg_color_set(sd, r , g, b,a);1260 sd->bg_color.r = red; 1261 sd->bg_color.g = green; 1262 sd->bg_color.b = blue; 1263 sd->bg_color.a = alpha; 1264 1265 sd->api->bg_color_set(sd, red, green, blue, alpha); 1266 1266 1267 1267 WebCore::FrameView* view = sd->_priv->main_frame->view(); … … 1269 1269 WebCore::Color color; 1270 1270 1271 if (!a )1271 if (!alpha) 1272 1272 color = WebCore::Color(0, 0, 0, 0); 1273 else if (a == 255)1274 color = WebCore::Color(r , g, b,a);1273 else if (alpha == 255) 1274 color = WebCore::Color(red, green, blue, alpha); 1275 1275 else 1276 color = WebCore::Color(r * 255 / a, g * 255 / a, b * 255 / a,a);1277 1278 view->updateBackgroundRecursively(color, !a );1279 } 1280 } 1281 1282 void ewk_view_bg_color_get(const Evas_Object* o, int* r, int* g, int* b, int*a)1283 { 1284 if (r )1285 *r = 0;1286 if (g )1287 *g = 0;1288 if (b )1289 *b = 0;1290 if (a )1291 *a = 0;1292 EWK_VIEW_SD_GET_OR_RETURN( o, sd);1293 if (r )1294 *r = sd->bg_color.r;1295 if (g )1296 *g = sd->bg_color.g;1297 if (b )1298 *b = sd->bg_color.b;1299 if (a )1300 *a = sd->bg_color.a;1301 } 1302 1303 Eina_Bool ewk_view_text_search(const Evas_Object* o, const char* string, Eina_Bool case_sensitive, Eina_Bool forward, Eina_Bool wrap)1304 { 1305 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1276 color = WebCore::Color(red * 255 / alpha, green * 255 / alpha, blue * 255 / alpha, alpha); 1277 1278 view->updateBackgroundRecursively(color, !alpha); 1279 } 1280 } 1281 1282 void ewk_view_bg_color_get(const Evas_Object* ewkView, int* red, int* green, int* blue, int* alpha) 1283 { 1284 if (red) 1285 *red = 0; 1286 if (green) 1287 *green = 0; 1288 if (blue) 1289 *blue = 0; 1290 if (alpha) 1291 *alpha = 0; 1292 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 1293 if (red) 1294 *red = sd->bg_color.r; 1295 if (green) 1296 *green = sd->bg_color.g; 1297 if (blue) 1298 *blue = sd->bg_color.b; 1299 if (alpha) 1300 *alpha = sd->bg_color.a; 1301 } 1302 1303 Eina_Bool ewk_view_text_search(const Evas_Object* ewkView, const char* string, Eina_Bool caseSensitive, Eina_Bool forward, Eina_Bool wrap) 1304 { 1305 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1306 1306 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1307 1307 EINA_SAFETY_ON_NULL_RETURN_VAL(string, EINA_FALSE); … … 1309 1309 WebCore::FindDirection direction; 1310 1310 1311 if (case _sensitive)1311 if (caseSensitive) 1312 1312 sensitive = WTF::TextCaseSensitive; 1313 1313 else … … 1327 1327 * @param o view object where to search text. 1328 1328 * @param string reference string to match. 1329 * @param case _sensitive if match should be case sensitive or not.1329 * @param caseSensitive if match should be case sensitive or not. 1330 1330 * @param highlight if matches should be highlighted. 1331 1331 * @param limit maximum amount of matches, or zero to unlimited. … … 1333 1333 * @return number of matches. 1334 1334 */ 1335 unsigned int ewk_view_text_matches_mark(Evas_Object* o, const char* string, Eina_Bool case_sensitive, Eina_Bool highlight, unsigned int limit)1336 { 1337 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);1335 unsigned int ewk_view_text_matches_mark(Evas_Object* ewkView, const char* string, Eina_Bool caseSensitive, Eina_Bool highlight, unsigned int limit) 1336 { 1337 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 1338 1338 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0); 1339 1339 EINA_SAFETY_ON_NULL_RETURN_VAL(string, 0); 1340 1340 WTF::TextCaseSensitivity sensitive; 1341 1341 1342 if (case _sensitive)1342 if (caseSensitive) 1343 1343 sensitive = WTF::TextCaseSensitive; 1344 1344 else … … 1348 1348 } 1349 1349 1350 Eina_Bool ewk_view_text_matches_unmark_all(Evas_Object* o)1351 { 1352 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1350 Eina_Bool ewk_view_text_matches_unmark_all(Evas_Object* ewkView) 1351 { 1352 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1353 1353 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1354 1354 priv->page->unmarkAllTextMatches(); … … 1356 1356 } 1357 1357 1358 Eina_Bool ewk_view_text_matches_highlight_set(Evas_Object* o, Eina_Bool highlight)1359 { 1360 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1358 Eina_Bool ewk_view_text_matches_highlight_set(Evas_Object* ewkView, Eina_Bool highlight) 1359 { 1360 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1361 1361 return ewk_frame_text_matches_highlight_set(sd->main_frame, highlight); 1362 1362 } 1363 1363 1364 Eina_Bool ewk_view_text_matches_highlight_get(const Evas_Object* o)1365 { 1366 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1364 Eina_Bool ewk_view_text_matches_highlight_get(const Evas_Object* ewkView) 1365 { 1366 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1367 1367 return ewk_frame_text_matches_highlight_get(sd->main_frame); 1368 1368 } 1369 1369 1370 Eina_Bool ewk_view_editable_set(Evas_Object* o, Eina_Bool editable)1371 { 1372 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1370 Eina_Bool ewk_view_editable_set(Evas_Object* ewkView, Eina_Bool editable) 1371 { 1372 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1373 1373 return ewk_frame_editable_set(sd->main_frame, editable); 1374 1374 } 1375 1375 1376 char* ewk_view_selection_get(const Evas_Object* o)1377 { 1378 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);1376 char* ewk_view_selection_get(const Evas_Object* ewkView) 1377 { 1378 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 1379 1379 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0); 1380 1380 CString s = priv->page->focusController()->focusedOrMainFrame()->editor()->selectedText().utf8(); … … 1389 1389 } 1390 1390 1391 Eina_Bool ewk_view_execute_editor_command(Evas_Object* o, const Ewk_Editor_Command command, const char* value)1392 { 1393 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1391 Eina_Bool ewk_view_execute_editor_command(Evas_Object* ewkView, const Ewk_Editor_Command command, const char* value) 1392 { 1393 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1394 1394 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1395 1395 … … 1416 1416 } 1417 1417 1418 Eina_Bool ewk_view_context_menu_forward_event(Evas_Object* o, const Evas_Event_Mouse_Down* ev)1418 Eina_Bool ewk_view_context_menu_forward_event(Evas_Object* ewkView, const Evas_Event_Mouse_Down* downEvent) 1419 1419 { 1420 1420 #if ENABLE(CONTEXT_MENUS) 1421 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1421 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1422 1422 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1423 1423 Eina_Bool mouse_press_handled = EINA_FALSE; … … 1428 1428 evas_object_geometry_get(sd->self, &x, &y, 0, 0); 1429 1429 1430 WebCore::PlatformMouseEvent event( ev, WebCore::IntPoint(x, y));1430 WebCore::PlatformMouseEvent event(downEvent, WebCore::IntPoint(x, y)); 1431 1431 1432 1432 if (main_frame->view()) { … … 1452 1452 } 1453 1453 1454 double ewk_view_load_progress_get(const Evas_Object* o)1455 { 1456 EWK_VIEW_SD_GET_OR_RETURN( o, sd, -1.0);1454 double ewk_view_load_progress_get(const Evas_Object* ewkView) 1455 { 1456 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, -1.0); 1457 1457 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, -1.0); 1458 1458 return priv->page->progress()->estimatedProgress(); 1459 1459 } 1460 1460 1461 Eina_Bool ewk_view_stop(Evas_Object* o)1462 { 1463 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1461 Eina_Bool ewk_view_stop(Evas_Object* ewkView) 1462 { 1463 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1464 1464 return ewk_frame_stop(sd->main_frame); 1465 1465 } 1466 1466 1467 Eina_Bool ewk_view_reload(Evas_Object* o)1468 { 1469 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1467 Eina_Bool ewk_view_reload(Evas_Object* ewkView) 1468 { 1469 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1470 1470 return ewk_frame_reload(sd->main_frame); 1471 1471 } 1472 1472 1473 Eina_Bool ewk_view_reload_full(Evas_Object* o)1474 { 1475 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1473 Eina_Bool ewk_view_reload_full(Evas_Object* ewkView) 1474 { 1475 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1476 1476 return ewk_frame_reload_full(sd->main_frame); 1477 1477 } 1478 1478 1479 Eina_Bool ewk_view_back(Evas_Object* o)1480 { 1481 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1479 Eina_Bool ewk_view_back(Evas_Object* ewkView) 1480 { 1481 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1482 1482 return ewk_frame_back(sd->main_frame); 1483 1483 } 1484 1484 1485 Eina_Bool ewk_view_forward(Evas_Object* o)1486 { 1487 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1485 Eina_Bool ewk_view_forward(Evas_Object* ewkView) 1486 { 1487 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1488 1488 return ewk_frame_forward(sd->main_frame); 1489 1489 } 1490 1490 1491 Eina_Bool ewk_view_navigate(Evas_Object* o, int steps)1492 { 1493 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1491 Eina_Bool ewk_view_navigate(Evas_Object* ewkView, int steps) 1492 { 1493 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1494 1494 return ewk_frame_navigate(sd->main_frame, steps); 1495 1495 } 1496 1496 1497 Eina_Bool ewk_view_back_possible(Evas_Object* o)1498 { 1499 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1497 Eina_Bool ewk_view_back_possible(Evas_Object* ewkView) 1498 { 1499 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1500 1500 return ewk_frame_back_possible(sd->main_frame); 1501 1501 } 1502 1502 1503 Eina_Bool ewk_view_forward_possible(Evas_Object* o)1504 { 1505 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1503 Eina_Bool ewk_view_forward_possible(Evas_Object* ewkView) 1504 { 1505 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1506 1506 return ewk_frame_forward_possible(sd->main_frame); 1507 1507 } 1508 1508 1509 Eina_Bool ewk_view_navigate_possible(Evas_Object* o, int steps)1510 { 1511 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1509 Eina_Bool ewk_view_navigate_possible(Evas_Object* ewkView, int steps) 1510 { 1511 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1512 1512 return ewk_frame_navigate_possible(sd->main_frame, steps); 1513 1513 } 1514 1514 1515 Eina_Bool ewk_view_history_enable_get(const Evas_Object* o)1516 { 1517 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1515 Eina_Bool ewk_view_history_enable_get(const Evas_Object* ewkView) 1516 { 1517 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1518 1518 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1519 1519 return static_cast<WebCore::BackForwardListImpl*>(priv->page->backForwardList())->enabled(); 1520 1520 } 1521 1521 1522 Eina_Bool ewk_view_history_enable_set(Evas_Object* o, Eina_Bool enable)1523 { 1524 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1522 Eina_Bool ewk_view_history_enable_set(Evas_Object* ewkView, Eina_Bool enable) 1523 { 1524 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1525 1525 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1526 1526 static_cast<WebCore::BackForwardListImpl*>(priv->page->backForwardList())->setEnabled(enable); … … 1528 1528 } 1529 1529 1530 Ewk_History* ewk_view_history_get(const Evas_Object* o)1531 { 1532 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);1530 Ewk_History* ewk_view_history_get(const Evas_Object* ewkView) 1531 { 1532 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 1533 1533 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0); 1534 1534 if (!static_cast<WebCore::BackForwardListImpl*>(priv->page->backForwardList())->enabled()) { … … 1545 1545 } 1546 1546 1547 Eina_Bool ewk_view_zoom_set(Evas_Object* o, float zoom, Evas_Coord cx, Evas_Coord cy)1548 { 1549 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1547 Eina_Bool ewk_view_zoom_set(Evas_Object* ewkView, float zoom, Evas_Coord cx, Evas_Coord cy) 1548 { 1549 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1550 1550 EWK_VIEW_PRIV_GET(sd, priv); 1551 1551 … … 1620 1620 } 1621 1621 1622 Eina_Bool ewk_view_zoom_weak_smooth_scale_get(const Evas_Object* o)1623 { 1624 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1622 Eina_Bool ewk_view_zoom_weak_smooth_scale_get(const Evas_Object* ewkView) 1623 { 1624 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1625 1625 return sd->zoom_weak_smooth_scale; 1626 1626 } 1627 1627 1628 void ewk_view_zoom_weak_smooth_scale_set(Evas_Object* o, Eina_Bool smooth_scale)1629 { 1630 EWK_VIEW_SD_GET_OR_RETURN( o, sd);1631 smooth _scale = !!smooth_scale;1632 if (sd->zoom_weak_smooth_scale == smooth _scale)1628 void ewk_view_zoom_weak_smooth_scale_set(Evas_Object* ewkView, Eina_Bool smoothScale) 1629 { 1630 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 1631 smoothScale = !!smoothScale; 1632 if (sd->zoom_weak_smooth_scale == smoothScale) 1633 1633 return; 1634 sd->zoom_weak_smooth_scale = smooth _scale;1634 sd->zoom_weak_smooth_scale = smoothScale; 1635 1635 EINA_SAFETY_ON_NULL_RETURN(sd->api); 1636 1636 EINA_SAFETY_ON_NULL_RETURN(sd->api->zoom_weak_smooth_scale_set); 1637 sd->api->zoom_weak_smooth_scale_set(sd, smooth _scale);1638 } 1639 1640 Eina_Bool ewk_view_zoom_weak_set(Evas_Object* o, float zoom, Evas_Coord cx, Evas_Coord cy)1641 { 1642 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1637 sd->api->zoom_weak_smooth_scale_set(sd, smoothScale); 1638 } 1639 1640 Eina_Bool ewk_view_zoom_weak_set(Evas_Object* ewkView, float zoom, Evas_Coord centerX, Evas_Coord centerY) 1641 { 1642 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1643 1643 EWK_VIEW_PRIV_GET(sd, priv); 1644 1644 … … 1663 1663 sd->animated_zoom.zoom.end = zoom; 1664 1664 sd->animated_zoom.zoom.current = zoom; 1665 return sd->api->zoom_weak_set(sd, zoom, c x, cy);1666 } 1667 1668 Eina_Bool ewk_view_zoom_animated_mark_start(Evas_Object* o, float zoom)1669 { 1670 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1665 return sd->api->zoom_weak_set(sd, zoom, centerX, centerY); 1666 } 1667 1668 Eina_Bool ewk_view_zoom_animated_mark_start(Evas_Object* ewkView, float zoom) 1669 { 1670 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1671 1671 sd->animated_zoom.zoom.start = zoom; 1672 1672 return EINA_TRUE; 1673 1673 } 1674 1674 1675 Eina_Bool ewk_view_zoom_animated_mark_end(Evas_Object* o, float zoom)1676 { 1677 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1675 Eina_Bool ewk_view_zoom_animated_mark_end(Evas_Object* ewkView, float zoom) 1676 { 1677 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1678 1678 sd->animated_zoom.zoom.end = zoom; 1679 1679 return EINA_TRUE; 1680 1680 } 1681 1681 1682 Eina_Bool ewk_view_zoom_animated_mark_current(Evas_Object* o, float zoom)1683 { 1684 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1682 Eina_Bool ewk_view_zoom_animated_mark_current(Evas_Object* ewkView, float zoom) 1683 { 1684 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1685 1685 sd->animated_zoom.zoom.current = zoom; 1686 1686 return EINA_TRUE; 1687 1687 } 1688 1688 1689 Eina_Bool ewk_view_zoom_animated_mark_stop(Evas_Object* o)1690 { 1691 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1689 Eina_Bool ewk_view_zoom_animated_mark_stop(Evas_Object* ewkView) 1690 { 1691 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1692 1692 _ewk_view_zoom_animated_mark_stop(sd); 1693 1693 return EINA_TRUE; 1694 1694 } 1695 1695 1696 Eina_Bool ewk_view_zoom_animated_set(Evas_Object* o, float zoom, float duration, Evas_Coord cx, Evas_Coord cy)1696 Eina_Bool ewk_view_zoom_animated_set(Evas_Object* ewkView, float zoom, float duration, Evas_Coord centerX, Evas_Coord centerY) 1697 1697 { 1698 1698 double now; 1699 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1699 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1700 1700 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1701 1701 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api, EINA_FALSE); … … 1723 1723 } 1724 1724 1725 if (c x< 0)1726 c x= 0;1727 if (c y< 0)1728 c y= 0;1725 if (centerX < 0) 1726 centerX = 0; 1727 if (centerY < 0) 1728 centerY = 0; 1729 1729 1730 1730 now = ecore_loop_time_get(); … … 1734 1734 priv->animated_zoom.zoom.end = zoom; 1735 1735 priv->animated_zoom.zoom.range = (priv->animated_zoom.zoom.end - priv->animated_zoom.zoom.start); 1736 priv->animated_zoom.center.x = c x;1737 priv->animated_zoom.center.y = c y;1736 priv->animated_zoom.center.x = centerX; 1737 priv->animated_zoom.center.y = centerY; 1738 1738 sd->animated_zoom.zoom.current = priv->animated_zoom.zoom.start; 1739 1739 sd->animated_zoom.zoom.start = priv->animated_zoom.zoom.start; … … 1743 1743 } 1744 1744 1745 Eina_Bool ewk_view_pre_render_region(Evas_Object* o, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, float zoom)1746 { 1747 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1745 Eina_Bool ewk_view_pre_render_region(Evas_Object* ewkView, Evas_Coord x, Evas_Coord y, Evas_Coord width, Evas_Coord height, float zoom) 1746 { 1747 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1748 1748 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1749 1749 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api->pre_render_region, EINA_FALSE); … … 1766 1766 cw *= zoom / cur_zoom; 1767 1767 ch *= zoom / cur_zoom; 1768 DBG("region %d,%d+%dx%d @ %f contents=%dx%d", x, y, w , h, zoom, cw, ch);1769 1770 if (x + w > cw)1771 w = cw - x;1772 1773 if (y + h > ch)1774 h = ch - y;1768 DBG("region %d,%d+%dx%d @ %f contents=%dx%d", x, y, width, height, zoom, cw, ch); 1769 1770 if (x + width > cw) 1771 width = cw - x; 1772 1773 if (y + height > ch) 1774 height = ch - y; 1775 1775 1776 1776 if (x < 0) { 1777 w += x;1777 width += x; 1778 1778 x = 0; 1779 1779 } 1780 1780 if (y < 0) { 1781 h += y;1781 height += y; 1782 1782 y = 0; 1783 1783 } 1784 1784 1785 return sd->api->pre_render_region(sd, x, y, w , h, zoom);1786 } 1787 1788 Eina_Bool ewk_view_pre_render_relative_radius(Evas_Object* o, unsigned int n)1789 { 1790 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1785 return sd->api->pre_render_region(sd, x, y, width, height, zoom); 1786 } 1787 1788 Eina_Bool ewk_view_pre_render_relative_radius(Evas_Object* ewkView, unsigned int number) 1789 { 1790 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1791 1791 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1792 1792 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api->pre_render_relative_radius, EINA_FALSE); … … 1797 1797 1798 1798 cur_zoom = ewk_frame_page_zoom_get(sd->main_frame); 1799 return sd->api->pre_render_relative_radius(sd, n , cur_zoom);1800 } 1801 1802 unsigned int ewk_view_imh_get(const Evas_Object* o)1803 { 1804 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);1799 return sd->api->pre_render_relative_radius(sd, number, cur_zoom); 1800 } 1801 1802 unsigned int ewk_view_imh_get(const Evas_Object* ewkView) 1803 { 1804 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 1805 1805 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0); 1806 1806 return priv->imh; 1807 1807 } 1808 1808 1809 void ewk_view_pre_render_cancel(Evas_Object* o)1810 { 1811 EWK_VIEW_SD_GET_OR_RETURN( o, sd);1809 void ewk_view_pre_render_cancel(Evas_Object* ewkView) 1810 { 1811 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 1812 1812 EINA_SAFETY_ON_NULL_RETURN(sd->api->pre_render_cancel); 1813 1813 sd->api->pre_render_cancel(sd); 1814 1814 } 1815 1815 1816 Eina_Bool ewk_view_enable_render(const Evas_Object* o)1817 { 1818 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1816 Eina_Bool ewk_view_enable_render(const Evas_Object* ewkView) 1817 { 1818 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1819 1819 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api->enable_render, EINA_FALSE); 1820 1820 return sd->api->enable_render(sd); 1821 1821 } 1822 1822 1823 Eina_Bool ewk_view_disable_render(const Evas_Object* o)1824 { 1825 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1823 Eina_Bool ewk_view_disable_render(const Evas_Object* ewkView) 1824 { 1825 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1826 1826 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api->disable_render, EINA_FALSE); 1827 1827 return sd->api->disable_render(sd); 1828 1828 } 1829 1829 1830 const char* ewk_view_setting_user_agent_get(const Evas_Object* o)1831 { 1832 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);1830 const char* ewk_view_setting_user_agent_get(const Evas_Object* ewkView) 1831 { 1832 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 1833 1833 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0); 1834 1834 return priv->settings.user_agent; 1835 1835 } 1836 1836 1837 Eina_Bool ewk_view_setting_user_agent_set(Evas_Object* o, const char* user_agent)1838 { 1839 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1840 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1841 if (eina_stringshare_replace(&priv->settings.user_agent, user _agent)) {1837 Eina_Bool ewk_view_setting_user_agent_set(Evas_Object* ewkView, const char* userAgent) 1838 { 1839 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1840 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1841 if (eina_stringshare_replace(&priv->settings.user_agent, userAgent)) { 1842 1842 WebCore::FrameLoaderClientEfl* client = static_cast<WebCore::FrameLoaderClientEfl*>(priv->main_frame->loader()->client()); 1843 client->setCustomUserAgent(String::fromUTF8(user _agent));1844 } 1845 return EINA_TRUE; 1846 } 1847 1848 const char* ewk_view_setting_user_stylesheet_get(const Evas_Object* o)1849 { 1850 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);1843 client->setCustomUserAgent(String::fromUTF8(userAgent)); 1844 } 1845 return EINA_TRUE; 1846 } 1847 1848 const char* ewk_view_setting_user_stylesheet_get(const Evas_Object* ewkView) 1849 { 1850 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 1851 1851 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0); 1852 1852 return priv->settings.user_stylesheet; 1853 1853 } 1854 1854 1855 Eina_Bool ewk_view_setting_user_stylesheet_set(Evas_Object* o, const char* uri)1856 { 1857 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1855 Eina_Bool ewk_view_setting_user_stylesheet_set(Evas_Object* ewkView, const char* uri) 1856 { 1857 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1858 1858 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1859 1859 if (eina_stringshare_replace(&priv->settings.user_stylesheet, uri)) { … … 1864 1864 } 1865 1865 1866 Eina_Bool ewk_view_setting_auto_load_images_get(const Evas_Object* o)1867 { 1868 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1866 Eina_Bool ewk_view_setting_auto_load_images_get(const Evas_Object* ewkView) 1867 { 1868 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1869 1869 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1870 1870 return priv->settings.auto_load_images; 1871 1871 } 1872 1872 1873 Eina_Bool ewk_view_setting_auto_load_images_set(Evas_Object* o, Eina_Bool automatic)1874 { 1875 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1873 Eina_Bool ewk_view_setting_auto_load_images_set(Evas_Object* ewkView, Eina_Bool automatic) 1874 { 1875 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1876 1876 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1877 1877 automatic = !!automatic; … … 1883 1883 } 1884 1884 1885 Eina_Bool ewk_view_setting_auto_shrink_images_get(const Evas_Object* o)1886 { 1887 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1885 Eina_Bool ewk_view_setting_auto_shrink_images_get(const Evas_Object* ewkView) 1886 { 1887 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1888 1888 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1889 1889 return priv->settings.auto_shrink_images; 1890 1890 } 1891 1891 1892 Eina_Bool ewk_view_setting_auto_shrink_images_set(Evas_Object* o, Eina_Bool automatic)1893 { 1894 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1892 Eina_Bool ewk_view_setting_auto_shrink_images_set(Evas_Object* ewkView, Eina_Bool automatic) 1893 { 1894 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1895 1895 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1896 1896 automatic = !!automatic; … … 1902 1902 } 1903 1903 1904 Eina_Bool ewk_view_setting_enable_auto_resize_window_get(const Evas_Object* o)1905 { 1906 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1904 Eina_Bool ewk_view_setting_enable_auto_resize_window_get(const Evas_Object* ewkView) 1905 { 1906 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1907 1907 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1908 1908 return priv->settings.enable_auto_resize_window; 1909 1909 } 1910 1910 1911 Eina_Bool ewk_view_setting_enable_auto_resize_window_set(Evas_Object* o, Eina_Bool resizable)1912 { 1913 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1911 Eina_Bool ewk_view_setting_enable_auto_resize_window_set(Evas_Object* ewkView, Eina_Bool resizable) 1912 { 1913 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1914 1914 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1915 1915 priv->settings.enable_auto_resize_window = resizable; … … 1917 1917 } 1918 1918 1919 Eina_Bool ewk_view_setting_enable_scripts_get(const Evas_Object* o)1920 { 1921 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1919 Eina_Bool ewk_view_setting_enable_scripts_get(const Evas_Object* ewkView) 1920 { 1921 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1922 1922 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1923 1923 return priv->settings.enable_scripts; 1924 1924 } 1925 1925 1926 Eina_Bool ewk_view_setting_enable_scripts_set(Evas_Object* o, Eina_Bool enable)1927 { 1928 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1926 Eina_Bool ewk_view_setting_enable_scripts_set(Evas_Object* ewkView, Eina_Bool enable) 1927 { 1928 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1929 1929 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1930 1930 enable = !!enable; … … 1936 1936 } 1937 1937 1938 Eina_Bool ewk_view_setting_enable_plugins_get(const Evas_Object* o)1939 { 1940 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1938 Eina_Bool ewk_view_setting_enable_plugins_get(const Evas_Object* ewkView) 1939 { 1940 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1941 1941 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1942 1942 return priv->settings.enable_plugins; 1943 1943 } 1944 1944 1945 Eina_Bool ewk_view_setting_enable_plugins_set(Evas_Object* o, Eina_Bool enable)1946 { 1947 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1945 Eina_Bool ewk_view_setting_enable_plugins_set(Evas_Object* ewkView, Eina_Bool enable) 1946 { 1947 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1948 1948 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1949 1949 enable = !!enable; … … 1955 1955 } 1956 1956 1957 Eina_Bool ewk_view_setting_enable_frame_flattening_get(const Evas_Object* o)1958 { 1959 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1957 Eina_Bool ewk_view_setting_enable_frame_flattening_get(const Evas_Object* ewkView) 1958 { 1959 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1960 1960 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1961 1961 return priv->settings.enable_frame_flattening; 1962 1962 } 1963 1963 1964 Eina_Bool ewk_view_setting_enable_frame_flattening_set(Evas_Object* o, Eina_Bool enable)1965 { 1966 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1964 Eina_Bool ewk_view_setting_enable_frame_flattening_set(Evas_Object* ewkView, Eina_Bool enable) 1965 { 1966 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1967 1967 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1968 1968 enable = !!enable; … … 1974 1974 } 1975 1975 1976 Eina_Bool ewk_view_setting_scripts_window_open_get(const Evas_Object* o)1977 { 1978 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1976 Eina_Bool ewk_view_setting_scripts_window_open_get(const Evas_Object* ewkView) 1977 { 1978 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1979 1979 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1980 1980 return priv->settings.scripts_window_open; 1981 1981 } 1982 1982 1983 Eina_Bool ewk_view_setting_scripts_window_open_set(Evas_Object* o, Eina_Bool allow)1984 { 1985 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1983 Eina_Bool ewk_view_setting_scripts_window_open_set(Evas_Object* ewkView, Eina_Bool allow) 1984 { 1985 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1986 1986 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1987 1987 allow = !!allow; … … 1993 1993 } 1994 1994 1995 Eina_Bool ewk_view_setting_scripts_can_close_windows_get(const Evas_Object* o)1996 { 1997 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);1995 Eina_Bool ewk_view_setting_scripts_can_close_windows_get(const Evas_Object* ewkView) 1996 { 1997 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 1998 1998 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 1999 1999 return priv->settings.scripts_can_close_windows; 2000 2000 } 2001 2001 2002 Eina_Bool ewk_view_setting_scripts_can_close_windows_set(Evas_Object* o, Eina_Bool allow)2003 { 2004 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2002 Eina_Bool ewk_view_setting_scripts_can_close_windows_set(Evas_Object* ewkView, Eina_Bool allow) 2003 { 2004 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2005 2005 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2006 2006 allow = !!allow; … … 2012 2012 } 2013 2013 2014 Eina_Bool ewk_view_setting_resizable_textareas_get(const Evas_Object* o)2015 { 2016 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2014 Eina_Bool ewk_view_setting_resizable_textareas_get(const Evas_Object* ewkView) 2015 { 2016 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2017 2017 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2018 2018 return priv->settings.resizable_textareas; 2019 2019 } 2020 2020 2021 Eina_Bool ewk_view_setting_resizable_textareas_set(Evas_Object* o, Eina_Bool enable)2022 { 2023 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2021 Eina_Bool ewk_view_setting_resizable_textareas_set(Evas_Object* ewkView, Eina_Bool enable) 2022 { 2023 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2024 2024 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2025 2025 enable = !!enable; … … 2031 2031 } 2032 2032 2033 Eina_Bool ewk_view_setting_private_browsing_get(const Evas_Object* o)2034 { 2035 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2033 Eina_Bool ewk_view_setting_private_browsing_get(const Evas_Object* ewkView) 2034 { 2035 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2036 2036 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2037 2037 return priv->settings.private_browsing; 2038 2038 } 2039 2039 2040 Eina_Bool ewk_view_setting_private_browsing_set(Evas_Object* o, Eina_Bool enable)2041 { 2042 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2040 Eina_Bool ewk_view_setting_private_browsing_set(Evas_Object* ewkView, Eina_Bool enable) 2041 { 2042 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2043 2043 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2044 2044 enable = !!enable; … … 2050 2050 } 2051 2051 2052 Eina_Bool ewk_view_setting_offline_app_cache_get(const Evas_Object* o)2053 { 2054 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2052 Eina_Bool ewk_view_setting_offline_app_cache_get(const Evas_Object* ewkView) 2053 { 2054 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2055 2055 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2056 2056 return priv->settings.offline_app_cache; 2057 2057 } 2058 2058 2059 Eina_Bool ewk_view_setting_offline_app_cache_set(Evas_Object* o, Eina_Bool enable)2060 { 2061 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2059 Eina_Bool ewk_view_setting_offline_app_cache_set(Evas_Object* ewkView, Eina_Bool enable) 2060 { 2061 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2062 2062 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2063 2063 enable = !!enable; … … 2070 2070 2071 2071 2072 Eina_Bool ewk_view_setting_caret_browsing_get(const Evas_Object* o)2073 { 2074 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2072 Eina_Bool ewk_view_setting_caret_browsing_get(const Evas_Object* ewkView) 2073 { 2074 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2075 2075 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2076 2076 return priv->settings.caret_browsing; 2077 2077 } 2078 2078 2079 Eina_Bool ewk_view_setting_caret_browsing_set(Evas_Object* o, Eina_Bool enable)2080 { 2081 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2079 Eina_Bool ewk_view_setting_caret_browsing_set(Evas_Object* ewkView, Eina_Bool enable) 2080 { 2081 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2082 2082 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2083 2083 enable = !!enable; … … 2089 2089 } 2090 2090 2091 const char* ewk_view_setting_encoding_custom_get(const Evas_Object* o)2092 { 2093 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);2091 const char* ewk_view_setting_encoding_custom_get(const Evas_Object* ewkView) 2092 { 2093 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 2094 2094 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0); 2095 Evas_Object* main_frame = ewk_view_frame_main_get( o);2095 Evas_Object* main_frame = ewk_view_frame_main_get(ewkView); 2096 2096 WebCore::Frame* core_frame = ewk_frame_core_get(main_frame); 2097 2097 … … 2105 2105 } 2106 2106 2107 Eina_Bool ewk_view_setting_encoding_custom_set(Evas_Object* o, const char* encoding)2108 { 2109 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2110 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2111 Evas_Object* main_frame = ewk_view_frame_main_get( o);2107 Eina_Bool ewk_view_setting_encoding_custom_set(Evas_Object* ewkView, const char* encoding) 2108 { 2109 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2110 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2111 Evas_Object* main_frame = ewk_view_frame_main_get(ewkView); 2112 2112 WebCore::Frame* core_frame = ewk_frame_core_get(main_frame); 2113 2113 DBG("%s", encoding); … … 2117 2117 } 2118 2118 2119 const char* ewk_view_setting_encoding_default_get(const Evas_Object* o)2120 { 2121 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);2119 const char* ewk_view_setting_encoding_default_get(const Evas_Object* ewkView) 2120 { 2121 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 2122 2122 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0); 2123 2123 return priv->settings.encoding_default; 2124 2124 } 2125 2125 2126 Eina_Bool ewk_view_setting_encoding_default_set(Evas_Object* o, const char* encoding)2127 { 2128 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2126 Eina_Bool ewk_view_setting_encoding_default_set(Evas_Object* ewkView, const char* encoding) 2127 { 2128 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2129 2129 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2130 2130 if (eina_stringshare_replace(&priv->settings.encoding_default, encoding)) … … 2133 2133 } 2134 2134 2135 Eina_Bool ewk_view_setting_encoding_detector_set(Evas_Object* o, Eina_Bool enable)2136 { 2137 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2135 Eina_Bool ewk_view_setting_encoding_detector_set(Evas_Object* ewkView, Eina_Bool enable) 2136 { 2137 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2138 2138 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2139 2139 enable = !!enable; … … 2145 2145 } 2146 2146 2147 Eina_Bool ewk_view_setting_encoding_detector_get(const Evas_Object* o)2148 { 2149 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2147 Eina_Bool ewk_view_setting_encoding_detector_get(const Evas_Object* ewkView) 2148 { 2149 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2150 2150 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2151 2151 return priv->settings.encoding_detector; 2152 2152 } 2153 2153 2154 Eina_Bool ewk_view_setting_enable_developer_extras_get(const Evas_Object* o)2155 { 2156 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2154 Eina_Bool ewk_view_setting_enable_developer_extras_get(const Evas_Object* ewkView) 2155 { 2156 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2157 2157 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2158 2158 return priv->settings.enable_developer_extras; 2159 2159 } 2160 2160 2161 Eina_Bool ewk_view_setting_enable_developer_extras_set(Evas_Object* o, Eina_Bool enable)2162 { 2163 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2161 Eina_Bool ewk_view_setting_enable_developer_extras_set(Evas_Object* ewkView, Eina_Bool enable) 2162 { 2163 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2164 2164 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2165 2165 enable = !!enable; … … 2171 2171 } 2172 2172 2173 int ewk_view_setting_font_minimum_size_get(const Evas_Object* o)2174 { 2175 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);2173 int ewk_view_setting_font_minimum_size_get(const Evas_Object* ewkView) 2174 { 2175 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 2176 2176 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0); 2177 2177 return priv->settings.font_minimum_size; 2178 2178 } 2179 2179 2180 Eina_Bool ewk_view_setting_font_minimum_size_set(Evas_Object* o, int size)2181 { 2182 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2180 Eina_Bool ewk_view_setting_font_minimum_size_set(Evas_Object* ewkView, int size) 2181 { 2182 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2183 2183 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2184 2184 if (priv->settings.font_minimum_size != size) { … … 2189 2189 } 2190 2190 2191 int ewk_view_setting_font_minimum_logical_size_get(const Evas_Object* o)2192 { 2193 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);2191 int ewk_view_setting_font_minimum_logical_size_get(const Evas_Object* ewkView) 2192 { 2193 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 2194 2194 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0); 2195 2195 return priv->settings.font_minimum_logical_size; 2196 2196 } 2197 2197 2198 Eina_Bool ewk_view_setting_font_minimum_logical_size_set(Evas_Object* o, int size)2199 { 2200 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2198 Eina_Bool ewk_view_setting_font_minimum_logical_size_set(Evas_Object* ewkView, int size) 2199 { 2200 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2201 2201 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2202 2202 if (priv->settings.font_minimum_logical_size != size) { … … 2207 2207 } 2208 2208 2209 int ewk_view_setting_font_default_size_get(const Evas_Object* o)2210 { 2211 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);2209 int ewk_view_setting_font_default_size_get(const Evas_Object* ewkView) 2210 { 2211 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 2212 2212 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0); 2213 2213 return priv->settings.font_default_size; 2214 2214 } 2215 2215 2216 Eina_Bool ewk_view_setting_font_default_size_set(Evas_Object* o, int size)2217 { 2218 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2216 Eina_Bool ewk_view_setting_font_default_size_set(Evas_Object* ewkView, int size) 2217 { 2218 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2219 2219 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2220 2220 if (priv->settings.font_default_size != size) { … … 2225 2225 } 2226 2226 2227 int ewk_view_setting_font_monospace_size_get(const Evas_Object* o)2228 { 2229 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);2227 int ewk_view_setting_font_monospace_size_get(const Evas_Object* ewkView) 2228 { 2229 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 2230 2230 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0); 2231 2231 return priv->settings.font_monospace_size; 2232 2232 } 2233 2233 2234 Eina_Bool ewk_view_setting_font_monospace_size_set(Evas_Object* o, int size)2235 { 2236 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2234 Eina_Bool ewk_view_setting_font_monospace_size_set(Evas_Object* ewkView, int size) 2235 { 2236 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2237 2237 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2238 2238 if (priv->settings.font_monospace_size != size) { … … 2243 2243 } 2244 2244 2245 const char* ewk_view_font_family_name_get(const Evas_Object* o, Ewk_Font_Family font_family)2246 { 2247 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);2245 const char* ewk_view_font_family_name_get(const Evas_Object* ewkView, Ewk_Font_Family fontFamily) 2246 { 2247 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 2248 2248 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0); 2249 2249 2250 switch (font _family) {2250 switch (fontFamily) { 2251 2251 case EWK_FONT_FAMILY_STANDARD: 2252 2252 return priv->settings.font_standard; … … 2265 2265 } 2266 2266 2267 Eina_Bool ewk_view_font_family_name_set(Evas_Object* o, Ewk_Font_Family font_family, const char* name)2268 { 2269 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2270 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2271 2272 switch (font _family) {2267 Eina_Bool ewk_view_font_family_name_set(Evas_Object* ewkView, Ewk_Font_Family fontFamily, const char* name) 2268 { 2269 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2270 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2271 2272 switch (fontFamily) { 2273 2273 case EWK_FONT_FAMILY_STANDARD: 2274 2274 if (eina_stringshare_replace(&priv->settings.font_standard, name)) … … 2302 2302 } 2303 2303 2304 Eina_Bool ewk_view_setting_spatial_navigation_get(const Evas_Object* o)2305 { 2306 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2304 Eina_Bool ewk_view_setting_spatial_navigation_get(const Evas_Object* ewkView) 2305 { 2306 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2307 2307 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2308 2308 return priv->settings.spatial_navigation; 2309 2309 } 2310 2310 2311 Eina_Bool ewk_view_setting_spatial_navigation_set(Evas_Object* o, Eina_Bool enable)2312 { 2313 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2311 Eina_Bool ewk_view_setting_spatial_navigation_set(Evas_Object* ewkView, Eina_Bool enable) 2312 { 2313 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2314 2314 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2315 2315 enable = !!enable; … … 2321 2321 } 2322 2322 2323 Eina_Bool ewk_view_setting_local_storage_get(const Evas_Object* o)2324 { 2325 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2323 Eina_Bool ewk_view_setting_local_storage_get(const Evas_Object* ewkView) 2324 { 2325 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2326 2326 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2327 2327 return priv->settings.local_storage; 2328 2328 } 2329 2329 2330 Eina_Bool ewk_view_setting_local_storage_set(Evas_Object* o, Eina_Bool enable)2331 { 2332 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2330 Eina_Bool ewk_view_setting_local_storage_set(Evas_Object* ewkView, Eina_Bool enable) 2331 { 2332 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2333 2333 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2334 2334 enable = !!enable; … … 2340 2340 } 2341 2341 2342 Eina_Bool ewk_view_setting_page_cache_get(const Evas_Object* o)2343 { 2344 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2342 Eina_Bool ewk_view_setting_page_cache_get(const Evas_Object* ewkView) 2343 { 2344 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2345 2345 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2346 2346 return priv->settings.page_cache; 2347 2347 } 2348 2348 2349 Eina_Bool ewk_view_setting_page_cache_set(Evas_Object* o, Eina_Bool enable)2350 { 2351 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2349 Eina_Bool ewk_view_setting_page_cache_set(Evas_Object* ewkView, Eina_Bool enable) 2350 { 2351 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2352 2352 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2353 2353 enable = !!enable; … … 2359 2359 } 2360 2360 2361 const char* ewk_view_setting_local_storage_database_path_get(const Evas_Object* o)2362 { 2363 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);2361 const char* ewk_view_setting_local_storage_database_path_get(const Evas_Object* ewkView) 2362 { 2363 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 2364 2364 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0); 2365 2365 return priv->settings.local_storage_database_path; 2366 2366 } 2367 2367 2368 Eina_Bool ewk_view_setting_local_storage_database_path_set(Evas_Object* o, const char* path)2369 { 2370 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2368 Eina_Bool ewk_view_setting_local_storage_database_path_set(Evas_Object* ewkView, const char* path) 2369 { 2370 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2371 2371 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2372 2372 if (eina_stringshare_replace(&priv->settings.local_storage_database_path, path)) … … 2375 2375 } 2376 2376 2377 Eina_Bool ewk_view_setting_minimum_timer_interval_set(Evas_Object* o, double interval)2378 { 2379 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2377 Eina_Bool ewk_view_setting_minimum_timer_interval_set(Evas_Object* ewkView, double interval) 2378 { 2379 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2380 2380 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2381 2381 if (fabs(priv->settings.dom_timer_interval - interval) >= std::numeric_limits<double>::epsilon()) { … … 2386 2386 } 2387 2387 2388 double ewk_view_setting_minimum_timer_interval_get(const Evas_Object* o)2389 { 2390 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);2388 double ewk_view_setting_minimum_timer_interval_get(const Evas_Object* ewkView) 2389 { 2390 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 2391 2391 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 2392 2392 return priv->settings.dom_timer_interval; 2393 2393 } 2394 2394 2395 Ewk_View_Smart_Data* ewk_view_smart_data_get(const Evas_Object* o)2396 { 2397 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);2395 Ewk_View_Smart_Data* ewk_view_smart_data_get(const Evas_Object* ewkView) 2396 { 2397 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 2398 2398 return sd; 2399 2399 } … … 2467 2467 * to define their own backing store. 2468 2468 */ 2469 void ewk_view_repaint_add(Ewk_View_Private_Data* priv, Evas_Coord x, Evas_Coord y, Evas_Coord w , Evas_Coord h)2469 void ewk_view_repaint_add(Ewk_View_Private_Data* priv, Evas_Coord x, Evas_Coord y, Evas_Coord width, Evas_Coord height) 2470 2470 { 2471 2471 EINA_SAFETY_ON_NULL_RETURN(priv); 2472 _ewk_view_repaint_add(priv, x, y, w , h);2472 _ewk_view_repaint_add(priv, x, y, width, height); 2473 2473 } 2474 2474 … … 2493 2493 } 2494 2494 2495 void ewk_view_scrolls_process(Ewk_View_Smart_Data* s d)2496 { 2497 EINA_SAFETY_ON_NULL_RETURN(s d);2498 EWK_VIEW_PRIV_GET_OR_RETURN(s d, priv);2499 if (!s d->api->scrolls_process(sd))2495 void ewk_view_scrolls_process(Ewk_View_Smart_Data* smartData) 2496 { 2497 EINA_SAFETY_ON_NULL_RETURN(smartData); 2498 EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv); 2499 if (!smartData->api->scrolls_process(smartData)) 2500 2500 ERR("failed to process scrolls."); 2501 2501 _ewk_view_scrolls_flush(priv); … … 2536 2536 } 2537 2537 2538 void ewk_view_paint_context_free(Ewk_View_Paint_Context* c txt)2539 { 2540 EINA_SAFETY_ON_NULL_RETURN(c txt);2541 delete c txt->gc;2542 cairo_destroy(c txt->cr);2543 free(c txt);2544 } 2545 2546 void ewk_view_paint_context_save(Ewk_View_Paint_Context* c txt)2547 { 2548 EINA_SAFETY_ON_NULL_RETURN(c txt);2549 cairo_save(c txt->cr);2550 c txt->gc->save();2551 } 2552 2553 void ewk_view_paint_context_restore(Ewk_View_Paint_Context* c txt)2554 { 2555 EINA_SAFETY_ON_NULL_RETURN(c txt);2556 c txt->gc->restore();2557 cairo_restore(c txt->cr);2558 } 2559 2560 void ewk_view_paint_context_clip(Ewk_View_Paint_Context* c txt, const Eina_Rectangle* area)2561 { 2562 EINA_SAFETY_ON_NULL_RETURN(c txt);2538 void ewk_view_paint_context_free(Ewk_View_Paint_Context* context) 2539 { 2540 EINA_SAFETY_ON_NULL_RETURN(context); 2541 delete context->gc; 2542 cairo_destroy(context->cr); 2543 free(context); 2544 } 2545 2546 void ewk_view_paint_context_save(Ewk_View_Paint_Context* context) 2547 { 2548 EINA_SAFETY_ON_NULL_RETURN(context); 2549 cairo_save(context->cr); 2550 context->gc->save(); 2551 } 2552 2553 void ewk_view_paint_context_restore(Ewk_View_Paint_Context* context) 2554 { 2555 EINA_SAFETY_ON_NULL_RETURN(context); 2556 context->gc->restore(); 2557 cairo_restore(context->cr); 2558 } 2559 2560 void ewk_view_paint_context_clip(Ewk_View_Paint_Context* context, const Eina_Rectangle* area) 2561 { 2562 EINA_SAFETY_ON_NULL_RETURN(context); 2563 2563 EINA_SAFETY_ON_NULL_RETURN(area); 2564 c txt->gc->clip(WebCore::IntRect(area->x, area->y, area->w, area->h));2565 } 2566 2567 void ewk_view_paint_context_paint(Ewk_View_Paint_Context* c txt, const Eina_Rectangle* area)2568 { 2569 EINA_SAFETY_ON_NULL_RETURN(c txt);2564 context->gc->clip(WebCore::IntRect(area->x, area->y, area->w, area->h)); 2565 } 2566 2567 void ewk_view_paint_context_paint(Ewk_View_Paint_Context* context, const Eina_Rectangle* area) 2568 { 2569 EINA_SAFETY_ON_NULL_RETURN(context); 2570 2570 EINA_SAFETY_ON_NULL_RETURN(area); 2571 2571 2572 2572 WebCore::IntRect rect(area->x, area->y, area->w, area->h); 2573 2573 2574 if (c txt->view->isTransparent())2575 c txt->gc->clearRect(rect);2576 c txt->view->paint(ctxt->gc, rect);2577 } 2578 2579 void ewk_view_paint_context_paint_contents(Ewk_View_Paint_Context* c txt, const Eina_Rectangle* area)2580 { 2581 EINA_SAFETY_ON_NULL_RETURN(c txt);2574 if (context->view->isTransparent()) 2575 context->gc->clearRect(rect); 2576 context->view->paint(context->gc, rect); 2577 } 2578 2579 void ewk_view_paint_context_paint_contents(Ewk_View_Paint_Context* context, const Eina_Rectangle* area) 2580 { 2581 EINA_SAFETY_ON_NULL_RETURN(context); 2582 2582 EINA_SAFETY_ON_NULL_RETURN(area); 2583 2583 2584 2584 WebCore::IntRect rect(area->x, area->y, area->w, area->h); 2585 2585 2586 if (c txt->view->isTransparent())2587 c txt->gc->clearRect(rect);2588 2589 c txt->view->paintContents(ctxt->gc, rect);2590 } 2591 2592 void ewk_view_paint_context_scale(Ewk_View_Paint_Context* c txt, float scale_x, float scale_y)2593 { 2594 EINA_SAFETY_ON_NULL_RETURN(c txt);2595 2596 c txt->gc->scale(WebCore::FloatSize(scale_x, scale_y));2597 } 2598 2599 void ewk_view_paint_context_translate(Ewk_View_Paint_Context* c txt, float x, float y)2600 { 2601 EINA_SAFETY_ON_NULL_RETURN(c txt);2602 2603 c txt->gc->translate(x, y);2586 if (context->view->isTransparent()) 2587 context->gc->clearRect(rect); 2588 2589 context->view->paintContents(context->gc, rect); 2590 } 2591 2592 void ewk_view_paint_context_scale(Ewk_View_Paint_Context* context, float scaleX, float scaleY) 2593 { 2594 EINA_SAFETY_ON_NULL_RETURN(context); 2595 2596 context->gc->scale(WebCore::FloatSize(scaleX, scaleY)); 2597 } 2598 2599 void ewk_view_paint_context_translate(Ewk_View_Paint_Context* context, float x, float y) 2600 { 2601 EINA_SAFETY_ON_NULL_RETURN(context); 2602 2603 context->gc->translate(x, y); 2604 2604 } 2605 2605 … … 2660 2660 * Emits signal: "ready" with no parameters. 2661 2661 */ 2662 void ewk_view_ready(Evas_Object* o)2663 { 2664 DBG(" o=%p", o);2665 evas_object_smart_callback_call( o, "ready", 0);2662 void ewk_view_ready(Evas_Object* ewkView) 2663 { 2664 DBG("ewkView=%p", ewkView); 2665 evas_object_smart_callback_call(ewkView, "ready", 0); 2666 2666 } 2667 2667 … … 2674 2674 * enabled or not. 2675 2675 */ 2676 void ewk_view_input_method_state_set(Evas_Object* o, Eina_Bool active)2677 { 2678 EWK_VIEW_SD_GET_OR_RETURN( o, sd);2676 void ewk_view_input_method_state_set(Evas_Object* ewkView, Eina_Bool active) 2677 { 2678 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 2679 2679 EWK_VIEW_PRIV_GET(sd, priv); 2680 2680 WebCore::Frame* focusedFrame = priv->page->focusController()->focusedOrMainFrame(); … … 2703 2703 } 2704 2704 2705 evas_object_smart_callback_call( o, "inputmethod,changed", (void*)active);2705 evas_object_smart_callback_call(ewkView, "inputmethod,changed", (void*)active); 2706 2706 } 2707 2707 … … 2712 2712 * Emits signal: "title,changed" with pointer to new title string. 2713 2713 */ 2714 void ewk_view_title_set(Evas_Object* o, const char* title)2715 { 2716 DBG(" o=%p, title=%s", o, title ? title : "(null)");2717 evas_object_smart_callback_call( o, "title,changed", (void*)title);2714 void ewk_view_title_set(Evas_Object* ewkView, const char* title) 2715 { 2716 DBG("ewkView=%p, title=%s", ewkView, title ? title : "(null)"); 2717 evas_object_smart_callback_call(ewkView, "title,changed", (void*)title); 2718 2718 } 2719 2719 … … 2724 2724 * Emits signal: "uri,changed" with pointer to the new uri string. 2725 2725 */ 2726 void ewk_view_uri_changed(Evas_Object* o)2727 { 2728 EWK_VIEW_SD_GET_OR_RETURN( o, sd);2726 void ewk_view_uri_changed(Evas_Object* ewkView) 2727 { 2728 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 2729 2729 const char* uri = ewk_frame_uri_get(sd->main_frame); 2730 DBG(" o=%p, uri=%s", o, uri ? uri : "(null)");2731 evas_object_smart_callback_call( o, "uri,changed", (void*)uri);2730 DBG("ewkView=%p, uri=%s", ewkView, uri ? uri : "(null)"); 2731 evas_object_smart_callback_call(ewkView, "uri,changed", (void*)uri); 2732 2732 } 2733 2733 … … 2741 2741 * Emits signal: "load,document,finished" with @p frame as the parameter. 2742 2742 */ 2743 void ewk_view_load_document_finished(Evas_Object* o, Evas_Object* frame)2744 { 2745 evas_object_smart_callback_call( o, "load,document,finished", frame);2743 void ewk_view_load_document_finished(Evas_Object* ewkView, Evas_Object* frame) 2744 { 2745 evas_object_smart_callback_call(ewkView, "load,document,finished", frame); 2746 2746 } 2747 2747 … … 2754 2754 * Emits signal: "load,started" with no parameters. 2755 2755 */ 2756 void ewk_view_load_started(Evas_Object* o)2757 { 2758 DBG(" o=%p", o);2759 evas_object_smart_callback_call( o, "load,started", 0);2756 void ewk_view_load_started(Evas_Object* ewkView) 2757 { 2758 DBG("ewkView=%p", ewkView); 2759 evas_object_smart_callback_call(ewkView, "load,started", 0); 2760 2760 } 2761 2761 … … 2767 2767 * Emits signal: "load,started" on main frame with no parameters. 2768 2768 */ 2769 void ewk_view_frame_main_load_started(Evas_Object* o)2770 { 2771 DBG(" o=%p", o);2772 Evas_Object* frame = ewk_view_frame_main_get( o);2769 void ewk_view_frame_main_load_started(Evas_Object* ewkView) 2770 { 2771 DBG("ewkView=%p", ewkView); 2772 Evas_Object* frame = ewk_view_frame_main_get(ewkView); 2773 2773 evas_object_smart_callback_call(frame, "load,started", 0); 2774 2774 } … … 2782 2782 * Emits signal: "load,provisional" on View with no parameters. 2783 2783 */ 2784 void ewk_view_load_provisional(Evas_Object* o)2785 { 2786 DBG(" o=%p", o);2787 evas_object_smart_callback_call( o, "load,provisional", 0);2784 void ewk_view_load_provisional(Evas_Object* ewkView) 2785 { 2786 DBG("ewkView=%p", ewkView); 2787 evas_object_smart_callback_call(ewkView, "load,provisional", 0); 2788 2788 } 2789 2789 … … 2796 2796 * Emits signal: "load,newwindow,show" on view with no parameters. 2797 2797 */ 2798 void ewk_view_load_show(Evas_Object* o)2799 { 2800 DBG(" o=%p", o);2801 evas_object_smart_callback_call( o, "load,newwindow,show", 0);2798 void ewk_view_load_show(Evas_Object* ewkView) 2799 { 2800 DBG("ewkView=%p", ewkView); 2801 evas_object_smart_callback_call(ewkView, "load,newwindow,show", 0); 2802 2802 } 2803 2803 … … 2809 2809 * @param o View. 2810 2810 */ 2811 void ewk_view_frame_main_cleared(Evas_Object* o)2812 { 2813 DBG(" o=%p", o);2814 EWK_VIEW_SD_GET_OR_RETURN( o, sd);2811 void ewk_view_frame_main_cleared(Evas_Object* ewkView) 2812 { 2813 DBG("ewkView=%p", ewkView); 2814 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 2815 2815 EINA_SAFETY_ON_NULL_RETURN(sd->api->flush); 2816 2816 sd->api->flush(sd); … … 2825 2825 * Emits signal: "icon,received" with no parameters. 2826 2826 */ 2827 void ewk_view_frame_main_icon_received(Evas_Object* o)2828 { 2829 DBG(" o=%p", o);2830 Evas_Object* frame = ewk_view_frame_main_get( o);2827 void ewk_view_frame_main_icon_received(Evas_Object* ewkView) 2828 { 2829 DBG("ewkView=%p", ewkView); 2830 Evas_Object* frame = ewk_view_frame_main_get(ewkView); 2831 2831 evas_object_smart_callback_call(frame, "icon,received", 0); 2832 2832 } … … 2842 2842 * compatible with previous WebKit. 2843 2843 */ 2844 void ewk_view_load_finished(Evas_Object* o, const Ewk_Frame_Load_Error* error)2845 { 2846 DBG(" o=%p, error=%p", o, error);2847 evas_object_smart_callback_call( o, "load,finished", (void*)error);2844 void ewk_view_load_finished(Evas_Object* ewkView, const Ewk_Frame_Load_Error* error) 2845 { 2846 DBG("ewkView=%p, error=%p", ewkView, error); 2847 evas_object_smart_callback_call(ewkView, "load,finished", (void*)error); 2848 2848 } 2849 2849 … … 2854 2854 * Emits signal: "load,error" with pointer to Ewk_Frame_Load_Error. 2855 2855 */ 2856 void ewk_view_load_error(Evas_Object* o, const Ewk_Frame_Load_Error* error)2857 { 2858 DBG(" o=%p, error=%p", o, error);2859 evas_object_smart_callback_call( o, "load,error", (void*)error);2856 void ewk_view_load_error(Evas_Object* ewkView, const Ewk_Frame_Load_Error* error) 2857 { 2858 DBG("ewkView=%p, error=%p", ewkView, error); 2859 evas_object_smart_callback_call(ewkView, "load,error", (void*)error); 2860 2860 } 2861 2861 … … 2866 2866 * Emits signal: "load,progress" with pointer to a double from 0.0 to 1.0. 2867 2867 */ 2868 void ewk_view_load_progress_changed(Evas_Object* o)2869 { 2870 EWK_VIEW_SD_GET_OR_RETURN( o, sd);2868 void ewk_view_load_progress_changed(Evas_Object* ewkView) 2869 { 2870 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 2871 2871 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv); 2872 2872 … … 2874 2874 double progress = priv->page->progress()->estimatedProgress(); 2875 2875 2876 DBG(" o=%p (p=%0.3f)", o, progress);2877 2878 evas_object_smart_callback_call( o, "load,progress", &progress);2876 DBG("ewkView=%p (p=%0.3f)", ewkView, progress); 2877 2878 evas_object_smart_callback_call(ewkView, "load,progress", &progress); 2879 2879 } 2880 2880 … … 2888 2888 * Emits signal: "restore" with frame. 2889 2889 */ 2890 void ewk_view_restore_state(Evas_Object* o, Evas_Object* frame)2891 { 2892 evas_object_smart_callback_call( o, "restore", frame);2890 void ewk_view_restore_state(Evas_Object* ewkView, Evas_Object* frame) 2891 { 2892 evas_object_smart_callback_call(ewkView, "restore", frame); 2893 2893 } 2894 2894 … … 2914 2914 * @see ewk_window_features_ref(). 2915 2915 */ 2916 Evas_Object* ewk_view_window_create(Evas_Object* o, Eina_Bool javascript, const WebCore::WindowFeatures* coreFeatures)2917 { 2918 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);2916 Evas_Object* ewk_view_window_create(Evas_Object* ewkView, Eina_Bool javascript, const WebCore::WindowFeatures* coreFeatures) 2917 { 2918 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 2919 2919 2920 2920 if (!sd->api->window_create) 2921 return o;2921 return ewkView; 2922 2922 2923 2923 Ewk_Window_Features* window_features = ewk_window_features_new_from_core(coreFeatures); … … 2942 2942 * @param o View to be closed. 2943 2943 */ 2944 void ewk_view_window_close(Evas_Object* o)2945 { 2946 EWK_VIEW_SD_GET_OR_RETURN( o, sd);2947 2948 ewk_view_stop( o);2944 void ewk_view_window_close(Evas_Object* ewkView) 2945 { 2946 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 2947 2948 ewk_view_stop(ewkView); 2949 2949 if (!sd->api->window_close) 2950 2950 return; … … 2958 2958 * Emits signal: "link,hover,in" 2959 2959 */ 2960 void ewk_view_mouse_link_hover_in(Evas_Object* o, void* data)2961 { 2962 evas_object_smart_callback_call( o, "link,hover,in", data);2960 void ewk_view_mouse_link_hover_in(Evas_Object* ewkView, void* data) 2961 { 2962 evas_object_smart_callback_call(ewkView, "link,hover,in", data); 2963 2963 } 2964 2964 … … 2969 2969 * Emits signal: "link,hover,out" 2970 2970 */ 2971 void ewk_view_mouse_link_hover_out(Evas_Object* o)2972 { 2973 evas_object_smart_callback_call( o, "link,hover,out", 0);2971 void ewk_view_mouse_link_hover_out(Evas_Object* ewkView) 2972 { 2973 evas_object_smart_callback_call(ewkView, "link,hover,out", 0); 2974 2974 } 2975 2975 … … 2980 2980 * Emits signal: "toolbars,visible,set" with a pointer to a boolean. 2981 2981 */ 2982 void ewk_view_toolbars_visible_set(Evas_Object* o, Eina_Bool visible)2983 { 2984 DBG(" o=%p (visible=%d)", o, !!visible);2985 evas_object_smart_callback_call( o, "toolbars,visible,set", &visible);2982 void ewk_view_toolbars_visible_set(Evas_Object* ewkView, Eina_Bool visible) 2983 { 2984 DBG("ewkView=%p (visible=%d)", ewkView, !!visible); 2985 evas_object_smart_callback_call(ewkView, "toolbars,visible,set", &visible); 2986 2986 } 2987 2987 … … 2997 2997 * Emits signal: "toolbars,visible,get" with a pointer to a boolean. 2998 2998 */ 2999 void ewk_view_toolbars_visible_get(Evas_Object* o, Eina_Bool* visible)3000 { 3001 DBG("%s, o=%p", __func__, o);2999 void ewk_view_toolbars_visible_get(Evas_Object* ewkView, Eina_Bool* visible) 3000 { 3001 DBG("%s, o=%p", __func__, ewkView); 3002 3002 *visible = EINA_FALSE; 3003 evas_object_smart_callback_call( o, "toolbars,visible,get", visible);3003 evas_object_smart_callback_call(ewkView, "toolbars,visible,get", visible); 3004 3004 } 3005 3005 … … 3013 3013 * Emits signal: "statusbar,visible,set" with a pointer to a boolean. 3014 3014 */ 3015 void ewk_view_statusbar_visible_set(Evas_Object* o, Eina_Bool visible)3016 { 3017 DBG(" o=%p (visible=%d)", o, !!visible);3018 evas_object_smart_callback_call( o, "statusbar,visible,set", &visible);3015 void ewk_view_statusbar_visible_set(Evas_Object* ewkView, Eina_Bool visible) 3016 { 3017 DBG("ewkView=%p (visible=%d)", ewkView, !!visible); 3018 evas_object_smart_callback_call(ewkView, "statusbar,visible,set", &visible); 3019 3019 } 3020 3020 … … 3030 3030 * Emits signal: "statusbar,visible,get" with a pointer to a boolean. 3031 3031 */ 3032 void ewk_view_statusbar_visible_get(Evas_Object* o, Eina_Bool* visible)3033 { 3034 DBG("%s, o=%p", __func__, o);3032 void ewk_view_statusbar_visible_get(Evas_Object* ewkView, Eina_Bool* visible) 3033 { 3034 DBG("%s, o=%p", __func__, ewkView); 3035 3035 *visible = EINA_FALSE; 3036 evas_object_smart_callback_call( o, "statusbar,visible,get", visible);3036 evas_object_smart_callback_call(ewkView, "statusbar,visible,get", visible); 3037 3037 } 3038 3038 … … 3046 3046 * Emits signal: "statusbar,text,set" with a string. 3047 3047 */ 3048 void ewk_view_statusbar_text_set(Evas_Object* o, const char* text)3049 { 3050 DBG(" o=%p (text=%s)", o, text);3048 void ewk_view_statusbar_text_set(Evas_Object* ewkView, const char* text) 3049 { 3050 DBG("ewkView=%p (text=%s)", ewkView, text); 3051 3051 INF("status bar text set: %s", text); 3052 evas_object_smart_callback_call( o, "statusbar,text,set", (void*)text);3052 evas_object_smart_callback_call(ewkView, "statusbar,text,set", (void*)text); 3053 3053 } 3054 3054 … … 3062 3062 * Emits signal: "scrollbars,visible,set" with a pointer to a boolean. 3063 3063 */ 3064 void ewk_view_scrollbars_visible_set(Evas_Object* o, Eina_Bool visible)3065 { 3066 DBG(" o=%p (visible=%d)", o, !!visible);3067 evas_object_smart_callback_call( o, "scrollbars,visible,set", &visible);3064 void ewk_view_scrollbars_visible_set(Evas_Object* ewkView, Eina_Bool visible) 3065 { 3066 DBG("ewkView=%p (visible=%d)", ewkView, !!visible); 3067 evas_object_smart_callback_call(ewkView, "scrollbars,visible,set", &visible); 3068 3068 } 3069 3069 … … 3079 3079 * Emits signal: "scrollbars,visible,get" with a pointer to a boolean. 3080 3080 */ 3081 void ewk_view_scrollbars_visible_get(Evas_Object* o, Eina_Bool* visible)3082 { 3083 DBG("%s, o=%p", __func__, o);3081 void ewk_view_scrollbars_visible_get(Evas_Object* ewkView, Eina_Bool* visible) 3082 { 3083 DBG("%s, o=%p", __func__, ewkView); 3084 3084 *visible = EINA_FALSE; 3085 evas_object_smart_callback_call( o, "scrollbars,visible,get", visible);3085 evas_object_smart_callback_call(ewkView, "scrollbars,visible,get", visible); 3086 3086 } 3087 3087 … … 3095 3095 * Emits signal: "menubar,visible,set" with a pointer to a boolean. 3096 3096 */ 3097 void ewk_view_menubar_visible_set(Evas_Object* o, Eina_Bool visible)3098 { 3099 DBG(" o=%p (visible=%d)", o, !!visible);3100 evas_object_smart_callback_call( o, "menubar,visible,set", &visible);3097 void ewk_view_menubar_visible_set(Evas_Object* ewkView, Eina_Bool visible) 3098 { 3099 DBG("ewkView=%p (visible=%d)", ewkView, !!visible); 3100 evas_object_smart_callback_call(ewkView, "menubar,visible,set", &visible); 3101 3101 } 3102 3102 … … 3112 3112 * Emits signal: "menubar,visible,get" with a pointer to a boolean. 3113 3113 */ 3114 void ewk_view_menubar_visible_get(Evas_Object* o, Eina_Bool* visible)3115 { 3116 DBG("%s, o=%p", __func__, o);3114 void ewk_view_menubar_visible_get(Evas_Object* ewkView, Eina_Bool* visible) 3115 { 3116 DBG("%s, o=%p", __func__, ewkView); 3117 3117 *visible = EINA_FALSE; 3118 evas_object_smart_callback_call( o, "menubar,visible,get", visible);3118 evas_object_smart_callback_call(ewkView, "menubar,visible,get", visible); 3119 3119 } 3120 3120 … … 3129 3129 * removed, text will be 0 or '\0' 3130 3130 */ 3131 void ewk_view_tooltip_text_set(Evas_Object* o, const char* text)3132 { 3133 DBG(" o=%p text=%s", o, text);3134 evas_object_smart_callback_call( o, "tooltip,text,set", (void*)text);3131 void ewk_view_tooltip_text_set(Evas_Object* ewkView, const char* text) 3132 { 3133 DBG("ewkView=%p text=%s", ewkView, text); 3134 evas_object_smart_callback_call(ewkView, "tooltip,text,set", (void*)text); 3135 3135 } 3136 3136 … … 3144 3144 * 3145 3145 */ 3146 void ewk_view_add_console_message(Evas_Object* o, const char* message, unsigned int lineNumber, const char* sourceID)3147 { 3148 DBG(" o=%p message=%s lineNumber=%u sourceID=%s", o, message, lineNumber, sourceID);3149 EWK_VIEW_SD_GET_OR_RETURN( o, sd);3146 void ewk_view_add_console_message(Evas_Object* ewkView, const char* message, unsigned int lineNumber, const char* sourceID) 3147 { 3148 DBG("ewkView=%p message=%s lineNumber=%u sourceID=%s", ewkView, message, lineNumber, sourceID); 3149 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 3150 3150 EINA_SAFETY_ON_NULL_RETURN(sd->api); 3151 3151 EINA_SAFETY_ON_NULL_RETURN(sd->api->add_console_message); … … 3153 3153 } 3154 3154 3155 bool ewk_view_focus_can_cycle(Evas_Object* o, Ewk_Focus_Direction direction)3156 { 3157 DBG(" o=%p direction=%d", o, direction);3158 EWK_VIEW_SD_GET_OR_RETURN( o, sd, false);3155 bool ewk_view_focus_can_cycle(Evas_Object* ewkView, Ewk_Focus_Direction direction) 3156 { 3157 DBG("ewkView=%p direction=%d", ewkView, direction); 3158 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, false); 3159 3159 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api, false); 3160 3160 … … 3165 3165 } 3166 3166 3167 void ewk_view_run_javascript_alert(Evas_Object* o, Evas_Object* frame, const char* message)3168 { 3169 DBG(" o=%p frame=%p message=%s", o, frame, message);3170 EWK_VIEW_SD_GET_OR_RETURN( o, sd);3167 void ewk_view_run_javascript_alert(Evas_Object* ewkView, Evas_Object* frame, const char* message) 3168 { 3169 DBG("ewkView=%p frame=%p message=%s", ewkView, frame, message); 3170 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 3171 3171 EINA_SAFETY_ON_NULL_RETURN(sd->api); 3172 3172 … … 3177 3177 } 3178 3178 3179 Eina_Bool ewk_view_run_javascript_confirm(Evas_Object* o, Evas_Object* frame, const char* message)3180 { 3181 DBG(" o=%p frame=%p message=%s", o, frame, message);3182 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);3179 Eina_Bool ewk_view_run_javascript_confirm(Evas_Object* ewkView, Evas_Object* frame, const char* message) 3180 { 3181 DBG("ewkView=%p frame=%p message=%s", ewkView, frame, message); 3182 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 3183 3183 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api, EINA_FALSE); 3184 3184 … … 3189 3189 } 3190 3190 3191 Eina_Bool ewk_view_run_javascript_prompt(Evas_Object* o, Evas_Object* frame, const char* message, const char* defaultValue, char** value)3192 { 3193 DBG(" o=%p frame=%p message=%s", o, frame, message);3194 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);3191 Eina_Bool ewk_view_run_javascript_prompt(Evas_Object* ewkView, Evas_Object* frame, const char* message, const char* defaultValue, char** value) 3192 { 3193 DBG("ewkView=%p frame=%p message=%s", ewkView, frame, message); 3194 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 3195 3195 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api, EINA_FALSE); 3196 3196 … … 3212 3212 * @return @c EINA_TRUE if script should be stopped; @c EINA_FALSE otherwise 3213 3213 */ 3214 Eina_Bool ewk_view_should_interrupt_javascript(Evas_Object* o)3215 { 3216 DBG(" o=%p", o);3217 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);3214 Eina_Bool ewk_view_should_interrupt_javascript(Evas_Object* ewkView) 3215 { 3216 DBG("ewkView=%p", ewkView); 3217 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 3218 3218 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api, EINA_FALSE); 3219 3219 … … 3238 3238 * site's requirement. 3239 3239 */ 3240 uint64_t ewk_view_exceeded_database_quota(Evas_Object* o, Evas_Object* frame, const char* databaseName, uint64_t current_size, uint64_t expected_size)3241 { 3242 DBG(" o=%p", o);3243 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);3240 uint64_t ewk_view_exceeded_database_quota(Evas_Object* ewkView, Evas_Object* frame, const char* databaseName, uint64_t currentSize, uint64_t expectedSize) 3241 { 3242 DBG("ewkView=%p", ewkView); 3243 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 3244 3244 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api, 0); 3245 3245 if (!sd->api->exceeded_database_quota) 3246 3246 return 0; 3247 3247 3248 INF("current_size=%" PRIu64 " expected_size=%" PRIu64, current _size, expected_size);3249 return sd->api->exceeded_database_quota(sd, frame, databaseName, current _size, expected_size);3248 INF("current_size=%" PRIu64 " expected_size=%" PRIu64, currentSize, expectedSize); 3249 return sd->api->exceeded_database_quota(sd, frame, databaseName, currentSize, expectedSize); 3250 3250 } 3251 3251 … … 3263 3263 * @return @EINA_FALSE if user canceled file selection; @EINA_TRUE if confirmed. 3264 3264 */ 3265 Eina_Bool ewk_view_run_open_panel(Evas_Object* o, Evas_Object* frame, Eina_Bool allows_multiple_files, const char* accept_types, Eina_List** selected_filenames)3266 { 3267 DBG(" o=%p frame=%p allows_multiple_files=%d", o, frame, allows_multiple_files);3268 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);3265 Eina_Bool ewk_view_run_open_panel(Evas_Object* ewkView, Evas_Object* frame, Eina_Bool allowsMultipleFiles, const char* acceptTypes, Eina_List** selectedFilenames) 3266 { 3267 DBG("ewkView=%p frame=%p allows_multiple_files=%d", ewkView, frame, allowsMultipleFiles); 3268 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 3269 3269 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api, EINA_FALSE); 3270 3270 Eina_Bool confirm; … … 3273 3273 return EINA_FALSE; 3274 3274 3275 *selected _filenames = 0;3276 3277 confirm = sd->api->run_open_panel(sd, frame, allows _multiple_files, accept_types, selected_filenames);3278 if (!confirm && *selected _filenames)3275 *selectedFilenames = 0; 3276 3277 confirm = sd->api->run_open_panel(sd, frame, allowsMultipleFiles, acceptTypes, selectedFilenames); 3278 if (!confirm && *selectedFilenames) 3279 3279 ERR("Canceled file selection, but selected filenames != 0. Free names before return."); 3280 3280 return confirm; 3281 3281 } 3282 3282 3283 void ewk_view_repaint(Evas_Object* o, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)3284 { 3285 DBG(" o=%p, region=%d,%d + %dx%d", o, x, y, w, h);3286 EWK_VIEW_SD_GET_OR_RETURN( o, sd);3283 void ewk_view_repaint(Evas_Object* ewkView, Evas_Coord x, Evas_Coord y, Evas_Coord width, Evas_Coord height) 3284 { 3285 DBG("ewkView=%p, region=%d,%d + %dx%d", ewkView, x, y, width, height); 3286 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 3287 3287 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv); 3288 3288 … … 3292 3292 } 3293 3293 3294 _ewk_view_repaint_add(priv, x, y, w , h);3294 _ewk_view_repaint_add(priv, x, y, width, height); 3295 3295 _ewk_view_smart_changed(sd); 3296 3296 } 3297 3297 3298 void ewk_view_scroll(Evas_Object* o, Evas_Coord dx, Evas_Coord dy, Evas_Coord sx, Evas_Coord sy, Evas_Coord sw, Evas_Coord sh, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch, Eina_Bool main_frame)3299 { 3300 DBG(" o=%p, delta: %d,%d, scroll: %d,%d+%dx%d, clip: %d,%d+%dx%d",3301 o, dx, dy, sx, sy, sw, sh, cx, cy, cw, ch);3302 3303 if ((s x != cx) || (sy != cy) || (sw != cw) || (sh != ch))3298 void ewk_view_scroll(Evas_Object* ewkView, Evas_Coord dx, Evas_Coord dy, Evas_Coord scrollX, Evas_Coord scrollY, Evas_Coord scrollWidth, Evas_Coord scrollHeight, Evas_Coord centerX, Evas_Coord centerY, Evas_Coord centerWidth, Evas_Coord centerHeight, Eina_Bool mainFrame) 3299 { 3300 DBG("ewkView=%p, delta: %d,%d, scroll: %d,%d+%dx%d, clip: %d,%d+%dx%d", 3301 ewkView, dx, dy, scrollX, scrollY, scrollWidth, scrollHeight, centerX, centerY, centerWidth, centerHeight); 3302 3303 if ((scrollX != centerX) || (scrollY != centerY) || (scrollWidth != centerWidth) || (scrollHeight != centerHeight)) 3304 3304 WRN("scroll region and clip are different! %d,%d+%dx%d and %d,%d+%dx%d", 3305 s x, sy, sw, sh, cx, cy, cw, ch);3306 3307 EWK_VIEW_SD_GET_OR_RETURN( o, sd);3305 scrollX, scrollY, scrollWidth, scrollHeight, centerX, centerY, centerWidth, centerHeight); 3306 3307 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 3308 3308 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv); 3309 3309 EINA_SAFETY_ON_TRUE_RETURN(!dx && !dy); 3310 3310 3311 _ewk_view_scroll_add(priv, dx, dy, s x, sy, sw, sh, main_frame);3311 _ewk_view_scroll_add(priv, dx, dy, scrollX, scrollY, scrollWidth, scrollHeight, mainFrame); 3312 3312 3313 3313 _ewk_view_smart_changed(sd); 3314 3314 } 3315 3315 3316 WebCore::Page* ewk_view_core_page_get(const Evas_Object* o)3317 { 3318 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);3316 WebCore::Page* ewk_view_core_page_get(const Evas_Object* ewkView) 3317 { 3318 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 3319 3319 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0); 3320 3320 return priv->page; … … 3326 3326 * Emits "frame,created" with the new frame object on success. 3327 3327 */ 3328 WTF::PassRefPtr<WebCore::Frame> ewk_view_frame_create(Evas_Object* o, Evas_Object* frame, const WTF::String& name, WebCore::HTMLFrameOwnerElement* ownerElement, const WebCore::KURL& url, const WTF::String& referrer)3329 { 3330 DBG(" o=%p, frame=%p, name=%s, ownerElement=%p, url=%s, referrer=%s",3331 o, frame, name.utf8().data(), ownerElement,3328 WTF::PassRefPtr<WebCore::Frame> ewk_view_frame_create(Evas_Object* ewkView, Evas_Object* frame, const WTF::String& name, WebCore::HTMLFrameOwnerElement* ownerElement, const WebCore::KURL& url, const WTF::String& referrer) 3329 { 3330 DBG("ewkView=%p, frame=%p, name=%s, ownerElement=%p, url=%s, referrer=%s", 3331 ewkView, frame, name.utf8().data(), ownerElement, 3332 3332 url.string().utf8().data(), referrer.utf8().data()); 3333 3333 3334 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);3334 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 3335 3335 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0); 3336 3336 … … 3354 3354 _ewk_view_smart_changed(sd); 3355 3355 3356 evas_object_smart_callback_call( o, "frame,created", frame);3356 evas_object_smart_callback_call(ewkView, "frame,created", frame); 3357 3357 return cf.release(); 3358 3358 } 3359 3359 3360 WTF::PassRefPtr<WebCore::Widget> ewk_view_plugin_create(Evas_Object* o, Evas_Object* frame, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues, const WTF::String& mimeType, bool loadManually)3361 { 3362 DBG(" o=%p, frame=%p, size=%dx%d, element=%p, url=%s, mimeType=%s",3363 o, frame, pluginSize.width(), pluginSize.height(), element,3360 WTF::PassRefPtr<WebCore::Widget> ewk_view_plugin_create(Evas_Object* ewkView, Evas_Object* frame, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues, const WTF::String& mimeType, bool loadManually) 3361 { 3362 DBG("ewkView=%p, frame=%p, size=%dx%d, element=%p, url=%s, mimeType=%s", 3363 ewkView, frame, pluginSize.width(), pluginSize.height(), element, 3364 3364 url.string().utf8().data(), mimeType.utf8().data()); 3365 3365 3366 EWK_VIEW_SD_GET_OR_RETURN( o, sd, 0);3366 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, 0); 3367 3367 sd->changed.frame_rect = EINA_TRUE; 3368 3368 _ewk_view_smart_changed(sd); … … 3384 3384 * Emits: "popup,create" with a list of Ewk_Menu containing each item's data 3385 3385 */ 3386 void ewk_view_popup_new(Evas_Object* o, WebCore::PopupMenuClient* client, int selected, const WebCore::IntRect& rect)3387 { 3388 INF(" o=%p", o);3389 EWK_VIEW_SD_GET_OR_RETURN( o, sd);3386 void ewk_view_popup_new(Evas_Object* ewkView, WebCore::PopupMenuClient* client, int selected, const WebCore::IntRect& rect) 3387 { 3388 INF("ewkView=%p", ewkView); 3389 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 3390 3390 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv); 3391 3391 3392 3392 if (priv->popup.menu_client) 3393 ewk_view_popup_destroy( o);3393 ewk_view_popup_destroy(ewkView); 3394 3394 3395 3395 priv->popup.menu_client = client; … … 3414 3414 priv->popup.menu.width = rect.width(); 3415 3415 priv->popup.menu.height = rect.height(); 3416 evas_object_smart_callback_call( o, "popup,create", &priv->popup.menu);3417 } 3418 3419 Eina_Bool ewk_view_popup_destroy(Evas_Object* o)3420 { 3421 INF(" o=%p", o);3422 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);3416 evas_object_smart_callback_call(ewkView, "popup,create", &priv->popup.menu); 3417 } 3418 3419 Eina_Bool ewk_view_popup_destroy(Evas_Object* ewkView) 3420 { 3421 INF("ewkView=%p", ewkView); 3422 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 3423 3423 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 3424 3424 … … 3426 3426 return EINA_FALSE; 3427 3427 3428 evas_object_smart_callback_call( o, "popup,willdelete", &priv->popup.menu);3428 evas_object_smart_callback_call(ewkView, "popup,willdelete", &priv->popup.menu); 3429 3429 3430 3430 void* itemv; … … 3440 3440 } 3441 3441 3442 void ewk_view_popup_selected_set(Evas_Object* o, int index)3443 { 3444 INF(" o=%p", o);3445 EWK_VIEW_SD_GET_OR_RETURN( o, sd);3442 void ewk_view_popup_selected_set(Evas_Object* ewkView, int index) 3443 { 3444 INF("ewkView=%p", ewkView); 3445 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 3446 3446 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv); 3447 3447 EINA_SAFETY_ON_NULL_RETURN(priv->popup.menu_client); … … 3460 3460 * requested download. The download per se must be handled outside of webkit. 3461 3461 */ 3462 void ewk_view_download_request(Evas_Object* o, Ewk_Download* download)3463 { 3464 DBG(" view=%p", o);3465 evas_object_smart_callback_call( o, "download,request", download);3462 void ewk_view_download_request(Evas_Object* ewkView, Ewk_Download* download) 3463 { 3464 DBG("ewkView=%p", ewkView); 3465 evas_object_smart_callback_call(ewkView, "download,request", download); 3466 3466 } 3467 3467 … … 3473 3473 * @param frame the frame. 3474 3474 */ 3475 void ewk_view_js_window_object_clear(Evas_Object* o, Evas_Object* frame)3476 { 3477 evas_object_smart_callback_call( o, "js,windowobject,clear", frame);3475 void ewk_view_js_window_object_clear(Evas_Object* ewkView, Evas_Object* frame) 3476 { 3477 evas_object_smart_callback_call(ewkView, "js,windowobject,clear", frame); 3478 3478 } 3479 3479 … … 3486 3486 * Emits signal: "viewport,changed" with no parameters. 3487 3487 */ 3488 void ewk_view_viewport_attributes_set(Evas_Object* o, const WebCore::ViewportArguments& arguments)3489 { 3490 EWK_VIEW_SD_GET( o, sd);3488 void ewk_view_viewport_attributes_set(Evas_Object* ewkView, const WebCore::ViewportArguments& arguments) 3489 { 3490 EWK_VIEW_SD_GET(ewkView, sd); 3491 3491 EWK_VIEW_PRIV_GET(sd, priv); 3492 3492 3493 3493 priv->viewport_arguments = arguments; 3494 evas_object_smart_callback_call( o, "viewport,changed", 0);3495 } 3496 3497 void ewk_view_viewport_attributes_get(const Evas_Object* o, int* w, int* h, float* init_scale, float* max_scale, float* min_scale, float* device_pixel_ratio, Eina_Bool* user_scalable)3498 { 3499 WebCore::ViewportAttributes attributes = _ewk_view_viewport_attributes_compute( o);3500 3501 if (w )3502 *w = attributes.layoutSize.width();3503 if (h )3504 *h = attributes.layoutSize.height();3505 if (init _scale)3506 *init _scale = attributes.initialScale;3507 if (max _scale)3508 *max _scale = attributes.maximumScale;3509 if (min _scale)3510 *min _scale = attributes.minimumScale;3511 if (device _pixel_ratio)3512 *device _pixel_ratio = attributes.devicePixelRatio;3513 if (user _scalable)3514 *user _scalable = static_cast<bool>(attributes.userScalable);3515 } 3516 3517 Eina_Bool ewk_view_zoom_range_set(Evas_Object* o, float min_scale, float max_scale)3518 { 3519 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);3520 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 3521 3522 if (max _scale < min_scale) {3494 evas_object_smart_callback_call(ewkView, "viewport,changed", 0); 3495 } 3496 3497 void ewk_view_viewport_attributes_get(const Evas_Object* ewkView, int* width, int* height, float* initScale, float* maxScale, float* minScale, float* devicePixelRatio, Eina_Bool* userScalable) 3498 { 3499 WebCore::ViewportAttributes attributes = _ewk_view_viewport_attributes_compute(ewkView); 3500 3501 if (width) 3502 *width = attributes.layoutSize.width(); 3503 if (height) 3504 *height = attributes.layoutSize.height(); 3505 if (initScale) 3506 *initScale = attributes.initialScale; 3507 if (maxScale) 3508 *maxScale = attributes.maximumScale; 3509 if (minScale) 3510 *minScale = attributes.minimumScale; 3511 if (devicePixelRatio) 3512 *devicePixelRatio = attributes.devicePixelRatio; 3513 if (userScalable) 3514 *userScalable = static_cast<bool>(attributes.userScalable); 3515 } 3516 3517 Eina_Bool ewk_view_zoom_range_set(Evas_Object* ewkView, float minScale, float maxScale) 3518 { 3519 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 3520 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 3521 3522 if (maxScale < minScale) { 3523 3523 WRN("min_scale is larger than max_scale"); 3524 3524 return EINA_FALSE; 3525 3525 } 3526 3526 3527 priv->settings.zoom_range.min_scale = min _scale;3528 priv->settings.zoom_range.max_scale = max _scale;3529 3530 return EINA_TRUE; 3531 } 3532 3533 float ewk_view_zoom_range_min_get(const Evas_Object* o)3534 { 3535 EWK_VIEW_SD_GET_OR_RETURN( o, sd, -1.0);3527 priv->settings.zoom_range.min_scale = minScale; 3528 priv->settings.zoom_range.max_scale = maxScale; 3529 3530 return EINA_TRUE; 3531 } 3532 3533 float ewk_view_zoom_range_min_get(const Evas_Object* ewkView) 3534 { 3535 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, -1.0); 3536 3536 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, -1.0); 3537 3537 … … 3539 3539 } 3540 3540 3541 float ewk_view_zoom_range_max_get(const Evas_Object* o)3542 { 3543 EWK_VIEW_SD_GET_OR_RETURN( o, sd, -1.0);3541 float ewk_view_zoom_range_max_get(const Evas_Object* ewkView) 3542 { 3543 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, -1.0); 3544 3544 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, -1.0); 3545 3545 … … 3547 3547 } 3548 3548 3549 Eina_Bool ewk_view_user_scalable_set(Evas_Object* o, Eina_Bool user_scalable)3550 { 3551 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);3552 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 3553 3554 priv->settings.zoom_range.user_scalable = user _scalable;3555 3556 return EINA_TRUE; 3557 } 3558 3559 Eina_Bool ewk_view_user_scalable_get(const Evas_Object* o)3560 { 3561 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);3549 Eina_Bool ewk_view_user_scalable_set(Evas_Object* ewkView, Eina_Bool userScalable) 3550 { 3551 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 3552 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 3553 3554 priv->settings.zoom_range.user_scalable = userScalable; 3555 3556 return EINA_TRUE; 3557 } 3558 3559 Eina_Bool ewk_view_user_scalable_get(const Evas_Object* ewkView) 3560 { 3561 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 3562 3562 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 3563 3563 … … 3565 3565 } 3566 3566 3567 float ewk_view_device_pixel_ratio_get(const Evas_Object* o)3568 { 3569 EWK_VIEW_SD_GET_OR_RETURN( o, sd, -1.0);3567 float ewk_view_device_pixel_ratio_get(const Evas_Object* ewkView) 3568 { 3569 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, -1.0); 3570 3570 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, -1.0); 3571 3571 … … 3573 3573 } 3574 3574 3575 void ewk_view_did_first_visually_nonempty_layout(Evas_Object* o)3576 { 3577 EWK_VIEW_SD_GET_OR_RETURN( o, sd);3575 void ewk_view_did_first_visually_nonempty_layout(Evas_Object* ewkView) 3576 { 3577 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 3578 3578 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv); 3579 3579 if (!priv->flags.view_cleared) { 3580 ewk_view_frame_main_cleared( o);3581 ewk_view_enable_render( o);3580 ewk_view_frame_main_cleared(ewkView); 3581 ewk_view_enable_render(ewkView); 3582 3582 priv->flags.view_cleared = EINA_TRUE; 3583 3583 } … … 3590 3590 * @param o view. 3591 3591 */ 3592 void ewk_view_dispatch_did_finish_loading(Evas_Object* o)3592 void ewk_view_dispatch_did_finish_loading(Evas_Object* ewkView) 3593 3593 { 3594 3594 /* If we reach this point and rendering is still disabled, WebCore will not … … 3596 3596 * forcefully re-enable the rendering. 3597 3597 */ 3598 ewk_view_did_first_visually_nonempty_layout( o);3599 } 3600 3601 void ewk_view_transition_to_commited_for_newpage(Evas_Object* o)3602 { 3603 EWK_VIEW_SD_GET_OR_RETURN( o, sd);3598 ewk_view_did_first_visually_nonempty_layout(ewkView); 3599 } 3600 3601 void ewk_view_transition_to_commited_for_newpage(Evas_Object* ewkView) 3602 { 3603 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 3604 3604 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv); 3605 3605 3606 ewk_view_disable_render( o);3606 ewk_view_disable_render(ewkView); 3607 3607 priv->flags.view_cleared = EINA_FALSE; 3608 3608 } … … 3618 3618 * @param request Request which contain url to navigate 3619 3619 */ 3620 Eina_Bool ewk_view_navigation_policy_decision(Evas_Object* o, Ewk_Frame_Resource_Request* request)3621 { 3622 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_TRUE);3620 Eina_Bool ewk_view_navigation_policy_decision(Evas_Object* ewkView, Ewk_Frame_Resource_Request* request) 3621 { 3622 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_TRUE); 3623 3623 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api, EINA_TRUE); 3624 3624 … … 3629 3629 } 3630 3630 3631 Eina_Bool ewk_view_js_object_add(Evas_Object* o, Ewk_JS_Object* obj, const char* obj_name)3631 Eina_Bool ewk_view_js_object_add(Evas_Object* ewkView, Ewk_JS_Object* object, const char* objectName) 3632 3632 { 3633 3633 #if ENABLE(NETSCAPE_PLUGIN_API) 3634 if (obj ->view) // object has already been added to another ewk_view3634 if (object->view) // object has already been added to another ewk_view 3635 3635 return EINA_FALSE; 3636 obj ->name = eina_stringshare_add(obj_name);3637 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);3636 object->name = eina_stringshare_add(object_name); 3637 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 3638 3638 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 3639 3639 … … 3650 3650 JSC::ExecState* exec = window->globalExec(); 3651 3651 3652 obj->view = o;3652 obj->view = ewkView; 3653 3653 JSC::JSObject* runtimeObject = (JSC::JSObject*)JSC::Bindings::CInstance::create((NPObject*)obj, root)->createRuntimeObject(exec); 3654 3654 JSC::Identifier id = JSC::Identifier(exec, obj_name); … … 3662 3662 } 3663 3663 3664 Eina_Bool ewk_view_protocol_handler_set(Evas_Object* o, const char** protocols, Ewk_View_Resource_Handler_Cb handler, void* context)3665 { 3666 EWK_VIEW_SD_GET( o, sd);3664 Eina_Bool ewk_view_protocol_handler_set(Evas_Object* ewkView, const char** protocols, Ewk_View_Resource_Handler_Cb handler, void* context) 3665 { 3666 EWK_VIEW_SD_GET(ewkView, sd); 3667 3667 EWK_VIEW_PRIV_GET(sd, priv); 3668 3668 … … 3676 3676 } 3677 3677 3678 Eina_Bool ewk_view_protocol_handler_unset(Evas_Object* o)3679 { 3680 EWK_VIEW_SD_GET( o, sd);3678 Eina_Bool ewk_view_protocol_handler_unset(Evas_Object* ewkView) 3679 { 3680 EWK_VIEW_SD_GET(ewkView, sd); 3681 3681 EWK_VIEW_PRIV_GET(sd, priv); 3682 3682 Eina_Bool ret = ewk_custom_protocol_handler_all_unset(); … … 3690 3690 } 3691 3691 3692 void* ewk_view_protocol_handler_resource_get(Evas_Object* o, size_t* bytesRead, char** mime, const char* file)3693 { 3694 EWK_VIEW_SD_GET( o, sd);3692 void* ewk_view_protocol_handler_resource_get(Evas_Object* ewkView, size_t* bytesRead, char** mime, const char* file) 3693 { 3694 EWK_VIEW_SD_GET(ewkView, sd); 3695 3695 EWK_VIEW_PRIV_GET(sd, priv); 3696 3696 … … 3711 3711 * @param h new content height. 3712 3712 */ 3713 void ewk_view_contents_size_changed(Evas_Object* o, int w, int h)3714 { 3715 EWK_VIEW_SD_GET_OR_RETURN( o, sd);3713 void ewk_view_contents_size_changed(Evas_Object* ewkView, int width, int height) 3714 { 3715 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd); 3716 3716 EINA_SAFETY_ON_NULL_RETURN(sd->api); 3717 3717 EINA_SAFETY_ON_NULL_RETURN(sd->api->contents_resize); 3718 3718 3719 if (!sd->api->contents_resize(sd, w , h))3720 ERR("failed to resize contents to %dx%d", w , h);3719 if (!sd->api->contents_resize(sd, width, height)) 3720 ERR("failed to resize contents to %dx%d", width, height); 3721 3721 } 3722 3722 … … 3729 3729 * @return page size. 3730 3730 */ 3731 WebCore::FloatRect ewk_view_page_rect_get(const Evas_Object* o)3732 { 3733 EWK_VIEW_SD_GET( o, sd);3731 WebCore::FloatRect ewk_view_page_rect_get(const Evas_Object* ewkView) 3732 { 3733 EWK_VIEW_SD_GET(ewkView, sd); 3734 3734 EWK_VIEW_PRIV_GET(sd, priv); 3735 3735 … … 3739 3739 3740 3740 #if ENABLE(TOUCH_EVENTS) 3741 void ewk_view_need_touch_events_set(Evas_Object* o, bool needed)3742 { 3743 EWK_VIEW_SD_GET( o, sd);3741 void ewk_view_need_touch_events_set(Evas_Object* ewkView, bool needed) 3742 { 3743 EWK_VIEW_SD_GET(ewkView, sd); 3744 3744 EWK_VIEW_PRIV_GET(sd, priv); 3745 3745 … … 3747 3747 } 3748 3748 3749 Eina_Bool ewk_view_need_touch_events_get(const Evas_Object* o)3750 { 3751 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);3749 Eina_Bool ewk_view_need_touch_events_get(const Evas_Object* ewkView) 3750 { 3751 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 3752 3752 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 3753 3753 return priv->flags.need_touch_events; … … 3755 3755 #endif 3756 3756 3757 Eina_Bool ewk_view_mode_set(Evas_Object* o, Ewk_View_Mode view_mode)3758 { 3759 EWK_VIEW_SD_GET_OR_RETURN( o, sd, EINA_FALSE);3760 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 3761 3762 switch (view _mode) {3757 Eina_Bool ewk_view_mode_set(Evas_Object* ewkView, Ewk_View_Mode viewMode) 3758 { 3759 EWK_VIEW_SD_GET_OR_RETURN(ewkView, sd, EINA_FALSE); 3760 EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); 3761 3762 switch (viewMode) { 3763 3763 case EWK_VIEW_MODE_WINDOWED: 3764 3764 priv->page->setViewMode(WebCore::Page::ViewModeWindowed); … … 3783 3783 } 3784 3784 3785 Ewk_View_Mode ewk_view_mode_get(const Evas_Object* o)3785 Ewk_View_Mode ewk_view_mode_get(const Evas_Object* ewkView) 3786 3786 { 3787 3787 Ewk_View_Mode mode = EWK_VIEW_MODE_WINDOWED; 3788 3788 3789 EWK_VIEW_SD_GET( o, sd);3789 EWK_VIEW_SD_GET(ewkView, sd); 3790 3790 if (!sd) 3791 3791 return mode; … … 3822 3822 * Emits signal: "editorclientselection,changed" with no parameters. 3823 3823 */ 3824 void ewk_view_editor_client_selection_changed(Evas_Object* o)3825 { 3826 evas_object_smart_callback_call( o, "editorclient,selection,changed", 0);3824 void ewk_view_editor_client_selection_changed(Evas_Object* ewkView) 3825 { 3826 evas_object_smart_callback_call(ewkView, "editorclient,selection,changed", 0); 3827 3827 } 3828 3828 … … 3835 3835 * Emits signal: "editorclient,contents,changed" with no parameters. 3836 3836 */ 3837 void ewk_view_editor_client_contents_changed(Evas_Object* o)3838 { 3839 evas_object_smart_callback_call( o, "editorclient,contents,changed", 0);3840 } 3837 void ewk_view_editor_client_contents_changed(Evas_Object* ewkView) 3838 { 3839 evas_object_smart_callback_call(ewkView, "editorclient,contents,changed", 0); 3840 } -
trunk/Source/WebKit/efl/ewk/ewk_view_single.cpp
r96382 r97329 10 10 This library is distributed in the hope that it will be useful, 11 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MER CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU12 MERchANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 13 Library General Public License for more details. 14 14 … … 32 32 static Ewk_View_Smart_Class _parent_sc = EWK_VIEW_SMART_CLASS_INIT_NULL; 33 33 34 static void _ewk_view_single_on_del(void* data, Evas* e , Evas_Object* o, void* event_info)34 static void _ewk_view_single_on_del(void* data, Evas* eventType, Evas_Object* callback, void* eventInfo) 35 35 { 36 36 Evas_Object* clip = (Evas_Object*)data; … … 38 38 } 39 39 40 static void _ewk_view_single_smart_add(Evas_Object* o)40 static void _ewk_view_single_smart_add(Evas_Object* ewkSingle) 41 41 { 42 42 Ewk_View_Smart_Data* sd; 43 43 44 _parent_sc.sc.add( o);45 46 sd = static_cast<Ewk_View_Smart_Data*>(evas_object_smart_data_get( o));44 _parent_sc.sc.add(ewkSingle); 45 46 sd = static_cast<Ewk_View_Smart_Data*>(evas_object_smart_data_get(ewkSingle)); 47 47 if (!sd) 48 48 return; 49 49 50 50 Evas_Object* clip = evas_object_rectangle_add(sd->base.evas); 51 evas_object_clip_set(sd->backing_store, clip);52 evas_object_smart_member_add(clip, o);53 51 evas_object_show(clip); 54 52 … … 57 55 } 58 56 59 static Evas_Object* _ewk_view_single_smart_backing_store_add(Ewk_View_Smart_Data* s d)60 { 61 Evas_Object* bs = evas_object_image_add(s d->base.evas);57 static Evas_Object* _ewk_view_single_smart_backing_store_add(Ewk_View_Smart_Data* smartData) 58 { 59 Evas_Object* bs = evas_object_image_add(smartData->base.evas); 62 60 evas_object_image_alpha_set(bs, EINA_FALSE); 63 evas_object_image_smooth_scale_set(bs, s d->zoom_weak_smooth_scale);61 evas_object_image_smooth_scale_set(bs, smartData->zoom_weak_smooth_scale); 64 62 65 63 return bs; 66 64 } 67 65 68 static void _ewk_view_single_smart_resize(Evas_Object* o, Evas_Coord w, Evas_Coord h)69 { 70 Ewk_View_Smart_Data* sd = static_cast<Ewk_View_Smart_Data*>(evas_object_smart_data_get( o));71 _parent_sc.sc.resize( o, w, h);66 static void _ewk_view_single_smart_resize(Evas_Object* ewkSingle, Evas_Coord width, Evas_Coord height) 67 { 68 Ewk_View_Smart_Data* sd = static_cast<Ewk_View_Smart_Data*>(evas_object_smart_data_get(ewkSingle)); 69 _parent_sc.sc.resize(ewkSingle, width, height); 72 70 73 71 if (!sd) … … 75 73 76 74 // these should be queued and processed in calculate as well! 77 evas_object_image_size_set(sd->backing_store, w , h);75 evas_object_image_size_set(sd->backing_store, width, height); 78 76 if (sd->animated_zoom.zoom.current < 0.00001) { 79 77 Evas_Object* clip = evas_object_clip_get(sd->backing_store); 80 78 Evas_Coord x, y, cw, ch; 81 evas_object_image_fill_set(sd->backing_store, 0, 0, w , h);79 evas_object_image_fill_set(sd->backing_store, 0, 0, width, height); 82 80 evas_object_geometry_get(sd->backing_store, &x, &y, 0, 0); 83 81 evas_object_move(clip, x, y); 84 82 ewk_frame_contents_size_get(sd->main_frame, &cw, &ch); 85 if (w > cw)86 w = cw;87 if (h > ch)88 h = ch;89 evas_object_resize(clip, w , h);90 } 91 } 92 93 static inline void _ewk_view_4b_move_region_up(uint32_t* image, size_t rows, size_t x, size_t y, size_t w , size_t h, size_t rowsize)83 if (width > cw) 84 width = cw; 85 if (height > ch) 86 height = ch; 87 evas_object_resize(clip, width, height); 88 } 89 } 90 91 static inline void _ewk_view_4b_move_region_up(uint32_t* image, size_t rows, size_t x, size_t y, size_t width, size_t height, size_t rowSize) 94 92 { 95 93 uint32_t* src; 96 94 uint32_t* dst; 97 95 98 dst = image + x + y * row size;99 src = dst + rows * row size;100 h -= rows;101 102 for (; h > 0; h--, dst += rowsize, src += rowsize)103 memcpy(dst, src, w * 4);104 } 105 106 static inline void _ewk_view_4b_move_region_down(uint32_t* image, size_t rows, size_t x, size_t y, size_t w , size_t h, size_t rowsize)96 dst = image + x + y * rowSize; 97 src = dst + rows * rowSize; 98 height -= rows; 99 100 for (; height > 0; height--, dst += rowSize, src += rowSize) 101 memcpy(dst, src, width * 4); 102 } 103 104 static inline void _ewk_view_4b_move_region_down(uint32_t* image, size_t rows, size_t x, size_t y, size_t width, size_t height, size_t rowSize) 107 105 { 108 106 uint32_t* src; 109 107 uint32_t* dst; 110 108 111 h -= rows;112 src = image + x + (y + h - 1) * rowsize;113 dst = src + rows * row size;114 115 for (; h > 0; h--, dst -= rowsize, src -= rowsize)116 memcpy(dst, src, w * 4);109 height -= rows; 110 src = image + x + (y + height - 1) * rowSize; 111 dst = src + rows * rowSize; 112 113 for (; height > 0; height--, dst -= rowSize, src -= rowSize) 114 memcpy(dst, src, width * 4); 117 115 } 118 116 … … 137 135 } 138 136 139 static inline void _ewk_view_4b_move_region_left(uint32_t* image, size_t cols, size_t x, size_t y, size_t w , size_t h, size_t rowsize)137 static inline void _ewk_view_4b_move_region_left(uint32_t* image, size_t cols, size_t x, size_t y, size_t width, size_t height, size_t rowSize) 140 138 { 141 139 uint32_t* src; 142 140 uint32_t* dst; 143 141 144 dst = image + x + y * row size;142 dst = image + x + y * rowSize; 145 143 src = dst + cols; 146 w -= cols;147 148 for (; h > 0; h--, dst += rowsize, src += rowsize)149 _ewk_view_4b_move_line_left(dst, src, w );150 } 151 152 static inline void _ewk_view_4b_move_region_right(uint32_t* image, size_t col s, size_t x, size_t y, size_t w, size_t h, size_t rowsize)144 width -= cols; 145 146 for (; height > 0; height--, dst += rowSize, src += rowSize) 147 _ewk_view_4b_move_line_left(dst, src, width); 148 } 149 150 static inline void _ewk_view_4b_move_region_right(uint32_t* image, size_t columns, size_t x, size_t y, size_t width, size_t height, size_t rowSize) 153 151 { 154 152 uint32_t* src; 155 153 uint32_t* dst; 156 154 157 w -= cols;158 src = image + (x + w - 1) + y * rowsize;159 dst = src + col s;160 161 for (; h > 0; h--, dst += rowsize, src += rowsize)162 _ewk_view_4b_move_line_right(dst, src, w );155 width -= columns; 156 src = image + (x + width - 1) + y * rowSize; 157 dst = src + columns; 158 159 for (; height > 0; height--, dst += rowSize, src += rowSize) 160 _ewk_view_4b_move_line_right(dst, src, width); 163 161 } 164 162 165 163 /* catch-all function, not as optimized as the others, but does the work. */ 166 static inline void _ewk_view_4b_move_region(uint32_t* image, int d x, int dy, size_t x, size_t y, size_t w, size_t h, size_t rowsize)164 static inline void _ewk_view_4b_move_region(uint32_t* image, int deltaX, int deltaY, size_t x, size_t y, size_t width, size_t height, size_t rowSize) 167 165 { 168 166 uint32_t* src; 169 167 uint32_t* dst; 170 168 171 if (d y< 0) {172 h += dy;173 dst = image + x + y * row size;174 src = dst - d y * rowsize;175 if (d x<= 0) {176 w += dx;177 src -= d x;178 for (; h > 0; h--, dst += rowsize, src += rowsize)179 _ewk_view_4b_move_line_left(dst, src, w );169 if (deltaY < 0) { 170 height += deltaY; 171 dst = image + x + y * rowSize; 172 src = dst - deltaY * rowSize; 173 if (deltaX <= 0) { 174 width += deltaX; 175 src -= deltaX; 176 for (; height > 0; height--, dst += rowSize, src += rowSize) 177 _ewk_view_4b_move_line_left(dst, src, width); 180 178 } else { 181 w -= dx;182 src += w - 1;183 dst += w + dx-1;184 for (; h > 0; h--, dst += rowsize, src += rowsize)185 _ewk_view_4b_move_line_right(dst, src, w );179 width -= deltaX; 180 src += width - 1; 181 dst += width + deltaX -1; 182 for (; height > 0; height--, dst += rowSize, src += rowSize) 183 _ewk_view_4b_move_line_right(dst, src, width); 186 184 } 187 185 } else { 188 h -= dy;189 src = image + x + (y + h - 1) * rowsize;190 dst = src + d y * rowsize;191 if (d x<= 0) {192 w += dx;193 src -= d x;194 for (; h > 0; h--, dst -= rowsize, src -= rowsize)195 _ewk_view_4b_move_line_left(dst, src, w );186 height -= deltaY; 187 src = image + x + (y + height - 1) * rowSize; 188 dst = src + deltaY * rowSize; 189 if (deltaX <= 0) { 190 width += deltaX; 191 src -= deltaX; 192 for (; height > 0; height--, dst -= rowSize, src -= rowSize) 193 _ewk_view_4b_move_line_left(dst, src, width); 196 194 } else { 197 w -= dx;198 src += w - 1;199 dst += w + dx- 1;200 for (; h > 0; h--, dst -= rowsize, src -= rowsize)201 _ewk_view_4b_move_line_right(dst, src, w );195 width -= deltaX; 196 src += width - 1; 197 dst += width + deltaX - 1; 198 for (; height > 0; height--, dst -= rowSize, src -= rowSize) 199 _ewk_view_4b_move_line_right(dst, src, width); 202 200 } 203 201 } 204 202 } 205 203 206 static inline void _ewk_view_single_scroll_process_single(Ewk_View_Smart_Data* s d, void* pixels, Evas_Coord ow, Evas_Coord oh, const Ewk_Scroll_Request* sr)204 static inline void _ewk_view_single_scroll_process_single(Ewk_View_Smart_Data* smartData, void* pixels, Evas_Coord width, Evas_Coord height, const Ewk_Scroll_Request* scrollRequest) 207 205 { 208 206 Evas_Coord sx, sy, sw, sh; 209 207 210 208 DBG("%d,%d + %d,%d %+03d,%+03d, store: %p %dx%d", 211 s r->x, sr->y, sr->w, sr->h, sr->dx, sr->dy, pixels, ow, oh);212 213 sx = s r->x;214 sy = s r->y;215 sw = s r->w;216 sh = s r->h;217 218 if (abs(s r->dx) >= sw || abs(sr->dy) >= sh) {209 scrollRequest->x, scrollRequest->y, scrollRequest->w, scrollRequest->h, scrollRequest->dx, scrollRequest->dy, pixels, width, height); 210 211 sx = scrollRequest->x; 212 sy = scrollRequest->y; 213 sw = scrollRequest->w; 214 sh = scrollRequest->h; 215 216 if (abs(scrollRequest->dx) >= sw || abs(scrollRequest->dy) >= sh) { 219 217 /* doubt webkit would be so stupid... */ 220 218 DBG("full page scroll %+03d,%+03d. convert to repaint %d,%d + %dx%d", 221 s r->dx, sr->dy, sx, sy, sw, sh);222 ewk_view_repaint_add(s d->_priv, sx, sy, sw, sh);219 scrollRequest->dx, scrollRequest->dy, sx, sy, sw, sh); 220 ewk_view_repaint_add(smartData->_priv, sx, sy, sw, sh); 223 221 return; 224 222 } … … 233 231 } 234 232 235 if (sx + sw > ow)236 sw = ow- sx;237 if (sy + sh > oh)238 sh = oh- sy;233 if (sx + sw > width) 234 sw = width - sx; 235 if (sy + sh > height) 236 sh = height - sy; 239 237 240 238 if (sw < 0) … … 244 242 245 243 EINA_SAFETY_ON_TRUE_RETURN(!sw || !sh); 246 if (!s r->dx) {247 if (s r->dy < 0) {244 if (!scrollRequest->dx) { 245 if (scrollRequest->dy < 0) { 248 246 DBG("scroll up: %+03d,%+03d update=%d,%d+%dx%d, " 249 247 "repaint=%d,%d+%dx%d", 250 s r->dx, sr->dy, sx, sy, sw, sh + sr->dy,251 sx, sy + sh + s r->dy, sw, -sr->dy);248 scrollRequest->dx, scrollRequest->dy, sx, sy, sw, sh + scrollRequest->dy, 249 sx, sy + sh + scrollRequest->dy, sw, -scrollRequest->dy); 252 250 253 251 _ewk_view_4b_move_region_up 254 (static_cast<uint32_t*>(pixels), -s r->dy, sx, sy, sw, sh, ow);252 (static_cast<uint32_t*>(pixels), -scrollRequest->dy, sx, sy, sw, sh, width); 255 253 evas_object_image_data_update_add 256 (s d->backing_store, sx, sy, sw, sh + sr->dy);257 258 ewk_view_repaint_add(s d->_priv, sx, sy + sh + sr->dy, sw, -sr->dy);259 } else if (s r->dy > 0) {254 (smartData->backing_store, sx, sy, sw, sh + scrollRequest->dy); 255 256 ewk_view_repaint_add(smartData->_priv, sx, sy + sh + scrollRequest->dy, sw, -scrollRequest->dy); 257 } else if (scrollRequest->dy > 0) { 260 258 DBG("scroll down: %+03d,%+03d update=%d,%d+%dx%d, " 261 259 "repaint=%d,%d+%dx%d", 262 s r->dx, sr->dy, sx, sy + sr->dy, sw, sh - sr->dy,263 sx, sy, sw, s r->dy);260 scrollRequest->dx, scrollRequest->dy, sx, sy + scrollRequest->dy, sw, sh - scrollRequest->dy, 261 sx, sy, sw, scrollRequest->dy); 264 262 265 263 _ewk_view_4b_move_region_down 266 (static_cast<uint32_t*>(pixels), s r->dy, sx, sy, sw, sh, ow);264 (static_cast<uint32_t*>(pixels), scrollRequest->dy, sx, sy, sw, sh, width); 267 265 evas_object_image_data_update_add 268 (s d->backing_store, sx, sy + sr->dy, sw, sh - sr->dy);269 270 ewk_view_repaint_add(s d->_priv, sx, sy, sw, sr->dy);266 (smartData->backing_store, sx, sy + scrollRequest->dy, sw, sh - scrollRequest->dy); 267 268 ewk_view_repaint_add(smartData->_priv, sx, sy, sw, scrollRequest->dy); 271 269 } 272 } else if (!s r->dy) {273 if (s r->dx < 0) {270 } else if (!scrollRequest->dy) { 271 if (scrollRequest->dx < 0) { 274 272 DBG("scroll left: %+03d,%+03d update=%d,%d+%dx%d, " 275 273 "repaint=%d,%d+%dx%d", 276 s r->dx, sr->dy, sx, sy, sw + sr->dx, sh,277 sx + sw + s r->dx, sy, -sr->dx, sh);274 scrollRequest->dx, scrollRequest->dy, sx, sy, sw + scrollRequest->dx, sh, 275 sx + sw + scrollRequest->dx, sy, -scrollRequest->dx, sh); 278 276 279 277 _ewk_view_4b_move_region_left 280 (static_cast<uint32_t*>(pixels), -s r->dx, sx, sy, sw, sh, ow);278 (static_cast<uint32_t*>(pixels), -scrollRequest->dx, sx, sy, sw, sh, width); 281 279 evas_object_image_data_update_add 282 (s d->backing_store, sx, sy, sw + sr->dx, sh);283 284 ewk_view_repaint_add(s d->_priv, sx + sw + sr->dx, sy, -sr->dx, sh);285 } else if (s r->dx > 0) {280 (smartData->backing_store, sx, sy, sw + scrollRequest->dx, sh); 281 282 ewk_view_repaint_add(smartData->_priv, sx + sw + scrollRequest->dx, sy, -scrollRequest->dx, sh); 283 } else if (scrollRequest->dx > 0) { 286 284 DBG("scroll up: %+03d,%+03d update=%d,%d+%dx%d, " 287 285 "repaint=%d,%d+%dx%d", 288 s r->dx, sr->dy, sx + sr->dx, sy, sw - sr->dx, sh,289 sx, sy, s r->dx, sh);286 scrollRequest->dx, scrollRequest->dy, sx + scrollRequest->dx, sy, sw - scrollRequest->dx, sh, 287 sx, sy, scrollRequest->dx, sh); 290 288 291 289 _ewk_view_4b_move_region_right 292 (static_cast<uint32_t*>(pixels), s r->dx, sx, sy, sw, sh, ow);290 (static_cast<uint32_t*>(pixels), scrollRequest->dx, sx, sy, sw, sh, width); 293 291 evas_object_image_data_update_add 294 (s d->backing_store, sx + sr->dx, sy, sw - sr->dx, sh);295 296 ewk_view_repaint_add(s d->_priv, sx, sy, sr->dx, sh);292 (smartData->backing_store, sx + scrollRequest->dx, sy, sw - scrollRequest->dx, sh); 293 294 ewk_view_repaint_add(smartData->_priv, sx, sy, scrollRequest->dx, sh); 297 295 } 298 296 } else { 299 297 Evas_Coord mx, my, mw, mh, ax, ay, aw, ah, bx, by, bw, bh; 300 298 301 if (s r->dx < 0) {299 if (scrollRequest->dx < 0) { 302 300 mx = sx; 303 mw = sw + s r->dx;301 mw = sw + scrollRequest->dx; 304 302 ax = mx + mw; 305 aw = -s r->dx;303 aw = -scrollRequest->dx; 306 304 } else { 307 305 ax = sx; 308 aw = s r->dx;306 aw = scrollRequest->dx; 309 307 mx = ax + aw; 310 mw = sw - s r->dx;308 mw = sw - scrollRequest->dx; 311 309 } 312 310 313 if (s r->dy < 0) {311 if (scrollRequest->dy < 0) { 314 312 my = sy; 315 mh = sh + s r->dy;313 mh = sh + scrollRequest->dy; 316 314 by = my + mh; 317 bh = -s r->dy;315 bh = -scrollRequest->dy; 318 316 } else { 319 317 by = sy; 320 bh = s r->dy;318 bh = scrollRequest->dy; 321 319 my = by + bh; 322 mh = sh - s r->dy;320 mh = sh - scrollRequest->dy; 323 321 } 324 322 … … 330 328 DBG("scroll diagonal: %+03d,%+03d update=%d,%d+%dx%d, " 331 329 "repaints: h=%d,%d+%dx%d v=%d,%d+%dx%d", 332 s r->dx, sr->dy, mx, my, mw, mh, ax, ay, aw, ah, bx, by, bw, bh);330 scrollRequest->dx, scrollRequest->dy, mx, my, mw, mh, ax, ay, aw, ah, bx, by, bw, bh); 333 331 334 332 _ewk_view_4b_move_region 335 (static_cast<uint32_t*>(pixels), s r->dx, sr->dy, sx, sy, sw, sh, ow);336 337 evas_object_image_data_update_add(s d->backing_store, mx, my, mw, mh);338 ewk_view_repaint_add(s d->_priv, ax, ay, aw, ah);339 ewk_view_repaint_add(s d->_priv, bx, by, bw, bh);340 } 341 } 342 343 static Eina_Bool _ewk_view_single_smart_scrolls_process(Ewk_View_Smart_Data* s d)333 (static_cast<uint32_t*>(pixels), scrollRequest->dx, scrollRequest->dy, sx, sy, sw, sh, width); 334 335 evas_object_image_data_update_add(smartData->backing_store, mx, my, mw, mh); 336 ewk_view_repaint_add(smartData->_priv, ax, ay, aw, ah); 337 ewk_view_repaint_add(smartData->_priv, bx, by, bw, bh); 338 } 339 } 340 341 static Eina_Bool _ewk_view_single_smart_scrolls_process(Ewk_View_Smart_Data* smartData) 344 342 { 345 343 const Ewk_Scroll_Request* sr; … … 347 345 Evas_Coord ow, oh; 348 346 size_t count; 349 void* pixels = evas_object_image_data_get(s d->backing_store, 1);350 evas_object_image_size_get(s d->backing_store, &ow, &oh);351 352 sr = ewk_view_scroll_requests_get(s d->_priv, &count);347 void* pixels = evas_object_image_data_get(smartData->backing_store, 1); 348 evas_object_image_size_get(smartData->backing_store, &ow, &oh); 349 350 sr = ewk_view_scroll_requests_get(smartData->_priv, &count); 353 351 sr_end = sr + count; 354 352 for (; sr < sr_end; sr++) 355 _ewk_view_single_scroll_process_single(s d, pixels, ow, oh, sr);356 357 evas_object_image_data_set(s d->backing_store, pixels);353 _ewk_view_single_scroll_process_single(smartData, pixels, ow, oh, sr); 354 355 evas_object_image_data_set(smartData->backing_store, pixels); 358 356 359 357 return EINA_TRUE; 360 358 } 361 359 362 static Eina_Bool _ewk_view_single_smart_repaints_process(Ewk_View_Smart_Data* s d)360 static Eina_Bool _ewk_view_single_smart_repaints_process(Ewk_View_Smart_Data* smartData) 363 361 { 364 362 Ewk_View_Paint_Context* ctxt; … … 377 375 Eina_Bool ret = EINA_TRUE; 378 376 379 if (s d->animated_zoom.zoom.current < 0.00001) {380 Evas_Object* clip = evas_object_clip_get(s d->backing_store);377 if (smartData->animated_zoom.zoom.current < 0.00001) { 378 Evas_Object* clip = evas_object_clip_get(smartData->backing_store); 381 379 Evas_Coord w, h, cw, ch; 382 380 // reset effects of zoom_weak_set() 383 381 evas_object_image_fill_set 384 (s d->backing_store, 0, 0, sd->view.w, sd->view.h);385 evas_object_move(clip, s d->view.x, sd->view.y);386 387 w = s d->view.w;388 h = s d->view.h;389 390 ewk_frame_contents_size_get(s d->main_frame, &cw, &ch);382 (smartData->backing_store, 0, 0, smartData->view.w, smartData->view.h); 383 evas_object_move(clip, smartData->view.x, smartData->view.y); 384 385 w = smartData->view.w; 386 h = smartData->view.h; 387 388 ewk_frame_contents_size_get(smartData->main_frame, &cw, &ch); 391 389 if (w > cw) 392 390 w = cw; … … 396 394 } 397 395 398 pixels = evas_object_image_data_get(s d->backing_store, 1);399 evas_object_image_size_get(s d->backing_store, &ow, &oh);396 pixels = evas_object_image_data_get(smartData->backing_store, 1); 397 evas_object_image_size_get(smartData->backing_store, &ow, &oh); 400 398 format = CAIRO_FORMAT_ARGB32; 401 399 … … 418 416 } 419 417 420 ctxt = ewk_view_paint_context_new(s d->_priv, cairo);418 ctxt = ewk_view_paint_context_new(smartData->_priv, cairo); 421 419 if (!ctxt) { 422 420 ERR("could not create paint context"); … … 432 430 } 433 431 434 pr = ewk_view_repaints_get(s d->_priv, &count);432 pr = ewk_view_repaints_get(smartData->_priv, &count); 435 433 pr_end = pr + count; 436 434 for (; pr < pr_end; pr++) … … 444 442 } 445 443 446 ewk_view_layout_if_needed_recursive(s d->_priv);444 ewk_view_layout_if_needed_recursive(smartData->_priv); 447 445 448 446 int sx, sy; 449 ewk_frame_scroll_pos_get(s d->main_frame, &sx, &sy);447 ewk_frame_scroll_pos_get(smartData->main_frame, &sx, &sy); 450 448 451 449 EINA_ITERATOR_FOREACH(itr, r) { … … 465 463 ewk_view_paint_context_restore(ctxt); 466 464 evas_object_image_data_update_add 467 (s d->backing_store, r->x, r->y, r->w, r->h);465 (smartData->backing_store, r->x, r->y, r->w, r->h); 468 466 } 469 467 eina_iterator_free(itr); … … 478 476 cairo_surface_destroy(surface); 479 477 error_cairo_surface: 480 evas_object_image_data_set(s d->backing_store, pixels); /* dec refcount */478 evas_object_image_data_set(smartData->backing_store, pixels); /* dec refcount */ 481 479 482 480 return ret; 483 481 } 484 482 485 static Eina_Bool _ewk_view_single_smart_zoom_weak_set(Ewk_View_Smart_Data* s d, float zoom, Evas_Coord cx, Evas_Coord cy)483 static Eina_Bool _ewk_view_single_smart_zoom_weak_set(Ewk_View_Smart_Data* smartData, float zoom, Evas_Coord centerX, Evas_Coord centerY) 486 484 { 487 485 // TODO: review 488 float scale = zoom / s d->animated_zoom.zoom.start;489 Evas_Coord w = s d->view.w * scale;490 Evas_Coord h = s d->view.h * scale;486 float scale = zoom / smartData->animated_zoom.zoom.start; 487 Evas_Coord w = smartData->view.w * scale; 488 Evas_Coord h = smartData->view.h * scale; 491 489 Evas_Coord dx, dy, cw, ch; 492 Evas_Object* clip = evas_object_clip_get(s d->backing_store);493 494 ewk_frame_contents_size_get(s d->main_frame, &cw, &ch);495 if (s d->view.w > 0 && sd->view.h > 0) {496 dx = (w * (s d->view.w - cx)) / sd->view.w;497 dy = (h * (s d->view.h - cy)) / sd->view.h;490 Evas_Object* clip = evas_object_clip_get(smartData->backing_store); 491 492 ewk_frame_contents_size_get(smartData->main_frame, &cw, &ch); 493 if (smartData->view.w > 0 && smartData->view.h > 0) { 494 dx = (w * (smartData->view.w - centerX)) / smartData->view.w; 495 dy = (h * (smartData->view.h - centerY)) / smartData->view.h; 498 496 } else { 499 497 dx = 0; … … 501 499 } 502 500 503 evas_object_image_fill_set(s d->backing_store, cx + dx, cy+ dy, w, h);504 505 if (s d->view.w > 0 && sd->view.h > 0) {506 dx = ((s d->view.w - w) * cx) / sd->view.w;507 dy = ((s d->view.h - h) * cy) / sd->view.h;501 evas_object_image_fill_set(smartData->backing_store, centerX + dx, centerY + dy, w, h); 502 503 if (smartData->view.w > 0 && smartData->view.h > 0) { 504 dx = ((smartData->view.w - w) * centerX) / smartData->view.w; 505 dy = ((smartData->view.h - h) * centerY) / smartData->view.h; 508 506 } else { 509 507 dx = 0; 510 508 dy = 0; 511 509 } 512 evas_object_move(clip, s d->view.x + dx, sd->view.y + dy);513 514 if (cw < s d->view.w)510 evas_object_move(clip, smartData->view.x + dx, smartData->view.y + dy); 511 512 if (cw < smartData->view.w) 515 513 w = cw * scale; 516 if (ch < s d->view.h)514 if (ch < smartData->view.h) 517 515 h = ch * scale; 518 516 evas_object_resize(clip, w, h); … … 520 518 } 521 519 522 static void _ewk_view_single_smart_zoom_weak_smooth_scale_set(Ewk_View_Smart_Data* s d, Eina_Bool smooth_scale)523 { 524 evas_object_image_smooth_scale_set(s d->backing_store, smooth_scale);525 } 526 527 static void _ewk_view_single_smart_bg_color_set(Ewk_View_Smart_Data* s d, unsigned char r, unsigned char g, unsigned char b, unsigned chara)528 { 529 evas_object_image_alpha_set(s d->backing_store,a < 255);520 static void _ewk_view_single_smart_zoom_weak_smooth_scale_set(Ewk_View_Smart_Data* smartData, Eina_Bool smooth_scale) 521 { 522 evas_object_image_smooth_scale_set(smartData->backing_store, smooth_scale); 523 } 524 525 static void _ewk_view_single_smart_bg_color_set(Ewk_View_Smart_Data* smartData, unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha) 526 { 527 evas_object_image_alpha_set(smartData->backing_store, alpha < 255); 530 528 } 531 529 … … 564 562 } 565 563 566 Evas_Object* ewk_view_single_add(Evas* e)567 { 568 return evas_object_smart_add( e, _ewk_view_single_smart_class_new());569 } 564 Evas_Object* ewk_view_single_add(Evas* canvas) 565 { 566 return evas_object_smart_add(canvas, _ewk_view_single_smart_class_new()); 567 } -
trunk/Source/WebKit/efl/ewk/ewk_view_tiled.cpp
r96382 r97329 31 31 static Ewk_View_Smart_Class _parent_sc = EWK_VIEW_SMART_CLASS_INIT_NULL; 32 32 33 static Eina_Bool _ewk_view_tiled_render_cb(void* data, Ewk_Tile* t , const Eina_Rectangle* area)33 static Eina_Bool _ewk_view_tiled_render_cb(void* data, Ewk_Tile* tile, const Eina_Rectangle* area) 34 34 { 35 35 Ewk_View_Private_Data* priv = static_cast<Ewk_View_Private_Data*>(data); 36 Eina_Rectangle r = {area->x + t->x, area->y + t->y, area->w, area->h};37 38 return ewk_view_paint_contents(priv, t ->cairo, &r);39 } 40 41 static void* _ewk_view_tiled_updates_process_pre(void* data, Evas_Object* o)36 Eina_Rectangle rect = {area->x + tile->x, area->y + tile->y, area->w, area->h}; 37 38 return ewk_view_paint_contents(priv, tile->cairo, &rect); 39 } 40 41 static void* _ewk_view_tiled_updates_process_pre(void* data, Evas_Object* ewkTile) 42 42 { 43 43 Ewk_View_Private_Data* priv = static_cast<Ewk_View_Private_Data*>(data); … … 46 46 } 47 47 48 static Evas_Object* _ewk_view_tiled_smart_backing_store_add(Ewk_View_Smart_Data* s d)49 { 50 Evas_Object* bs = ewk_tiled_backing_store_add(s d->base.evas);48 static Evas_Object* _ewk_view_tiled_smart_backing_store_add(Ewk_View_Smart_Data* smartData) 49 { 50 Evas_Object* bs = ewk_tiled_backing_store_add(smartData->base.evas); 51 51 ewk_tiled_backing_store_render_cb_set 52 (bs, _ewk_view_tiled_render_cb, s d->_priv);52 (bs, _ewk_view_tiled_render_cb, smartData->_priv); 53 53 ewk_tiled_backing_store_updates_process_pre_set 54 (bs, _ewk_view_tiled_updates_process_pre, s d->_priv);54 (bs, _ewk_view_tiled_updates_process_pre, smartData->_priv); 55 55 return bs; 56 56 } 57 57 58 58 static void 59 _ewk_view_tiled_contents_size_changed_cb(void* data, Evas_Object* o, void* event_info)60 { 61 Evas_Coord* size = static_cast<Evas_Coord*>(event _info);62 Ewk_View_Smart_Data* s d= static_cast<Ewk_View_Smart_Data*>(data);59 _ewk_view_tiled_contents_size_changed_cb(void* data, Evas_Object* ewkTile, void* eventInfo) 60 { 61 Evas_Coord* size = static_cast<Evas_Coord*>(eventInfo); 62 Ewk_View_Smart_Data* smartData = static_cast<Ewk_View_Smart_Data*>(data); 63 63 64 64 ewk_tiled_backing_store_contents_resize 65 (s d->backing_store, size[0], size[1]);66 } 67 68 static void _ewk_view_tiled_smart_add(Evas_Object* o)65 (smartData->backing_store, size[0], size[1]); 66 } 67 68 static void _ewk_view_tiled_smart_add(Evas_Object* ewkTile) 69 69 { 70 70 Ewk_View_Smart_Data* sd; 71 71 72 _parent_sc.sc.add( o);73 74 sd = static_cast<Ewk_View_Smart_Data*>(evas_object_smart_data_get( o));72 _parent_sc.sc.add(ewkTile); 73 74 sd = static_cast<Ewk_View_Smart_Data*>(evas_object_smart_data_get(ewkTile)); 75 75 if (!sd) 76 76 return; … … 82 82 } 83 83 84 static Eina_Bool _ewk_view_tiled_smart_scrolls_process(Ewk_View_Smart_Data* s d)84 static Eina_Bool _ewk_view_tiled_smart_scrolls_process(Ewk_View_Smart_Data* smartData) 85 85 { 86 86 const Ewk_Scroll_Request* sr; … … 89 89 Evas_Coord vw, vh; 90 90 91 ewk_frame_contents_size_get(s d->main_frame, &vw, &vh);92 93 sr = ewk_view_scroll_requests_get(s d->_priv, &count);91 ewk_frame_contents_size_get(smartData->main_frame, &vw, &vh); 92 93 sr = ewk_view_scroll_requests_get(smartData->_priv, &count); 94 94 sr_end = sr + count; 95 95 for (; sr < sr_end; sr++) { 96 96 if (sr->main_scroll) 97 97 ewk_tiled_backing_store_scroll_full_offset_add 98 (s d->backing_store, sr->dx, sr->dy);98 (smartData->backing_store, sr->dx, sr->dy); 99 99 else { 100 100 Evas_Coord sx, sy, sw, sh; … … 109 109 DBG("full page scroll %+03d,%+03d. convert to repaint %d,%d + %dx%d", 110 110 sr->dx, sr->dy, sx, sy, sw, sh); 111 ewk_view_repaint_add(s d->_priv, sx, sy, sw, sh);111 ewk_view_repaint_add(smartData->_priv, sx, sy, sw, sh); 112 112 continue; 113 113 } … … 130 130 sw += abs(sr->dx); 131 131 sh += abs(sr->dy); 132 ewk_view_repaint_add(s d->_priv, sx, sy, sw, sh);132 ewk_view_repaint_add(smartData->_priv, sx, sy, sw, sh); 133 133 INF("using repaint for inner frame scolling!"); 134 134 } … … 138 138 } 139 139 140 static Eina_Bool _ewk_view_tiled_smart_repaints_process(Ewk_View_Smart_Data* s d)140 static Eina_Bool _ewk_view_tiled_smart_repaints_process(Ewk_View_Smart_Data* smartData) 141 141 { 142 142 const Eina_Rectangle* pr, * pr_end; … … 144 144 int sx, sy; 145 145 146 ewk_frame_scroll_pos_get(s d->main_frame, &sx, &sy);147 148 pr = ewk_view_repaints_get(s d->_priv, &count);146 ewk_frame_scroll_pos_get(smartData->main_frame, &sx, &sy); 147 148 pr = ewk_view_repaints_get(smartData->_priv, &count); 149 149 pr_end = pr + count; 150 150 for (; pr < pr_end; pr++) { … … 154 154 r.w = pr->w; 155 155 r.h = pr->h; 156 ewk_tiled_backing_store_update(s d->backing_store, &r);156 ewk_tiled_backing_store_update(smartData->backing_store, &r); 157 157 } 158 ewk_tiled_backing_store_updates_process(s d->backing_store);159 160 return EINA_TRUE; 161 } 162 163 static Eina_Bool _ewk_view_tiled_smart_contents_resize(Ewk_View_Smart_Data* s d, int w, int h)164 { 165 ewk_tiled_backing_store_contents_resize(s d->backing_store, w, h);166 return EINA_TRUE; 167 } 168 169 static Eina_Bool _ewk_view_tiled_smart_zoom_set(Ewk_View_Smart_Data* s d, float zoom, Evas_Coord cx, Evas_Coord cy)158 ewk_tiled_backing_store_updates_process(smartData->backing_store); 159 160 return EINA_TRUE; 161 } 162 163 static Eina_Bool _ewk_view_tiled_smart_contents_resize(Ewk_View_Smart_Data* smartData, int width, int height) 164 { 165 ewk_tiled_backing_store_contents_resize(smartData->backing_store, width, height); 166 return EINA_TRUE; 167 } 168 169 static Eina_Bool _ewk_view_tiled_smart_zoom_set(Ewk_View_Smart_Data* smartData, float zoom, Evas_Coord centerX, Evas_Coord centerY) 170 170 { 171 171 Evas_Coord x, y, w, h; 172 172 Eina_Bool r; 173 r = ewk_tiled_backing_store_zoom_set(s d->backing_store,174 &zoom, c x, cy, &x, &y);173 r = ewk_tiled_backing_store_zoom_set(smartData->backing_store, 174 &zoom, centerX, centerY, &x, &y); 175 175 if (!r) 176 176 return r; 177 ewk_tiled_backing_store_disabled_update_set(s d->backing_store, EINA_TRUE);178 r = _parent_sc.zoom_set(s d, zoom, cx, cy);179 ewk_frame_scroll_set(s d->main_frame, -x, -y);180 ewk_frame_scroll_size_get(s d->main_frame, &w, &h);181 ewk_tiled_backing_store_fix_offsets(s d->backing_store, w, h);182 ewk_view_scrolls_process(s d);183 evas_object_smart_calculate(s d->backing_store);184 evas_object_smart_calculate(s d->self);185 ewk_tiled_backing_store_disabled_update_set(s d->backing_store, EINA_FALSE);177 ewk_tiled_backing_store_disabled_update_set(smartData->backing_store, EINA_TRUE); 178 r = _parent_sc.zoom_set(smartData, zoom, centerX, centerY); 179 ewk_frame_scroll_set(smartData->main_frame, -x, -y); 180 ewk_frame_scroll_size_get(smartData->main_frame, &w, &h); 181 ewk_tiled_backing_store_fix_offsets(smartData->backing_store, w, h); 182 ewk_view_scrolls_process(smartData); 183 evas_object_smart_calculate(smartData->backing_store); 184 evas_object_smart_calculate(smartData->self); 185 ewk_tiled_backing_store_disabled_update_set(smartData->backing_store, EINA_FALSE); 186 186 return r; 187 187 } 188 188 189 static Eina_Bool _ewk_view_tiled_smart_zoom_weak_set(Ewk_View_Smart_Data* s d, float zoom, Evas_Coord cx, Evas_Coord cy)190 { 191 return ewk_tiled_backing_store_zoom_weak_set(s d->backing_store, zoom, cx, cy);192 } 193 194 static void _ewk_view_tiled_smart_zoom_weak_smooth_scale_set(Ewk_View_Smart_Data* s d, Eina_Bool smooth_scale)195 { 196 ewk_tiled_backing_store_zoom_weak_smooth_scale_set(s d->backing_store, smooth_scale);197 } 198 199 static void _ewk_view_tiled_smart_flush(Ewk_View_Smart_Data* s d)200 { 201 ewk_tiled_backing_store_flush(s d->backing_store);202 _parent_sc.flush(s d);203 } 204 205 static Eina_Bool _ewk_view_tiled_smart_pre_render_region(Ewk_View_Smart_Data* s d, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, float zoom)189 static Eina_Bool _ewk_view_tiled_smart_zoom_weak_set(Ewk_View_Smart_Data* smartData, float zoom, Evas_Coord centerX, Evas_Coord centerY) 190 { 191 return ewk_tiled_backing_store_zoom_weak_set(smartData->backing_store, zoom, centerX, centerY); 192 } 193 194 static void _ewk_view_tiled_smart_zoom_weak_smooth_scale_set(Ewk_View_Smart_Data* smartData, Eina_Bool smoothScale) 195 { 196 ewk_tiled_backing_store_zoom_weak_smooth_scale_set(smartData->backing_store, smoothScale); 197 } 198 199 static void _ewk_view_tiled_smart_flush(Ewk_View_Smart_Data* smartData) 200 { 201 ewk_tiled_backing_store_flush(smartData->backing_store); 202 _parent_sc.flush(smartData); 203 } 204 205 static Eina_Bool _ewk_view_tiled_smart_pre_render_region(Ewk_View_Smart_Data* smartData, Evas_Coord x, Evas_Coord y, Evas_Coord width, Evas_Coord height, float zoom) 206 206 { 207 207 return ewk_tiled_backing_store_pre_render_region 208 (s d->backing_store, x, y, w, h, zoom);209 } 210 211 static Eina_Bool _ewk_view_tiled_smart_pre_render_relative_radius(Ewk_View_Smart_Data* s d, unsigned int n, float zoom)208 (smartData->backing_store, x, y, width, height, zoom); 209 } 210 211 static Eina_Bool _ewk_view_tiled_smart_pre_render_relative_radius(Ewk_View_Smart_Data* smartData, unsigned int n, float zoom) 212 212 { 213 213 return ewk_tiled_backing_store_pre_render_relative_radius 214 (s d->backing_store, n, zoom);215 } 216 217 static void _ewk_view_tiled_smart_pre_render_cancel(Ewk_View_Smart_Data* s d)218 { 219 ewk_tiled_backing_store_pre_render_cancel(s d->backing_store);220 } 221 222 static Eina_Bool _ewk_view_tiled_smart_disable_render(Ewk_View_Smart_Data* s d)223 { 224 return ewk_tiled_backing_store_disable_render(s d->backing_store);225 } 226 227 static Eina_Bool _ewk_view_tiled_smart_enable_render(Ewk_View_Smart_Data* s d)228 { 229 return ewk_tiled_backing_store_enable_render(s d->backing_store);214 (smartData->backing_store, n, zoom); 215 } 216 217 static void _ewk_view_tiled_smart_pre_render_cancel(Ewk_View_Smart_Data* smartData) 218 { 219 ewk_tiled_backing_store_pre_render_cancel(smartData->backing_store); 220 } 221 222 static Eina_Bool _ewk_view_tiled_smart_disable_render(Ewk_View_Smart_Data* smartData) 223 { 224 return ewk_tiled_backing_store_disable_render(smartData->backing_store); 225 } 226 227 static Eina_Bool _ewk_view_tiled_smart_enable_render(Ewk_View_Smart_Data* smartData) 228 { 229 return ewk_tiled_backing_store_enable_render(smartData->backing_store); 230 230 } 231 231 … … 269 269 } 270 270 271 Evas_Object* ewk_view_tiled_add(Evas* e)272 { 273 return evas_object_smart_add( e, _ewk_view_tiled_smart_class_new());274 } 275 276 Ewk_Tile_Unused_Cache* ewk_view_tiled_unused_cache_get(const Evas_Object* o)277 { 278 Ewk_View_Smart_Data* sd = ewk_view_smart_data_get( o);271 Evas_Object* ewk_view_tiled_add(Evas* canvas) 272 { 273 return evas_object_smart_add(canvas, _ewk_view_tiled_smart_class_new()); 274 } 275 276 Ewk_Tile_Unused_Cache* ewk_view_tiled_unused_cache_get(const Evas_Object* ewkTile) 277 { 278 Ewk_View_Smart_Data* sd = ewk_view_smart_data_get(ewkTile); 279 279 EINA_SAFETY_ON_NULL_RETURN_VAL(sd, 0); 280 280 return ewk_tiled_backing_store_tile_unused_cache_get(sd->backing_store); 281 281 } 282 282 283 void ewk_view_tiled_unused_cache_set(Evas_Object* o, Ewk_Tile_Unused_Cache* cache)284 { 285 Ewk_View_Smart_Data* sd = ewk_view_smart_data_get( o);283 void ewk_view_tiled_unused_cache_set(Evas_Object* ewkTile, Ewk_Tile_Unused_Cache* cache) 284 { 285 Ewk_View_Smart_Data* sd = ewk_view_smart_data_get(ewkTile); 286 286 EINA_SAFETY_ON_NULL_RETURN(sd); 287 287 ewk_tiled_backing_store_tile_unused_cache_set(sd->backing_store, cache); -
trunk/Source/WebKit/efl/ewk/ewk_window_features.cpp
r95901 r97329 36 36 }; 37 37 38 void ewk_window_features_unref(Ewk_Window_Features* window _features)38 void ewk_window_features_unref(Ewk_Window_Features* windowFeatures) 39 39 { 40 EINA_SAFETY_ON_NULL_RETURN(window _features);41 EINA_SAFETY_ON_FALSE_RETURN(window _features->__ref > 0);40 EINA_SAFETY_ON_NULL_RETURN(windowFeatures); 41 EINA_SAFETY_ON_FALSE_RETURN(windowFeatures->__ref > 0); 42 42 43 if (--window _features->__ref)43 if (--windowFeatures->__ref) 44 44 return; 45 45 46 delete window _features->core;47 window _features->core = 0;48 free(window _features);46 delete windowFeatures->core; 47 windowFeatures->core = 0; 48 free(windowFeatures); 49 49 } 50 50 51 void ewk_window_features_ref(Ewk_Window_Features* window _features)51 void ewk_window_features_ref(Ewk_Window_Features* windowFeatures) 52 52 { 53 EINA_SAFETY_ON_NULL_RETURN(window _features);54 window _features->__ref++;53 EINA_SAFETY_ON_NULL_RETURN(windowFeatures); 54 windowFeatures->__ref++; 55 55 } 56 56 57 void ewk_window_features_bool_property_get(const 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)57 void ewk_window_features_bool_property_get(const Ewk_Window_Features* windowFeatures, Eina_Bool* toolbarVisible, Eina_Bool* statusbarVisible, Eina_Bool* scrollbarsVisible, Eina_Bool* menubarVisible, Eina_Bool* locationbarVisible, Eina_Bool* fullScreen) 58 58 { 59 EINA_SAFETY_ON_NULL_RETURN(window _features);60 EINA_SAFETY_ON_NULL_RETURN(window _features->core);59 EINA_SAFETY_ON_NULL_RETURN(windowFeatures); 60 EINA_SAFETY_ON_NULL_RETURN(windowFeatures->core); 61 61 62 if (toolbar _visible)63 *toolbar _visible = window_features->core->toolBarVisible;62 if (toolbarVisible) 63 *toolbarVisible = windowFeatures->core->toolBarVisible; 64 64 65 if (statusbar _visible)66 *statusbar _visible = window_features->core->statusBarVisible;65 if (statusbarVisible) 66 *statusbarVisible = windowFeatures->core->statusBarVisible; 67 67 68 if (scrollbars _visible)69 *scrollbars _visible = window_features->core->scrollbarsVisible;68 if (scrollbarsVisible) 69 *scrollbarsVisible = windowFeatures->core->scrollbarsVisible; 70 70 71 if (menubar _visible)72 *menubar _visible = window_features->core->menuBarVisible;71 if (menubarVisible) 72 *menubarVisible = windowFeatures->core->menuBarVisible; 73 73 74 if (locationbar _visible)75 *locationbar _visible = window_features->core->locationBarVisible;74 if (locationbarVisible) 75 *locationbarVisible = windowFeatures->core->locationBarVisible; 76 76 77 if (full screen)78 *full screen = window_features->core->fullscreen;77 if (fullScreen) 78 *fullScreen = windowFeatures->core->fullscreen; 79 79 } 80 80 81 void ewk_window_features_int_property_get(const Ewk_Window_Features* window _features, int* x, int* y, int* w, int* h)81 void ewk_window_features_int_property_get(const Ewk_Window_Features* windowFeatures, int* x, int* y, int* width, int* height) 82 82 { 83 EINA_SAFETY_ON_NULL_RETURN(window _features);84 EINA_SAFETY_ON_NULL_RETURN(window _features->core);83 EINA_SAFETY_ON_NULL_RETURN(windowFeatures); 84 EINA_SAFETY_ON_NULL_RETURN(windowFeatures->core); 85 85 86 86 if (x) 87 *x = window _features->core->xSet ? static_cast<int>(window_features->core->x) : -1;87 *x = windowFeatures->core->xSet ? static_cast<int>(windowFeatures->core->x) : -1; 88 88 89 89 if (y) 90 *y = window _features->core->ySet ? static_cast<int>(window_features->core->y) : -1;90 *y = windowFeatures->core->ySet ? static_cast<int>(windowFeatures->core->y) : -1; 91 91 92 if (w )93 *w = window_features->core->widthSet ? static_cast<int>(window_features->core->width) : -1;92 if (width) 93 *width = windowFeatures->core->widthSet ? static_cast<int>(windowFeatures->core->width) : -1; 94 94 95 if (h )96 *h = window_features->core->heightSet ? static_cast<int>(window_features->core->height) : -1;95 if (height) 96 *height = windowFeatures->core->heightSet ? static_cast<int>(windowFeatures->core->height) : -1; 97 97 } 98 98
Note: See TracChangeset
for help on using the changeset viewer.