Enlightenment CVS committal
Author : moom
Project : e17
Module : proto
Dir : e17/proto/etk/src/lib
Modified Files:
etk_toggle_button.c etk_toggle_button.h etk_types.h
Log Message:
* [Toggle_Button] Documentation
===================================================================
RCS file: /cvs/e/e17/proto/etk/src/lib/etk_toggle_button.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- etk_toggle_button.c 6 Oct 2006 17:04:15 -0000 1.14
+++ etk_toggle_button.c 30 Dec 2006 21:22:45 -0000 1.15
@@ -38,7 +38,7 @@
/**
* @internal
* @brief Gets the type of an Etk_Toggle_Button
- * @return Returns the type on an Etk_Toggle_Button
+ * @return Returns the type of an Etk_Toggle_Button
*/
Etk_Type *etk_toggle_button_type_get()
{
@@ -46,11 +46,14 @@
if (!toggle_button_type)
{
- toggle_button_type = etk_type_new("Etk_Toggle_Button", ETK_BUTTON_TYPE,
sizeof(Etk_Toggle_Button), ETK_CONSTRUCTOR(_etk_toggle_button_constructor),
NULL);
+ toggle_button_type = etk_type_new("Etk_Toggle_Button", ETK_BUTTON_TYPE,
sizeof(Etk_Toggle_Button),
+ ETK_CONSTRUCTOR(_etk_toggle_button_constructor), NULL);
- _etk_toggle_button_signals[ETK_TOGGLE_BUTTON_TOGGLED_SIGNAL] =
etk_signal_new("toggled", toggle_button_type,
ETK_MEMBER_OFFSET(Etk_Toggle_Button, toggled), etk_marshaller_VOID__VOID, NULL,
NULL);
+ _etk_toggle_button_signals[ETK_TOGGLE_BUTTON_TOGGLED_SIGNAL] =
etk_signal_new("toggled",
+ toggle_button_type, ETK_MEMBER_OFFSET(Etk_Toggle_Button, toggled),
etk_marshaller_VOID__VOID, NULL, NULL);
- etk_type_property_add(toggle_button_type, "active",
ETK_TOGGLE_BUTTON_ACTIVE_PROPERTY, ETK_PROPERTY_BOOL,
ETK_PROPERTY_READABLE_WRITABLE, etk_property_value_bool(0));
+ etk_type_property_add(toggle_button_type, "active",
ETK_TOGGLE_BUTTON_ACTIVE_PROPERTY,
+ ETK_PROPERTY_BOOL, ETK_PROPERTY_READABLE_WRITABLE,
etk_property_value_bool(ETK_FALSE));
toggle_button_type->property_set = _etk_toggle_button_property_set;
toggle_button_type->property_get = _etk_toggle_button_property_get;
@@ -61,7 +64,7 @@
/**
* @brief Creates a new toggle button
- * @return Returns the new toggle button widget
+ * @return Returns the new toggle-button widget
*/
Etk_Widget *etk_toggle_button_new()
{
@@ -71,11 +74,12 @@
/**
* @brief Creates a new toggle button with a label
* @param label the label
- * @return Returns the new toggle button widget
+ * @return Returns the new toggle-button widget
*/
Etk_Widget *etk_toggle_button_new_with_label(const char *label)
{
- return etk_widget_new(ETK_TOGGLE_BUTTON_TYPE, "theme_group",
"toggle_button", "label", label, "focusable", ETK_TRUE, NULL);
+ return etk_widget_new(ETK_TOGGLE_BUTTON_TYPE, "theme_group",
"toggle_button",
+ "label", label, "focusable", ETK_TRUE, NULL);
}
/**
@@ -90,9 +94,9 @@
}
/**
- * @brief Sets the state of the toggle button
+ * @brief Sets whether the toggle button is active or not
* @param toggle_button a toggle button
- * @param active if @a active == ETK_TRUE, the toggle button will be active
+ * @param active if @a active is ETK_TRUE, the toggle button will be
activated. Otherwise, it will be deactivated
*/
void etk_toggle_button_active_set(Etk_Toggle_Button *toggle_button, Etk_Bool
active)
{
@@ -103,7 +107,7 @@
/**
* @brief Gets the state of the toggle button
* @param toggle_button a toggle button
- * @return Returns ETK_TRUE if the button is activated, ETK_FALSE otherwise
+ * @return Returns ETK_TRUE if the button is active, ETK_FALSE otherwise
*/
Etk_Bool etk_toggle_button_active_get(Etk_Toggle_Button *toggle_button)
{
@@ -128,8 +132,11 @@
toggle_button->toggled = _etk_toggle_button_toggled_handler;
toggle_button->active_set = _etk_toggle_button_active_set_default;
- etk_signal_connect("realize", ETK_OBJECT(toggle_button),
ETK_CALLBACK(_etk_toggle_button_realize_cb), NULL);
- etk_signal_connect_swapped("clicked", ETK_OBJECT(toggle_button),
ETK_CALLBACK(etk_toggle_button_toggle), toggle_button);
+ etk_signal_connect("realize", ETK_OBJECT(toggle_button),
+ ETK_CALLBACK(_etk_toggle_button_realize_cb), NULL);
+ /* If the button is clicked, we toggle it */
+ etk_signal_connect_swapped("clicked", ETK_OBJECT(toggle_button),
+ ETK_CALLBACK(etk_toggle_button_toggle), toggle_button);
}
/* Sets the property whose id is "property_id" to the value "value" */
@@ -212,3 +219,35 @@
}
/** @} */
+
+/**************************
+ *
+ * Documentation
+ *
+ **************************/
+
+/**
+ * @addtogroup Etk_Toggle_Button
+ *
+ * @image html widgets/toggle_button.png
+ *
+ * \par Object Hierarchy:
+ * - Etk_Object
+ * - Etk_Widget
+ * - Etk_Container
+ * - Etk_Bin
+ * - Etk_Button
+ * - Etk_Toggle_Button
+ *
+ * \par Signals:
+ * @signal_name "toggled": Emitted when the state of the toggle button is
changed
+ * @signal_cb void callback(Etk_Toggle_Button *button, void *data)
+ * @signal_arg button: the toggle button that has been toggled
+ * @signal_data
+ *
+ * \par Properties:
+ * @prop_name "active": Whether or not the toggle button is active
+ * @prop_type Boolean
+ * @prop_rw
+ * @prop_val ETK_FALSE
+ */
===================================================================
RCS file: /cvs/e/e17/proto/etk/src/lib/etk_toggle_button.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- etk_toggle_button.h 7 Apr 2006 15:36:11 -0000 1.3
+++ etk_toggle_button.h 30 Dec 2006 21:22:45 -0000 1.4
@@ -7,6 +7,8 @@
/**
* @defgroup Etk_Toggle_Button Etk_Toggle_Button
+ * @brief An Etk_Toggle_Button is a button that can be activated and
deactivated by clicking on it.
+ * It is the base class of check and radio buttons.
* @{
*/
@@ -18,11 +20,10 @@
#define ETK_IS_TOGGLE_BUTTON(obj) (ETK_OBJECT_CHECK_TYPE((obj),
ETK_TOGGLE_BUTTON_TYPE))
/**
- * @struct Etk_Toggle_Button
- * @brief A toggle button is a button that can be activated/deactivated. @n
- * It's the base class of check and radio buttons
+ * @brief @widget A button that can be activated/deactivated
+ * @structinfo
*/
-struct _Etk_Toggle_Button
+struct Etk_Toggle_Button
{
/* private: */
/* Inherit from Etk_Button */
@@ -33,12 +34,12 @@
Etk_Bool active;
};
-Etk_Type *etk_toggle_button_type_get();
+Etk_Type *etk_toggle_button_type_get();
Etk_Widget *etk_toggle_button_new();
Etk_Widget *etk_toggle_button_new_with_label(const char *label);
-void etk_toggle_button_toggle(Etk_Toggle_Button *toggle_button);
-void etk_toggle_button_active_set(Etk_Toggle_Button *toggle_button, Etk_Bool
active);
+void etk_toggle_button_toggle(Etk_Toggle_Button *toggle_button);
+void etk_toggle_button_active_set(Etk_Toggle_Button *toggle_button,
Etk_Bool active);
Etk_Bool etk_toggle_button_active_get(Etk_Toggle_Button *toggle_button);
/** @} */
===================================================================
RCS file: /cvs/e/e17/proto/etk/src/lib/etk_types.h,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -3 -r1.59 -r1.60
--- etk_types.h 9 Dec 2006 09:56:33 -0000 1.59
+++ etk_types.h 30 Dec 2006 21:22:45 -0000 1.60
@@ -106,7 +106,7 @@
typedef struct Etk_Textblock_Format Etk_Textblock_Format;
typedef struct Etk_Textblock_Iter Etk_Textblock_Iter;
typedef struct Etk_Textblock_Node Etk_Textblock_Node;
-typedef struct _Etk_Toggle_Button Etk_Toggle_Button;
+typedef struct Etk_Toggle_Button Etk_Toggle_Button;
typedef struct Etk_Toplevel Etk_Toplevel;
typedef struct Etk_Toolbar Etk_Toolbar;
typedef struct _Etk_Tool_Button Etk_Tool_Button;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs