[elm_webview]API change mime_callback_set -> scheme_callback_set
authorRyuan Choi <ryuan.choi@samsung.com>
Fri, 10 Sep 2010 05:50:23 +0000 (14:50 +0900)
committerRyuan Choi <ryuan.choi@samsung.com>
Fri, 10 Sep 2010 05:50:23 +0000 (14:50 +0900)
src/lib/Elementary.h.in
src/lib/elm_webview.c
src/lib/els_webview.c
src/lib/els_webview.h

index 1ce09f9..f1b2b75 100644 (file)
@@ -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 */
index 1b759e1..620a809 100644 (file)
@@ -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);
 }
 
 /**
index 1bcff18..f2d29ec 100644 (file)
@@ -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 = ':';
      }
 
index 6a4306e..7536238 100644 (file)
@@ -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);