91 lines
1.9 KiB
C++
91 lines
1.9 KiB
C++
|
|
#ifdef HAVE_CONFIG_H
|
|
# include <config.h>
|
|
#endif
|
|
|
|
#include "Eo.h"
|
|
#include "Evas.h"
|
|
|
|
#include "Eo.hh"
|
|
#include "Eina.hh"
|
|
#include "Evas.hh"
|
|
|
|
#include "main.h"
|
|
|
|
#define EXPEDITE_CXX_TEST_IMPL
|
|
#include "text_styles_capi.h"
|
|
|
|
/* standard var */
|
|
static int done = 0;
|
|
|
|
/* private data */
|
|
static efl::eina::list<evas::text> texts;
|
|
|
|
inline Evas_Text_Style_Type
|
|
operator++(Evas_Text_Style_Type const& x)
|
|
{
|
|
int val = static_cast<int>(x);
|
|
return static_cast<Evas_Text_Style_Type>(val++);
|
|
}
|
|
|
|
/* setup */
|
|
static void _setup(void)
|
|
{
|
|
evas::canvas canvas(::eo_ref(G_evas));
|
|
Evas_Text_Style_Type st = EVAS_TEXT_STYLE_SHADOW;
|
|
for (int i = 0; i < OBNUM; i++)
|
|
{
|
|
evas::text o(efl::eo::parent = canvas);
|
|
texts.push_back(o);
|
|
o.font_set("Vera-Bold", 20);
|
|
o.text_set("This is a test string");
|
|
o.style_set(st);
|
|
o.evas::object::color_set(255, 255, 255, 255);
|
|
o.shadow_color_set(0, 0, 0, 24);
|
|
o.glow_color_set(100, 80, 40, 100);
|
|
o.glow2_color_set(50, 10, 5, 50);
|
|
o.outline_color_set(0, 0, 0, 255);
|
|
o.visibility_set(true);
|
|
++st;
|
|
if (st > EVAS_TEXT_STYLE_FAR_SOFT_SHADOW) st = EVAS_TEXT_STYLE_SHADOW;
|
|
}
|
|
done = 0;
|
|
}
|
|
|
|
/* cleanup */
|
|
static void _cleanup(void)
|
|
{
|
|
for (evas::text& t : texts)
|
|
t.parent_set(efl::eo::base(nullptr));
|
|
texts.clear();
|
|
}
|
|
|
|
/* loop - do things */
|
|
static void _loop(double t, int f)
|
|
{
|
|
Evas_Coord x, y, w, h;
|
|
int i = 0;
|
|
for (evas::text& t : texts)
|
|
{
|
|
t.evas::object::size_get(&w, &h);
|
|
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);
|
|
t.evas::object::position_set(x, y);
|
|
++i;
|
|
}
|
|
FPS_STD(NAME);
|
|
}
|
|
|
|
static void _key(char *key)
|
|
{
|
|
KEY_STD;
|
|
}
|
|
|
|
extern "C" void FNAME(void)
|
|
{
|
|
ui_func_set(_key, _loop);
|
|
_setup();
|
|
}
|