diff options
author | Colomban Wendling <[email protected]> | 2017-01-20 11:03:03 +0100 |
---|---|---|
committer | lukefromdc <[email protected]> | 2017-01-23 13:49:34 -0500 |
commit | da419c619744efc754e72df2e2101a32adca8a37 (patch) | |
tree | 37df54c88607741686a5e2a50a49b90811c021a2 /applets/notification_area | |
parent | 7d39b2e82f46777efa67224f078c1cec9e827654 (diff) | |
download | mate-panel-da419c619744efc754e72df2e2101a32adca8a37.tar.bz2 mate-panel-da419c619744efc754e72df2e2101a32adca8a37.tar.xz |
Lower GLib dependency
Diffstat (limited to 'applets/notification_area')
10 files changed, 121 insertions, 37 deletions
diff --git a/applets/notification_area/libstatus-notifier-watcher/gf-sn-watcher-v0.h b/applets/notification_area/libstatus-notifier-watcher/gf-sn-watcher-v0.h index 73bf6d04..877c5a85 100644 --- a/applets/notification_area/libstatus-notifier-watcher/gf-sn-watcher-v0.h +++ b/applets/notification_area/libstatus-notifier-watcher/gf-sn-watcher-v0.h @@ -22,10 +22,19 @@ G_BEGIN_DECLS -#define GF_TYPE_SN_WATCHER_V0 gf_sn_watcher_v0_get_type () -G_DECLARE_FINAL_TYPE (GfSnWatcherV0, gf_sn_watcher_v0, - GF, SN_WATCHER_V0, GfSnWatcherV0GenSkeleton) +#define GF_TYPE_SN_WATCHER_V0 (gf_sn_watcher_v0_get_type ()) +#define GF_SN_WATCHER_V0(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GF_TYPE_SN_WATCHER_V0, GfSnWatcherV0)) +#define GF_IS_SN_WATCHER_V0(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GF_TYPE_SN_WATCHER_V0)) +typedef struct _GfSnWatcherV0 GfSnWatcherV0; +typedef struct _GfSnWatcherV0Class GfSnWatcherV0Class; + +struct _GfSnWatcherV0Class +{ + GfSnWatcherV0GenSkeletonClass parent_class; +}; + +GType gf_sn_watcher_v0_get_type (void); GfSnWatcherV0 *gf_sn_watcher_v0_new (void); G_END_DECLS diff --git a/applets/notification_area/libstatus-notifier-watcher/gf-status-notifier-watcher.h b/applets/notification_area/libstatus-notifier-watcher/gf-status-notifier-watcher.h index fd871a42..4219891a 100644 --- a/applets/notification_area/libstatus-notifier-watcher/gf-status-notifier-watcher.h +++ b/applets/notification_area/libstatus-notifier-watcher/gf-status-notifier-watcher.h @@ -22,10 +22,19 @@ G_BEGIN_DECLS -#define GF_TYPE_STATUS_NOTIFIER_WATCHER gf_status_notifier_watcher_get_type () -G_DECLARE_FINAL_TYPE (GfStatusNotifierWatcher, gf_status_notifier_watcher, - GF, STATUS_NOTIFIER_WATCHER, GObject) +#define GF_TYPE_STATUS_NOTIFIER_WATCHER (gf_status_notifier_watcher_get_type ()) +#define GF_STATUS_NOTIFIER_WATCHER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GF_TYPE_STATUS_NOTIFIER_WATCHER, GfStatusNotifierWatcher)) +#define GF_IS_STATUS_NOTIFIER_WATCHER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GF_TYPE_STATUS_NOTIFIER_WATCHER)) +typedef struct _GfStatusNotifierWatcher GfStatusNotifierWatcher; +typedef struct _GfStatusNotifierWatcherClass GfStatusNotifierWatcherClass; + +struct _GfStatusNotifierWatcherClass +{ + GObjectClass parent_class; +}; + +GType gf_status_notifier_watcher_get_type (void); GfStatusNotifierWatcher *gf_status_notifier_watcher_new (void); G_END_DECLS diff --git a/applets/notification_area/na-host.h b/applets/notification_area/na-host.h index 7f06678a..eeccb56f 100644 --- a/applets/notification_area/na-host.h +++ b/applets/notification_area/na-host.h @@ -23,8 +23,13 @@ G_BEGIN_DECLS -#define NA_TYPE_HOST na_host_get_type () -G_DECLARE_INTERFACE (NaHost, na_host, NA, HOST, GObject) +#define NA_TYPE_HOST (na_host_get_type ()) +#define NA_HOST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NA_TYPE_HOST, NaHost)) +#define NA_IS_HOST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NA_TYPE_HOST)) +#define NA_HOST_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NA_TYPE_HOST, NaHostInterface)) + +typedef struct _NaHost NaHost; +typedef struct _NaHostInterface NaHostInterface; struct _NaHostInterface { @@ -35,13 +40,14 @@ struct _NaHostInterface GtkStyleContext *context); }; -void na_host_force_redraw (NaHost *host); -void na_host_style_updated (NaHost *host, - GtkStyleContext *context); -void na_host_emit_item_added (NaHost *host, - NaItem *item); -void na_host_emit_item_removed (NaHost *host, - NaItem *item); +GType na_host_get_type (void); +void na_host_force_redraw (NaHost *host); +void na_host_style_updated (NaHost *host, + GtkStyleContext *context); +void na_host_emit_item_added (NaHost *host, + NaItem *item); +void na_host_emit_item_removed (NaHost *host, + NaItem *item); G_END_DECLS diff --git a/applets/notification_area/na-item.h b/applets/notification_area/na-item.h index 30e8e676..7b9364c6 100644 --- a/applets/notification_area/na-item.h +++ b/applets/notification_area/na-item.h @@ -23,8 +23,13 @@ G_BEGIN_DECLS -#define NA_TYPE_ITEM na_item_get_type () -G_DECLARE_INTERFACE (NaItem, na_item, NA, ITEM, GtkWidget) +#define NA_TYPE_ITEM (na_item_get_type ()) +#define NA_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NA_TYPE_ITEM, NaItem)) +#define NA_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NA_TYPE_ITEM)) +#define NA_ITEM_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NA_TYPE_ITEM, NaItemInterface)) + +typedef struct _NaItem NaItem; +typedef struct _NaItemInterface NaItemInterface; typedef enum { @@ -53,6 +58,7 @@ struct _NaItemInterface cairo_t *parent_cr); }; +GType na_item_get_type (void); const gchar *na_item_get_id (NaItem *item); NaItemCategory na_item_get_category (NaItem *item); gboolean na_item_draw_on_parent (NaItem *item, diff --git a/applets/notification_area/status-notifier/sn-dbus-menu.h b/applets/notification_area/status-notifier/sn-dbus-menu.h index 39907d07..d92f8eb8 100644 --- a/applets/notification_area/status-notifier/sn-dbus-menu.h +++ b/applets/notification_area/status-notifier/sn-dbus-menu.h @@ -22,8 +22,19 @@ G_BEGIN_DECLS -#define SN_TYPE_DBUS_MENU sn_dbus_menu_get_type () -G_DECLARE_FINAL_TYPE (SnDBusMenu, sn_dbus_menu, SN, DBUS_MENU, GtkMenu) +#define SN_TYPE_DBUS_MENU (sn_dbus_menu_get_type ()) +#define SN_DBUS_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SN_TYPE_DBUS_MENU, SnDBusMenu)) +#define SN_IS_DBUS_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SN_TYPE_DBUS_MENU)) + +typedef struct _SnDBusMenu SnDBusMenu; +typedef struct _SnDBusMenuClass SnDBusMenuClass; + +struct _SnDBusMenuClass +{ + GtkMenuClass parent_class; +}; + +GType sn_dbus_menu_get_type (void); GtkMenu *sn_dbus_menu_new (const gchar *bus_name, const gchar *object_path); diff --git a/applets/notification_area/status-notifier/sn-host-v0.h b/applets/notification_area/status-notifier/sn-host-v0.h index 61c8b5c3..6681c111 100644 --- a/applets/notification_area/status-notifier/sn-host-v0.h +++ b/applets/notification_area/status-notifier/sn-host-v0.h @@ -23,9 +23,19 @@ G_BEGIN_DECLS -#define SN_TYPE_HOST_V0 sn_host_v0_get_type () -G_DECLARE_FINAL_TYPE (SnHostV0, sn_host_v0, SN, HOST_V0, SnHostV0GenSkeleton) +#define SN_TYPE_HOST_V0 (sn_host_v0_get_type ()) +#define SN_HOST_V0(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SN_TYPE_HOST_V0, SnHostV0)) +#define SN_IS_HOST_V0(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SN_TYPE_HOST_V0)) +typedef struct _SnHostV0 SnHostV0; +typedef struct _SnHostV0Class SnHostV0Class; + +struct _SnHostV0Class +{ + SnHostV0GenSkeletonClass parent_class; +}; + +GType sn_host_v0_get_type (void); NaHost *sn_host_v0_new (void); G_END_DECLS diff --git a/applets/notification_area/status-notifier/sn-image-menu-item.h b/applets/notification_area/status-notifier/sn-image-menu-item.h index b0fe8a90..9aa9a4a1 100644 --- a/applets/notification_area/status-notifier/sn-image-menu-item.h +++ b/applets/notification_area/status-notifier/sn-image-menu-item.h @@ -22,9 +22,19 @@ G_BEGIN_DECLS -#define SN_TYPE_IMAGE_MENU_ITEM sn_image_menu_item_get_type () -G_DECLARE_FINAL_TYPE (SnImageMenuItem, sn_image_menu_item, - SN, IMAGE_MENU_ITEM, GtkMenuItem) +#define SN_TYPE_IMAGE_MENU_ITEM (sn_image_menu_item_get_type ()) +#define SN_IMAGE_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SN_TYPE_IMAGE_MENU_ITEM, SnImageMenuItem)) +#define SN_IS_IMAGE_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SN_TYPE_IMAGE_MENU_ITEM)) + +typedef struct _SnImageMenuItem SnImageMenuItem; +typedef struct _SnImageMenuItemClass SnImageMenuItemClass; + +struct _SnImageMenuItemClass +{ + GtkMenuItemClass parent_class; +}; + +GType sn_image_menu_item_get_type (void); GtkWidget *sn_image_menu_item_new (void); diff --git a/applets/notification_area/status-notifier/sn-item-v0.h b/applets/notification_area/status-notifier/sn-item-v0.h index 4b1bd492..548905e8 100644 --- a/applets/notification_area/status-notifier/sn-item-v0.h +++ b/applets/notification_area/status-notifier/sn-item-v0.h @@ -22,8 +22,19 @@ G_BEGIN_DECLS -#define SN_TYPE_ITEM_V0 sn_item_v0_get_type () -G_DECLARE_FINAL_TYPE (SnItemV0, sn_item_v0, SN, ITEM_V0, SnItem) +#define SN_TYPE_ITEM_V0 (sn_item_v0_get_type ()) +#define SN_ITEM_V0(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SN_TYPE_ITEM_V0, SnItemV0)) +#define SN_IS_ITEM_V0(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SN_TYPE_ITEM_V0)) + +typedef struct _SnItemV0 SnItemV0; +typedef struct _SnItemV0Class SnItemV0Class; + +struct _SnItemV0Class +{ + SnItemClass parent_class; +}; + +GType sn_item_v0_get_type (void); SnItem *sn_item_v0_new (const gchar *bus_name, const gchar *object_path); diff --git a/applets/notification_area/status-notifier/sn-item.c b/applets/notification_area/status-notifier/sn-item.c index 13ee68f3..9bd16314 100644 --- a/applets/notification_area/status-notifier/sn-item.c +++ b/applets/notification_area/status-notifier/sn-item.c @@ -22,7 +22,7 @@ #include "na-item.h" -typedef struct +struct _SnItemPrivate { gchar *bus_name; gchar *object_path; @@ -30,7 +30,7 @@ typedef struct GtkOrientation orientation; GtkMenu *menu; -} SnItemPrivate; +}; enum { @@ -56,18 +56,12 @@ static guint signals[LAST_SIGNAL] = { 0 }; static void na_item_init (NaItemInterface *iface); G_DEFINE_ABSTRACT_TYPE_WITH_CODE (SnItem, sn_item, GTK_TYPE_BUTTON, - //~ G_ADD_PRIVATE (SnItem); G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, NULL) G_IMPLEMENT_INTERFACE (NA_TYPE_ITEM, na_item_init)) -/* FIXME: apparently if requesting < 2.38, G_ADD_PRIVATE() or the default - * sn_item_get_instance_private() does NOT work, and returns some garbage - * (either get_instance_private() works but G_ADD_PRIVATE() didn't do nothing, - * or the other way around, but it leads to using incorrect memory) */ -#define sn_item_get_instance_private(i) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((i), SN_TYPE_ITEM, SnItemPrivate)) +#define sn_item_get_instance_private(i) (SN_ITEM (i)->priv) static void sn_item_dispose (GObject *object) @@ -461,6 +455,8 @@ sn_item_class_init (SnItemClass *item_class) static void sn_item_init (SnItem *item) { + item->priv = G_TYPE_INSTANCE_GET_PRIVATE (item, SN_TYPE_ITEM, SnItemPrivate); + gtk_widget_add_events (GTK_WIDGET (item), GDK_SCROLL_MASK); } diff --git a/applets/notification_area/status-notifier/sn-item.h b/applets/notification_area/status-notifier/sn-item.h index c414b942..de7de892 100644 --- a/applets/notification_area/status-notifier/sn-item.h +++ b/applets/notification_area/status-notifier/sn-item.h @@ -22,8 +22,12 @@ G_BEGIN_DECLS -#define SN_TYPE_ITEM sn_item_get_type () -G_DECLARE_DERIVABLE_TYPE (SnItem, sn_item, SN, ITEM, GtkButton) +#define SN_TYPE_ITEM (sn_item_get_type ()) +#define SN_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SN_TYPE_ITEM, SnItem)) +#define SN_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SN_TYPE_ITEM, SnItemClass)) +#define SN_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SN_TYPE_ITEM)) +#define SN_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SN_TYPE_ITEM)) +#define SN_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SN_TYPE_ITEM, SnItemClass)) typedef enum { @@ -31,6 +35,17 @@ typedef enum SN_ITEM_ORIENTATION_VERTICAL } SnItemOrientation; +typedef struct _SnItem SnItem; +typedef struct _SnItemPrivate SnItemPrivate; +typedef struct _SnItemClass SnItemClass; + +struct _SnItem +{ + GtkButtonClass parent_instance; + + SnItemPrivate *priv; +}; + struct _SnItemClass { GtkButtonClass parent_class; @@ -60,6 +75,7 @@ struct _SnItemClass SnItemOrientation orientation); }; +GType sn_item_get_type (void); const gchar *sn_item_get_bus_name (SnItem *item); const gchar *sn_item_get_object_path (SnItem *item); |