2010-08-08 23:43:33 -07:00
|
|
|
#undef FNAME
|
|
|
|
#undef NAME
|
|
|
|
#undef ICON
|
|
|
|
|
|
|
|
/* metadata */
|
|
|
|
#define FNAME widgets_list_2_grouped_start
|
|
|
|
#define NAME "Widgets List 2 Grouped"
|
|
|
|
#define ICON "widgets.png"
|
|
|
|
|
|
|
|
#ifndef PROTO
|
|
|
|
# ifndef UI
|
|
|
|
# include "main.h"
|
|
|
|
|
|
|
|
/* standard var */
|
|
|
|
static int done = 0;
|
|
|
|
/* private data */
|
|
|
|
#define NUM 512
|
|
|
|
#define ICON_SIZE 64
|
|
|
|
static Evas_Object *o_images[NUM];
|
|
|
|
static Evas_Object *o_texts[NUM];
|
|
|
|
|
2013-01-23 07:05:24 -08:00
|
|
|
static const char *labels[] =
|
2010-08-08 23:43:33 -07:00
|
|
|
{
|
|
|
|
"Andrew",
|
|
|
|
"Alex",
|
|
|
|
"Amanda",
|
|
|
|
"Arthur",
|
|
|
|
"Astrid",
|
|
|
|
"Avery",
|
2013-01-23 07:05:24 -08:00
|
|
|
|
2010-08-08 23:43:33 -07:00
|
|
|
"Beethoven",
|
|
|
|
"Billy",
|
|
|
|
"Bob",
|
|
|
|
"Bundy",
|
2013-01-23 07:05:24 -08:00
|
|
|
|
|
|
|
"Candy",
|
2010-08-08 23:43:33 -07:00
|
|
|
"Carsten",
|
2013-01-23 07:05:24 -08:00
|
|
|
|
2010-08-08 23:43:33 -07:00
|
|
|
"Danny",
|
|
|
|
"Dennis",
|
|
|
|
"Dirk",
|
|
|
|
"Doug",
|
2013-01-23 07:05:24 -08:00
|
|
|
|
2010-08-08 23:43:33 -07:00
|
|
|
"Edmond",
|
|
|
|
"Erik",
|
2013-01-23 07:05:24 -08:00
|
|
|
|
2010-08-08 23:43:33 -07:00
|
|
|
"Fernando",
|
|
|
|
"Frank",
|
|
|
|
"Frederick",
|
2013-01-23 07:05:24 -08:00
|
|
|
|
2010-08-08 23:43:33 -07:00
|
|
|
"Gabby",
|
|
|
|
"George",
|
|
|
|
"Gilroy",
|
|
|
|
"Goodrich",
|
|
|
|
"Gumby",
|
|
|
|
};
|
|
|
|
|
|
|
|
/* setup */
|
|
|
|
static void _setup(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
Evas_Object *o;
|
|
|
|
for (i = 0; i < NUM; i++)
|
|
|
|
{
|
2016-08-22 03:00:56 -07:00
|
|
|
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
2013-01-23 07:05:24 -08:00
|
|
|
o_images[i] = o;
|
2018-06-18 14:17:48 -07:00
|
|
|
efl_gfx_image_border_set(o, 2, 2, 2, 2);
|
2019-03-13 17:17:36 -07:00
|
|
|
efl_file_simple_load(o, build_path("pan.png"), NULL);
|
2018-06-18 14:17:48 -07:00
|
|
|
efl_gfx_entity_size_set(o, EINA_SIZE2D(win_w, ICON_SIZE));
|
|
|
|
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
2013-01-23 07:05:09 -08:00
|
|
|
|
2016-05-26 02:29:05 -07:00
|
|
|
o = evas_object_text_add(evas);
|
2010-08-08 23:43:33 -07:00
|
|
|
o_texts[i] = o;
|
2018-06-18 14:17:48 -07:00
|
|
|
efl_text_font_set(o, "Vera-Bold", 10);
|
2016-03-03 06:03:49 -08:00
|
|
|
efl_text_set(o, labels[i % 26]);
|
|
|
|
efl_gfx_color_set(o, 0, 0, 0, 255);
|
2018-06-18 14:17:48 -07:00
|
|
|
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
2010-08-08 23:43:33 -07:00
|
|
|
}
|
|
|
|
for (i = 0; i < NUM; i++)
|
|
|
|
{
|
2019-03-13 17:21:51 -07:00
|
|
|
efl_gfx_stack_raise_to_top(o_images[i]);
|
2010-08-08 23:43:33 -07:00
|
|
|
}
|
|
|
|
for (i = 0; i < NUM; i++)
|
|
|
|
{
|
2019-03-13 17:21:51 -07:00
|
|
|
efl_gfx_stack_raise_to_top(o_texts[i]);
|
2010-08-08 23:43:33 -07:00
|
|
|
}
|
|
|
|
done = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* cleanup */
|
|
|
|
static void _cleanup(void)
|
|
|
|
{
|
|
|
|
int i;
|
2014-08-21 15:48:19 -07:00
|
|
|
for (i = 0; i < NUM; i++)
|
|
|
|
{
|
2016-08-22 03:00:56 -07:00
|
|
|
efl_del(o_images[i]);
|
|
|
|
efl_del(o_texts[i]);
|
2014-08-21 15:48:19 -07:00
|
|
|
}
|
2010-08-08 23:43:33 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* loop - do things */
|
|
|
|
static void _loop(double t, int f)
|
|
|
|
{
|
|
|
|
int i;
|
2011-04-24 10:14:34 -07:00
|
|
|
Evas_Coord x, y, tw, th, cent;
|
2010-08-08 23:43:33 -07:00
|
|
|
x = 0;
|
|
|
|
y = 0 - f;
|
|
|
|
for (i = 0; i < NUM; i++)
|
|
|
|
{
|
2018-06-18 14:17:48 -07:00
|
|
|
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
|
|
|
exp_size_get(o_texts[i], &tw, &th);
|
2010-08-08 23:43:33 -07:00
|
|
|
cent = (ICON_SIZE - th) / 2;
|
2018-06-18 14:17:48 -07:00
|
|
|
efl_gfx_entity_position_set(o_texts[i], EINA_POSITION2D(x + 8, y + cent));
|
2010-08-08 23:43:33 -07:00
|
|
|
y += ICON_SIZE;
|
|
|
|
}
|
|
|
|
FPS_STD(NAME);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* prepend special key handlers if interactive (before STD) */
|
2016-07-19 02:21:56 -07:00
|
|
|
static void _key(const char *key)
|
2010-08-08 23:43:33 -07:00
|
|
|
{
|
|
|
|
KEY_STD;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* template stuff - ignore */
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef UI
|
|
|
|
_ui_menu_item_add(ICON, NAME, FNAME);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef PROTO
|
|
|
|
void FNAME(void);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef PROTO
|
|
|
|
# ifndef UI
|
|
|
|
void FNAME(void)
|
|
|
|
{
|
|
|
|
ui_func_set(_key, _loop);
|
|
|
|
_setup();
|
|
|
|
}
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
#undef FNAME
|
|
|
|
#undef NAME
|
|
|
|
#undef ICON
|