Ejemplo n.º 1
0
static void
display_help(Evas *e)
{
    Evas_Textblock_Style *style;
    int h_win, w_win;

    evas_output_viewport_get(e, NULL, NULL, &w_win, &h_win);

    help_background = evas_object_rectangle_add(e);
    help_text_cmd = evas_object_textblock_add(e);
    help_text_desc = evas_object_textblock_add(e);

    style =  evas_textblock_style_new();
    evas_font_path_append(e,PACKAGE_DATA_DIR"/viewer");
    evas_textblock_style_set(style,"DEFAULT='font=DejaVuSans-Bold font_size=20 align=left color=#000000 wrap=word style=soft_outline outline_color=#3779cb'"
                             "NewLine= '+\n'");

    evas_object_resize(help_text_cmd, w_win,h_win);
    evas_object_move(help_text_cmd,200,140);
    evas_object_show(help_text_cmd);

    evas_object_textblock_style_set(help_text_cmd,style);
    evas_object_textblock_text_markup_set(help_text_cmd,help_msg_cmd);

    evas_object_resize(help_text_desc, w_win,h_win);
    evas_object_move(help_text_desc,450,140);
    evas_object_show(help_text_desc);

    evas_object_textblock_style_set(help_text_desc,style);
    evas_object_textblock_text_markup_set(help_text_desc,help_msg_desc);



    evas_object_show(help_background);
    evas_object_color_set(help_background, 0, 0, 0, 200);
    evas_object_resize(help_background, w_win,h_win);
    evas_object_move(help_background,0,0);

    is_help = 1;
}
Ejemplo n.º 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;
}
Ejemplo n.º 3
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;
}
Ejemplo n.º 4
0
int
main(int argc, char *argv[])
{
  Ecore_Evas            *ee;
  Evas                  *evas;
  Evas_Object           *textblock;
  Evas_Object           *background;
  Ertf_Document         *doc;
  Ertf_Page             *epage;
  int                    w, h, dpi;
  int                    pageno;

  if (argc < 3)
  {
    printf ("Usage: %s file.rtf <page_number>\n", argv[0]);
    return EXIT_FAILURE;
  }

  if (!ecore_evas_init())
    return EXIT_FAILURE;

  if (!ertf_init())
    goto shutdown_ecore_evas;

  ee = ecore_evas_new("software_x11", 0, 0, 1024, 768, NULL);
  if (!ee)
    goto shutdown_ertf;

  ecore_evas_title_set(ee, "Ertf Evas test"); 
  ecore_evas_callback_delete_request_set(ee, _ertf_cb_delete);

  evas = ecore_evas_get(ee);

  doc = ertf_document_new(argv[1]);
  if (!doc)
    goto shutdown_ertf;

  epage = ertf_page_new(doc);
  if (!epage)
    goto free_doc;

#ifdef USE_DPI
  dpi = ecore_x_dpi_get();
  ertf_twip_scale_factor_set(dpi);
  printf("Using dpi.\n");
#endif
  
  ertf_document_size_get(doc, &w, &h);
  ecore_evas_resize(ee, w, h);
  ecore_evas_show(ee);

  if (!ertf_document_parse(doc))
    goto free_page;

  printf ("Filename : %s\n", ertf_document_filename_get(doc));
  printf ("Version  : %d\n", ertf_document_version_get(doc));  

  /* background */
  background = evas_object_rectangle_add(evas);
  evas_object_color_set(background, 255, 255, 255, 255);
  evas_object_move(background, 0, 0);
  evas_object_resize(background, w, h);
  evas_object_name_set(background, "background");
  evas_object_show(background);

  /* create an textblock object */
  textblock = evas_object_textblock_add(evas);
  sscanf(argv[2], "%d", &pageno);
  ertf_page_page_set(epage, pageno);
  ertf_page_render(epage, textblock);
  evas_object_move(textblock, 0, 0);
  evas_object_resize(textblock, w, h);
  evas_object_show(textblock);

  ecore_main_loop_begin ();

  evas_object_del(textblock);
  ertf_page_free(epage);
  ertf_document_free(doc);
  ertf_shutdown();
  ecore_evas_shutdown();

  return EXIT_SUCCESS;

 free_page:
  ertf_page_free(epage);
 free_doc:
  ertf_document_free(doc);
 shutdown_ertf:
  ertf_shutdown();
 shutdown_ecore_evas:
  ecore_evas_shutdown();
 
  return EXIT_FAILURE;
}
Ejemplo n.º 5
0
int
_edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *group, const char *parent, Eina_List *group_path)
{
   Edje *ed;
   Evas *tev;
   Edje_Real_Part *rp;
   Eina_List *textblocks = NULL;
   Eina_List *sources = NULL;
   Eina_List *externals = NULL;
   Eina_List *old_swallows;
   unsigned int n;
   Eina_List *parts = NULL;
   int group_path_started = 0;

   ed = _edje_fetch(obj);
   if (!ed) return 0;
   if (!file) file = "";
   if (!group) group = "";
   if (((ed->path) && (!strcmp(file, ed->path))) &&
       (ed->group) && (!strcmp(group, ed->group)))
     return 1;

   tev = evas_object_evas_get(obj);
   evas_event_freeze(tev);
   old_swallows = _edje_swallows_collect(ed);

   if (_edje_script_only(ed)) _edje_script_only_shutdown(ed);
   if (_edje_lua_script_only(ed)) _edje_lua_script_only_shutdown(ed);
   _edje_file_del(ed);

   eina_stringshare_replace(&ed->path, file);
   eina_stringshare_replace(&ed->group, group);

   ed->parent = eina_stringshare_add(parent);

   ed->load_error = EDJE_LOAD_ERROR_NONE;
   _edje_file_add(ed);
   ed->block_break = 0;

   if (ed->file && ed->file->external_dir)
     {
	unsigned int i;

	for (i = 0; i < ed->file->external_dir->entries_count; ++i)
	  edje_module_load(ed->file->external_dir->entries[i].entry);
     }

   _edje_textblock_styles_add(ed);
   _edje_textblock_style_all_update(ed);

   ed->has_entries = EINA_FALSE;

   if (ed->collection)
     {
	if (ed->collection->prop.orientation != EDJE_ORIENTATION_AUTO)
          ed->is_rtl = (ed->collection->prop.orientation ==
                        EDJE_ORIENTATION_RTL);

	if (ed->collection->script_only)
	  {
	     ed->load_error = EDJE_LOAD_ERROR_NONE;
	     _edje_script_only_init(ed);
	  }
	else if (ed->collection->lua_script_only)
	  {
	     ed->load_error = EDJE_LOAD_ERROR_NONE;
	     _edje_lua_script_only_init(ed);
	  }
	else
	  {
	     unsigned int i;

	     /* colorclass stuff */
	     for (i = 0; i < ed->collection->parts_count; ++i)
	       {
		  Edje_Part *ep;
		  unsigned int k;

		  ep = ed->collection->parts[i];

		  /* Register any color classes in this parts descriptions. */
		  if ((ep->default_desc) && (ep->default_desc->color_class))
		    _edje_color_class_member_add(ed, ep->default_desc->color_class);

		  for (k = 0; k < ep->other.desc_count; k++)
		    {
		       Edje_Part_Description_Common *desc;

		       desc = ep->other.desc[k];

		       if (desc->color_class)
			 _edje_color_class_member_add(ed, desc->color_class);
		    }
	       }
	     /* build real parts */
	     for (n = 0; n < ed->collection->parts_count; n++)
	       {
		  Edje_Part *ep;

		  ep = ed->collection->parts[n];
		  rp = eina_mempool_malloc(_edje_real_part_mp, sizeof(Edje_Real_Part));
		  if (!rp)
		    {
                       /* FIXME: destroy all allocated ressource, need to have a common exit point */
		       ed->load_error = EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
                       evas_event_thaw(tev);
                       evas_event_thaw_eval(tev);
		       return 0;
		    }

		  memset(rp, 0, sizeof (Edje_Real_Part));

		  if ((ep->dragable.x != 0) || (ep->dragable.y != 0))
		    {
		       rp->drag = calloc(1, sizeof (Edje_Real_Part_Drag));
		       if (!rp->drag)
			 {
			    ed->load_error = EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
			    eina_mempool_free(_edje_real_part_mp, rp);
                            evas_event_thaw(tev);
                            evas_event_thaw_eval(tev);
                            return 0;
			 }

		       rp->drag->step.x = FROM_INT(ep->dragable.step_x);
		       rp->drag->step.y = FROM_INT(ep->dragable.step_y);
		    }

		  rp->edje = ed;
		  _edje_ref(rp->edje);
		  rp->part = ep;
		  parts = eina_list_append(parts, rp);
		  rp->param1.description = 
                    _edje_part_description_find(ed, rp, "default", 0.0);
		  rp->chosen_description = rp->param1.description;
		  if (!rp->param1.description)
		    ERR("no default part description!");

		  switch (ep->type)
		    {
		     case EDJE_PART_TYPE_RECTANGLE:
			rp->object = evas_object_rectangle_add(ed->base.evas);
			break;
                     case EDJE_PART_TYPE_PROXY:
		     case EDJE_PART_TYPE_IMAGE:
			rp->object = evas_object_image_add(ed->base.evas);
			break;
		     case EDJE_PART_TYPE_TEXT:
			_edje_text_part_on_add(ed, rp);
			rp->object = evas_object_text_add(ed->base.evas);
			evas_object_text_font_source_set(rp->object, ed->path);
			break;
		     case EDJE_PART_TYPE_GROUP:
                        sources = eina_list_append(sources, rp);
		     case EDJE_PART_TYPE_SWALLOW:
		     case EDJE_PART_TYPE_EXTERNAL:
                        if (ep->type == EDJE_PART_TYPE_EXTERNAL)
                          externals = eina_list_append(externals, rp);
			rp->object = evas_object_rectangle_add(ed->base.evas);
			evas_object_color_set(rp->object, 0, 0, 0, 0);
			evas_object_pass_events_set(rp->object, 1);
			evas_object_pointer_mode_set(rp->object, EVAS_OBJECT_POINTER_MODE_NOGRAB);
			_edje_callbacks_focus_add(rp->object, ed, rp);
			break;
		     case EDJE_PART_TYPE_TEXTBLOCK:
			textblocks = eina_list_append(textblocks, rp);
			rp->object = evas_object_textblock_add(ed->base.evas);
			break;
		     case EDJE_PART_TYPE_BOX:
                        sources = eina_list_append(sources, rp);
			rp->object = evas_object_box_add(ed->base.evas);
                        rp->anim = _edje_box_layout_anim_new(rp->object);
			break;
		     case EDJE_PART_TYPE_TABLE:
                        sources = eina_list_append(sources, rp);
			rp->object = evas_object_table_add(ed->base.evas);
			break;
		     case EDJE_PART_TYPE_GRADIENT:
			ERR("SPANK ! SPANK ! SPANK ! YOU ARE USING GRADIENT IN PART %s FROM GROUP %s INSIDE FILE %s !! THEY ARE NOW REMOVED !",
			    ep->name, group, file);
		     default:
			ERR("wrong part type %i!", ep->type);
			break;
		    }

		  if (rp->object)
		    {
		       evas_object_smart_member_add(rp->object, ed->obj);
//		       evas_object_layer_set(rp->object, evas_object_layer_get(ed->obj));
		       if (ep->type != EDJE_PART_TYPE_SWALLOW && ep->type != EDJE_PART_TYPE_GROUP && ep->type != EDJE_PART_TYPE_EXTERNAL)
			 {
			    if (ep->mouse_events)
			      {
				 _edje_callbacks_add(rp->object, ed, rp);
				 if (ep->repeat_events)
				   evas_object_repeat_events_set(rp->object, 1);
				 
				 if (ep->pointer_mode != EVAS_OBJECT_POINTER_MODE_AUTOGRAB)
				   evas_object_pointer_mode_set(rp->object, ep->pointer_mode);
			      }
			    else
			      {
				 evas_object_pass_events_set(rp->object, 1);
				 evas_object_pointer_mode_set(rp->object, EVAS_OBJECT_POINTER_MODE_NOGRAB);
			      }
			    if (ep->precise_is_inside)
			      evas_object_precise_is_inside_set(rp->object, 1);
			 }
		       if (rp->part->clip_to_id < 0)
			 evas_object_clip_set(rp->object, ed->base.clipper);
		    }
	       }
	     if (n > 0)
	       {
		  Eina_List *l;

		  ed->table_parts = malloc(sizeof(Edje_Real_Part *) * n);
		  ed->table_parts_size = n;
		  /* FIXME: check malloc return */
		  n = 0;
		  EINA_LIST_FOREACH(parts, l, rp)
		    {
		       ed->table_parts[n] = rp;
		       n++;
		    }
		  eina_list_free(parts);
		  for (i = 0; i < ed->table_parts_size; i++)
		    {
		       rp = ed->table_parts[i];
		       if (rp->param1.description) /* FIXME: prevent rel to gone radient part to go wrong. You may
						      be able to remove this when all theme are correctly rewritten. */
			 {
			    if (rp->param1.description->rel1.id_x >= 0)
			      rp->param1.rel1_to_x = ed->table_parts[rp->param1.description->rel1.id_x % ed->table_parts_size];
			    if (rp->param1.description->rel1.id_y >= 0)
			      rp->param1.rel1_to_y = ed->table_parts[rp->param1.description->rel1.id_y % ed->table_parts_size];
			    if (rp->param1.description->rel2.id_x >= 0)
			      rp->param1.rel2_to_x = ed->table_parts[rp->param1.description->rel2.id_x % ed->table_parts_size];
			    if (rp->param1.description->rel2.id_y >= 0)
			      rp->param1.rel2_to_y = ed->table_parts[rp->param1.description->rel2.id_y % ed->table_parts_size];
			 }
		       if (rp->part->clip_to_id >= 0)
			 {
			    rp->clip_to = ed->table_parts[rp->part->clip_to_id % ed->table_parts_size];
			    if (rp->clip_to)
			      {
				 evas_object_pass_events_set(rp->clip_to->object, 1);
				 evas_object_pointer_mode_set(rp->clip_to->object, EVAS_OBJECT_POINTER_MODE_NOGRAB);
				 evas_object_clip_set(rp->object, rp->clip_to->object);
			      }
			 }
		       if (rp->drag)
			 {
			    if (rp->part->dragable.confine_id >= 0)
			      rp->drag->confine_to = ed->table_parts[rp->part->dragable.confine_id % ed->table_parts_size];
			 }

		       /* replay events for dragable */
		       if (rp->part->dragable.event_id >= 0)
			 {
			    rp->events_to =
			      ed->table_parts[rp->part->dragable.event_id % ed->table_parts_size];
			    /* events_to may be used only with dragable */
			    if (!rp->events_to->part->dragable.x &&
				!rp->events_to->part->dragable.y)
			      rp->events_to = NULL;
			 }

		       rp->swallow_params.min.w = 0;
		       rp->swallow_params.min.h = 0;
		       rp->swallow_params.max.w = -1;
		       rp->swallow_params.max.h = -1;

		       if (rp->part->type == EDJE_PART_TYPE_TEXT
			   || rp->part->type == EDJE_PART_TYPE_TEXTBLOCK)
			 {
			    Edje_Part_Description_Text *text;

			    text = (Edje_Part_Description_Text *) rp->param1.description;

			    if (ed->file->feature_ver < 1)
			      {
				 text->text.id_source = -1;
				 text->text.id_text_source = -1;
			      }

			    if (text->text.id_source >= 0)
			      rp->text.source = ed->table_parts[text->text.id_source % ed->table_parts_size];
			    if (text->text.id_text_source >= 0)
			      rp->text.text_source = ed->table_parts[text->text.id_text_source % ed->table_parts_size];
			    if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
			      {
				 _edje_entry_real_part_init(rp);
				 if (!ed->has_entries)
				   ed->has_entries = EINA_TRUE;
			      }
			 }
		    }
	       }
	     
	     _edje_programs_patterns_init(ed);

	     n = ed->collection->programs.fnmatch_count +
	       ed->collection->programs.strcmp_count +
	       ed->collection->programs.strncmp_count +
	       ed->collection->programs.strrncmp_count +
	       ed->collection->programs.nocmp_count;
	     if (n > 0)
	       {
		  Edje_Program *pr;

		  ed->table_programs = malloc(sizeof(Edje_Program *) * n);
		  if (ed->table_programs)
		    {
		       ed->table_programs_size = n;

#define EDJE_LOAD_BUILD_TABLE(Array, Ed, It, Tmp)	\
		       for (It = 0; It < Ed->collection->programs.Array##_count; ++It) \
			 {						\
			    Tmp = Ed->collection->programs.Array[It];	\
			    Ed->table_programs[Tmp->id] = Tmp;		\
			 }

		       EDJE_LOAD_BUILD_TABLE(fnmatch, ed, i, pr);
		       EDJE_LOAD_BUILD_TABLE(strcmp, ed, i, pr);
		       EDJE_LOAD_BUILD_TABLE(strncmp, ed, i, pr);
		       EDJE_LOAD_BUILD_TABLE(strrncmp, ed, i, pr);
		       EDJE_LOAD_BUILD_TABLE(nocmp, ed, i, pr);
		    }
	       }
	     _edje_ref(ed);
	     _edje_block(ed);
	     _edje_freeze(ed);
//	     if (ed->collection->script) _edje_embryo_script_init(ed);
	     _edje_var_init(ed);
	     for (i = 0; i < ed->table_parts_size; i++)
	       {
		  rp = ed->table_parts[i];
		  evas_object_show(rp->object);
		  if (_edje_block_break(ed)) break;
		  if (rp->drag)
		    {
		       if (rp->part->dragable.x < 0) rp->drag->val.x = FROM_DOUBLE(1.0);
		       if (rp->part->dragable.y < 0) rp->drag->val.x = FROM_DOUBLE(1.0);
		       _edje_dragable_pos_set(ed, rp, rp->drag->val.x, rp->drag->val.y);
		    }
	       }
             ed->recalc_call = 1;
	     ed->dirty = 1;
#ifdef EDJE_CALC_CACHE
	     ed->all_part_change = 1;
#endif
	     if ((evas_object_clipees_get(ed->base.clipper)) &&
		 (evas_object_visible_get(obj)))
	       evas_object_show(ed->base.clipper);

	     /* instantiate 'internal swallows' */
             EINA_LIST_FREE(externals, rp)
               {
                  Edje_Part_Description_External *external;
                  Evas_Object *child_obj;

                  external = (Edje_Part_Description_External *) rp->part->default_desc;
                  child_obj = _edje_external_type_add(rp->part->source,
                                                      evas_object_evas_get(ed->obj), ed->obj,
                                                      external->external_params, rp->part->name);
                  if (child_obj)
                    {
                       _edje_real_part_swallow(rp, child_obj, EINA_TRUE);
                       rp->param1.external_params = _edje_external_params_parse(child_obj,
                                                                                external->external_params);
                       _edje_external_recalc_apply(ed, rp, NULL, rp->chosen_description);
                    }
               }
Ejemplo n.º 6
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;
}