summaryrefslogtreecommitdiff
path: root/gtk/gtkprintunixdialog.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-05-26 20:08:01 +0000
committerMatthias Clasen <mclasen@redhat.com>2019-05-26 20:08:01 +0000
commitc0eea6c5de0fbd61b815be4b7773237479d4d13f (patch)
tree9469d7047d64ae7a8d07d808829f48717389e492 /gtk/gtkprintunixdialog.c
parentbb46cc6470dd61f6c8dd6a1ad987d7e7391dd334 (diff)
downloadgtk+-c0eea6c5de0fbd61b815be4b7773237479d4d13f.tar.gz
print dialog: Drop the priv pointer
Diffstat (limited to 'gtk/gtkprintunixdialog.c')
-rw-r--r--gtk/gtkprintunixdialog.c208
1 files changed, 114 insertions, 94 deletions
diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c
index dd6b14711b..6ef2682c3a 100644
--- a/gtk/gtkprintunixdialog.c
+++ b/gtk/gtkprintunixdialog.c
@@ -267,9 +267,6 @@ typedef struct GtkPrintUnixDialogPrivate GtkPrintUnixDialogPrivate;
struct _GtkPrintUnixDialog
{
GtkDialog parent_instance;
-
- /*< private >*/
- GtkPrintUnixDialogPrivate *priv;
};
struct _GtkPrintUnixDialogClass
@@ -399,7 +396,7 @@ static gboolean
is_default_printer (GtkPrintUnixDialog *dialog,
GtkPrinter *printer)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
if (priv->format_for_printer)
return strcmp (priv->format_for_printer,
@@ -616,7 +613,7 @@ error_dialogs (GtkPrintUnixDialog *print_dialog,
gint print_dialog_response_id,
gpointer data)
{
- GtkPrintUnixDialogPrivate *priv = print_dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (print_dialog);
GtkPrinterOption *option = NULL;
GtkPrinter *printer = NULL;
GtkWindow *toplevel = NULL;
@@ -718,8 +715,7 @@ gtk_print_unix_dialog_init (GtkPrintUnixDialog *dialog)
GtkTreeSortable *sort;
GtkWidget *widget;
- dialog->priv = gtk_print_unix_dialog_get_instance_private (dialog);
- priv = dialog->priv;
+ priv = gtk_print_unix_dialog_get_instance_private (dialog);
priv->print_backends = NULL;
priv->current_page = -1;
@@ -854,7 +850,7 @@ static void
disconnect_printer_details_request (GtkPrintUnixDialog *dialog,
gboolean details_failed)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
if (priv->request_details_tag)
{
@@ -885,7 +881,7 @@ static void
gtk_print_unix_dialog_finalize (GObject *object)
{
GtkPrintUnixDialog *dialog = GTK_PRINT_UNIX_DIALOG (object);
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
GtkPrintBackend *backend;
GList *node;
@@ -938,7 +934,7 @@ printer_removed_cb (GtkPrintBackend *backend,
GtkPrinter *printer,
GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
GtkTreeIter *iter;
iter = g_object_get_data (G_OBJECT (printer), "gtk-print-tree-iter");
@@ -958,8 +954,10 @@ gtk_print_unix_dialog_buildable_get_internal_child (GtkBuildable *buildable,
GtkBuilder *builder,
const gchar *childname)
{
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (GTK_PRINT_UNIX_DIALOG (buildable));
+
if (strcmp (childname, "notebook") == 0)
- return G_OBJECT (GTK_PRINT_UNIX_DIALOG (buildable)->priv->notebook);
+ return G_OBJECT (priv->notebook);
return parent_buildable_iface->get_internal_child (buildable, builder, childname);
}
@@ -992,7 +990,7 @@ printer_status_cb (GtkPrintBackend *backend,
GtkPrinter *printer,
GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
GtkTreeIter *iter;
GtkTreeSelection *selection;
GIcon *icon;
@@ -1028,7 +1026,7 @@ printer_added_cb (GtkPrintBackend *backend,
GtkPrinter *printer,
GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
GtkTreeIter iter, filter_iter;
GtkTreeSelection *selection;
GtkTreePath *path;
@@ -1116,7 +1114,7 @@ printer_list_initialize (GtkPrintUnixDialog *dialog,
static void
load_print_backends (GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
GList *node;
if (g_module_supported ())
@@ -1174,7 +1172,7 @@ gtk_print_unix_dialog_get_property (GObject *object,
GParamSpec *pspec)
{
GtkPrintUnixDialog *dialog = GTK_PRINT_UNIX_DIALOG (object);
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
switch (prop_id)
{
@@ -1215,7 +1213,7 @@ is_printer_active (GtkTreeModel *model,
{
gboolean result;
GtkPrinter *printer;
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
gtk_tree_model_get (model, iter,
PRINTER_LIST_COL_PRINTER_OBJ, &printer,
@@ -1331,7 +1329,7 @@ setup_option (GtkPrintUnixDialog *dialog,
const gchar *option_name,
GtkPrinterOptionWidget *widget)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
GtkPrinterOption *option;
option = gtk_printer_option_set_lookup (priv->options, option_name);
@@ -1459,7 +1457,7 @@ setup_page_table (GtkPrinterOptionSet *options,
static void
update_print_at_option (GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
GtkPrinterOption *option;
option = gtk_printer_option_set_lookup (priv->options, "gtk-print-time");
@@ -1491,7 +1489,7 @@ update_print_at_option (GtkPrintUnixDialog *dialog)
static gboolean
setup_print_at (GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
GtkPrinterOption *option;
option = gtk_printer_option_set_lookup (priv->options, "gtk-print-time");
@@ -1540,7 +1538,7 @@ setup_print_at (GtkPrintUnixDialog *dialog)
static void
update_dialog_from_settings (GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
GList *groups, *l;
gchar *group;
GtkWidget *table, *frame;
@@ -1662,8 +1660,8 @@ update_dialog_from_settings (GtkPrintUnixDialog *dialog)
static void
update_dialog_from_capabilities (GtkPrintUnixDialog *dialog)
{
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
GtkPrintCapabilities caps;
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
gboolean can_collate;
const gchar *copies;
GtkWidget *button;
@@ -1722,7 +1720,7 @@ set_paper_size (GtkPrintUnixDialog *dialog,
gboolean size_only,
gboolean add_item)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
GtkTreeModel *model;
GtkTreeIter iter;
GtkPageSetup *list_page_setup;
@@ -1784,7 +1782,7 @@ set_paper_size (GtkPrintUnixDialog *dialog,
static void
fill_custom_paper_sizes (GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
GtkTreeIter iter, paper_iter;
GtkTreeModel *model;
@@ -1823,7 +1821,7 @@ static void
fill_paper_sizes (GtkPrintUnixDialog *dialog,
GtkPrinter *printer)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
GList *list, *l;
GtkPageSetup *page_setup;
GtkPaperSize *paper_size;
@@ -1889,7 +1887,7 @@ update_paper_sizes (GtkPrintUnixDialog *dialog)
static void
mark_conflicts (GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
GtkPrinter *printer;
gboolean have_conflict;
@@ -1922,7 +1920,7 @@ static gboolean
mark_conflicts_callback (gpointer data)
{
GtkPrintUnixDialog *dialog = data;
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
priv->mark_conflicts_id = 0;
@@ -1934,7 +1932,7 @@ mark_conflicts_callback (gpointer data)
static void
unschedule_idle_mark_conflicts (GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
if (priv->mark_conflicts_id != 0)
{
@@ -1946,7 +1944,7 @@ unschedule_idle_mark_conflicts (GtkPrintUnixDialog *dialog)
static void
schedule_idle_mark_conflicts (GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
if (priv->mark_conflicts_id != 0)
return;
@@ -1958,7 +1956,7 @@ schedule_idle_mark_conflicts (GtkPrintUnixDialog *dialog)
static void
options_changed_cb (GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
schedule_idle_mark_conflicts (dialog);
@@ -1984,7 +1982,7 @@ extension_point_clear_children (GtkContainer *container)
static void
clear_per_printer_ui (GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
if (priv->finishing_table == NULL)
return;
@@ -2005,7 +2003,7 @@ printer_details_acquired (GtkPrinter *printer,
gboolean success,
GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
disconnect_printer_details_request (dialog, !success);
@@ -2022,7 +2020,7 @@ static void
selected_printer_changed (GtkTreeSelection *selection,
GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
GtkPrinter *printer;
GtkTreeIter iter, filter_iter;
@@ -2222,7 +2220,7 @@ static void
update_collate_icon (GtkToggleButton *toggle_button,
GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
gtk_widget_queue_draw (priv->collate_image);
}
@@ -2317,7 +2315,7 @@ static void
update_page_range_entry_sensitivity (GtkWidget *button,
GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
gboolean active;
active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
@@ -2332,7 +2330,7 @@ static void
update_print_at_entry_sensitivity (GtkWidget *button,
GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
gboolean active;
active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
@@ -2366,7 +2364,7 @@ static GtkPageRange *
dialog_get_page_ranges (GtkPrintUnixDialog *dialog,
gint *n_ranges_out)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
gint i, n_ranges;
const gchar *text, *p;
gchar *next;
@@ -2448,7 +2446,7 @@ dialog_set_page_ranges (GtkPrintUnixDialog *dialog,
GtkPageRange *ranges,
gint n_ranges)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
gint i;
GString *s = g_string_new (NULL);
@@ -2472,7 +2470,7 @@ dialog_set_page_ranges (GtkPrintUnixDialog *dialog,
static GtkPrintPages
dialog_get_print_pages (GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->all_pages_radio)))
return GTK_PRINT_PAGES_ALL;
@@ -2488,7 +2486,7 @@ static void
dialog_set_print_pages (GtkPrintUnixDialog *dialog,
GtkPrintPages pages)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
if (pages == GTK_PRINT_PAGES_RANGES)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->page_range_radio), TRUE);
@@ -2503,8 +2501,10 @@ dialog_set_print_pages (GtkPrintUnixDialog *dialog,
static gdouble
dialog_get_scale (GtkPrintUnixDialog *dialog)
{
- if (gtk_widget_is_sensitive (dialog->priv->scale_spin))
- return gtk_spin_button_get_value (GTK_SPIN_BUTTON (dialog->priv->scale_spin));
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
+
+ if (gtk_widget_is_sensitive (priv->scale_spin))
+ return gtk_spin_button_get_value (GTK_SPIN_BUTTON (priv->scale_spin));
else
return 100.0;
}
@@ -2513,14 +2513,18 @@ static void
dialog_set_scale (GtkPrintUnixDialog *dialog,
gdouble val)
{
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->priv->scale_spin), val);
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
+
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (priv->scale_spin), val);
}
static GtkPageSet
dialog_get_page_set (GtkPrintUnixDialog *dialog)
{
- if (gtk_widget_is_sensitive (dialog->priv->page_set_combo))
- return (GtkPageSet)gtk_combo_box_get_active (GTK_COMBO_BOX (dialog->priv->page_set_combo));
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
+
+ if (gtk_widget_is_sensitive (priv->page_set_combo))
+ return (GtkPageSet)gtk_combo_box_get_active (GTK_COMBO_BOX (priv->page_set_combo));
else
return GTK_PAGE_SET_ALL;
}
@@ -2529,14 +2533,15 @@ static void
dialog_set_page_set (GtkPrintUnixDialog *dialog,
GtkPageSet val)
{
- gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->page_set_combo),
- (int)val);
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
+
+ gtk_combo_box_set_active (GTK_COMBO_BOX (priv->page_set_combo), (int)val);
}
static gint
dialog_get_n_copies (GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
GtkAdjustment *adjustment;
const gchar *text;
gchar *endptr = NULL;
@@ -2547,7 +2552,7 @@ dialog_get_n_copies (GtkPrintUnixDialog *dialog)
text = gtk_editable_get_text (GTK_EDITABLE (priv->copies_spin));
n_copies = g_ascii_strtoull (text, &endptr, 0);
- if (gtk_widget_is_sensitive (dialog->priv->copies_spin))
+ if (gtk_widget_is_sensitive (priv->copies_spin))
{
if (n_copies != 0 && endptr != text && (endptr != NULL && endptr[0] == '\0') &&
n_copies >= gtk_adjustment_get_lower (adjustment) &&
@@ -2566,15 +2571,19 @@ static void
dialog_set_n_copies (GtkPrintUnixDialog *dialog,
gint n_copies)
{
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->priv->copies_spin),
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
+
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (priv->copies_spin),
n_copies);
}
static gboolean
dialog_get_collate (GtkPrintUnixDialog *dialog)
{
- if (gtk_widget_is_sensitive (dialog->priv->collate_check))
- return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->collate_check));
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
+
+ if (gtk_widget_is_sensitive (priv->collate_check))
+ return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->collate_check));
return FALSE;
}
@@ -2582,15 +2591,19 @@ static void
dialog_set_collate (GtkPrintUnixDialog *dialog,
gboolean collate)
{
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->collate_check),
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
+
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->collate_check),
collate);
}
static gboolean
dialog_get_reverse (GtkPrintUnixDialog *dialog)
{
- if (gtk_widget_is_sensitive (dialog->priv->reverse_check))
- return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->reverse_check));
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
+
+ if (gtk_widget_is_sensitive (priv->reverse_check))
+ return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->reverse_check));
return FALSE;
}
@@ -2598,14 +2611,16 @@ static void
dialog_set_reverse (GtkPrintUnixDialog *dialog,
gboolean reverse)
{
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->reverse_check),
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
+
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->reverse_check),
reverse);
}
static gint
dialog_get_pages_per_sheet (GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
const gchar *val;
gint num;
@@ -2626,7 +2641,7 @@ dialog_get_pages_per_sheet (GtkPrintUnixDialog *dialog)
static GtkNumberUpLayout
dialog_get_number_up_layout (GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
GtkPrintCapabilities caps;
GtkNumberUpLayout layout;
const gchar *val;
@@ -2673,7 +2688,7 @@ draw_page (GtkDrawingArea *da,
{
GtkWidget *widget = GTK_WIDGET (da);
GtkPrintUnixDialog *dialog = GTK_PRINT_UNIX_DIALOG (data);
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
GtkStyleContext *context;
gdouble ratio;
gint w, h, tmp, shadow_offset;
@@ -3076,7 +3091,7 @@ draw_page (GtkDrawingArea *da,
static void
redraw_page_layout_preview (GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
if (priv->page_layout_preview)
gtk_widget_queue_draw (priv->page_layout_preview);
@@ -3085,7 +3100,7 @@ redraw_page_layout_preview (GtkPrintUnixDialog *dialog)
static void
update_number_up_layout (GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
GtkPrintCapabilities caps;
GtkPrinterOptionSet *set;
GtkNumberUpLayout layout;
@@ -3234,7 +3249,7 @@ custom_paper_dialog_response_cb (GtkDialog *custom_paper_dialog,
gpointer user_data)
{
GtkPrintUnixDialog *print_dialog = GTK_PRINT_UNIX_DIALOG (user_data);
- GtkPrintUnixDialogPrivate *priv = print_dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (print_dialog);
GtkTreeModel *model;
GtkTreeIter iter;
@@ -3271,7 +3286,7 @@ static void
orientation_changed (GtkComboBox *combo_box,
GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
GtkPageOrientation orientation;
GtkPageSetup *page_setup;
@@ -3296,7 +3311,7 @@ static void
paper_size_changed (GtkComboBox *combo_box,
GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
GtkTreeIter iter;
GtkPageSetup *page_setup, *last_page_setup;
GtkPageOrientation orientation;
@@ -3418,9 +3433,11 @@ gtk_print_unix_dialog_new (const gchar *title,
GtkPrinter *
gtk_print_unix_dialog_get_selected_printer (GtkPrintUnixDialog *dialog)
{
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
+
g_return_val_if_fail (GTK_IS_PRINT_UNIX_DIALOG (dialog), NULL);
- return dialog->priv->current_printer;
+ return priv->current_printer;
}
/**
@@ -3434,13 +3451,11 @@ void
gtk_print_unix_dialog_set_page_setup (GtkPrintUnixDialog *dialog,
GtkPageSetup *page_setup)
{
- GtkPrintUnixDialogPrivate *priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
g_return_if_fail (GTK_IS_PRINT_UNIX_DIALOG (dialog));
g_return_if_fail (GTK_IS_PAGE_SETUP (page_setup));
- priv = dialog->priv;
-
if (priv->page_setup != page_setup)
{
g_clear_object (&priv->page_setup);
@@ -3463,9 +3478,11 @@ gtk_print_unix_dialog_set_page_setup (GtkPrintUnixDialog *dialog,
GtkPageSetup *
gtk_print_unix_dialog_get_page_setup (GtkPrintUnixDialog *dialog)
{
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
+
g_return_val_if_fail (GTK_IS_PRINT_UNIX_DIALOG (dialog), NULL);
- return dialog->priv->page_setup;
+ return priv->page_setup;
}
/**
@@ -3479,9 +3496,11 @@ gtk_print_unix_dialog_get_page_setup (GtkPrintUnixDialog *dialog)
gboolean
gtk_print_unix_dialog_get_page_setup_set (GtkPrintUnixDialog *dialog)
{
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
+
g_return_val_if_fail (GTK_IS_PRINT_UNIX_DIALOG (dialog), FALSE);
- return dialog->priv->page_setup_set;
+ return priv->page_setup_set;
}
/**
@@ -3496,12 +3515,10 @@ void
gtk_print_unix_dialog_set_current_page (GtkPrintUnixDialog *dialog,
gint current_page)
{
- GtkPrintUnixDialogPrivate *priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
g_return_if_fail (GTK_IS_PRINT_UNIX_DIALOG (dialog));
- priv = dialog->priv;
-
if (priv->current_page != current_page)
{
priv->current_page = current_page;
@@ -3524,16 +3541,18 @@ gtk_print_unix_dialog_set_current_page (GtkPrintUnixDialog *dialog,
gint
gtk_print_unix_dialog_get_current_page (GtkPrintUnixDialog *dialog)
{
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
+
g_return_val_if_fail (GTK_IS_PRINT_UNIX_DIALOG (dialog), -1);
- return dialog->priv->current_page;
+ return priv->current_page;
}
static gboolean
set_active_printer (GtkPrintUnixDialog *dialog,
const gchar *printer_name)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
GtkTreeModel *model;
GtkTreeIter iter, filter_iter;
GtkTreeSelection *selection;
@@ -3588,7 +3607,7 @@ void
gtk_print_unix_dialog_set_settings (GtkPrintUnixDialog *dialog,
GtkPrintSettings *settings)
{
- GtkPrintUnixDialogPrivate *priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
const gchar *printer;
GtkPageRange *ranges;
gint num_ranges;
@@ -3596,8 +3615,6 @@ gtk_print_unix_dialog_set_settings (GtkPrintUnixDialog *dialog,
g_return_if_fail (GTK_IS_PRINT_UNIX_DIALOG (dialog));
g_return_if_fail (settings == NULL || GTK_IS_PRINT_SETTINGS (settings));
- priv = dialog->priv;
-
if (settings != NULL)
{
dialog_set_collate (dialog, gtk_print_settings_get_collate (settings));
@@ -3652,7 +3669,7 @@ gtk_print_unix_dialog_set_settings (GtkPrintUnixDialog *dialog,
GtkPrintSettings *
gtk_print_unix_dialog_get_settings (GtkPrintUnixDialog *dialog)
{
- GtkPrintUnixDialogPrivate *priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
GtkPrintSettings *settings;
GtkPrintPages print_pages;
GtkPageRange *ranges;
@@ -3660,7 +3677,6 @@ gtk_print_unix_dialog_get_settings (GtkPrintUnixDialog *dialog)
g_return_val_if_fail (GTK_IS_PRINT_UNIX_DIALOG (dialog), NULL);
- priv = dialog->priv;
settings = gtk_print_settings_new ();
if (priv->current_printer)
@@ -3720,7 +3736,9 @@ gtk_print_unix_dialog_add_custom_tab (GtkPrintUnixDialog *dialog,
GtkWidget *child,
GtkWidget *tab_label)
{
- gtk_notebook_insert_page (GTK_NOTEBOOK (dialog->priv->notebook),
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
+
+ gtk_notebook_insert_page (GTK_NOTEBOOK (priv->notebook),
child, tab_label, 2);
gtk_widget_show (child);
gtk_widget_show (tab_label);
@@ -3741,7 +3759,7 @@ void
gtk_print_unix_dialog_set_manual_capabilities (GtkPrintUnixDialog *dialog,
GtkPrintCapabilities capabilities)
{
- GtkPrintUnixDialogPrivate *priv = dialog->priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
if (priv->manual_capabilities != capabilities)
{
@@ -3774,9 +3792,11 @@ gtk_print_unix_dialog_set_manual_capabilities (GtkPrintUnixDialog *dialog,
GtkPrintCapabilities
gtk_print_unix_dialog_get_manual_capabilities (GtkPrintUnixDialog *dialog)
{
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
+
g_return_val_if_fail (GTK_IS_PRINT_UNIX_DIALOG (dialog), FALSE);
- return dialog->priv->manual_capabilities;
+ return priv->manual_capabilities;
}
/**
@@ -3790,12 +3810,10 @@ void
gtk_print_unix_dialog_set_support_selection (GtkPrintUnixDialog *dialog,
gboolean support_selection)
{
- GtkPrintUnixDialogPrivate *priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
g_return_if_fail (GTK_IS_PRINT_UNIX_DIALOG (dialog));
- priv = dialog->priv;
-
support_selection = support_selection != FALSE;
if (priv->support_selection != support_selection)
{
@@ -3830,9 +3848,11 @@ gtk_print_unix_dialog_set_support_selection (GtkPrintUnixDialog *dialog,
gboolean
gtk_print_unix_dialog_get_support_selection (GtkPrintUnixDialog *dialog)
{
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
+
g_return_val_if_fail (GTK_IS_PRINT_UNIX_DIALOG (dialog), FALSE);
- return dialog->priv->support_selection;
+ return priv->support_selection;
}
/**
@@ -3846,12 +3866,10 @@ void
gtk_print_unix_dialog_set_has_selection (GtkPrintUnixDialog *dialog,
gboolean has_selection)
{
- GtkPrintUnixDialogPrivate *priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
g_return_if_fail (GTK_IS_PRINT_UNIX_DIALOG (dialog));
- priv = dialog->priv;
-
has_selection = has_selection != FALSE;
if (priv->has_selection != has_selection)
{
@@ -3880,9 +3898,11 @@ gtk_print_unix_dialog_set_has_selection (GtkPrintUnixDialog *dialog,
gboolean
gtk_print_unix_dialog_get_has_selection (GtkPrintUnixDialog *dialog)
{
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
+
g_return_val_if_fail (GTK_IS_PRINT_UNIX_DIALOG (dialog), FALSE);
- return dialog->priv->has_selection;
+ return priv->has_selection;
}
/**
@@ -3896,12 +3916,10 @@ void
gtk_print_unix_dialog_set_embed_page_setup (GtkPrintUnixDialog *dialog,
gboolean embed)
{
- GtkPrintUnixDialogPrivate *priv;
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
g_return_if_fail (GTK_IS_PRINT_UNIX_DIALOG (dialog));
- priv = dialog->priv;
-
embed = embed != FALSE;
if (priv->embed_page_setup != embed)
{
@@ -3944,7 +3962,9 @@ gtk_print_unix_dialog_set_embed_page_setup (GtkPrintUnixDialog *dialog,
gboolean
gtk_print_unix_dialog_get_embed_page_setup (GtkPrintUnixDialog *dialog)
{
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
+
g_return_val_if_fail (GTK_IS_PRINT_UNIX_DIALOG (dialog), FALSE);
- return dialog->priv->embed_page_setup;
+ return priv->embed_page_setup;
}