~valavanisalex/ubuntu/oneiric/inkscape/inkscape_0.48.1-2ubuntu4

« back to all changes in this revision

Viewing changes to src/desktop.h

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook, Kees Cook, Ted Gould
  • Date: 2008-02-10 14:20:16 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20080210142016-vcnb2zqyhszu0xvb
Tags: 0.46~pre1-0ubuntu1
[ Kees Cook ]
* debian/control:
  - add libgtkspell-dev build-dep to gain GtkSpell features (LP: #183547).
  - update Standards version (no changes needed).
  - add Vcs and Homepage fields.
  - switch to new python-lxml dep.
* debian/{control,rules}: switch from dpatch to quilt for more sanity.
* debian/patches/20_fix_glib_and_gxx43_ftbfs.patch:
  - merged against upstream fixes.
  - added additional fixes for newly written code.
* debian/rules: enable parallel building.

[ Ted Gould ]
* Updating POTFILES.in to make it so things build correctly.
* debian/control:
  - add ImageMagick++ and libboost-dev to build-deps

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef __SP_DESKTOP_H__
2
 
#define __SP_DESKTOP_H__
 
1
#ifndef SEEN_SP_DESKTOP_H
 
2
#define SEEN_SP_DESKTOP_H
3
3
 
4
4
/** \file
5
5
 * SPDesktop: an editable view.
10
10
 *   bulia byak <buliabyak@users.sf.net>
11
11
 *   Ralf Stephan <ralf@ark.in-berlin.de>
12
12
 *   John Bintz <jcoswell@coswellproductions.org>
 
13
 *   Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
13
14
 *
 
15
 * Copyright (C) 2007 Johan Engelen
14
16
 * Copyright (C) 2006 John Bintz
15
17
 * Copyright (C) 1999-2005 authors
16
18
 * Copyright (C) 2000-2001 Ximian, Inc.
23
25
#include "config.h"
24
26
#endif
25
27
 
 
28
#include <gdk/gdkevents.h>
26
29
#include <gtk/gtktypeutils.h>
27
30
#include <sigc++/sigc++.h>
 
31
 
28
32
#include "libnr/nr-matrix.h"
29
33
#include "libnr/nr-matrix-fns.h"
30
34
#include "libnr/nr-rect.h"
33
37
 
34
38
class NRRect;
35
39
class SPCSSAttr;
 
40
struct _GtkWidget;
 
41
typedef struct _GtkWidget GtkWidget;
36
42
struct SPCanvas;
37
43
struct SPCanvasItem;
38
44
struct SPCanvasGroup;
44
50
struct SPStyle;
45
51
struct SPViewWidget;
46
52
 
 
53
namespace Gtk
 
54
{
 
55
  class Window;
 
56
}
 
57
 
47
58
typedef int sp_verb_t;
48
59
 
49
 
namespace Inkscape { 
 
60
 
 
61
 
 
62
namespace Inkscape {
50
63
  class Application;
51
64
  class MessageContext;
52
 
  class Selection; 
 
65
  class Selection;
53
66
  class ObjectHierarchy;
54
67
  class LayerManager;
55
68
  class EventLog;
56
 
  namespace UI { 
57
 
      namespace Dialog { 
58
 
          class DialogManager; 
 
69
  namespace UI {
 
70
      namespace Dialog {
 
71
          class DialogManager;
59
72
      }
60
73
  }
61
74
  namespace Whiteboard {
81
94
 
82
95
    SPCanvasItem  *acetate;
83
96
    SPCanvasGroup *main;
84
 
    SPCanvasGroup *grid;
 
97
    SPCanvasGroup *gridgroup;
85
98
    SPCanvasGroup *guides;
86
99
    SPCanvasItem  *drawing;
87
100
    SPCanvasGroup *sketch;
95
108
    GList *zooms_future;
96
109
    unsigned int dkey;
97
110
    unsigned int number;
98
 
    bool is_fullscreen;
 
111
    guint window_state;
99
112
    unsigned int interaction_disabled_counter;
 
113
    bool waiting_cursor;
100
114
 
101
115
    /// \todo fixme: This has to be implemented in different way */
102
116
    guint guides_active : 1;
103
117
 
104
 
    // storage for selected dragger used by GrDrag as it's 
 
118
    // storage for selected dragger used by GrDrag as it's
105
119
    // created and deleted by tools
106
120
    SPItem *gr_item;
107
 
    guint  gr_point_num;
108
 
    bool   gr_fill_or_stroke;   
 
121
    guint  gr_point_type;
 
122
    guint  gr_point_i;
 
123
    bool   gr_fill_or_stroke;
 
124
 
109
125
 
110
126
    Inkscape::ObjectHierarchy *_layer_hierarchy;
111
127
    gchar * _reconstruction_old_layer_id;
118
134
    {
119
135
        return _document_replaced_signal.connect (slot);
120
136
    }
121
 
    
122
 
    sigc::connection connectEventContextChanged (const sigc::slot<void,SPDesktop*,SPEventContext*> & slot) 
 
137
 
 
138
    sigc::connection connectEventContextChanged (const sigc::slot<void,SPDesktop*,SPEventContext*> & slot)
123
139
    {
124
140
        return _event_context_changed_signal.connect (slot);
125
141
    }
126
 
    sigc::connection connectSetStyle (const sigc::slot<bool, const SPCSSAttr *> & slot) 
 
142
    sigc::connection connectSetStyle (const sigc::slot<bool, const SPCSSAttr *> & slot)
127
143
    {
128
 
        return _set_style_signal.connect (slot);
 
144
        return _set_style_signal.connect (slot);
129
145
    }
130
 
    sigc::connection connectQueryStyle (const sigc::slot<int, SPStyle *, int> & slot) 
 
146
    sigc::connection connectQueryStyle (const sigc::slot<int, SPStyle *, int> & slot)
131
147
    {
132
 
        return _query_style_signal.connect (slot);
 
148
        return _query_style_signal.connect (slot);
133
149
    }
134
150
     // subselection is some sort of selection which is specific to the tool, such as a handle in gradient tool, or a text selection
135
151
    sigc::connection connectToolSubselectionChanged(const sigc::slot<void, gpointer> & slot) {
136
 
        return _tool_subselection_changed.connect(slot);
 
152
        return _tool_subselection_changed.connect(slot);
137
153
    }
138
 
    void emitToolSubselectionChanged(gpointer data); 
 
154
    void emitToolSubselectionChanged(gpointer data);
139
155
    sigc::connection connectCurrentLayerChanged(const sigc::slot<void, SPObject *> & slot) {
140
 
        return _layer_changed_signal.connect(slot);
 
156
        return _layer_changed_signal.connect(slot);
141
157
    }
142
 
    
143
 
        // Whiteboard changes
 
158
 
 
159
    // Whiteboard changes
144
160
 
145
161
#ifdef WITH_INKBOARD
146
 
        Inkscape::Whiteboard::SessionManager* whiteboard_session_manager() {
147
 
        return _whiteboard_session_manager;
148
 
        }
 
162
    Inkscape::Whiteboard::SessionManager* whiteboard_session_manager() {
 
163
        return _whiteboard_session_manager;
 
164
    }
149
165
 
150
 
        Inkscape::Whiteboard::SessionManager* _whiteboard_session_manager;
 
166
    Inkscape::Whiteboard::SessionManager* _whiteboard_session_manager;
151
167
#endif
152
 
   
 
168
 
153
169
    SPDesktop();
154
170
    void init (SPNamedView* nv, SPCanvas* canvas);
155
 
    ~SPDesktop();
 
171
    virtual ~SPDesktop();
156
172
    void destroy();
157
173
 
158
174
    Inkscape::MessageContext *guidesMessageContext() const {
159
 
        return _guides_message_context;
 
175
        return _guides_message_context;
160
176
    }
161
177
 
162
178
    void setDisplayModeNormal();
165
181
    int displayMode;
166
182
    int getMode() const { return displayMode; }
167
183
 
 
184
    Inkscape::UI::Widget::Dock* getDock() { return _widget->getDock(); }
 
185
 
168
186
    void set_active (bool new_active);
169
187
    SPObject *currentRoot() const;
170
188
    SPObject *currentLayer() const;
173
191
    bool isLayer(SPObject *object) const;
174
192
    bool isWithinViewport(SPItem *item) const;
175
193
    bool itemIsHidden(SPItem const *item) const;
176
 
    
 
194
 
177
195
    void activate_guides (bool activate);
178
196
    void change_document (SPDocument *document);
179
197
 
210
228
    void next_zoom();
211
229
 
212
230
    bool scroll_to_point (NR::Point const *s_dt, gdouble autoscrollspeed = 0);
213
 
    void scroll_world (double dx, double dy);
214
 
    void scroll_world (NR::Point const scroll)
 
231
    void scroll_world (double dx, double dy, bool is_scrolling = false);
 
232
    void scroll_world (NR::Point const scroll, bool is_scrolling = false)
215
233
    {
216
234
        using NR::X;
217
 
        using NR::Y;
218
 
        scroll_world(scroll[X], scroll[Y]);
 
235
        using NR::Y;
 
236
        scroll_world(scroll[X], scroll[Y], is_scrolling);
219
237
    }
220
238
 
221
239
    void getWindowGeometry (gint &x, gint &y, gint &w, gint &h);
222
240
    void setWindowPosition (NR::Point p);
223
241
    void setWindowSize (gint w, gint h);
224
242
    void setWindowTransient (void* p, int transient_policy=1);
 
243
    Gtk::Window* getToplevel();
225
244
    void presentWindow();
226
245
    bool warnDialog (gchar *text);
227
246
    void toggleRulers();
230
249
    void destroyWidget();
231
250
    void setToolboxFocusTo (gchar const* label);
232
251
    void setToolboxAdjustmentValue (gchar const* id, double val);
 
252
    void setToolboxSelectOneValue (gchar const* id, gint val);
233
253
    bool isToolboxButtonActive (gchar const *id);
234
254
    void updateNow();
235
255
    void updateCanvasNow();
236
 
    
 
256
 
237
257
    void enableInteraction();
238
258
    void disableInteraction();
239
 
    
 
259
 
 
260
    void setWaitingCursor();
 
261
    void clearWaitingCursor();
 
262
 
 
263
    void toggleColorProfAdjust();
 
264
 
 
265
    void toggleGrids();
 
266
    void toggleSnapping();
 
267
    bool gridsEnabled() { return grids_visible; }
 
268
    void showGrids(bool show, bool dirty_document = true);
 
269
 
 
270
    bool is_iconified();
 
271
    bool is_maximized();
 
272
    bool is_fullscreen();
 
273
 
 
274
    void iconify();
 
275
    void maximize();
240
276
    void fullscreen();
241
277
 
242
278
    void registerEditWidget (Inkscape::UI::View::EditWidgetInterface *widget)
243
279
    { _widget = widget; }
244
280
 
245
 
    NR::Matrix w2d() const;
 
281
    NR::Matrix w2d() const; //transformation from window to desktop coordinates (used for zooming)
246
282
    NR::Point w2d(NR::Point const &p) const;
247
283
    NR::Point d2w(NR::Point const &p) const;
248
284
    NR::Matrix doc2dt() const;
254
290
    virtual void mouseover() {}
255
291
    virtual void mouseout() {}
256
292
 
 
293
    virtual bool onDeleteUI (GdkEventAny*);
 
294
    virtual bool onWindowStateEvent (GdkEventWindowState* event);
 
295
 
257
296
private:
258
297
    Inkscape::UI::View::EditWidgetInterface       *_widget;
259
298
    Inkscape::Application     *_inkscape;
262
301
    NR::Matrix _w2d;
263
302
    NR::Matrix _d2w;
264
303
    NR::Matrix _doc2dt;
265
 
    
 
304
 
 
305
    bool grids_visible; /* don't set this variable directly, use the method below */
 
306
    void set_grids_visible(bool visible);
 
307
 
266
308
    void push_current_zoom (GList**);
267
309
 
268
310
    sigc::signal<void,SPDesktop*,SPDocument*>     _document_replaced_signal;
270
312
    sigc::signal<void>                 _deactivate_signal;
271
313
    sigc::signal<void,SPDesktop*,SPEventContext*> _event_context_changed_signal;
272
314
    sigc::signal<void, gpointer>       _tool_subselection_changed;
273
 
  
 
315
 
274
316
    sigc::connection _activate_connection;
275
317
    sigc::connection _deactivate_connection;
276
318
    sigc::connection _sel_modified_connection;
279
321
    sigc::connection _reconstruction_finish_connection;
280
322
    sigc::connection _commit_connection;
281
323
    sigc::connection _modified_connection;
282
 
    
 
324
 
283
325
    virtual void onPositionSet (double, double);
284
326
    virtual void onResized (double, double);
285
327
    virtual void onRedrawRequested();
292
334
    static void _onSelectionModified (Inkscape::Selection *selection, guint flags, SPDesktop *dt);
293
335
};
294
336
 
295
 
#endif
 
337
#endif // SEEN_SP_DESKTOP_H
296
338
 
297
339
/*
298
340
  Local Variables: