diff options
Diffstat (limited to 'libindicator')
-rw-r--r-- | libindicator/indicator-desktop-shortcuts.c | 86 | ||||
-rw-r--r-- | libindicator/indicator-desktop-shortcuts.h | 3 |
2 files changed, 88 insertions, 1 deletions
diff --git a/libindicator/indicator-desktop-shortcuts.c b/libindicator/indicator-desktop-shortcuts.c index 6c60638..845f997 100644 --- a/libindicator/indicator-desktop-shortcuts.c +++ b/libindicator/indicator-desktop-shortcuts.c @@ -42,6 +42,7 @@ static void indicator_desktop_shortcuts_finalize (GObject *object); G_DEFINE_TYPE (IndicatorDesktopShortcuts, indicator_desktop_shortcuts, G_TYPE_OBJECT); +/* Build up the class */ static void indicator_desktop_shortcuts_class_init (IndicatorDesktopShortcutsClass *klass) { @@ -55,6 +56,7 @@ indicator_desktop_shortcuts_class_init (IndicatorDesktopShortcutsClass *klass) return; } +/* Initialize instance data */ static void indicator_desktop_shortcuts_init (IndicatorDesktopShortcuts *self) { @@ -65,6 +67,7 @@ indicator_desktop_shortcuts_init (IndicatorDesktopShortcuts *self) return; } +/* Clear object references */ static void indicator_desktop_shortcuts_dispose (GObject *object) { @@ -73,6 +76,7 @@ indicator_desktop_shortcuts_dispose (GObject *object) return; } +/* Free all memory */ static void indicator_desktop_shortcuts_finalize (GObject *object) { @@ -81,3 +85,85 @@ indicator_desktop_shortcuts_finalize (GObject *object) return; } +/* API */ + +/** + indicator_desktop_shortcuts_new: + @file: The desktop file that would be opened to + find the actions. + @identity: This is a string that represents the identity + that should be used in searching those actions. It + relates to the ShowIn and NotShownIn properties. + + This function creates the basic object. It involves opening + the file and parsing it. It could potentially block on IO. At + the end of the day you'll have a fully functional object. + + Return value: A new #IndicatorDesktopShortcuts object. +*/ +IndicatorDesktopShortcuts * +indicator_desktop_shortcuts_new (const gchar * file, const gchar * identity) +{ + + return NULL; +} + +/** + indicator_desktop_shortcuts_get_nicks: + @ids: The #IndicatorDesktopShortcuts object to look in + + Give you the list of commands that are available for this desktop + file given the identity that was passed in at creation. This will + filter out the various items in the desktop file. These nicks can + then be used as keys for working with the desktop file. + + Return value: A #NULL terminated list of strings. This memory + is managed by the @ids object. +*/ +const gchar ** +indicator_desktop_shortcuts_get_nicks (IndicatorDesktopShortcuts * ids) +{ + + + return NULL; +} + +/** + indicator_desktop_shortcuts_nick_get_name: + @ids: The #IndicatorDesktopShortcuts object to look in + @nick: Which command that we're referencing. + + This function looks in a desktop file for a nick to find the + user visible name for that shortcut. The @nick parameter + should be gotten from #indicator_desktop_shortcuts_get_nicks + though it's not required that the exact memory location + be the same. + + Return value: A user visible string for the shortcut or + #NULL on error. +*/ +const gchar * +indicator_desktop_shortcuts_nick_get_name (IndicatorDesktopShortcuts * ids, const gchar * nick) +{ + + return NULL; +} + +/** + indicator_desktop_shortcuts_nick_exec: + @ids: The #IndicatorDesktopShortcuts object to look in + @nick: Which command that we're referencing. + + Here we take a @nick and try and execute the action that is + associated with it. The @nick parameter should be gotten + from #indicator_desktop_shortcuts_get_nicks though it's not + required that the exact memory location be the same. + + Return value: #TRUE on success or #FALSE on error. +*/ +gboolean +indicator_desktop_shortcuts_nick_exec (IndicatorDesktopShortcuts * ids, const gchar * nick) +{ + + return FALSE; +} diff --git a/libindicator/indicator-desktop-shortcuts.h b/libindicator/indicator-desktop-shortcuts.h index 10cacff..bda65a6 100644 --- a/libindicator/indicator-desktop-shortcuts.h +++ b/libindicator/indicator-desktop-shortcuts.h @@ -66,7 +66,8 @@ IndicatorDesktopShortcuts * indicator_desktop_shortcuts_new (const const gchar ** indicator_desktop_shortcuts_get_nicks (IndicatorDesktopShortcuts * ids); const gchar * indicator_desktop_shortcuts_nick_get_name (IndicatorDesktopShortcuts * ids, const gchar * nick); - +gboolean indicator_desktop_shortcuts_nick_exec (IndicatorDesktopShortcuts * ids, + const gchar * nick); G_END_DECLS |