Code

work a bit on snapindicator: added switch statement for different types
[inkscape.git] / src / desktop-handles.cpp
1 #define __SP_DESKTOP_HANDLES_C__
3 /*
4  * Frontends
5  *
6  * Author:
7  *   Lauris Kaplinski <lauris@kaplinski.com>
8  *
9  * Copyright (C) 2001-2002 Lauris Kaplinski
10  * Copyright (C) 2001 Ximian, Inc.
11  *
12  * Released under GNU GPL, read the file 'COPYING' for more information
13  */
15 #include "display/sp-canvas.h"
16 #include "desktop.h"
18 SPEventContext *
19 sp_desktop_event_context (SPDesktop const * desktop)
20 {
21         g_return_val_if_fail (desktop != NULL, NULL);
23         return desktop->event_context;
24 }
26 Inkscape::Selection *
27 sp_desktop_selection (SPDesktop const * desktop)
28 {
29         g_assert(desktop != NULL);
31         return desktop->selection;
32 }
34 SPDocument *
35 sp_desktop_document (SPDesktop const * desktop)
36 {
37         g_return_val_if_fail (desktop != NULL, NULL);
39         return desktop->doc();
40 }
42 SPCanvas *
43 sp_desktop_canvas (SPDesktop const * desktop)
44 {
45         g_return_val_if_fail (desktop != NULL, NULL);
47         return ((SPCanvasItem *) desktop->main)->canvas;
48 }
50 SPCanvasItem *
51 sp_desktop_acetate (SPDesktop const * desktop)
52 {
53         g_return_val_if_fail (desktop != NULL, NULL);
55         return desktop->acetate;
56 }
58 SPCanvasGroup *
59 sp_desktop_main (SPDesktop const * desktop)
60 {
61         g_return_val_if_fail (desktop != NULL, NULL);
63         return desktop->main;
64 }
66 SPCanvasGroup *
67 sp_desktop_gridgroup (SPDesktop const * desktop)
68 {
69         g_return_val_if_fail (desktop != NULL, NULL);
71         return desktop->gridgroup;
72 }
74 SPCanvasGroup *
75 sp_desktop_guides (SPDesktop const * desktop)
76 {
77         g_return_val_if_fail (desktop != NULL, NULL);
79         return desktop->guides;
80 }
82 SPCanvasItem *
83 sp_desktop_drawing (SPDesktop const *desktop)
84 {
85         g_return_val_if_fail (desktop != NULL, NULL);
87         return desktop->drawing;
88 }
90 SPCanvasGroup *
91 sp_desktop_sketch (SPDesktop const * desktop)
92 {
93         g_return_val_if_fail (desktop != NULL, NULL);
95         return desktop->sketch;
96 }
98 SPCanvasGroup *
99 sp_desktop_controls (SPDesktop const * desktop)
101         g_return_val_if_fail (desktop != NULL, NULL);
103         return desktop->controls;
106 SPCanvasGroup *
107 sp_desktop_tempgroup (SPDesktop const * desktop)
109     g_return_val_if_fail (desktop != NULL, NULL);
111     return desktop->tempgroup;
114 Inkscape::MessageStack *
115 sp_desktop_message_stack (SPDesktop const * desktop)
117         g_return_val_if_fail (desktop != NULL, NULL);
119         return desktop->messageStack();
122 SPNamedView *
123 sp_desktop_namedview (SPDesktop const * desktop)
125         g_return_val_if_fail (desktop != NULL, NULL);
127         return desktop->namedview;