People from Earth: Welcome Elm_Web
authorsachiel <sachiel@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 29 Sep 2011 20:58:22 +0000 (20:58 +0000)
committerMike McCormack <mj.mccormack@samsung.com>
Thu, 10 Nov 2011 01:50:27 +0000 (10:50 +0900)
Started by glima as a thin wrapper around ewk_view to make webkit
work better integrated with Elementary, then grew up as a more complete
widget thanks to k-s' magic fingers, and now I screwed it up but it looks
like it works, so there..

Build WebKit-EFL, rebuild Elementary and enjoy elm_web.

git-svn-id: https://svn.enlightenment.org/svn/e/trunk/elementary@63676 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

configure.ac
src/bin/Makefile.am
src/bin/test.c
src/lib/Elementary.h.in
src/lib/Makefile.am
src/lib/elm_main.c
src/lib/elm_priv.h

index aa69cc5..b6649d7 100755 (executable)
@@ -533,6 +533,38 @@ if test "x$want_elementary_ethumb" = "xyes" -a "x$have_elementary_ethumb" = "xno
 fi
 AC_SUBST(ELM_ETHUMB_DEF)
 
 fi
 AC_SUBST(ELM_ETHUMB_DEF)
 
+ELM_WEB_DEF="#undef"
+have_elementary_web="no"
+want_elementary_web="auto"
+AC_ARG_ENABLE([web],
+   [AC_HELP_STRING([--disable-web], [disable web (WebKit) support. @<:@default=detect@:>@])],
+   [want_elementary_web=$enableval], [])
+
+if test "x$want_elementary_web" != "xno"; then
+    PKG_CHECK_MODULES([ELEMENTARY_WEB],
+       [
+        ewebkit
+       ],
+       [
+        AC_DEFINE(HAVE_ELEMENTARY_WEB, 1, [Web support for Elementary])
+        webkit_datadir=$($PKG_CONFIG ewebkit --variable=datadir)
+        AC_DEFINE_UNQUOTED(WEBKIT_DATADIR,
+                           "$webkit_datadir",
+                           "WebKit's data dir")
+        have_elementary_web="yes"
+        ELM_WEB_DEF="#define"
+        requirement_elm="web_client ${requirement_elm}"
+       ],
+       [have_elementary_web="no"]
+    )
+else
+    have_elementary_web="no"
+fi
+if test "x$want_elementary_web" = "xyes" -a "x$have_elementary_web" = "xno"; then
+    AC_MSG_ERROR([Web support requested, but no ewebkit found by pkg-config.])
+fi
+AC_SUBST(ELM_WEB_DEF)
+
 ELM_DEBUG_DEF="#undef"
 want_elementary_debug="no"
 AC_ARG_ENABLE([debug],
 ELM_DEBUG_DEF="#undef"
 want_elementary_debug="no"
 AC_ARG_ENABLE([debug],
@@ -651,6 +683,7 @@ echo "    EFreet.................: ${have_elementary_efreet}"
 echo "    EWeather...............: ${have_elementary_eweather}"
 echo "    EMap...................: ${have_elementary_emap}"
 echo "    Ethumb.................: ${have_elementary_ethumb}"
 echo "    EWeather...............: ${have_elementary_eweather}"
 echo "    EMap...................: ${have_elementary_emap}"
 echo "    Ethumb.................: ${have_elementary_ethumb}"
+echo "    Web (WebKit)...........: ${have_elementary_web}"
 echo "    Quick Launch...........: ${have_fork}"
 echo "    EIO....................: ${have_eio}"
 echo "    Emotion................: ${have_emotion}"
 echo "    Quick Launch...........: ${have_fork}"
 echo "    EIO....................: ${have_eio}"
 echo "    Emotion................: ${have_emotion}"
index 940f571..dee0257 100644 (file)
@@ -18,7 +18,8 @@ AM_CPPFLAGS = \
 @ELEMENTARY_EFREET_CFLAGS@ \
 @ELEMENTARY_EWEATHER_CFLAGS@ \
 @ELEMENTARY_ETHUMB_CFLAGS@ \
 @ELEMENTARY_EFREET_CFLAGS@ \
 @ELEMENTARY_EWEATHER_CFLAGS@ \
 @ELEMENTARY_ETHUMB_CFLAGS@ \
-@EIO_CFLAGS@
+@EIO_CFLAGS@ \
+@ELEMENTARY_WEB_CFLAGS@
 
 if ELEMENTARY_WINDOWS_BUILD
 AM_CPPFLAGS += -DELEMENTARY_BUILD
 
 if ELEMENTARY_WINDOWS_BUILD
 AM_CPPFLAGS += -DELEMENTARY_BUILD
@@ -104,6 +105,7 @@ test_toolbar.c \
 test_tooltip.c \
 test_transit.c \
 test_weather.c \
 test_tooltip.c \
 test_transit.c \
 test_weather.c \
+test_web.c \
 test_win_inline.c \
 test_win_state.c
 
 test_win_inline.c \
 test_win_state.c
 
@@ -117,6 +119,7 @@ elementary_test_LDADD = $(top_builddir)/src/lib/libelementary.la \
        @ELEMENTARY_EFREET_LIBS@ \
        @ELEMENTARY_LIBS@ \
        @EIO_LIBS@ \
        @ELEMENTARY_EFREET_LIBS@ \
        @ELEMENTARY_LIBS@ \
        @EIO_LIBS@ \
+       @ELEMENTARY_WEB_LIBS@ \
        @my_libs@
 elementary_test_LDFLAGS =
 
        @my_libs@
 elementary_test_LDFLAGS =
 
@@ -157,7 +160,8 @@ elementary_testql_LTLIBRARIES = elementary_testql.la
 elementary_testql_la_SOURCES = $(elementary_test_SOURCES)
 elementary_testql_la_LIBADD = $(top_builddir)/src/lib/libelementary.la \
        @ELEMENTARY_EWEATHER_LIBS@ \
 elementary_testql_la_SOURCES = $(elementary_test_SOURCES)
 elementary_testql_la_LIBADD = $(top_builddir)/src/lib/libelementary.la \
        @ELEMENTARY_EWEATHER_LIBS@ \
-       @EIO_LIBS@
+       @EIO_LIBS@ \
+       @ELEMENTARY_WEB_LIBS@
 
 elementary_testql_la_CFLAGS =
 elementary_testql_la_LDFLAGS = -module -avoid-version -no-undefined
 
 elementary_testql_la_CFLAGS =
 elementary_testql_la_LDFLAGS = -module -avoid-version -no-undefined
@@ -167,7 +171,8 @@ elementary_testql_LDADD = $(top_builddir)/src/lib/libelementary.la \
        @ELEMENTARY_EDBUS_LIBS@ \
        @ELEMENTARY_EFREET_LIBS@ \
        @ELEMENTARY_LIBS@ \
        @ELEMENTARY_EDBUS_LIBS@ \
        @ELEMENTARY_EFREET_LIBS@ \
        @ELEMENTARY_LIBS@ \
-       @EIO_LIBS@
+       @EIO_LIBS@ \
+       @ELEMENTARY_WEB_LIBS@ \
        @my_libs@
 
 elementary_testql_CFLAGS = -DELM_LIB_QUICKLAUNCH=1
        @my_libs@
 
 elementary_testql_CFLAGS = -DELM_LIB_QUICKLAUNCH=1
index 65f8569..fe191e6 100644 (file)
@@ -142,6 +142,9 @@ void test_naviframe(void *data, Evas_Object *obj, void *event_info);
 #ifdef HAVE_EIO
 void test_eio(void *data, Evas_Object *obj, void *event_info);
 #endif
 #ifdef HAVE_EIO
 void test_eio(void *data, Evas_Object *obj, void *event_info);
 #endif
+#ifdef HAVE_ELEMENTARY_WEB
+void test_web(void *data, Evas_Object *obj, void *event_info);
+#endif
 
 struct elm_test
 {
 
 struct elm_test
 {
@@ -416,6 +419,9 @@ my_win_main(char *autorun, Eina_Bool test_win_only)
    ADD_TEST("3D", test_3d);
    ADD_TEST("Gesture Layer", test_gesture_layer);
    ADD_TEST("Naviframe", test_naviframe);
    ADD_TEST("3D", test_3d);
    ADD_TEST("Gesture Layer", test_gesture_layer);
    ADD_TEST("Naviframe", test_naviframe);
+#ifdef HAVE_ELEMENTARY_WEB
+   ADD_TEST("Web", test_web);
+#endif
 #undef ADD_TEST
 
    if (autorun)
 #undef ADD_TEST
 
    if (autorun)
@@ -461,6 +467,8 @@ elm_main(int argc, char **argv)
    Eina_Bool test_win_only = EINA_FALSE;
    char *autorun = NULL;
 
    Eina_Bool test_win_only = EINA_FALSE;
    char *autorun = NULL;
 
+   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
+
    /* tell elm about our app so it can figure out where to get files */
    elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR);
    elm_app_compile_data_dir_set(PACKAGE_DATA_DIR);
    /* tell elm about our app so it can figure out where to get files */
    elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR);
    elm_app_compile_data_dir_set(PACKAGE_DATA_DIR);
index d55bc1b..430a0f7 100644 (file)
@@ -312,6 +312,7 @@ contact with the developers and maintainers.
 @ELM_EDBUS_DEF@ ELM_EDBUS
 @ELM_EFREET_DEF@ ELM_EFREET
 @ELM_ETHUMB_DEF@ ELM_ETHUMB
 @ELM_EDBUS_DEF@ ELM_EDBUS
 @ELM_EFREET_DEF@ ELM_EFREET
 @ELM_ETHUMB_DEF@ ELM_ETHUMB
+@ELM_WEB_DEF@ ELM_WEB
 @ELM_EMAP_DEF@ ELM_EMAP
 @ELM_DEBUG_DEF@ ELM_DEBUG
 @ELM_ALLOCA_H_DEF@ ELM_ALLOCA_H
 @ELM_EMAP_DEF@ ELM_EMAP
 @ELM_DEBUG_DEF@ ELM_DEBUG
 @ELM_ALLOCA_H_DEF@ ELM_ALLOCA_H
@@ -896,6 +897,14 @@ extern "C" {
    EAPI Eina_Bool    elm_need_ethumb(void);
 
    /**
    EAPI Eina_Bool    elm_need_ethumb(void);
 
    /**
+    * This must be called before any other function that handle with
+    * elm_web objects or ewk_view instances.
+    *
+    * @ingroup Web
+    */
+   EAPI Eina_Bool    elm_need_web(void);
+
+   /**
     * Set a new policy's value (for a given policy group/identifier).
     *
     * @param policy policy identifier, as in @ref Elm_Policy.
     * Set a new policy's value (for a given policy group/identifier).
     *
     * @param policy policy identifier, as in @ref Elm_Policy.
@@ -13155,7 +13164,6 @@ extern "C" {
     * @}
     */
 
     * @}
     */
 
-#if 0
    /**
     * @defgroup Web Web
     *
    /**
     * @defgroup Web Web
     *
@@ -14006,7 +14014,6 @@ extern "C" {
    /**
     * @}
     */
    /**
     * @}
     */
-#endif
 
    /**
     * @defgroup Hoversel Hoversel
 
    /**
     * @defgroup Hoversel Hoversel
index e71e010..3e3e840 100644 (file)
@@ -21,6 +21,7 @@ AM_CPPFLAGS = \
 @ELEMENTARY_EDBUS_CFLAGS@ \
 @ELEMENTARY_EFREET_CFLAGS@ \
 @ELEMENTARY_ETHUMB_CFLAGS@ \
 @ELEMENTARY_EDBUS_CFLAGS@ \
 @ELEMENTARY_EFREET_CFLAGS@ \
 @ELEMENTARY_ETHUMB_CFLAGS@ \
+@ELEMENTARY_WEB_CFLAGS@ \
 @ELEMENTARY_EMAP_CFLAGS@ \
 @EVIL_CFLAGS@ \
 @ECORE_CON_CFLAGS@ \
 @ELEMENTARY_EMAP_CFLAGS@ \
 @EVIL_CFLAGS@ \
 @ECORE_CON_CFLAGS@ \
@@ -131,6 +132,7 @@ elm_toolbar.c \
 elm_transit.c \
 elm_util.c \
 elm_video.c \
 elm_transit.c \
 elm_util.c \
 elm_video.c \
+elm_web.c \
 elm_widget.c \
 elm_win.c \
 els_box.c \
 elm_widget.c \
 elm_win.c \
 els_box.c \
@@ -157,6 +159,7 @@ libelementary_la_LIBADD = \
 @ELEMENTARY_EDBUS_LIBS@ \
 @ELEMENTARY_EFREET_LIBS@ \
 @ELEMENTARY_ETHUMB_LIBS@ \
 @ELEMENTARY_EDBUS_LIBS@ \
 @ELEMENTARY_EFREET_LIBS@ \
 @ELEMENTARY_ETHUMB_LIBS@ \
+@ELEMENTARY_WEB_LIBS@ \
 @ELEMENTARY_EMAP_LIBS@ \
 @EVIL_LIBS@ \
 @ECORE_CON_LIBS@ \
 @ELEMENTARY_EMAP_LIBS@ \
 @EVIL_LIBS@ \
 @ECORE_CON_LIBS@ \
index 0c825ca..7a35b2e 100644 (file)
@@ -508,6 +508,7 @@ elm_quicklaunch_shutdown(void)
    _elm_unneed_efreet();
    _elm_unneed_e_dbus();
    _elm_unneed_ethumb();
    _elm_unneed_efreet();
    _elm_unneed_e_dbus();
    _elm_unneed_ethumb();
+   _elm_unneed_web();
    ecore_file_shutdown();
 
 #ifdef HAVE_ELEMENTARY_EMAP
    ecore_file_shutdown();
 
 #ifdef HAVE_ELEMENTARY_EMAP
index 40e4ba1..bd52584 100644 (file)
@@ -183,6 +183,7 @@ void                _elm_widget_top_win_focused_set(Evas_Object *obj, Eina_Bool
 Eina_Bool           _elm_widget_top_win_focused_get(const Evas_Object *obj);
 
 void                _elm_unneed_ethumb(void);
 Eina_Bool           _elm_widget_top_win_focused_get(const Evas_Object *obj);
 
 void                _elm_unneed_ethumb(void);
+void                _elm_unneed_web(void);
 
 void                _elm_rescale(void);
 void                _elm_widget_mirrored_reload(Evas_Object *obj);
 
 void                _elm_rescale(void);
 void                _elm_widget_mirrored_reload(Evas_Object *obj);