[balsa] ab-window: Use modern macros to declare and define
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa] ab-window: Use modern macros to declare and define
- Date: Thu, 18 Jul 2019 23:36:13 +0000 (UTC)
commit 584403517ba5c504bc6099f0764aa51ede1923df
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Thu Jul 18 19:24:52 2019 -0400
ab-window: Use modern macros to declare and define
* src/ab-window.c: use G_DEFINE_TYPE();
* src/ab-window.h: use G_DECLARE_FINAL_TYPE().
ChangeLog | 7 +++++++
src/ab-window.c | 60 +++++++++++++++++++++++++++++++--------------------------
src/ab-window.h | 50 +++++++----------------------------------------
3 files changed, 47 insertions(+), 70 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 000e3868c..85de36249 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2019-07-18 Peter Bloomfield <pbloomfield bellsouth net>
+
+ ab-window: Use modern macros to declare and define.
+
+ * src/ab-window.c: use G_DEFINE_TYPE();
+ * src/ab-window.h: use G_DECLARE_FINAL_TYPE().
+
2019-07-17 Peter Bloomfield <pbloomfield bellsouth net>
* libbalsa/mailbox_maildir.c
diff --git a/src/ab-window.c b/src/ab-window.c
index 6852a0bbb..f2408ccd8 100644
--- a/src/ab-window.c
+++ b/src/ab-window.c
@@ -1,6 +1,6 @@
/* -*-mode:c; c-style:k&r; c-basic-offset:4; -*- */
/* Balsa E-Mail Client
- * Copyright (C) 1997-2016 Stuart Parmenter and others,
+ * Copyright (C) 1997-2019 Stuart Parmenter and others,
* See the file AUTHORS for a list.
*
* This program is free software; you can redistribute it and/or modify
@@ -38,10 +38,6 @@ enum {
N_COLUMNS
};
-/* Object system functions ... */
-static void balsa_ab_window_init(BalsaAbWindow *ab);
-static void balsa_ab_window_class_init(BalsaAbWindowClass *klass);
-
/* Loading ... */
static void balsa_ab_window_load_cb(LibBalsaAddressBook *libbalsa_ab,
LibBalsaAddress *address,
@@ -86,30 +82,40 @@ struct _BalsaAbWindowClass
GtkDialogClass parent_class;
};
-GType
-balsa_ab_window_get_type(void)
+struct _BalsaAbWindow
{
- static GType ab_type = 0;
-
- if ( !ab_type ) {
- static const GTypeInfo ab_info = {
- sizeof(BalsaAbWindowClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) balsa_ab_window_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof(BalsaAbWindow),
- 0, /* n_preallocs */
- (GInstanceInitFunc) balsa_ab_window_init
- };
- ab_type =
- g_type_register_static(GTK_TYPE_DIALOG, "BalsaAbWindow",
- &ab_info, 0);
- }
- return ab_type;
-}
+ GtkDialog parent;
+
+ /* Are we composing? */
+ gboolean composing;
+
+ /* The current address book */
+ LibBalsaAddressBook *current_address_book;
+
+ /* the filter entry */
+ GtkWidget *filter_entry;
+
+ /* The address list */
+ GtkWidget *address_list;
+
+ /* The send to list */
+ GtkWidget *recipient_list;
+
+ /* Radio buttons for dist list mode */
+ GtkWidget *single_address_mode_radio;
+ GtkWidget *dist_address_mode_radio;
+ guint toggle_handler_id;
+
+ /* Stuff to hide when not in compose mode */
+ GtkWidget *send_to_label;
+ GtkWidget *send_to_list;
+ GtkWidget *arrow_box;
+
+ /* The address book list */
+ GtkWidget *combo_box;
+};
+G_DEFINE_TYPE(BalsaAbWindow, balsa_ab_window, GTK_TYPE_DIALOG)
GtkWidget *
balsa_ab_window_new(gboolean composing, GtkWindow* parent)
diff --git a/src/ab-window.h b/src/ab-window.h
index a9ec98931..3cfbc70b1 100644
--- a/src/ab-window.h
+++ b/src/ab-window.h
@@ -1,6 +1,6 @@
/* -*-mode:c; c-style:k&r; c-basic-offset:4; -*- */
/* Balsa E-Mail Client
- * Copyright (C) 1997-2016 Stuart Parmenter and others,
+ * Copyright (C) 1997-2019 Stuart Parmenter and others,
* See the file AUTHORS for a list.
*
* This program is free software; you can redistribute it and/or modify
@@ -23,50 +23,14 @@
#include <gtk/gtk.h>
#include <libbalsa.h>
-#define BALSA_TYPE_AB_WINDOW (balsa_ab_window_get_type ())
-#define BALSA_AB_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BALSA_TYPE_AB_WINDOW,
BalsaAbWindow))
-#define BALSA_AB_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BALSA_TYPE_AB_WINDOW,
BalsaAbWindowClass))
-#define BALSA_IS_AB_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BALSA_TYPE_AB_WINDOW))
-#define BALSA_IS_AB_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BALSA_TYPE_AB_WINDOW))
+#define BALSA_TYPE_AB_WINDOW (balsa_ab_window_get_type())
+G_DECLARE_FINAL_TYPE(BalsaAbWindow,
+ balsa_ab_window,
+ BALSA,
+ AB_WINDOW,
+ GtkDialog)
-typedef struct _BalsaAbWindow BalsaAbWindow;
-typedef struct _BalsaAbWindowClass BalsaAbWindowClass;
-
-struct _BalsaAbWindow
-{
- GtkDialog parent;
-
- /* Are we composing? */
- gboolean composing;
-
- /* The current address book */
- LibBalsaAddressBook *current_address_book;
-
- /* the filter entry */
- GtkWidget *filter_entry;
-
- /* The address list */
- GtkWidget *address_list;
-
- /* The send to list */
- GtkWidget *recipient_list;
-
- /* Radio buttons for dist list mode */
- GtkWidget *single_address_mode_radio;
- GtkWidget *dist_address_mode_radio;
- guint toggle_handler_id;
-
- /* Stuff to hide when not in compose mode */
- GtkWidget *send_to_label;
- GtkWidget *send_to_list;
- GtkWidget *arrow_box;
-
- /* The address book list */
- GtkWidget *combo_box;
-};
-
-GType balsa_ab_window_get_type(void);
GtkWidget *balsa_ab_window_new(gboolean composing, GtkWindow* parent);
gchar *balsa_ab_window_get_recipients(BalsaAbWindow *ab);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]