示例#1
0
文件: textblock.c 项目: clones/kaa
PyObject *
Evas_Object_PyObject_textblock_clear(Evas_Object_PyObject * self, PyObject * args)
{
    BENCH_START
    evas_object_textblock_clear(self->object);
    BENCH_END
    return Py_INCREF(Py_None), Py_None;
}
示例#2
0
/**
 * Add a textblock, and fill with text.
 *
 * Code comes straight from other examples.
 */
Evas_Object *
textblock_add(Evas *e, int x, int y){
	Evas_Object *o;
	Evas_Textblock_Style *st;

	o = evas_object_textblock_add(e);

	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'"
	      "/center='- \n'"
	      "right='+ font=Vera,Kochi font_size=10 align=right'"
	      "/right='- \n'"
	      "blockquote='+ left_margin=+24 right_margin=+24 font=Vera,Kochi font_size=10 align=left'"
	      "h1='+ font_size=20'"
	      "red='+ color=#ff0000'"
	      "p='+ font=Vera,Kochi font_size=10 align=left'"
	      "/p='- \n'"
	      "br='\n'"
	      "tab='\t'"
	      );
   evas_object_textblock_style_set(o, st);
   evas_textblock_style_free(st);
   evas_object_textblock_clear(o);
	evas_object_resize(o, 300,120);
evas_object_textblock_text_markup_set
     (o,
      "<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>"
      "<p>If you want a newline use &lt;br&gt;<br>woo a new line!</p>"
      "<right>Right "
      "<style=outline color=#fff outline_color=#000>aligned</> "
      "<style=shadow shadow_color=#fff8>text</> "
      "<style=soft_shadow shadow_color=#0002>should</> "
      "<style=glow color=#fff glow2_color=#fe87 glow_color=#f214 >go here</> "
      "<style=far_shadow shadow_color=#0005>as it is</> "
      "<style=outline_shadow color=#fff outline_color=#8228 shadow_color=#005>within</> "
     );

	evas_object_move(o,x,y);
	evas_object_show(o);

	return o;
}
示例#3
0
//Display subtitles corresponding to the current time
void eclair_subtitles_display_current_subtitle(Eclair_Subtitles *subtitles, double current_time, Evas_Object *subtitles_object)
{
#if 0  /* FIXME: convert to new textblock API. */
   char *current_subtitle, *sub, *new_line, *end_of_line;
   Evas_Coord subtitle_height, evas_width, evas_height;

   if (!subtitles || !subtitles_object || !subtitles->enable)
      return;

   evas_object_textblock_clear(subtitles_object);

   if (!(current_subtitle = eclair_subtitles_get_current_subtitle(subtitles, current_time)))
      return;

   evas_object_textblock_format_insert(subtitles_object, "color=#ffffffff outline_color=#000000ff style=outline font='Vera-Bold' size=24 wrap=word align=center valign=bottom");
   sub = strdup(current_subtitle);
   new_line = sub;
   while (new_line)
   {
      end_of_line = strpbrk(new_line, "\r\n");
      if (end_of_line)
         *end_of_line = 0;
      evas_object_textblock_text_insert(subtitles_object, new_line);
      if (end_of_line)
      {
         new_line = end_of_line + 1;
         if (*new_line == '\n' || *new_line == '\r')
            new_line++;
         evas_object_textblock_format_insert(subtitles_object, "\n");
      }
      else
         new_line = NULL;
   }
   free(sub);

   evas_output_size_get(evas_object_evas_get(subtitles_object), &evas_width, &evas_height);
	evas_object_textblock_format_size_get(subtitles_object, NULL, &subtitle_height);
   evas_object_move(subtitles_object, 0, evas_height - subtitle_height);
   evas_object_resize(subtitles_object, evas_width, subtitle_height);
#endif
}
示例#4
0
/* setup */
static void _setup(void)
{
   Evas_Object *o;
   Evas_Textblock_Style *st;

   o = evas_object_textblock_add(evas);
   o_text = o;
   st = evas_textblock_style_new();
   evas_textblock_style_set
     (st,
      "DEFAULT='font=Sans font_size=10 align=left color=#000000 wrap=word'"
      "br='\n'"
      );
   evas_object_textblock_style_set(o, st);
   evas_textblock_style_free(st);
   evas_object_textblock_clear(o);

   evas_object_textblock_text_markup_set
     (o,
      "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: '&tau;&upsilon;&lambda;&theta;'<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>"
      );

   evas_object_show(o);

   done = 0;
}
示例#5
0
/* setup */
static void _setup(void)
{
   Evas_Object *o;
   Evas_Textblock_Style *st;

   o = evas_object_textblock_add(evas);
   o_text = o;
   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'"
      "/center='- \n'"
      "right='+ font=Vera,Kochi font_size=10 align=right'"
      "/right='- \n'"
      "blockquote='+ left_margin=+24 right_margin=+24 font=Vera,Kochi font_size=10 align=left'"
      "h1='+ font_size=20'"
      "red='+ color=#ff0000'"
      "p='+ font=Vera,Kochi font_size=10 align=left'"
      "/p='- \n'"
      "br='\n'"
      "tab='\t'"
      );
   evas_object_textblock_style_set(o, st);
   evas_textblock_style_free(st);
   evas_object_textblock_clear(o);

   evas_object_textblock_text_markup_set
     (o,
      "<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>"
      "<p>If you want a newline use &lt;br&gt;<br>woo a new line!</p>"
      "<right>Right "
      "<style=outline color=#fff outline_color=#000>aligned</> "
      "<style=shadow shadow_color=#fff8>text</> "
      "<style=soft_shadow shadow_color=#0002>should</> "
      "<style=glow color=#fff glow2_color=#fe87 glow_color=#f214 >go here</> "
      "<style=far_shadow shadow_color=#0005>as it is</> "
      "<style=outline_shadow color=#fff outline_color=#8228 shadow_color=#005>within</> "
      "<style=outline_soft_shadow color=#fff outline_color=#8228 shadow_color=#0002>right tags</> "
      "<style=far_soft_shadow color=#fff shadow_color=#0002>to make it align to the</> "
      "<underline=on underline_color=#00f>right hand</> "
      "<backing=on backing_color=#fff8>side </><backing_color=#ff08>of</><backing_color=#0f08> </>"
      "<strikethrough=on strikethrough_color=#f0f8>the textblock</>.</right>"
      "<p>And "
      "<underline=double underline_color=#f00 underline2_color=#00f>now we need</> "
      "to test some <color=#f00 font_size=8>C</><color=#0f0 font_size=10>O</>"
      "<color=#00f font_size=12>L</><color=#fff font_size=14>O</>"
      "<color=#ff0 font_size=16>R</><color=#0ff font_size=18> Bla Rai</>"
      "<color=#f0f font_size=20> Stuff</>.</p>"
      "<backing=on backing_color=#f00 linesize=20>20 Linesize<br>"
      "<backing=on backing_color=#0f0 linesize=40>40 Linesize<br>"
      "<backing=on backing_color=#f00 linerelsize=100%>100 percent Linerelsize<br>"
      "<backing=on backing_color=#0f0 linerelsize=150%>150 percent Linerelsize<br>"
      "<backing=on backing_color=#00f linerelsize=200%>200 percent Linerelsize<br>"
      "<backing=off linerelsize=0%>"
      "<blockquote>"
      "(日本語 カタカナ ひらがな) "
      "<style=outline color=#fff outline_color=#000>Round about the cauldron go;</> "
      "In the poison'd entrails throw. "
      "<style=shadow shadow_color=#fff8>Toad, that under cold stone</> "
      "Days and nights has thirty-one "
      "<style=soft_shadow shadow_color=#0002>Swelter'd venom sleeping got,</> "
      "<style=glow color=#fff glow2_color=#fe87 glow_color=#f214 >Boil thou first i' the charmed pot.</> "
      "Double, double toil and trouble; "
      "Fire burn, and cauldron bubble. "
      "<style=far_shadow shadow_color=#0005>Fillet of a fenny snake,</> "
      "In the cauldron boil and bake; "
      "<style=outline_shadow color=#fff outline_color=#8228 shadow_color=#005>Eye of newt and toe of frog,</> "
      "<underline=on underline_color=#00f>Wool of bat and tongue of dog,</> "
      "<backing=on backing_color=#ff08>Adder's fork and blind-worm's sting,</> "
      "<underline=double underline_color=#f00 underline2_color=#00f>Lizard's leg and owlet's wing,</> "
      "<color=#808 font_size=20>For a charm of powerful trouble, "
      "Like a hell-broth boil and bubble. "
      "Double, double toil and trouble;</> "
      "Fire burn and cauldron bubble. "
      "Scale of dragon, tooth of wolf, "
      "Witches' mummy, maw and gulf "
      "Of the ravin'd salt-sea shark, "
      "Root of hemlock digg'd i' the dark, "
      "Liver of blaspheming Jew, "
      "Gall of goat, and slips of yew "
      "Silver'd in the moon's eclipse, "
      "Nose of Turk and Tartar's lips, "
      "Finger of birth-strangled babe "
      "Ditch-deliver'd by a drab, "
      "Make the gruel thick and slab: "
      "Add thereto a tiger's chaudron, "
      "For the ingredients of our cauldron. "
      "Double, double toil and trouble; "
      "Fire burn and cauldron bubble. "
      "Cool it with a baboon's blood, "
      "Then the charm is firm and good. "
      "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_object_show(o);

   done = 0;
}