From 96eefd49fa7ec1ed57ee987ac702bd4130420678 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 26 May 2019 15:33:10 -0400 Subject: [PATCH] icon theme: Make final Nobody should subclass GtkIconTheme or GtkIconInfo. --- gtk/gtkicontheme.c | 36 ++++++++++++++++++++++++++++ gtk/gtkicontheme.h | 58 ---------------------------------------------- 2 files changed, 36 insertions(+), 58 deletions(-) diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index d41d31310e..d9fc68054b 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -130,6 +130,29 @@ typedef enum #define DEBUG_CACHE(args) #endif +typedef struct _GtkIconInfoClass GtkIconInfoClass; +typedef struct _GtkIconThemeClass GtkIconThemeClass; +typedef struct _GtkIconThemePrivate GtkIconThemePrivate; + +/** + * GtkIconTheme: + * + * Acts as a database of information about an icon theme. + * Normally, you retrieve the icon theme for a particular + * display using gtk_icon_theme_get_for_display() and it + * will contain information about current icon theme for + * that display, but you can also create a new #GtkIconTheme + * object and set the icon theme name explicitly using + * gtk_icon_theme_set_custom_theme(). + */ +struct _GtkIconTheme +{ + /*< private >*/ + GObject parent_instance; + + GtkIconThemePrivate *priv; +}; + struct _GtkIconThemePrivate { GHashTable *info_cache; @@ -162,6 +185,13 @@ struct _GtkIconThemePrivate gulong theme_changed_idle; }; +struct _GtkIconThemeClass +{ + GObjectClass parent_class; + + void (* changed) (GtkIconTheme *icon_theme); +}; + typedef struct { gchar **icon_names; gint size; @@ -186,6 +216,12 @@ struct _GtkIconInfoClass GObjectClass parent_class; }; +/** + * GtkIconInfo: + * + * Contains information found when looking up an icon in + * an icon theme. + */ struct _GtkIconInfo { GObject parent_instance; diff --git a/gtk/gtkicontheme.h b/gtk/gtkicontheme.h index 057d2fe6f3..de0cd2308d 100644 --- a/gtk/gtkicontheme.h +++ b/gtk/gtkicontheme.h @@ -31,72 +31,14 @@ G_BEGIN_DECLS #define GTK_TYPE_ICON_INFO (gtk_icon_info_get_type ()) #define GTK_ICON_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ICON_INFO, GtkIconInfo)) -#define GTK_ICON_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ICON_INFO, GtkIconInfoClass)) #define GTK_IS_ICON_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ICON_INFO)) -#define GTK_IS_ICON_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ICON_INFO)) -#define GTK_ICON_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ICON_INFO, GtkIconInfoClass)) #define GTK_TYPE_ICON_THEME (gtk_icon_theme_get_type ()) #define GTK_ICON_THEME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ICON_THEME, GtkIconTheme)) -#define GTK_ICON_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ICON_THEME, GtkIconThemeClass)) #define GTK_IS_ICON_THEME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ICON_THEME)) -#define GTK_IS_ICON_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ICON_THEME)) -#define GTK_ICON_THEME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ICON_THEME, GtkIconThemeClass)) -/** - * GtkIconInfo: - * - * Contains information found when looking up an icon in - * an icon theme. - */ typedef struct _GtkIconInfo GtkIconInfo; -typedef struct _GtkIconInfoClass GtkIconInfoClass; typedef struct _GtkIconTheme GtkIconTheme; -typedef struct _GtkIconThemeClass GtkIconThemeClass; -typedef struct _GtkIconThemePrivate GtkIconThemePrivate; - -/** - * GtkIconTheme: - * - * Acts as a database of information about an icon theme. - * Normally, you retrieve the icon theme for a particular - * display using gtk_icon_theme_get_for_display() and it - * will contain information about current icon theme for - * that display, but you can also create a new #GtkIconTheme - * object and set the icon theme name explicitly using - * gtk_icon_theme_set_custom_theme(). - */ -struct _GtkIconTheme -{ - /*< private >*/ - GObject parent_instance; - - GtkIconThemePrivate *priv; -}; - -/** - * GtkIconThemeClass: - * @parent_class: The parent class. - * @changed: Signal emitted when the current icon theme is switched or - * GTK+ detects that a change has occurred in the contents of the - * current icon theme. - */ -struct _GtkIconThemeClass -{ - GObjectClass parent_class; - - /*< public >*/ - - void (* changed) (GtkIconTheme *icon_theme); - - /*< private >*/ - - /* Padding for future expansion */ - void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); - void (*_gtk_reserved4) (void); -}; /** * GtkIconLookupFlags: