Enlightenment CVS committal

Author  : moom16
Project : e17
Module  : proto

Dir     : e17/proto/etk/src/lib


Modified Files:
        Etk.h Makefile.am etk_button.c etk_button.h etk_types.h 
Added Files:
        etk_stock.c etk_stock.h 


Log Message:
* Add stock icons support. Need more icons though

Thanks to Vincent Torri :)



===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/Etk.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- Etk.h       31 Oct 2005 21:36:40 -0000      1.7
+++ Etk.h       2 Nov 2005 10:41:03 -0000       1.8
@@ -17,6 +17,7 @@
 #include "etk_string.h"
 
 #include "etk_widget.h"
+#include "etk_stock.h"
 #include "etk_bin.h"
 #include "etk_box.h"
 #include "etk_hbox.h"
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/Makefile.am,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- Makefile.am 31 Oct 2005 21:36:40 -0000      1.10
+++ Makefile.am 2 Nov 2005 10:41:03 -0000       1.11
@@ -26,6 +26,7 @@
 etk_scrolled_view.h etk_viewport.h \
 etk_window.h \
 etk_image.h \
+etk_stock.h \
 etk_string.h etk_editable_text_object.h etk_label.h \
 etk_button.h etk_toggle_button.h etk_check_button.h etk_radio_button.h \
 etk_entry.h \
@@ -46,6 +47,7 @@
 etk_scrolled_view.c etk_viewport.c \
 etk_window.c \
 etk_image.c \
+etk_stock.c \
 etk_string.c etk_editable_text_object.c etk_label.c \
 etk_button.c etk_toggle_button.c etk_check_button.c etk_radio_button.c \
 etk_entry.c \
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/etk_button.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- etk_button.c        1 Nov 2005 00:18:40 -0000       1.3
+++ etk_button.c        2 Nov 2005 10:41:03 -0000       1.4
@@ -2,12 +2,14 @@
 #include "etk_button.h"
 #include <stdlib.h>
 #include <string.h>
+#include "config.h"
 #include "etk_hbox.h"
 #include "etk_alignment.h"
 #include "etk_image.h"
 #include "etk_label.h"
 #include "etk_signal.h"
 #include "etk_signal_callback.h"
+#include "etk_utils.h"
 
 /**
  * @addtogroup Etk_Button
@@ -100,6 +102,34 @@
 }
 
 /**
+ * @brief Creates a new button with a label and an icon defined by a stock id
+ * @param stock_id the stock id corresponding to the label and the icon you 
want
+ * @return Returns the new button widget
+ * @see Etk_Stock
+ */
+Etk_Widget *etk_button_new_from_stock(Etk_Stock_Id stock_id)
+{
+   Etk_Widget *button;
+   char *key;
+
+   key = etk_stock_key_get(stock_id);
+   if (key)
+   {
+      Etk_Widget *image;
+      char *label;
+
+      label = etk_stock_label_get(stock_id);
+      image = etk_image_new_from_edje(PACKAGE_DATA_DIR 
"/stock_icons/default.edj", key);
+      button = etk_button_new_with_label(_(label));
+      etk_button_image_set(ETK_BUTTON(button), ETK_IMAGE(image));
+   }
+   else
+      button = etk_widget_new(ETK_BUTTON_TYPE, "theme_group", "button", NULL);
+
+   return button;
+}
+
+/**
  * @brief Sends the "pressed" signal
  * @param button a button
  */
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/etk_button.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- etk_button.h        1 Oct 2005 16:29:45 -0000       1.1
+++ etk_button.h        2 Nov 2005 10:41:03 -0000       1.2
@@ -4,6 +4,7 @@
 
 #include "etk_bin.h"
 #include "etk_types.h"
+#include "etk_stock.h"
 
 /**
  * @defgroup Etk_Button Etk_Button
@@ -39,6 +40,7 @@
 Etk_Type *etk_button_type_get();
 Etk_Widget *etk_button_new();
 Etk_Widget *etk_button_new_with_label(const char *label);
+Etk_Widget *etk_button_new_from_stock(Etk_Stock_Id stock_id);
 
 void etk_button_pressed(Etk_Button *button);
 void etk_button_released(Etk_Button *button);
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/etk_types.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- etk_types.h 31 Oct 2005 23:45:32 -0000      1.10
+++ etk_types.h 2 Nov 2005 10:41:03 -0000       1.11
@@ -47,6 +47,7 @@
 typedef struct _Etk_Event_Key_Up_Down Etk_Event_Key_Up_Down;
 typedef struct _Etk_Size Etk_Size;
 typedef struct _Etk_Geometry Etk_Geometry;
+typedef enum _Etk_Stock_Id Etk_Stock_Id;
 typedef enum _Etk_Pointer_Type Etk_Pointer_Type;
 typedef struct _Etk_Toplevel_Widget Etk_Toplevel_Widget;
 typedef struct _Etk_Container Etk_Container;




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to