From 2d8eac6ae37a5615c846953410e1576faf5bc677 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 26 Mar 2013 15:14:33 -0500 Subject: rename user-widget.[ch] to idousermenuitem.[ch]. Not building yet, next step is to decouple from dbusmenu. --- src/idousermenuitem.h | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/idousermenuitem.h (limited to 'src/idousermenuitem.h') diff --git a/src/idousermenuitem.h b/src/idousermenuitem.h new file mode 100644 index 0000000..ac115a8 --- /dev/null +++ b/src/idousermenuitem.h @@ -0,0 +1,55 @@ +/* +Copyright 2011 Canonical Ltd. + +Authors: + Conor Curran + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program. If not, see . +*/ +#ifndef __IDO_USER_MENU_ITEM_H__ +#define __IDO_USER_MENU_ITEM_H__ + +#include +#include + +G_BEGIN_DECLS + +#define IDO_USER_MENU_ITEM_TYPE (ido_user_menu_item_get_type ()) +#define IDO_USER_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), IDO_USER_MENU_ITEM_TYPE, IdoUserMenuItem)) +#define IDO_USER_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), IDO_USER_MENU_ITEM_TYPE, IdoUserMenuItemClass)) +#define IS_IDO_USER_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IDO_USER_MENU_ITEM_TYPE)) +#define IS_IDO_USER_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), IDO_USER_MENU_ITEM_TYPE)) +#define IDO_USER_MENU_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), IDO_USER_MENU_ITEM_TYPE, IdoUserMenuItemClass)) + +typedef struct _IdoUserMenuItem IdoUserMenuItem; +typedef struct _IdoUserMenuItemClass IdoUserMenuItemClass; +typedef struct _IdoUserMenuItemPrivate IdoUserMenuItemPrivate; + +struct _IdoUserMenuItemClass +{ + GtkMenuItemClass parent_class; +}; + +struct _IdoUserMenuItem +{ + /*< private >*/ + GtkMenuItem parent; + IdoUserMenuItemPrivate * priv; +}; + +GType ido_user_menu_item_get_type (void) G_GNUC_CONST; +GtkWidget* ido_user_menu_item_new(DbusmenuMenuitem *twin_item); + +G_END_DECLS + +#endif -- cgit v1.2.3 From 259c7ad0334a5c04873e4b62eb04890c76813fd0 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 26 Mar 2013 16:24:47 -0500 Subject: add properties to IdoUserMenuItem and remove its dependencies on DbusmenuMenuitem --- src/idousermenuitem.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/idousermenuitem.h') diff --git a/src/idousermenuitem.h b/src/idousermenuitem.h index ac115a8..7826718 100644 --- a/src/idousermenuitem.h +++ b/src/idousermenuitem.h @@ -20,7 +20,6 @@ with this program. If not, see . #define __IDO_USER_MENU_ITEM_H__ #include -#include G_BEGIN_DECLS @@ -35,6 +34,12 @@ typedef struct _IdoUserMenuItem IdoUserMenuItem; typedef struct _IdoUserMenuItemClass IdoUserMenuItemClass; typedef struct _IdoUserMenuItemPrivate IdoUserMenuItemPrivate; +/* property keys */ +#define IDO_USER_MENU_ITEM_PROP_LABEL "label" +#define IDO_USER_MENU_ITEM_PROP_ICON "icon" +#define IDO_USER_MENU_ITEM_PROP_IS_LOGGED_IN "is-logged-in" +#define IDO_USER_MENU_ITEM_PROP_IS_CURRENT_USER "is-current-user" + struct _IdoUserMenuItemClass { GtkMenuItemClass parent_class; @@ -48,7 +53,13 @@ struct _IdoUserMenuItem }; GType ido_user_menu_item_get_type (void) G_GNUC_CONST; -GtkWidget* ido_user_menu_item_new(DbusmenuMenuitem *twin_item); + +GtkWidget* ido_user_menu_item_new(void); + +void ido_user_menu_item_set_icon (IdoUserMenuItem * self, const char * icon_name); +void ido_user_menu_item_set_logged_in (IdoUserMenuItem * self, gboolean is_logged_in); +void ido_user_menu_item_set_current_user (IdoUserMenuItem * self, gboolean is_current_user); +void ido_user_menu_item_set_label (IdoUserMenuItem * self, const char * label); G_END_DECLS -- cgit v1.2.3 From e9c82c3904642003b47f3d2bc13343894e6750d8 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 27 Mar 2013 08:30:38 -0500 Subject: rename idousermenuitem's "icon" property as "icon-filename" for a little more clarity. --- src/idousermenuitem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/idousermenuitem.h') diff --git a/src/idousermenuitem.h b/src/idousermenuitem.h index 7826718..b9a3d00 100644 --- a/src/idousermenuitem.h +++ b/src/idousermenuitem.h @@ -36,7 +36,7 @@ typedef struct _IdoUserMenuItemPrivate IdoUserMenuItemPrivate; /* property keys */ #define IDO_USER_MENU_ITEM_PROP_LABEL "label" -#define IDO_USER_MENU_ITEM_PROP_ICON "icon" +#define IDO_USER_MENU_ITEM_PROP_ICON_FILENAME "icon-filename" #define IDO_USER_MENU_ITEM_PROP_IS_LOGGED_IN "is-logged-in" #define IDO_USER_MENU_ITEM_PROP_IS_CURRENT_USER "is-current-user" -- cgit v1.2.3