Enlightenment CVS committal

Author  : technikolor
Project : e17
Module  : docs

Dir     : e17/docs/cookbook/xml/etox


Modified Files:
        etox_overview.xml 


Log Message:
Completed Etox intro, added evas ecore template to get new coders moving fast, 
updated pre-render and todo list.

===================================================================
RCS file: /cvsroot/enlightenment/e17/docs/cookbook/xml/etox/etox_overview.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- etox_overview.xml   12 Jul 2004 08:40:42 -0000      1.1
+++ etox_overview.xml   28 Jul 2004 10:14:30 -0000      1.2
@@ -82,23 +82,61 @@
 
 <para>
 Most of thie example is standard Ecore_Evas functions, so we'll concentrate just on 
the Etox related parts of it.
-Notice that we use the <function>evas_font_path_append</function> Evas function to 
define our font path, this is 
+Notice that we use the <function>evas_font_path_append()</function> Evas function to 
define our font path, this is 
 something that Etox will not do for you.
 </para>
 
 <para>
-Your Etox text will always start by adding a new Etox using 
<function>etox_new</function> function which returns a new
+Your Etox text will always start by adding a new Etox using the 
<function>etox_new()</function> function which returns a new
 Evas_Object.  Because your Etox is itself an Evas object it can be manipulated as 
such.  Etox's layout functions
-such as clipping and wrapping are dependant upon the size of the Etox itself, 
therefore <function>evas_object_resize</function>
-needs to be called to define the proper size of the Etox.  Please note that the area 
of the object will <emphasis>not</emphasis>
+such as clipping and wrapping are dependant upon the size of the Etox itself, 
therefore <function>evas_object_resize()</function>
+need to be called to define the proper size of the Etox.  Please note that the area 
of the object will <emphasis>not</emphasis>
 default to the size of the Evas itself.  
 </para>
 
 <para>
-Etox uses the concept of contexts.  A context is a set of parameters such as color, 
font, alignment, styles, and markers that
+Etox uses the concept of contexts.  A <term>context</term> is a set of parameters 
such as color, font, alignment, styles, and markers that
 are applied to a certain set of text.  Each Etox object has at least one context 
associated with it which is created when calling
-<function>etox_new</function>.  For this reason the 
<function>etox_context_new</function> function <emphasis>only</emphasis> needs
-to be called when creating additional contexts.
+<function>etox_new()</function>.  For this reason the 
<function>etox_context_new()</function> function <emphasis>only</emphasis> needs
+to be called when creating additional contexts. 
+</para>
+
+<para>
+Once you've used <function>etox_new()</function> to add your Etox object you need to 
use the <function>etox_get_context()</function>
+to return a <varname>Etox_Context</varname> pointer which can then be passed to other 
context functions to modify the attributes of your
+text.  In the example we change the color, font and alignment of our context.
+</para>
+
+<para>
+Two of the most interesting and simplistic features of Etox is it's ability to 
intellegently wrap text and to interpret a 
+standard C newline charrector (\n) as a wrap.  These are features that Evas itself 
does not contain, it is the responsability
+of the coder to ensure text doesn't trail off the canvas.  
+</para>
+
+<para>
+Intellegent wrapping comes in two flavors which are not mutually exclusive.  The 
first is soft wrapping, which will wrap text when a charrector
+is going to exceed the width of the canvas.  The second is word wrapping, which will 
wrap text when a word is going to exceed the width of
+the canvas.  Typically  the later is desirable so that you get "This is (wrap) my 
string" instead of "This is m(wrap)y string."  Note, however,
+that work wrapping will not work unless soft wrapping has already been turned on, 
thus work wrapping requires calling <emphasis>both</emphasis>
+<function>etox_set_soft_wrap()</function> and 
<function>etox_set_word_wrap()</function> functions.
+</para>
+
+<para>
+A final note about wrapping is that by default wrapping will insert a <term>wrap 
marker</term> into your output string, a "+" (plus) sign by default.
+This marker indicates that a wrap has occured and is printed  as the first charrector 
on the next line of the wrap.  Your string will therefore
+likely look more like this: "This is my (wrap) +string."  If you would prefer that 
Etox silently wrap without a marker, simply set the marker
+to being nothing using the <function>etox_context_set_wrap_marker()</function> 
function.
+</para>
+
+<para>
+Etox text strings themselves are set using the <function>etox_set_text()</function>.  
It's important to note that the string applies to the Etox itself
+and not to the context.  There is no direct association between the string and the 
context, which facilitates easy modification of the display of the
+text without having to change the context, or vice versa.
+</para>
+
+<para>
+While this is a very simple example of Etox usage, far more can be accomplished and 
as you can see the API is simple and clean, filling in many
+of the text handling needs that Evas doesn't provide.
 </para>
 
 




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to