Enlightenment CVS committal
Author : dj2
Project : e17
Module : docs
Dir : e17/docs/ewlbook/xml
Modified Files:
appendix-ewl_media_example.xml getting_started.xml
widget_packing.xml widgets.xml
Log Message:
sync EWL API changes
add some extra text in the widget packing section along with a diagram of
padding/insets for widgets
add the svg files for the image that i've made
===================================================================
RCS file: /cvsroot/enlightenment/e17/docs/ewlbook/xml/appendix-ewl_media_example.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- appendix-ewl_media_example.xml 13 Aug 2004 01:17:12 -0000 1.3
+++ appendix-ewl_media_example.xml 18 Aug 2004 05:42:49 -0000 1.4
@@ -41,7 +41,7 @@
void video_realize_cb(Ewl_Widget *w, void *event, void *data) {
double len = ewl_media_length_get(EWL_MEDIA(video));
- ewl_seeker_set_range(EWL_SEEKER(seeker), len);
+ ewl_seeker_range_set(EWL_SEEKER(seeker), len);
}
void video_change_cb(Ewl_Widget *w, void *event, void *data) {
@@ -51,14 +51,14 @@
Ewl_Text *t = (Ewl_Text *)data;
double pos = ewl_media_position_get(EWL_MEDIA(video));
- ewl_seeker_set_value(EWL_SEEKER(seeker), pos);
+ ewl_seeker_value_set(EWL_SEEKER(seeker), pos);
ewl_media_position_time_get(EWL_MEDIA(video), &h, &m, &s);
snprintf(buf, sizeof(buf), "%02i:%02i:%02.0f", h, m, s);
ewl_text_text_set(t, buf);
}
void seeker_move_cb(Ewl_Widget *w, void *event, void *data) {
- double val = ewl_seeker_get_value(EWL_SEEKER(seeker));
+ double val = ewl_seeker_value_get(EWL_SEEKER(seeker));
ewl_media_position_set(EWL_MEDIA(video), val);
}
@@ -80,20 +80,20 @@
Ewl_Widget *fd = NULL;
if (fd_win) {
- ewl_widget_show(fd_win);
- return;
+ ewl_widget_show(fd_win);
+ return;
}
fd_win = ewl_window_new();
- ewl_window_set_title(EWL_WINDOW(fd_win), "EWL Media Open");
- ewl_window_set_class(EWL_WINDOW(fd_win), "EWL_Media_Open");
- ewl_window_set_name(EWL_WINDOW(fd_win), "EWL_Media_Open");
+ ewl_window_title_set(EWL_WINDOW(fd_win), "EWL Media Open");
+ ewl_window_class_set(EWL_WINDOW(fd_win), "EWL_Media_Open");
+ ewl_window_name_set(EWL_WINDOW(fd_win), "EWL_Media_Open");
ewl_callback_append(fd_win, EWL_CALLBACK_DELETE_WINDOW,
fd_win_del_cb, NULL);
ewl_widget_show(fd_win);
fd = ewl_filedialog_new(EWL_FILEDIALOG_TYPE_OPEN);
- ewl_container_append_child(EWL_CONTAINER(fd_win), fd);
+ ewl_container_child_append(EWL_CONTAINER(fd_win), fd);
ewl_callback_append(fd, EWL_CALLBACK_VALUE_CHANGED, open_file_cb, NULL);
ewl_widget_show(fd);
}
@@ -117,17 +117,17 @@
char * file = NULL;
if (!ewl_init(&argc, argv)) {
- printf("Can't init ewl");
- return 1;
+ printf("Can't init ewl");
+ return 1;
}
if (argc > 1)
file = argv[1];
win = ewl_window_new();
- ewl_window_set_title(EWL_WINDOW(win), "EWL Media test");
- ewl_window_set_name(EWL_WINDOW(win), "EWL_Media_test");
- ewl_window_set_class(EWL_WINDOW(win), "EWL_Media_test");
+ ewl_window_title_set(EWL_WINDOW(win), "EWL Media test");
+ ewl_window_name_set(EWL_WINDOW(win), "EWL_Media_test");
+ ewl_window_class_set(EWL_WINDOW(win), "EWL_Media_test");
ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW, del_cb, NULL);
ewl_callback_append(win, EWL_CALLBACK_KEY_UP, key_up_cb, NULL);
ewl_object_size_request(EWL_OBJECT(win), 320, 280);
@@ -136,7 +136,7 @@
/* box to contain everything */
b = ewl_vbox_new();
- ewl_container_append_child(EWL_CONTAINER(win), b);
+ ewl_container_child_append(EWL_CONTAINER(win), b);
ewl_object_fill_policy_set(EWL_OBJECT(b), EWL_FLAG_FILL_ALL);
ewl_widget_show(b);
@@ -145,7 +145,7 @@
/* the video */
video = ewl_media_new(file);
- ewl_container_append_child(EWL_CONTAINER(b), video);
+ ewl_container_child_append(EWL_CONTAINER(b), video);
ewl_object_fill_policy_set(EWL_OBJECT(video), EWL_FLAG_FILL_ALL);
ewl_callback_append(video, EWL_CALLBACK_REALIZE, video_realize_cb, NULL);
ewl_callback_append(video, EWL_CALLBACK_VALUE_CHANGED, video_change_cb, time);
@@ -155,16 +155,16 @@
controls = ewl_vbox_new();
ewl_object_fill_policy_set(EWL_OBJECT(controls),
EWL_FLAG_FILL_VSHRINK | EWL_FLAG_FILL_HFILL);
- ewl_container_append_child(EWL_CONTAINER(b), controls);
+ ewl_container_child_append(EWL_CONTAINER(b), controls);
ewl_widget_show(controls);
/* hold he controls */
b = ewl_hbox_new();
- ewl_container_append_child(EWL_CONTAINER(controls), b);
+ ewl_container_child_append(EWL_CONTAINER(controls), b);
ewl_widget_show(b);
{
- Control controls [] = {
+ Control controls [] = {
{ "play", play_cb },
{ "stop", stop_cb },
{ "rewind", rew_cb },
@@ -172,34 +172,34 @@
{ "open", open_cb },
{ NULL, NULL }
};
- int i;
+ int i;
- for(i = 0; controls[i].name != NULL; i++) {
- o = ewl_button_with_stock_new(controls[i].name);
- ewl_container_append_child(EWL_CONTAINER(b), o);
- ewl_callback_append(o, EWL_CALLBACK_CLICKED,
- controls[i].func, NULL);
- ewl_widget_show(o);
- }
+ for(i = 0; controls[i].name != NULL; i++) {
+ o = ewl_button_with_stock_new(controls[i].name);
+ ewl_container_child_append(EWL_CONTAINER(b), o);
+ ewl_callback_append(o, EWL_CALLBACK_CLICKED,
+ controls[i].func, NULL);
+ ewl_widget_show(o);
+ }
}
b = ewl_hbox_new();
- ewl_container_append_child(EWL_CONTAINER(controls), b);
+ ewl_container_child_append(EWL_CONTAINER(controls), b);
ewl_widget_show(b);
/* the video seeker */
seeker = ewl_seeker_new(EWL_ORIENTATION_HORIZONTAL);
- ewl_container_append_child(EWL_CONTAINER(b), seeker);
+ ewl_container_child_append(EWL_CONTAINER(b), seeker);
ewl_object_fill_policy_set(EWL_OBJECT(seeker),
- EWL_FLAG_FILL_VSHRINK | EWL_FLAG_FILL_HFILL);
- ewl_seeker_set_value(EWL_SEEKER(seeker), 0.0);
- ewl_seeker_set_range(EWL_SEEKER(seeker), 0.0);
- ewl_seeker_set_step(EWL_SEEKER(seeker), 1.0);
+ EWL_FLAG_FILL_VSHRINK | EWL_FLAG_FILL_HFILL);
+ ewl_seeker_value_set(EWL_SEEKER(seeker), 0.0);
+ ewl_seeker_range_set(EWL_SEEKER(seeker), 0.0);
+ ewl_seeker_step_set(EWL_SEEKER(seeker), 1.0);
ewl_callback_append(seeker, EWL_CALLBACK_VALUE_CHANGED, seeker_move_cb, NULL);
ewl_widget_show(seeker);
/* the time text spot */
- ewl_container_append_child(EWL_CONTAINER(b), time);
+ ewl_container_child_append(EWL_CONTAINER(b), time);
ewl_object_insets_set(EWL_OBJECT(time), 0, 3, 0, 0);
ewl_object_fill_policy_set(EWL_OBJECT(time), EWL_FLAG_FILL_SHRINK);
ewl_widget_show(time);
===================================================================
RCS file: /cvsroot/enlightenment/e17/docs/ewlbook/xml/getting_started.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- getting_started.xml 13 Aug 2004 01:17:12 -0000 1.6
+++ getting_started.xml 18 Aug 2004 05:42:49 -0000 1.7
@@ -52,9 +52,9 @@
}
win = ewl_window_new();
- ewl_window_set_title(EWL_WINDOW(win), "EWL Window");
- ewl_window_set_name(EWL_WINDOW(win), "EWL_WINDOW");
- ewl_window_set_class(EWL_WINDOW(win), "EWLWindow");
+ ewl_window_title_set(EWL_WINDOW(win), "EWL Window");
+ ewl_window_name_set(EWL_WINDOW(win), "EWL_WINDOW");
+ ewl_window_class_set(EWL_WINDOW(win), "EWLWindow");
ewl_object_size_request(EWL_OBJECT(win), 200, 100);
ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW, destroy_cb, NULL);
ewl_widget_show(win);
@@ -158,9 +158,9 @@
<programlisting role="C">
win = ewl_window_new();
- ewl_window_set_title(EWL_WINDOW(win), "EWL Window");
- ewl_window_set_name(EWL_WINDOW(win), "EWL_WINDOW");
- ewl_window_set_class(EWL_WINDOW(win), "EWLWindow");
+ ewl_window_title_set(EWL_WINDOW(win), "EWL Window");
+ ewl_window_name_set(EWL_WINDOW(win), "EWL_WINDOW");
+ ewl_window_class_set(EWL_WINDOW(win), "EWLWindow");
ewl_object_size_request(EWL_OBJECT(win), 200, 100);
ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW, destroy_cb, NULL);
ewl_widget_show(win);
@@ -168,10 +168,10 @@
<para>
This is where the actual window is created. A call to
<function>ewl_window_new()</function>
creates the new, empty window. We then take that window and start attaching data. We
begin
-by setting the title with <function>ewl_window_set_title()</function>, which will set
+by setting the title with <function>ewl_window_title_set()</function>, which will set
the string to be displayed by the window manager on the top of the window. The next
two
-function calls, <function>ewl_window_set_name()</function> and
-<function>ewl_window_set_class()</function> set data that will be used by the window
manager
+function calls, <function>ewl_window_name_set()</function> and
+<function>ewl_window_class_set()</function> set data that will be used by the window
manager
to better manage your application.
</para>
@@ -264,22 +264,22 @@
/* create the window */
win = ewl_window_new();
- ewl_window_set_title(EWL_WINDOW(win), "Hello world");
- ewl_window_set_class(EWL_WINDOW(win), "hello");
- ewl_window_set_name(EWL_WINDOW(win), "hello");
+ ewl_window_title_set(EWL_WINDOW(win), "Hello world");
+ ewl_window_class_set(EWL_WINDOW(win), "hello");
+ ewl_window_name_set(EWL_WINDOW(win), "hello");
ewl_object_size_request(EWL_OBJECT(win), 200, 50);
ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW, destroy_cb, NULL);
ewl_widget_show(win);
/* create the container */
box = ewl_vbox_new();
- ewl_container_append_child(EWL_CONTAINER(win), box);
+ ewl_container_child_append(EWL_CONTAINER(win), box);
ewl_object_fill_policy_set(EWL_OBJECT(box), EWL_FLAG_FILL_ALL);
ewl_widget_show(box);
/* create text label */
label = ewl_text_new(NULL);
- ewl_container_append_child(EWL_CONTAINER(box), label);
+ ewl_container_child_append(EWL_CONTAINER(box), label);
ewl_object_alignment_set(EWL_OBJECT(label), EWL_FLAG_ALIGN_CENTER);
ewl_text_style_set(EWL_TEXT(label), "soft_shadow");
ewl_text_color_set(EWL_TEXT(label), 255, 0, 0, 255);
@@ -288,7 +288,7 @@
/* create the entry */
o = ewl_entry_new("");
- ewl_container_append_child(EWL_CONTAINER(box), o);
+ ewl_container_child_append(EWL_CONTAINER(box), o);
ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_CENTER);
ewl_object_padding_set(EWL_OBJECT(o), 5, 5, 5, 0);
ewl_text_color_set(EWL_TEXT(EWL_ENTRY(o)->text), 0, 0, 0, 255);
@@ -375,7 +375,7 @@
<programlisting role="C">
box = ewl_vbox_new();
- ewl_container_append_child(EWL_CONTAINER(win), box);
+ ewl_container_child_append(EWL_CONTAINER(win), box);
ewl_object_fill_policy_set(EWL_OBJECT(box), EWL_FLAG_FILL_ALL);
ewl_widget_show(box);
</programlisting>
@@ -385,7 +385,7 @@
box is created with a call to <function>ewl_vbox_new()</function> creating a
vertical box layout. We could have used <function>ewl_hbox_new()</function>
if we desired a horizontal box instead of a vertical one. Once the box is created
-we attach it to the window by calling
<function>ewl_container_append_child()</function>.
+we attach it to the window by calling
<function>ewl_container_child_append()</function>.
This places the given widget into the container as the next element. Containers are
packed
from top to bottom, or left to right, so the order elements are inserted into the
container effect there appearance on screen. Lastly, before showing the widget,
@@ -417,7 +417,7 @@
<programlisting role="C">
label = ewl_text_new(NULL);
- ewl_container_append_child(EWL_CONTAINER(box), label);
+ ewl_container_child_append(EWL_CONTAINER(box), label);
ewl_object_alignment_set(EWL_OBJECT(label), EWL_FLAG_ALIGN_CENTER);
ewl_text_style_set(EWL_TEXT(label), "soft_shadow");
ewl_text_color_set(EWL_TEXT(label), 255, 0, 0, 255);
@@ -436,7 +436,7 @@
<para>
Once the widget is created we attach it to the box
-with <function>ewl_container_append_child()</function>. Next we set
+with <function>ewl_container_child_append()</function>. Next we set
the alignment on the text object though
<function>ewl_object_alignment_set()</function>.
This specifies how the contents will be aligned within the widget itself.
</para>
@@ -465,7 +465,7 @@
<programlisting role="C">
o = ewl_entry_new("");
- ewl_container_append_child(EWL_CONTAINER(box), o);
+ ewl_container_child_append(EWL_CONTAINER(box), o);
ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_CENTER);
ewl_object_padding_set(EWL_OBJECT(o), 5, 5, 5, 0);
ewl_text_color_set(EWL_TEXT(EWL_ENTRY(o)->text), 0, 0, 0, 255);
===================================================================
RCS file: /cvsroot/enlightenment/e17/docs/ewlbook/xml/widget_packing.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- widget_packing.xml 18 Jul 2004 20:45:02 -0000 1.3
+++ widget_packing.xml 18 Aug 2004 05:42:49 -0000 1.4
@@ -7,5 +7,29 @@
on how EWL packs widgets together.
</para>
+<para>
+There are two main orientations for containers in EWL, vertical or
+horizontal. The different orientations can be most easily seen in
+<xref linkend="sec-EwlBox" />.
+</para>
+
+<para>
+In EWL, each widget has an amount of padding around the widget and an inset
+set into the widget. This is seen in the below in
+<xref linkend="fig-padding_inset_diagram" />.
+
+ <figure id="fig-padding_inset_diagram">
+ <title>Padding and Insets</title>
+ <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="img/padding_insets.png" format="png" />
+ </imageobject>
+ <textobject>
+ <phrase>Diagram of padding and insets in EWL</phrase>
+ </textobject>
+ </inlinemediaobject>
+ </figure>
+</para>
+
</chapter>
===================================================================
RCS file: /cvsroot/enlightenment/e17/docs/ewlbook/xml/widgets.xml,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- widgets.xml 13 Aug 2004 01:17:12 -0000 1.9
+++ widgets.xml 18 Aug 2004 05:42:49 -0000 1.10
@@ -145,7 +145,7 @@
<title>Creating a checkbutton</title>
<programlisting role="C">
Ewl_Widget *cb = ewl_checkbutton_new("Label");
- ewl_checkbutton_set_label_position(EWL_CHECKBUTTON(cb), EWL_FLAG_ALIGN_LEFT);
+ ewl_checkbutton_label_position_set(EWL_CHECKBUTTON(cb), EWL_FLAG_ALIGN_LEFT);
ewl_callback_append(cb, EWL_CALLBACK_VALUE_CHANGED, checkbutton_cb, NULL);
ewl_widget_show(cb);
</programlisting>
@@ -196,7 +196,7 @@
ewl_widget_show(combo);
Ewl_widget *item1 = ewl_menu_item_new(NULL, "foo");
- ewl_container_append_child(EWL_CONTAINER(combo));
+ ewl_container_child_append(EWL_CONTAINER(combo));
ewl_widget_show(item1);
</programlisting>
</example>
@@ -258,12 +258,12 @@
ewl_widget_show(dialog);
o = ewl_dialog_set_button(EWL_STOCK_OK, EWL_RESPONSE_OK);
- ewl_container_append_child(EWL_CONTAINER(dialog), o);
+ ewl_container_child_append(EWL_CONTAINER(dialog), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED, dialog_clicked_cb, dialog);
ewl_widget_show(o);
o = ewl_dialog_set_button(EWL_STOCK_CANCEL, EWL_RESPONSE_CANCEL);
- ewl_container_append_child(EWL_CONTAINER(dialog), o);
+ ewl_container_child_append(EWL_CONTAINER(dialog), o);
ewl_callback_append(o, EWL_CALLBACK_CLICKED, dialog_clicked_cb, dialog);
ewl_widget_show(o);
</programlisting>
@@ -461,7 +461,7 @@
<para>
It is also possible to pack other widgets into the filedialog itself. This is done
through
-the normal <function>ewl_container_append_child()</function>. So, if you
+the normal <function>ewl_container_child_append()</function>. So, if you
needed, for example, to add a 'Home' button, you could create the button and pack it
into the file dialog where it will appear down the left side.
</para>
@@ -671,9 +671,9 @@
<title>Creating an EWL seeker</title>
<programlisting role="C">
Ewl_Widget *s = ewl_seeker_new(EWL_ORIENTATION_HORIZONTAL);
- ewl_seeker_set_value(EWL_SEEKER(s), 5.0);
- ewl_seeker_set_range(EWL_SEEKER(s), 10.0);
- ewl_seeker_set_step(EWL_SEEKER(s), 1);
+ ewl_seeker_value_set(EWL_SEEKER(s), 5.0);
+ ewl_seeker_range_set(EWL_SEEKER(s), 10.0);
+ ewl_seeker_step_set(EWL_SEEKER(s), 1);
ewl_callback_append(s, EWL_CALLBACK_VALUE_CHANGED, seeker_cb, NULL);
ewl_widget_show(s);
</programlisting>
@@ -685,7 +685,7 @@
<title>Ewl_Seeker callback</title>
<programlisting role="C">
void seeker_cb(Ewl_Widget *w, void *event, void *data) {
- double val = ewl_seeker_get_value(EWL_SEEKER(w));
+ double val = ewl_seeker_value_get(EWL_SEEKER(w));
printf("%f\n", val);
}
</programlisting>
@@ -976,17 +976,17 @@
<title>Creating a Window</title>
<programlisting role="C">
Ewl_Widget *window = ewl_window_new();
- ewl_window_set_title(EWL_WINDOW(window), "foo window");
- ewl_window_set_class(EWL_WINDOW(window), "foo_class");
- ewl_window_set_name(EWL_WINDOW(window), "foo_name");
+ ewl_window_title_set(EWL_WINDOW(window), "foo window");
+ ewl_window_class_set(EWL_WINDOW(window), "foo_class");
+ ewl_window_name_set(EWL_WINDOW(window), "foo_name");
ewl_object_size_request(EWL_OBJECT(window), 300, 400);
ewl_callback_append(window, EWL_CALLBACK_DELETE_WINDOW, win_del_cb, NULL);
ewl_widget_show(window);
</programlisting>
</example>
Setting up the basic window is pretty simple. We take the extra steps of
-calling: <function>ewl_window_set_title()</function>,
-<function>ewl_window_set_name()</function> and
<function>ewl_window_set_class()</function>
+calling: <function>ewl_window_title_set()</function>,
+<function>ewl_window_name_set()</function> and
<function>ewl_window_class_set()</function>
to fill in the information the window manager uses.
</para>
@@ -1020,20 +1020,20 @@
<para>
Some of the other operations involving the Ewl_Window object are:
<itemizedlist mark="bullet" spacing="compact">
- <listitem><para><function>char *ewl_window_get_title(Ewl_Window
*)</function></para></listitem>
- <listitem><para><function>char *ewl_window_get_name(Ewl_Window
*)</function></para></listitem>
- <listitem><para><function>char *ewl_window_get_class(Ewl_Window
*)</function></para></listitem>
- <listitem><para><function>void ewl_window_set_borderless(Ewl_Window
*)</function></para></listitem>
+ <listitem><para><function>char *ewl_window_title_get(Ewl_Window
*)</function></para></listitem>
+ <listitem><para><function>char *ewl_window_name_get(Ewl_Window
*)</function></para></listitem>
+ <listitem><para><function>char *ewl_window_class_get(Ewl_Window
*)</function></para></listitem>
+ <listitem><para><function>void ewl_window_borderless_set(Ewl_Window
*)</function></para></listitem>
<listitem><para><function>void ewl_window_move(Ewl_Window *, int x, int
y)</function></para></listitem>
<listitem><para>
- <function>void ewl_window_get_position(Ewl_Window *, int *x, int *y)</function>
+ <function>void ewl_window_position_get(Ewl_Window *, int *x, int *y)</function>
</para></listitem>
</itemizedlist>
-The first three calls are pretty self explanatory. The
<function>ewl_window_set_borderless()</function>
+The first three calls are pretty self explanatory. The
<function>ewl_window_borderless_set()</function>
can be used to tell the window manager not to display any decoration around the
window, this includes
the border and the title bar. The function <function>ewl_window_move()</function> is
used to
position the window to a specific place on the desktop, indexed from the top
-left corner. There is also a <function>ewl_window_get_position()</function> which
will return the position
+left corner. There is also a <function>ewl_window_position_get()</function> which
will return the position
of the window on the desktop.
</para>
</sect1>
-------------------------------------------------------
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