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
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876 | /*
* lapiz-app.c
* This file is part of lapiz
*
* Copyright (C) 2005-2006 - Paolo Maggi
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
/*
* Modified by the lapiz Team, 2005. See the AUTHORS file for a
* list of people on the lapiz Team.
* See the ChangeLog files for a list of changes.
*
* $Id$
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <string.h>
#include <unistd.h>
#include <glib/gi18n.h>
#include <cdk/cdkx.h>
#include "lapiz-app.h"
#include "lapiz-prefs-manager-app.h"
#include "lapiz-commands.h"
#include "lapiz-notebook.h"
#include "lapiz-debug.h"
#include "lapiz-utils.h"
#include "lapiz-enum-types.h"
#include "lapiz-dirs.h"
#define LAPIZ_PAGE_SETUP_FILE "lapiz-page-setup"
#define LAPIZ_PRINT_SETTINGS_FILE "lapiz-print-settings"
/* Properties */
enum
{
PROP_0,
PROP_LOCKDOWN
};
struct _LapizAppPrivate
{
GList *windows;
LapizWindow *active_window;
LapizLockdownMask lockdown;
CtkPageSetup *page_setup;
CtkPrintSettings *print_settings;
};
G_DEFINE_TYPE_WITH_PRIVATE (LapizApp, lapiz_app, G_TYPE_OBJECT)<--- There is an unknown macro here somewhere. Configuration is required. If G_DEFINE_TYPE_WITH_PRIVATE is a macro then please configure it.
static void
lapiz_app_finalize (GObject *object)
{
LapizApp *app = LAPIZ_APP (object);
g_list_free (app->priv->windows);
if (app->priv->page_setup)
g_object_unref (app->priv->page_setup);
if (app->priv->print_settings)
g_object_unref (app->priv->print_settings);
G_OBJECT_CLASS (lapiz_app_parent_class)->finalize (object);
}
static void
lapiz_app_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
LapizApp *app = LAPIZ_APP (object);
switch (prop_id)
{
case PROP_LOCKDOWN:
g_value_set_flags (value, lapiz_app_get_lockdown (app));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
lapiz_app_class_init (LapizAppClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = lapiz_app_finalize;
object_class->get_property = lapiz_app_get_property;
g_object_class_install_property (object_class,
PROP_LOCKDOWN,
g_param_spec_flags ("lockdown",
"Lockdown",
"The lockdown mask",
LAPIZ_TYPE_LOCKDOWN_MASK,
0,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
}
static gboolean
ensure_user_config_dir (void)
{
gchar *config_dir;
gboolean ret = TRUE;
gint res;
config_dir = lapiz_dirs_get_user_config_dir ();
if (config_dir == NULL)
{
g_warning ("Could not get config directory\n");
return FALSE;
}
res = g_mkdir_with_parents (config_dir, 0755);
if (res < 0)
{
g_warning ("Could not create config directory\n");
ret = FALSE;
}
g_free (config_dir);
return ret;
}
static void
load_accels (void)
{
gchar *filename;
filename = lapiz_dirs_get_user_accels_file ();
if (filename != NULL)
{
lapiz_debug_message (DEBUG_APP, "Loading keybindings from %s\n", filename);
ctk_accel_map_load (filename);
g_free (filename);
}
}
static void
save_accels (void)
{
gchar *filename;
filename = lapiz_dirs_get_user_accels_file ();
if (filename != NULL)
{
lapiz_debug_message (DEBUG_APP, "Saving keybindings in %s\n", filename);
ctk_accel_map_save (filename);
g_free (filename);
}
}
static gchar *
get_page_setup_file (void)
{
gchar *config_dir;
gchar *setup = NULL;
config_dir = lapiz_dirs_get_user_config_dir ();
if (config_dir != NULL)
{
setup = g_build_filename (config_dir,
LAPIZ_PAGE_SETUP_FILE,
NULL);
g_free (config_dir);
}
return setup;
}
static void
load_page_setup (LapizApp *app)
{
gchar *filename;
GError *error = NULL;
g_return_if_fail (app->priv->page_setup == NULL);
filename = get_page_setup_file ();
app->priv->page_setup = ctk_page_setup_new_from_file (filename,
&error);
if (error)
{
/* Ignore file not found error */
if (error->domain != G_FILE_ERROR ||
error->code != G_FILE_ERROR_NOENT)
{
g_warning ("%s", error->message);
}
g_error_free (error);
}
g_free (filename);
/* fall back to default settings */
if (app->priv->page_setup == NULL)
app->priv->page_setup = ctk_page_setup_new ();
}
static void
save_page_setup (LapizApp *app)
{
gchar *filename;
GError *error = NULL;
if (app->priv->page_setup == NULL)
return;
filename = get_page_setup_file ();
ctk_page_setup_to_file (app->priv->page_setup,
filename,
&error);
if (error)
{
g_warning ("%s", error->message);
g_error_free (error);
}
g_free (filename);
}
static gchar *
get_print_settings_file (void)
{
gchar *config_dir;
gchar *settings = NULL;
config_dir = lapiz_dirs_get_user_config_dir ();
if (config_dir != NULL)
{
settings = g_build_filename (config_dir,
LAPIZ_PRINT_SETTINGS_FILE,
NULL);
g_free (config_dir);
}
return settings;
}
static void
load_print_settings (LapizApp *app)
{
gchar *filename;
GError *error = NULL;
g_return_if_fail (app->priv->print_settings == NULL);
filename = get_print_settings_file ();
app->priv->print_settings = ctk_print_settings_new_from_file (filename,
&error);
if (error)
{
/* Ignore file not found error */
if (error->domain != G_FILE_ERROR ||
error->code != G_FILE_ERROR_NOENT)
{
g_warning ("%s", error->message);
}
g_error_free (error);
}
g_free (filename);
/* fall back to default settings */
if (app->priv->print_settings == NULL)
app->priv->print_settings = ctk_print_settings_new ();
}
static void
save_print_settings (LapizApp *app)
{
gchar *filename;
GError *error = NULL;
if (app->priv->print_settings == NULL)
return;
filename = get_print_settings_file ();
ctk_print_settings_to_file (app->priv->print_settings,
filename,
&error);
if (error)
{
g_warning ("%s", error->message);
g_error_free (error);
}
g_free (filename);
}
static void
lapiz_app_init (LapizApp *app)
{
app->priv = lapiz_app_get_instance_private (app);
load_accels ();
/* initial lockdown state */
app->priv->lockdown = lapiz_prefs_manager_get_lockdown ();
}
static void
app_weak_notify (gpointer data G_GNUC_UNUSED,
GObject *where_the_app_was G_GNUC_UNUSED)
{
ctk_main_quit ();
}
/**
* lapiz_app_get_default:
*
* Returns the #LapizApp object. This object is a singleton and
* represents the running lapiz instance.
*
* Return value: (transfer none): the #LapizApp pointer
*/
LapizApp *
lapiz_app_get_default (void)
{
static LapizApp *app = NULL;
if (app != NULL)
return app;
app = LAPIZ_APP (g_object_new (LAPIZ_TYPE_APP, NULL));
g_object_add_weak_pointer (G_OBJECT (app),
(gpointer) &app);
g_object_weak_ref (G_OBJECT (app),
app_weak_notify,
NULL);
return app;
}
static void
set_active_window (LapizApp *app,
LapizWindow *window)
{
app->priv->active_window = window;
}
static gboolean
window_focus_in_event (LapizWindow *window,
CdkEventFocus *event G_GNUC_UNUSED,
LapizApp *app)
{
/* updates active_view and active_child when a new toplevel receives focus */
g_return_val_if_fail (LAPIZ_IS_WINDOW (window), FALSE);
set_active_window (app, window);
return FALSE;
}
static gboolean
window_delete_event (LapizWindow *window,
CdkEvent *event G_GNUC_UNUSED,
LapizApp *app G_GNUC_UNUSED)
{
LapizWindowState ws;
ws = lapiz_window_get_state (window);
if (ws &
(LAPIZ_WINDOW_STATE_SAVING |
LAPIZ_WINDOW_STATE_PRINTING |
LAPIZ_WINDOW_STATE_SAVING_SESSION))
return TRUE;
_lapiz_cmd_file_quit (NULL, window);
/* Do not destroy the window */
return TRUE;
}
static void
window_destroy (LapizWindow *window,
LapizApp *app)
{
app->priv->windows = g_list_remove (app->priv->windows,
window);
if (window == app->priv->active_window)
{
set_active_window (app, app->priv->windows != NULL ? app->priv->windows->data : NULL);
}
/* CHECK: I don't think we have to disconnect this function, since windows
is being destroyed */
/*
g_signal_handlers_disconnect_by_func (window,
G_CALLBACK (window_focus_in_event),
app);
g_signal_handlers_disconnect_by_func (window,
G_CALLBACK (window_destroy),
app);
*/
if (app->priv->windows == NULL)
{
/* Last window is gone... save some settings and exit */
ensure_user_config_dir ();
save_accels ();
save_page_setup (app);
save_print_settings (app);
g_object_unref (app);
}
}
/* Generates a unique string for a window role */
static gchar *
gen_role (void)
{
GTimeVal result;
static gint serial;
g_get_current_time (&result);
return g_strdup_printf ("lapiz-window-%ld-%ld-%d-%s",
result.tv_sec,
result.tv_usec,
serial++,
g_get_host_name ());
}
static LapizWindow *
lapiz_app_create_window_real (LapizApp *app,
gboolean set_geometry,
const gchar *role)
{
LapizWindow *window;
lapiz_debug (DEBUG_APP);
/*
* We need to be careful here, there is a race condition:
* when another lapiz is launched it checks active_window,
* so we must do our best to ensure that active_window
* is never NULL when at least a window exists.
*/
if (app->priv->windows == NULL)
{
window = g_object_new (LAPIZ_TYPE_WINDOW, NULL);
set_active_window (app, window);
}
else
{
window = g_object_new (LAPIZ_TYPE_WINDOW, NULL);
}
app->priv->windows = g_list_prepend (app->priv->windows,
window);
lapiz_debug_message (DEBUG_APP, "Window created");
if (role != NULL)
{
ctk_window_set_role (CTK_WINDOW (window), role);
}
else
{
gchar *newrole;
newrole = gen_role ();
ctk_window_set_role (CTK_WINDOW (window), newrole);
g_free (newrole);
}
if (set_geometry)
{
CdkWindowState state;
gint w, h;
state = lapiz_prefs_manager_get_window_state ();
if ((state & CDK_WINDOW_STATE_MAXIMIZED) != 0)
{
lapiz_prefs_manager_get_default_window_size (&w, &h);
ctk_window_set_default_size (CTK_WINDOW (window), w, h);
ctk_window_maximize (CTK_WINDOW (window));
}
else
{
lapiz_prefs_manager_get_window_size (&w, &h);
ctk_window_set_default_size (CTK_WINDOW (window), w, h);
ctk_window_unmaximize (CTK_WINDOW (window));
}
if ((state & CDK_WINDOW_STATE_STICKY ) != 0)
ctk_window_stick (CTK_WINDOW (window));
else
ctk_window_unstick (CTK_WINDOW (window));
}
g_signal_connect (window,
"focus_in_event",
G_CALLBACK (window_focus_in_event),
app);
g_signal_connect (window,
"delete_event",
G_CALLBACK (window_delete_event),
app);
g_signal_connect (window,
"destroy",
G_CALLBACK (window_destroy),
app);
return window;
}
/**
* lapiz_app_create_window:
* @app: the #LapizApp
* @screen: (allow-none):
*
* Create a new #LapizWindow part of @app.
*
* Return value: (transfer none): the new #LapizWindow
*/
LapizWindow *
lapiz_app_create_window (LapizApp *app,
CdkScreen *screen)
{
LapizWindow *window;
window = lapiz_app_create_window_real (app, TRUE, NULL);
if (screen != NULL)
ctk_window_set_screen (CTK_WINDOW (window), screen);
return window;
}
/*
* Same as _create_window, but doesn't set the geometry.
* The session manager takes care of it. Used in cafe-session.
*/
LapizWindow *
_lapiz_app_restore_window (LapizApp *app,
const gchar *role)
{
LapizWindow *window;
window = lapiz_app_create_window_real (app, FALSE, role);
return window;
}
/**
* lapiz_app_get_windows:
* @app: the #LapizApp
*
* Returns all the windows currently present in #LapizApp.
*
* Return value: (element-type Lapiz.Window) (transfer none): the list of #LapizWindows objects.
* The list should not be freed
*/
const GList *
lapiz_app_get_windows (LapizApp *app)
{
g_return_val_if_fail (LAPIZ_IS_APP (app), NULL);
return app->priv->windows;
}
/**
* lapiz_app_get_active_window:
* @app: the #LapizApp
*
* Retrives the #LapizWindow currently active.
*
* Return value: (transfer none): the active #LapizWindow
*/
LapizWindow *
lapiz_app_get_active_window (LapizApp *app)
{
g_return_val_if_fail (LAPIZ_IS_APP (app), NULL);
/* make sure our active window is always realized:
* this is needed on startup if we launch two lapiz fast
* enough that the second instance comes up before the
* first one shows its window.
*/
if (!ctk_widget_get_realized (CTK_WIDGET (app->priv->active_window)))
ctk_widget_realize (CTK_WIDGET (app->priv->active_window));
return app->priv->active_window;
}
static gboolean
is_in_viewport (LapizWindow *window,
CdkScreen *screen,
gint workspace,
gint viewport_x,
gint viewport_y)
{
CdkWindow *cdkwindow;
gint ws;
gint sc_width, sc_height;
gint x, y, width, height;
gint vp_x, vp_y;
/* Check for workspace match */
ws = lapiz_utils_get_window_workspace (CTK_WINDOW (window));
if (ws != workspace && ws != LAPIZ_ALL_WORKSPACES)
return FALSE;
/* Check for viewport match */
cdkwindow = ctk_widget_get_window (CTK_WIDGET (window));
cdk_window_get_position (cdkwindow, &x, &y);
width = cdk_window_get_width(cdkwindow);
height = cdk_window_get_height(cdkwindow);
lapiz_utils_get_current_viewport (screen, &vp_x, &vp_y);
x += vp_x;
y += vp_y;
sc_width = WidthOfScreen (cdk_x11_screen_get_xscreen (screen));
sc_height = HeightOfScreen (cdk_x11_screen_get_xscreen (screen));
return x + width * .25 >= viewport_x &&
x + width * .75 <= viewport_x + sc_width &&
y >= viewport_y &&
y + height <= viewport_y + sc_height;
}
/**
* _lapiz_app_get_window_in_viewport:
* @app: the #LapizApp
* @screen: the #CdkScreen
* @workspace: the workspace number
* @viewport_x: the viewport horizontal origin
* @viewport_y: the viewport vertical origin
*
* Since a workspace can be larger than the screen, it is divided into several
* equal parts called viewports. This function retrives the #LapizWindow in
* the given viewport of the given workspace.
*
* Return value: the #LapizWindow in the given viewport of the given workspace.
*/
LapizWindow *
_lapiz_app_get_window_in_viewport (LapizApp *app,
CdkScreen *screen,
gint workspace,
gint viewport_x,
gint viewport_y)
{
LapizWindow *window;
GList *l;
g_return_val_if_fail (LAPIZ_IS_APP (app), NULL);
/* first try if the active window */
window = app->priv->active_window;
g_return_val_if_fail (LAPIZ_IS_WINDOW (window), NULL);
if (is_in_viewport (window, screen, workspace, viewport_x, viewport_y))
return window;
/* otherwise try to see if there is a window on this workspace */
for (l = app->priv->windows; l != NULL; l = l->next)
{
window = l->data;
if (is_in_viewport (window, screen, workspace, viewport_x, viewport_y))
return window;
}
/* no window on this workspace... create a new one */
return lapiz_app_create_window (app, screen);
}
/**
* lapiz_app_get_documents:
* @app: the #LapizApp
*
* Returns all the documents currently open in #LapizApp.
*
* Return value: (element-type Lapiz.Document) (transfer container):
* a newly allocated list of #LapizDocument objects
*/
GList *
lapiz_app_get_documents (LapizApp *app)
{
GList *res = NULL;
GList *windows;
g_return_val_if_fail (LAPIZ_IS_APP (app), NULL);
windows = app->priv->windows;
while (windows != NULL)
{
res = g_list_concat (res,
lapiz_window_get_documents (LAPIZ_WINDOW (windows->data)));
windows = g_list_next (windows);
}
return res;
}
/**
* lapiz_app_get_views:
* @app: the #LapizApp
*
* Returns all the views currently present in #LapizApp.
*
* Return value: (element-type Lapiz.View) (transfer container):
* a newly allocated list of #LapizView objects
*/
GList *
lapiz_app_get_views (LapizApp *app)
{
GList *res = NULL;
GList *windows;
g_return_val_if_fail (LAPIZ_IS_APP (app), NULL);
windows = app->priv->windows;
while (windows != NULL)
{
res = g_list_concat (res,
lapiz_window_get_views (LAPIZ_WINDOW (windows->data)));
windows = g_list_next (windows);
}
return res;
}
/**
* lapiz_app_get_lockdown:
* @app: a #LapizApp
*
* Gets the lockdown mask (see #LapizLockdownMask) for the application.
* The lockdown mask determines which functions are locked down using
* the CAFE-wise lockdown GSettings keys.
**/
LapizLockdownMask
lapiz_app_get_lockdown (LapizApp *app)
{
g_return_val_if_fail (LAPIZ_IS_APP (app), LAPIZ_LOCKDOWN_ALL);
return app->priv->lockdown;
}
static void
app_lockdown_changed (LapizApp *app)
{
GList *l;
for (l = app->priv->windows; l != NULL; l = l->next)
_lapiz_window_set_lockdown (LAPIZ_WINDOW (l->data),
app->priv->lockdown);
g_object_notify (G_OBJECT (app), "lockdown");
}
void
_lapiz_app_set_lockdown (LapizApp *app,
LapizLockdownMask lockdown)
{
g_return_if_fail (LAPIZ_IS_APP (app));
app->priv->lockdown = lockdown;
app_lockdown_changed (app);
}
void
_lapiz_app_set_lockdown_bit (LapizApp *app,
LapizLockdownMask bit,
gboolean value)
{
g_return_if_fail (LAPIZ_IS_APP (app));
if (value)
app->priv->lockdown |= bit;
else
app->priv->lockdown &= ~bit;
app_lockdown_changed (app);
}
/* Returns a copy */
CtkPageSetup *
_lapiz_app_get_default_page_setup (LapizApp *app)
{
g_return_val_if_fail (LAPIZ_IS_APP (app), NULL);
if (app->priv->page_setup == NULL)
load_page_setup (app);
return ctk_page_setup_copy (app->priv->page_setup);
}
void
_lapiz_app_set_default_page_setup (LapizApp *app,
CtkPageSetup *page_setup)
{
g_return_if_fail (LAPIZ_IS_APP (app));
g_return_if_fail (CTK_IS_PAGE_SETUP (page_setup));
if (app->priv->page_setup != NULL)
g_object_unref (app->priv->page_setup);
app->priv->page_setup = g_object_ref (page_setup);
}
/* Returns a copy */
CtkPrintSettings *
_lapiz_app_get_default_print_settings (LapizApp *app)
{
g_return_val_if_fail (LAPIZ_IS_APP (app), NULL);
if (app->priv->print_settings == NULL)
load_print_settings (app);
return ctk_print_settings_copy (app->priv->print_settings);
}
void
_lapiz_app_set_default_print_settings (LapizApp *app,
CtkPrintSettings *settings)
{
g_return_if_fail (LAPIZ_IS_APP (app));
g_return_if_fail (CTK_IS_PRINT_SETTINGS (settings));
if (app->priv->print_settings != NULL)
g_object_unref (app->priv->print_settings);
app->priv->print_settings = g_object_ref (settings);
}
|