*/
/**
- * @page web_example_01 Web - Simple example
+ * @page web_example_02 Web - Simple example
*
* WebKit-EFL is independent of any particular toolkit, such as Elementary,
* so using it on applications requires that the programmer writes a lot of
* some WebKit functions on it, thus we need to include the necessary headers
* first.
*
- * @dontinclude web_example.c
+ * @dontinclude web_example_02.c
* @skip include
* @until EWebKit
*
* @until ELM_MAIN
*
* Some parts of the code were left out, as they are not relevant to the
- * example, but the full listing can be found at @ref web_example.c
- * "web_example.c".
+ * example, but the full listing can be found at @ref web_example_02.c
+ * "web_example_02.c".
*
- * @example web_example.c
+ * @example web_example_02.c
*/
/**
--- /dev/null
+/*
+ * gcc -o web_example_01 web_example_01.c `pkg-config --cflags --libs elementary ewebkit` -D_GNU_SOURCE
+ */
+
+#define _GNU_SOURCE
+#include <Elementary.h>
+#ifdef HAVE_ELEMENTARY_WEB
+#include <EWebKit.h>
+#endif
+
+#define URL "http://www.enlightenment.org"
+
+EAPI_MAIN int
+elm_main(int argc, char *argv[])
+{
+ Evas_Object *win, *bg, *web;
+
+ /* The program will proceed only if Ewebkit library is available. */
+ if (elm_need_web() == EINA_FALSE)
+ return -1;
+
+ elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
+
+ /* Window */
+ win = elm_win_add(NULL, "Elementary Webkit Widget", ELM_WIN_BASIC);
+ elm_win_autodel_set(win, EINA_TRUE);
+ evas_object_resize(win, 720, 600);
+ evas_object_show(win);
+
+ /* Web */
+ web = elm_web_add(win);
+ evas_object_size_hint_weight_set(web, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_web_window_create_hook_set(web, NULL, NULL);
+ elm_win_resize_object_add(win, web);
+ elm_web_history_enabled_set(web, EINA_FALSE);
+
+ if (!elm_web_uri_set(web, URL))
+ {
+ printf("URL NOT LOADED");
+ return -1;
+ }
+ evas_object_show(web);
+
+ elm_run();
+ elm_shutdown();
+
+ return 0;
+}
+ELM_MAIN()