Enlightenment CVS committal

Author  : codewarrior
Project : e17
Module  : proto

Dir     : e17/proto/etk/src/lib


Modified Files:
        Etk.h etk_button.c etk_button.h etk_tool_button.c 
        etk_toolbar.c etk_toolbar.h 


Log Message:
- buttons now have a stock_size property
- buttons now have a style property that can control their appearence (icon, 
text, icon + text horiz, or icon + text vert)
- toolbar can change its orientation (horiz or vert)
- toolbar gets a style property that will affect its children's property 
(icons, text, both, both vert)
- toolbar will automatically change the orientation of any separators it holds 
once its orientation changes


===================================================================
RCS file: /cvs/e/e17/proto/etk/src/lib/Etk.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- Etk.h       13 Aug 2006 15:33:17 -0000      1.36
+++ Etk.h       15 Aug 2006 20:56:19 -0000      1.37
@@ -26,7 +26,6 @@
 #include "etk_stock.h"
 #include "etk_bin.h"
 #include "etk_box.h"
-#include "etk_toolbar.h"
 #include "etk_table.h"
 #include "etk_alignment.h"
 #include "etk_frame.h"
@@ -42,6 +41,7 @@
 #include "etk_toggle_button.h"
 #include "etk_check_button.h"
 #include "etk_radio_button.h"
+#include "etk_toolbar.h"   
 #include "etk_tool_button.h"   
 #include "etk_editable_text_object.h"
 #include "etk_textblock.h"
===================================================================
RCS file: /cvs/e/e17/proto/etk/src/lib/etk_button.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -3 -r1.24 -r1.25
--- etk_button.c        15 Aug 2006 15:59:01 -0000      1.24
+++ etk_button.c        15 Aug 2006 20:56:19 -0000      1.25
@@ -29,7 +29,8 @@
    ETK_BUTTON_IMAGE_PROPERTY,
    ETK_BUTTON_XALIGN_PROPERTY,
    ETK_BUTTON_YALIGN_PROPERTY,
-   ETK_BUTTON_TOOL_PROPERTY
+   ETK_BUTTON_STYLE_PROPERTY,
+   ETK_BUTTON_STOCK_SIZE_PROPERTY
 };
 
 static void _etk_button_constructor(Etk_Button *button);
@@ -83,8 +84,10 @@
          ETK_PROPERTY_FLOAT, ETK_PROPERTY_READABLE_WRITABLE,  
etk_property_value_float(0.5));
       etk_type_property_add(button_type, "yalign", ETK_BUTTON_YALIGN_PROPERTY,
          ETK_PROPERTY_FLOAT, ETK_PROPERTY_READABLE_WRITABLE,  
etk_property_value_float(0.5));
-      etk_type_property_add(button_type, "tool", ETK_BUTTON_TOOL_PROPERTY,
-         ETK_PROPERTY_BOOL, ETK_PROPERTY_READABLE_WRITABLE,  
etk_property_value_bool(ETK_FALSE));
+      etk_type_property_add(button_type, "style", ETK_BUTTON_STYLE_PROPERTY,
+         ETK_PROPERTY_INT, ETK_PROPERTY_READABLE_WRITABLE,  
etk_property_value_int(ETK_BUTTON_BOTH_VERT));
+      etk_type_property_add(button_type, "stock_size", 
ETK_BUTTON_STOCK_SIZE_PROPERTY,
+         ETK_PROPERTY_INT, ETK_PROPERTY_READABLE_WRITABLE,  
etk_property_value_int(ETK_STOCK_SMALL));
 
       button_type->property_set = _etk_button_property_set;
       button_type->property_get = _etk_button_property_get;
@@ -243,10 +246,7 @@
    if (!button)
       return;
 
-   if (button->tool)
-      image = etk_image_new_from_stock(stock_id, ETK_STOCK_MEDIUM);
-   else
-      image = etk_image_new_from_stock(stock_id, ETK_STOCK_SMALL);
+   image = etk_image_new_from_stock(stock_id, button->stock_size);
    etk_widget_show(image);
    etk_widget_visibility_locked_set(image, ETK_TRUE);
    label = etk_stock_label_get(stock_id);
@@ -308,19 +308,19 @@
 }
 
 /**
- * @brief Sets wether the button is a toolbar button or not
+ * @brief Sets the style of the button (icon, text, both vertically, both 
horizontally
  * @param button a button
- * @param tool ETK_TRUE for a toolbar button, ETK_FALSE otherwise
+ * @param style the style to give the button
  */
-void etk_button_tool_set(Etk_Button *button, Etk_Bool tool)
+void etk_button_style_set(Etk_Button *button, Etk_Button_Style style)
 {
    if (!button)
       return;
    
-   if (button->tool == tool)
+   if (button->style == style)
       return;
 
-   button->tool = tool;
+   button->style = style;
    if (button->box)
    {  
       if (button->image)
@@ -331,20 +331,62 @@
       button->box = NULL;
    }
    _etk_button_children_create(button);
-   etk_object_notify(ETK_OBJECT(button), "tool");
+   etk_object_notify(ETK_OBJECT(button), "style");
 }
 
 /**
- * @brief Gets wether the button is a toolbar button or not
+ * @brief Sets the style of the button (icon, text, both vertically, both 
horizontally
  * @param button a button
- * @return Returns a boolean indication of its a toolbar button or not
+ * @return Returns the button's style
  */
-Etk_Bool etk_button_tool_get(Etk_Button *button)
+Etk_Button_Style etk_button_style_get(Etk_Button *button)
 {
    if (!button)
       return ETK_FALSE;
    
-   return button->tool;
+   return button->style;
+}
+
+/**
+ * @brief Sets the button's stock size
+ * @param button a button
+ * @param style the stock size
+ */
+void etk_button_stock_size_set(Etk_Button *button, Etk_Stock_Size size)
+{
+   Etk_Stock_Id stock_id;
+   Etk_Stock_Size stock_size;
+   
+   if (!button)
+      return;
+   
+   if (button->stock_size == size)
+      return;
+
+   button->stock_size = size;
+   
+   if (!button->image)
+      return;
+   
+   etk_image_stock_get(button->image, &stock_id, &stock_size);
+   if (stock_id == ETK_STOCK_NO_STOCK)
+      return;
+
+   etk_button_set_from_stock(ETK_BUTTON(button), stock_id);  
+   etk_object_notify(ETK_OBJECT(button), "stock_size");
+}
+
+/**
+ * @brief Gets the size of the button's stock
+ * @param button a button
+ * @return Returns the button's stock size
+ */
+Etk_Stock_Size etk_button_stock_size_get(Etk_Button *button)
+{
+   if (!button)
+      return ETK_STOCK_SMALL;
+   
+   return button->stock_size;
 }
 
 /**************************
@@ -362,7 +404,9 @@
    button->box = NULL;
    button->image = NULL;
    button->alignment = NULL;
-
+   button->style = ETK_BUTTON_BOTH_HORIZ;
+   button->stock_size = ETK_STOCK_SMALL;   
+   
    button->label = etk_label_new(NULL);
    etk_widget_visibility_locked_set(button->label, ETK_TRUE);
    etk_label_alignment_set(ETK_LABEL(button->label), 0.5, 0.5);
@@ -376,7 +420,7 @@
    button->is_pressed = ETK_FALSE;
    button->xalign = 0.5;
    button->yalign = 0.5;
-   button->tool = ETK_FALSE;   
+   button->style = ETK_BUTTON_BOTH_HORIZ;
 
    etk_signal_connect("realize", ETK_OBJECT(button), 
ETK_CALLBACK(_etk_button_realize_cb), NULL);
    etk_signal_connect("key_down", ETK_OBJECT(button), 
ETK_CALLBACK(_etk_button_key_down_cb), NULL);
@@ -407,8 +451,13 @@
          break;
       case ETK_BUTTON_YALIGN_PROPERTY:
          etk_button_alignment_set(button, button->xalign, 
etk_property_value_float_get(value));
-      case ETK_BUTTON_TOOL_PROPERTY:
-         etk_button_tool_set(button, etk_property_value_bool_get(value));
+         break;
+      case ETK_BUTTON_STYLE_PROPERTY:
+         etk_button_style_set(button, etk_property_value_int_get(value));
+         break;
+      case ETK_BUTTON_STOCK_SIZE_PROPERTY:
+         etk_button_stock_size_set(button, etk_property_value_int_get(value));
+         break;      
       default:
          break;
    }
@@ -436,8 +485,11 @@
       case ETK_BUTTON_YALIGN_PROPERTY:
          etk_property_value_float_set(value, button->yalign);
          break;
-      case ETK_BUTTON_TOOL_PROPERTY:
-         etk_property_value_bool_set(value, button->tool);
+      case ETK_BUTTON_STYLE_PROPERTY:
+         etk_property_value_int_set(value, button->style);
+         break;
+      case ETK_BUTTON_STOCK_SIZE_PROPERTY:
+         etk_property_value_int_set(value, button->stock_size);
          break;      
       default:
          break;
@@ -582,13 +634,8 @@
       Etk_Stock_Size stock_size;
       
       etk_image_stock_get(button->image, &stock_id, &stock_size);
-      if (stock_id != ETK_STOCK_NO_STOCK)
-      {
-        if (button->tool && stock_size != ETK_STOCK_MEDIUM)
-           etk_image_set_from_stock(button->image, stock_id, ETK_STOCK_MEDIUM);
-        else if (!button->tool && stock_size != ETK_STOCK_SMALL)
-           etk_image_set_from_stock(button->image, stock_id, ETK_STOCK_SMALL);
-      }      
+      if (stock_id != ETK_STOCK_NO_STOCK)      
+        etk_image_set_from_stock(button->image, stock_id, button->stock_size);
       
       if (!button->alignment)
       {         
@@ -601,8 +648,8 @@
 
       if (!button->box)
       {
-        if (button->tool)
-           button->box = etk_vbox_new(ETK_FALSE, 1);
+        if (button->style == ETK_BUTTON_BOTH_VERT)        
+           button->box = etk_vbox_new(ETK_FALSE, 1);      
         else
            button->box = etk_hbox_new(ETK_FALSE, 8);      
         
@@ -613,10 +660,14 @@
          etk_signal_connect("child_removed", ETK_OBJECT(button->box), 
ETK_CALLBACK(_etk_button_image_removed_cb), button);
          
          etk_label_alignment_set(ETK_LABEL(button->label), 0.0, 0.5);
-         etk_box_append(ETK_BOX(button->box), button->label, ETK_BOX_END, 
ETK_BOX_NONE, 0);
+        etk_box_append(ETK_BOX(button->box), button->label, ETK_BOX_END, 
ETK_BOX_NONE, 0);
+        if (button->style == ETK_BUTTON_ICON)     
+           etk_widget_hide(button->label);        
       }
-
+           
       etk_box_append(ETK_BOX(button->box), ETK_WIDGET(button->image), 
ETK_BOX_START, ETK_BOX_NONE, 0);
+      if (button->style == ETK_BUTTON_TEXT)
+        etk_widget_hide(ETK_WIDGET(button->image));
       etk_widget_pass_mouse_events_set(ETK_WIDGET(button->image), ETK_TRUE);
    }
    else
===================================================================
RCS file: /cvs/e/e17/proto/etk/src/lib/etk_button.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- etk_button.h        13 Aug 2006 10:41:15 -0000      1.8
+++ etk_button.h        15 Aug 2006 20:56:19 -0000      1.9
@@ -25,6 +25,18 @@
 #define ETK_IS_BUTTON(obj)    (ETK_OBJECT_CHECK_TYPE((obj), ETK_BUTTON_TYPE))
 
 /**
+ * @enum Etk_Button_Style
+ * @brief The button's style (icon, text, both vertically, both horizontally)
+ */
+typedef enum _Etk_Button_Style
+{
+   ETK_BUTTON_ICON,
+   ETK_BUTTON_TEXT,
+   ETK_BUTTON_BOTH_VERT,
+   ETK_BUTTON_BOTH_HORIZ
+} Etk_Button_Style;
+
+/**
  * @brief @widget The structure of a button
  * @structinfo
  */
@@ -46,7 +58,8 @@
    Etk_Bool is_pressed;
    float xalign;
    float yalign;
-   Etk_Bool tool;
+   Etk_Button_Style style;
+   Etk_Stock_Size stock_size;
 };
 
 Etk_Type *etk_button_type_get();
@@ -69,8 +82,11 @@
 void etk_button_alignment_set(Etk_Button *button, float xalign, float yalign);
 void etk_button_alignment_get(Etk_Button *button, float *xalign, float 
*yalign);
 
-void etk_button_tool_set(Etk_Button *button, Etk_Bool tool);
-Etk_Bool etk_button_tool_get(Etk_Button *button);
+void etk_button_style_set(Etk_Button *button, Etk_Button_Style style);
+Etk_Button_Style etk_button_style_get(Etk_Button *button);
+
+void etk_button_stock_size_set(Etk_Button *button, Etk_Stock_Size size);
+Etk_Stock_Size etk_button_stock_size_get(Etk_Button *button);
 
 /** @} */
 
===================================================================
RCS file: /cvs/e/e17/proto/etk/src/lib/etk_tool_button.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- etk_tool_button.c   13 Aug 2006 15:33:17 -0000      1.1
+++ etk_tool_button.c   15 Aug 2006 20:56:19 -0000      1.2
@@ -43,7 +43,7 @@
 Etk_Widget *etk_tool_button_new()
 {
    return etk_widget_new(ETK_TOOL_BUTTON_TYPE, "theme_group", "toolbar/button",
-      "tool", ETK_TRUE, NULL);
+      "style", ETK_BUTTON_BOTH_VERT, NULL);
 }
 
 /**
@@ -53,7 +53,7 @@
 Etk_Widget *etk_tool_button_new_with_label(const char *label)
 {
    return etk_widget_new(ETK_TOOL_BUTTON_TYPE, "theme_group", "toolbar/button",
-      "label", label, "tool", ETK_TRUE, NULL);
+      "label", label, "style", ETK_BUTTON_BOTH_VERT, NULL);
 }
 
 /**
===================================================================
RCS file: /cvs/e/e17/proto/etk/src/lib/etk_toolbar.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- etk_toolbar.c       15 Aug 2006 17:43:29 -0000      1.3
+++ etk_toolbar.c       15 Aug 2006 20:56:19 -0000      1.4
@@ -5,6 +5,8 @@
 
 #include "etk_widget.h"
 #include "etk_signal.h"
+#include "etk_button.h"
+#include "etk_separator.h"
 
 /**
  * @addtogroup Etk_Toolbar
@@ -13,7 +15,8 @@
 
 enum Etk_Window_Property_Id
 {
-   ETK_TOOLBAR_ORIENTATION_PROPERTY
+   ETK_TOOLBAR_ORIENTATION_PROPERTY,
+   ETK_TOOLBAR_STYLE_PROPERTY     
 };     
 
 static void _etk_toolbar_constructor(Etk_Toolbar *toolbar);
@@ -42,7 +45,8 @@
       toolbar_type = etk_type_new("Etk_Toolbar", ETK_WIDGET_TYPE, 
sizeof(Etk_Toolbar),
          ETK_CONSTRUCTOR(_etk_toolbar_constructor), 
ETK_DESTRUCTOR(_etk_toolbar_destructor));
 
-      etk_type_property_add(toolbar_type, "orientation", 
ETK_TOOLBAR_ORIENTATION_PROPERTY, ETK_PROPERTY_INT, 
ETK_PROPERTY_READABLE_WRITABLE, 
etk_property_value_int(ETK_TOOLBAR_ORIENTATION_HORIZONTAL));
+      etk_type_property_add(toolbar_type, "orientation", 
ETK_TOOLBAR_ORIENTATION_PROPERTY, ETK_PROPERTY_INT, 
ETK_PROPERTY_READABLE_WRITABLE, etk_property_value_int(ETK_TOOLBAR_HORIZ));
+      etk_type_property_add(toolbar_type, "style", ETK_TOOLBAR_STYLE_PROPERTY, 
ETK_PROPERTY_INT, ETK_PROPERTY_READABLE_WRITABLE, 
etk_property_value_int(ETK_TOOLBAR_BOTH_VERT));
       
       toolbar_type->property_set = _etk_toolbar_property_set;
       toolbar_type->property_get = _etk_toolbar_property_get;
@@ -56,7 +60,7 @@
  */
 Etk_Widget *etk_toolbar_new()
 {
-   return etk_widget_new(ETK_TOOLBAR_TYPE, "theme_group", 
"toolbar","orientation", ETK_TOOLBAR_ORIENTATION_HORIZONTAL, NULL);
+   return etk_widget_new(ETK_TOOLBAR_TYPE, "theme_group", "toolbar", NULL);
 }
 
 /**
@@ -69,6 +73,30 @@
    if (!toolbar || !widget)
       return;
    
+   if (ETK_IS_BUTTON(widget))
+   {
+      Etk_Button_Style button_style;
+           
+      switch(toolbar->style)
+      {
+         case ETK_TOOLBAR_ICONS:
+            button_style = ETK_BUTTON_ICON;
+            break;
+         case ETK_TOOLBAR_TEXT:
+            button_style = ETK_BUTTON_TEXT;
+            break;
+         case ETK_TOOLBAR_BOTH_VERT:
+            button_style = ETK_BUTTON_BOTH_VERT;
+            break;
+         case ETK_TOOLBAR_BOTH_HORIZ:
+            button_style = ETK_BUTTON_BOTH_HORIZ;
+            break;
+         default:
+            button_style = ETK_BUTTON_ICON;
+            break;      
+      }      
+      etk_button_style_set(ETK_BUTTON(widget), button_style);
+   }
    etk_box_append(ETK_BOX(toolbar->box), widget, ETK_BOX_START, ETK_BOX_NONE, 
0);
 }
 
@@ -82,6 +110,30 @@
    if (!toolbar || !widget)
       return;
    
+   if (ETK_IS_BUTTON(widget))
+   {
+      Etk_Button_Style button_style;
+           
+      switch(toolbar->style)
+      {
+         case ETK_TOOLBAR_ICONS:
+            button_style = ETK_BUTTON_ICON;
+            break;
+         case ETK_TOOLBAR_TEXT:
+            button_style = ETK_BUTTON_TEXT;
+            break;
+         case ETK_TOOLBAR_BOTH_VERT:
+            button_style = ETK_BUTTON_BOTH_VERT;
+            break;
+         case ETK_TOOLBAR_BOTH_HORIZ:
+            button_style = ETK_BUTTON_BOTH_HORIZ;
+            break;
+         default:
+            button_style = ETK_BUTTON_ICON;
+            break;      
+      }      
+      etk_button_style_set(ETK_BUTTON(widget), button_style);
+   }   
    etk_box_prepend(ETK_BOX(toolbar->box), widget, ETK_BOX_START, ETK_BOX_NONE, 
0);
 }
 
@@ -90,14 +142,12 @@
  * @param toolbar the toolbar
  * @param orientation the orientation
  */
-void etk_toolbar_orientation_set(Etk_Toolbar *toolbar, int orientation)
+void etk_toolbar_orientation_set(Etk_Toolbar *toolbar, Etk_Toolbar_Orientation 
orientation)
 {
    Evas_List *children;
    Evas_List *l;
    
-   if (!toolbar || toolbar->orientation == orientation ||
-       (orientation != ETK_TOOLBAR_ORIENTATION_HORIZONTAL &&
-       orientation != ETK_TOOLBAR_ORIENTATION_VERTICAL))
+   if (!toolbar || toolbar->orientation == orientation)
       return;
    
    children = etk_container_children_get(ETK_CONTAINER(toolbar->box));
@@ -108,7 +158,7 @@
    etk_object_destroy(ETK_OBJECT(toolbar->box));
    
    toolbar->orientation = orientation;
-   if (toolbar->orientation == ETK_TOOLBAR_ORIENTATION_VERTICAL)
+   if (toolbar->orientation == ETK_TOOLBAR_VERT)
       toolbar->box = etk_vbox_new(ETK_FALSE, 0);
    else
       toolbar->box = etk_hbox_new(ETK_FALSE, 0);           
@@ -118,7 +168,19 @@
    etk_widget_show(toolbar->box);
    
    for (l = children; l; l = l->next)
+   {
+      if (ETK_IS_VSEPARATOR(l->data))
+      {
+        etk_object_destroy(ETK_OBJECT(l->data));
+        l->data = etk_hseparator_new();
+      } 
+      else if (ETK_IS_HSEPARATOR(l->data))
+      {
+        etk_object_destroy(ETK_OBJECT(l->data));
+        l->data = etk_vseparator_new();
+      }
       etk_box_append(ETK_BOX(toolbar->box), ETK_WIDGET(l->data), 
ETK_BOX_START, ETK_BOX_NONE, 0);
+   }
 }
 
 /**
@@ -126,7 +188,7 @@
  * @param toolbar the toolbar
  * @return the orientation
  */
-int etk_toolbar_orientation_get(Etk_Toolbar *toolbar)
+Etk_Toolbar_Orientation etk_toolbar_orientation_get(Etk_Toolbar *toolbar)
 {
    if (!toolbar)
       return ETK_FALSE;
@@ -134,6 +196,61 @@
    return toolbar->orientation;
 }
 
+/**
+ * @brief Sets the toolbar's style (icons, text, both, both vertical)
+ * @param toolbar the toolbar
+ * @param style the style
+ */
+void etk_toolbar_style_set(Etk_Toolbar *toolbar, Etk_Toolbar_Style style)
+{
+   Evas_List *children;
+   Evas_List *l;
+   Etk_Button_Style button_style;
+   
+   if (!toolbar || toolbar->style == style)
+      return;
+   
+   children = etk_container_children_get(ETK_CONTAINER(toolbar->box));
+      
+   toolbar->style = style;
+   switch(style)
+   {
+      case ETK_TOOLBAR_ICONS:
+         button_style = ETK_BUTTON_ICON;
+         break;
+      case ETK_TOOLBAR_TEXT:
+         button_style = ETK_BUTTON_TEXT;
+         break;
+      case ETK_TOOLBAR_BOTH_VERT:
+         button_style = ETK_BUTTON_BOTH_VERT;
+         break;
+      case ETK_TOOLBAR_BOTH_HORIZ:
+         button_style = ETK_BUTTON_BOTH_HORIZ;
+         break;
+      default:
+         button_style = ETK_BUTTON_ICON;
+         break;      
+   }
+   for (l = children; l; l = l->next)
+   {
+      if (ETK_IS_BUTTON(l->data))
+        etk_button_style_set(ETK_BUTTON(l->data), button_style);
+   }
+}
+
+/**
+ * @brief Gets the toolbar's style (icons, text, both, both vertical)
+ * @param toolbar the toolbar
+ * @return the style
+ */
+Etk_Toolbar_Style etk_toolbar_style_get(Etk_Toolbar *toolbar)
+{
+   if (!toolbar)
+      return ETK_TOOLBAR_DEFAULT;
+   
+   return toolbar->style;
+}
+
 /**************************
  *
  * Etk specific functions
@@ -145,15 +262,14 @@
 {
    if (!toolbar)
       return;
-   
-   if (toolbar->orientation == ETK_TOOLBAR_ORIENTATION_VERTICAL)
-      toolbar->box = etk_vbox_new(ETK_FALSE, 0);
-   else
-      toolbar->box = etk_hbox_new(ETK_FALSE, 0);
-   
+
+   toolbar->style = ETK_TOOLBAR_BOTH_VERT;
+   toolbar->orientation = ETK_TOOLBAR_HORIZ;
+      
    ETK_WIDGET(toolbar)->size_request = _etk_toolbar_size_request;
    ETK_WIDGET(toolbar)->size_allocate = _etk_toolbar_size_allocate;
-   
+
+   toolbar->box = etk_hbox_new(ETK_FALSE, 0);
    etk_widget_parent_set(toolbar->box, ETK_WIDGET(toolbar));
    etk_widget_visibility_locked_set(ETK_WIDGET(toolbar->box), ETK_TRUE);
    etk_widget_show(toolbar->box);
@@ -182,8 +298,11 @@
       case ETK_TOOLBAR_ORIENTATION_PROPERTY:
          etk_toolbar_orientation_set(toolbar, 
etk_property_value_int_get(value));
          break;
-      default:
+      case ETK_TOOLBAR_STYLE_PROPERTY:
+         etk_toolbar_style_set(toolbar, etk_property_value_int_get(value));
          break;      
+      default:
+         break;
    }
 }
 
@@ -200,6 +319,9 @@
       case ETK_TOOLBAR_ORIENTATION_PROPERTY:
          etk_property_value_int_set(value, toolbar->orientation);
          break;
+      case ETK_TOOLBAR_STYLE_PROPERTY:
+         etk_property_value_int_set(value, toolbar->style);
+         break;      
       default:
          break;
    }
===================================================================
RCS file: /cvs/e/e17/proto/etk/src/lib/etk_toolbar.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- etk_toolbar.h       15 Aug 2006 17:43:29 -0000      1.2
+++ etk_toolbar.h       15 Aug 2006 20:56:19 -0000      1.3
@@ -27,11 +27,24 @@
  */
 typedef enum _Etk_Toolbar_Orientation
 {
-   ETK_TOOLBAR_ORIENTATION_HORIZONTAL,
-   ETK_TOOLBAR_ORIENTATION_VERTICAL,
+   ETK_TOOLBAR_HORIZ,
+   ETK_TOOLBAR_VERT,
 } Etk_Toolbar_Orientation;
 
 /**
+ * @enum Etk_Toolbar_Style
+ * @brief The style a toolbar has (icons, text, both, both horizontally)
+ */
+typedef enum _Etk_Toolbar_Style
+{
+   ETK_TOOLBAR_ICONS,            /**< Only show icons */
+   ETK_TOOLBAR_TEXT,             /**< Only show text */
+   ETK_TOOLBAR_BOTH_VERT,        /**< Show icons and text, vertically */
+   ETK_TOOLBAR_BOTH_HORIZ,       /**< Show icons and text, horizontally */
+   ETK_TOOLBAR_DEFAULT           /**< Use Etk's default policy */
+} Etk_Toolbar_Style;
+
+/**
  * @brief @widget The structure of a toolbar
  * @structinfo
  */
@@ -42,7 +55,8 @@
    Etk_Widget widget;
 
    Etk_Widget *box;
-   int orientation;
+   Etk_Toolbar_Orientation orientation;
+   Etk_Toolbar_Style style;
 };
 
 Etk_Type *etk_toolbar_type_get();
@@ -52,8 +66,11 @@
 void etk_toolbar_append(Etk_Toolbar *toolbar, Etk_Widget *widget);
 void etk_toolbar_prepend(Etk_Toolbar *toolbar, Etk_Widget *widget);
 
-void etk_toolbar_orientation_set(Etk_Toolbar *toolbar, int orientation);
-int etk_toolbar_orientation_get(Etk_Toolbar *toolbar);  
+void etk_toolbar_orientation_set(Etk_Toolbar *toolbar, Etk_Toolbar_Orientation 
orientation);
+Etk_Toolbar_Orientation etk_toolbar_orientation_get(Etk_Toolbar *toolbar);
+
+void etk_toolbar_style_set(Etk_Toolbar *toolbar, Etk_Toolbar_Style style);
+Etk_Toolbar_Style etk_toolbar_style_get(Etk_Toolbar *toolbar);
 
 /** @} */
 



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to