lifecycle_ui: Add almost-working lifecycle gui demo

This is pending some Elm fixes to function correctly
devs/vitorsousa/csharp
Andy Williams 5 years ago
parent afb4aa07ca
commit 9cbbb37750
  1. 13
      tutorial/c/lifecycle_ui/meson.build
  2. 57
      tutorial/c/lifecycle_ui/src/lifecycle_main.c
  3. 12
      tutorial/c/lifecycle_ui/src/meson.build

@ -0,0 +1,13 @@
project(
'efl-example-lifecycle-ui', 'c',
version : '0.0.1',
default_options: [ 'c_std=gnu99', 'warning_level=2' ],
meson_version : '>= 0.38.0')
eina = dependency('eina', version : '>=1.20.99')
efl = dependency('efl-ui', version : '>=1.20.99')
elm = dependency('elementary', version : '>=1.20.99')
inc = include_directories('.')
subdir('src')

@ -0,0 +1,57 @@
#define EFL_EO_API_SUPPORT 1
#define EFL_BETA_API_SUPPORT 1
#include <Eina.h>
#include <Elementary.h>
#include <Efl_Ui.h>
static void
_gui_quit_clicked_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
{
efl_exit(0);
}
static void
_gui_setup()
{
Eo *win;
win = efl_add(EFL_UI_WIN_CLASS, NULL,
efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
efl_ui_win_name_set(efl_added, "Lifecycle Example"),
efl_text_set(efl_added, "Hello World"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
efl_add(EFL_UI_BUTTON_CLASS, win,
efl_text_set(efl_added, "Quit"),
efl_content_set(win, efl_added),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
_gui_quit_clicked_cb, efl_added));
}
EAPI_MAIN void
efl_pause(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
{
printf("Lifecycle: paused\n");
}
EAPI_MAIN void
efl_resume(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
{
printf("Lifecycle: resumed\n");
}
EAPI_MAIN void
efl_terminate(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
{
printf("Lifecycle: terminated\n");
}
EAPI_MAIN void
efl_main(void *data EINA_UNUSED, const Efl_Event *ev)
{
printf("Lifecycle: launched\n");
_gui_setup();
}
EFL_MAIN_EX()

@ -0,0 +1,12 @@
src = files([
'lifecycle_main.c',
])
deps = [eina, efl, elm]
executable('efl_example_lifecycle_ui', src,
dependencies : deps,
include_directories : inc,
install : true
)
Loading…
Cancel
Save