desktop.h revision fb9b3fab56a9ba69208ffc2536941761f43c4a71
#ifndef SEEN_SP_DESKTOP_H
#define SEEN_SP_DESKTOP_H
/*
* Author:
* Lauris Kaplinski <lauris@kaplinski.com>
* Frank Felfe <innerspace@iname.com>
* bulia byak <buliabyak@users.sf.net>
* Ralf Stephan <ralf@ark.in-berlin.de>
* John Bintz <jcoswell@coswellproductions.org>
* Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
* Jon A. Cruz <jon@joncruz.org>get
* Abhishek Sharma
*
* Copyright (C) 2007 Johan Engelen
* Copyright (C) 2006 John Bintz
* Copyright (C) 1999-2005 authors
* Copyright (C) 2000-2001 Ximian, Inc.
*
* Released under GNU GPL, read the file 'COPYING' for more information
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stddef.h>
#include "display/rendermode.h"
#include "sp-gradient.h" // TODO refactor enums out to their own .h file
struct SPCanvas;
struct SPCanvasItem;
struct SPCanvasGroup;
struct SPEventContext;
struct SPNamedView;
struct SPStyle;
{
}
typedef int sp_verb_t;
struct _GdkEventAny;
typedef struct _GdkEventAny GdkEventAny;
struct _GdkEventWindowState;
typedef struct _GdkEventWindowState GdkEventWindowState;
}
}
}
}
}
}
}
/**
* SPDesktop is a subclass of View, implementing an editable document
* canvas. It is extensively used by many UI controls that need certain
* visual representations of their own.
*
* SPDesktop provides a certain set of SPCanvasItems, serving as GUI
* layers of different control objects. The one containing the whole
* document is the drawing layer. In addition to it, there are grid,
* guide, sketch and control layers. The sketch layer is used for
* temporary drawing objects, before the real objects in document are
* created. The control layer contains editing knots, rubberband and
* similar non-document UI objects.
*
* Each SPDesktop is associated with a SPNamedView node of the document
* tree. Currently, all desktops are created from a single main named
* view, but in the future there may be support for different ones.
* SPNamedView serves as an in-document container for desktop-related
* data, like grid and guideline placement, snapping options and so on.
*
* Associated with each SPDesktop are the two most important editing
* related objects - SPSelection and SPEventContext.
*
* Sodipodi keeps track of the active desktop and invokes notification
* signals whenever it changes. UI elements can use these to update their
* display to the selection of the currently active editing window.
* (Lauris Kaplinski)
*
* @see \ref desktop-handles.h for desktop macros.
*/
{
/// current selection; will never generally be NULL
bool _focusMode; ///< Whether we're focused working or general working
bool _quick_zoom_enabled; ///< Signifies that currently we're in quick zoom mode
unsigned int dkey;
unsigned int number;
unsigned int interaction_disabled_counter;
bool waiting_cursor;
bool showing_dialogs;
/// \todo fixme: This has to be implemented in different way */
// storage for selected dragger used by GrDrag as it's
// created and deleted by tools
/// Emitted when the zoom factor changes (not emitted when scrolling).
/// The parameter is the new zoom factor
{
}
{
}
sigc::connection connectEventContextChanged (const sigc::slot<void,SPDesktop*,SPEventContext*> & slot)
{
}
{
}
{
}
// subselection is some sort of selection which is specific to the tool, such as a handle in gradient tool, or a text selection
}
}
// Whiteboard changes
#ifdef WITH_INKBOARD
return _whiteboard_session_manager;
}
#endif
/**
* Return new desktop object.
* \pre namedview != NULL.
* \pre canvas != NULL.
*/
SPDesktop();
void destroy();
return _guides_message_context;
}
Inkscape::Display::TemporaryItem * add_temporary_canvasitem (SPCanvasItem *item, guint lifetime, bool move_to_bottom = true);
void setDisplayModeNormal() {
}
void setDisplayModeNoFilters() {
}
void setDisplayModeOutline() {
}
void displayModeToggle();
void setDisplayColorModeNormal() {
}
void setDisplayColorModeGrayscale() {
}
// void setDisplayColorModePrintColorsPreview() {
// _setDisplayColorMode(Inkscape::COLORMODE_PRINT_COLORS_PREVIEW);
// }
void displayColorModeToggle();
void set_active (bool new_active);
// TODO look into making these return a more specific subclass:
SPObject *currentRoot() const;
SPObject *currentLayer() const;
void toggleHideAllLayers(bool hide);
void toggleLockAllLayers(bool lock);
void activate_guides (bool activate);
{
}
void zoom_page();
void zoom_page_width();
void zoom_drawing();
void zoom_selection();
void zoom_grab_focus();
void prev_zoom();
void next_zoom();
void zoom_quick(bool enable = true);
/** \brief Returns whether the desktop is in quick zoom mode or not */
bool quick_zoomed(void) { return _quick_zoom_enabled; }
{
}
void presentWindow();
void toggleRulers();
void toggleScrollbars();
void layoutWidget();
void destroyWidget();
void updateNow();
void updateCanvasNow();
void enableInteraction();
void disableInteraction();
void setWaitingCursor();
void clearWaitingCursor();
bool isWaitingCursor() const { return waiting_cursor; };
void toggleColorProfAdjust();
bool colorProfAdjustEnabled();
void toggleGrids();
void toggleSnapGlobal();
bool gridsEnabled() const { return grids_visible; };
bool is_iconified();
bool is_maximized();
bool is_fullscreen();
bool is_focusMode();
void iconify();
void maximize();
void fullscreen();
/**
* Reopen any dialogs that were open when inkscape last shutdown
*/
void show_dialogs();
bool _active;
bool grids_visible; /* don't set this variable directly, use the method below */
void set_grids_visible(bool visible);
virtual void onPositionSet (double, double);
virtual void onRedrawRequested();
virtual void onDocumentResized (double, double);
};
#endif // SEEN_SP_DESKTOP_H
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :