Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-studio / tags / 0.61.08 / 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 #include "general.h"
36
37 #endif
38
39 /* === U S I N G =========================================================== */
40
41 using namespace std;
42 using namespace etl;
43 using namespace synfig;
44 using namespace studio;
45
46 /* === M A C R O S ========================================================= */
47
48 /* === G L O B A L S ======================================================= */
49
50 /* === P R O C E D U R E S ================================================= */
51
52 /* === M E T H O D S ======================================================= */
53
54 WorkAreaRenderer::WorkAreaRenderer():
55         enabled_(true),
56         priority_(0)
57 {
58 }
59
60 WorkAreaRenderer::~WorkAreaRenderer()
61 {
62 }
63
64 bool
65 WorkAreaRenderer::get_enabled_vfunc()const
66 {
67         return enabled_;
68 }
69
70 void
71 WorkAreaRenderer::set_enabled(bool x)
72 {
73         if(x==enabled_)
74                 return;
75         enabled_=x;
76         signal_changed()();
77 }
78
79 void
80 WorkAreaRenderer::set_priority(int x)
81 {
82         if(x==priority_)
83                 return;
84         priority_=x;
85         signal_changed()();
86 }
87
88 void
89 WorkAreaRenderer::set_work_area(WorkArea* x)
90 {
91         work_area_=x;
92 }
93
94 void
95 WorkAreaRenderer::render_vfunc(
96         const Glib::RefPtr<Gdk::Drawable>& /*window*/,
97         const Gdk::Rectangle& /*expose_area*/
98 )
99 {
100 }
101
102 bool
103 WorkAreaRenderer::event_vfunc(
104         GdkEvent* /*event*/
105 )
106 {
107         return false;
108 }
109
110 int
111 WorkAreaRenderer::get_w()const
112 { return get_work_area()->get_w(); }
113 int
114 WorkAreaRenderer::get_h()const
115 { return get_work_area()->get_h(); }
116
117 float
118 WorkAreaRenderer::get_pw()const
119 { return get_work_area()->get_pw(); }
120 float
121 WorkAreaRenderer::get_ph()const
122 { return get_work_area()->get_ph(); }
123
124 synfig::Point
125 WorkAreaRenderer::screen_to_comp_coords(synfig::Point pos)const
126 {
127         return get_work_area()->screen_to_comp_coords(pos);
128 }
129
130 synfig::Point
131 WorkAreaRenderer::comp_to_screen_coords(synfig::Point pos)const
132 {
133         return get_work_area()->comp_to_screen_coords(pos);
134 }