Enlightenment CVS committal
Author : codewarrior
Project : e17
Module : proto
Dir : e17/proto/etk/src/lib
Modified Files:
etk_tool_button.c etk_tool_button.h etk_types.h
Log Message:
toggle button for toolbar (edc not finished yet)
===================================================================
RCS file: /cvs/e/e17/proto/etk/src/lib/etk_tool_button.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- etk_tool_button.c 15 Aug 2006 20:56:19 -0000 1.2
+++ etk_tool_button.c 17 Aug 2006 15:44:07 -0000 1.3
@@ -5,13 +5,13 @@
#include "etk_button.h"
-
/**
* @addtogroup Etk_Tool_Button
* @{
*/
static void _etk_tool_button_constructor(Etk_Tool_Button *tool_button);
+static void _etk_tool_toggle_button_constructor(Etk_Tool_Toggle_Button
*tool_toggle_button);
/**************************
*
@@ -57,9 +57,9 @@
}
/**
- * @brief Creates a new tool button with a label and an icon defined by a
stock id
+ * @brief Creates a new tool toggle button with a label and an icon defined by
a stock id
* @param stock_id the stock id corresponding to a label and an icon
- * @return Returns the new tool button widget
+ * @return Returns the new tool toggle button widget
* @see Etk_Stock
*/
Etk_Widget *etk_tool_button_new_from_stock(Etk_Stock_Id stock_id)
@@ -72,6 +72,58 @@
return tool_button;
}
+/**
+ * @brief Gets the type of an Etk_Tool_Toggle_Button
+ * @return Returns the type of an Etk_Tool_Toggle_Button
+ */
+Etk_Type *etk_tool_toggle_button_type_get()
+{
+ static Etk_Type *tool_toggle_button_type = NULL;
+
+ if (!tool_toggle_button_type)
+ {
+ tool_toggle_button_type = etk_type_new("Etk_Tool_Toggle_Button",
ETK_TOGGLE_BUTTON_TYPE, sizeof(Etk_Tool_Toggle_Button),
+ ETK_CONSTRUCTOR(_etk_tool_toggle_button_constructor), NULL);
+ }
+
+ return tool_toggle_button_type;
+}
+
+/**
+ * @brief Creates a new tool toggle button
+ * @return Returns the new tool toggle button widget
+ */
+Etk_Widget *etk_tool_toggle_button_new()
+{
+ return etk_widget_new(ETK_TOOL_TOGGLE_BUTTON_TYPE, "theme_group",
"toolbar/toggle_button",
+ "style", ETK_BUTTON_BOTH_VERT, NULL);
+}
+
+/**
+ * @brief Creates a new tool toggle button with a label
+ * @return Returns the new tool toggle button widget
+ */
+Etk_Widget *etk_tool_toggle_button_new_with_label(const char *label)
+{
+ return etk_widget_new(ETK_TOOL_TOGGLE_BUTTON_TYPE, "theme_group",
"toolbar/toggle_button",
+ "label", label, "style", ETK_BUTTON_BOTH_VERT, NULL);
+}
+
+/**
+ * @brief Creates a new tool toggle button with a label and an icon defined by
a stock id
+ * @param stock_id the stock id corresponding to a label and an icon
+ * @return Returns the new tool toggle button widget
+ * @see Etk_Stock
+ */
+Etk_Widget *etk_tool_toggle_button_new_from_stock(Etk_Stock_Id stock_id)
+{
+ Etk_Widget *tool_toggle_button;
+
+ tool_toggle_button = etk_tool_toggle_button_new();
+ etk_button_set_from_stock(ETK_BUTTON(tool_toggle_button), stock_id);
+
+ return tool_toggle_button;
+}
/**************************
*
@@ -83,5 +135,12 @@
static void _etk_tool_button_constructor(Etk_Tool_Button *tool_button)
{
if (!tool_button)
+ return;
+}
+
+/* Initializes the tool toggle button */
+static void _etk_tool_toggle_button_constructor(Etk_Tool_Toggle_Button
*tool_toggle_button)
+{
+ if (!tool_toggle_button)
return;
}
===================================================================
RCS file: /cvs/e/e17/proto/etk/src/lib/etk_tool_button.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- etk_tool_button.h 13 Aug 2006 15:33:17 -0000 1.1
+++ etk_tool_button.h 17 Aug 2006 15:44:07 -0000 1.2
@@ -3,6 +3,7 @@
#define _ETK_TOOL_BUTTON_H_
#include "etk_button.h"
+#include "etk_toggle_button.h"
#include "etk_stock.h"
#include "etk_types.h"
@@ -14,7 +15,7 @@
/** Gets the type of a tool button */
#define ETK_TOOL_BUTTON_TYPE (etk_tool_button_type_get())
-/** Casts the object to an Etk_Button */
+/** Casts the object to an Etk_Tool_Button */
#define ETK_TOOL_BUTTON(obj) (ETK_OBJECT_CAST((obj),
ETK_TOOL_BUTTON_TYPE, Etk_Tool_Button))
/** Checks if the object is an Etk_Tool_Button */
#define ETK_IS_TOOL_BUTTON(obj) (ETK_OBJECT_CHECK_TYPE((obj),
ETK_TOOL_BUTTON_TYPE))
@@ -34,6 +35,37 @@
Etk_Widget *etk_tool_button_new();
Etk_Widget *etk_tool_button_new_with_label(const char *label);
Etk_Widget *etk_tool_button_new_from_stock(Etk_Stock_Id stock_id);
+
+/** @} */
+
+/**
+ * @defgroup Etk_Tool_Toggle_Button Etk_Tool_Toggle_Button
+ * @brief The Etk_Tool_Toggle_Button widget is similar to an Etk_Toggle_Button
but it has a specific toolbar friendly theme
+ * @{
+ */
+
+/** Gets the type of a tool toggle button */
+#define ETK_TOOL_TOGGLE_BUTTON_TYPE (etk_tool_toggle_button_type_get())
+/** Casts the object to an Etk_Tool_Toggle_Button */
+#define ETK_TOOL_TOGGLE_BUTTON(obj) (ETK_OBJECT_CAST((obj),
ETK_TOOL_TOGGLE_BUTTON_TYPE, Etk_Tool_Toggle_Button))
+/** Checks if the object is an Etk_Tool_Toggle_Button */
+#define ETK_IS_TOOL_TOGGLE_BUTTON(obj) (ETK_OBJECT_CHECK_TYPE((obj),
ETK_TOOL_TOGGLE_BUTTON_TYPE))
+
+/**
+ * @brief @widget The structure of a tool toggle button
+ * @structinfo
+ */
+struct _Etk_Tool_Toggle_Button
+{
+ /* private: */
+ /* Inherit from Etk_Toggle_Button */
+ Etk_Toggle_Button button;
+};
+
+Etk_Type *etk_tool_toggle_button_type_get();
+Etk_Widget *etk_tool_toggle_button_new();
+Etk_Widget *etk_tool_toggle_button_new_with_label(const char *label);
+Etk_Widget *etk_tool_toggle_button_new_from_stock(Etk_Stock_Id stock_id);
/** @} */
===================================================================
RCS file: /cvs/e/e17/proto/etk/src/lib/etk_types.h,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -3 -r1.50 -r1.51
--- etk_types.h 13 Aug 2006 15:33:17 -0000 1.50
+++ etk_types.h 17 Aug 2006 15:44:07 -0000 1.51
@@ -103,6 +103,7 @@
typedef struct _Etk_Toplevel_Widget Etk_Toplevel_Widget;
typedef struct _Etk_Toolbar Etk_Toolbar;
typedef struct _Etk_Tool_Button Etk_Tool_Button;
+typedef struct _Etk_Tool_Toggle_Button Etk_Tool_Toggle_Button;
typedef struct _Etk_Tree Etk_Tree;
typedef struct _Etk_Tree_Col Etk_Tree_Col;
typedef struct _Etk_Tree_Model Etk_Tree_Model;
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs