From: Ryuan Choi Date: Fri, 10 Sep 2010 05:50:23 +0000 (+0900) Subject: [elm_webview]API change mime_callback_set -> scheme_callback_set X-Git-Tag: origin~243 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba673db3d3cb05521c284b883f7097f9305c173e;p=framework%2Fuifw%2Felementary.git [elm_webview]API change mime_callback_set -> scheme_callback_set --- diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index 1ce09f9..f1b2b75 100644 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -2652,7 +2652,7 @@ extern "C" { EAPI Evas_Object *elm_webview_minimap_get(Evas_Object *obj); EAPI void elm_webview_uri_set(Evas_Object *obj, const char *uri); EAPI void elm_webview_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce); - EAPI void elm_webview_mime_callback_set(Evas_Object *obj, const char *mime, Elm_WebView_Mime_Cb func); + EAPI void elm_webview_scheme_callback_set(Evas_Object *obj, const char *scheme, Elm_WebView_Mime_Cb func); EAPI void elm_webview_default_layout_width_set(Evas_Object *obj, int width); /* NoContents */ diff --git a/src/lib/elm_webview.c b/src/lib/elm_webview.c index 1b759e1..620a809 100644 --- a/src/lib/elm_webview.c +++ b/src/lib/elm_webview.c @@ -209,23 +209,23 @@ elm_webview_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce) } /** - * Add callback to treat mime type + * Add callback to treat scheme * - * When user click link, the WebView may have different action by mime type. - * This is a way to choose proper action each mime type. + * When user click link, the WebView may have different action by scheme. + * This is a way to choose proper action each scheme. * * @param obj The WebView object - * @param mime mime type string - * @param mime_callback callback when user choose link which involved @mime + * @param scheme The scheme which user want to receive + * @param scheme_callback callback when user choose link which involved @scheme * * @ingroup WebView */ EAPI void -elm_webview_mime_callback_set(Evas_Object *obj, const char *mime, Elm_WebView_Mime_Cb func) +elm_webview_scheme_callback_set(Evas_Object *obj, const char *scheme, Elm_WebView_Mime_Cb func) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - _elm_smart_webview_mime_callback_set(wd->webkit, mime, func); + _elm_smart_webview_scheme_callback_set(wd->webkit, scheme, func); } /** diff --git a/src/lib/els_webview.c b/src/lib/els_webview.c index 1bcff18..f2d29ec 100644 --- a/src/lib/els_webview.c +++ b/src/lib/els_webview.c @@ -139,7 +139,7 @@ struct _Smart_Data { #endif Ecore_Job *move_calc_job; Ecore_Job *resize_calc_job; - Eina_Hash* mime_func_hash; + Eina_Hash* scheme_func_hash; int locked_dx; int locked_dy; unsigned char bounce_horiz : 1; @@ -617,16 +617,16 @@ _elm_smart_webview_bounce_allow_set(Evas_Object* obj, Eina_Bool horiz, Eina_Bool } void -_elm_smart_webview_mime_callback_set(Evas_Object* obj, const char *mime, Elm_WebView_Mime_Cb func) +_elm_smart_webview_scheme_callback_set(Evas_Object* obj, const char *scheme, Elm_WebView_Mime_Cb func) { API_ENTRY return; - if (!sd->mime_func_hash) - sd->mime_func_hash = eina_hash_pointer_new(NULL); + if (!sd->scheme_func_hash) + sd->scheme_func_hash = eina_hash_pointer_new(NULL); if (!func) - eina_hash_del(sd->mime_func_hash, mime, func); + eina_hash_del(sd->scheme_func_hash, scheme, func); else - eina_hash_add(sd->mime_func_hash, mime, func); + eina_hash_add(sd->scheme_func_hash, scheme, func); } void @@ -926,11 +926,11 @@ _smart_navigation_policy_decision(Ewk_View_Smart_Data *esd, Ewk_Frame_Resource_R Elm_WebView_Mime_Cb func = NULL; Smart_Data *sd = (Smart_Data*)esd; - if (sd->mime_func_hash) + if (sd->scheme_func_hash) { protocol_hack = strstr(request->url, ":"); *protocol_hack = '\0'; - func = (Elm_WebView_Mime_Cb) eina_hash_find(sd->mime_func_hash, request->url); + func = (Elm_WebView_Mime_Cb) eina_hash_find(sd->scheme_func_hash, request->url); *protocol_hack = ':'; } diff --git a/src/lib/els_webview.h b/src/lib/els_webview.h index 6a4306e..7536238 100644 --- a/src/lib/els_webview.h +++ b/src/lib/els_webview.h @@ -5,7 +5,7 @@ Evas_Object* _elm_smart_webview_add(Evas *evas, Eina_Bool tiled); void _elm_smart_webview_events_feed_set(Evas_Object* obj, Eina_Bool feed); Eina_Bool _elm_smart_webview_events_feed_get(Evas_Object* obj); void _elm_smart_webview_bounce_allow_set(Evas_Object* obj, Eina_Bool horiz, Eina_Bool vert); -void _elm_smart_webview_mime_callback_set(Evas_Object* obj, const char *mime, Elm_WebView_Mime_Cb func); +void _elm_smart_webview_scheme_callback_set(Evas_Object* obj, const char *scheme, Elm_WebView_Mime_Cb func); void _elm_smart_webview_default_layout_width_set(Evas_Object *obj, int width); #ifdef BOUNCING_SUPPORT void _elm_smart_webview_container_set(Evas_Object *obj, Evas_Object *container);