99 lines
2.3 KiB
C++
99 lines
2.3 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_change_capi.h"
|
|
|
|
/* standard var */
|
|
static int done = 0;
|
|
|
|
/* private data */
|
|
static efl::eina::list<evas::text> texts;
|
|
|
|
/* setup */
|
|
static void _setup(void)
|
|
{
|
|
evas::canvas canvas(::eo_ref(G_evas));
|
|
char buf[1024];
|
|
const char *strs[] = {
|
|
"Big", "Smelly", "Fish", "Pants", "Octopus", "Garden", "There", "I",
|
|
"Am", "You", "Are", "Erogenous", "We", "Stick", "Wet", "Fishy",
|
|
"Fiddly", "Family", "Lair", "Monkeys", "Magazine"
|
|
};
|
|
srnd();
|
|
for (int i = 0; i < OBNUM; i++)
|
|
{
|
|
evas::text o(efl::eo::parent = canvas);
|
|
texts.push_back(o);
|
|
o.font_set("Vera-Bold", 20);
|
|
snprintf(buf, sizeof(buf), "%s %s %s %s.", // XXX
|
|
strs[rnd() % (sizeof(strs) / sizeof(char *))],
|
|
strs[rnd() % (sizeof(strs) / sizeof(char *))],
|
|
strs[rnd() % (sizeof(strs) / sizeof(char *))],
|
|
strs[rnd() % (sizeof(strs) / sizeof(char *))]);
|
|
Evas_Coord w, h;
|
|
o.text_set(buf);
|
|
o.evas::object::color_set(0, 0, 0, 255);
|
|
o.evas::object::size_get(&w, &h);
|
|
Evas_Coord x = (win_w / 2) - (w / 2);
|
|
x += sin((double)((i * 13)) / (36.7 * SLOW)) * (w / 2);
|
|
Evas_Coord y = (win_h / 2) - (h / 2);
|
|
y += cos((double)((i * 28)) / (43.8 * SLOW)) * (w / 2);
|
|
o.evas::object::position_set(x, y);
|
|
o.evas::object::visibility_set(true);
|
|
}
|
|
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)
|
|
{
|
|
char buf[1024];
|
|
const char *strs[] = {
|
|
"Big", "Smelly", "Fish", "Pants", "Octopus", "Garden", "There", "I",
|
|
"Am", "You", "Are", "Erogenous", "We", "Stick", "Wet", "Fishy",
|
|
"Fiddly", "Family", "Lair", "Monkeys", "Magazine"
|
|
};
|
|
for (evas::text& text : texts)
|
|
{
|
|
snprintf(buf, sizeof(buf), "%s %s %s %s.",
|
|
strs[rnd() % (sizeof(strs) / sizeof(char *))],
|
|
strs[rnd() % (sizeof(strs) / sizeof(char *))],
|
|
strs[rnd() % (sizeof(strs) / sizeof(char *))],
|
|
strs[rnd() % (sizeof(strs) / sizeof(char *))]);
|
|
text.text_set(buf);
|
|
}
|
|
FPS_STD(NAME);
|
|
}
|
|
|
|
|
|
static void _key(char *key)
|
|
{
|
|
KEY_STD;
|
|
}
|
|
|
|
extern "C" void FNAME(void)
|
|
{
|
|
ui_func_set(_key, _loop);
|
|
_setup();
|
|
}
|