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