view.h revision 109e6513fe12819f639b71b6ae98b28d1fce4aab
#ifndef INKSCAPE_UI_VIEW_VIEW_H
#define INKSCAPE_UI_VIEW_VIEW_H
/** \file
* Abstract base class for all SVG document views
*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* Ralf Stephan <ralf@ark.in-berlin.de>
*
* Copyright (C) 2001-2002 Lauris Kaplinski
* Copyright (C) 2001 Ximian, Inc.
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <gdk/gdktypes.h>
#include <sigc++/connection.h>
#include "message.h"
#include "gc-managed.h"
#include "gc-finalized.h"
#include "gc-anchored.h"
/**
* Iterates until true or returns false.
* When used as signal accumulator, stops emission if one slot returns true.
*/
struct StopOnTrue {
typedef bool result_type;
if (*first) return true;
return false;
}
};
/**
* Iterates until nonzero or returns 0.
* When used as signal accumulator, stops emission if one slot returns nonzero.
*/
struct StopOnNonZero {
typedef int result_type;
return 0;
}
};
}
/**
* View is an abstract base class of all UI document views. This
* includes both the editing window and the SVG preview, but does not
* include the non-UI RGBA buffer-based NRArena nor the XML editor or
* similar views. The View base class has very little functionality of
* its own.
*/
{
View();
/// Returns a pointer to the view's document.
SPDocument *doc() const
{ return _doc; }
/// Returns a pointer to the view's message stack.
{ return _message_stack; }
/// Returns a pointer to the view's tipsMessageContext.
{ return _tips_message_context; }
void requestRedraw();
// view subclasses must give implementations of these methods
virtual void onPositionSet (double, double) = 0;
virtual void onRedrawRequested() = 0;
virtual void onDocumentResized (double, double) = 0;
};
}}}
#endif // INKSCAPE_UI_VIEW_VIEW_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 :