2007-04-11 04:58:32 -07:00
|
|
|
#undef FNAME
|
|
|
|
#undef NAME
|
|
|
|
#undef ICON
|
|
|
|
|
|
|
|
/* metadata */
|
|
|
|
#define FNAME text_styles_start
|
|
|
|
#define NAME "Text Styles"
|
2010-01-18 19:07:39 -08:00
|
|
|
#define ICON "text.png"
|
2007-04-11 04:58:32 -07:00
|
|
|
|
|
|
|
#ifndef PROTO
|
|
|
|
# ifndef UI
|
|
|
|
# include "main.h"
|
|
|
|
|
|
|
|
/* standard var */
|
|
|
|
static int done = 0;
|
|
|
|
|
|
|
|
/* private data */
|
|
|
|
static Evas_Object *o_texts[OBNUM];
|
|
|
|
|
|
|
|
/* setup */
|
|
|
|
static void _setup(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
Evas_Object *o;
|
|
|
|
Evas_Text_Style_Type st;
|
|
|
|
|
|
|
|
st = EVAS_TEXT_STYLE_SHADOW;
|
|
|
|
for (i = 0; i < OBNUM; i++)
|
|
|
|
{
|
2016-05-26 02:29:05 -07:00
|
|
|
o = evas_object_text_add(evas);
|
2007-04-11 04:58:32 -07:00
|
|
|
o_texts[i] = o;
|
2016-03-03 06:03:49 -08:00
|
|
|
efl_text_properties_font_set(o, "Vera-Bold", 20);
|
|
|
|
efl_text_set(o, "This is a test string");
|
2016-05-26 02:29:05 -07:00
|
|
|
evas_object_text_style_set(o, st);
|
2016-03-03 06:03:49 -08:00
|
|
|
efl_gfx_color_set(o, 255, 255, 255, 255);
|
2016-05-26 02:29:05 -07:00
|
|
|
evas_object_text_shadow_color_set(o, 0, 0, 0, 24);
|
|
|
|
evas_object_text_glow_color_set(o, 100, 80, 40, 100);
|
|
|
|
evas_object_text_glow2_color_set(o, 50, 10, 5, 50);
|
|
|
|
evas_object_text_outline_color_set(o, 0, 0, 0, 255);
|
2016-03-03 06:03:49 -08:00
|
|
|
efl_gfx_visible_set(o, EINA_TRUE);
|
2007-04-11 04:58:32 -07:00
|
|
|
st++;
|
|
|
|
if (st > EVAS_TEXT_STYLE_FAR_SOFT_SHADOW) st = EVAS_TEXT_STYLE_SHADOW;
|
|
|
|
}
|
|
|
|
done = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* cleanup */
|
|
|
|
static void _cleanup(void)
|
|
|
|
{
|
|
|
|
int i;
|
2016-07-19 02:25:00 -07:00
|
|
|
for (i = 0; i < OBNUM; i++) eo_del(o_texts[i]);
|
2007-04-11 04:58:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* loop - do things */
|
|
|
|
static void _loop(double t, int f)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
Evas_Coord x, y, w, h;
|
|
|
|
for (i = 0; i < OBNUM; i++)
|
|
|
|
{
|
2016-03-03 06:03:49 -08:00
|
|
|
efl_gfx_size_get(o_texts[i], &w, &h);
|
2007-04-11 04:58:32 -07:00
|
|
|
x = (win_w / 2) - (w / 2);
|
|
|
|
x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
|
|
|
|
y = (win_h / 2) - (h / 2);
|
|
|
|
y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (w / 2);
|
2016-03-03 06:03:49 -08:00
|
|
|
efl_gfx_position_set(o_texts[i], x, y);
|
2007-04-11 04:58:32 -07:00
|
|
|
}
|
|
|
|
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)
|
2007-04-11 04:58:32 -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
|