[gtk/ebassi/final-types: 3/3] Make GtkPasswordEntry a true final type
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/ebassi/final-types: 3/3] Make GtkPasswordEntry a true final type
- Date: Wed, 16 Mar 2022 14:47:03 +0000 (UTC)
commit 99cfaf622d70da48e694ce66aa564dff1c08d62b
Author: Emmanuele Bassi <ebassi gnome org>
Date: Wed Mar 16 14:38:24 2022 +0000
Make GtkPasswordEntry a true final type
Use G_DECLARE_FINAL_TYPE in the header, and G_DEFINE_FINAL_TYPE in the
source.
gtk/gtkpasswordentry.c | 8 ++++----
gtk/gtkpasswordentry.h | 9 ++-------
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]