From 55845c5a3ed0d867e204f5a311e5c7c3f370963b Mon Sep 17 00:00:00 2001 From: "Jonas M. Gastal" Date: Thu, 20 Dec 2012 20:42:45 +0000 Subject: [PATCH] efl: Adding much improved textblock style documentation. SVN revision: 81485 --- src/lib/evas/Evas.h | 2 + src/lib/evas/canvas/evas_object_textblock.c | 600 +++++++++++++++++++- 2 files changed, 600 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/Evas.h b/src/lib/evas/Evas.h index 2edbf55e5d..bf58ec5c2b 100644 --- a/src/lib/evas/Evas.h +++ b/src/lib/evas/Evas.h @@ -10504,6 +10504,8 @@ EAPI Evas_BiDi_Direction evas_object_text_direction_get(const Evas_Object *obj) * additional format directives using "tags" that can be set in the style see * @ref evas_textblock_style_set . * + * For more details see @ref evas_textblock_style_page + * * Textblock supports the following formats: * @li font - Font description in fontconfig like format, e.g: "Sans:style=Italic:lang=hi". or "Serif:style=Bold". * @li font_weight - Overrides the weight defined in "font". E.g: "font_weight=Bold" is the same as "font=:style=Bold". Supported weights: "normal", "thin", "ultralight", "light", "book", "medium", "semibold", "bold", "ultrabold", "black", and "extrablack". diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 8ce1a6dfb8..ac0c1e9c2a 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -1,6 +1,6 @@ /** * @internal - * @section Evas_Object_Textblock_Internal Internal Textblock Object Tutorial + * @subsection Evas_Object_Textblock_Internal Internal Textblock Object Tutorial * * This explains the internal design of the Evas Textblock Object, it's assumed * that the reader of this section has already read @ref Evas_Object_Textblock_Tutorial "Textblock's usage docs.". @@ -1099,6 +1099,12 @@ static const char *passwordstr = NULL; static const char *underline_dash_widthstr = NULL; static const char *underline_dash_gapstr = NULL; +/** + * @page evas_textblock_style_page Evas Textblock Style Options + * + * @brief This page describes how to style text in an Evas Text Block. + */ + /** * @internal * Init the format strings. @@ -1108,6 +1114,53 @@ _format_command_init(void) { if (format_refcount == 0) { + /** + * @page evas_textblock_style_page Evas Textblock Style Options + * + * @section evas_textblock_style_index Index + * + * The following styling commands are accepted: + * @li @ref evas_textblock_style_font + * @li @ref evas_textblock_style_font_fallback + * @li @ref evas_textblock_style_font_size + * @li @ref evas_textblock_style_font_source + * @li @ref evas_textblock_style_font_weight + * @li @ref evas_textblock_style_font_style + * @li @ref evas_textblock_style_font_width + * @li @ref evas_textblock_style_lang + * @li @ref evas_textblock_style_color + * @li @ref evas_textblock_style_underline_color + * @li @ref evas_textblock_style_underline2_color + * @li @ref evas_textblock_style_underline_dash_color + * @li @ref evas_textblock_style_outline_color + * @li @ref evas_textblock_style_shadow_color + * @li @ref evas_textblock_style_glow_color + * @li @ref evas_textblock_style_glow2_color + * @li @ref evas_textblock_style_backing_color + * @li @ref evas_textblock_style_strikethrough_color + * @li @ref evas_textblock_style_align + * @li @ref evas_textblock_style_valign + * @li @ref evas_textblock_style_wrap + * @li @ref evas_textblock_style_left_margin + * @li @ref evas_textblock_style_right_margin + * @li @ref evas_textblock_style_underline + * @li @ref evas_textblock_style_strikethrough + * @li @ref evas_textblock_style_backing + * @li @ref evas_textblock_style_style + * @li @ref evas_textblock_style_tabstops + * @li @ref evas_textblock_style_linesize + * @li @ref evas_textblock_style_linerelsize + * @li @ref evas_textblock_style_linegap + * @li @ref evas_textblock_style_linerelgap + * @li @ref evas_textblock_style_item + * @li @ref evas_textblock_style_linefill + * @li @ref evas_textblock_style_ellipsis + * @li @ref evas_textblock_style_password + * @li @ref evas_textblock_style_underline_dash_width + * @li @ref evas_textblock_style_underline_dash_gap + * + * @section evas_textblock_style_contents Contents + */ fontstr = eina_stringshare_add("font"); font_fallbacksstr = eina_stringshare_add("font_fallbacks"); font_sizestr = eina_stringshare_add("font_size"); @@ -1261,14 +1314,45 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch if (cmd == fontstr) { + /** + * @page evas_textblock_style_page Evas Textblock Style Options + * + * @subsection evas_textblock_style_font Font + * + * This sets the name of the font to be used. + * @code + * font= + * @endcode + */ evas_font_name_parse(fmt->font.fdesc, tmp_param); } else if (cmd == font_fallbacksstr) { + /** + * @page evas_textblock_style_page Evas Textblock Style Options + * + * @subsection evas_textblock_style_font_fallback Font fallback + * + * This sets the name of the fallback font to be used. This font will + * be used if the primary font is not available. + * @code + * font_fallbacks= + * @endcode + */ eina_stringshare_replace(&(fmt->font.fdesc->fallbacks), tmp_param); } else if (cmd == font_sizestr) { + /** + * @page evas_textblock_style_page Evas Textblock Style Options + * + * @subsection evas_textblock_style_font_size Font size + * + * This sets the the size of font in points to be used. + * @code + * font_size= + * @endcode + */ int v; v = atoi(tmp_param); @@ -1279,6 +1363,16 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch } else if (cmd == font_sourcestr) { + /** + * @page evas_textblock_style_page Evas Textblock Style Options + * + * @subsection evas_textblock_style_font_source Font source + * + * Specify an object from which to search for the font. + * @code + * font_source= + * @endcode + */ if ((!fmt->font.source) || ((fmt->font.source) && (strcmp(fmt->font.source, tmp_param)))) { @@ -1288,65 +1382,295 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch } else if (cmd == font_weightstr) { + /** + * @page evas_textblock_style_page Evas Textblock Style Options + * + * @subsection evas_textblock_style_font_weight Font weight + * + * Sets the weight of the font. The value must be one of: + * @li "normal" + * @li "thin" + * @li "ultralight" + * @li "light" + * @li "book" + * @li "medium" + * @li "semibold" + * @li "bold" + * @li "ultrabold" + * @li "black" + * @li "extrablack" + * @code + * font_weight= + * @endcode + */ fmt->font.fdesc->weight = evas_font_style_find(tmp_param, tmp_param + strlen(tmp_param), EVAS_FONT_STYLE_WEIGHT); } else if (cmd == font_stylestr) { + /** + * @page evas_textblock_style_page Evas Textblock Style Options + * + * @subsection evas_textblock_style_font_style Font style + * + * Sets the style of the font. The value must be one of: + * @li "normal" + * @li "oblique" + * @li "italic" + * @code + * font_style=