From fb334b1b15b3ec67fc5da33f164aa8f91add177e Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 26 May 2019 15:34:31 -0400 Subject: switch: Make final This should not be subclassed. --- gtk/gtkswitch.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'gtk/gtkswitch.c') diff --git a/gtk/gtkswitch.c b/gtk/gtkswitch.c index c0bc4ecc4f..71f97024e1 100644 --- a/gtk/gtkswitch.c +++ b/gtk/gtkswitch.c @@ -73,6 +73,9 @@ #include "fallback-c89.c" +typedef struct _GtkSwitchPrivate GtkSwitchPrivate; +typedef struct _GtkSwitchClass GtkSwitchClass; + struct _GtkSwitchPrivate { GtkActionHelper *action_helper; @@ -91,7 +94,27 @@ struct _GtkSwitchPrivate GtkWidget *off_image; GtkWidget *slider; }; -typedef struct _GtkSwitchPrivate GtkSwitchPrivate; + +/** + * GtkSwitch: + * + * The #GtkSwitch-struct contains private + * data and it should only be accessed using the provided API. + */ +struct _GtkSwitch +{ + /*< private >*/ + GtkWidget parent_instance; +}; + +struct _GtkSwitchClass +{ + GtkWidgetClass parent_class; + + void (* activate) (GtkSwitch *sw); + + gboolean (* state_set) (GtkSwitch *sw, gboolean state); +}; enum { -- cgit v1.2.1