summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2022-03-16 14:38:24 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2022-03-16 14:38:24 +0000
commit99cfaf622d70da48e694ce66aa564dff1c08d62b (patch)
tree61870d57c3acb9997b60599fc639c3cb503333de
parent80617f01c35a32160490ce3fb84283bbd614bd8c (diff)
downloadgtk+-ebassi/final-types.tar.gz
Make GtkPasswordEntry a true final typeebassi/final-types
Use G_DECLARE_FINAL_TYPE in the header, and G_DEFINE_FINAL_TYPE in the source.
-rw-r--r--gtk/gtkpasswordentry.c8
-rw-r--r--gtk/gtkpasswordentry.h9
2 files changed, 6 insertions, 11 deletions
diff --git a/gtk/gtkpasswordentry.c b/gtk/gtkpasswordentry.c
index b6a6dea51b..6526fd3e9a 100644
--- a/gtk/gtkpasswordentry.c
+++ b/gtk/gtkpasswordentry.c
@@ -104,7 +104,7 @@ enum {
PROP_ACTIVATES_DEFAULT,
PROP_SHOW_PEEK_ICON,
PROP_EXTRA_MENU,
- NUM_PROPERTIES
+ NUM_PROPERTIES
};
static GParamSpec *props[NUM_PROPERTIES] = { NULL, };
@@ -112,9 +112,9 @@ static GParamSpec *props[NUM_PROPERTIES] = { NULL, };
static void gtk_password_entry_editable_init (GtkEditableInterface *iface);
static void gtk_password_entry_accessible_init (GtkAccessibleInterface *iface);
-G_DEFINE_TYPE_WITH_CODE (GtkPasswordEntry, gtk_password_entry, GTK_TYPE_WIDGET,
- G_IMPLEMENT_INTERFACE (GTK_TYPE_ACCESSIBLE, gtk_password_entry_accessible_init)
- G_IMPLEMENT_INTERFACE (GTK_TYPE_EDITABLE, gtk_password_entry_editable_init))
+G_DEFINE_FINAL_TYPE_WITH_CODE (GtkPasswordEntry, gtk_password_entry, GTK_TYPE_WIDGET,
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_ACCESSIBLE, gtk_password_entry_accessible_init)
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_EDITABLE, gtk_password_entry_editable_init))
static void
caps_lock_state_changed (GdkDevice *device,
diff --git a/gtk/gtkpasswordentry.h b/gtk/gtkpasswordentry.h
index 43a2222660..55beb13002 100644
--- a/gtk/gtkpasswordentry.h
+++ b/gtk/gtkpasswordentry.h
@@ -29,15 +29,10 @@
G_BEGIN_DECLS
-#define GTK_TYPE_PASSWORD_ENTRY (gtk_password_entry_get_type ())
-#define GTK_PASSWORD_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PASSWORD_ENTRY, GtkPasswordEntry))
-#define GTK_IS_PASSWORD_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PASSWORD_ENTRY))
-
-typedef struct _GtkPasswordEntry GtkPasswordEntry;
-typedef struct _GtkPasswordEntryClass GtkPasswordEntryClass;
+#define GTK_TYPE_PASSWORD_ENTRY (gtk_password_entry_get_type ())
GDK_AVAILABLE_IN_ALL
-GType gtk_password_entry_get_type (void) G_GNUC_CONST;
+G_DECLARE_FINAL_TYPE (GtkPasswordEntry, gtk_password_entry, GTK, PASSWORD_ENTRY, GtkWidget)
GDK_AVAILABLE_IN_ALL
GtkWidget * gtk_password_entry_new (void);