LT_INIT([win32-dll disable-static pic-only])
EFL_INIT
+### Checks for programs
+
+# compilers
+AC_PROG_CC
+AC_PROG_CC_STDC
+AC_PROG_CXX
+
+EFL_CXX_COMPILE_STDCXX_11([ext])
+
+# pkg-config
+PKG_PROG_PKG_CONFIG
+
+# gettext
+m4_ifdef([AM_GNU_GETTEXT_VERSION], [
+AM_GNU_GETTEXT_VERSION([0.18])
+])
+
+m4_ifdef([AM_GNU_GETTEXT], [
+AM_GNU_GETTEXT([external])
+po_makefile_in=po/Makefile.in
+have_po="yes"
+],[
+have_po="no"
+])
+AC_SUBST([LTLIBINTL])
+
+if test "x${POSUB}" = "x" ; then
+ have_po="no"
+fi
+
+AM_CONDITIONAL([HAVE_PO], [test "x${have_po}" = "xyes"])
+
+# doxygen
+EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
+
+# EFL binaries
+EFL_WITH_BIN([eet], [eet-eet], [eet])
+EFL_WITH_BIN([edje], [edje-cc], [edje_cc])
+EFL_WITH_BIN([elementary], [elementary-codegen], [elementary_codegen])
+EFL_WITH_BIN([elementary], [elm-prefs-cc], [elm_prefs_cc])
+EFL_WITH_BIN([eolian], [eolian-gen], [eolian_gen])
+EFL_WITH_BIN([eolian-cxx], [eolian-cxx], [eolian_cxx])
+EFL_WITH_BIN([eldbus], [eldbus_codegen], [eldbus-codegen])
+# Force the helper to try external eolian generators
+AM_CONDITIONAL([HAVE_EOLIAN_GEN], [true])
+AM_CONDITIONAL([HAVE_EOLIAN_CXX], [true])
+AM_CONDITIONAL([HAVE_EOLIAN_JS], [true])
+
+EFL_ENABLE_BIN([elementary-test])
+EFL_ENABLE_BIN([elementary-codegen])
+EFL_ENABLE_BIN([elm-prefs-cc])
+EFL_ENABLE_BIN([elementary-config])
### Additional options to configure
[want_quicklaunch=$enableval],
[want_quicklaunch="auto"])
+# Webkit support
+AC_ARG_WITH([elementary-web-backend],
+ [AS_HELP_STRING([--with-elementary-web-backend=@<:@ewebkit2/detect/none@:>@],
+ [Select the WebKit backend for Elementary to support web @<:@default=detect@:>@])],
+ [elementary_web_backend=${withval}],
+ [elementary_web_backend="detect"])
+
+elementary_webkit2="no"
+elementary_web="none"
+
+case "${elementary_web_backend}" in
+ ewebkit2|detect)
+# For now only ewebkit2 exist so detect is similar to it
+ PKG_CHECK_MODULES([EWEBKIT2], [ewebkit2],
+ [elementary_webkit2="yes"],
+ [elementary_webkit2="no"])
+ ;;
+ none)
+ ;;
+ *)
+ AC_MSG_ERROR([Invalid web backend: must be ewebkit2, detect or none instead of '${elementary_web_backend}'])
+ ;;
+esac
+
+if test "x${elementary_webkit2}" = "xyes"; then
+ AC_DEFINE([HAVE_ELEMENTARY_WEB], [1], [Web support for Elementary])
+ webkit_datadir=$(${PKG_CONFIG} ewebkit2 --variable=datadir)
+ AC_DEFINE_UNQUOTED([WEBKIT_DATADIR],
+ ["${webkit_datadir}"],
+ ["WebKit's data dir"])
+ ELM_WEB2_DEF="#define"
+ elementary_web="ewebkit2"
+fi
+AM_CONDITIONAL([HAVE_EWEBKIT2], [test "x${elementary_web}" = "xewebkit2"])
+
+AC_MSG_CHECKING([whether to build web option])
+AC_MSG_RESULT([${elementary_web}])
### Default options with respect to host and default values
AC_SUBST([ELM_UNIX_DEF])
AC_SUBST([ELM_WIN32_DEF])
-### Checks for programs
-
-# compilers
-AC_PROG_CC
-AC_PROG_CC_STDC
-AC_PROG_CXX
-
-EFL_CXX_COMPILE_STDCXX_11([ext])
-
-# pkg-config
-PKG_PROG_PKG_CONFIG
-
-# gettext
-m4_ifdef([AM_GNU_GETTEXT_VERSION], [
-AM_GNU_GETTEXT_VERSION([0.18])
-])
-
-m4_ifdef([AM_GNU_GETTEXT], [
-AM_GNU_GETTEXT([external])
-po_makefile_in=po/Makefile.in
-have_po="yes"
-],[
-have_po="no"
-])
-AC_SUBST([LTLIBINTL])
-
-if test "x${POSUB}" = "x" ; then
- have_po="no"
-fi
-
-AM_CONDITIONAL([HAVE_PO], [test "x${have_po}" = "xyes"])
-
-# doxygen
-EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
-
-# EFL binaries
-EFL_WITH_BIN([eet], [eet-eet], [eet])
-EFL_WITH_BIN([edje], [edje-cc], [edje_cc])
-EFL_WITH_BIN([elementary], [elementary-codegen], [elementary_codegen])
-EFL_WITH_BIN([elementary], [elm-prefs-cc], [elm_prefs_cc])
-EFL_WITH_BIN([eolian], [eolian-gen], [eolian_gen])
-EFL_WITH_BIN([eolian-cxx], [eolian-cxx], [eolian_cxx])
-EFL_WITH_BIN([eldbus], [eldbus_codegen], [eldbus-codegen])
-# Force the helper to try external eolian generators
-AM_CONDITIONAL([HAVE_EOLIAN_GEN], [true])
-AM_CONDITIONAL([HAVE_EOLIAN_CXX], [true])
-AM_CONDITIONAL([HAVE_EOLIAN_JS], [true])
-
-EFL_ENABLE_BIN([elementary-test])
-EFL_ENABLE_BIN([elementary-codegen])
-EFL_ENABLE_BIN([elm-prefs-cc])
-EFL_ENABLE_BIN([elementary-config])
-
-
### Checks for libraries
requirement_elm_pc=""
ELM_CHECK_OPTION([eweather], [0.2.0])
# emap is in svn : trunk/PROTO
ELM_CHECK_OPTION([emap], [0.1.0])
-ELM_CHECK_OPTION([eweb])
if test "x${HAVE_CXX11}" = "x1" -a "x${want_cxx11}" = "xyes"; then
PKG_CHECK_MODULES([ELEMENTARY_CXX],
src/modules/datetime_input_ctxpopup/Makefile
src/modules/test_entry/Makefile
src/modules/test_map/Makefile
+src/modules/web/Makefile
+src/modules/web/none/Makefile
+src/modules/web/webkit2/Makefile
src/edje_externals/Makefile
src/examples/Makefile
src/examples/sphere_hunter/Makefile
echo " Features:"
echo " EWeather...............: ${have_elementary_eweather}"
echo " EMap...................: ${have_elementary_emap}"
-echo " Web (WebKit)...........: ${elementary_web}"
+echo " Web....................: ${elementary_web}"
echo " Quick Launch...........: ${ac_cv_func_fork}"
echo " Elocation..............: ${have_elementary_elocation}"
echo
m4_popdef([DOWN])dnl
])
-dnl use: ELM_CHECK_OPTION_DEP_EWK2()
-AC_DEFUN([ELM_CHECK_OPTION_DEP_EWK2],
-[dnl
-
-ELM_WEB2_DEF="#undef"
-elementary_web="no"
-
-AC_ARG_WITH([elementary-web-backend],
- [AS_HELP_STRING(
- [--with-elementary-web-backend=@<:@ewebkit2/detect/none@:>@],
- [Select the WebKit backend for Elementary to support web @<:@default=detect@:>@])],
- [elementary_web_backend=${withval}],
- [elementary_web_backend="detect"])
-
-case "${elementary_web_backend}" in
- ewebkit2|detect|none)
- ;;
- *)
- AC_MSG_ERROR([Invalid web backend: must be ewebkit2, detect or none])
- ;;
-esac
-
-if test "x${elementary_web_backend}" = "xdetect"; then
- want_elementary_web="ewebkit2"
-else
- want_elementary_web=${elementary_web_backend}
-fi
-
-AC_MSG_CHECKING([which web option to use])
-AC_MSG_RESULT([${want_elementary_web}])
-
-if test "x${want_elementary_web}" != "xnone"; then
- PKG_CHECK_EXISTS([$want_elementary_web],
- [
- AC_DEFINE([HAVE_ELEMENTARY_WEB], [1], [Web support for Elementary])
- webkit_datadir=$(${PKG_CONFIG} ${want_elementary_web} --variable=datadir)
- AC_DEFINE_UNQUOTED([WEBKIT_DATADIR],
- ["${webkit_datadir}"],
- ["WebKit's data dir"])
- ELM_WEB2_DEF="#define"
- elementary_web=${want_elementary_web}
- requirement_elm_pc="${want_elementary_web} ${requirement_elm_pc}"
- ],
- [elementary_web="no"]
- )
-fi
-
-AC_MSG_CHECKING([whether to build web option])
-AC_MSG_RESULT([${elementary_web}])
-
-if test "x${elementary_web_backend}" = "xewebkit2" && test "x${elementary_web}" = "xnone"; then
- AC_MSG_ERROR([Web support requested, but no ${elementary_web_backend} found by pkg-config.])
-fi
-
-AC_SUBST([ELM_WEB2_DEF])
-])
-
-
dnl use: ELM_CHECK_OPTION(option, pkgver)
AC_DEFUN([ELM_CHECK_OPTION],
[dnl
@ELM_UNIX_DEF@ ELM_UNIX
@ELM_WIN32_DEF@ ELM_WIN32
-@ELM_WEB2_DEF@ ELM_WEB2
@ELM_EMAP_DEF@ ELM_EMAP
@ELM_DEBUG_DEF@ ELM_DEBUG
@ELM_ALLOCA_H_DEF@ ELM_ALLOCA_H
ELM_CONFIG_VAL(D, T, config_version, T_INT);
ELM_CONFIG_VAL(D, T, engine, T_STRING);
ELM_CONFIG_VAL(D, T, accel, T_STRING);
+ ELM_CONFIG_VAL(D, T, web_backend, T_STRING);
ELM_CONFIG_VAL(D, T, accel_override, T_UCHAR);
ELM_CONFIG_VAL(D, T, vsync, T_UCHAR);
ELM_CONFIG_VAL(D, T, thumbscroll_enable, T_UCHAR);
if (_elm_config->atspi_mode != ELM_ATSPI_MODE_OFF)
_elm_atspi_bridge_init();
+ if (!_elm_config->web_backend)
+ _elm_config->web_backend = "none";
+ if (!_elm_web_init(_elm_config->web_backend))
+ _elm_config->web_backend = "none";
return _elm_init_count;
}
int config_version;
const char *engine;
const char *accel;
+ const char *web_backend;
unsigned char accel_override;
unsigned char vsync;
unsigned char thumbscroll_enable;
int references;
};
+Eina_Bool _elm_web_init(const char *engine);
+
Eo *_elm_atspi_bridge_get(void);
void _elm_atspi_bridge_init(void);
void _elm_atspi_bridge_shutdown(void);
implements {
class.constructor;
Eo.Base.constructor;
- Evas.Object_Smart.add;
- Evas.Object_Smart.del;
- Elm.Widget.theme_apply;
- Elm.Widget.on_focus;
- Elm.Widget.event;
+ @virtual .tab_propagate.get;
+ @virtual .tab_propagate.set;
+ @virtual .webkit_view.get;
+ @virtual .window_create_hook.set;
+ @virtual .dialog_alert_hook.set;
+ @virtual .dialog_confirm_hook.set;
+ @virtual .dialog_prompt_hook.set;
+ @virtual .dialog_file_selector_hook.set;
+ @virtual .console_message_hook.set;
+ @virtual .useragent.set;
+ @virtual .useragent.get;
+ @virtual .url.set;
+ @virtual .url.get;
+ @virtual .html_string_load;
+ @virtual .title.get;
+ @virtual .bg_color.set;
+ @virtual .bg_color.get;
+ @virtual .selection.get;
+ @virtual .popup_selected.set;
+ @virtual .popup_destroy;
+ @virtual .text_search;
+ @virtual .text_matches_mark;
+ @virtual .text_matches_unmark_all;
+ @virtual .text_matches_highlight.set;
+ @virtual .text_matches_highlight.get;
+ @virtual .load_progress.get;
+ @virtual .stop;
+ @virtual .reload;
+ @virtual .reload_full;
+ @virtual .back;
+ @virtual .forward;
+ @virtual .navigate;
+ @virtual .back_possible.get;
+ @virtual .forward_possible.get;
+ @virtual .navigate_possible_get;
+ @virtual .history_enabled.get;
+ @virtual .history_enabled.set;
+ @virtual .zoom.set;
+ @virtual .zoom.get;
+ @virtual .zoom_mode.set;
+ @virtual .zoom_mode.get;
+ @virtual .region_show;
+ @virtual .region_bring_in;
+ @virtual .inwin_mode.set;
+ @virtual .inwin_mode.get;
}
events {
uri,changed;
url,changed;
windows,close,request;
}
-
}
#include "elm_priv.h"
#include "elm_widget_web.h"
-#if defined(HAVE_ELEMENTARY_WEB)
-#include <EWebKit2.h>
-#endif
-
#define MY_CLASS ELM_WEB_CLASS
#define MY_CLASS_NAME "Elm_Web"
#define MY_CLASS_NAME_LEGACY "elm_web"
-#if defined(HAVE_ELEMENTARY_WEB)
-static Ewk_View_Smart_Class _ewk_view_parent_sc =
- EWK_VIEW_SMART_CLASS_INIT_NULL;
-#endif
+typedef struct _Elm_Web_Module Elm_Web_Module;
+struct _Elm_Web_Module
+{
+ void (*unneed_web)(void);
+ Eina_Bool (*need_web)(void);
+
+ void (*window_features_ref)(Elm_Web_Window_Features *wf);
+ void (*window_features_unref)(Elm_Web_Window_Features *wf);
+ Eina_Bool (*window_features_property_get)(const Elm_Web_Window_Features *wf,
+ Elm_Web_Window_Feature_Flag flag);
+ void (*window_features_region_get)(const Elm_Web_Window_Features *wf,
+ Evas_Coord *x,
+ Evas_Coord *y,
+ Evas_Coord *w,
+ Evas_Coord *h);
+
+ const Eo_Class *(*class_get)(void);
+
+ Eina_Module *m;
+};
+
+static Elm_Web_Module ewm = {
+ NULL,
+ NULL,
+
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+
+ NULL
+};
static const char SIG_URI_CHANGED[] = "uri,changed"; // deprecated, use "url,changed" instead.
static const char SIG_URL_CHANGED[] = "url,changed";
{ NULL, NULL }
};
-#ifdef HAVE_ELEMENTARY_WEB
-static void
-_view_smart_add(Evas_Object *obj)
-{
- View_Smart_Data *sd;
-
- sd = calloc(1, sizeof(View_Smart_Data));
- evas_object_smart_data_set(obj, sd);
-
- _ewk_view_parent_sc.sc.add(obj);
-}
-
-static void
-_view_smart_del(Evas_Object *obj)
-{
- _ewk_view_parent_sc.sc.del(obj);
-}
-
-static Evas_Object *
-_view_smart_window_create(Ewk_View_Smart_Data *vsd,
- const Ewk_Window_Features *window_features)
-{
- Evas_Object *new;
- Evas_Object *obj = evas_object_smart_parent_get(vsd->self);
-
- ELM_WEB_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
-
- if (!sd->hook.window_create) return NULL;
-
- new = sd->hook.window_create
- (sd->hook.window_create_data, obj, EINA_TRUE,
- (const Elm_Web_Window_Features *)window_features);
- if (new) return elm_web_webkit_view_get(new);
-
- return NULL;
-}
-
-static void
-_view_smart_window_close(Ewk_View_Smart_Data *sd)
-{
- Evas_Object *obj = evas_object_smart_parent_get(sd->self);
-
- ELM_WEB_CHECK(obj);
-
- eo_event_callback_call(obj, ELM_WEB_EVENT_WINDOWS_CLOSE_REQUEST, NULL);
-}
-
-static void
-_popup_item_selected(void *data,
- Evas_Object *obj,
- void *event_info EINA_UNUSED)
-{
- Elm_Object_Item *list_it = elm_list_selected_item_get(obj);
- const Eina_List *itr, *list = elm_list_items_get(obj);
- Ewk_Popup_Menu *menu = data;
- int i = 0;
- void *d;
-
- EINA_LIST_FOREACH(list, itr, d)
- {
- if (d == list_it)
- break;
-
- i++;
- }
-
- ewk_popup_menu_selected_index_set(menu, i);
- ewk_popup_menu_close(menu);
-
- evas_object_del(evas_object_data_get(obj, "_notify"));
-}
-
-static Eina_Bool
-_popup_dismiss_cb(void *data,
- Eo *obj,
- const Eo_Event_Description *desc EINA_UNUSED,
- void *event_info EINA_UNUSED)
+// FIXME: init/shutdown module below
+void
+_elm_unneed_web(void)
{
- ewk_popup_menu_close(data);
- evas_object_del(obj);
- return EINA_TRUE;
+ if (!ewm.unneed_web) return ;
+ ewm.unneed_web();
}
-static Eina_Bool
-_view_smart_popup_menu_show(Ewk_View_Smart_Data *sd,
- Eina_Rectangle r,
- Ewk_Text_Direction dir EINA_UNUSED,
- double scale EINA_UNUSED,
- Ewk_Popup_Menu *menu)
+EAPI Eina_Bool
+elm_need_web(void)
{
- Evas_Object *notify, *list, *grid, *win;
- const Eina_List* items = ewk_popup_menu_items_get(menu);
- Evas_Object *obj = evas_object_smart_parent_get(sd->self);
- int h, ww, wh;
-
- Elm_Object_Item *lit;
- Eina_Bool disabled;
- const char *txt;
- Ewk_Popup_Menu_Item *it;
- const Eina_List *itr;
-
- Evas_Object *popup = evas_object_data_get(sd->self, "_select_popup");
- if (popup) evas_object_del(popup);
-
- win = elm_widget_top_get(obj);
-
- notify = elm_notify_add(win);
- elm_notify_allow_events_set(notify, EINA_FALSE);
- elm_notify_align_set(notify, 0.5, 1.0);
-
- list = elm_list_add(notify);
- evas_object_data_set(list, "_notify", notify);
- elm_list_select_mode_set(list, ELM_OBJECT_SELECT_MODE_ALWAYS);
- elm_scroller_bounce_set(list, EINA_FALSE, EINA_FALSE);
- elm_list_mode_set(list, ELM_LIST_EXPAND);
- evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(list);
-
- EINA_LIST_FOREACH(items, itr, it)
- {
- switch (ewk_popup_menu_item_type_get(it))
- {
- case EWK_POPUP_MENU_SEPARATOR:
- // TODO:
- break;
- case EWK_POPUP_MENU_ITEM:
- txt = ewk_popup_menu_item_text_get(it);
- if (ewk_popup_menu_item_is_label_get(it))
- {
- lit = elm_list_item_append(list, txt, NULL, NULL, NULL, NULL);
- disabled = EINA_TRUE;
- }
- else
- {
- lit = elm_list_item_append(list, txt, NULL, NULL, _popup_item_selected, menu);
- disabled = !ewk_popup_menu_item_enabled_get(it);
- }
-
- elm_object_item_disabled_set(lit, disabled);
- break;
- default:
- break;
- }
- }
- elm_list_go(list);
-
- grid = elm_grid_add(win);
- elm_grid_size_set(grid, 1, 1);
- elm_grid_pack(grid, list, 0, 0, 1, 1);
- evas_object_geometry_get(win, NULL, NULL, &ww, &wh);
-
- //FIXME: it should be the real height of items in the list.
- h = r.h * eina_list_count(items);
- evas_object_size_hint_min_set(grid, ww, h < wh / 2 ? h : wh / 2);
- elm_object_content_set(notify, grid);
- evas_object_show(grid);
-
- evas_object_show(notify);
-
- evas_object_data_set(sd->self, "_select_popup", notify);
-
- eo_event_callback_add
- (notify, ELM_NOTIFY_EVENT_BLOCK_CLICKED, _popup_dismiss_cb, menu);
-
- return EINA_TRUE;
+ if (!ewm.need_web) return EINA_FALSE;
+ return ewm.need_web();
}
-static Eina_Bool
-_view_smart_popup_menu_hide(Ewk_View_Smart_Data *sd)
+EAPI Evas_Object *
+elm_web_add(Evas_Object *parent)
{
- Evas_Object *popup = evas_object_data_get(sd->self, "_select_popup");
- if (!popup) return EINA_FALSE;
-
- evas_object_del(popup);
- evas_object_data_del(sd->self, "_select_popup");
-
- return EINA_TRUE;
-}
+ Evas_Object *obj;
-static Eina_Bool
-_fullscreen_accept(void *data,
- Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
-{
- Evas_Object *ewk = data;
- evas_object_del(evas_object_data_get(ewk, "_fullscreen_permission_popup"));
+ if (!parent || !ewm.class_get) return NULL;
- return EINA_TRUE;
+ eo_add(&obj, ewm.class_get(), parent);
+ return obj;
}
-static Eina_Bool
-_fullscreen_deny(void *data,
- Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
+EOLIAN static Eo *
+_elm_web_eo_base_constructor(Eo *obj, Elm_Web_Data *sd)
{
- Evas_Object *ewk = data;
- ewk_view_fullscreen_exit(ewk);
- evas_object_del(evas_object_data_get(ewk, "_fullscreen_permission_popup"));
+ obj = eo_constructor(eo_super(obj, MY_CLASS));
+ sd->obj = obj;
+ evas_obj_type_set(obj, MY_CLASS_NAME_LEGACY);
+ evas_obj_smart_callbacks_descriptions_set(obj, _elm_web_smart_callbacks);
+ elm_interface_atspi_accessible_role_set(obj, ELM_ATSPI_ROLE_HTML_CONTAINER);
- return EINA_TRUE;
+ return obj;
}
-static Eina_Bool
-_view_smart_fullscreen_enter(Ewk_View_Smart_Data *sd, Ewk_Security_Origin *origin)
+EAPI Eina_Bool
+elm_web_uri_set(Evas_Object *obj, const char *url)
{
- Evas_Object *btn, *popup, *top;
- const char *host;
- char buffer[2048];
-
- Evas_Object *obj = evas_object_smart_parent_get(sd->self);
-
ELM_WEB_CHECK(obj) EINA_FALSE;
- top = elm_widget_top_get(obj);
- elm_win_fullscreen_set(top, EINA_TRUE);
-
- popup = elm_popup_add(top);
- elm_popup_orient_set(popup, ELM_POPUP_ORIENT_TOP);
- evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-
- host = ewk_security_origin_host_get(origin);
- snprintf(buffer, sizeof(buffer), "%s is now fullscreen.<br>Press ESC at any time to exit fullscreen,<br>Allow fullscreen?<br>", host);
- elm_object_text_set(popup, buffer);
-
- btn = elm_button_add(popup);
- elm_object_text_set(btn, "Accept");
- elm_object_part_content_set(popup, "button1", btn);
- eo_event_callback_add
- (btn, EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _fullscreen_accept, sd->self);
-
- btn = elm_button_add(popup);
- elm_object_text_set(btn, "Deny");
- elm_object_part_content_set(popup, "button2", btn);
- eo_event_callback_add
- (btn, EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _fullscreen_deny, sd->self);
-
- evas_object_data_set(sd->self, "_fullscreen_permission_popup", popup);
- evas_object_show(popup);
-
- return EINA_TRUE;
+ return elm_obj_web_url_set(obj, url);
}
-static Eina_Bool
-_view_smart_fullscreen_exit(Ewk_View_Smart_Data *sd)
+EAPI const char *
+elm_web_uri_get(const Evas_Object *obj)
{
- Evas_Object *obj = evas_object_smart_parent_get(sd->self);
-
- ELM_WEB_CHECK(obj) EINA_FALSE;
-
- Evas_Object *top = elm_widget_top_get(obj);
- elm_win_fullscreen_set(top, EINA_FALSE);
-
- return EINA_TRUE;
+ return elm_obj_web_url_get((Eo *) obj);
}
-static Eina_Bool
-_bt_close(void *data,
- Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
+// FIXME: override with module function
+EAPI void
+elm_web_window_features_ref(Elm_Web_Window_Features *wf)
{
- Dialog_Data *d = data;
-
- if (d->type == DIALOG_ALERT) goto end;
-
- *d->response = (obj == d->bt_ok);
- if (d->type == DIALOG_CONFIRM) goto end;
-
- if (d->type == DIALOG_PROMPT)
- *d->entry_value = strdup(elm_entry_entry_get(d->entry));
-
-end:
- evas_object_del(d->dialog);
- free(d);
-
- return EINA_TRUE;
+ if (!ewm.window_features_ref) return ;
+ ewm.window_features_ref(wf);
}
-static Dialog_Data *
-_dialog_new(Evas_Object *web, Eina_Bool inwin_mode)
+EAPI void
+elm_web_window_features_unref(Elm_Web_Window_Features *wf)
{
- Dialog_Data *d;
-
- d = calloc(1, sizeof(Dialog_Data));
- if (!d) return NULL;
-
- if (!web || inwin_mode)
- {
- Evas_Object *bg;
-
- d->dialog = elm_win_add(NULL, "elm-web-popup", ELM_WIN_DIALOG_BASIC);
- eo_event_callback_add
- (d->dialog, ELM_WIN_EVENT_DELETE_REQUEST, _bt_close, d);
-
- bg = elm_bg_add(d->dialog);
- evas_object_size_hint_weight_set
- (bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_win_resize_object_add(d->dialog, bg);
- evas_object_show(bg);
-
- d->box = elm_box_add(d->dialog);
- evas_object_size_hint_weight_set
- (d->box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_win_resize_object_add(d->dialog, d->box);
- evas_object_show(d->box);
- }
- else
- {
- Evas_Object *win = elm_widget_top_get(web);
-
- d->dialog = elm_win_inwin_add(win);
- elm_object_style_set(d->dialog, "minimal");
- evas_object_size_hint_weight_set
- (d->dialog, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-
- d->box = elm_box_add(win);
- evas_object_size_hint_weight_set
- (d->box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_win_inwin_content_set(d->dialog, d->box);
- evas_object_show(d->box);
- }
-
- return d;
+ if (!ewm.window_features_unref) return ;
+ ewm.window_features_unref(wf);
}
-static void
-_dialog_ok_cancel_buttons_add(Dialog_Data *dialog_data)
+EAPI Eina_Bool
+elm_web_window_features_property_get(const Elm_Web_Window_Features *wf,
+ Elm_Web_Window_Feature_Flag flag)
{
- Evas_Object *bx, *bt;
- bx = elm_box_add(dialog_data->box);
- elm_box_horizontal_set(bx, EINA_TRUE);
- elm_box_pack_end(dialog_data->box, bx);
- evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(bx);
-
- dialog_data->bt_cancel = bt = elm_button_add(bx);
- elm_object_text_set(bt, "Cancel");
- elm_box_pack_end(bx, bt);
- evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
- eo_event_callback_add
- (bt, EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _bt_close, dialog_data);
- evas_object_show(bt);
-
- dialog_data->bt_ok = bt = elm_button_add(bx);
- elm_object_text_set(bt, "Ok");
- elm_box_pack_end(bx, bt);
- evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
- eo_event_callback_add
- (bt, EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _bt_close, dialog_data);
- evas_object_show(bt);
+ if (!ewm.window_features_property_get) return EINA_FALSE;
+ return ewm.window_features_property_get(wf, flag);
}
-static void
-_dialog_del_cb(void *data EINA_UNUSED,
- Evas *e EINA_UNUSED,
- Evas_Object *obj EINA_UNUSED,
- void *event_info EINA_UNUSED)
+EAPI void
+elm_web_window_features_region_get(const Elm_Web_Window_Features *wf,
+ Evas_Coord *x,
+ Evas_Coord *y,
+ Evas_Coord *w,
+ Evas_Coord *h)
{
- ecore_main_loop_quit();
-}
+ if (x) *x = 0;
+ if (y) *y = 0;
+ if (w) *w = 0;
+ if (h) *h = 0;
-static void
-_exec_dialog(Evas_Object *dialog)
-{
- evas_object_event_callback_add
- (dialog, EVAS_CALLBACK_DEL, _dialog_del_cb, NULL);
- ecore_main_loop_begin();
+ if (!ewm.window_features_region_get) return;
+ ewm.window_features_region_get(wf, x, y, w, h);
}
static void
-_view_smart_run_javascript_alert(Ewk_View_Smart_Data *vsd, const char *message)
+_elm_web_class_constructor(Eo_Class *klass)
{
- Evas_Object *obj = evas_object_smart_parent_get(vsd->self);
- Evas_Object *dialog = NULL;
-
- ELM_WEB_DATA_GET_OR_RETURN(obj, sd);
-
- if (sd->hook.alert)
- dialog = sd->hook.alert(sd->hook.alert_data, obj, message);
- else
- {
- Evas_Object *lb;
- Dialog_Data *dialog_data = _dialog_new(obj, sd->inwin_mode);
- dialog_data->type = DIALOG_ALERT;
- dialog = dialog_data->dialog;
-
- lb = elm_label_add(dialog_data->box);
- elm_object_text_set(lb, message);
- elm_box_pack_end(dialog_data->box, lb);
- evas_object_show(lb);
-
- dialog_data->bt_ok = elm_button_add(dialog_data->box);
- elm_object_text_set(dialog_data->bt_ok, "Close");
- elm_box_pack_end(dialog_data->box, dialog_data->bt_ok);
- evas_object_size_hint_align_set
- (dialog_data->bt_ok, EVAS_HINT_FILL, EVAS_HINT_FILL);
- eo_event_callback_add
- (dialog_data->bt_ok, EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _bt_close, dialog_data);
- evas_object_show(dialog_data->bt_ok);
-
- evas_object_show(dialog);
- }
-
- if (dialog) _exec_dialog(dialog);
+ evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
}
-static Eina_Bool
-_view_smart_run_javascript_confirm(Ewk_View_Smart_Data *vsd, const char *message)
-{
- Evas_Object *obj = evas_object_smart_parent_get(vsd->self);
- Eina_Bool response = EINA_FALSE;
- Evas_Object *dialog = NULL;
-
- ELM_WEB_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
-
- if (sd->hook.confirm)
- dialog = sd->hook.confirm(sd->hook.confirm_data, obj, message, &response);
- else
- {
- Evas_Object *lb;
- Dialog_Data *dialog_data = _dialog_new(obj, sd->inwin_mode);
- dialog_data->type = DIALOG_CONFIRM;
- dialog_data->response = &response;
- dialog = dialog_data->dialog;
-
- lb = elm_label_add(dialog_data->box);
- elm_object_text_set(lb, message);
- elm_box_pack_end(dialog_data->box, lb);
- evas_object_show(lb);
-
- _dialog_ok_cancel_buttons_add(dialog_data);
-
- evas_object_show(dialog);
- }
-
- if (dialog) _exec_dialog(dialog);
-
- return response;
-}
+#if defined(_WIN32) || defined(__CYGWIN__)
+# define EFL_SHARED_EXTENSION ".dll"
+#else
+# define EFL_SHARED_EXTENSION ".so"
+#endif
-static const char *
-_view_smart_run_javascript_prompt(Ewk_View_Smart_Data *vsd, const char *message, const char *default_value)
+Eina_Bool
+_elm_web_init(const char *engine)
{
- Evas_Object *obj = evas_object_smart_parent_get(vsd->self);
- Eina_Bool response = EINA_FALSE;
- Evas_Object *dialog = NULL;
- char *value = NULL;
- const char *ret;
+ char buf[PATH_MAX];
- ELM_WEB_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
-
- if (sd->hook.prompt)
- dialog = sd->hook.prompt(sd->hook.prompt_data, obj, message, default_value, (const char**)&value, &response);
+ if (getenv("ELM_RUN_IN_TREE"))
+ snprintf(buf, sizeof(buf),
+ ELM_TOP_BUILD_DIR"/src/modules/web/%s/.libs/module"EFL_SHARED_EXTENSION,
+ engine);
else
- {
- Evas_Object *lb, *entry;
- Dialog_Data *dialog_data = _dialog_new(obj, sd->inwin_mode);
- dialog_data->type = DIALOG_PROMPT;
- dialog_data->response = &response;
- dialog_data->entry_value = (const char**)&value;
- dialog = dialog_data->dialog;
-
- lb = elm_label_add(dialog_data->box);
- elm_object_text_set(lb, message);
- elm_box_pack_end(dialog_data->box, lb);
- evas_object_show(lb);
-
- dialog_data->entry = entry = elm_entry_add(dialog_data->box);
- elm_entry_single_line_set(entry, EINA_TRUE);
- elm_entry_scrollable_set(entry, EINA_TRUE);
- elm_entry_entry_set(entry, default_value);
- evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_box_pack_end(dialog_data->box, entry);
- evas_object_show(entry);
-
- _dialog_ok_cancel_buttons_add(dialog_data);
-
- evas_object_show(dialog);
- }
-
- if (dialog) _exec_dialog(dialog);
-
- if (!value) return NULL;
-
- ret = eina_stringshare_add(value);
- free(value);
- return ret;
-}
-
-/**
- * Creates a new view object given the parent.
- *
- * @param parent object to use as parent.
- *
- * @return newly added Evas_Object or @c NULL on errors.
- */
-Evas_Object *
-_view_add(Evas_Object *parent)
-{
- Evas *canvas = evas_object_evas_get(parent);
- static Evas_Smart *smart = NULL;
- Evas_Object *view;
-
- if (!smart)
- {
- static Ewk_View_Smart_Class api =
- EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION("EWK_View_Elementary");
-
- ewk_view_smart_class_set(&api);
- ewk_view_smart_class_set(&_ewk_view_parent_sc);
-
- // TODO: check every api method and provide overrides with hooks!
- // TODO: hooks should provide extension points
- // TODO: extension should have some kind of "default implementation",
- // TODO: that can be replaced or controlled by hooks.
- // TODO: ie: run_javascript_alert() should present an elm_win
- // TODO: by default, but user could override it to show as inwin.
- api.sc.add = _view_smart_add;
- api.sc.del = _view_smart_del;
- api.window_create = _view_smart_window_create;
- api.window_close = _view_smart_window_close;
- api.popup_menu_show = _view_smart_popup_menu_show;
- api.popup_menu_hide = _view_smart_popup_menu_hide;
- api.fullscreen_enter = _view_smart_fullscreen_enter;
- api.fullscreen_exit = _view_smart_fullscreen_exit;
- api.run_javascript_alert = _view_smart_run_javascript_alert;
- api.run_javascript_confirm = _view_smart_run_javascript_confirm;
- api.run_javascript_prompt = _view_smart_run_javascript_prompt;
-
- smart = evas_smart_class_new(&api.sc);
- if (!smart)
- {
- CRI("Could not create smart class");
- return NULL;
- }
- }
+ snprintf(buf, sizeof(buf),
+ "%s/elementary/modules/web/%s/%s/module"EFL_SHARED_EXTENSION,
+ _elm_lib_dir, engine, MODULE_ARCH);
- view = ewk_view_smart_add(canvas, smart, ewk_context_default_get(), ewk_page_group_create(0));
- if (!view)
+ if (ewm.m)
{
- ERR("Could not create smart object object for view");
- return NULL;
+ // Check if the module is already open
+ if (!strcmp(buf, eina_module_file_get(ewm.m)))
+ return EINA_TRUE;
+
+ // We are leaking reference on purpose here, as we can't be sure that
+ // the web engine is not leaking state around preventing a clean exit.
+ // Only future elm_web object created from now will use the new engine.
+ ewm.unneed_web = NULL;
+ ewm.need_web = NULL;
+ ewm.window_features_ref = NULL;
+ ewm.window_features_unref = NULL;
+ ewm.window_features_property_get = NULL;
+ ewm.window_features_region_get = NULL;
+ ewm.class_get = NULL;
}
- return view;
-}
-
-static Eina_Bool
-_view_smart_url_changed_cb(void *data,
- Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
-{
- eo_event_callback_call(data, ELM_WEB_EVENT_URI_CHANGED, event_info);
- eo_event_callback_call(data, ELM_WEB_EVENT_URL_CHANGED, event_info);
-
- return EINA_TRUE;
-}
-
-static void
-_view_smart_callback_proxy(Evas_Object *view, Evas_Object *parent)
-{
- eo_event_callback_add
- (view, ELM_WEB_EVENT_URL_CHANGED, _view_smart_url_changed_cb, parent);
-}
-
-static Eina_Bool _elm_need_web = EINA_FALSE;
-#endif
-
-void
-_elm_unneed_web(void)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- if (!_elm_need_web) return;
- _elm_need_web = EINA_FALSE;
- ewk_shutdown();
-#endif
-}
-
-EAPI Eina_Bool
-elm_need_web(void)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- if (_elm_need_web) return EINA_TRUE;
- _elm_need_web = EINA_TRUE;
- ewk_init();
- return EINA_TRUE;
-#else
- return EINA_FALSE;
-#endif
-}
-
-EOLIAN static Eina_Bool
-_elm_web_elm_widget_theme_apply(Eo *obj, Elm_Web_Data *sd EINA_UNUSED)
-{
- (void)obj;
- return EINA_TRUE;
-}
-
-EOLIAN static Eina_Bool
-_elm_web_elm_widget_on_focus(Eo *obj, Elm_Web_Data *sd, Elm_Object_Item *item EINA_UNUSED)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- Evas_Object *top;
-
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_TRUE);
- Eina_Bool int_ret = EINA_FALSE;
-
- int_ret = elm_obj_widget_on_focus(eo_super(obj, MY_CLASS), NULL);
- if (!int_ret) return EINA_TRUE;
-
- top = elm_widget_top_get(obj);
+ ewm.m = eina_module_new(buf);
+ if (!ewm.m) return EINA_FALSE;
- if (elm_object_focus_get(obj))
+ if (!eina_module_load(ewm.m))
{
- evas_object_focus_set(wd->resize_obj, EINA_TRUE);
- if (top) elm_win_keyboard_mode_set(top, sd->input_method);
+ eina_module_free(ewm.m);
+ ewm.m = NULL;
+ return EINA_FALSE;
}
- else
- {
- evas_object_focus_set(wd->resize_obj, EINA_FALSE);
- if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF);
- }
-#else
- (void)obj;
- (void)sd;
-#endif
- return EINA_TRUE;
-}
-
-EOLIAN static Eina_Bool
-_elm_web_elm_widget_event(Eo *obj, Elm_Web_Data *sd, Evas_Object *src, Evas_Callback_Type type, void *event_info)
-{
- (void)obj;
- (void)sd;
- (void)src;
- (void)type;
- (void)event_info;
- return EINA_FALSE;
-}
-
-EOLIAN static Eina_Bool
-_elm_web_tab_propagate_get(Eo *obj EINA_UNUSED, Elm_Web_Data *sd)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- return sd->tab_propagate;
-#else
- (void)sd;
- return EINA_FALSE;
-#endif
-}
-
-EOLIAN static void
-_elm_web_tab_propagate_set(Eo *obj EINA_UNUSED, Elm_Web_Data *sd, Eina_Bool propagate)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- sd->tab_propagate = propagate;
-#else
- (void)propagate;
- (void)sd;
-#endif
-}
-EOLIAN static void
-_elm_web_evas_object_smart_add(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED)
-{
- Evas_Object *resize_obj;
-
-#ifdef HAVE_ELEMENTARY_WEB
- resize_obj = _view_add(obj);
- elm_widget_resize_object_set(obj, resize_obj, EINA_TRUE);
-
- evas_obj_smart_add(eo_super(obj, MY_CLASS));
- elm_widget_sub_object_parent_add(obj);
-
- //TODO: need a way to change theme
- ewk_view_theme_set(resize_obj, WEBKIT_DATADIR "/themes/default.edj");
-
- _view_smart_callback_proxy(resize_obj, obj);
- elm_widget_can_focus_set(obj, EINA_TRUE);
-#else
- resize_obj = elm_label_add(obj);
- elm_object_text_set(resize_obj, "WebKit not supported!");
- elm_widget_resize_object_set(obj, resize_obj, EINA_TRUE);
-
- evas_obj_smart_add(eo_super(obj, MY_CLASS));
- elm_widget_sub_object_parent_add(obj);
-#endif
-}
-
-EOLIAN static void
-_elm_web_evas_object_smart_del(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED)
-{
- evas_obj_smart_del(eo_super(obj, MY_CLASS));
-}
+ ewm.unneed_web = eina_module_symbol_get(ewm.m, "ewm_unneed_web");
+ ewm.need_web = eina_module_symbol_get(ewm.m, "ewm_need_web");
+ ewm.window_features_ref = eina_module_symbol_get(ewm.m, "ewm_window_features_ref");
+ ewm.window_features_unref = eina_module_symbol_get(ewm.m, "ewm_window_features_unref");
+ ewm.window_features_property_get = eina_module_symbol_get(ewm.m, "ewm_window_features_property_get");
+ ewm.window_features_region_get = eina_module_symbol_get(ewm.m, "ewm_window_features_region_get");
+ ewm.class_get = eina_module_symbol_get(ewm.m, "ewm_class_get");
-EAPI Evas_Object *
-elm_web_add(Evas_Object *parent)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
- Evas_Object *obj = NULL;
- eo_add(&obj, MY_CLASS, parent);
- return obj;
-}
-
-EOLIAN static Eo *
-_elm_web_eo_base_constructor(Eo *obj, Elm_Web_Data *sd)
-{
- obj = eo_constructor(eo_super(obj, MY_CLASS));
- sd->obj = obj;
- evas_obj_type_set(obj, MY_CLASS_NAME_LEGACY);
- evas_obj_smart_callbacks_descriptions_set(obj, _elm_web_smart_callbacks);
- elm_interface_atspi_accessible_role_set(obj, ELM_ATSPI_ROLE_HTML_CONTAINER);
-
- return obj;
-}
-
-EOLIAN static Evas_Object*
-_elm_web_webkit_view_get(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
- return wd->resize_obj;
-#else
- (void)obj;
- ERR("Elementary not compiled with EWebKit support.");
- return NULL;
-#endif
-}
-
-EOLIAN static void
-_elm_web_window_create_hook_set(Eo *obj EINA_UNUSED, Elm_Web_Data *sd, Elm_Web_Window_Open func, void *data)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- sd->hook.window_create = func;
- sd->hook.window_create_data = data;
-#else
- (void)sd;
- (void)func;
- (void)data;
-#endif
-}
-
-EOLIAN static void
-_elm_web_dialog_alert_hook_set(Eo *obj EINA_UNUSED, Elm_Web_Data *sd, Elm_Web_Dialog_Alert func, void *data)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- sd->hook.alert = func;
- sd->hook.alert_data = data;
-#else
- (void)func;
- (void)data;
- (void)sd;
-#endif
-}
-
-EOLIAN static void
-_elm_web_dialog_confirm_hook_set(Eo *obj EINA_UNUSED, Elm_Web_Data *sd, Elm_Web_Dialog_Confirm func, void *data)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- sd->hook.confirm = func;
- sd->hook.confirm_data = data;
-#else
- (void)func;
- (void)data;
- (void)sd;
-#endif
-}
-
-EOLIAN static void
-_elm_web_dialog_prompt_hook_set(Eo *obj EINA_UNUSED, Elm_Web_Data *sd, Elm_Web_Dialog_Prompt func, void *data)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- sd->hook.prompt = func;
- sd->hook.prompt_data = data;
-#else
- (void)func;
- (void)data;
- (void)sd;
-#endif
-}
-
-EOLIAN static void
-_elm_web_dialog_file_selector_hook_set(Eo *obj EINA_UNUSED, Elm_Web_Data *_pd EINA_UNUSED, Elm_Web_Dialog_File_Selector func, void *data)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- (void)func;
- (void)data;
- (void)_pd;
-#else
- (void)func;
- (void)data;
- (void)_pd;
-#endif
-}
-
-EOLIAN static void
-_elm_web_console_message_hook_set(Eo *obj EINA_UNUSED, Elm_Web_Data *_pd EINA_UNUSED, Elm_Web_Console_Message func, void *data)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- (void)func;
- (void)data;
- (void)_pd;
-#else
- (void)func;
- (void)data;
- (void)_pd;
-#endif
-}
-
-EOLIAN static void
-_elm_web_useragent_set(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED, const char *user_agent)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
-
- ewk_view_user_agent_set(wd->resize_obj, user_agent);
-#else
- (void)user_agent;
- (void)obj;
-#endif
-}
-
-EOLIAN static const char*
-_elm_web_useragent_get(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
-
- return ewk_view_user_agent_get(wd->resize_obj);
-#else
- (void)obj;
- return NULL;
-#endif
-}
-
-EAPI Eina_Bool
-elm_web_uri_set(Evas_Object *obj, const char *url)
-{
- ELM_WEB_CHECK(obj) EINA_FALSE;
- Eina_Bool ret = EINA_FALSE;
- ret = elm_obj_web_url_set(obj, url);
- return ret;
-}
-
-EAPI const char *
-elm_web_uri_get(const Evas_Object *obj)
-{
- const char *ret = NULL;
- ret = elm_obj_web_url_get((Eo *) obj);
- return ret;
-}
-
-EOLIAN static Eina_Bool
-_elm_web_url_set(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED, const char *url)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
- return ewk_view_url_set(wd->resize_obj, url);
-#else
- (void)url;
- (void)obj;
- return EINA_FALSE;
-#endif
-}
-
-EOLIAN static const char*
-_elm_web_url_get(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
- return ewk_view_url_get(wd->resize_obj);
-#else
- (void)obj;
- return NULL;
-#endif
-}
-
-EOLIAN static Eina_Bool
-_elm_web_html_string_load(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED, const char *html, const char *base_url, const char *unreachable_url)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
-
- return ewk_view_html_string_load(wd->resize_obj,
- html, base_url, unreachable_url);
-#else
- (void)obj;
- (void)html;
- (void)base_url;
- (void)unreachable_url;
- return EINA_FALSE;
-#endif
-}
-
-EOLIAN static const char*
-_elm_web_title_get(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
- return ewk_view_title_get(wd->resize_obj);
-#else
- (void)obj;
- return NULL;
-#endif
-}
-
-EOLIAN static void
-_elm_web_bg_color_set(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED, int r, int g, int b, int a)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
-
- ewk_view_bg_color_set(wd->resize_obj, r, g, b, a);
-#else
- (void)obj;
- (void)r;
- (void)g;
- (void)b;
- (void)a;
-#endif
-}
-
-EOLIAN static void
-_elm_web_bg_color_get(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED, int *r, int *g, int *b, int *a)
-{
- if (r) *r = 0;
- if (g) *g = 0;
- if (b) *b = 0;
- if (a) *a = 0;
-
-#ifdef HAVE_ELEMENTARY_WEB
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
-
- ewk_view_bg_color_get(wd->resize_obj, r, g, b, a);
-#else
- (void)obj;
-#endif
-}
-
-EOLIAN static const char*
-_elm_web_selection_get(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- (void)obj;
- return NULL;
-#else
- (void)obj;
- return NULL;
-#endif
-}
-
-EOLIAN static void
-_elm_web_popup_selected_set(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED, int idx)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- (void)idx;
- (void)obj;
-#else
- (void)idx;
- (void)obj;
-#endif
-}
-
-EOLIAN static Eina_Bool
-_elm_web_popup_destroy(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- (void)obj;
-#else
- (void)obj;
-#endif
-
- return EINA_FALSE;
-}
-
-EOLIAN static Eina_Bool
-_elm_web_text_search(const Eo *obj, Elm_Web_Data *_pd EINA_UNUSED, const char *string, Eina_Bool case_sensitive, Eina_Bool forward, Eina_Bool wrap)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- (void)string;
- (void)case_sensitive;
- (void)forward;
- (void)wrap;
- (void)obj;
-#else
- (void)string;
- (void)case_sensitive;
- (void)forward;
- (void)wrap;
- (void)obj;
-#endif
-
- return EINA_FALSE;
-}
-
-EOLIAN static unsigned int
-_elm_web_text_matches_mark(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED, const char *string, Eina_Bool case_sensitive, Eina_Bool highlight, unsigned int limit)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- (void)string;
- (void)case_sensitive;
- (void)highlight;
- (void)limit;
- (void)obj;
-#else
- (void)string;
- (void)case_sensitive;
- (void)highlight;
- (void)limit;
- (void)obj;
-#endif
-
- return 0;
-}
-
-EOLIAN static Eina_Bool
-_elm_web_text_matches_unmark_all(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- (void)obj;
-#else
- (void)obj;
-#endif
-
- return EINA_FALSE;
-}
-
-EOLIAN static Eina_Bool
-_elm_web_text_matches_highlight_set(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED, Eina_Bool highlight)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- (void)obj;
- (void)highlight;
-#else
- (void)obj;
- (void)highlight;
-#endif
-
- return EINA_FALSE;
-}
-
-EOLIAN static Eina_Bool
-_elm_web_text_matches_highlight_get(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- (void)obj;
-#else
- (void)obj;
-#endif
-
- return EINA_FALSE;
-}
-
-EOLIAN static double
-_elm_web_load_progress_get(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED)
-{
- double ret;
- ret = -1.0;
-
-#ifdef HAVE_ELEMENTARY_WEB
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, ret);
-
- ret = ewk_view_load_progress_get(wd->resize_obj);
-#else
- (void)obj;
-#endif
-
- return ret;
-}
-
-EOLIAN static Eina_Bool
-_elm_web_stop(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED)
-{
- Eina_Bool ret = EINA_FALSE;
-
-#ifdef HAVE_ELEMENTARY_WEB
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, ret);
-
- ret = ewk_view_stop(wd->resize_obj);
-#else
- (void)obj;
-#endif
-
- return ret;
-}
-
-EOLIAN static Eina_Bool
-_elm_web_reload(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED)
-{
- Eina_Bool ret = EINA_FALSE;
-
-#ifdef HAVE_ELEMENTARY_WEB
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, ret);
-
- ret = ewk_view_reload(wd->resize_obj);
-#else
- (void)obj;
-#endif
-
- return ret;
-}
-
-EOLIAN static Eina_Bool
-_elm_web_reload_full(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED)
-{
- Eina_Bool ret = EINA_FALSE;
-
-#ifdef HAVE_ELEMENTARY_WEB
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, ret);
-
- ret = ewk_view_reload_bypass_cache(wd->resize_obj);
-#else
- (void)obj;
-#endif
-
- return ret;
-}
-
-EOLIAN static Eina_Bool
-_elm_web_back(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED)
-{
- Eina_Bool ret = EINA_FALSE;
-
-#ifdef HAVE_ELEMENTARY_WEB
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, ret);
-
- ret = ewk_view_back(wd->resize_obj);
-#else
- (void)obj;
-#endif
-
- return ret;
-}
-
-EOLIAN static Eina_Bool
-_elm_web_forward(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED)
-{
- Eina_Bool ret = EINA_FALSE;
-
-#ifdef HAVE_ELEMENTARY_WEB
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
-
- ret = ewk_view_forward(wd->resize_obj);
-#else
- (void)obj;
-#endif
-
- return ret;
-}
-
-EOLIAN static Eina_Bool
-_elm_web_navigate(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED, int steps)
-{
- Eina_Bool ret = EINA_FALSE;
-
-#ifdef HAVE_ELEMENTARY_WEB
- Ewk_Back_Forward_List *history;
- Ewk_Back_Forward_List_Item *item = NULL;
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, ret);
-
- history = ewk_view_back_forward_list_get(wd->resize_obj);
- if (history)
- {
- item = ewk_back_forward_list_item_at_index_get(history, steps);
- if (item) ret = ewk_view_navigate_to(wd->resize_obj, item);
- }
-#else
- (void)steps;
- (void)obj;
-#endif
-
- return ret;
-}
-
-EOLIAN static Eina_Bool
-_elm_web_back_possible_get(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED)
-{
- Eina_Bool ret;
- ret = EINA_FALSE;
-
-#ifdef HAVE_ELEMENTARY_WEB
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, ret);
-
- ret = ewk_view_back_possible(wd->resize_obj);
-#else
- (void)obj;
-#endif
-
- return ret;
-}
-
-EOLIAN static Eina_Bool
-_elm_web_forward_possible_get(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED)
-{
- Eina_Bool ret;
- ret = EINA_FALSE;
-
-#ifdef HAVE_ELEMENTARY_WEB
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, ret);
-
- ret = ewk_view_forward_possible(wd->resize_obj);
-#else
- (void)obj;
-#endif
-
- return ret;
-}
-
-EOLIAN static Eina_Bool
-_elm_web_navigate_possible_get(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED, int steps)
-{
- Eina_Bool ret;
- ret = EINA_FALSE;
-
-#ifdef HAVE_ELEMENTARY_WEB
- Ewk_Back_Forward_List *history;
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, ret);
-
- history = ewk_view_back_forward_list_get(wd->resize_obj);
- if (history && ewk_back_forward_list_item_at_index_get(history, steps))
- ret = EINA_TRUE;
-#else
- (void)steps;
- (void)obj;
-#endif
-
- return ret;
-}
-
-EOLIAN static Eina_Bool
-_elm_web_history_enabled_get(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED)
-{
- Eina_Bool ret;
- ret = EINA_FALSE;
-
-#ifdef HAVE_ELEMENTARY_WEB
- (void)obj;
-#else
- (void)obj;
-#endif
-
- return ret;
-}
-
-EOLIAN static void
-_elm_web_history_enabled_set(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED, Eina_Bool enable)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- (void)enable;
- (void)obj;
-#else
- (void)enable;
- (void)obj;
-#endif
-}
-
-EOLIAN static void
-_elm_web_zoom_set(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED, double zoom)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
-
- ewk_view_page_zoom_set(wd->resize_obj, zoom);
-#else
- (void)obj;
- (void)zoom;
-#endif
-}
-
-EOLIAN static double
-_elm_web_zoom_get(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, -1);
-
- return ewk_view_page_zoom_get(wd->resize_obj);
-#else
- (void)obj;
- return -1;
-#endif
-}
-
-EOLIAN static void
-_elm_web_zoom_mode_set(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED, Elm_Web_Zoom_Mode mode)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- (void)obj;
- (void)_pd;
- (void)mode;
-#else
- (void)obj;
- (void)_pd;
- (void)mode;
-#endif
-}
-
-EOLIAN static Elm_Web_Zoom_Mode
-_elm_web_zoom_mode_get(Eo *obj EINA_UNUSED, Elm_Web_Data *_pd EINA_UNUSED)
-{
- Elm_Web_Zoom_Mode ret;
- ret = ELM_WEB_ZOOM_MODE_LAST;
-#ifdef HAVE_ELEMENTARY_WEB
- (void)_pd;
-#else
- (void)_pd;
-#endif
-
- return ret;
-}
-
-EOLIAN static void
-_elm_web_region_show(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED, int x, int y, int w, int h)
-{
- (void)w;
- (void)h;
-
-#ifdef HAVE_ELEMENTARY_WEB
- (void)obj;
- (void)_pd;
- (void)x;
- (void)y;
-#else
- (void)obj;
- (void)_pd;
- (void)x;
- (void)y;
-#endif
-}
-
-EOLIAN static void
-_elm_web_region_bring_in(Eo *obj, Elm_Web_Data *_pd EINA_UNUSED, int x, int y, int w, int h)
-{
- (void)w;
- (void)h;
-
-#ifdef HAVE_ELEMENTARY_WEB
- (void)obj;
- (void)_pd;
- (void)x;
- (void)y;
-#else
- (void)obj;
- (void)_pd;
- (void)x;
- (void)y;
-#endif
-}
-
-EOLIAN static void
-_elm_web_inwin_mode_set(Eo *obj EINA_UNUSED, Elm_Web_Data *sd, Eina_Bool value)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- sd->inwin_mode = value;
-#else
- (void)sd;
- (void)value;
-#endif
-}
-
-EOLIAN static Eina_Bool
-_elm_web_inwin_mode_get(Eo *obj EINA_UNUSED, Elm_Web_Data *sd)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- return sd->inwin_mode;
-#else
- (void)sd;
- return EINA_FALSE;
-#endif
-}
-
-EAPI void
-elm_web_window_features_ref(Elm_Web_Window_Features *wf)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- ewk_object_ref((Ewk_Object *)wf);
-#else
- (void)wf;
-#endif
-}
-
-EAPI void
-elm_web_window_features_unref(Elm_Web_Window_Features *wf)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- ewk_object_unref((Ewk_Object *)wf);
-#else
- (void)wf;
-#endif
-}
-
-EAPI Eina_Bool
-elm_web_window_features_property_get(const Elm_Web_Window_Features *wf,
- Elm_Web_Window_Feature_Flag flag)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- const Ewk_Window_Features *ewf = (const Ewk_Window_Features *)wf;
- switch (flag)
- {
- case ELM_WEB_WINDOW_FEATURE_TOOLBAR:
- return ewk_window_features_toolbar_visible_get(ewf);
-
- case ELM_WEB_WINDOW_FEATURE_STATUSBAR:
- return ewk_window_features_statusbar_visible_get(ewf);
-
- case ELM_WEB_WINDOW_FEATURE_SCROLLBARS:
- return ewk_window_features_scrollbars_visible_get(ewf);
-
- case ELM_WEB_WINDOW_FEATURE_MENUBAR:
- return ewk_window_features_menubar_visible_get(ewf);
-
- case ELM_WEB_WINDOW_FEATURE_LOCATIONBAR:
- return ewk_window_features_locationbar_visible_get(ewf);
-
- case ELM_WEB_WINDOW_FEATURE_FULLSCREEN:
- return ewk_window_features_fullscreen_get(ewf);
- }
-#else
- (void)wf;
- (void)flag;
-#endif
-
- return EINA_FALSE;
-}
-
-EAPI void
-elm_web_window_features_region_get(const Elm_Web_Window_Features *wf,
- Evas_Coord *x,
- Evas_Coord *y,
- Evas_Coord *w,
- Evas_Coord *h)
-{
-#ifdef HAVE_ELEMENTARY_WEB
- ewk_window_features_geometry_get
- ((const Ewk_Window_Features *)wf, x, y, w, h);
-#else
- (void)wf;
- (void)x;
- (void)y;
- (void)w;
- (void)h;
-#endif
-}
-
-static void
-_elm_web_class_constructor(Eo_Class *klass)
-{
- evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
+ // Only the class_get is mandatory
+ if (!ewm.class_get) return EINA_FALSE;
+ return EINA_TRUE;
}
#include "elm_web.eo.c"
#ifndef ELM_WIDGET_WEB_H
#define ELM_WIDGET_WEB_H
-#ifdef HAVE_ELEMENTARY_WEB
-#include <EWebKit2.h>
-#endif
-
/* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR
* CODE. THIS IS ELEMENTARY'S INTERNAL WIDGET API (for now) AND IS NOT
* FINAL. CALL elm_widget_api_check(ELM_INTERNAL_API_VERSION) TO CHECK
struct _Elm_Web_Data
{
Evas_Object *obj;
-#ifdef HAVE_ELEMENTARY_WEB
- struct
- {
- Elm_Web_Window_Open window_create;
- void *window_create_data;
- Elm_Web_Dialog_Alert alert;
- void *alert_data;
- Elm_Web_Dialog_Confirm confirm;
- void *confirm_data;
- Elm_Web_Dialog_Prompt prompt;
- void *prompt_data;
- Elm_Web_Dialog_File_Selector file_selector;
- void *file_selector_data;
- Elm_Web_Console_Message console_message;
- void *console_message_data;
- } hook;
-
- Elm_Win_Keyboard_Mode input_method;
-
- struct
- {
- Elm_Web_Zoom_Mode mode;
- float current;
- float min, max;
- Eina_Bool no_anim;
- Ecore_Timer *timer;
- } zoom;
-
- struct
- {
- struct
- {
- int x, y;
- } start, end;
- Ecore_Animator *animator;
- } bring_in;
-
- Eina_Bool tab_propagate : 1;
- Eina_Bool inwin_mode : 1;
-#endif
-};
-
-enum Dialog_Type
-{
- DIALOG_ALERT,
- DIALOG_CONFIRM,
- DIALOG_PROMPT,
- DIALOG_FILE_SELECTOR
-};
-
-typedef struct _Dialog_Data Dialog_Data;
-struct _Dialog_Data
-{
- enum Dialog_Type type;
-
- Evas_Object *dialog;
- Evas_Object *box;
- Evas_Object *bt_ok, *bt_cancel;
- Evas_Object *entry;
- Evas_Object *file_sel;
-
- Eina_Bool *response;
- const char **entry_value;
- Eina_List **selected_files;
};
struct _Elm_Web_Callback_Proxy_Context
};
typedef struct _Elm_Web_Callback_Proxy_Context Elm_Web_Callback_Proxy_Context;
-#ifdef HAVE_ELEMENTARY_WEB
-
-typedef struct _View_Smart_Data View_Smart_Data;
-struct _View_Smart_Data
-{
- Ewk_View_Smart_Data base;
- struct
- {
- Evas_Event_Mouse_Down event;
- Evas_Coord x, y;
- unsigned int move_count;
- Ecore_Timer *longpress_timer;
- Ecore_Animator *pan_anim;
- } mouse;
-};
-
-#endif
-
/**
* @}
*/
test_entry \
test_map \
access_output \
-datetime_input_ctxpopup
+datetime_input_ctxpopup \
+web
--- /dev/null
+AUTOMAKE_OPTIONS = 1.4 foreign
+MAINTAINERCLEANFILES = Makefile.in
+
+SUBDIRS = \
+none \
+webkit2
--- /dev/null
+AUTOMAKE_OPTIONS = 1.4 foreign
+MAINTAINERCLEANFILES = Makefile.in
+
+CLEANFILES =
+
+EOLIAN_FLAGS = @DEPS_EOLIAN_FLAGS@ \
+ -I$(top_srcdir)/src/lib
+
+include $(top_srcdir)/Makefile_Eolian_Helper.am
+
+AM_CPPFLAGS = \
+-DELM_INTERNAL_API_ARGESFSDFEFC=1 \
+-DMODULES_PATH=\"$(pkglibdir)/modules\" \
+-I. \
+-I$(top_builddir) \
+-I$(top_srcdir) \
+-I$(top_srcdir)/src/imported \
+-I$(top_srcdir)/src/lib \
+-I$(top_builddir)/src/lib \
+-DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" \
+-DLOCALE_DIR=\"$(localedir)\" \
+-DPACKAGE_LIB_DIR=\"$(libdir)\" \
+-DICON_DIR=\"$(datadir)/icons\" \
+-DELM_TOP_BUILD_DIR=\"$(top_builddir)\" \
+-DELEMENTARY_BUILD \
+@ELEMENTARY_CFLAGS@
+
+pkgdir = $(pkglibdir)/modules/web/none/$(MODULE_ARCH)
+pkg_LTLIBRARIES = module.la
+
+BUILT_SOURCES = elm_web_none.eo.h elm_web_none.eo.c
+
+module_la_SOURCES = elm_web_none.c elm_web_none.eo.h
+module_la_LIBADD = @ELEMENTARY_LIBS@ $(top_builddir)/src/lib/libelementary.la
+module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@
+module_la_LIBTOOLFLAGS = --tag=disable-static
+
+EXTRA_DIST = elm_web_none.eo
+
+
--- /dev/null
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
+
+#include <Elementary.h>
+
+#include "elm_priv.h"
+#include "elm_widget_web.h"
+#include "elm_web_none.eo.h"
+
+#define MY_CLASS ELM_WEB_CLASS
+
+#define MY_CLASS_NAME "Elm_Web_None"
+
+typedef struct _Elm_Web_None_Data Elm_Web_None_Data;
+struct _Elm_Web_None_Data
+{
+};
+
+EOLIAN static Eina_Bool
+_elm_web_none_elm_web_tab_propagate_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *sd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static void
+_elm_web_none_elm_web_tab_propagate_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data *sd EINA_UNUSED, Eina_Bool propagate EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_elm_web_none_evas_object_smart_add(Eo *obj, Elm_Web_None_Data *_pd EINA_UNUSED)
+{
+ Evas_Object *resize_obj;
+
+ resize_obj = elm_label_add(obj);
+ elm_object_text_set(resize_obj, "WebKit not supported!");
+ elm_widget_resize_object_set(obj, resize_obj, EINA_TRUE);
+
+ evas_obj_smart_add(eo_super(obj, MY_CLASS));
+ elm_widget_sub_object_parent_add(obj);
+}
+
+EOLIAN static Evas_Object*
+_elm_web_none_elm_web_webkit_view_get(Eo *obj, Elm_Web_None_Data *_pd EINA_UNUSED)
+{
+ (void)obj;
+ ERR("Elementary not compiled with EWebKit support.");
+ return NULL;
+}
+
+EOLIAN static void
+_elm_web_none_elm_web_window_create_hook_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data *sd EINA_UNUSED, Elm_Web_Window_Open func EINA_UNUSED, void *data EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_elm_web_none_elm_web_dialog_alert_hook_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data *sd EINA_UNUSED, Elm_Web_Dialog_Alert func EINA_UNUSED, void *data EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_elm_web_none_elm_web_dialog_confirm_hook_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data *sd EINA_UNUSED, Elm_Web_Dialog_Confirm func EINA_UNUSED, void *data EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_elm_web_none_elm_web_dialog_prompt_hook_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data *sd EINA_UNUSED, Elm_Web_Dialog_Prompt func EINA_UNUSED, void *data EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_elm_web_none_elm_web_dialog_file_selector_hook_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED, Elm_Web_Dialog_File_Selector func EINA_UNUSED, void *data EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_elm_web_none_elm_web_console_message_hook_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED, Elm_Web_Console_Message func EINA_UNUSED, void *data EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_elm_web_none_elm_web_useragent_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED, const char *user_agent EINA_UNUSED)
+{
+}
+
+EOLIAN static const char*
+_elm_web_none_elm_web_useragent_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+{
+ return NULL;
+}
+
+EOLIAN static Eina_Bool
+_elm_web_none_elm_web_url_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED, const char *url EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static const char*
+_elm_web_none_elm_web_url_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+{
+ return NULL;
+}
+
+EOLIAN static Eina_Bool
+_elm_web_none_elm_web_html_string_load(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED, const char *html EINA_UNUSED, const char *base_url EINA_UNUSED, const char *unreachable_url EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static const char*
+_elm_web_none_elm_web_title_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+{
+ return NULL;
+}
+
+EOLIAN static void
+_elm_web_none_elm_web_bg_color_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED, int r EINA_UNUSED, int g EINA_UNUSED, int b EINA_UNUSED, int a EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_elm_web_none_elm_web_bg_color_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED, int *r, int *g, int *b, int *a)
+{
+ if (r) *r = 0;
+ if (g) *g = 0;
+ if (b) *b = 0;
+ if (a) *a = 0;
+}
+
+EOLIAN static const char*
+_elm_web_none_elm_web_selection_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+{
+ return NULL;
+}
+
+EOLIAN static void
+_elm_web_none_elm_web_popup_selected_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED, int idx EINA_UNUSED)
+{
+}
+
+EOLIAN static Eina_Bool
+_elm_web_none_elm_web_popup_destroy(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_elm_web_none_elm_web_text_search(const Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED, const char *string EINA_UNUSED, Eina_Bool case_sensitive EINA_UNUSED, Eina_Bool forward EINA_UNUSED, Eina_Bool wrap EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static unsigned int
+_elm_web_none_elm_web_text_matches_mark(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED, const char *string EINA_UNUSED, Eina_Bool case_sensitive EINA_UNUSED, Eina_Bool highlight EINA_UNUSED, unsigned int limit EINA_UNUSED)
+{
+ return 0;
+}
+
+EOLIAN static Eina_Bool
+_elm_web_none_elm_web_text_matches_unmark_all(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_elm_web_none_elm_web_text_matches_highlight_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED, Eina_Bool highlight EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_elm_web_none_elm_web_text_matches_highlight_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static double
+_elm_web_none_elm_web_load_progress_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+{
+ return -1.0;
+}
+
+EOLIAN static Eina_Bool
+_elm_web_none_elm_web_stop(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_elm_web_none_elm_web_reload(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_elm_web_none_elm_web_reload_full(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_elm_web_none_elm_web_back(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_elm_web_none_elm_web_forward(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_elm_web_none_elm_web_navigate(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED, int steps EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_elm_web_none_elm_web_back_possible_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_elm_web_none_elm_web_forward_possible_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_elm_web_none_elm_web_navigate_possible_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED, int steps EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_elm_web_none_elm_web_history_enabled_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static void
+_elm_web_none_elm_web_history_enabled_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED, Eina_Bool enable EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_elm_web_none_elm_web_zoom_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED, double zoom EINA_UNUSED)
+{
+}
+
+EOLIAN static double
+_elm_web_none_elm_web_zoom_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+{
+ return -1;
+}
+
+EOLIAN static void
+_elm_web_none_elm_web_zoom_mode_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED, Elm_Web_Zoom_Mode mode EINA_UNUSED)
+{
+}
+
+EOLIAN static Elm_Web_Zoom_Mode
+_elm_web_none_elm_web_zoom_mode_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED)
+{
+ return ELM_WEB_ZOOM_MODE_LAST;
+}
+
+EOLIAN static void
+_elm_web_none_elm_web_region_show(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_elm_web_none_elm_web_region_bring_in(Eo *obj EINA_UNUSED, Elm_Web_None_Data *_pd EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_elm_web_none_elm_web_inwin_mode_set(Eo *obj EINA_UNUSED, Elm_Web_None_Data *sd EINA_UNUSED, Eina_Bool value EINA_UNUSED)
+{
+}
+
+EOLIAN static Eina_Bool
+_elm_web_none_elm_web_inwin_mode_get(Eo *obj EINA_UNUSED, Elm_Web_None_Data *sd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EAPI void
+ewm_window_features_ref(Elm_Web_Window_Features *wf EINA_UNUSED)
+{
+}
+
+EAPI void
+ewm_window_features_unref(Elm_Web_Window_Features *wf EINA_UNUSED)
+{
+}
+
+EAPI Eina_Bool
+ewm_window_features_property_get(const Elm_Web_Window_Features *wf EINA_UNUSED,
+ Elm_Web_Window_Feature_Flag flag EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EAPI void
+ewm_window_features_region_get(const Elm_Web_Window_Features *wf EINA_UNUSED,
+ Evas_Coord *x,
+ Evas_Coord *y,
+ Evas_Coord *w,
+ Evas_Coord *h)
+{
+ if (x) *x = 0;
+ if (y) *y = 0;
+ if (w) *w = 0;
+ if (h) *h = 0;
+}
+
+EAPI void
+ewm_unneed_web(void)
+{
+}
+
+EAPI Eina_Bool
+ewm_need_web(void)
+{
+ return EINA_TRUE;
+}
+
+EAPI const Eo_Class *
+ewm_class_get(void)
+{
+ return elm_web_none_class_get();
+}
+
+#include "elm_web_none.eo.c"
--- /dev/null
+class Elm.Web.None (Elm.Web)
+{
+ implements {
+ Evas.Object_Smart.add;
+ Elm.Widget.theme_apply;
+ Elm.Widget.on_focus;
+ Elm.Widget.event;
+ Elm.Web.tab_propagate.get;
+ Elm.Web.tab_propagate.set;
+ Elm.Web.webkit_view.get;
+ Elm.Web.window_create_hook.set;
+ Elm.Web.dialog_alert_hook.set;
+ Elm.Web.dialog_confirm_hook.set;
+ Elm.Web.dialog_prompt_hook.set;
+ Elm.Web.dialog_file_selector_hook.set;
+ Elm.Web.console_message_hook.set;
+ Elm.Web.useragent.set;
+ Elm.Web.useragent.get;
+ Elm.Web.url.set;
+ Elm.Web.url.get;
+ Elm.Web.html_string_load;
+ Elm.Web.title.get;
+ Elm.Web.bg_color.set;
+ Elm.Web.bg_color.get;
+ Elm.Web.selection.get;
+ Elm.Web.popup_selected.set;
+ Elm.Web.popup_destroy;
+ Elm.Web.text_search;
+ Elm.Web.text_matches_mark;
+ Elm.Web.text_matches_unmark_all;
+ Elm.Web.text_matches_highlight.set;
+ Elm.Web.text_matches_highlight.get;
+ Elm.Web.load_progress.get;
+ Elm.Web.stop;
+ Elm.Web.reload;
+ Elm.Web.reload_full;
+ Elm.Web.back;
+ Elm.Web.forward;
+ Elm.Web.navigate;
+ Elm.Web.back_possible.get;
+ Elm.Web.forward_possible.get;
+ Elm.Web.navigate_possible_get;
+ Elm.Web.history_enabled.get;
+ Elm.Web.history_enabled.set;
+ Elm.Web.zoom.set;
+ Elm.Web.zoom.get;
+ Elm.Web.zoom_mode.set;
+ Elm.Web.zoom_mode.get;
+ Elm.Web.region_show;
+ Elm.Web.region_bring_in;
+ Elm.Web.inwin_mode.set;
+ Elm.Web.inwin_mode.get;
+ }
+}
--- /dev/null
+
+void _elm_web_none_evas_object_smart_add(Eo *obj, Elm_Web_None_Data *pd);
+
+
+Eina_Bool _elm_web_none_elm_widget_theme_apply(Eo *obj, Elm_Web_None_Data *pd);
+
+
+Eina_Bool _elm_web_none_elm_widget_on_focus(Eo *obj, Elm_Web_None_Data *pd, Elm_Widget_Item *item);
+
+
+Eina_Bool _elm_web_none_elm_widget_event(Eo *obj, Elm_Web_None_Data *pd, Evas_Object *source, Evas_Callback_Type type, void *event_info);
+
+
+Eina_Bool _elm_web_none_elm_web_tab_propagate_get(Eo *obj, Elm_Web_None_Data *pd);
+
+
+void _elm_web_none_elm_web_tab_propagate_set(Eo *obj, Elm_Web_None_Data *pd, Eina_Bool propagate);
+
+
+Evas_Object * _elm_web_none_elm_web_webkit_view_get(Eo *obj, Elm_Web_None_Data *pd);
+
+
+void _elm_web_none_elm_web_window_create_hook_set(Eo *obj, Elm_Web_None_Data *pd, Elm_Web_Window_Open func, void *data);
+
+
+void _elm_web_none_elm_web_dialog_alert_hook_set(Eo *obj, Elm_Web_None_Data *pd, Elm_Web_Dialog_Alert func, void *data);
+
+
+void _elm_web_none_elm_web_dialog_confirm_hook_set(Eo *obj, Elm_Web_None_Data *pd, Elm_Web_Dialog_Confirm func, void *data);
+
+
+void _elm_web_none_elm_web_dialog_prompt_hook_set(Eo *obj, Elm_Web_None_Data *pd, Elm_Web_Dialog_Prompt func, void *data);
+
+
+void _elm_web_none_elm_web_dialog_file_selector_hook_set(Eo *obj, Elm_Web_None_Data *pd, Elm_Web_Dialog_File_Selector func, void *data);
+
+
+void _elm_web_none_elm_web_console_message_hook_set(Eo *obj, Elm_Web_None_Data *pd, Elm_Web_Console_Message func, void *data);
+
+
+void _elm_web_none_elm_web_useragent_set(Eo *obj, Elm_Web_None_Data *pd, const char *user_agent);
+
+
+const char * _elm_web_none_elm_web_useragent_get(Eo *obj, Elm_Web_None_Data *pd);
+
+
+Eina_Bool _elm_web_none_elm_web_url_set(Eo *obj, Elm_Web_None_Data *pd, const char *url);
+
+
+const char * _elm_web_none_elm_web_url_get(Eo *obj, Elm_Web_None_Data *pd);
+
+
+Eina_Bool _elm_web_none_elm_web_html_string_load(Eo *obj, Elm_Web_None_Data *pd, const char *html, const char *base_url, const char *unreachable_url);
+
+
+const char * _elm_web_none_elm_web_title_get(Eo *obj, Elm_Web_None_Data *pd);
+
+
+void _elm_web_none_elm_web_bg_color_set(Eo *obj, Elm_Web_None_Data *pd, int r, int g, int b, int a);
+
+
+void _elm_web_none_elm_web_bg_color_get(Eo *obj, Elm_Web_None_Data *pd, int *r, int *g, int *b, int *a);
+
+
+const char * _elm_web_none_elm_web_selection_get(Eo *obj, Elm_Web_None_Data *pd);
+
+
+void _elm_web_none_elm_web_popup_selected_set(Eo *obj, Elm_Web_None_Data *pd, int idx);
+
+
+Eina_Bool _elm_web_none_elm_web_popup_destroy(Eo *obj, Elm_Web_None_Data *pd);
+
+
+Eina_Bool _elm_web_none_elm_web_text_search(const Eo *obj, Elm_Web_None_Data *pd, const char *string, Eina_Bool case_sensitive, Eina_Bool forward, Eina_Bool wrap);
+
+
+unsigned int _elm_web_none_elm_web_text_matches_mark(Eo *obj, Elm_Web_None_Data *pd, const char *string, Eina_Bool case_sensitive, Eina_Bool highlight, unsigned int limit);
+
+
+Eina_Bool _elm_web_none_elm_web_text_matches_unmark_all(Eo *obj, Elm_Web_None_Data *pd);
+
+
+Eina_Bool _elm_web_none_elm_web_text_matches_highlight_set(Eo *obj, Elm_Web_None_Data *pd, Eina_Bool highlight);
+
+
+Eina_Bool _elm_web_none_elm_web_text_matches_highlight_get(Eo *obj, Elm_Web_None_Data *pd);
+
+
+double _elm_web_none_elm_web_load_progress_get(Eo *obj, Elm_Web_None_Data *pd);
+
+
+Eina_Bool _elm_web_none_elm_web_stop(Eo *obj, Elm_Web_None_Data *pd);
+
+
+Eina_Bool _elm_web_none_elm_web_reload(Eo *obj, Elm_Web_None_Data *pd);
+
+
+Eina_Bool _elm_web_none_elm_web_reload_full(Eo *obj, Elm_Web_None_Data *pd);
+
+
+Eina_Bool _elm_web_none_elm_web_back(Eo *obj, Elm_Web_None_Data *pd);
+
+
+Eina_Bool _elm_web_none_elm_web_forward(Eo *obj, Elm_Web_None_Data *pd);
+
+
+Eina_Bool _elm_web_none_elm_web_navigate(Eo *obj, Elm_Web_None_Data *pd, int steps);
+
+
+Eina_Bool _elm_web_none_elm_web_back_possible_get(Eo *obj, Elm_Web_None_Data *pd);
+
+
+Eina_Bool _elm_web_none_elm_web_forward_possible_get(Eo *obj, Elm_Web_None_Data *pd);
+
+
+Eina_Bool _elm_web_none_elm_web_navigate_possible_get(Eo *obj, Elm_Web_None_Data *pd, int steps);
+
+
+Eina_Bool _elm_web_none_elm_web_history_enabled_get(Eo *obj, Elm_Web_None_Data *pd);
+
+
+void _elm_web_none_elm_web_history_enabled_set(Eo *obj, Elm_Web_None_Data *pd, Eina_Bool enable);
+
+
+void _elm_web_none_elm_web_zoom_set(Eo *obj, Elm_Web_None_Data *pd, double zoom);
+
+
+double _elm_web_none_elm_web_zoom_get(Eo *obj, Elm_Web_None_Data *pd);
+
+
+void _elm_web_none_elm_web_zoom_mode_set(Eo *obj, Elm_Web_None_Data *pd, Elm_Web_Zoom_Mode mode);
+
+
+Elm_Web_Zoom_Mode _elm_web_none_elm_web_zoom_mode_get(Eo *obj, Elm_Web_None_Data *pd);
+
+
+void _elm_web_none_elm_web_region_show(Eo *obj, Elm_Web_None_Data *pd, int x, int y, int w, int h);
+
+
+void _elm_web_none_elm_web_region_bring_in(Eo *obj, Elm_Web_None_Data *pd, int x, int y, int w, int h);
+
+
+void _elm_web_none_elm_web_inwin_mode_set(Eo *obj, Elm_Web_None_Data *pd, Eina_Bool value);
+
+
+Eina_Bool _elm_web_none_elm_web_inwin_mode_get(Eo *obj, Elm_Web_None_Data *pd);
+
+
+static const Eo_Op_Description _elm_web_none_op_desc[] = {
+ EO_OP_FUNC_OVERRIDE(evas_obj_smart_add, _elm_web_none_evas_object_smart_add),
+ EO_OP_FUNC_OVERRIDE(elm_obj_widget_theme_apply, _elm_web_none_elm_widget_theme_apply),
+ EO_OP_FUNC_OVERRIDE(elm_obj_widget_on_focus, _elm_web_none_elm_widget_on_focus),
+ EO_OP_FUNC_OVERRIDE(elm_obj_widget_event, _elm_web_none_elm_widget_event),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_tab_propagate_get, _elm_web_none_elm_web_tab_propagate_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_tab_propagate_set, _elm_web_none_elm_web_tab_propagate_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_webkit_view_get, _elm_web_none_elm_web_webkit_view_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_window_create_hook_set, _elm_web_none_elm_web_window_create_hook_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_dialog_alert_hook_set, _elm_web_none_elm_web_dialog_alert_hook_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_dialog_confirm_hook_set, _elm_web_none_elm_web_dialog_confirm_hook_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_dialog_prompt_hook_set, _elm_web_none_elm_web_dialog_prompt_hook_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_dialog_file_selector_hook_set, _elm_web_none_elm_web_dialog_file_selector_hook_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_console_message_hook_set, _elm_web_none_elm_web_console_message_hook_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_useragent_set, _elm_web_none_elm_web_useragent_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_useragent_get, _elm_web_none_elm_web_useragent_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_url_set, _elm_web_none_elm_web_url_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_url_get, _elm_web_none_elm_web_url_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_html_string_load, _elm_web_none_elm_web_html_string_load),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_title_get, _elm_web_none_elm_web_title_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_bg_color_set, _elm_web_none_elm_web_bg_color_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_bg_color_get, _elm_web_none_elm_web_bg_color_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_selection_get, _elm_web_none_elm_web_selection_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_popup_selected_set, _elm_web_none_elm_web_popup_selected_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_popup_destroy, _elm_web_none_elm_web_popup_destroy),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_text_search, _elm_web_none_elm_web_text_search),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_text_matches_mark, _elm_web_none_elm_web_text_matches_mark),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_text_matches_unmark_all, _elm_web_none_elm_web_text_matches_unmark_all),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_text_matches_highlight_set, _elm_web_none_elm_web_text_matches_highlight_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_text_matches_highlight_get, _elm_web_none_elm_web_text_matches_highlight_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_load_progress_get, _elm_web_none_elm_web_load_progress_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_stop, _elm_web_none_elm_web_stop),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_reload, _elm_web_none_elm_web_reload),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_reload_full, _elm_web_none_elm_web_reload_full),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_back, _elm_web_none_elm_web_back),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_forward, _elm_web_none_elm_web_forward),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_navigate, _elm_web_none_elm_web_navigate),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_back_possible_get, _elm_web_none_elm_web_back_possible_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_forward_possible_get, _elm_web_none_elm_web_forward_possible_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_navigate_possible_get, _elm_web_none_elm_web_navigate_possible_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_history_enabled_get, _elm_web_none_elm_web_history_enabled_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_history_enabled_set, _elm_web_none_elm_web_history_enabled_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_zoom_set, _elm_web_none_elm_web_zoom_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_zoom_get, _elm_web_none_elm_web_zoom_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_zoom_mode_set, _elm_web_none_elm_web_zoom_mode_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_zoom_mode_get, _elm_web_none_elm_web_zoom_mode_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_region_show, _elm_web_none_elm_web_region_show),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_region_bring_in, _elm_web_none_elm_web_region_bring_in),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_inwin_mode_set, _elm_web_none_elm_web_inwin_mode_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_inwin_mode_get, _elm_web_none_elm_web_inwin_mode_get),
+};
+
+static const Eo_Class_Description _elm_web_none_class_desc = {
+ EO_VERSION,
+ "Elm_Web_None",
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(_elm_web_none_op_desc),
+ NULL,
+ sizeof(Elm_Web_None_Data),
+ NULL,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_web_none_class_get, &_elm_web_none_class_desc, ELM_WEB_CLASS, NULL);
\ No newline at end of file
--- /dev/null
+#ifndef _ELM_WEB_NONE_EO_H_
+#define _ELM_WEB_NONE_EO_H_
+
+#ifndef _ELM_WEB_NONE_EO_CLASS_TYPE
+#define _ELM_WEB_NONE_EO_CLASS_TYPE
+
+typedef Eo Elm_Web_None;
+
+#endif
+
+#ifndef _ELM_WEB_NONE_EO_TYPES
+#define _ELM_WEB_NONE_EO_TYPES
+
+
+#endif
+#define ELM_WEB_NONE_CLASS elm_web_none_class_get()
+
+EAPI const Eo_Class *elm_web_none_class_get(void);
+
+
+#endif
--- /dev/null
+AUTOMAKE_OPTIONS = 1.4 foreign
+MAINTAINERCLEANFILES = Makefile.in
+
+CLEANFILES =
+
+EOLIAN_FLAGS = @DEPS_EOLIAN_FLAGS@ \
+ -I$(top_srcdir)/src/lib
+
+include $(top_srcdir)/Makefile_Eolian_Helper.am
+
+AM_CPPFLAGS = \
+-DELM_INTERNAL_API_ARGESFSDFEFC=1 \
+-DMODULES_PATH=\"$(pkglibdir)/modules\" \
+-I. \
+-I$(top_builddir) \
+-I$(top_srcdir) \
+-I$(top_srcdir)/src/imported \
+-I$(top_srcdir)/src/lib \
+-I$(top_builddir)/src/lib \
+-DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" \
+-DLOCALE_DIR=\"$(localedir)\" \
+-DPACKAGE_LIB_DIR=\"$(libdir)\" \
+-DICON_DIR=\"$(datadir)/icons\" \
+-DELM_TOP_BUILD_DIR=\"$(top_builddir)\" \
+-DELEMENTARY_BUILD \
+@ELEMENTARY_CFLAGS@ \
+@EWEBKIT2_CFLAGS@
+
+if HAVE_EWEBKIT2
+pkgdir = $(pkglibdir)/modules/web/webkit2/$(MODULE_ARCH)
+pkg_LTLIBRARIES = module.la
+
+BUILT_SOURCES = elm_web_webkit2.eo.h elm_web_webkit2.eo.c
+
+module_la_SOURCES = elm_web_webkit2.c elm_web_webkit2.eo.h
+module_la_LIBADD = @ELEMENTARY_LIBS@ $(top_builddir)/src/lib/libelementary.la @EWEBKIT2_LIBS@
+module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@
+module_la_LIBTOOLFLAGS = --tag=disable-static
+endif
+
+EXTRA_DIST = elm_web_webkit2.eo
+
--- /dev/null
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
+
+#include <Elementary.h>
+
+#include "elm_priv.h"
+#include "elm_widget_web.h"
+#include "elm_web_webkit2.eo.h"
+
+#include <EWebKit2.h>
+
+#define MY_CLASS ELM_WEB_WEBKIT2_CLASS
+
+#define MY_CLASS_NAME "Elm_Web_Webkit2"
+
+#define ELM_WEB_WEBKIT2_DATA_GET(o, sd) \
+ Elm_Web_Webkit2_Data * sd = eo_data_scope_get(o, ELM_WEB_WEBKIT2_CLASS)
+
+#define ELM_WEB_WEBKIT2_DATA_GET_OR_RETURN(o, ptr) \
+ ELM_WEB_WEBKIT2_DATA_GET(o, ptr); \
+ if (EINA_UNLIKELY(!ptr)) \
+ { \
+ CRI("No widget data for object %p (%s)", \
+ o, evas_object_type_get(o)); \
+ return; \
+ }
+
+#define ELM_WEB_WEBKIT2_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
+ ELM_WEB_WEBKIT2_DATA_GET(o, ptr); \
+ if (EINA_UNLIKELY(!ptr)) \
+ { \
+ CRI("No widget data for object %p (%s)", \
+ o, evas_object_type_get(o)); \
+ return val; \
+ }
+
+#define ELM_WEB_WEBKIT2_CHECK(obj) \
+ if (EINA_UNLIKELY(!eo_isa((obj), ELM_WEB_WEBKIT2_CLASS))) \
+ return
+
+typedef struct _Elm_Web_Webkit2_Data Elm_Web_Webkit2_Data;
+struct _Elm_Web_Webkit2_Data
+{
+ struct
+ {
+ Elm_Web_Window_Open window_create;
+ void *window_create_data;
+ Elm_Web_Dialog_Alert alert;
+ void *alert_data;
+ Elm_Web_Dialog_Confirm confirm;
+ void *confirm_data;
+ Elm_Web_Dialog_Prompt prompt;
+ void *prompt_data;
+ Elm_Web_Dialog_File_Selector file_selector;
+ void *file_selector_data;
+ Elm_Web_Console_Message console_message;
+ void *console_message_data;
+ } hook;
+
+ Elm_Win_Keyboard_Mode input_method;
+
+ struct
+ {
+ Elm_Web_Zoom_Mode mode;
+ float current;
+ float min, max;
+ Eina_Bool no_anim;
+ Ecore_Timer *timer;
+ } zoom;
+
+ struct
+ {
+ struct
+ {
+ int x, y;
+ } start, end;
+ Ecore_Animator *animator;
+ } bring_in;
+
+ Eina_Bool tab_propagate : 1;
+ Eina_Bool inwin_mode : 1;
+};
+
+typedef struct _View_Smart_Data View_Smart_Data;
+struct _View_Smart_Data
+{
+ Ewk_View_Smart_Data base;
+ struct
+ {
+ Evas_Event_Mouse_Down event;
+ Evas_Coord x, y;
+ unsigned int move_count;
+ Ecore_Timer *longpress_timer;
+ Ecore_Animator *pan_anim;
+ } mouse;
+};
+
+enum Dialog_Type
+{
+ DIALOG_ALERT,
+ DIALOG_CONFIRM,
+ DIALOG_PROMPT,
+ DIALOG_FILE_SELECTOR
+};
+
+typedef struct _Dialog_Data Dialog_Data;
+struct _Dialog_Data
+{
+ enum Dialog_Type type;
+
+ Evas_Object *dialog;
+ Evas_Object *box;
+ Evas_Object *bt_ok, *bt_cancel;
+ Evas_Object *entry;
+ Evas_Object *file_sel;
+
+ Eina_Bool *response;
+ const char **entry_value;
+ Eina_List **selected_files;
+};
+
+static Ewk_View_Smart_Class _ewk_view_parent_sc =
+ EWK_VIEW_SMART_CLASS_INIT_NULL;
+
+static int _webkit2_log_dom = -1;
+
+#define CRI(...) EINA_LOG_DOM_CRIT(_webkit2_log_dom, __VA_ARGS__)
+#define ERR(...) EINA_LOG_DOM_ERR(_webkit2_log_dom, __VA_ARGS__)
+#define WRN(...) EINA_LOG_DOM_WARN(_webkit2_log_dom, __VA_ARGS__)
+#define INF(...) EINA_LOG_DOM_INFO(_webkit2_log_dom, __VA_ARGS__)
+#define DBG(...) EINA_LOG_DOM_DBG(_webkit2_log_dom, __VA_ARGS__)
+
+static void
+_view_smart_add(Evas_Object *obj)
+{
+ View_Smart_Data *sd;
+
+ sd = calloc(1, sizeof(View_Smart_Data));
+ evas_object_smart_data_set(obj, sd);
+
+ _ewk_view_parent_sc.sc.add(obj);
+}
+
+static void
+_view_smart_del(Evas_Object *obj)
+{
+ _ewk_view_parent_sc.sc.del(obj);
+}
+
+static Evas_Object *
+_view_smart_window_create(Ewk_View_Smart_Data *vsd,
+ const Ewk_Window_Features *window_features)
+{
+ Evas_Object *new;
+ Evas_Object *obj = evas_object_smart_parent_get(vsd->self);
+
+ ELM_WEB_WEBKIT2_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
+
+ if (!sd->hook.window_create) return NULL;
+
+ new = sd->hook.window_create
+ (sd->hook.window_create_data, obj, EINA_TRUE,
+ (const Elm_Web_Window_Features *)window_features);
+ if (new) return elm_web_webkit_view_get(new);
+
+ return NULL;
+}
+
+static void
+_view_smart_window_close(Ewk_View_Smart_Data *sd)
+{
+ Evas_Object *obj = evas_object_smart_parent_get(sd->self);
+
+ ELM_WEB_WEBKIT2_CHECK(obj);
+
+ eo_event_callback_call(obj, ELM_WEB_EVENT_WINDOWS_CLOSE_REQUEST, NULL);
+}
+
+static void
+_popup_item_selected(void *data,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Elm_Object_Item *list_it = elm_list_selected_item_get(obj);
+ const Eina_List *itr, *list = elm_list_items_get(obj);
+ Ewk_Popup_Menu *menu = data;
+ int i = 0;
+ void *d;
+
+ EINA_LIST_FOREACH(list, itr, d)
+ {
+ if (d == list_it)
+ break;
+
+ i++;
+ }
+
+ ewk_popup_menu_selected_index_set(menu, i);
+ ewk_popup_menu_close(menu);
+
+ evas_object_del(evas_object_data_get(obj, "_notify"));
+}
+
+static Eina_Bool
+_popup_dismiss_cb(void *data, const Eo_Event *event)
+{
+ ewk_popup_menu_close(data);
+ evas_object_del(event->obj);
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_view_smart_popup_menu_show(Ewk_View_Smart_Data *sd,
+ Eina_Rectangle r,
+ Ewk_Text_Direction dir EINA_UNUSED,
+ double scale EINA_UNUSED,
+ Ewk_Popup_Menu *menu)
+{
+ Evas_Object *notify, *list, *grid, *win;
+ const Eina_List* items = ewk_popup_menu_items_get(menu);
+ Evas_Object *obj = evas_object_smart_parent_get(sd->self);
+ int h, ww, wh;
+
+ Elm_Object_Item *lit;
+ Eina_Bool disabled;
+ const char *txt;
+ Ewk_Popup_Menu_Item *it;
+ const Eina_List *itr;
+
+ Evas_Object *popup = evas_object_data_get(sd->self, "_select_popup");
+ if (popup) evas_object_del(popup);
+
+ win = elm_widget_top_get(obj);
+
+ notify = elm_notify_add(win);
+ elm_notify_allow_events_set(notify, EINA_FALSE);
+ elm_notify_align_set(notify, 0.5, 1.0);
+
+ list = elm_list_add(notify);
+ evas_object_data_set(list, "_notify", notify);
+ elm_list_select_mode_set(list, ELM_OBJECT_SELECT_MODE_ALWAYS);
+ elm_scroller_bounce_set(list, EINA_FALSE, EINA_FALSE);
+ elm_list_mode_set(list, ELM_LIST_EXPAND);
+ evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(list);
+
+ EINA_LIST_FOREACH(items, itr, it)
+ {
+ switch (ewk_popup_menu_item_type_get(it))
+ {
+ case EWK_POPUP_MENU_SEPARATOR:
+ // TODO:
+ break;
+ case EWK_POPUP_MENU_ITEM:
+ txt = ewk_popup_menu_item_text_get(it);
+ if (ewk_popup_menu_item_is_label_get(it))
+ {
+ lit = elm_list_item_append(list, txt, NULL, NULL, NULL, NULL);
+ disabled = EINA_TRUE;
+ }
+ else
+ {
+ lit = elm_list_item_append(list, txt, NULL, NULL, _popup_item_selected, menu);
+ disabled = !ewk_popup_menu_item_enabled_get(it);
+ }
+
+ elm_object_item_disabled_set(lit, disabled);
+ break;
+ default:
+ break;
+ }
+ }
+ elm_list_go(list);
+
+ grid = elm_grid_add(win);
+ elm_grid_size_set(grid, 1, 1);
+ elm_grid_pack(grid, list, 0, 0, 1, 1);
+ evas_object_geometry_get(win, NULL, NULL, &ww, &wh);
+
+ //FIXME: it should be the real height of items in the list.
+ h = r.h * eina_list_count(items);
+ evas_object_size_hint_min_set(grid, ww, h < wh / 2 ? h : wh / 2);
+ elm_object_content_set(notify, grid);
+ evas_object_show(grid);
+
+ evas_object_show(notify);
+
+ evas_object_data_set(sd->self, "_select_popup", notify);
+
+ eo_event_callback_add
+ (notify, ELM_NOTIFY_EVENT_BLOCK_CLICKED, _popup_dismiss_cb, menu);
+
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_view_smart_popup_menu_hide(Ewk_View_Smart_Data *sd)
+{
+ Evas_Object *popup = evas_object_data_get(sd->self, "_select_popup");
+ if (!popup) return EINA_FALSE;
+
+ evas_object_del(popup);
+ evas_object_data_del(sd->self, "_select_popup");
+
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_fullscreen_accept(void *data, const Eo_Event *event EINA_UNUSED)
+{
+ Evas_Object *ewk = data;
+ evas_object_del(evas_object_data_get(ewk, "_fullscreen_permission_popup"));
+
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_fullscreen_deny(void *data, const Eo_Event *event EINA_UNUSED)
+{
+ Evas_Object *ewk = data;
+ ewk_view_fullscreen_exit(ewk);
+ evas_object_del(evas_object_data_get(ewk, "_fullscreen_permission_popup"));
+
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_view_smart_fullscreen_enter(Ewk_View_Smart_Data *sd, Ewk_Security_Origin *origin)
+{
+ Evas_Object *btn, *popup, *top;
+ const char *host;
+ char buffer[2048];
+
+ Evas_Object *obj = evas_object_smart_parent_get(sd->self);
+
+ ELM_WEB_WEBKIT2_CHECK(obj) EINA_FALSE;
+
+ top = elm_widget_top_get(obj);
+ elm_win_fullscreen_set(top, EINA_TRUE);
+
+ popup = elm_popup_add(top);
+ elm_popup_orient_set(popup, ELM_POPUP_ORIENT_TOP);
+ evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+ host = ewk_security_origin_host_get(origin);
+ snprintf(buffer, sizeof(buffer), "%s is now fullscreen.<br>Press ESC at any time to exit fullscreen,<br>Allow fullscreen?<br>", host);
+ elm_object_text_set(popup, buffer);
+
+ btn = elm_button_add(popup);
+ elm_object_text_set(btn, "Accept");
+ elm_object_part_content_set(popup, "button1", btn);
+ eo_event_callback_add
+ (btn, EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _fullscreen_accept, sd->self);
+
+ btn = elm_button_add(popup);
+ elm_object_text_set(btn, "Deny");
+ elm_object_part_content_set(popup, "button2", btn);
+ eo_event_callback_add
+ (btn, EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _fullscreen_deny, sd->self);
+
+ evas_object_data_set(sd->self, "_fullscreen_permission_popup", popup);
+ evas_object_show(popup);
+
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_view_smart_fullscreen_exit(Ewk_View_Smart_Data *sd)
+{
+ Evas_Object *obj = evas_object_smart_parent_get(sd->self);
+
+ ELM_WEB_WEBKIT2_CHECK(obj) EINA_FALSE;
+
+ Evas_Object *top = elm_widget_top_get(obj);
+ elm_win_fullscreen_set(top, EINA_FALSE);
+
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_bt_close(void *data, const Eo_Event *event)
+{
+ Dialog_Data *d = data;
+
+ if (d->type == DIALOG_ALERT) goto end;
+
+ *d->response = (event->obj == d->bt_ok);
+ if (d->type == DIALOG_CONFIRM) goto end;
+
+ if (d->type == DIALOG_PROMPT)
+ *d->entry_value = strdup(elm_entry_entry_get(d->entry));
+
+end:
+ evas_object_del(d->dialog);
+ free(d);
+
+ return EINA_TRUE;
+}
+
+static Dialog_Data *
+_dialog_new(Evas_Object *web, Eina_Bool inwin_mode)
+{
+ Dialog_Data *d;
+
+ d = calloc(1, sizeof(Dialog_Data));
+ if (!d) return NULL;
+
+ if (!web || inwin_mode)
+ {
+ Evas_Object *bg;
+
+ d->dialog = elm_win_add(NULL, "elm-web-popup", ELM_WIN_DIALOG_BASIC);
+ eo_event_callback_add
+ (d->dialog, ELM_WIN_EVENT_DELETE_REQUEST, _bt_close, d);
+
+ bg = elm_bg_add(d->dialog);
+ evas_object_size_hint_weight_set
+ (bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(d->dialog, bg);
+ evas_object_show(bg);
+
+ d->box = elm_box_add(d->dialog);
+ evas_object_size_hint_weight_set
+ (d->box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(d->dialog, d->box);
+ evas_object_show(d->box);
+ }
+ else
+ {
+ Evas_Object *win = elm_widget_top_get(web);
+
+ d->dialog = elm_win_inwin_add(win);
+ elm_object_style_set(d->dialog, "minimal");
+ evas_object_size_hint_weight_set
+ (d->dialog, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+ d->box = elm_box_add(win);
+ evas_object_size_hint_weight_set
+ (d->box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_inwin_content_set(d->dialog, d->box);
+ evas_object_show(d->box);
+ }
+
+ return d;
+}
+
+static void
+_dialog_ok_cancel_buttons_add(Dialog_Data *dialog_data)
+{
+ Evas_Object *bx, *bt;
+ bx = elm_box_add(dialog_data->box);
+ elm_box_horizontal_set(bx, EINA_TRUE);
+ elm_box_pack_end(dialog_data->box, bx);
+ evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(bx);
+
+ dialog_data->bt_cancel = bt = elm_button_add(bx);
+ elm_object_text_set(bt, "Cancel");
+ elm_box_pack_end(bx, bt);
+ evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ eo_event_callback_add
+ (bt, EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _bt_close, dialog_data);
+ evas_object_show(bt);
+
+ dialog_data->bt_ok = bt = elm_button_add(bx);
+ elm_object_text_set(bt, "Ok");
+ elm_box_pack_end(bx, bt);
+ evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ eo_event_callback_add
+ (bt, EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _bt_close, dialog_data);
+ evas_object_show(bt);
+}
+
+static void
+_dialog_del_cb(void *data EINA_UNUSED,
+ Evas *e EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ ecore_main_loop_quit();
+}
+
+static void
+_exec_dialog(Evas_Object *dialog)
+{
+ evas_object_event_callback_add
+ (dialog, EVAS_CALLBACK_DEL, _dialog_del_cb, NULL);
+ ecore_main_loop_begin();
+}
+
+static void
+_view_smart_run_javascript_alert(Ewk_View_Smart_Data *vsd, const char *message)
+{
+ Evas_Object *obj = evas_object_smart_parent_get(vsd->self);
+ Evas_Object *dialog = NULL;
+
+ ELM_WEB_WEBKIT2_DATA_GET_OR_RETURN(obj, sd);
+
+ if (sd->hook.alert)
+ dialog = sd->hook.alert(sd->hook.alert_data, obj, message);
+ else
+ {
+ Evas_Object *lb;
+ Dialog_Data *dialog_data = _dialog_new(obj, sd->inwin_mode);
+ dialog_data->type = DIALOG_ALERT;
+ dialog = dialog_data->dialog;
+
+ lb = elm_label_add(dialog_data->box);
+ elm_object_text_set(lb, message);
+ elm_box_pack_end(dialog_data->box, lb);
+ evas_object_show(lb);
+
+ dialog_data->bt_ok = elm_button_add(dialog_data->box);
+ elm_object_text_set(dialog_data->bt_ok, "Close");
+ elm_box_pack_end(dialog_data->box, dialog_data->bt_ok);
+ evas_object_size_hint_align_set
+ (dialog_data->bt_ok, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ eo_event_callback_add
+ (dialog_data->bt_ok, EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _bt_close, dialog_data);
+ evas_object_show(dialog_data->bt_ok);
+
+ evas_object_show(dialog);
+ }
+
+ if (dialog) _exec_dialog(dialog);
+}
+
+static Eina_Bool
+_view_smart_run_javascript_confirm(Ewk_View_Smart_Data *vsd, const char *message)
+{
+ Evas_Object *obj = evas_object_smart_parent_get(vsd->self);
+ Eina_Bool response = EINA_FALSE;
+ Evas_Object *dialog = NULL;
+
+ ELM_WEB_WEBKIT2_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+
+ if (sd->hook.confirm)
+ dialog = sd->hook.confirm(sd->hook.confirm_data, obj, message, &response);
+ else
+ {
+ Evas_Object *lb;
+ Dialog_Data *dialog_data = _dialog_new(obj, sd->inwin_mode);
+ dialog_data->type = DIALOG_CONFIRM;
+ dialog_data->response = &response;
+ dialog = dialog_data->dialog;
+
+ lb = elm_label_add(dialog_data->box);
+ elm_object_text_set(lb, message);
+ elm_box_pack_end(dialog_data->box, lb);
+ evas_object_show(lb);
+
+ _dialog_ok_cancel_buttons_add(dialog_data);
+
+ evas_object_show(dialog);
+ }
+
+ if (dialog) _exec_dialog(dialog);
+
+ return response;
+}
+
+static const char *
+_view_smart_run_javascript_prompt(Ewk_View_Smart_Data *vsd, const char *message, const char *default_value)
+{
+ Evas_Object *obj = evas_object_smart_parent_get(vsd->self);
+ Eina_Bool response = EINA_FALSE;
+ Evas_Object *dialog = NULL;
+ char *value = NULL;
+ const char *ret;
+
+ ELM_WEB_WEBKIT2_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+
+ if (sd->hook.prompt)
+ dialog = sd->hook.prompt(sd->hook.prompt_data, obj, message, default_value, (const char**)&value, &response);
+ else
+ {
+ Evas_Object *lb, *entry;
+ Dialog_Data *dialog_data = _dialog_new(obj, sd->inwin_mode);
+ dialog_data->type = DIALOG_PROMPT;
+ dialog_data->response = &response;
+ dialog_data->entry_value = (const char**)&value;
+ dialog = dialog_data->dialog;
+
+ lb = elm_label_add(dialog_data->box);
+ elm_object_text_set(lb, message);
+ elm_box_pack_end(dialog_data->box, lb);
+ evas_object_show(lb);
+
+ dialog_data->entry = entry = elm_entry_add(dialog_data->box);
+ elm_entry_single_line_set(entry, EINA_TRUE);
+ elm_entry_scrollable_set(entry, EINA_TRUE);
+ elm_entry_entry_set(entry, default_value);
+ evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_box_pack_end(dialog_data->box, entry);
+ evas_object_show(entry);
+
+ _dialog_ok_cancel_buttons_add(dialog_data);
+
+ evas_object_show(dialog);
+ }
+
+ if (dialog) _exec_dialog(dialog);
+
+ if (!value) return NULL;
+
+ ret = eina_stringshare_add(value);
+ free(value);
+ return ret;
+}
+
+/**
+ * Creates a new view object given the parent.
+ *
+ * @param parent object to use as parent.
+ *
+ * @return newly added Evas_Object or @c NULL on errors.
+ */
+Evas_Object *
+_view_add(Evas_Object *parent)
+{
+ Evas *canvas = evas_object_evas_get(parent);
+ static Evas_Smart *smart = NULL;
+ Evas_Object *view;
+
+ if (!smart)
+ {
+ static Ewk_View_Smart_Class api =
+ EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION("EWK_View_Elementary");
+
+ ewk_view_smart_class_set(&api);
+ ewk_view_smart_class_set(&_ewk_view_parent_sc);
+
+ // TODO: check every api method and provide overrides with hooks!
+ // TODO: hooks should provide extension points
+ // TODO: extension should have some kind of "default implementation",
+ // TODO: that can be replaced or controlled by hooks.
+ // TODO: ie: run_javascript_alert() should present an elm_win
+ // TODO: by default, but user could override it to show as inwin.
+ api.sc.add = _view_smart_add;
+ api.sc.del = _view_smart_del;
+ api.window_create = _view_smart_window_create;
+ api.window_close = _view_smart_window_close;
+ api.popup_menu_show = _view_smart_popup_menu_show;
+ api.popup_menu_hide = _view_smart_popup_menu_hide;
+ api.fullscreen_enter = _view_smart_fullscreen_enter;
+ api.fullscreen_exit = _view_smart_fullscreen_exit;
+ api.run_javascript_alert = _view_smart_run_javascript_alert;
+ api.run_javascript_confirm = _view_smart_run_javascript_confirm;
+ api.run_javascript_prompt = _view_smart_run_javascript_prompt;
+
+ smart = evas_smart_class_new(&api.sc);
+ if (!smart)
+ {
+ CRI("Could not create smart class");
+ return NULL;
+ }
+ }
+
+ view = ewk_view_smart_add(canvas, smart, ewk_context_default_get(), ewk_page_group_create(0));
+ if (!view)
+ {
+ ERR("Could not create smart object object for view");
+ return NULL;
+ }
+
+ return view;
+}
+
+static Eina_Bool
+_view_smart_url_changed_cb(void *data, const Eo_Event *event)
+{
+ eo_event_callback_call(data, ELM_WEB_EVENT_URI_CHANGED, event->event_info);
+ eo_event_callback_call(data, ELM_WEB_EVENT_URL_CHANGED, event->event_info);
+
+ return EINA_TRUE;
+}
+
+static void
+_view_smart_callback_proxy(Evas_Object *view, Evas_Object *parent)
+{
+ eo_event_callback_add
+ (view, ELM_WEB_EVENT_URL_CHANGED, _view_smart_url_changed_cb, parent);
+}
+
+EOLIAN static Eina_Bool
+_elm_web_webkit2_elm_widget_on_focus(Eo *obj, Elm_Web_Webkit2_Data *sd, Elm_Object_Item *item EINA_UNUSED)
+{
+ Evas_Object *top;
+
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_TRUE);
+ Eina_Bool int_ret = EINA_FALSE;
+
+ int_ret = elm_obj_widget_on_focus(eo_super(obj, MY_CLASS), NULL);
+ if (!int_ret) return EINA_TRUE;
+
+ top = elm_widget_top_get(obj);
+
+ if (elm_object_focus_get(obj))
+ {
+ evas_object_focus_set(wd->resize_obj, EINA_TRUE);
+ if (top) elm_win_keyboard_mode_set(top, sd->input_method);
+ }
+ else
+ {
+ evas_object_focus_set(wd->resize_obj, EINA_FALSE);
+ if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF);
+ }
+ return EINA_TRUE;
+}
+
+EOLIAN static Eina_Bool
+_elm_web_webkit2_elm_web_tab_propagate_get(Eo *obj EINA_UNUSED, Elm_Web_Webkit2_Data *sd)
+{
+ return sd->tab_propagate;
+}
+
+EOLIAN static void
+_elm_web_webkit2_elm_web_tab_propagate_set(Eo *obj EINA_UNUSED, Elm_Web_Webkit2_Data *sd, Eina_Bool propagate)
+{
+ sd->tab_propagate = propagate;
+}
+
+EOLIAN static void
+_elm_web_webkit2_evas_object_smart_add(Eo *obj, Elm_Web_Webkit2_Data *_pd EINA_UNUSED)
+{
+ Evas_Object *resize_obj;
+
+ resize_obj = _view_add(obj);
+ elm_widget_resize_object_set(obj, resize_obj, EINA_TRUE);
+
+ evas_obj_smart_add(eo_super(obj, MY_CLASS));
+ elm_widget_sub_object_parent_add(obj);
+
+ //TODO: need a way to change theme
+ ewk_view_theme_set(resize_obj, WEBKIT_DATADIR "/themes/default.edj");
+
+ _view_smart_callback_proxy(resize_obj, obj);
+ elm_widget_can_focus_set(obj, EINA_TRUE);
+}
+
+EOLIAN static void
+_elm_web_webkit2_evas_object_smart_del(Eo *obj, Elm_Web_Webkit2_Data *_pd EINA_UNUSED)
+{
+ evas_obj_smart_del(eo_super(obj, MY_CLASS));
+}
+
+EOLIAN static Evas_Object*
+_elm_web_webkit2_elm_web_webkit_view_get(Eo *obj, Elm_Web_Webkit2_Data *_pd EINA_UNUSED)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+ return wd->resize_obj;
+}
+
+EOLIAN static void
+_elm_web_webkit2_elm_web_window_create_hook_set(Eo *obj EINA_UNUSED, Elm_Web_Webkit2_Data *sd, Elm_Web_Window_Open func, void *data)
+{
+ sd->hook.window_create = func;
+ sd->hook.window_create_data = data;
+}
+
+EOLIAN static void
+_elm_web_webkit2_elm_web_dialog_alert_hook_set(Eo *obj EINA_UNUSED, Elm_Web_Webkit2_Data *sd, Elm_Web_Dialog_Alert func, void *data)
+{
+ sd->hook.alert = func;
+ sd->hook.alert_data = data;
+}
+
+EOLIAN static void
+_elm_web_webkit2_elm_web_dialog_confirm_hook_set(Eo *obj EINA_UNUSED, Elm_Web_Webkit2_Data *sd, Elm_Web_Dialog_Confirm func, void *data)
+{
+ sd->hook.confirm = func;
+ sd->hook.confirm_data = data;
+}
+
+EOLIAN static void
+_elm_web_webkit2_elm_web_dialog_prompt_hook_set(Eo *obj EINA_UNUSED, Elm_Web_Webkit2_Data *sd, Elm_Web_Dialog_Prompt func, void *data)
+{
+ sd->hook.prompt = func;
+ sd->hook.prompt_data = data;
+}
+
+EOLIAN static void
+_elm_web_webkit2_elm_web_dialog_file_selector_hook_set(Eo *obj EINA_UNUSED, Elm_Web_Webkit2_Data *_pd EINA_UNUSED, Elm_Web_Dialog_File_Selector func EINA_UNUSED, void *data EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_elm_web_webkit2_elm_web_console_message_hook_set(Eo *obj EINA_UNUSED, Elm_Web_Webkit2_Data *_pd EINA_UNUSED, Elm_Web_Console_Message func EINA_UNUSED, void *data EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_elm_web_webkit2_elm_web_useragent_set(Eo *obj, Elm_Web_Webkit2_Data *_pd EINA_UNUSED, const char *user_agent)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+ ewk_view_user_agent_set(wd->resize_obj, user_agent);
+}
+
+EOLIAN static const char*
+_elm_web_webkit2_elm_web_useragent_get(Eo *obj, Elm_Web_Webkit2_Data *_pd EINA_UNUSED)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+
+ return ewk_view_user_agent_get(wd->resize_obj);
+}
+
+EOLIAN static Eina_Bool
+_elm_web_webkit2_elm_web_url_set(Eo *obj, Elm_Web_Webkit2_Data *_pd EINA_UNUSED, const char *url)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
+ return ewk_view_url_set(wd->resize_obj, url);
+}
+
+EOLIAN static const char*
+_elm_web_webkit2_elm_web_url_get(Eo *obj, Elm_Web_Webkit2_Data *_pd EINA_UNUSED)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+ return ewk_view_url_get(wd->resize_obj);
+}
+
+EOLIAN static Eina_Bool
+_elm_web_webkit2_elm_web_html_string_load(Eo *obj, Elm_Web_Webkit2_Data *_pd EINA_UNUSED, const char *html, const char *base_url, const char *unreachable_url)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
+
+ return ewk_view_html_string_load(wd->resize_obj,
+ html, base_url, unreachable_url);
+}
+
+EOLIAN static const char*
+_elm_web_webkit2_elm_web_title_get(Eo *obj, Elm_Web_Webkit2_Data *_pd EINA_UNUSED)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+ return ewk_view_title_get(wd->resize_obj);
+}
+
+EOLIAN static void
+_elm_web_webkit2_elm_web_bg_color_set(Eo *obj, Elm_Web_Webkit2_Data *_pd EINA_UNUSED, int r, int g, int b, int a)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+ ewk_view_bg_color_set(wd->resize_obj, r, g, b, a);
+}
+
+EOLIAN static void
+_elm_web_webkit2_elm_web_bg_color_get(Eo *obj, Elm_Web_Webkit2_Data *_pd EINA_UNUSED, int *r, int *g, int *b, int *a)
+{
+ if (r) *r = 0;
+ if (g) *g = 0;
+ if (b) *b = 0;
+ if (a) *a = 0;
+
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+ ewk_view_bg_color_get(wd->resize_obj, r, g, b, a);
+}
+
+EOLIAN static const char*
+_elm_web_webkit2_elm_web_selection_get(Eo *obj EINA_UNUSED, Elm_Web_Webkit2_Data *_pd EINA_UNUSED)
+{
+ return NULL;
+}
+
+EOLIAN static void
+_elm_web_webkit2_elm_web_popup_selected_set(Eo *obj EINA_UNUSED, Elm_Web_Webkit2_Data *_pd EINA_UNUSED, int idx EINA_UNUSED)
+{
+}
+
+EOLIAN static Eina_Bool
+_elm_web_webkit2_elm_web_popup_destroy(Eo *obj EINA_UNUSED, Elm_Web_Webkit2_Data *_pd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_elm_web_webkit2_elm_web_text_search(const Eo *obj EINA_UNUSED, Elm_Web_Webkit2_Data *_pd EINA_UNUSED, const char *string EINA_UNUSED, Eina_Bool case_sensitive EINA_UNUSED, Eina_Bool forward EINA_UNUSED, Eina_Bool wrap EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static unsigned int
+_elm_web_webkit2_elm_web_text_matches_mark(Eo *obj EINA_UNUSED, Elm_Web_Webkit2_Data *_pd EINA_UNUSED, const char *string EINA_UNUSED, Eina_Bool case_sensitive EINA_UNUSED, Eina_Bool highlight EINA_UNUSED, unsigned int limit EINA_UNUSED)
+{
+ return 0;
+}
+
+EOLIAN static Eina_Bool
+_elm_web_webkit2_elm_web_text_matches_unmark_all(Eo *obj EINA_UNUSED, Elm_Web_Webkit2_Data *_pd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_elm_web_webkit2_elm_web_text_matches_highlight_set(Eo *obj EINA_UNUSED, Elm_Web_Webkit2_Data *_pd EINA_UNUSED, Eina_Bool highlight EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_elm_web_webkit2_elm_web_text_matches_highlight_get(Eo *obj EINA_UNUSED, Elm_Web_Webkit2_Data *_pd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static double
+_elm_web_webkit2_elm_web_load_progress_get(Eo *obj, Elm_Web_Webkit2_Data *_pd EINA_UNUSED)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, -1.0);
+
+ return ewk_view_load_progress_get(wd->resize_obj);
+}
+
+EOLIAN static Eina_Bool
+_elm_web_webkit2_elm_web_stop(Eo *obj, Elm_Web_Webkit2_Data *_pd EINA_UNUSED)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
+
+ return ewk_view_stop(wd->resize_obj);
+}
+
+EOLIAN static Eina_Bool
+_elm_web_webkit2_elm_web_reload(Eo *obj, Elm_Web_Webkit2_Data *_pd EINA_UNUSED)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
+
+ return ewk_view_reload(wd->resize_obj);
+}
+
+EOLIAN static Eina_Bool
+_elm_web_webkit2_elm_web_reload_full(Eo *obj, Elm_Web_Webkit2_Data *_pd EINA_UNUSED)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
+
+ return ewk_view_reload_bypass_cache(wd->resize_obj);
+}
+
+EOLIAN static Eina_Bool
+_elm_web_webkit2_elm_web_back(Eo *obj, Elm_Web_Webkit2_Data *_pd EINA_UNUSED)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
+
+ return ewk_view_back(wd->resize_obj);
+}
+
+EOLIAN static Eina_Bool
+_elm_web_webkit2_elm_web_forward(Eo *obj, Elm_Web_Webkit2_Data *_pd EINA_UNUSED)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
+
+ return ewk_view_forward(wd->resize_obj);
+}
+
+EOLIAN static Eina_Bool
+_elm_web_webkit2_elm_web_navigate(Eo *obj, Elm_Web_Webkit2_Data *_pd EINA_UNUSED, int steps)
+{
+ Ewk_Back_Forward_List *history;
+ Ewk_Back_Forward_List_Item *item = NULL;
+
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
+
+ history = ewk_view_back_forward_list_get(wd->resize_obj);
+ if (history)
+ {
+ item = ewk_back_forward_list_item_at_index_get(history, steps);
+ if (item) return ewk_view_navigate_to(wd->resize_obj, item);
+ }
+
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_elm_web_webkit2_elm_web_back_possible_get(Eo *obj, Elm_Web_Webkit2_Data *_pd EINA_UNUSED)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
+
+ return ewk_view_back_possible(wd->resize_obj);
+}
+
+EOLIAN static Eina_Bool
+_elm_web_webkit2_elm_web_forward_possible_get(Eo *obj, Elm_Web_Webkit2_Data *_pd EINA_UNUSED)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
+
+ return ewk_view_forward_possible(wd->resize_obj);
+}
+
+EOLIAN static Eina_Bool
+_elm_web_webkit2_elm_web_navigate_possible_get(Eo *obj, Elm_Web_Webkit2_Data *_pd EINA_UNUSED, int steps)
+{
+ Ewk_Back_Forward_List *history;
+
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
+
+ history = ewk_view_back_forward_list_get(wd->resize_obj);
+ if (history && ewk_back_forward_list_item_at_index_get(history, steps))
+ return EINA_TRUE;
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_elm_web_webkit2_elm_web_history_enabled_get(Eo *obj EINA_UNUSED, Elm_Web_Webkit2_Data *_pd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static void
+_elm_web_webkit2_elm_web_history_enabled_set(Eo *obj EINA_UNUSED, Elm_Web_Webkit2_Data *_pd EINA_UNUSED, Eina_Bool enable EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_elm_web_webkit2_elm_web_zoom_set(Eo *obj, Elm_Web_Webkit2_Data *_pd EINA_UNUSED, double zoom)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+
+ ewk_view_page_zoom_set(wd->resize_obj, zoom);
+}
+
+EOLIAN static double
+_elm_web_webkit2_elm_web_zoom_get(Eo *obj, Elm_Web_Webkit2_Data *_pd EINA_UNUSED)
+{
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, -1);
+
+ return ewk_view_page_zoom_get(wd->resize_obj);
+}
+
+EOLIAN static void
+_elm_web_webkit2_elm_web_zoom_mode_set(Eo *obj EINA_UNUSED, Elm_Web_Webkit2_Data *_pd EINA_UNUSED, Elm_Web_Zoom_Mode mode EINA_UNUSED)
+{
+}
+
+EOLIAN static Elm_Web_Zoom_Mode
+_elm_web_webkit2_elm_web_zoom_mode_get(Eo *obj EINA_UNUSED, Elm_Web_Webkit2_Data *_pd EINA_UNUSED)
+{
+ return ELM_WEB_ZOOM_MODE_LAST;
+}
+
+EOLIAN static void
+_elm_web_webkit2_elm_web_region_show(Eo *obj EINA_UNUSED, Elm_Web_Webkit2_Data *_pd EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_elm_web_webkit2_elm_web_region_bring_in(Eo *obj EINA_UNUSED, Elm_Web_Webkit2_Data *_pd EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_elm_web_webkit2_elm_web_inwin_mode_set(Eo *obj EINA_UNUSED, Elm_Web_Webkit2_Data *sd, Eina_Bool value)
+{
+ sd->inwin_mode = value;
+}
+
+EOLIAN static Eina_Bool
+_elm_web_webkit2_elm_web_inwin_mode_get(Eo *obj EINA_UNUSED, Elm_Web_Webkit2_Data *sd)
+{
+ return sd->inwin_mode;
+}
+
+EAPI void
+ewm_web_window_features_ref(Elm_Web_Window_Features *wf)
+{
+ ewk_object_ref((Ewk_Object *)wf);
+}
+
+EAPI void
+ewm_web_window_features_unref(Elm_Web_Window_Features *wf)
+{
+ ewk_object_unref((Ewk_Object *)wf);
+}
+
+EAPI Eina_Bool
+ewm_web_window_features_property_get(const Elm_Web_Window_Features *wf,
+ Elm_Web_Window_Feature_Flag flag)
+{
+ const Ewk_Window_Features *ewf = (const Ewk_Window_Features *)wf;
+ switch (flag)
+ {
+ case ELM_WEB_WINDOW_FEATURE_TOOLBAR:
+ return ewk_window_features_toolbar_visible_get(ewf);
+
+ case ELM_WEB_WINDOW_FEATURE_STATUSBAR:
+ return ewk_window_features_statusbar_visible_get(ewf);
+
+ case ELM_WEB_WINDOW_FEATURE_SCROLLBARS:
+ return ewk_window_features_scrollbars_visible_get(ewf);
+
+ case ELM_WEB_WINDOW_FEATURE_MENUBAR:
+ return ewk_window_features_menubar_visible_get(ewf);
+
+ case ELM_WEB_WINDOW_FEATURE_LOCATIONBAR:
+ return ewk_window_features_locationbar_visible_get(ewf);
+
+ case ELM_WEB_WINDOW_FEATURE_FULLSCREEN:
+ return ewk_window_features_fullscreen_get(ewf);
+ }
+
+ return EINA_FALSE;
+}
+
+EAPI void
+ewm_web_window_features_region_get(const Elm_Web_Window_Features *wf,
+ Evas_Coord *x,
+ Evas_Coord *y,
+ Evas_Coord *w,
+ Evas_Coord *h)
+{
+ ewk_window_features_geometry_get
+ ((const Ewk_Window_Features *)wf, x, y, w, h);
+}
+
+static Eina_Bool _elm_need_web = EINA_FALSE;
+
+EAPI void
+ewm_unneed_web(void)
+{
+ if (!_elm_need_web) return;
+ _elm_need_web = EINA_FALSE;
+ ewk_shutdown();
+}
+
+EAPI Eina_Bool
+ewm_need_web(void)
+{
+ if (_elm_need_web) return EINA_TRUE;
+ _elm_need_web = EINA_TRUE;
+ ewk_init();
+
+ if (_webkit2_log_dom == -1)
+ _webkit2_log_dom = eina_log_domain_register("elm_webkit2", EINA_COLOR_LIGHTBLUE);
+ return EINA_TRUE;
+}
+
+EAPI const Eo_Class *
+ewm_class_get(void)
+{
+ return elm_web_webkit2_class_get();
+}
+
+#include "elm_web_webkit2.eo.c"
--- /dev/null
+class Elm.Web.Webkit2 (Elm.Web)
+{
+ implements {
+ Evas.Object_Smart.add;
+ Evas.Object_Smart.del;
+ Elm.Widget.on_focus;
+ Elm.Web.tab_propagate.get;
+ Elm.Web.tab_propagate.set;
+ Elm.Web.webkit_view.get;
+ Elm.Web.window_create_hook.set;
+ Elm.Web.dialog_alert_hook.set;
+ Elm.Web.dialog_confirm_hook.set;
+ Elm.Web.dialog_prompt_hook.set;
+ Elm.Web.dialog_file_selector_hook.set;
+ Elm.Web.console_message_hook.set;
+ Elm.Web.useragent.set;
+ Elm.Web.useragent.get;
+ Elm.Web.url.set;
+ Elm.Web.url.get;
+ Elm.Web.html_string_load;
+ Elm.Web.title.get;
+ Elm.Web.bg_color.set;
+ Elm.Web.bg_color.get;
+ Elm.Web.selection.get;
+ Elm.Web.popup_selected.set;
+ Elm.Web.popup_destroy;
+ Elm.Web.text_search;
+ Elm.Web.text_matches_mark;
+ Elm.Web.text_matches_unmark_all;
+ Elm.Web.text_matches_highlight.set;
+ Elm.Web.text_matches_highlight.get;
+ Elm.Web.load_progress.get;
+ Elm.Web.stop;
+ Elm.Web.reload;
+ Elm.Web.reload_full;
+ Elm.Web.back;
+ Elm.Web.forward;
+ Elm.Web.navigate;
+ Elm.Web.back_possible.get;
+ Elm.Web.forward_possible.get;
+ Elm.Web.navigate_possible_get;
+ Elm.Web.history_enabled.get;
+ Elm.Web.history_enabled.set;
+ Elm.Web.zoom.set;
+ Elm.Web.zoom.get;
+ Elm.Web.zoom_mode.set;
+ Elm.Web.zoom_mode.get;
+ Elm.Web.region_show;
+ Elm.Web.region_bring_in;
+ Elm.Web.inwin_mode.set;
+ Elm.Web.inwin_mode.get;
+ }
+}
--- /dev/null
+
+void _elm_web_webkit2_evas_object_smart_add(Eo *obj, Elm_Web_Webkit2_Data *pd);
+
+
+void _elm_web_webkit2_evas_object_smart_del(Eo *obj, Elm_Web_Webkit2_Data *pd);
+
+
+Eina_Bool _elm_web_webkit2_elm_widget_on_focus(Eo *obj, Elm_Web_Webkit2_Data *pd, Elm_Widget_Item *item);
+
+
+Eina_Bool _elm_web_webkit2_elm_web_tab_propagate_get(Eo *obj, Elm_Web_Webkit2_Data *pd);
+
+
+void _elm_web_webkit2_elm_web_tab_propagate_set(Eo *obj, Elm_Web_Webkit2_Data *pd, Eina_Bool propagate);
+
+
+Evas_Object * _elm_web_webkit2_elm_web_webkit_view_get(Eo *obj, Elm_Web_Webkit2_Data *pd);
+
+
+void _elm_web_webkit2_elm_web_window_create_hook_set(Eo *obj, Elm_Web_Webkit2_Data *pd, Elm_Web_Window_Open func, void *data);
+
+
+void _elm_web_webkit2_elm_web_dialog_alert_hook_set(Eo *obj, Elm_Web_Webkit2_Data *pd, Elm_Web_Dialog_Alert func, void *data);
+
+
+void _elm_web_webkit2_elm_web_dialog_confirm_hook_set(Eo *obj, Elm_Web_Webkit2_Data *pd, Elm_Web_Dialog_Confirm func, void *data);
+
+
+void _elm_web_webkit2_elm_web_dialog_prompt_hook_set(Eo *obj, Elm_Web_Webkit2_Data *pd, Elm_Web_Dialog_Prompt func, void *data);
+
+
+void _elm_web_webkit2_elm_web_dialog_file_selector_hook_set(Eo *obj, Elm_Web_Webkit2_Data *pd, Elm_Web_Dialog_File_Selector func, void *data);
+
+
+void _elm_web_webkit2_elm_web_console_message_hook_set(Eo *obj, Elm_Web_Webkit2_Data *pd, Elm_Web_Console_Message func, void *data);
+
+
+void _elm_web_webkit2_elm_web_useragent_set(Eo *obj, Elm_Web_Webkit2_Data *pd, const char *user_agent);
+
+
+const char * _elm_web_webkit2_elm_web_useragent_get(Eo *obj, Elm_Web_Webkit2_Data *pd);
+
+
+Eina_Bool _elm_web_webkit2_elm_web_url_set(Eo *obj, Elm_Web_Webkit2_Data *pd, const char *url);
+
+
+const char * _elm_web_webkit2_elm_web_url_get(Eo *obj, Elm_Web_Webkit2_Data *pd);
+
+
+Eina_Bool _elm_web_webkit2_elm_web_html_string_load(Eo *obj, Elm_Web_Webkit2_Data *pd, const char *html, const char *base_url, const char *unreachable_url);
+
+
+const char * _elm_web_webkit2_elm_web_title_get(Eo *obj, Elm_Web_Webkit2_Data *pd);
+
+
+void _elm_web_webkit2_elm_web_bg_color_set(Eo *obj, Elm_Web_Webkit2_Data *pd, int r, int g, int b, int a);
+
+
+void _elm_web_webkit2_elm_web_bg_color_get(Eo *obj, Elm_Web_Webkit2_Data *pd, int *r, int *g, int *b, int *a);
+
+
+const char * _elm_web_webkit2_elm_web_selection_get(Eo *obj, Elm_Web_Webkit2_Data *pd);
+
+
+void _elm_web_webkit2_elm_web_popup_selected_set(Eo *obj, Elm_Web_Webkit2_Data *pd, int idx);
+
+
+Eina_Bool _elm_web_webkit2_elm_web_popup_destroy(Eo *obj, Elm_Web_Webkit2_Data *pd);
+
+
+Eina_Bool _elm_web_webkit2_elm_web_text_search(const Eo *obj, Elm_Web_Webkit2_Data *pd, const char *string, Eina_Bool case_sensitive, Eina_Bool forward, Eina_Bool wrap);
+
+
+unsigned int _elm_web_webkit2_elm_web_text_matches_mark(Eo *obj, Elm_Web_Webkit2_Data *pd, const char *string, Eina_Bool case_sensitive, Eina_Bool highlight, unsigned int limit);
+
+
+Eina_Bool _elm_web_webkit2_elm_web_text_matches_unmark_all(Eo *obj, Elm_Web_Webkit2_Data *pd);
+
+
+Eina_Bool _elm_web_webkit2_elm_web_text_matches_highlight_set(Eo *obj, Elm_Web_Webkit2_Data *pd, Eina_Bool highlight);
+
+
+Eina_Bool _elm_web_webkit2_elm_web_text_matches_highlight_get(Eo *obj, Elm_Web_Webkit2_Data *pd);
+
+
+double _elm_web_webkit2_elm_web_load_progress_get(Eo *obj, Elm_Web_Webkit2_Data *pd);
+
+
+Eina_Bool _elm_web_webkit2_elm_web_stop(Eo *obj, Elm_Web_Webkit2_Data *pd);
+
+
+Eina_Bool _elm_web_webkit2_elm_web_reload(Eo *obj, Elm_Web_Webkit2_Data *pd);
+
+
+Eina_Bool _elm_web_webkit2_elm_web_reload_full(Eo *obj, Elm_Web_Webkit2_Data *pd);
+
+
+Eina_Bool _elm_web_webkit2_elm_web_back(Eo *obj, Elm_Web_Webkit2_Data *pd);
+
+
+Eina_Bool _elm_web_webkit2_elm_web_forward(Eo *obj, Elm_Web_Webkit2_Data *pd);
+
+
+Eina_Bool _elm_web_webkit2_elm_web_navigate(Eo *obj, Elm_Web_Webkit2_Data *pd, int steps);
+
+
+Eina_Bool _elm_web_webkit2_elm_web_back_possible_get(Eo *obj, Elm_Web_Webkit2_Data *pd);
+
+
+Eina_Bool _elm_web_webkit2_elm_web_forward_possible_get(Eo *obj, Elm_Web_Webkit2_Data *pd);
+
+
+Eina_Bool _elm_web_webkit2_elm_web_navigate_possible_get(Eo *obj, Elm_Web_Webkit2_Data *pd, int steps);
+
+
+Eina_Bool _elm_web_webkit2_elm_web_history_enabled_get(Eo *obj, Elm_Web_Webkit2_Data *pd);
+
+
+void _elm_web_webkit2_elm_web_history_enabled_set(Eo *obj, Elm_Web_Webkit2_Data *pd, Eina_Bool enable);
+
+
+void _elm_web_webkit2_elm_web_zoom_set(Eo *obj, Elm_Web_Webkit2_Data *pd, double zoom);
+
+
+double _elm_web_webkit2_elm_web_zoom_get(Eo *obj, Elm_Web_Webkit2_Data *pd);
+
+
+void _elm_web_webkit2_elm_web_zoom_mode_set(Eo *obj, Elm_Web_Webkit2_Data *pd, Elm_Web_Zoom_Mode mode);
+
+
+Elm_Web_Zoom_Mode _elm_web_webkit2_elm_web_zoom_mode_get(Eo *obj, Elm_Web_Webkit2_Data *pd);
+
+
+void _elm_web_webkit2_elm_web_region_show(Eo *obj, Elm_Web_Webkit2_Data *pd, int x, int y, int w, int h);
+
+
+void _elm_web_webkit2_elm_web_region_bring_in(Eo *obj, Elm_Web_Webkit2_Data *pd, int x, int y, int w, int h);
+
+
+void _elm_web_webkit2_elm_web_inwin_mode_set(Eo *obj, Elm_Web_Webkit2_Data *pd, Eina_Bool value);
+
+
+Eina_Bool _elm_web_webkit2_elm_web_inwin_mode_get(Eo *obj, Elm_Web_Webkit2_Data *pd);
+
+
+static const Eo_Op_Description _elm_web_webkit2_op_desc[] = {
+ EO_OP_FUNC_OVERRIDE(evas_obj_smart_add, _elm_web_webkit2_evas_object_smart_add),
+ EO_OP_FUNC_OVERRIDE(evas_obj_smart_del, _elm_web_webkit2_evas_object_smart_del),
+ EO_OP_FUNC_OVERRIDE(elm_obj_widget_on_focus, _elm_web_webkit2_elm_widget_on_focus),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_tab_propagate_get, _elm_web_webkit2_elm_web_tab_propagate_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_tab_propagate_set, _elm_web_webkit2_elm_web_tab_propagate_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_webkit_view_get, _elm_web_webkit2_elm_web_webkit_view_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_window_create_hook_set, _elm_web_webkit2_elm_web_window_create_hook_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_dialog_alert_hook_set, _elm_web_webkit2_elm_web_dialog_alert_hook_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_dialog_confirm_hook_set, _elm_web_webkit2_elm_web_dialog_confirm_hook_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_dialog_prompt_hook_set, _elm_web_webkit2_elm_web_dialog_prompt_hook_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_dialog_file_selector_hook_set, _elm_web_webkit2_elm_web_dialog_file_selector_hook_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_console_message_hook_set, _elm_web_webkit2_elm_web_console_message_hook_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_useragent_set, _elm_web_webkit2_elm_web_useragent_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_useragent_get, _elm_web_webkit2_elm_web_useragent_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_url_set, _elm_web_webkit2_elm_web_url_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_url_get, _elm_web_webkit2_elm_web_url_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_html_string_load, _elm_web_webkit2_elm_web_html_string_load),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_title_get, _elm_web_webkit2_elm_web_title_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_bg_color_set, _elm_web_webkit2_elm_web_bg_color_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_bg_color_get, _elm_web_webkit2_elm_web_bg_color_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_selection_get, _elm_web_webkit2_elm_web_selection_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_popup_selected_set, _elm_web_webkit2_elm_web_popup_selected_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_popup_destroy, _elm_web_webkit2_elm_web_popup_destroy),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_text_search, _elm_web_webkit2_elm_web_text_search),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_text_matches_mark, _elm_web_webkit2_elm_web_text_matches_mark),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_text_matches_unmark_all, _elm_web_webkit2_elm_web_text_matches_unmark_all),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_text_matches_highlight_set, _elm_web_webkit2_elm_web_text_matches_highlight_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_text_matches_highlight_get, _elm_web_webkit2_elm_web_text_matches_highlight_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_load_progress_get, _elm_web_webkit2_elm_web_load_progress_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_stop, _elm_web_webkit2_elm_web_stop),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_reload, _elm_web_webkit2_elm_web_reload),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_reload_full, _elm_web_webkit2_elm_web_reload_full),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_back, _elm_web_webkit2_elm_web_back),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_forward, _elm_web_webkit2_elm_web_forward),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_navigate, _elm_web_webkit2_elm_web_navigate),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_back_possible_get, _elm_web_webkit2_elm_web_back_possible_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_forward_possible_get, _elm_web_webkit2_elm_web_forward_possible_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_navigate_possible_get, _elm_web_webkit2_elm_web_navigate_possible_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_history_enabled_get, _elm_web_webkit2_elm_web_history_enabled_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_history_enabled_set, _elm_web_webkit2_elm_web_history_enabled_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_zoom_set, _elm_web_webkit2_elm_web_zoom_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_zoom_get, _elm_web_webkit2_elm_web_zoom_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_zoom_mode_set, _elm_web_webkit2_elm_web_zoom_mode_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_zoom_mode_get, _elm_web_webkit2_elm_web_zoom_mode_get),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_region_show, _elm_web_webkit2_elm_web_region_show),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_region_bring_in, _elm_web_webkit2_elm_web_region_bring_in),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_inwin_mode_set, _elm_web_webkit2_elm_web_inwin_mode_set),
+ EO_OP_FUNC_OVERRIDE(elm_obj_web_inwin_mode_get, _elm_web_webkit2_elm_web_inwin_mode_get),
+};
+
+static const Eo_Class_Description _elm_web_webkit2_class_desc = {
+ EO_VERSION,
+ "Elm_Web_Webkit2",
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(_elm_web_webkit2_op_desc),
+ NULL,
+ sizeof(Elm_Web_Webkit2_Data),
+ NULL,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_web_webkit2_class_get, &_elm_web_webkit2_class_desc, ELM_WEB_CLASS, NULL);
\ No newline at end of file
--- /dev/null
+#ifndef _ELM_WEB_WEBKIT2_EO_H_
+#define _ELM_WEB_WEBKIT2_EO_H_
+
+#ifndef _ELM_WEB_WEBKIT2_EO_CLASS_TYPE
+#define _ELM_WEB_WEBKIT2_EO_CLASS_TYPE
+
+typedef Eo Elm_Web_Webkit2;
+
+#endif
+
+#ifndef _ELM_WEB_WEBKIT2_EO_TYPES
+#define _ELM_WEB_WEBKIT2_EO_TYPES
+
+
+#endif
+#define ELM_WEB_WEBKIT2_CLASS elm_web_webkit2_class_get()
+
+EAPI const Eo_Class *elm_web_webkit2_class_get(void);
+
+
+#endif