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
  
163
  
164
  
165
  
166
  
167
  
168
  
169
  
170
  
171
  
172
  
173
  
174
  
175
  
176
  
177
  
178
  
179
  
180
  
181
  
182
  
183
  
184
  
185
  
186
  
187
  
188
  
189
  
190
  
191
  
192
  
193
  
194
  
195
  
196
  
197
  
198
  
199
  
200
  
201
  
202
  
203
  
204
  
205
  
206
  
207
  
208
  
209
  
210
  
211
  
212
  
213
  
214
  
215
  
216
  
217
  
218
  
219
  
220
  
221
  
222
  
223
  
224
  
225
  
226
  
227
  
228
  
229
  
230
  
231
  
232
  
233
  
234
  
235
  
236
  
237
  
238
  
239
  
240
  
241
  
242
  
243
  
244
  
245
  
246
  
247
  
248
  
249
  
250
  
251
  
252
  
253
  
254
  
255
  
256
  
257
  
258
  
259
  
260
  
261
  
262
  
263
  
264
  
265
  
266
  
267
  
268
  
269
  
270
  
271
  
272
  
273
  
274
  
275
  
276
  
277
  
278
  
279
  
280
  
281
  
282
  
283
  
284
  
285
  
286
  
287
  
288
  
289
  
290
  
291
  
292
  
293
  
294
  
295
  
296
  
297
  
298
  
299
  
300
  
301
  
302
  
303
  
304
  
305
  
/* -*- C -*- */ 
require not_now; 
class GTK2.PrintSettings; 
inherit G.Object; 
 
//! A GTK2.PrintSettings object represents the settings of a print dialog 
//! in a system-independent way. The main use for this object is that once 
//! you've printed you can get a settings object that represents the settings 
//! the user chose, and the next time you print you can pass that object in 
//! so that the user doesn't have to re-set all his settings. 
 
//! <p> 
//! Recognized keys: 
//! printer 
//! orientation 
//! paper-format 
//! paper-width 
//! paper-height 
//! use-color 
//! collate 
//! reverse 
//! duplex 
//! quality 
//! n-copies 
//! number-up 
//! resolution 
//! scale 
//! print-pages 
//! page-ranges 
//! page-set 
//! default-source 
//! media-type 
//! dither 
//! finishings 
//! output-bin 
//! output-file-format (PS, PDF) 
//! output-uri (file://) 
//! win32-driver-extra 
//! win32-driver-version 
 
void create(?mapping(string:mixed) props) 
//! Create a new GTK2.PrintSettings. 
{ 
  pgtk2_verify_not_inited(); 
  pgtk2_verify_setup(); 
  if (args) { 
    INIT_WITH_PROPS(GTK_TYPE_PRINT_SETTINGS); 
    pgtk2_pop_n_elems(args); 
  } else { 
    GtkWidget *ga; 
    ga=gtk_print_settings_new(); 
    THIS->obj=G_OBJECT(ga); 
  } 
  pgtk2__init_this_object(); 
} 
 
+GTK2.PrintSettings copy(); 
//! Returns a copy. 
 
int has_key(string key); 
//! Returns true, if a value is associated with key. 
 
string get(string key); 
//! Loops up the string value associated with key. 
 
void set(string key, string value); 
//! Associates value with key. 
 
void unset(string key); 
//! Removes any value associated with key. 
 
int get_bool(string key); 
//! Returns the boolean represented by the value that is associated with key. 
//! <p> 
//! The string "true" represents TRUE, any other string FALSE. 
 
void set_bool(string key, int value); 
//! Sets key to a boolean value. 
 
float get_double(string key); 
//! Returns the double value associated with key, or 0.0. 
 
float get_double_with_default(string key, float def); 
//! Returns the floating point number represented by the value that is 
//! associated with key, or def if the value does not represent a floating 
//! point number. 
 
void set_double(string key, float value); 
//! Sets key to a double value. 
 
float get_length(string key, int unit); 
//! Returns the value associated with key, interpreted as a length.  The 
//! returned value is converted to units. 
 
void set_length(string key, float value, int unit); 
//! Associates a length in units of unit with key. 
 
int get_int(string key); 
//! Returns the integer value of key, or 0. 
 
int get_int_with_default(string key, int def); 
//! Returns the value of key, interpreted as an integer, or the default value. 
 
void set_int(string key, int value); 
//! Sets key to an integer value. 
 
string get_printer(); 
//! Return printer. 
 
void set_printer(string printer); 
//! Set printer. 
 
int get_orientation(); 
//! Get the orientation. 
 
void set_orientation(int orientation); 
//! Set orientation. 
 
+GTK2.PaperSize get_paper_size() 
//! Gets the paper size. 
{ 
  pgtk2_verify_inited(); 
  pgtk2_pop_n_elems(args); 
  { 
    GtkPaperSize *gps; 
 
    gps=gtk_print_settings_get_paper_size(GTK_PRINT_SETTINGS(THIS->obj)); 
    push_gobjectclass(gps,pgtk2_paper_size_program); 
  } 
} 
 
void set_paper_size(GTK2.PaperSize paper_size) 
//! Sets the paper size. 
{ 
  pgtk2_verify_inited(); 
  { 
    struct object *o1; 
 
    get_all_args(NULL,args,"%o",&o1); 
    gtk_print_settings_set_paper_size((GtkPaperSize *)(get_pg2object(o1,pgtk2_paper_size_program))); 
  } 
  RETURN_THIS(); 
} 
 
float get_paper_width(int unit); 
//! Gets the paper width, converted to unit. 
 
void set_paper_width(float width, int unit); 
//! Sets the paper width. 
 
float get_paper_height(int unit); 
//! Gets the paper height, converted to unit. 
 
void set_paper_height(float height, int unit); 
//! Sets the paper height. 
 
int get_use_color(); 
//! Gets whether to use color. 
 
void set_use_color(int use_color); 
//! Sets whether to use color. 
 
int get_collate(); 
//! Gets the value of collate. 
 
void set_collate(int collate); 
//! Sets the value of collate. 
 
int get_reverse(); 
//! Gets whether to reverse the order of the pages. 
 
void set_reverse(int reverse); 
//! Sets whether to reverse the output. 
 
int get_duplex(); 
//! Gets whether to print the output in duplex. 
 
void set_duplex(); 
//! Sets the duplex value. 
 
int get_quality(); 
//! Get the print quality. 
 
void set_quality(int quality); 
//! Sets the print quality. 
 
int get_n_copies(); 
//! Gets the number of copies to print. 
 
void set_n_copies(int num_copies); 
//! Sets the number of copies to print. 
 
int get_number_up(); 
//! Gets the number of pages per sheet. 
 
void set_number_up(int number_up); 
//! Sets the number of pages per sheet. 
 
int get_resolution(); 
//! Gets the resolution in dpi. 
 
void set_resolution(int resolution); 
//! Sets the resolution in dpi. 
 
float get_scale(); 
//! Gets the scale in percent. 
 
void set_scale(float scale); 
//! Sets the scale in percent. 
 
int get_print_pages(); 
//! Gets which pages to print. 
 
void set_print_pages(int pages); 
//! Sets the pages to print mode. 
 
array get_page_ranges() 
//! Gets the page ranges to print. 
{ 
  pgtk2_verify_inited(); 
  pgtk2_pop_n_elems(args); 
  { 
    GtkPageRange *gpr; 
    gint num_ranges; 
    int i; 
 
    gpr=gtk_print_settings_get_page_ranges(GTK_PRINT_SETTINGS(THIS->obj), 
                        &num_ranges); 
    for (i=0; i<num_ranges; i++) { 
      push_int(gpr[i].start); 
      push_int(gpr[i].end); 
      f_aggregate(2); 
    } 
    f_aggregate(num_ranges); 
  } 
} 
 
void set_page_ranges(array(array) page_ranges) 
//! Sets the page ranges to print. 
{ 
  pgtk2_verify_inited(); 
  { 
    ONERROR err; 
    struct array *a; 
    int num_ranges,i; 
    GtkPageRange *gpr; 
 
    get_all_args(NULL,args,"%A",&a); 
    if (a==NULL) 
      Pike_error("Invalid array.\n"); 
 
    gpr=xalloc(sizeof(GtkPageRange)*a->size+1); 
    SET_ONERROR(err,xfree,gpr); 
    for (i=num_ranges=0; i<a->size; i++) { 
      if (TYPEOF(ITEM(a)[i]) != PIKE_T_ARRAY) 
        continue; 
      if (ITEM(a)[i].u.array.size!=2) 
        continue; 
      gpr[num_range].start=PGTK_GETINT(ITEM(ITEM(a)[i].u.array)[0]); 
      gpr[num_range++].end=PGTK_GETINT(ITEM(ITEM(a)[i].u.array)[1]); 
    } 
    gtk_print_settings_set_page_ranges(GTK_PRINT_SETTINGS(THIS->obj), 
                        gpr,num_ranges); 
    CALL_AND_UNSET_ONERROR(err); 
  } 
  RETURN_THIS(); 
} 
 
int get_page_set(); 
//! Gets the set of pages to print. 
 
void set_page_set(int page_set); 
//! Sets the set of pages to print. 
 
string get_default_source(); 
//! Gets the default source. 
 
void set_default_source(string def); 
//! Sets the default source. 
 
string get_media_type(); 
//! Gets the media type. 
 
void set_media_type(string media_type); 
//! Sets the media type. 
 
string get_dither(); 
//! Gets the type of dithering that is used. 
 
void set_dither(string dither); 
//! Sets the type of dithering that is used. 
 
string get_finishings(); 
//! Gets the finishings. 
 
void set_finishings(string finishings); 
//! Sets the finishings. 
 
string get_output_bin(); 
//! Gets the output bin. 
 
void set_output_bin(); 
//! Sets the output bin. 
endrequire;