File: GtkPrintOperation.xs

package info (click to toggle)
libgtk2-perl 2:1.2499-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,668 kB
  • ctags: 594
  • sloc: perl: 22,100; ansic: 122; makefile: 17
file content (162 lines) | stat: -rw-r--r-- 5,657 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
/*
 * Copyright (c) 2006 by the gtk2-perl team (see the file AUTHORS)
 *
 * Licensed under the LGPL, see LICENSE file for more information.
 *
 * $Id$
 */

#include "gtk2perl.h"

static GPerlCallback *
gtk2perl_page_setup_done_func_create (SV * func, SV * data)
{
	GType param_types [1];
	param_types[0] = GTK_TYPE_PAGE_SETUP;
	return gperl_callback_new (func, data, G_N_ELEMENTS (param_types),
				   param_types, 0);
}

static void
gtk2perl_page_setup_done_func (GtkPageSetup *page_setup, gpointer data)
{
	gperl_callback_invoke ((GPerlCallback *) data, NULL, page_setup);
	/* The callback is always called exactly once, so free it now. */
	gperl_callback_destroy ((GPerlCallback *) data);
}

MODULE = Gtk2::PrintOperation	PACKAGE = Gtk2::PrintOperation	PREFIX = gtk_print_operation_

# GtkPrintOperation * gtk_print_operation_new (void);
GtkPrintOperation_noinc * gtk_print_operation_new (class)
    C_ARGS:
	/* void */

void gtk_print_operation_set_default_page_setup (GtkPrintOperation *op, GtkPageSetup_ornull *default_page_setup);

GtkPageSetup_ornull * gtk_print_operation_get_default_page_setup (GtkPrintOperation *op);

void gtk_print_operation_set_print_settings (GtkPrintOperation *op, GtkPrintSettings_ornull *print_settings);

GtkPrintSettings_ornull * gtk_print_operation_get_print_settings (GtkPrintOperation *op);

void gtk_print_operation_set_job_name (GtkPrintOperation *op, const gchar *job_name);

void gtk_print_operation_set_n_pages (GtkPrintOperation *op, gint n_pages);

void gtk_print_operation_set_current_page (GtkPrintOperation *op, gint current_page);

void gtk_print_operation_set_use_full_page (GtkPrintOperation *op, gboolean full_page);

void gtk_print_operation_set_unit (GtkPrintOperation *op, GtkUnit unit);

void gtk_print_operation_set_export_filename (GtkPrintOperation *op, const gchar *filename);

void gtk_print_operation_set_track_print_status (GtkPrintOperation *op, gboolean track_status);

void gtk_print_operation_set_show_progress (GtkPrintOperation *op, gboolean show_progress);

void gtk_print_operation_set_allow_async (GtkPrintOperation *op, gboolean allow_async);

void gtk_print_operation_set_custom_tab_label (GtkPrintOperation *op, const gchar *label);

=for apidoc __gerror__
=cut
# GtkPrintOperationResult gtk_print_operation_run (GtkPrintOperation *op, GtkPrintOperationAction action, GtkWindow *parent, GError **error);
GtkPrintOperationResult
gtk_print_operation_run (GtkPrintOperation *op, GtkPrintOperationAction action, GtkWindow_ornull *parent)
    PREINIT:
	GError *error = NULL;
    CODE:
	RETVAL = gtk_print_operation_run (op, action, parent, &error);
	if (error)
		gperl_croak_gerror (NULL, error);
    OUTPUT:
	RETVAL

# FIXME: Does it makes sense to wrap it like this?
# void gtk_print_operation_get_error (GtkPrintOperation *op, GError **error);
SV *
gtk_print_operation_get_error (GtkPrintOperation *op)
    PREINIT:
	GError *error = NULL;
    CODE:
	gtk_print_operation_get_error (op, &error);
	RETVAL = gperl_sv_from_gerror (error);
    OUTPUT:
	RETVAL

GtkPrintStatus gtk_print_operation_get_status (GtkPrintOperation *op);

const gchar * gtk_print_operation_get_status_string (GtkPrintOperation *op);

gboolean gtk_print_operation_is_finished (GtkPrintOperation *op);

void gtk_print_operation_cancel (GtkPrintOperation *op);

#if GTK_CHECK_VERSION (2, 16, 0)

=for apidoc

=for signature $op->draw_page_finish ()

The method draw_page_finish() can only be called if the method
set_defer_drawing() has been called previously otherwise a segmentation fault
will occur. This means that the application will crash and even an eval will not
be able to recover from that error.

=cut
void gtk_print_operation_draw_page_finish (GtkPrintOperation *op);


=for apidoc

=for signature $op->set_defer_drawing ()

The method set_defer_drawing() can only be called from the callback
C<'draw-page'>.

=cut
void gtk_print_operation_set_defer_drawing (GtkPrintOperation *op);

#endif /* 2.16 */

#if GTK_CHECK_VERSION (2, 18, 0)

void gtk_print_operation_set_embed_page_setup (GtkPrintOperation *op, gboolean embed);

gboolean gtk_print_operation_get_embed_page_setup (GtkPrintOperation *op);

void gtk_print_operation_set_support_selection (GtkPrintOperation *op, gboolean support_selection);

gboolean gtk_print_operation_get_support_selection (GtkPrintOperation *op);

void gtk_print_operation_set_has_selection (GtkPrintOperation *op, gboolean has_selection);

gboolean gtk_print_operation_get_has_selection (GtkPrintOperation *op);

gint gtk_print_operation_get_n_pages_to_print (GtkPrintOperation *op);

#endif /* 2.18 */

MODULE = Gtk2::PrintOperation	PACKAGE = Gtk2::Print	PREFIX = gtk_print_

# GtkPageSetup * gtk_print_run_page_setup_dialog (GtkWindow *parent, GtkPageSetup *page_setup, GtkPrintSettings *settings);
GtkPageSetup_noinc *
gtk_print_run_page_setup_dialog (class, GtkWindow_ornull *parent, GtkPageSetup_ornull *page_setup, GtkPrintSettings *settings)
    C_ARGS:
	parent, page_setup, settings

# void gtk_print_run_page_setup_dialog_async (GtkWindow_ornull *parent, GtkPageSetup_ornull *page_setup, GtkPrintSettings *settings, GtkPageSetupDoneFunc done_cb, gpointer data);
void
gtk_print_run_page_setup_dialog_async (class, GtkWindow_ornull *parent, GtkPageSetup_ornull *page_setup, GtkPrintSettings *settings, SV *func, SV *data=NULL)
    PREINIT:
	GPerlCallback *callback;
    CODE:
	callback = gtk2perl_page_setup_done_func_create (func, data);
	gtk_print_run_page_setup_dialog_async (
		parent, page_setup, settings,
		gtk2perl_page_setup_done_func,
		callback);
	/* Since it's always called exactly once, the callback is destroyed
	 * directly in the marshaller. */