diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-05-19 20:34:13 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-05-19 20:34:13 +0000 |
commit | 2dec0b8d7f12dae277962c33aef11a62284576b6 (patch) | |
tree | afdd780dc4f362ecd3f470eb64b3f9b850af6f52 /gtk | |
parent | 8c1bce72d53cec1879e0797e6ab306ce48f83c7c (diff) | |
download | gtk+-2dec0b8d7f12dae277962c33aef11a62284576b6.tar.gz |
volume button: Don't allow subclassing
If you want to subclass, there's GtkScaleButton.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkscalebutton.h | 8 | ||||
-rw-r--r-- | gtk/gtkvolumebutton.c | 7 | ||||
-rw-r--r-- | gtk/gtkvolumebutton.h | 15 |
3 files changed, 10 insertions, 20 deletions
diff --git a/gtk/gtkscalebutton.h b/gtk/gtkscalebutton.h index 1fc7ecdab2..c9dd397594 100644 --- a/gtk/gtkscalebutton.h +++ b/gtk/gtkscalebutton.h @@ -65,11 +65,9 @@ struct _GtkScaleButtonClass void (* value_changed) (GtkScaleButton *button, gdouble value); - /* Padding for future expansion */ - void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); - void (*_gtk_reserved4) (void); + /*< private >*/ + + gpointer padding[8]; }; GDK_AVAILABLE_IN_ALL diff --git a/gtk/gtkvolumebutton.c b/gtk/gtkvolumebutton.c index 71b5fc1208..5d805b282b 100644 --- a/gtk/gtkvolumebutton.c +++ b/gtk/gtkvolumebutton.c @@ -45,6 +45,13 @@ * icons, tooltips and accessible labels. */ +typedef struct _GtkVolumeButtonClass GtkVolumeButtonClass; + +struct _GtkVolumeButtonClass +{ + GtkScaleButtonClass parent_class; +}; + #define EPSILON (1e-10) static const gchar * const icons[] = diff --git a/gtk/gtkvolumebutton.h b/gtk/gtkvolumebutton.h index 19b6076787..57f28378b9 100644 --- a/gtk/gtkvolumebutton.h +++ b/gtk/gtkvolumebutton.h @@ -38,30 +38,15 @@ G_BEGIN_DECLS #define GTK_TYPE_VOLUME_BUTTON (gtk_volume_button_get_type ()) #define GTK_VOLUME_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_VOLUME_BUTTON, GtkVolumeButton)) -#define GTK_VOLUME_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_VOLUME_BUTTON, GtkVolumeButtonClass)) #define GTK_IS_VOLUME_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_VOLUME_BUTTON)) -#define GTK_IS_VOLUME_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_VOLUME_BUTTON)) -#define GTK_VOLUME_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_VOLUME_BUTTON, GtkVolumeButtonClass)) typedef struct _GtkVolumeButton GtkVolumeButton; -typedef struct _GtkVolumeButtonClass GtkVolumeButtonClass; struct _GtkVolumeButton { GtkScaleButton parent; }; -struct _GtkVolumeButtonClass -{ - GtkScaleButtonClass parent_class; - - /* Padding for future expansion */ - void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); - void (*_gtk_reserved4) (void); -}; - GDK_AVAILABLE_IN_ALL GType gtk_volume_button_get_type (void) G_GNUC_CONST; GDK_AVAILABLE_IN_ALL |