129 lines
4.1 KiB
C++
129 lines
4.1 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 "textblock_intl_capi.h"
|
||
|
||
/* standard var */
|
||
static int done = 0;
|
||
|
||
/* private data */
|
||
evas::textblock *text_block;
|
||
|
||
/* setup */
|
||
static void _setup(void)
|
||
{
|
||
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'"
|
||
);
|
||
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/>"
|
||
"German: 'Heizölrückstoßabdämpfung'<br/>"
|
||
"Spanish: 'El pingüino Wenceslao hizo kilómetros bajo exhaustiva lluvia y'<br/>"
|
||
"French: 'Le cœur déçu mais l'âme plutôt naïve, Louÿs rêva de crapaüter en'<br/>"
|
||
"Irish Gaelic: 'D'fhuascail Íosa, Úrmhac na hÓighe Beannaithe, pór Éava agus Ádhaimh'<br/>"
|
||
"Hungarian: 'Árvíztűrő tükörfúrógép'<br/>"
|
||
"Icelandic: 'Kæmi ný öxi hér ykist þjófum nú bæði víl og ádrepa'<br/>"
|
||
"Japanese (hiragana): 'いろはにほへとちりぬるを'<br/>"
|
||
"Japanese (katakana): 'イロハニホヘト チリヌルヲ ワカヨタレソ ツネナラム'<br/>"
|
||
"Hebrew: 'דג סקרן שט בים מאוכזב ולפתע מצא לו חברה איך הקליטה?'<br/>"
|
||
"Polish: 'Pchnąć w tę łódź jeża lub ośm skrzyń fig'<br/>"
|
||
"Russian: 'В чащах юга жил бы цитрус? Да, но фальшивый экземпляр!'<br/>"
|
||
"IPA: 'ˈjunɪˌkoːd'<br/>"
|
||
"American Dictionary: 'Ūnĭcōde̽'<br/>"
|
||
"Anglo-saxon: 'ᛡᚢᚾᛁᚳᚩᛞ'<br/>"
|
||
"Arabic: 'يونِكود'<br/>"
|
||
"Armenian: 'Յունիկօդ'<br/>"
|
||
"Bengali: 'য়ূনিকোড'<br/>"
|
||
"Bopomofo: 'ㄊㄨㄥ˅ ㄧˋ ㄇㄚ˅'<br/>"
|
||
"Canadian Syllabics: 'ᔫᗂᑰᑦ'<br/>"
|
||
"Cherokee: 'ᏳᏂᎪᏛ'<br/>"
|
||
"Chinese: '萬國碼'<br/>"
|
||
"Ethiopic: 'ዩኒኮድ'<br/>"
|
||
"Georgian: 'უნიკოდი'<br/>"
|
||
"Greek: 'Γιούνικοντ'<br/>"
|
||
|
||
/* also test the html entity stuff a bit */
|
||
"Greek continued: 'τυλθ'<br/>"
|
||
|
||
"Gujarati: 'યૂનિકોડ'<br/>"
|
||
"Gurmukhi: 'ਯੂਨਿਕੋਡ'<br/>"
|
||
"Hindi: 'यूनिकोड'<br/>"
|
||
"Kannada: 'ಯೂನಿಕೋಡ್'<br/>"
|
||
"Khmer: 'យូនីគោដ'<br/>"
|
||
"Korean: '유니코드'<br/>"
|
||
"Malayalam: 'യൂനികോഡ്'<br/>"
|
||
"Ogham: 'ᚔᚒᚅᚔᚉᚑᚇ'<br/>"
|
||
"Oriya: 'ୟୂନିକୋଡ'<br/>"
|
||
"Persian: 'یونیکُد'<br/>"
|
||
"Sinhala: 'යණනිකෞද්'<br/>"
|
||
"Syriac: 'ܝܘܢܝܩܘܕ'<br/>"
|
||
"Tamil:'யூனிகோட்'<br/>"
|
||
"Telugu: 'యూనికోడ్'<br/>"
|
||
"Thai: 'ยูนืโคด'<br/>"
|
||
"Tibetan: 'ཨུ་ནི་ཀོཌྲ།'<br/>"
|
||
"Yiddish: 'יוניקאָד'<br/>"
|
||
);
|
||
text_block->visibility_set(true);
|
||
::evas_textblock_style_free(st);
|
||
|
||
done = 0;
|
||
}
|
||
|
||
/* 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 (text_block)
|
||
{
|
||
Evas_Coord x, y, w, h, w0, h0;
|
||
int i = 0;
|
||
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));
|
||
text_block->evas::object::position_set(x, y);
|
||
text_block->evas::object::size_set(w, h);
|
||
}
|
||
FPS_STD(NAME);
|
||
}
|
||
|
||
static void _key(char *key)
|
||
{
|
||
KEY_STD;
|
||
}
|
||
|
||
extern "C" void FNAME(void)
|
||
{
|
||
ui_func_set(_key, _loop);
|
||
_setup();
|
||
}
|