Enlightenment CVS committal
Author : moom16
Project : e17
Module : proto
Dir : e17/proto/etk/src/lib
Modified Files:
etk_menu_item.c etk_menu_item.h etk_types.h
Log Message:
* Add a menu separator
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/etk_menu_item.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- etk_menu_item.c 13 Nov 2005 12:04:05 -0000 1.2
+++ etk_menu_item.c 13 Nov 2005 12:20:33 -0000 1.3
@@ -47,6 +47,10 @@
*
**************************/
+/**************************
+ * Menu Item
+ **************************/
+
/**
* @brief Gets the type of an Etk_Menu_Item
* @return Returns the type on an Etk_Menu_Item
@@ -263,6 +267,36 @@
}
/**************************
+ * Menu Separator
+ **************************/
+
+/**
+ * @brief Gets the type of an Etk_Menu_Separator
+ * @return Returns the type on an Etk_Menu_Separator
+ */
+Etk_Type *etk_menu_separator_type_get()
+{
+ static Etk_Type *menu_separator_type = NULL;
+
+ if (!menu_separator_type)
+ {
+ menu_separator_type = etk_type_new("Etk_Menu_Separator",
ETK_MENU_ITEM_TYPE, sizeof(Etk_Menu_Separator), NULL, NULL);
+ }
+
+ return menu_separator_type;
+}
+
+/**
+ * @brief Creates a new menu separator
+ * @return Returns the new menu separator widget
+ * @note Unlike the other widgets, You don't need to call etk_widget_shown,
the widget is automaticall shown at its creation
+ */
+Etk_Widget *etk_menu_separator_new()
+{
+ return etk_widget_new(ETK_MENU_SEPARATOR_TYPE, "theme_group",
"menu_separator", "visible", TRUE, NULL);
+}
+
+/**************************
*
* Etk specific functions
*
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/etk_menu_item.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- etk_menu_item.h 13 Nov 2005 12:04:05 -0000 1.2
+++ etk_menu_item.h 13 Nov 2005 12:20:33 -0000 1.3
@@ -17,6 +17,13 @@
/** @brief Checks if the object is an Etk_Menu_Item */
#define ETK_IS_MENU_ITEM(obj) (ETK_OBJECT_CHECK_TYPE((obj),
ETK_MENU_ITEM_TYPE))
+/** @brief Gets the type of a menu separator */
+#define ETK_MENU_SEPARATOR_TYPE (etk_menu_separator_type_get())
+/** @brief Casts the object to an Etk_Menu_Sepatator */
+#define ETK_MENU_SEPARATOR(obj) (ETK_OBJECT_CAST((obj),
ETK_MENU_SEPARATOR_TYPE, Etk_Menu_Separator))
+/** @brief Checks if the object is an Etk_Menu_Separator */
+#define ETK_IS_MENU_SEPARATOR(obj) (ETK_OBJECT_CHECK_TYPE((obj),
ETK_MENU_SEPARATOR_TYPE))
+
/**
* @struct Etk_Menu_Item
* @brief An item of a menu or of a menu bar
@@ -45,6 +52,17 @@
Etk_Bool right_widget_is_arrow;
};
+/**
+ * @struct Etk_Menu_Separator
+ * @brief An horizontal separator for the menus
+ */
+struct _Etk_Menu_Separator
+{
+ /* private: */
+ /* Inherit from Etk_Menu_Item */
+ Etk_Menu_Item menu_item;
+};
+
Etk_Type *etk_menu_item_type_get();
Etk_Widget *etk_menu_item_new();
Etk_Widget *etk_menu_item_new_with_label(const char *label);
@@ -62,6 +80,10 @@
void etk_menu_item_image_show(Etk_Menu_Item *menu_item, Etk_Bool show);
void etk_menu_item_right_swallow_show(Etk_Menu_Item *menu_item, Etk_Bool show);
+
+Etk_Type *etk_menu_separator_type_get();
+Etk_Widget *etk_menu_separator_new();
+
/** @} */
#endif
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/etk_types.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- etk_types.h 13 Nov 2005 12:04:05 -0000 1.13
+++ etk_types.h 13 Nov 2005 12:20:33 -0000 1.14
@@ -98,6 +98,7 @@
typedef struct _Etk_Menu_Shell Etk_Menu_Shell;
typedef struct _Etk_Menu Etk_Menu;
typedef struct _Etk_Menu_Item Etk_Menu_Item;
+typedef struct _Etk_Menu_Separator Etk_Menu_Separator;
/**
* @enum Etk_Fill_Policy_Flags
-------------------------------------------------------
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