Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-studio / tags / synfigstudio_0_61_07_rc3 / src / gtkmm / workarearenderer.cpp
1 /* === S Y N F I G ========================================================= */
2 /*!     \file workarearenderer.cpp
3 **      \brief Template File
4 **
5 **      $Id$
6 **
7 **      \legal
8 **      Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 **
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.
14 **
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.
19 **      \endlegal
20 */
21 /* ========================================================================= */
22
23 /* === H E A D E R S ======================================================= */
24
25 #ifdef USING_PCH
26 #       include "pch.h"
27 #else
28 #ifdef HAVE_CONFIG_H
29 #       include <config.h>
30 #endif
31
32 #include "workarearenderer.h"
33 #include "workarea.h"
34
35 #endif
36
37 /* === U S I N G =========================================================== */
38
39 using namespace std;
40 using namespace etl;
41 using namespace synfig;
42 using namespace studio;
43
44 /* === M A C R O S ========================================================= */
45
46 /* === G L O B A L S ======================================================= */
47
48 /* === P R O C E D U R E S ================================================= */
49
50 /* === M E T H O D S ======================================================= */
51
52 WorkAreaRenderer::WorkAreaRenderer():
53         enabled_(true),
54         priority_(0)
55 {
56 }
57
58 WorkAreaRenderer::~WorkAreaRenderer()
59 {
60 }
61
62 bool
63 WorkAreaRenderer::get_enabled_vfunc()const
64 {
65         return enabled_;
66 }
67
68 void
69 WorkAreaRenderer::set_enabled(bool x)
70 {
71         if(x==enabled_)
72                 return;
73         enabled_=x;
74         signal_changed()();
75 }
76
77 void
78 WorkAreaRenderer::set_priority(int x)
79 {
80         if(x==priority_)
81                 return;
82         priority_=x;
83         signal_changed()();
84 }
85
86 void
87 WorkAreaRenderer::set_work_area(WorkArea* x)
88 {
89         work_area_=x;
90 }
91
92 void
93 WorkAreaRenderer::render_vfunc(
94         const Glib::RefPtr<Gdk::Drawable>& /*window*/,
95         const Gdk::Rectangle& /*expose_area*/
96 )
97 {
98 }
99
100 bool
101 WorkAreaRenderer::event_vfunc(
102         GdkEvent* /*event*/
103 )
104 {
105         return false;
106 }
107
108 int
109 WorkAreaRenderer::get_w()const
110 { return get_work_area()->get_w(); }
111 int
112 WorkAreaRenderer::get_h()const
113 { return get_work_area()->get_h(); }
114
115 float
116 WorkAreaRenderer::get_pw()const
117 { return get_work_area()->get_pw(); }
118 float
119 WorkAreaRenderer::get_ph()const
120 { return get_work_area()->get_ph(); }
121
122 synfig::Point
123 WorkAreaRenderer::screen_to_comp_coords(synfig::Point pos)const
124 {
125         return get_work_area()->screen_to_comp_coords(pos);
126 }
127
128 synfig::Point
129 WorkAreaRenderer::comp_to_screen_coords(synfig::Point pos)const
130 {
131         return get_work_area()->comp_to_screen_coords(pos);
132 }