Enlightenment CVS committal Author : moom16 Project : e17 Module : proto
Dir : e17/proto/etk/src/lib Modified Files: Etk.h Makefile.am etk_bin.c etk_bin.h etk_tree.c etk_types.h Added Files: etk_frame.c etk_frame.h Log Message: * Add a frame container * More work on the test app of the tree =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/Etk.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- Etk.h 28 Oct 2005 14:06:25 -0000 1.5 +++ Etk.h 30 Oct 2005 10:25:25 -0000 1.6 @@ -23,6 +23,7 @@ #include "etk_vbox.h" #include "etk_table.h" #include "etk_alignment.h" +#include "etk_frame.h" #include "etk_paned.h" #include "etk_window.h" #include "etk_label.h" =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/Makefile.am,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- Makefile.am 28 Oct 2005 14:06:25 -0000 1.8 +++ Makefile.am 30 Oct 2005 10:25:25 -0000 1.9 @@ -22,7 +22,7 @@ etk_widget.h etk_toplevel_widget.h \ etk_container.h etk_bin.h etk_table.h etk_alignment.h \ etk_box.h etk_hbox.h etk_vbox.h \ -etk_paned.h \ +etk_paned.h etk_frame.h \ etk_window.h \ etk_image.h \ etk_string.h etk_editable_text_object.h etk_label.h \ @@ -41,7 +41,7 @@ etk_widget.c etk_toplevel_widget.c \ etk_container.c etk_bin.c etk_table.c etk_alignment.c \ etk_box.c etk_hbox.c etk_vbox.c \ -etk_paned.c \ +etk_paned.c etk_frame.c \ etk_window.c \ etk_image.c \ etk_string.c etk_editable_text_object.c etk_label.c \ =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/etk_bin.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- etk_bin.c 29 Oct 2005 19:57:20 -0000 1.3 +++ etk_bin.c 30 Oct 2005 10:25:25 -0000 1.4 @@ -51,7 +51,7 @@ { if (!bin) return NULL; - return ETK_WIDGET(evas_list_data(ETK_CONTAINER(bin)->children)); + return bin->child; } /** @@ -61,10 +61,10 @@ */ void etk_bin_child_set(Etk_Bin *bin, Etk_Widget *child) { - if (!bin || etk_bin_child_get(bin) == child) + if (!bin || bin->child == child) return; - _etk_bin_child_remove(ETK_CONTAINER(bin), etk_bin_child_get(bin)); + _etk_bin_child_remove(ETK_CONTAINER(bin), bin->child); if (child) { @@ -74,6 +74,7 @@ /* TODO: disconnect */ etk_signal_connect_after("realize", ETK_OBJECT(child), ETK_CALLBACK(_etk_bin_child_realize_cb), bin); etk_widget_parent_set(child, ETK_CONTAINER(bin)); + bin->child = child; } return; @@ -91,6 +92,7 @@ if (!bin) return; + bin->child = NULL; ETK_CONTAINER(bin)->child_add = _etk_bin_child_add; ETK_CONTAINER(bin)->child_remove = _etk_bin_child_remove; ETK_WIDGET(bin)->size_request = _etk_bin_size_request; @@ -102,20 +104,19 @@ { Etk_Bin *bin; Etk_Container *container; - Etk_Widget *child; if (!(bin = ETK_BIN(widget)) || !size_requisition) return; container = ETK_CONTAINER(bin); - if (!(child = etk_bin_child_get(bin))) + if (!bin->child) { size_requisition->w = 0; size_requisition->h = 0; } else - etk_widget_size_request(child, size_requisition); + etk_widget_size_request(bin->child, size_requisition); size_requisition->w += 2 * etk_container_border_width_get(container); size_requisition->h += 2 * etk_container_border_width_get(container); @@ -125,20 +126,19 @@ static void _etk_bin_size_allocate(Etk_Widget *widget, Etk_Geometry geometry) { Etk_Bin *bin; - Etk_Widget *child; Etk_Container *container; if (!(bin = ETK_BIN(widget))) return; container = ETK_CONTAINER(widget); - if ((child = etk_bin_child_get(bin)) && !child->swallowed) + if (bin->child && !bin->child->swallowed) { geometry.x += etk_container_border_width_get(container); geometry.y += etk_container_border_width_get(container); geometry.w -= 2 * etk_container_border_width_get(container); geometry.h -= 2 * etk_container_border_width_get(container); - etk_widget_size_allocate(child, geometry); + etk_widget_size_allocate(bin->child, geometry); } } @@ -160,34 +160,29 @@ /* Removes the child from the bin */ static void _etk_bin_child_remove(Etk_Container *container, Etk_Widget *widget) { - Etk_Widget *child; Etk_Bin *bin; - Etk_Widget *bin_widget; if (!(bin = ETK_BIN(container)) || !widget) return; - bin_widget = ETK_WIDGET(bin); - child = etk_bin_child_get(bin); - - if (child != widget) + if (bin->child != widget) return; etk_widget_parent_set(widget, NULL); - etk_widget_size_recalc_queue(bin_widget); + bin->child = NULL; + etk_widget_size_recalc_queue(ETK_WIDGET(bin)); } /* Called when the child of the bin is realized */ static void _etk_bin_child_realize_cb(Etk_Object *object, void *data) { Etk_Bin *bin; - Etk_Widget *child; - if (!(bin = ETK_BIN(data)) || !(child = etk_bin_child_get(bin)) || ETK_OBJECT(child) != object) + if (!(bin = ETK_BIN(data)) || !bin->child || ETK_OBJECT(bin->child) != object) return; - if (ETK_WIDGET(bin)->realized && child->realized) - etk_widget_swallow_widget(ETK_WIDGET(bin), "swallow_area", child); + if (ETK_WIDGET(bin)->realized && bin->child->realized) + etk_widget_swallow_widget(ETK_WIDGET(bin), "swallow_area", bin->child); } /** @} */ =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/etk_bin.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- etk_bin.h 29 Oct 2005 19:57:20 -0000 1.2 +++ etk_bin.h 30 Oct 2005 10:25:25 -0000 1.3 @@ -26,6 +26,8 @@ /* private: */ /* Inherit from Etk_Container */ Etk_Container container; + + Etk_Widget *child; }; Etk_Type *etk_bin_type_get(); =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/etk_tree.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- etk_tree.c 30 Oct 2005 08:13:32 -0000 1.10 +++ etk_tree.c 30 Oct 2005 10:25:25 -0000 1.11 @@ -698,13 +698,16 @@ if ((l = evas_list_find_list(row->node.parent->child_rows, row))) { - Etk_Tree_Node *n; - for (n = row->tree->last_selected; n; n = n->parent) + if (row->tree->last_selected) { - if (&row->node == n) + Etk_Tree_Node *n; + for (n = row->tree->last_selected; n; n = n->parent) { - row->tree->last_selected = NULL; - break; + if (&row->node == n) + { + row->tree->last_selected = NULL; + break; + } } } _etk_tree_row_free(l->data); =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/etk_types.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- etk_types.h 28 Oct 2005 14:06:25 -0000 1.7 +++ etk_types.h 30 Oct 2005 10:25:25 -0000 1.8 @@ -59,6 +59,7 @@ typedef struct _Etk_Table_Col_Row Etk_Table_Col_Row; typedef struct _Etk_Table_Child_Properties Etk_Table_Child_Properties; typedef struct _Etk_Alignment Etk_Alignment; +typedef struct _Etk_Frame Etk_Frame; typedef struct _Etk_Paned Etk_Paned; typedef struct _Etk_HPaned Etk_HPaned; typedef struct _Etk_VPaned Etk_VPaned; ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs