Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : docs

Dir     : e17/docs/ewlbook/xml


Modified Files:
        config.xml getting_started.xml themes.xml widgets.xml 


Log Message:
- dump more stuff into the theme chapter
- add the --ewl-print-theme-keys
- fix api breakage stuff

===================================================================
RCS file: /cvsroot/enlightenment/e17/docs/ewlbook/xml/config.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- config.xml  13 Aug 2004 01:17:12 -0000      1.4
+++ config.xml  26 Aug 2004 03:04:54 -0000      1.5
@@ -59,6 +59,11 @@
  </varlistentry>
 
  <varlistentry>
+  <term>/ewl/theme/print_keys</term>
+  <listitem><para>a boolean to indicate if the theme key names should be printed as 
they are accessed</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
   <term>/ewl/theme/color_classes/override</term>
   <listitem><para>Override the default colour classes</para></listitem>
  </varlistentry>
===================================================================
RCS file: /cvsroot/enlightenment/e17/docs/ewlbook/xml/getting_started.xml,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- getting_started.xml 18 Aug 2004 05:42:49 -0000      1.7
+++ getting_started.xml 26 Aug 2004 03:04:54 -0000      1.8
@@ -139,6 +139,7 @@
 <itemizedlist mark="bullet" spacing="compact">
  <title>EWL command line switches</title>
  <listitem><para>--ewl-theme &lt;name&gt;</para></listitem>
+ <listitem><para>--ewl-print-theme-keys</para></listitem>
  <listitem><para>--ewl-segv</para></listitem>
  <listitem><para>--ewl-software-x11</para></listitem>
  <listitem><para>--ewl-gl-x11</para></listitem>
===================================================================
RCS file: /cvsroot/enlightenment/e17/docs/ewlbook/xml/themes.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- themes.xml  13 Aug 2004 01:17:12 -0000      1.2
+++ themes.xml  26 Aug 2004 03:04:54 -0000      1.3
@@ -2,15 +2,126 @@
 <title>EWL Themes</title>
 
 <para>
-EWL uses the Edje library to handle off of its theming requirements. The
-themes can either be defined in the configuration file or on the command
-line using the <literal>--ewl-theme</literal> switch.
+As the EWL was designed around the lower EFL libraries it incorporates the
+use of Edje to handle the widget theming. You can either identify the theme
+to be used in the main configuration db, <command>examine _system</command>,
+or specified on the command line with the <literal>--ewl-theme</literal>
+flag.
+</para>
+
+<para>In order to theme the EWL, a background in Edje is required. You can
+take a look at the EdjeBook for an overview and reference manual to EDC
+programming.
+</para>
+
+<para>
+As you add widgets into your EWL application, EWL builds up an appearance
+tree. This can be seen using the <literal>--ewl-print-theme-keys</literal>
+flag when running any EWL application. This flag will print out each of the
+appearance keys as EWL attempts to access them. You will see something
+similar to <xref linkend="ch-Themes-ex-theme-keys" />.
+<example id="ch-Themes-ex-theme-keys">
+<title>EWL theme keys</title>
+<screen>
[EMAIL PROTECTED] [e17] -> ewl_test --ewl-print-theme-keys
+/theme/font_path
+/window/file
+/window/group
+/window/hbox/file
+/window/hbox/group
+/window/hbox/tree/file
+/window/hbox/tree/group
+/window/hbox/scrollpane/file
+/window/hbox/scrollpane/group
+/window/hbox/tree/row/file
+/window/hbox/tree/row/group
+/window/hbox/tree/scrollpane/file
+/window/hbox/tree/scrollpane/group
+</screen>
+</example>
+As EWL attempts to locate these entries in the theme db it will remove
+successive portions of the path until it finds the key in the theme. So, in
+the case of <literal>/window/hbox/scrollpane/group</literal> it will
+traverse through:
+<itemizedlist spacing="compact" mark="none">
+ <listitem><literal>/window/hbox/scrollpane/group</literal></listitem>
+ <listitem><literal>/hbox/scrollpane/group</literal></listitem>
+ <listitem><literal>/scrollpane/group</literal></listitem>
+</itemizedlist>
+attempting to locate a matching key.
+</para>
+
+<para>
+Using this hierarichal structure EWL allows for very specific theme keys to
+be set. It will allow you to theme your boxes differently if they appear
+inside a scrollpane or inside of a window. This delivers a lot of power and
+flexibility into your hands as a themer.
+</para>
+
+<para>
+The easiest way to figure out how to theme EWL is to take a look at the
+current themes and how they're written. If you look into the
+<emphasis>data/themes</emphasis> directory you will see several directories
+and several .edc files. Each .edc and directory combination is a theme. This
+top level .edc file is what pulls all of the pieces of the lower directories
+together.
+</para>
+
+<para>
+This chapter will be pulling its examples from the 'zero' theme that
+currently resides in the EWL cvs tree.
+</para>
+
+<para>
+Taking a look at the top level zero.edc file, you can see a large
+<literal>data {}</literal> section. This contains the mappings that EWL uses
+from the appearance keys metioned above to the Edje groups defined in the
+theme files. This mapping is done with the keys that end in
+<emphasis>/group</emphasis>.
+</para>
+
+<para>
+You'll notice looking at the .edc file that the
+<literal>/bar/group</literal> key points to the <literal>bar</literal>
+group. So, somewhere in the other .edc files there is a Edje group called
+<literal>bar</literal>. So using this method you could then theme a bar that
+appears inside a scrollpane by using the full path from the scrollpane down
+to the bar element in the data section.
+</para>
+
+<para>
+If you want different fonts for you different widgets this is also done in
+the <literal>data {}</literal> section of the main .edc file. A key that
+ends in <literal>/text/font</literal> will set the font on that text item.
+Similarly there is a <literal>/text/font_size</literal> and
+<literal>/text/style</literal> for setting the font size and style
+respectively.
 </para>
 
 <para>
-The use of Edje for the theming gives EWL a large amount of flexibility and
-provides the themer with a lot of power to customize the look of EWL.
+As an example the <literal>item, "/button/text/font" "vio";</literal> will
+set the text used on any button widgets to use the &quot;vio&quot; alias
+which was defined in the <literal>fonts</literal> section with:
+<literal>font: "zero/fonts/vio.ttf" "vio";</literal>
+</para>
+
+<para>
+There are several different keys that can be looked up by EWL as the program
+executes. Its best to use the <literal>--ewl-print-theme-keys</literal>
+option to find the ones you desire.
+</para>
+
+<para>
+The main <literal>data {}</literal> section also includes a little bit of
+meta-data about the theme itself. There are currently four relevant keys:
+<itemizedlist spacing="compact" mark="bullet">
+ <listitem>/theme/author</listitem>
+ <listitem>/theme/font_path</listitem>
+ <listitem>/theme/license</listitem>
+ <listitem>/theme/name</listitem>
+</itemizedlist>
 </para>
 
 </chapter>
 
+
===================================================================
RCS file: /cvsroot/enlightenment/e17/docs/ewlbook/xml/widgets.xml,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- widgets.xml 22 Aug 2004 17:52:10 -0000      1.11
+++ widgets.xml 26 Aug 2004 03:04:54 -0000      1.12
@@ -252,8 +252,8 @@
     ewl_widget_show(o);
 
     dialog = ewl_dialog_new(EWL_POSITION_BOTTOM);
-    ewl_dialog_set_has_separator(EWL_DIALOG(dialog), 0);
-    ewl_dialog_add_widget(EWL_DIALOG(dialog), o);
+    ewl_dialog_has_separator_set(EWL_DIALOG(dialog), 0);
+    ewl_dialog_widget_add(EWL_DIALOG(dialog), o);
     ewl_object_alignment_set(EWL_OBJECT(dialog), EWL_FLAG_ALIGN_CENTER);
     ewl_widget_show(dialog);
 
@@ -283,21 +283,21 @@
 <para>
 A <literal>Ewl_Dialog</literal> can optionally have a horizontal line drawn
 to seperate the two sections of the dialog. The line is controlled with the
-<function>ewl_dialog_set_has_separator()</function> where 0 means do not
+<function>ewl_dialog_has_separator_set()</function> where 0 means do not
 draw separator and 1 means to draw the separator. There is a corresponding
-<function>ewl_dialog_get_has_separator()</function> returning 1 if there is
+<function>ewl_dialog_has_separator_get()</function> returning 1 if there is
 a separator and 0 otherwise.
 </para>
 
 <para>
 The content of the main display area of the box is controlled through the
-function <function>ewl_dialog_add_widget()</function>. In this instance we
+function <function>ewl_dialog_widget_add()</function>. In this instance we
 add a <literal>Ewl_Text</literal> object into the dialog.
 </para>
 
 <para>
 Once the dialog is initialized we need to create any desired buttons. The
-buttons are created by calling <function>ewl_dialog_set_button()</function>
+buttons are created by calling <function>ewl_dialog_button_set()</function>
 this will create a button. The parameters are the label of the button and
 the response code to return from the button. There are several pre-defined
 labels, including:
@@ -567,21 +567,21 @@
 <title>Creating an EWL password</title>
 <programlisting role="C">
     Ewl_Widget *p = ewl_password_new("default");
-    ewl_password_set_obscure(EWL_PASSWORD(p), "-");
+    ewl_password_obscure_set(EWL_PASSWORD(p), "-");
     ewl_callback_append(p, EWL_CALLBACK_VALUE_CHANGED, passwd_cb, NULL);
     ewl_widget_show(p);
 </programlisting>
 </example>
 The default obscuring character used is a '*' character. This can be easily
 changed by calling 
-<function>ewl_password_set_obscure(Ewl_Password *, char)</function>.
+<function>ewl_password_obscure_set(Ewl_Password *, char)</function>.
 There is also a corresponding 
-<function>char ewl_password_get_obscure(Ewl_Password *)</function> to
+<function>char ewl_password_obscure_get(Ewl_Password *)</function> to
 retrieve the current obscuring character. As with the
 <literal>ewl_text</literal> widget there are two functions to get and set
 the text of the widget: 
-<function>ewl_password_set_text(Ewl_Password *, char *)</function> and
-<function>char *ewl_password_get_text(Ewl_Password *)</function>.
+<function>ewl_password_text_set(Ewl_Password *, char *)</function> and
+<function>char *ewl_password_text_get(Ewl_Password *)</function>.
 </para>
 
 <para>
@@ -591,7 +591,7 @@
 <title>Ewl_Password value changed callback</title>
 <programlisting role="C">
 void passwd_cb(Ewl_Widget *, void *event, void *data) {
-    char *text = ewl_password_get_text(EWL_PASSWORD(w));
+    char *text = ewl_password_text_get(EWL_PASSWORD(w));
     printf("text: %s\n", text);
 }
 </programlisting>




-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to