Enlightenment CVS committal

Author  : jethomas
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_checkbutton.c ewl_checkbutton.h 


Log Message:
Add view_get for checkbutton

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_checkbutton.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- ewl_checkbutton.c   13 Nov 2007 22:19:25 -0000      1.20
+++ ewl_checkbutton.c   16 Dec 2007 05:53:33 -0000      1.21
@@ -7,6 +7,12 @@
 #include "ewl_private.h"
 #include "ewl_debug.h"
 
+static Ewl_Widget *ewl_checkbutton_view_cb_widget_fetch(void *data,
+                                                       unsigned int row,
+                                                       unsigned int col);
+static Ewl_Widget *ewl_checkbutton_view_cb_header_fetch(void *data,
+                                                       unsigned int col);
+
 /**
  * @return Returns the newly allocated checkbutton on success, NULL on failure.
  * @brief Allocate and initialize a new check button
@@ -182,6 +188,51 @@
        ewl_callback_call(w, EWL_CALLBACK_VALUE_CHANGED);
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
+ * @return Returns a view that can be used to display Ewl_Checkbutton widgets
+ * @brief Creates and returns a view to be used by Ewl_Checkbutton widgets
+ */
+Ewl_View *
+ewl_checkbutton_view_get(void)
+{
+       Ewl_View *view;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+
+       view = ewl_view_new();
+       ewl_view_widget_fetch_set(view, ewl_checkbutton_view_cb_widget_fetch);
+       ewl_view_header_fetch_set(view, ewl_checkbutton_view_cb_header_fetch);
+
+       DRETURN_PTR(view, DLEVEL_STABLE);
+}
+
+static Ewl_Widget *
+ewl_checkbutton_view_cb_widget_fetch(void *data, unsigned int row __UNUSED__,
+                                               unsigned int col __UNUSED__)
+{
+       Ewl_Widget *check;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+
+       check = ewl_checkbutton_new();
+       ewl_button_label_set(EWL_BUTTON(check), data);
+
+       DRETURN_PTR(check, DLEVEL_STABLE);
+}
+
+static Ewl_Widget *
+ewl_checkbutton_view_cb_header_fetch(void *data, unsigned int col __UNUSED__)
+{
+       Ewl_Widget *check;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+
+       check = ewl_checkbutton_new();
+       ewl_button_label_set(EWL_BUTTON(check), data);
+
+       DRETURN_PTR(check, DLEVEL_STABLE);
 }
 
 
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_checkbutton.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- ewl_checkbutton.h   11 Nov 2007 06:07:46 -0000      1.20
+++ ewl_checkbutton.h   16 Dec 2007 05:53:33 -0000      1.21
@@ -3,6 +3,7 @@
 #define EWL_CHECKBUTTON_H
 
 #include "ewl_button.h"
+#include "ewl_view.h"
 
 /**
  * @addtogroup Ewl_Checkbutton Ewl_Checkbutton: An Ewl_Checkbutton with Label
@@ -64,6 +65,7 @@
 
 void            ewl_checkbutton_label_position_set(Ewl_Checkbutton *cb,
                                                           Ewl_Position p);
+Ewl_View       *ewl_checkbutton_view_get(void);
 
 /*
  * Internally used callbacks, override at your own risk



-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to