Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_box.c ewl_button.c ewl_scrollbar.c ewl_scrollbar.h 
        ewl_seeker.c ewl_seeker.h 


Log Message:
Conversion of seeker and scrollbar to new API style.
Re-enable the child hide functions on the box.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_box.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ewl_box.c   3 Oct 2005 06:43:06 -0000       1.7
+++ ewl_box.c   8 Oct 2005 06:22:59 -0000       1.8
@@ -158,7 +158,7 @@
         */
        ewl_container_resize_notify_set(EWL_CONTAINER(b), 
ewl_box_child_resize_cb);
        ewl_container_show_notify_set(EWL_CONTAINER(b), ewl_box_child_show_cb);
-       ewl_container_hide_notify_set(EWL_CONTAINER(b), ewl_box_child_show_cb);
+       ewl_container_hide_notify_set(EWL_CONTAINER(b), ewl_box_child_hide_cb);
 
        /*
         * Attach the default layout callback.
@@ -266,7 +266,7 @@
                ewl_container_show_notify_set(EWL_CONTAINER(b),
                                          ewl_box_child_show_cb);
                ewl_container_hide_notify_set(EWL_CONTAINER(b),
-                                         ewl_box_child_show_cb);
+                                         ewl_box_child_hide_cb);
        }
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_button.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- ewl_button.c        6 Oct 2005 05:01:44 -0000       1.6
+++ ewl_button.c        8 Oct 2005 06:22:59 -0000       1.7
@@ -70,8 +70,12 @@
        else if (!b->label_object) {
                b->label_object = ewl_label_new();
                ewl_label_text_set(EWL_LABEL(b->label_object), l);
-               ewl_widget_show(b->label_object);
+               ewl_object_fill_policy_set(EWL_OBJECT(b->label_object),
+                                       EWL_FLAG_FILL_ALL);
+               ewl_object_alignment_set(EWL_OBJECT(b->label_object),
+                                       EWL_FLAG_ALIGN_CENTER);
                ewl_container_child_append(EWL_CONTAINER(b), b->label_object);
+               ewl_widget_show(b->label_object);
        }
        else
                ewl_label_text_set(EWL_LABEL(b->label_object), l);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_scrollbar.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- ewl_scrollbar.c     3 Oct 2005 06:43:07 -0000       1.5
+++ ewl_scrollbar.c     8 Oct 2005 06:22:59 -0000       1.6
@@ -6,11 +6,10 @@
 static int  ewl_scrollbar_timer(void *data);
 
 /**
- * @param orientation: the desired orientation of the scrollbar
  * @return Returns NULL on failure, or a pointer to a new scrollbar on success.
  * @brief Allocate and initialize a new scrollbar widget
  */
-Ewl_Widget     *ewl_scrollbar_new(Ewl_Orientation orientation)
+Ewl_Widget *ewl_scrollbar_new(void)
 {
        Ewl_Scrollbar  *s;
 
@@ -23,18 +22,51 @@
        /*
         * Initialize the objects fields.
         */
-       ewl_scrollbar_init(s, orientation);
+       ewl_scrollbar_init(s);
+
+       DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE);
+}
+
+/**
+ * @return Returns NULL on failure, or a pointer to a new scrollbar on success.
+ * @brief Allocate and initialize a new horizontal scrollbar widget
+ */
+Ewl_Widget *ewl_hscrollbar_new(void)
+{
+       Ewl_Widget *s;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+
+       s = ewl_scrollbar_new();
+       ewl_scrollbar_orientation_set(EWL_SCROLLBAR(s),
+                                     EWL_ORIENTATION_HORIZONTAL);
+
+       DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE);
+}
+
+/**
+ * @return Returns NULL on failure, or a pointer to a new scrollbar on success.
+ * @brief Allocate and initialize a new vertical scrollbar widget
+ */
+Ewl_Widget *ewl_vscrollbar_new(void)
+{
+       Ewl_Widget *s;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+
+       s = ewl_scrollbar_new();
+       ewl_scrollbar_orientation_set(EWL_SCROLLBAR(s),
+                                     EWL_ORIENTATION_VERTICAL);
 
        DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE);
 }
 
 /**
  * @param s: the scrollbar to initialize
- * @param orientation: the orientation for the scrollbar
  * @return Returns no value.
  * @brief Initialize a scrollbar to default values
  */
-int ewl_scrollbar_init(Ewl_Scrollbar * s, Ewl_Orientation orientation)
+int ewl_scrollbar_init(Ewl_Scrollbar * s)
 {
        Ewl_Widget     *w;
 
@@ -46,8 +78,8 @@
        if (!ewl_box_init(EWL_BOX(w)))
                DRETURN_INT(FALSE, DLEVEL_STABLE);
 
-       ewl_box_orientation_set(EWL_BOX(w), orientation);
-       ewl_widget_appearance_set(w, "scrollbar");
+       ewl_box_orientation_set(EWL_BOX(w), EWL_ORIENTATION_HORIZONTAL);
+       ewl_widget_appearance_set(w, "hscrollbar");
        ewl_widget_inherit(w, "scrollbar");
 
        /*
@@ -75,43 +107,25 @@
        /*
         * Setup the seeker portion
         */
-       s->seeker = ewl_seeker_new(orientation);
+       s->seeker = ewl_hseeker_new();
        ewl_widget_internal_set(s->seeker, TRUE);
        ewl_object_alignment_set(EWL_OBJECT(s->seeker), EWL_FLAG_ALIGN_CENTER);
+       ewl_object_fill_policy_set(EWL_OBJECT(s->seeker),
+                                  EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK);
        ewl_widget_show(s->seeker);
 
        /*
         * Attach callbacks to the buttons and seeker to handle the various
         * events.
         */
-       if (orientation == EWL_ORIENTATION_HORIZONTAL) {
-               ewl_callback_append(s->button_increment,
-                               EWL_CALLBACK_MOUSE_DOWN,
-                               ewl_scrollbar_scroll_start_cb, s);
-               ewl_callback_append(s->button_increment,
-                               EWL_CALLBACK_MOUSE_UP,
-                               ewl_scrollbar_scroll_stop_cb, s);
-               ewl_callback_append(s->button_decrement,
-                               EWL_CALLBACK_MOUSE_DOWN,
-                               ewl_scrollbar_scroll_start_cb, s);
-               ewl_callback_append(s->button_decrement,
-                               EWL_CALLBACK_MOUSE_UP,
-                               ewl_scrollbar_scroll_stop_cb, s);
-       }
-       else {
-               ewl_callback_append(s->button_increment,
-                               EWL_CALLBACK_MOUSE_DOWN,
-                               ewl_scrollbar_scroll_start_cb, s);
-               ewl_callback_append(s->button_increment,
-                               EWL_CALLBACK_MOUSE_UP,
-                               ewl_scrollbar_scroll_stop_cb, s);
-               ewl_callback_append(s->button_decrement,
-                               EWL_CALLBACK_MOUSE_DOWN,
-                               ewl_scrollbar_scroll_start_cb, s);
-               ewl_callback_append(s->button_decrement,
-                               EWL_CALLBACK_MOUSE_UP,
-                               ewl_scrollbar_scroll_stop_cb, s);
-       }
+       ewl_callback_append(s->button_increment, EWL_CALLBACK_MOUSE_DOWN,
+                           ewl_scrollbar_scroll_start_cb, s);
+       ewl_callback_append(s->button_increment, EWL_CALLBACK_MOUSE_UP,
+                           ewl_scrollbar_scroll_stop_cb, s);
+       ewl_callback_append(s->button_decrement, EWL_CALLBACK_MOUSE_DOWN,
+                           ewl_scrollbar_scroll_start_cb, s);
+       ewl_callback_append(s->button_decrement, EWL_CALLBACK_MOUSE_UP,
+                           ewl_scrollbar_scroll_stop_cb, s);
 
        /*
         * Set the default alignment for the buttons.
@@ -127,6 +141,11 @@
        s->fill_percentage = 1.0;
 
        /*
+        * Set the default for horizontal standard scrolling
+        */
+       s->invert = 1;
+
+       /*
         * Append a value change callback to the seeker to catch when it
         * moves.
         */
@@ -146,17 +165,101 @@
        ewl_widget_appearance_set(s->button_decrement, "button_decrement");
        ewl_widget_appearance_set(s->button_increment, "button_increment");
 
+       if (s->buttons_alignment & EWL_FLAG_ALIGN_LEFT) {
+
+               /*
+                * Place in decrement, increment, seeker order.
+                */
+               ewl_container_child_append(EWL_CONTAINER(s),
+                                          s->button_decrement);
+               ewl_container_child_append(EWL_CONTAINER(s),
+                                          s->button_increment);
+               ewl_container_child_append(EWL_CONTAINER(s), s->seeker);
+       }
+       else if (s->buttons_alignment & EWL_FLAG_ALIGN_RIGHT) {
+
+               /*
+                * Place in seeker, decrement, increment order.
+                */
+               ewl_container_child_append(EWL_CONTAINER(s), s->seeker);
+               ewl_container_child_append(EWL_CONTAINER(s),
+                                          s->button_decrement);
+               ewl_container_child_append(EWL_CONTAINER(s),
+                                          s->button_increment);
+       }
+       else {
+
+               /*
+                * Place in decrement, seeker, increment order.
+                */
+               ewl_container_child_append(EWL_CONTAINER(s),
+                                          s->button_decrement);
+               ewl_container_child_append(EWL_CONTAINER(s), s->seeker);
+               ewl_container_child_append(EWL_CONTAINER(s),
+                                          s->button_increment);
+       }
+
+       /*
+        * Set the default value to the beginning of the seeker.
+        */
+       ewl_seeker_value_set(EWL_SEEKER(s->seeker), 0);
+
+       DRETURN_INT(TRUE, DLEVEL_STABLE);
+}
+
+/**
+ * @param s: the scrollbar to change orientation
+ * @param o: the new orientation to use on the scrollbar
+ * @return Returns no value.
+ * @brief Change the orientation of a scrollbar.
+ */
+void ewl_scrollbar_orientation_set(Ewl_Scrollbar *s, Ewl_Orientation o)
+{
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("s", s);
+
+       if (o == ewl_box_orientation_get(EWL_BOX(s)))
+               DRETURN(DLEVEL_STABLE);
+
+       ewl_box_orientation_set(EWL_BOX(s), o);
+
+       /*
+        * Swap scroll direction on orientation change
+        */
+       s->invert = -s->invert;
+
+       if (o == EWL_ORIENTATION_HORIZONTAL) {
+               ewl_widget_appearance_set(EWL_WIDGET(s), "hscrollbar");
+               ewl_object_fill_policy_set(EWL_OBJECT(s),
+                               EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK);
+               ewl_object_fill_policy_set(EWL_OBJECT(s->seeker),
+                               EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK);
+       }
+       else {
+               ewl_widget_appearance_set(EWL_WIDGET(s), "vscrollbar");
+               ewl_object_fill_policy_set(EWL_OBJECT(s),
+                               EWL_FLAG_FILL_VFILL | EWL_FLAG_FILL_VSHRINK);
+               ewl_object_fill_policy_set(EWL_OBJECT(s->seeker),
+                               EWL_FLAG_FILL_VFILL | EWL_FLAG_FILL_VSHRINK);
+       }
+
        /*
         * Set the alignment of the buttons to the seeker.
         */
        s->buttons_alignment = ewl_theme_data_int_get(EWL_WIDGET(s),
                                                      "button_order");
 
+       ewl_container_child_remove(EWL_CONTAINER(s), s->button_decrement);
+       ewl_container_child_remove(EWL_CONTAINER(s), s->button_increment);
+       ewl_container_child_remove(EWL_CONTAINER(s), s->seeker);
+
+       ewl_seeker_orientation_set(EWL_SEEKER(s->seeker), o);
+
        /*
         * Setup a few orientation specific variables, such as appearance and
         * packing order.
         */
-       if (orientation == EWL_ORIENTATION_HORIZONTAL) {
+       if (o == EWL_ORIENTATION_HORIZONTAL) {
 
                if (s->buttons_alignment & EWL_FLAG_ALIGN_LEFT) {
 
@@ -192,13 +295,6 @@
                                                   s->button_increment);
                }
 
-               /*
-                * Set the default value to the beginning of the seeker.
-                */
-               ewl_seeker_value_set(EWL_SEEKER(s->seeker), 0);
-               ewl_widget_appearance_set(w, "hscrollbar");
-               ewl_object_fill_policy_set(EWL_OBJECT(s),
-                               EWL_FLAG_FILL_HFILL | EWL_FLAG_FILL_HSHRINK);
        }
        else {
 
@@ -236,16 +332,56 @@
                                                   s->button_decrement);
                }
 
-               /*
-                * Set the default value to the beginning of the seeker.
-                */
-               ewl_seeker_value_set(EWL_SEEKER(s->seeker), 0);
-               ewl_widget_appearance_set(w, "vscrollbar");
-               ewl_object_fill_policy_set(EWL_OBJECT(s),
-                               EWL_FLAG_FILL_VFILL | EWL_FLAG_FILL_VSHRINK);
        }
 
-       DRETURN_INT(TRUE, DLEVEL_STABLE);
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
+ * @param s: the scrollbar to change orientation
+ * @return Returns no value.
+ * @brief Change the orientation of a scrollbar.
+ */
+Ewl_Orientation ewl_scrollbar_orientation_get(Ewl_Scrollbar *s)
+{
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR_RET("s", s, EWL_ORIENTATION_HORIZONTAL);
+
+       DRETURN_INT(ewl_box_orientation_get(EWL_BOX(s)), DLEVEL_STABLE);
+}
+
+/**
+ * @param s: the scrollbar to set inverted scrolling value
+ * @param i: value to set for inverse scrolling
+ * @return Returns no value.
+ * @brief Sets the inverse scrolling flag on a scrollbar.
+ */
+void ewl_scrollbar_inverse_scroll_set(Ewl_Scrollbar *s, char i)
+{
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("s", s);
+
+       if (i >= 0)
+               i = 1;
+       else
+               i = -1;
+
+       s->direction = i;
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
+ * @param s: the scrollbar to get inverted scrolling value
+ * @return Returns the current value for inverted scrolling.
+ * @brief Checks the inverse scrolling flag on a scrollbar.
+ */
+char ewl_scrollbar_inverse_scroll_get(Ewl_Scrollbar *s)
+{
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR_RET("s", s, 1);
+
+       DRETURN_INT(s->invert, DLEVEL_STABLE);
 }
 
 /**
@@ -283,11 +419,6 @@
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("s", s);
 
-       /*
-       if (EWL_BOX(s)->orientation == EWL_ORIENTATION_VERTICAL)
-               v = 1.0 - v;
-               */
-
        ewl_seeker_value_set(EWL_SEEKER(s->seeker), v);
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -351,8 +482,7 @@
         * scrollbar.
         */
        o = ewl_box_orientation_get(EWL_BOX(s));
-       if (o == EWL_ORIENTATION_VERTICAL)
-               s->direction = -s->direction;
+       s->direction = s->direction * s->invert;
 
        s->start_time = ecore_time_get();
        s->timer = ecore_timer_add(0.02, ewl_scrollbar_timer, s);
@@ -362,7 +492,7 @@
 
 void
 ewl_scrollbar_scroll_stop_cb(Ewl_Widget * w __UNUSED__,
-                               void *ev_data __UNUSED__, void *user_data)
+                            void *ev_data __UNUSED__, void *user_data)
 {
        Ewl_Scrollbar *s;
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_scrollbar.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ewl_scrollbar.h     3 Oct 2005 06:43:07 -0000       1.3
+++ ewl_scrollbar.h     8 Oct 2005 06:22:59 -0000       1.4
@@ -45,35 +45,30 @@
  */
 struct Ewl_Scrollbar
 {
-       Ewl_Box         box; /**< Inherit from Ewl_Box */
+       Ewl_Box         box;               /**< Inherit from Ewl_Box */
 
-       Ewl_Widget     *seeker; /**< The internal Ewl_Seeker */
-       Ewl_Widget     *button_decrement; /**< The internal decrement button */
-       Ewl_Widget     *button_increment; /**< The internal increment button */
+       Ewl_Widget     *seeker;            /**< The internal Ewl_Seeker */
+       Ewl_Widget     *button_decrement;  /**< The internal decrement button */
+       Ewl_Widget     *button_increment;  /**< The internal increment button */
        unsigned int    buttons_alignment; /**< The ordering of buttons */
 
-       double          fill_percentage; /**< The ratio of size for draggable */
-       double          start_time; /**< Time scrolling began */
-       Ecore_Timer    *timer; /**< Repeating timer for scrolling */
-       signed char     direction;
+       double          fill_percentage;   /**< Ratio of size for draggable */
+       double          start_time;        /**< Time scrolling began */
+       Ecore_Timer    *timer;             /**< Repeating timer for scrolling */
+       signed char     direction;   /**< */
+       signed char     invert;      /**< Invert the scrolling direction */
 };
 
-/**
- * @def ewl_hscrollbar_new()
- * A shortcut for allocating a new horizontal scrollbar.
- */
-#define ewl_hscrollbar_new() ewl_scrollbar_new(EWL_ORIENTATION_HORIZONTAL)
-
-/**
- * @def ewl_vscrollbar_new()
- * A shortcut for allocating a new vertical scrollbar.
- */
-#define ewl_vscrollbar_new() ewl_scrollbar_new(EWL_ORIENTATION_VERTICAL)
-
-Ewl_Widget     *ewl_scrollbar_new(Ewl_Orientation orientation);
-int             ewl_scrollbar_init(Ewl_Scrollbar * s,
-                                  Ewl_Orientation orientation);
-
+Ewl_Widget     *ewl_scrollbar_new(void);
+Ewl_Widget     *ewl_hscrollbar_new(void);
+Ewl_Widget     *ewl_vscrollbar_new(void);
+int             ewl_scrollbar_init(Ewl_Scrollbar * s);
+
+void            ewl_scrollbar_orientation_set(Ewl_Scrollbar * s,
+                                             Ewl_Orientation orientation);
+Ewl_Orientation ewl_scrollbar_orientation_get(Ewl_Scrollbar * s);
+char            ewl_scrollbar_inverse_scroll_get(Ewl_Scrollbar * s);
+void            ewl_scrollbar_inverse_scroll_set(Ewl_Scrollbar * s, char v);
 double          ewl_scrollbar_value_get(Ewl_Scrollbar * s);
 void            ewl_scrollbar_value_set(Ewl_Scrollbar * s, double v);
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_seeker.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- ewl_seeker.c        3 Oct 2005 06:43:07 -0000       1.5
+++ ewl_seeker.c        8 Oct 2005 06:22:59 -0000       1.6
@@ -4,13 +4,12 @@
 #include "ewl_private.h"
 
 /**
- * @param o: the orientation for the new seeker
  * @return Returns NULL on failure, or a pointer to the new seeker on success.
- * @brief Allocate and initialize a new seeker with orientation
+ * @brief Allocate and initialize a new seeker with default orientation
  */
-Ewl_Widget     *ewl_seeker_new(Ewl_Orientation o)
+Ewl_Widget *ewl_seeker_new()
 {
-       Ewl_Seeker     *s;
+       Ewl_Seeker *s;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
 
@@ -18,7 +17,40 @@
        if (!s)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       ewl_seeker_init(s, o);
+       ewl_seeker_init(s);
+
+       DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE);
+}
+
+
+/**
+ * @return Returns NULL on failure, or a pointer to the new seeker on success.
+ * @brief Allocate and initialize a new seeker with horizontal orientation
+ */
+Ewl_Widget *ewl_hseeker_new()
+{
+       Ewl_Widget *s;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+
+       s = ewl_seeker_new();
+       ewl_seeker_orientation_set(EWL_SEEKER(s), EWL_ORIENTATION_HORIZONTAL);
+
+       DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE);
+}
+
+/**
+ * @return Returns NULL on failure, or a pointer to the new seeker on success.
+ * @brief Allocate and initialize a new seeker with vertical orientation
+ */
+Ewl_Widget *ewl_vseeker_new()
+{
+       Ewl_Widget *s;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+
+       s = ewl_seeker_new();
+       ewl_seeker_orientation_set(EWL_SEEKER(s), EWL_ORIENTATION_VERTICAL);
 
        DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE);
 }
@@ -33,7 +65,7 @@
  * Initializes the seeker @a s to the orientation @a orientation to default
  * values and callbacks.
  */
-int ewl_seeker_init(Ewl_Seeker * s, Ewl_Orientation orientation)
+int ewl_seeker_init(Ewl_Seeker * s)
 {
        Ewl_Widget     *w;
 
@@ -46,23 +78,15 @@
                DRETURN_INT(FALSE, DLEVEL_STABLE);
 
        /*
-        * Initialize the widget fields and set appropriate orientation and
-        * type
+        * Initialize the widget fields and set default orientation and type
         */
-       if (orientation == EWL_ORIENTATION_HORIZONTAL) {
-               ewl_widget_appearance_set(w, "hseeker");
-               ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_HFILL |
+       ewl_widget_appearance_set(w, "hseeker");
+       ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_HFILL |
                                EWL_FLAG_FILL_HSHRINK);
-       }
-       else {
-               ewl_widget_appearance_set(w, "vseeker");
-               ewl_object_fill_policy_set(EWL_OBJECT(w),
-                               EWL_FLAG_FILL_VFILL |
-                               EWL_FLAG_FILL_VSHRINK);
-       }
        ewl_widget_inherit(w, "seeker");
 
-       ewl_container_show_notify_set(EWL_CONTAINER(w), 
ewl_seeker_child_show_cb);
+       ewl_container_show_notify_set(EWL_CONTAINER(w),
+                                     ewl_seeker_child_show_cb);
 
        /*
         * Create and add the button portion of the seeker
@@ -75,7 +99,7 @@
        /*
         * Set the starting orientation, range and values
         */
-       s->orientation = orientation;
+       s->orientation = EWL_ORIENTATION_HORIZONTAL;
        s->range = 100.0;
        s->value = 0.0;
        s->step = 10.0;
@@ -108,6 +132,31 @@
        DRETURN_INT(FALSE, DLEVEL_STABLE);
 }
 
+/**
+ * @param s: the seeker to change orientation
+ * @param o: the new orientation for the seeker
+ * @returns Returns no value.
+ * @brief Changes the orientation of the given seeker.
+ */
+void ewl_seeker_orientation_set(Ewl_Seeker *s, Ewl_Orientation o)
+{
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("s", s);
+
+       if (o == s->orientation)
+               DRETURN(DLEVEL_STABLE);
+
+       s->orientation = o;
+       if (o == EWL_ORIENTATION_HORIZONTAL) {
+               ewl_widget_appearance_set(EWL_WIDGET(s), "hseeker");
+       }
+       else {
+               ewl_widget_appearance_set(EWL_WIDGET(s), "vseeker");
+       }
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
 
 /**
  *
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_seeker.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ewl_seeker.h        17 Feb 2005 19:14:55 -0000      1.3
+++ ewl_seeker.h        8 Oct 2005 06:22:59 -0000       1.4
@@ -49,20 +49,13 @@
        int             autohide; /**< Indicator to hide when not scrollable */
 };
 
-/**
- * @def ewl_vseeker_new()
- * Shorthand to allocate a vertical seeker.
- */
-#define ewl_vseeker_new() ewl_seeker_new(EWL_ORIENTATION_VERTICAL);
-
-/**
- * @def ewl_hseeker_new()
- * Shorthand to allocate a horizontal seeker.
- */
-#define ewl_hseeker_new() ewl_seeker_new(EWL_ORIENTATION_HORIZONTAL);
+Ewl_Widget     *ewl_seeker_new();
+Ewl_Widget     *ewl_hseeker_new();
+Ewl_Widget     *ewl_vseeker_new();
+int             ewl_seeker_init(Ewl_Seeker * s);
 
-Ewl_Widget     *ewl_seeker_new(Ewl_Orientation orientation);
-int             ewl_seeker_init(Ewl_Seeker * s, Ewl_Orientation orientation);
+void            ewl_seeker_orientation_set(Ewl_Seeker * s, Ewl_Orientation o);
+Ewl_Orientation ewl_seeker_orientation_get(Ewl_Seeker * s);
 
 void            ewl_seeker_value_set(Ewl_Seeker * s, double v);
 double          ewl_seeker_value_get(Ewl_Seeker * s);




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to