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