diff options
author | Ted Gould <ted@gould.cx> | 2010-08-12 09:30:35 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-08-12 09:30:35 -0500 |
commit | 6769e30333d906eb69789aff69d58851fe08fc00 (patch) | |
tree | 717e599f47384d4ab7814094dc7cf7312266e966 /src | |
parent | c1b795ef9c73fb679fdcac0d24d892b30ef3c7de (diff) | |
parent | f6b5ccdf34323425d94e594c6f748c1d4201cf89 (diff) | |
download | libayatana-appindicator-6769e30333d906eb69789aff69d58851fe08fc00.tar.gz libayatana-appindicator-6769e30333d906eb69789aff69d58851fe08fc00.tar.bz2 libayatana-appindicator-6769e30333d906eb69789aff69d58851fe08fc00.zip |
Sync to trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/app-indicator.c | 59 | ||||
-rw-r--r-- | src/application-service-appstore.c | 6 | ||||
-rw-r--r-- | src/notification-item.xml | 6 |
3 files changed, 65 insertions, 6 deletions
diff --git a/src/app-indicator.c b/src/app-indicator.c index 7528da2..6511589 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -94,6 +94,7 @@ enum { NEW_ATTENTION_ICON, NEW_STATUS, NEW_LABEL, + X_NEW_LABEL, CONNECTION_CHANGED, NEW_ICON_THEME_PATH, LAST_SIGNAL @@ -115,6 +116,8 @@ enum { PROP_CONNECTED, PROP_LABEL, PROP_LABEL_GUIDE, + PROP_X_LABEL, + PROP_X_LABEL_GUIDE, PROP_ORDERING_INDEX, PROP_X_ORDERING_INDEX }; @@ -130,6 +133,8 @@ enum { #define PROP_CONNECTED_S "connected" #define PROP_LABEL_S "label" #define PROP_LABEL_GUIDE_S "label-guide" +#define PROP_X_LABEL_S ("x-ayatana-" PROP_LABEL_S) +#define PROP_X_LABEL_GUIDE_S ("x-ayatana-" PROP_LABEL_GUIDE_S) #define PROP_ORDERING_INDEX_S "ordering-index" #define PROP_X_ORDERING_INDEX_S ("x-ayatana-" PROP_ORDERING_INDEX_S) @@ -137,6 +142,9 @@ enum { #define APP_INDICATOR_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), APP_INDICATOR_TYPE, AppIndicatorPrivate)) +/* Signal wrapper */ +#define APP_INDICATOR_SIGNAL_X_NEW_LABEL ("x-ayatana-" APP_INDICATOR_SIGNAL_NEW_LABEL) + /* Default Path */ #define DEFAULT_ITEM_PATH "/org/ayatana/NotificationItem" @@ -370,6 +378,32 @@ app_indicator_class_init (AppIndicatorClass *klass) 0, G_MAXUINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + AppIndicator:x-ayatana-label: + + Wrapper for #AppIndicator:label. Please use that in all of your + code. + */ + g_object_class_install_property(object_class, + PROP_X_LABEL, + g_param_spec_string (PROP_X_LABEL_S, + "A wrapper, please don't use.", + "A wrapper, please don't use.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + AppIndicator:x-ayatana-label-guide: + + Wrapper for #AppIndicator:label-guide. Please use that in all of your + code. + */ + g_object_class_install_property(object_class, + PROP_X_LABEL_GUIDE, + g_param_spec_string (PROP_X_LABEL_GUIDE_S, + "A wrapper, please don't use.", + "A wrapper, please don't use.", + NULL, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /* Signals */ @@ -435,6 +469,23 @@ app_indicator_class_init (AppIndicatorClass *klass) G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); /** + AppIndicator::x-ayatana-new-label: + @arg0: The #AppIndicator object + @arg1: The string for the label + @arg1: The string for the guide + + Wrapper for #AppIndicator::new-label, please don't use this signal + use the other one. + */ + signals[X_NEW_LABEL] = g_signal_new (APP_INDICATOR_SIGNAL_X_NEW_LABEL, + G_TYPE_FROM_CLASS(klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (AppIndicatorClass, new_label), + NULL, NULL, + _application_service_marshal_VOID__STRING_STRING, + G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); + + /** AppIndicator::connection-changed: @arg0: The #AppIndicator object @arg1: Whether we're connected or not @@ -698,6 +749,7 @@ app_indicator_set_property (GObject * object, guint prop_id, const GValue * valu check_connect (self); break; + case PROP_X_LABEL: case PROP_LABEL: { gchar * oldlabel = priv->label; priv->label = g_value_dup_string(value); @@ -716,6 +768,7 @@ app_indicator_set_property (GObject * object, guint prop_id, const GValue * valu } break; } + case PROP_X_LABEL_GUIDE: case PROP_LABEL_GUIDE: { gchar * oldguide = priv->label_guide; priv->label_guide = g_value_dup_string(value); @@ -796,10 +849,12 @@ app_indicator_get_property (GObject * object, guint prop_id, GValue * value, GPa g_value_set_boolean (value, priv->watcher_proxy != NULL ? TRUE : FALSE); break; + case PROP_X_LABEL: case PROP_LABEL: g_value_set_string (value, priv->label); break; + case PROP_X_LABEL_GUIDE: case PROP_LABEL_GUIDE: g_value_set_string (value, priv->label_guide); break; @@ -828,6 +883,10 @@ signal_label_change_idle (gpointer user_data) priv->label != NULL ? priv->label : "", priv->label_guide != NULL ? priv->label_guide : "", TRUE); + g_signal_emit(G_OBJECT(self), signals[X_NEW_LABEL], 0, + priv->label != NULL ? priv->label : "", + priv->label_guide != NULL ? priv->label_guide : "", + TRUE); priv->label_change_idle = 0; diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index d3dc4a9..4ac1576 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -46,14 +46,14 @@ static gboolean _application_service_server_get_applications (ApplicationService #define NOTIFICATION_ITEM_PROP_AICON_NAME "AttentionIconName" #define NOTIFICATION_ITEM_PROP_ICON_THEME_PATH "IconThemePath" #define NOTIFICATION_ITEM_PROP_MENU "Menu" -#define NOTIFICATION_ITEM_PROP_LABEL "Label" -#define NOTIFICATION_ITEM_PROP_LABEL_GUIDE "LabelGuide" +#define NOTIFICATION_ITEM_PROP_LABEL "XAyatanaLabel" +#define NOTIFICATION_ITEM_PROP_LABEL_GUIDE "XAyatanaLabelGuide" #define NOTIFICATION_ITEM_PROP_ORDERING_INDEX "XAyatanaOrderingIndex" #define NOTIFICATION_ITEM_SIG_NEW_ICON "NewIcon" #define NOTIFICATION_ITEM_SIG_NEW_AICON "NewAttentionIcon" #define NOTIFICATION_ITEM_SIG_NEW_STATUS "NewStatus" -#define NOTIFICATION_ITEM_SIG_NEW_LABEL "NewLabel" +#define NOTIFICATION_ITEM_SIG_NEW_LABEL "XAyatanaNewLabel" #define NOTIFICATION_ITEM_SIG_NEW_ICON_THEME_PATH "NewIconThemePath" #define OVERRIDE_GROUP_NAME "Ordering Index Overrides" diff --git a/src/notification-item.xml b/src/notification-item.xml index b66dfe3..05afd83 100644 --- a/src/notification-item.xml +++ b/src/notification-item.xml @@ -12,8 +12,8 @@ to find the icons specified above. --> <property name="IconThemePath" type="s" access="read" /> <property name="Menu" type="o" access="read" /> - <property name="Label" type="s" access="read" /> - <property name="LabelGuide" type="s" access="read" /> + <property name="XAyatanaLabel" type="s" access="read" /> + <property name="XAyatanaLabelGuide" type="s" access="read" /> <property name="XAyatanaOrderingIndex" type="u" access="read" /> <!-- Methods --> @@ -30,7 +30,7 @@ <signal name="NewStatus"> <arg type="s" name="status" direction="out" /> </signal> - <signal name="NewLabel"> + <signal name="XAyatanaNewLabel"> <arg type="s" name="label" direction="out" /> <arg type="s" name="guide" direction="out" /> </signal> |