File: GtkPrintSettings.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 (149 lines) | stat: -rw-r--r-- 4,737 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
/*
 * 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_print_settings_func_create (SV * func, SV * data)
{
	GType param_types [2];
	param_types[0] = G_TYPE_STRING;
	param_types[1] = G_TYPE_STRING;
	return gperl_callback_new (func, data, G_N_ELEMENTS (param_types),
				   param_types, 0);
}

static void
gtk2perl_print_settings_func (const gchar *key, const gchar *value, gpointer data)
{
	gperl_callback_invoke ((GPerlCallback *) data, NULL, key, value);
}

MODULE = Gtk2::PrintSettings	PACKAGE = Gtk2::PrintSettings	PREFIX = gtk_print_settings_

# GtkPrintSettings * gtk_print_settings_new (void);
GtkPrintSettings_noinc * gtk_print_settings_new (class)
    C_ARGS:
	/* void */

# Needed?
# GtkPrintSettings * gtk_print_settings_copy (GtkPrintSettings *other);

gboolean gtk_print_settings_has_key (GtkPrintSettings *settings, const gchar *key);

const gchar_ornull * gtk_print_settings_get (GtkPrintSettings *settings, const gchar *key);

void gtk_print_settings_set (GtkPrintSettings *settings, const gchar *key, const gchar_ornull *value);

void gtk_print_settings_unset (GtkPrintSettings *settings, const gchar *key);

# void gtk_print_settings_foreach (GtkPrintSettings *settings, GtkPrintSettingsFunc func, gpointer user_data);
void
gtk_print_settings_foreach (GtkPrintSettings *settings, SV *func, SV *data=NULL)
    PREINIT:
	GPerlCallback *callback;
    CODE:
	callback = gtk2perl_print_settings_func_create (func, data);
	gtk_print_settings_foreach (settings, gtk2perl_print_settings_func,
	                            callback);
	gperl_callback_destroy (callback);

#if GTK_CHECK_VERSION (2, 12, 0)

# GtkPrintSettings * gtk_print_settings_new_from_file (const gchar *file_name, GError **error);
=for apidoc __gerror__
=cut
GtkPrintSettings_noinc * gtk_print_settings_new_from_file (class, GPerlFilename file_name)
    PREINIT:
	GError *error = NULL;
    CODE:
	RETVAL = gtk_print_settings_new_from_file (file_name, &error);
	if (error)
		gperl_croak_gerror (NULL, error);
    OUTPUT:
	RETVAL

# gboolean gtk_print_settings_to_file (GtkPrintSettings *settings, const gchar *file_name, GError **error);
=for apidoc __gerror__
=cut
void gtk_print_settings_to_file (GtkPrintSettings *settings, GPerlFilename file_name)
    PREINIT:
	GError *error = NULL;
    CODE:
	if (!gtk_print_settings_to_file (settings, file_name, &error))
		gperl_croak_gerror (NULL, error);

# GtkPrintSettings * gtk_print_settings_new_from_key_file (GKeyFile *key_file, const gchar *group_name, GError **error);
=for apidoc __gerror__
=cut
GtkPrintSettings_noinc * gtk_print_settings_new_from_key_file (class, GKeyFile *key_file, const gchar_ornull *group_name)
    PREINIT:
	GError *error = NULL;
    CODE:
	RETVAL = gtk_print_settings_new_from_key_file (key_file, group_name, &error);
	if (error)
		gperl_croak_gerror (NULL, error);
    OUTPUT:
	RETVAL

void gtk_print_settings_to_key_file (GtkPrintSettings *settings, GKeyFile *key_file, const gchar_ornull *group_name);

#endif

#if GTK_CHECK_VERSION (2, 14, 0)

=for apidoc __gerror__
=cut
# gboolean gtk_print_settings_load_file (GtkPrintSettings *settings, const char *file_name, GError **error);
void
gtk_print_settings_load_file (GtkPrintSettings *settings, const char *file_name)
    PREINIT:
	GError *error = NULL;
    CODE:
	if (!gtk_print_settings_load_file (settings, file_name, &error))
		gperl_croak_gerror (NULL, error);

=for apidoc __gerror__
=cut
# gboolean gtk_print_settings_load_key_file (GtkPrintSettings *settings, GKeyFile *key_file, const gchar *group_name, GError **error);
void
gtk_print_settings_load_key_file (GtkPrintSettings *settings, GKeyFile *key_file, const gchar_ornull *group_name)
    PREINIT:
	GError *error = NULL;
    CODE:
	if (!gtk_print_settings_load_key_file (settings, key_file, group_name, &error))
		gperl_croak_gerror (NULL, error);

#endif /* 2.14 */

# We do not wrap the convenience getters and setters intentionally, but these
# few slipped in accidentally.  We hide them in the generated POD.

#if GTK_CHECK_VERSION (2, 16, 0)

=for apidoc __hide__
=cut
gdouble gtk_print_settings_get_printer_lpi (GtkPrintSettings *settings);

=for apidoc __hide__
=cut
gint gtk_print_settings_get_resolution_x (GtkPrintSettings *settings);

=for apidoc __hide__
=cut
gint gtk_print_settings_get_resolution_y (GtkPrintSettings *settings);

=for apidoc __hide__
=cut
void gtk_print_settings_set_printer_lpi  (GtkPrintSettings *settings, gdouble lpi);

=for apidoc __hide__
=cut
void gtk_print_settings_set_resolution_xy (GtkPrintSettings *settings, gint resolution_x, gint resolution_y);

#endif /* 2.16 */