forked from enlightenment/efl
wip
This commit is contained in:
parent
9e219e4eaa
commit
89c433009c
|
@ -1,27 +1,56 @@
|
|||
//Compile with:
|
||||
//gcc -g efl_ui_scroller_example.c -o efl_ui_scroller_example `pkg-config --cflags --libs elementary`
|
||||
#include <Efl_Ui.h>
|
||||
#include <Efreet.h>
|
||||
|
||||
static Efl_Ui_Spotlight_Container *over_container;
|
||||
|
||||
#define SCALE 0.5
|
||||
|
||||
static Efl_Ui_Table*
|
||||
_hs_screen_new(Eina_List *icons, Eina_Size2D goal_size)
|
||||
{
|
||||
Efl_Ui_Table *table;
|
||||
|
||||
table = efl_add(EFL_UI_TABLE_CLASS, over_container);
|
||||
|
||||
for (int y = 0; y < goal_size.h/(150*SCALE); ++y)
|
||||
{
|
||||
for (int x = 0; x < goal_size.w/(150*SCALE); ++x)
|
||||
{
|
||||
Eo *obj = efl_add(EFL_UI_BUTTON_CLASS, table,
|
||||
efl_text_set(efl_added, "Bla") );
|
||||
efl_pack_table(table, obj, x, y, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
return table;
|
||||
}
|
||||
|
||||
EAPI_MAIN void
|
||||
efl_main(void *data EINA_UNUSED, const Efl_Event *ev)
|
||||
efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
|
||||
{
|
||||
Eo *win, *scroller, *content;
|
||||
char buf[64];
|
||||
Eo *win;
|
||||
|
||||
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
||||
elm_app_info_set(efl_main, "elementary", "images/plant_01.jpg");
|
||||
|
||||
win = efl_add_ref(EFL_UI_WIN_CLASS, NULL, "TEST", ELM_WIN_BASIC,
|
||||
win = efl_new(EFL_UI_WIN_CLASS,
|
||||
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
|
||||
efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 400));
|
||||
efl_gfx_entity_size_set(win, EINA_SIZE2D(720*SCALE, 1280*SCALE));
|
||||
|
||||
scroller = efl_add(EFL_UI_SCROLLER_CLASS, win);
|
||||
efl_content_set(win, scroller);
|
||||
|
||||
content = efl_add(EFL_UI_IMAGE_CLASS, scroller);
|
||||
snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
|
||||
efl_file_simple_load(content, buf, NULL);
|
||||
efl_gfx_entity_size_set(content, EINA_SIZE2D(5000, 5000));
|
||||
efl_content_set(scroller, content);
|
||||
Efl_Ui_Spotlight_Indicator *indicator = efl_new(EFL_UI_SPOTLIGHT_INDICATOR_ICON_CLASS);
|
||||
Efl_Ui_Spotlight_Manager *scroll = efl_new(EFL_UI_SPOTLIGHT_MANAGER_SCROLL_CLASS);
|
||||
|
||||
over_container = efl_add(EFL_UI_SPOTLIGHT_CONTAINER_CLASS, win,
|
||||
efl_ui_spotlight_manager_set(efl_added, scroll),
|
||||
efl_ui_spotlight_indicator_set(efl_added, indicator)
|
||||
);
|
||||
efl_gfx_entity_size_set(over_container, EINA_SIZE2D(720*SCALE, 1280*SCALE));
|
||||
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
Eo *screen = _hs_screen_new(NULL, EINA_SIZE2D(720*SCALE, 1280*SCALE));
|
||||
|
||||
efl_pack_end(over_container, screen);
|
||||
}
|
||||
}
|
||||
EFL_MAIN()
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
executable('homescreen',
|
||||
'homescreen.c',
|
||||
dependencies: elementary,
|
||||
)
|
Loading…
Reference in New Issue