From e932bfa4e6ba766d12fb4193cd4d2e7c24645784 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 20 Oct 2009 22:07:29 -0500 Subject: Fleshing out the set functions. --- src/libcustomindicator/custom-indicator.c | 74 ++++++++++++++++++++++++++++--- src/libcustomindicator/custom-indicator.h | 2 +- 2 files changed, 68 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/libcustomindicator/custom-indicator.c b/src/libcustomindicator/custom-indicator.c index 127084d..530f035 100644 --- a/src/libcustomindicator/custom-indicator.c +++ b/src/libcustomindicator/custom-indicator.c @@ -564,44 +564,104 @@ check_connect (CustomIndicator * self) /* Public Functions */ /* ************************* */ +/** + custom_indicator_set_id: + @ci: The #CustomIndicator object to use + @id: ID to set for this indicator + + Wrapper function for property #CustomIndicator::id. +*/ void custom_indicator_set_id (CustomIndicator * ci, const gchar * id) { - + GValue value = {0}; + g_value_init(&value, G_TYPE_STRING); + g_value_set_string(&value, id); + g_object_set_property(G_OBJECT(ci), PROP_ID_S, &value); return; } +/** + custom_indicator_set_category: + @ci: The #CustomIndicator object to use + @category: The category to set for this indicator + + Wrapper function for property #CustomIndicator::category. +*/ void custom_indicator_set_category (CustomIndicator * ci, CustomIndicatorCategory category) { - + GValue value = {0}; + g_value_init(&value, G_TYPE_ENUM); + g_value_set_enum(&value, category); + g_object_set_property(G_OBJECT(ci), PROP_CATEGORY_S, &value); return; } +/** + custom_indicator_set_status: + @ci: The #CustomIndicator object to use + @status: The status to set for this indicator + + Wrapper function for property #CustomIndicator::status. +*/ void custom_indicator_set_status (CustomIndicator * ci, CustomIndicatorStatus status) { - + GValue value = {0}; + g_value_init(&value, G_TYPE_ENUM); + g_value_set_enum(&value, status); + g_object_set_property(G_OBJECT(ci), PROP_STATUS_S, &value); return; } +/** + custom_indicator_set_icon: + @ci: The #CustomIndicator object to use + @icon_name: The name of the icon to set for this indicator + + Wrapper function for property #CustomIndicator::icon. +*/ void custom_indicator_set_icon (CustomIndicator * ci, const gchar * icon_name) { - + GValue value = {0}; + g_value_init(&value, G_TYPE_STRING); + g_value_set_string(&value, icon_name); + g_object_set_property(G_OBJECT(ci), PROP_ICON_NAME_S, &value); return; } +/** + custom_indicator_set_attention_icon: + @ci: The #CustomIndicator object to use + @icon_name: The name of the attention icon to set for this indicator + + Wrapper function for property #CustomIndicator::attention-icon. +*/ void custom_indicator_set_attention_icon (CustomIndicator * ci, const gchar * icon_name) { - + GValue value = {0}; + g_value_init(&value, G_TYPE_STRING); + g_value_set_string(&value, icon_name); + g_object_set_property(G_OBJECT(ci), PROP_ATTENTION_ICON_NAME_S, &value); return; } +/** + custom_indicator_set_menu: + @ci: The #CustomIndicator object to use + @menu: The object with the menu for the indicator + + Wrapper function for property #CustomIndicator::menu. +*/ void -custom_indicator_set_menu (CustomIndicator * ci, void * menu) +custom_indicator_set_menu (CustomIndicator * ci, DbusmenuServer * menu) { - + GValue value = {0}; + g_value_init(&value, G_TYPE_OBJECT); + g_value_set_object(&value, G_OBJECT(menu)); + g_object_set_property(G_OBJECT(ci), PROP_MENU_S, &value); return; } diff --git a/src/libcustomindicator/custom-indicator.h b/src/libcustomindicator/custom-indicator.h index b6bb228..fd2ddc7 100644 --- a/src/libcustomindicator/custom-indicator.h +++ b/src/libcustomindicator/custom-indicator.h @@ -127,7 +127,7 @@ void custom_indicator_set_icon (CustomIndic void custom_indicator_set_attention_icon (CustomIndicator * ci, const gchar * icon_name); void custom_indicator_set_menu (CustomIndicator * ci, - void * menu); + DbusmenuServer * menu); /* Get properties */ const gchar * custom_indicator_get_id (CustomIndicator * ci); -- cgit v1.2.3