2017-12-06 04:46:15 -08:00
|
|
|
#define EFL_BETA_API_SUPPORT 1
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include <Eina.h>
|
|
|
|
#include <Elementary.h>
|
|
|
|
#include <Efl_Ui.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Efl.Ui translation exmaples.
|
|
|
|
*
|
|
|
|
* Efl.Ui contains a way to manage translations provided by gettext or
|
|
|
|
* other translation provider. This example shows how to set it up and to
|
|
|
|
* extract strings for translation. (see src/meson.build).
|
|
|
|
*
|
|
|
|
* The gettext extraction command is:
|
|
|
|
* "xgettext --keyword=efl_ui_translatable_text_set:2 --from-code=utf-8 --foreign-user"
|
|
|
|
*
|
|
|
|
* In this project you can go to build/ and execute "ninja example_translation-pot"
|
|
|
|
*/
|
|
|
|
#define _TEXT_DOMAIN "example_translation"
|
|
|
|
|
2017-12-13 04:53:11 -08:00
|
|
|
// quit the app, called if the user clicks the Quit button or the window is deleted
|
|
|
|
static void
|
|
|
|
_gui_quit_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
|
|
|
|
{
|
|
|
|
efl_exit(0);
|
|
|
|
}
|
|
|
|
|
2017-12-06 04:46:15 -08:00
|
|
|
EAPI_MAIN void
|
|
|
|
efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Efl_Ui_Win *win, *box;
|
|
|
|
|
2018-05-25 10:17:51 -07:00
|
|
|
win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
|
2019-03-05 00:30:09 -08:00
|
|
|
efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC),
|
2018-05-25 10:17:51 -07:00
|
|
|
efl_text_set(efl_added, "Translations"),
|
2017-12-06 04:46:15 -08:00
|
|
|
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
|
|
|
|
|
2017-12-13 04:53:11 -08:00
|
|
|
// when the user clicks "close" on a window there is a request to delete
|
|
|
|
efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _gui_quit_cb, NULL);
|
|
|
|
|
2017-12-06 04:46:15 -08:00
|
|
|
box = efl_add(EFL_UI_BOX_CLASS, win,
|
|
|
|
efl_content_set(win, efl_added));
|
|
|
|
|
|
|
|
efl_add(EFL_UI_BUTTON_CLASS, win,
|
2019-01-18 04:35:35 -08:00
|
|
|
efl_ui_l10n_text_set(efl_added, "Translations", _TEXT_DOMAIN),
|
2017-12-06 04:46:15 -08:00
|
|
|
efl_pack_end(box, efl_added));
|
|
|
|
|
|
|
|
efl_add(EFL_UI_BUTTON_CLASS, win,
|
2019-01-18 04:35:35 -08:00
|
|
|
efl_ui_l10n_text_set(efl_added, "Help", _TEXT_DOMAIN),
|
2017-12-06 04:46:15 -08:00
|
|
|
efl_pack_end(box, efl_added));
|
|
|
|
|
|
|
|
efl_add(EFL_UI_BUTTON_CLASS, win,
|
2019-01-18 04:35:35 -08:00
|
|
|
efl_ui_l10n_text_set(efl_added, "Quit", _TEXT_DOMAIN),
|
2017-12-06 04:46:15 -08:00
|
|
|
efl_pack_end(box, efl_added),
|
2019-03-02 07:38:07 -08:00
|
|
|
efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(100, 100)),
|
2019-08-16 11:30:41 -07:00
|
|
|
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED,
|
2017-12-13 04:53:11 -08:00
|
|
|
_gui_quit_cb, efl_added));
|
2017-12-06 04:46:15 -08:00
|
|
|
|
2018-04-23 03:27:50 -07:00
|
|
|
efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 320));
|
2017-12-06 04:46:15 -08:00
|
|
|
}
|
|
|
|
EFL_MAIN()
|
|
|
|
|