[gtk] page setup dialog: Drop the priv pointer



commit 210a4393656b2de387e904010f00dc786199dbd1
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun May 26 19:43:41 2019 +0000

    page setup dialog: Drop the priv pointer

 gtk/gtkpagesetupunixdialog.c | 45 ++++++++++++++++++++++----------------------
 1 file changed, 22 insertions(+), 23 deletions(-)
---
diff --git a/gtk/gtkpagesetupunixdialog.c b/gtk/gtkpagesetupunixdialog.c
index 61315100b7..7c5655c7c7 100644
--- a/gtk/gtkpagesetupunixdialog.c
+++ b/gtk/gtkpagesetupunixdialog.c
@@ -66,8 +66,6 @@ typedef struct _GtkPageSetupUnixDialogPrivate  GtkPageSetupUnixDialogPrivate;
 struct _GtkPageSetupUnixDialog
 {
   GtkDialog parent_instance;
-
-  GtkPageSetupUnixDialogPrivate *priv;
 };
 
 struct _GtkPageSetupUnixDialogClass
@@ -104,6 +102,7 @@ struct _GtkPageSetupUnixDialogPrivate
   gchar *waiting_for_printer;
 };
 
+
 /* Keep these in line with GtkListStores defined in gtkpagesetupunixprintdialog.ui */
 enum {
   PRINTER_LIST_COL_NAME,
@@ -201,7 +200,7 @@ gtk_page_setup_unix_dialog_init (GtkPageSetupUnixDialog *dialog)
   GtkTreeIter iter;
   gchar *tmp;
 
-  priv = dialog->priv = gtk_page_setup_unix_dialog_get_instance_private (dialog);
+  priv = gtk_page_setup_unix_dialog_get_instance_private (dialog);
 
   priv->print_backends = NULL;
 
@@ -241,7 +240,7 @@ static void
 gtk_page_setup_unix_dialog_finalize (GObject *object)
 {
   GtkPageSetupUnixDialog *dialog = GTK_PAGE_SETUP_UNIX_DIALOG (object);
-  GtkPageSetupUnixDialogPrivate *priv = dialog->priv;
+  GtkPageSetupUnixDialogPrivate *priv = gtk_page_setup_unix_dialog_get_instance_private (dialog);
   GtkPrintBackend *backend;
   GList *node;
 
@@ -304,7 +303,7 @@ printer_added_cb (GtkPrintBackend        *backend,
                   GtkPrinter             *printer,
                   GtkPageSetupUnixDialog *dialog)
 {
-  GtkPageSetupUnixDialogPrivate *priv = dialog->priv;
+  GtkPageSetupUnixDialogPrivate *priv = gtk_page_setup_unix_dialog_get_instance_private (dialog);
   GtkTreeIter iter;
   gchar *str;
   const gchar *location;
@@ -346,7 +345,7 @@ printer_removed_cb (GtkPrintBackend        *backend,
                     GtkPrinter             *printer,
                     GtkPageSetupUnixDialog *dialog)
 {
-  GtkPageSetupUnixDialogPrivate *priv = dialog->priv;
+  GtkPageSetupUnixDialogPrivate *priv = gtk_page_setup_unix_dialog_get_instance_private (dialog);
   GtkTreeIter *iter;
 
   iter = g_object_get_data (G_OBJECT (printer), "gtk-print-tree-iter");
@@ -359,7 +358,7 @@ printer_status_cb (GtkPrintBackend        *backend,
                    GtkPrinter             *printer,
                    GtkPageSetupUnixDialog *dialog)
 {
-  GtkPageSetupUnixDialogPrivate *priv = dialog->priv;
+  GtkPageSetupUnixDialogPrivate *priv = gtk_page_setup_unix_dialog_get_instance_private (dialog);
   GtkTreeIter *iter;
   gchar *str;
   const gchar *location;
@@ -417,7 +416,7 @@ printer_list_initialize (GtkPageSetupUnixDialog *dialog,
 static void
 load_print_backends (GtkPageSetupUnixDialog *dialog)
 {
-  GtkPageSetupUnixDialogPrivate *priv = dialog->priv;
+  GtkPageSetupUnixDialogPrivate *priv = gtk_page_setup_unix_dialog_get_instance_private (dialog);
   GList *node;
 
   if (g_module_supported ())
@@ -441,7 +440,7 @@ paper_size_row_is_separator (GtkTreeModel *model,
 static GtkPageSetup *
 get_current_page_setup (GtkPageSetupUnixDialog *dialog)
 {
-  GtkPageSetupUnixDialogPrivate *priv = dialog->priv;
+  GtkPageSetupUnixDialogPrivate *priv = gtk_page_setup_unix_dialog_get_instance_private (dialog);
   GtkPageSetup *current_page_setup;
   GtkComboBox *combo_box;
   GtkTreeIter iter;
@@ -490,7 +489,7 @@ set_paper_size (GtkPageSetupUnixDialog *dialog,
                 gboolean                size_only,
                 gboolean                add_item)
 {
-  GtkPageSetupUnixDialogPrivate *priv = dialog->priv;
+  GtkPageSetupUnixDialogPrivate *priv = gtk_page_setup_unix_dialog_get_instance_private (dialog);
   GtkTreeModel *model;
   GtkTreeIter iter;
   GtkPageSetup *list_page_setup;
@@ -541,7 +540,7 @@ set_paper_size (GtkPageSetupUnixDialog *dialog,
 static void
 fill_custom_paper_sizes (GtkPageSetupUnixDialog *dialog)
 {
-  GtkPageSetupUnixDialogPrivate *priv = dialog->priv;
+  GtkPageSetupUnixDialogPrivate *priv = gtk_page_setup_unix_dialog_get_instance_private (dialog);
   GtkTreeIter iter, paper_iter;
   GtkTreeModel *model;
 
@@ -580,7 +579,7 @@ static void
 fill_paper_sizes_from_printer (GtkPageSetupUnixDialog *dialog,
                                GtkPrinter             *printer)
 {
-  GtkPageSetupUnixDialogPrivate *priv = dialog->priv;
+  GtkPageSetupUnixDialogPrivate *priv = gtk_page_setup_unix_dialog_get_instance_private (dialog);
   GList *list, *l;
   GtkPageSetup *current_page_setup, *page_setup;
   GtkPaperSize *paper_size;
@@ -645,7 +644,7 @@ printer_changed_finished_callback (GtkPrinter             *printer,
                                    gboolean                success,
                                    GtkPageSetupUnixDialog *dialog)
 {
-  GtkPageSetupUnixDialogPrivate *priv = dialog->priv;
+  GtkPageSetupUnixDialogPrivate *priv = gtk_page_setup_unix_dialog_get_instance_private (dialog);
 
   g_signal_handler_disconnect (priv->request_details_printer,
                                priv->request_details_tag);
@@ -662,7 +661,7 @@ static void
 printer_changed_callback (GtkComboBox            *combo_box,
                           GtkPageSetupUnixDialog *dialog)
 {
-  GtkPageSetupUnixDialogPrivate *priv = dialog->priv;
+  GtkPageSetupUnixDialogPrivate *priv = gtk_page_setup_unix_dialog_get_instance_private (dialog);
   GtkPrinter *printer;
   GtkTreeIter iter;
 
@@ -755,13 +754,13 @@ custom_paper_dialog_response_cb (GtkDialog *custom_paper_dialog,
                                  gint       response_id,
                                  gpointer   user_data)
 {
-  GtkPageSetupUnixDialog *page_setup_dialog = GTK_PAGE_SETUP_UNIX_DIALOG (user_data);
-  GtkPageSetupUnixDialogPrivate *priv = page_setup_dialog->priv;
+  GtkPageSetupUnixDialog *dialog = GTK_PAGE_SETUP_UNIX_DIALOG (user_data);
+  GtkPageSetupUnixDialogPrivate *priv = gtk_page_setup_unix_dialog_get_instance_private (dialog);
 
   _gtk_print_load_custom_papers (priv->custom_paper_list);
 
   /* Update printer page list */
-  printer_changed_callback (GTK_COMBO_BOX (priv->printer_combo), page_setup_dialog);
+  printer_changed_callback (GTK_COMBO_BOX (priv->printer_combo), dialog);
 
   gtk_widget_destroy (GTK_WIDGET (custom_paper_dialog));
 }
@@ -770,7 +769,7 @@ static void
 paper_size_changed (GtkComboBox            *combo_box,
                     GtkPageSetupUnixDialog *dialog)
 {
-  GtkPageSetupUnixDialogPrivate *priv = dialog->priv;
+  GtkPageSetupUnixDialogPrivate *priv = gtk_page_setup_unix_dialog_get_instance_private (dialog);
   GtkTreeIter iter;
   GtkPageSetup *page_setup, *last_page_setup;
   GtkUnit unit;
@@ -920,7 +919,7 @@ gtk_page_setup_unix_dialog_new (const gchar *title,
 static GtkPageOrientation
 get_orientation (GtkPageSetupUnixDialog *dialog)
 {
-  GtkPageSetupUnixDialogPrivate *priv = dialog->priv;
+  GtkPageSetupUnixDialogPrivate *priv = gtk_page_setup_unix_dialog_get_instance_private (dialog);
 
   if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->portrait_radio)))
     return GTK_PAGE_ORIENTATION_PORTRAIT;
@@ -935,7 +934,7 @@ static void
 set_orientation (GtkPageSetupUnixDialog *dialog,
                  GtkPageOrientation      orientation)
 {
-  GtkPageSetupUnixDialogPrivate *priv = dialog->priv;
+  GtkPageSetupUnixDialogPrivate *priv = gtk_page_setup_unix_dialog_get_instance_private (dialog);
 
   switch (orientation)
     {
@@ -999,7 +998,7 @@ static gboolean
 set_active_printer (GtkPageSetupUnixDialog *dialog,
                     const gchar            *printer_name)
 {
-  GtkPageSetupUnixDialogPrivate *priv = dialog->priv;
+  GtkPageSetupUnixDialogPrivate *priv = gtk_page_setup_unix_dialog_get_instance_private (dialog);
   GtkTreeModel *model;
   GtkTreeIter iter;
   GtkPrinter *printer;
@@ -1043,7 +1042,7 @@ void
 gtk_page_setup_unix_dialog_set_print_settings (GtkPageSetupUnixDialog *dialog,
                                                GtkPrintSettings       *print_settings)
 {
-  GtkPageSetupUnixDialogPrivate *priv = dialog->priv;
+  GtkPageSetupUnixDialogPrivate *priv = gtk_page_setup_unix_dialog_get_instance_private (dialog);
   const gchar *format_for_printer;
 
   if (priv->print_settings == print_settings) return;
@@ -1079,7 +1078,7 @@ gtk_page_setup_unix_dialog_set_print_settings (GtkPageSetupUnixDialog *dialog,
 GtkPrintSettings *
 gtk_page_setup_unix_dialog_get_print_settings (GtkPageSetupUnixDialog *dialog)
 {
-  GtkPageSetupUnixDialogPrivate *priv = dialog->priv;
+  GtkPageSetupUnixDialogPrivate *priv = gtk_page_setup_unix_dialog_get_instance_private (dialog);
 
   return priv->print_settings;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]