/* -*- C++ -*- * Copyright ©2004 Hugo Mills * * This software is distributed under the terms of the GNU GPL v3 * For more information on the GPL, see the file COPYING or * visit http://www.gnu.org/ * * This software is distributed without warranty */ #ifndef XFVIEW_H #define XFVIEW_H #include "magellan/vectors.h" #include "magellan/configlexer.h" #include "magellan/plugininfo.h" #include "magellan/plugin.h" class OutsideViewport { }; class RenderContext; class XfView : public Plugin { public: XfView() : bottom_left(ivec2(0)), top_right(ivec2(100)), centre(ivec2(50)), scale(50.0) { } XfView(const ivec2& bl, const ivec2& tr, const ivec2& cn, double sc) : bottom_left(bl), top_right(tr), centre(cn), scale(sc) { } virtual bool f(ivec2&, const dvec2&) const; virtual bool g(dvec2&, const ivec2&) const; virtual int left(void) const { return bottom_left[0]; } virtual int bottom(void) const { return bottom_left[1]; } virtual int right(void) const { return top_right[0]; } virtual int top(void) const { return top_right[1]; } virtual double scaling(void) const { return scale; } static XfView* parse(ConfigLexer*, const std::string&, const std::string&); static PluginInfo* getmodules(int i); protected: virtual ~XfView() { } private: ivec2 bottom_left, top_right; ivec2 centre; double scale; void set_left(int); void set_bottom(int); friend class RenderContext; }; #endif