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 Robert B. Quattlebaum Jr.
10 ** This software and associated documentation
11 ** are CONFIDENTIAL and PROPRIETARY property of
12 ** the above-mentioned copyright holder.
14 ** You may not copy, print, publish, or in any
15 ** other way distribute this software without
16 ** a prior written agreement with
17 ** the copyright holder.
20 /* ========================================================================= */
22 /* === S T A R T =========================================================== */
24 #ifndef __SYNFIG_WORKAREARENDERER_H
25 #define __SYNFIG_WORKAREARENDERER_H
27 /* === H E A D E R S ======================================================= */
30 #include <sigc++/signal.h>
31 #include <sigc++/object.h>
32 #include <synfig/vector.h>
33 #include <gdkmm/drawable.h>
34 #include <gdkmm/rectangle.h>
36 /* === M A C R O S ========================================================= */
38 /* === T Y P E D E F S ===================================================== */
40 /* === C L A S S E S & S T R U C T S ======================================= */
45 class WorkAreaRenderer : public etl::shared_object, public sigc::trackable
48 typedef etl::handle<WorkAreaRenderer> Handle;
49 typedef etl::loose_handle<WorkAreaRenderer> LooseHandle;
55 sigc::signal<void> signal_changed_;
61 sigc::signal<void>& signal_changed() { return signal_changed_; }
70 //! Converts screen coords (ie: pixels) to composition coordinates
71 synfig::Point screen_to_comp_coords(synfig::Point pos)const;
73 //! Converts composition coordinates to screen coords (ie: pixels)
74 synfig::Point comp_to_screen_coords(synfig::Point pos)const;
77 virtual ~WorkAreaRenderer();
79 bool get_enabled()const { return get_enabled_vfunc(); }
80 int get_priority()const { return priority_; }
81 WorkArea* get_work_area()const { return work_area_; }
83 void set_enabled(bool x);
84 void set_priority(int x);
85 void set_work_area(WorkArea* work_area_);
87 virtual void render_vfunc(
88 const Glib::RefPtr<Gdk::Drawable>& window,
89 const Gdk::Rectangle& expose_area
92 virtual bool event_vfunc(
98 virtual bool get_enabled_vfunc()const;
101 bool operator<(const WorkAreaRenderer &rhs)
102 { return priority_<rhs.priority_; }
105 inline bool operator<(const WorkAreaRenderer::Handle &lhs,const WorkAreaRenderer::Handle &rhs)
106 { return lhs->get_priority() < rhs->get_priority(); }
108 inline bool operator<(const WorkAreaRenderer::LooseHandle &lhs,const WorkAreaRenderer::LooseHandle &rhs)
109 { return lhs->get_priority() < rhs->get_priority(); }
111 }; // END of namespace studio
113 /* === E N D =============================================================== */