X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftags%2Fsynfigstudio_0_61_07_rc3%2Fsrc%2Fgtkmm%2Fworkarearenderer.h;fp=synfig-studio%2Ftags%2Fsynfigstudio_0_61_07_rc3%2Fsrc%2Fgtkmm%2Fworkarearenderer.h;h=fd79bb6de942e6f46d05b855ec3352063e394065;hb=1f5a0e6a86f9cf4798b6e1fb8dfcb4b6e84beb5d;hp=0000000000000000000000000000000000000000;hpb=0e729dddd753ed872265ba82c0089bc55e64bf55;p=synfig.git diff --git a/synfig-studio/tags/synfigstudio_0_61_07_rc3/src/gtkmm/workarearenderer.h b/synfig-studio/tags/synfigstudio_0_61_07_rc3/src/gtkmm/workarearenderer.h new file mode 100644 index 0000000..fd79bb6 --- /dev/null +++ b/synfig-studio/tags/synfigstudio_0_61_07_rc3/src/gtkmm/workarearenderer.h @@ -0,0 +1,116 @@ +/* === S Y N F I G ========================================================= */ +/*! \file workarearenderer.h +** \brief Template Header +** +** $Id$ +** +** \legal +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** +** This package is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License as +** published by the Free Software Foundation; either version 2 of +** the License, or (at your option) any later version. +** +** This package is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** General Public License for more details. +** \endlegal +*/ +/* ========================================================================= */ + +/* === S T A R T =========================================================== */ + +#ifndef __SYNFIG_WORKAREARENDERER_H +#define __SYNFIG_WORKAREARENDERER_H + +/* === H E A D E R S ======================================================= */ + +#include +#include +#include +#include +#include +#include + +/* === M A C R O S ========================================================= */ + +/* === T Y P E D E F S ===================================================== */ + +/* === C L A S S E S & S T R U C T S ======================================= */ + +namespace studio { +class WorkArea; + +class WorkAreaRenderer : public etl::shared_object, public sigc::trackable +{ +public: + typedef etl::handle Handle; + typedef etl::loose_handle LooseHandle; + +private: + bool enabled_; + int priority_; + + sigc::signal signal_changed_; + + WorkArea* work_area_; + +public: + + sigc::signal& signal_changed() { return signal_changed_; } + +public: + int get_w()const; + int get_h()const; + + float get_pw()const; + float get_ph()const; + + //! Converts screen coords (ie: pixels) to composition coordinates + synfig::Point screen_to_comp_coords(synfig::Point pos)const; + + //! Converts composition coordinates to screen coords (ie: pixels) + synfig::Point comp_to_screen_coords(synfig::Point pos)const; + + WorkAreaRenderer(); + virtual ~WorkAreaRenderer(); + + bool get_enabled()const { return get_enabled_vfunc(); } + int get_priority()const { return priority_; } + WorkArea* get_work_area()const { return work_area_; } + + void set_enabled(bool x); + void set_priority(int x); + void set_work_area(WorkArea* work_area_); + + virtual void render_vfunc( + const Glib::RefPtr& window, + const Gdk::Rectangle& expose_area + ); + + virtual bool event_vfunc( + GdkEvent* event + ); + +protected: + + virtual bool get_enabled_vfunc()const; + +public: + bool operator<(const WorkAreaRenderer &rhs) + { return priority_get_priority() < rhs->get_priority(); } + +inline bool operator<(const WorkAreaRenderer::LooseHandle &lhs,const WorkAreaRenderer::LooseHandle &rhs) + { return lhs->get_priority() < rhs->get_priority(); } + +}; // END of namespace studio + +/* === E N D =============================================================== */ + +#endif