expedite-cxx: Finished textblock tests.

This commit is contained in:
Savio Sena 2014-10-06 18:37:03 -03:00
parent 2a2cc7260c
commit 55a7eae96f
4 changed files with 73 additions and 98 deletions

View File

@ -19,26 +19,21 @@
static int done = 0;
/* private data */
//static evas::textblock text; // XXX not allowed to
static evas::textblock *text_block;
/* setup */
static void _setup(void)
{
#if 0
evas::canvas canvas(::eo_ref(G_evas));
Evas_Textblock_Style *st;
o = eo_add(EVAS_TEXTBLOCK_CLASS, G_evas);
o_text = o;
st = evas_textblock_style_new();
evas_textblock_style_set
text_block = new evas::textblock(efl::eo::parent = canvas);
Evas_Textblock_Style *st = ::evas_textblock_style_new();
::evas_textblock_style_set
(st,
"DEFAULT='font=Sans font_size=10 color=#000000 wrap=word'"
);
eo_do(o,
evas_obj_textblock_style_set(st),
evas_obj_textblock_clear(),
evas_obj_textblock_text_markup_set(
text_block->style_set(st);
text_block->clear();
text_block->text_markup_set(
"This is a test of auto alignment in Evas<ps/>"
"<br/>"
"This text should be left aligned<ps/>"
@ -56,37 +51,35 @@ static void _setup(void)
"words should appear in the following order: 'דוגמה' first, 'of' second,<br/>"
"'טקסט' third, 'english' fourth and 'in' fifth, counting from right to left<ps/>"
"דוגמה of טקסט in english."
),
evas_obj_visibility_set(EINA_TRUE));
evas_textblock_style_free(st);
);
text_block->visibility_set(true);
::evas_textblock_style_free(st);
done = 0;
#endif // XXX
}
/* cleanup */
static void _cleanup(void)
{
text_block->parent_set(efl::eo::base(nullptr));
delete text_block;
}
/* loop - do things */
static void _loop(double t, int f)
{
#if 0
Evas_Coord x, y, w, h, w0, h0;
int i = 0;
if (!text_block) goto fps; // XXX
eo_do(o_text, evas_obj_textblock_size_native_get(&w0, &h0));
text_block->size_native_get(&w0, &h0);
w = w0;
h = h0;
w += fabs(sin((double)(f + (i * 13)) / (31.1 * SLOW))) * (w0);
x = (win_w / 2) - (w / 2);
y = (win_h / 2) - (h0 / 2);
eo_do(o_text,
evas_obj_position_set(x, y),
evas_obj_size_set(w, h));
#endif /// XXX
text_block->evas::object::position_set(x, y);
text_block->evas::object::size_set(w, h);
fps:
FPS_STD(NAME);
}

View File

@ -19,19 +19,16 @@
static int done = 0;
/* private data */
// static evas::text text; // XXX not allowed to
static evas::textblock *text_block;
/* setup */
static void _setup(void)
{
#if 0
Evas_Object *o;
Evas_Textblock_Style *st;
o = eo_add(EVAS_TEXTBLOCK_CLASS, G_evas);
o_text = o;
st = evas_textblock_style_new();
evas_textblock_style_set
evas::canvas canvas(::eo_ref(G_evas));
text_block = new evas::textblock(efl::eo::parent = canvas);
Evas_Textblock_Style *st = ::evas_textblock_style_new();
::evas_textblock_style_set
(st,
"DEFAULT='font=Vera,Kochi font_size=8 align=left color=#000000 wrap=word'"
"center='+ font=Vera,Kochi font_size=10 align=center'"
@ -44,10 +41,9 @@ static void _setup(void)
"p='+ font=Vera,Kochi font_size=10 align=left'"
"/p='- \n'"
);
eo_do(o,
evas_obj_textblock_style_set(st),
evas_obj_textblock_clear(),
evas_obj_textblock_text_markup_set(
text_block->style_set(st);
text_block->clear();
text_block->text_markup_set(
"<center><h1>Title</h1></center><br/>"
"<p><tab>A pragraph here <red>red text</red> and stuff.</p>"
"<p>And escaping &lt; and &gt; as well as &amp; as <h1>normal.</h1></p>"
@ -116,27 +112,27 @@ static void _setup(void)
"Heizölrückstoßabdämpfung fløde pingüino kilómetros cœur déçu l'âme "
"plutôt naïve Louÿs rêva crapaüter Íosa Úrmhac Óighe pór Éava Ádhaim"
"</blockquote>"
),
evas_obj_visibility_set(EINA_TRUE));
evas_textblock_style_free(st);
);
text_block->visibility_set(true);
::evas_textblock_style_free(st);
done = 0;
#endif // XXX
}
/* cleanup */
static void _cleanup(void)
{
text_block->parent_set(efl::eo::base(nullptr));
delete text_block;
}
/* loop - do things */
static void _loop(double t, int f)
{
#if 0
Evas_Coord x, y, w, h, w0, h0;
int i = 0;
if (!text_block) goto fps; // XXX
w0 = 160;
h0 = 120;
w = 150 + ((1.0 + cos((double)(f + (i * 10)) / (37.4 * SLOW) )) * w0 * 2);
@ -145,11 +141,10 @@ static void _loop(double t, int f)
x += sin((double)(f + (i * 13)) / (86.7 * SLOW)) * (w0 / 2);
y = (win_h / 2) - (h / 2);
y += cos((double)(f + (i * 28)) / (93.8 * SLOW)) * (h0 / 2);
eo_do(o_text,
evas_obj_position_set(x, y),
evas_obj_size_set(w, 5000));
#endif
FPS_STD(NAME);
text_block->evas::object::position_set(x, y);
text_block->evas::object::size_set(w, 5000);
fps:
FPS_STD(NAME);
}
static void _key(char *key)

View File

@ -19,26 +19,21 @@
static int done = 0;
/* private data */
//evas::text text; // XXX not allowed to
evas::textblock *text_block;
/* setup */
static void _setup(void)
{
#if 0
Evas_Object *o;
Evas_Textblock_Style *st;
o = eo_add(EVAS_TEXTBLOCK_CLASS, G_evas);
o_text = o;
st = evas_textblock_style_new();
evas_textblock_style_set
evas::canvas canvas(::eo_ref(G_evas));
text_block = new evas::textblock(efl::eo::parent = canvas);
Evas_Textblock_Style *st = ::evas_textblock_style_new();
::evas_textblock_style_set
(st,
"DEFAULT='font=Sans font_size=10 align=left color=#000000 wrap=word'"
);
eo_do(o,
evas_obj_textblock_style_set(st),
evas_obj_textblock_clear(),
evas_obj_textblock_text_markup_set(
text_block->style_set(st);
text_block->clear();
text_block->text_markup_set(
"This is a test of International test rendering in Evas<br/>"
"<br/>"
"Danish: 'Quizdeltagerne spiste jordbær med fløde, mens cirkusklovnen'<br/>"
@ -87,39 +82,36 @@ static void _setup(void)
"Thai: 'ยูนืโคด'<br/>"
"Tibetan: 'ཨུ་ནི་ཀོཌྲ།'<br/>"
"Yiddish: 'יוניקאָד'<br/>"
),
evas_obj_visibility_set(EINA_TRUE));
evas_textblock_style_free(st);
);
text_block->visibility_set(true);
::evas_textblock_style_free(st);
done = 0;
#endif // XXX
}
/* cleanup */
static void _cleanup(void)
{
text_block->parent_set(efl::eo::base(nullptr));
delete text_block;
}
/* loop - do things */
static void _loop(double t, int f)
{
#if 0
Evas_Coord x, y, w, h, w0, h0;
int i = 0;
eo_do(o_text, evas_obj_textblock_size_native_get(&w0, &h0));
if (!text_block) goto fps; // XXX
text_block->size_native_get(&w0, &h0);
w = w0;
h = h0;
x = (win_w / 2) - (w / 2);
x += sin((double)(f + (i * 13)) / (31.1 * SLOW)) * (w0 / (2 * 2));
y = (win_h / 2) - (h / 2);
y += cos((double)(f + (i * 28)) / (19.6 * SLOW)) * (h0 / (2 * 2));
eo_do(o_text,
evas_obj_position_set(x, y),
evas_obj_size_set(w, h));
#endif // XXX
text_block->evas::object::position_set(x, y);
text_block->evas::object::size_set(w, h);
fps:
FPS_STD(NAME);
}

View File

@ -19,26 +19,21 @@
static int done = 0;
/* private data */
// static evas::text text; // XXX not allowed to
static evas::textblock *text_block;
/* setup */
static void _setup(void)
{
#if 0
Evas_Object *o;
Evas_Textblock_Style *st;
o = eo_add(EVAS_TEXTBLOCK_CLASS, G_evas);
o_text = o;
st = evas_textblock_style_new();
evas_textblock_style_set
evas::canvas canvas(::eo_ref(G_evas));
text_block = new evas::textblock(efl::eo::parent = canvas);
Evas_Textblock_Style *st = ::evas_textblock_style_new();
::evas_textblock_style_set
(st,
"DEFAULT='font=Sans font_size=10 color=#000000 wrap=word'"
);
eo_do(o,
evas_obj_textblock_style_set(st),
evas_obj_textblock_clear(),
evas_obj_textblock_text_markup_set(
text_block->style_set(st);
text_block->clear();
text_block->text_markup_set(
"This test just appends and removes text from different paragraphs, it's "
"not a very visual test, it's included for benchmarking purposes."
"<ps/>"
@ -97,36 +92,37 @@ static void _setup(void)
"Graphics"
"<ps/>"
"Enlightenment is built by designers and programmers who want others to be able to do more with less. Some of Enlightenment's libraries do not do anything with graphics at all, but it is the ones that do that are the shining stars of the Enlightenment world.<ps/>Evas is the canvas layer. It is not a drawing library. It is not like OpenGL, Cairo, XRender, GDI, DirectFB etc. It is a scene graph library that retains state of all objects in it. They are created then manipulated until they are no longer needed, at which point they are deleted. This allows the programmer to work in terms that a designer thinks of. It is direct mapping, as opposed to having to convert the concepts into drawing commands in the right order, calculate minimum drawing calls needed to get the job done etc.<ps/>Evas also handles abstracting the rendering mechanism. With zero changes the same application can move from software to OpenGL rendering, as they all use an abstracted scene graph to describe the world (canvas) to Evas. Evas supports multiple targets, but the most useful are the high-speed software rendering engines and OpenGL (as well as OpenGL-ES 2.0).<ps/>Evas not only does quality rendering and compositing, but also can scale, rotate and fully 3D transform objects, allowing for sought-after 3D effects in your interfaces. It supplies these abilities in both software and OpenGL rendering, so you are never caught with unexpected loss of features. The software rendering is even fast enough to provide the 3D without any acceleration on devices for simple uses.<ps/>Edje is a meta-object design library that is somewhere between Flash, PSD, SVG and HTML+CSS. It separates design out from code and into a dynamically loaded data file. This file is compressed and loaded very quickly, along with being cached and shared betweeen instances.<ps/>This allows design to be provided at runtime by different design (EDJ) files, leaving the programmer to worry about overall application implementation and coarse grained UI as opposed to needing to worry about all the little details that the artists may vary even until the day before shipping the product.<br/>"
),
evas_obj_position_set(0, 0),
evas_obj_size_set(win_w, win_h),
evas_obj_visibility_set(EINA_TRUE));
evas_textblock_style_free(st);
);
text_block->evas::object::position_set(0, 0);
text_block->evas::object::size_set(win_w, win_h);
text_block->visibility_set(true);
::evas_textblock_style_free(st);
done = 0;
#endif // XXX
}
/* cleanup */
static void _cleanup(void)
{
text_block->parent_set(efl::eo::base(nullptr));
delete text_block;
}
/* loop - do things */
static void _loop(double t, int f)
{
#if 0
Evas_Textblock_Cursor *cur;
static Evas_Textblock_Cursor *cur2;
eo_do(o_text, cur = evas_obj_textblock_cursor_get());
if (!text_block) goto fps; // XXX
cur = text_block->cursor_get();
evas_textblock_cursor_text_append(cur, "*");
evas_textblock_cursor_char_delete(cur);
evas_textblock_cursor_paragraph_char_first(cur);
if (!cur2)
{
eo_do(o_text, cur2 = evas_obj_textblock_cursor_new());
cur2 = text_block->cursor_new();
evas_textblock_cursor_paragraph_last(cur2);
evas_textblock_cursor_paragraph_char_first(cur2);
}
@ -134,8 +130,7 @@ static void _loop(double t, int f)
evas_textblock_cursor_paragraph_first(cur);
else
evas_textblock_cursor_paragraph_next(cur);
#endif // XXX
fps:
FPS_STD(NAME);
}