forked from enlightenment/efl
elementary: Minimalist Elementary Web widget example.
Author: Joao Paulo Fernandes Ventura <ventura@profusion.mobi> SVN revision: 74949
This commit is contained in:
parent
0d4d37e807
commit
b8c0d34a79
|
@ -5932,7 +5932,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @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,
|
* WebKit-EFL is independent of any particular toolkit, such as Elementary,
|
||||||
* so using it on applications requires that the programmer writes a lot of
|
* so using it on applications requires that the programmer writes a lot of
|
||||||
|
@ -5958,7 +5958,7 @@
|
||||||
* some WebKit functions on it, thus we need to include the necessary headers
|
* some WebKit functions on it, thus we need to include the necessary headers
|
||||||
* first.
|
* first.
|
||||||
*
|
*
|
||||||
* @dontinclude web_example.c
|
* @dontinclude web_example_02.c
|
||||||
* @skip include
|
* @skip include
|
||||||
* @until EWebKit
|
* @until EWebKit
|
||||||
*
|
*
|
||||||
|
@ -6052,10 +6052,10 @@
|
||||||
* @until ELM_MAIN
|
* @until ELM_MAIN
|
||||||
*
|
*
|
||||||
* Some parts of the code were left out, as they are not relevant to the
|
* 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
|
* example, but the full listing can be found at @ref web_example_02.c
|
||||||
* "web_example.c".
|
* "web_example_02.c".
|
||||||
*
|
*
|
||||||
* @example web_example.c
|
* @example web_example_02.c
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -132,7 +132,8 @@ transit_example_01.c \
|
||||||
transit_example_02.c \
|
transit_example_02.c \
|
||||||
transit_example_03.c \
|
transit_example_03.c \
|
||||||
transit_example_04.c \
|
transit_example_04.c \
|
||||||
web_example.c \
|
web_example_01.c \
|
||||||
|
web_example_02.c \
|
||||||
win_example.c
|
win_example.c
|
||||||
|
|
||||||
.edc.edj:
|
.edc.edj:
|
||||||
|
@ -243,7 +244,8 @@ transit_example_01 \
|
||||||
transit_example_02 \
|
transit_example_02 \
|
||||||
transit_example_03 \
|
transit_example_03 \
|
||||||
transit_example_04 \
|
transit_example_04 \
|
||||||
web_example \
|
web_example_01 \
|
||||||
|
web_example_02 \
|
||||||
win_example
|
win_example
|
||||||
|
|
||||||
if ELEMENTARY_WINDOWS_BUILD
|
if ELEMENTARY_WINDOWS_BUILD
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
/*
|
||||||
|
* 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()
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* gcc -o web_example web_example.c `pkg-config --cflags --libs elementary ewebkit` -D_GNU_SOURCE
|
* gcc -o web_example_02 web_example_02.c `pkg-config --cflags --libs elementary ewebkit` -D_GNU_SOURCE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
|
@ -80,7 +80,8 @@
|
||||||
*
|
*
|
||||||
* An example of use of web:
|
* An example of use of web:
|
||||||
*
|
*
|
||||||
* - @ref web_example_01 TBD
|
* - @ref web_example_01
|
||||||
|
* - @ref web_example_02
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue