Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-core / tags / synfig_0_61_04 / synfig-core / src / synfig / layer_pastecanvas.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file layer_pastecanvas.h
3 **      \brief Template Header
4 **
5 **      $Id: layer_pastecanvas.h,v 1.2 2005/01/24 03:08:18 darco Exp $
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 /* === S T A R T =========================================================== */
24
25 #ifndef __SYNFIG_LAYER_PASTEIMAGE_H
26 #define __SYNFIG_LAYER_PASTEIMAGE_H
27
28 /* === H E A D E R S ======================================================= */
29
30 #include "layer_composite.h"
31 #include "color.h"
32 #include "vector.h"
33 #include "real.h"
34 #include "time.h"
35 #include "canvasbase.h"
36 #include "canvas.h"
37 #include "rect.h"
38
39 /* === M A C R O S ========================================================= */
40
41 /* === T Y P E D E F S ===================================================== */
42
43 /* === C L A S S E S & S T R U C T S ======================================= */
44
45 namespace synfig {
46         
47 class Layer_PasteCanvas : public Layer_Composite, public Layer_NoDeform
48 {
49         SYNFIG_LAYER_MODULE_EXT
50 private:
51
52         Vector origin;
53
54         etl::loose_handle<synfig::Canvas> canvas;
55
56         //! Recursion depth counter
57         mutable int depth;
58
59         Real zoom;
60
61         Time time_offset;
62
63         mutable Time curr_time;
64
65         bool optimize_layers(synfig::Context context,synfig::CanvasBase&)const;
66
67         bool do_not_muck_with_time_;
68         
69         bool children_lock;
70
71         mutable Rect bounds;
72
73         sigc::connection child_changed_connection;
74 public:
75
76         virtual void on_canvas_set();
77
78         void set_do_not_muck_with_time(bool x=true) { do_not_muck_with_time_=true; }
79
80         etl::handle<synfig::Canvas> get_sub_canvas()const { return canvas; }
81         void set_sub_canvas(etl::handle<synfig::Canvas> x);
82         
83         Real get_zoom()const { return zoom; }
84
85         Time get_time_offset()const { return time_offset; }
86
87         Point get_origin()const { return origin; }
88
89         Layer_PasteCanvas();
90         virtual ~Layer_PasteCanvas();
91
92         virtual String get_local_name()const;
93         
94         virtual bool set_param(const String & param, const synfig::ValueBase &value);
95
96         virtual ValueBase get_param(const String & param)const;
97
98         virtual Color get_color(Context context, const Point &pos)const;
99
100         virtual void set_time(Context context, Time time)const;
101
102         virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
103
104         virtual Vocab get_param_vocab()const;
105
106         virtual synfig::Rect get_bounding_rect()const;
107
108         virtual synfig::Layer::Handle hit_check(synfig::Context context, const synfig::Point &point)const;
109         
110 protected:
111         virtual void get_times_vfunc(Node::time_set &set) const;        
112
113 }; // END of class Layer_PasteCanvas
114
115 }; // END of namespace synfig
116
117 /* === E N D =============================================================== */
118
119 #endif