1 /* === S Y N F I G ========================================================= */
3 ** \brief Template Header
5 ** $Id: workarearenderer.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
10 ** This package is free software; you can redistribute it and/or
11 ** modify it under the terms of the GNU General Public License as
12 ** published by the Free Software Foundation; either version 2 of
13 ** the License, or (at your option) any later version.
15 ** This package is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ** General Public License for more details.
21 /* ========================================================================= */
23 /* === S T A R T =========================================================== */
25 #ifndef __SYNFIG_WORKAREARENDERER_H
26 #define __SYNFIG_WORKAREARENDERER_H
28 /* === H E A D E R S ======================================================= */
31 #include <sigc++/signal.h>
32 #include <sigc++/object.h>
33 #include <synfig/vector.h>
34 #include <gdkmm/drawable.h>
35 #include <gdkmm/rectangle.h>
37 /* === M A C R O S ========================================================= */
39 /* === T Y P E D E F S ===================================================== */
41 /* === C L A S S E S & S T R U C T S ======================================= */
46 class WorkAreaRenderer : public etl::shared_object, public sigc::trackable
49 typedef etl::handle<WorkAreaRenderer> Handle;
50 typedef etl::loose_handle<WorkAreaRenderer> LooseHandle;
56 sigc::signal<void> signal_changed_;
62 sigc::signal<void>& signal_changed() { return signal_changed_; }
71 //! Converts screen coords (ie: pixels) to composition coordinates
72 synfig::Point screen_to_comp_coords(synfig::Point pos)const;
74 //! Converts composition coordinates to screen coords (ie: pixels)
75 synfig::Point comp_to_screen_coords(synfig::Point pos)const;
78 virtual ~WorkAreaRenderer();
80 bool get_enabled()const { return get_enabled_vfunc(); }
81 int get_priority()const { return priority_; }
82 WorkArea* get_work_area()const { return work_area_; }
84 void set_enabled(bool x);
85 void set_priority(int x);
86 void set_work_area(WorkArea* work_area_);
88 virtual void render_vfunc(
89 const Glib::RefPtr<Gdk::Drawable>& window,
90 const Gdk::Rectangle& expose_area
93 virtual bool event_vfunc(
99 virtual bool get_enabled_vfunc()const;
102 bool operator<(const WorkAreaRenderer &rhs)
103 { return priority_<rhs.priority_; }
106 inline bool operator<(const WorkAreaRenderer::Handle &lhs,const WorkAreaRenderer::Handle &rhs)
107 { return lhs->get_priority() < rhs->get_priority(); }
109 inline bool operator<(const WorkAreaRenderer::LooseHandle &lhs,const WorkAreaRenderer::LooseHandle &rhs)
110 { return lhs->get_priority() < rhs->get_priority(); }
112 }; // END of namespace studio
114 /* === E N D =============================================================== */