annotate window/picture.h @ 31:5ae5533b3a9a

* Added some license headers
author thib
date Sat, 07 Mar 2009 21:36:46 +0000
parents 223b71206888
children 15a18fbe6f21
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
31
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
1 /*
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
2 * Copyright (c) 2004-2006 Kazunori "jagarl" Ueno
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
3 * All rights reserved.
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
4 *
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
5 * Redistribution and use in source and binary forms, with or without
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
6 * modification, are permitted provided that the following conditions
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
7 * are met:
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
8 * 1. Redistributions of source code must retain the above copyright
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
9 * notice, this list of conditions and the following disclaimer.
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
10 * 2. Redistributions in binary form must reproduce the above copyright
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
11 * notice, this list of conditions and the following disclaimer in the
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
12 * documentation and/or other materials provided with the distribution.
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
13 * 3. The name of the author may not be used to endorse or promote products
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
14 * derived from this software without specific prior written permission.
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
15 *
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
26 */
5ae5533b3a9a * Added some license headers
thib
parents: 0
diff changeset
27
0
223b71206888 Initial import
thib
parents:
diff changeset
28 #ifndef __PICTURE__
223b71206888 Initial import
thib
parents:
diff changeset
29 #define __PICTURE__
223b71206888 Initial import
thib
parents:
diff changeset
30
223b71206888 Initial import
thib
parents:
diff changeset
31 #include<vector>
223b71206888 Initial import
thib
parents:
diff changeset
32 #include<list>
223b71206888 Initial import
thib
parents:
diff changeset
33 #ifdef HAVE_CONFIG_H
223b71206888 Initial import
thib
parents:
diff changeset
34 # include "config.h"
223b71206888 Initial import
thib
parents:
diff changeset
35 #endif
223b71206888 Initial import
thib
parents:
diff changeset
36
223b71206888 Initial import
thib
parents:
diff changeset
37 class PicBase;
223b71206888 Initial import
thib
parents:
diff changeset
38 class PicContainer;
223b71206888 Initial import
thib
parents:
diff changeset
39 class PicRoot;
223b71206888 Initial import
thib
parents:
diff changeset
40
223b71206888 Initial import
thib
parents:
diff changeset
41 class Surface;
223b71206888 Initial import
thib
parents:
diff changeset
42
223b71206888 Initial import
thib
parents:
diff changeset
43 namespace Event {
223b71206888 Initial import
thib
parents:
diff changeset
44 class Video;
223b71206888 Initial import
thib
parents:
diff changeset
45 }
223b71206888 Initial import
thib
parents:
diff changeset
46
223b71206888 Initial import
thib
parents:
diff changeset
47 /* PicBase の内容をイベントと連動させるためのインターフェース */
223b71206888 Initial import
thib
parents:
diff changeset
48 class PicAnm {
223b71206888 Initial import
thib
parents:
diff changeset
49 public:
223b71206888 Initial import
thib
parents:
diff changeset
50 typedef std::vector<PicBase*>::iterator iterator;
223b71206888 Initial import
thib
parents:
diff changeset
51 std::vector<PicBase*> pic;
223b71206888 Initial import
thib
parents:
diff changeset
52 PicAnm(PicBase* pic);
223b71206888 Initial import
thib
parents:
diff changeset
53 PicAnm(std::vector<PicBase*> pic);
223b71206888 Initial import
thib
parents:
diff changeset
54 virtual ~PicAnm();
223b71206888 Initial import
thib
parents:
diff changeset
55 };
223b71206888 Initial import
thib
parents:
diff changeset
56
223b71206888 Initial import
thib
parents:
diff changeset
57 class PicBase {
223b71206888 Initial import
thib
parents:
diff changeset
58 friend class PicContainer;
223b71206888 Initial import
thib
parents:
diff changeset
59 friend class PicWidget;
223b71206888 Initial import
thib
parents:
diff changeset
60
223b71206888 Initial import
thib
parents:
diff changeset
61 typedef std::list<PicBase*> List;
223b71206888 Initial import
thib
parents:
diff changeset
62 typedef std::list<PicBase*>::iterator iterator;
223b71206888 Initial import
thib
parents:
diff changeset
63
223b71206888 Initial import
thib
parents:
diff changeset
64 PicContainer* parent;
223b71206888 Initial import
thib
parents:
diff changeset
65 class PicWidget* widget;
223b71206888 Initial import
thib
parents:
diff changeset
66 Rect rel_pos; // relative position to the parent
223b71206888 Initial import
thib
parents:
diff changeset
67 Rect rel_solid_area; // solid area(not alpha-blended) to the parent
223b71206888 Initial import
thib
parents:
diff changeset
68 Rect clip_area; // clip area on the parent
223b71206888 Initial import
thib
parents:
diff changeset
69 bool is_hidden;
223b71206888 Initial import
thib
parents:
diff changeset
70 bool is_hidden_now;
223b71206888 Initial import
thib
parents:
diff changeset
71 bool is_cached;
223b71206888 Initial import
thib
parents:
diff changeset
72 public:
223b71206888 Initial import
thib
parents:
diff changeset
73 enum { /*MOBILE=1,*/ CACHE_BACK=2, /* CACHE_SELF=4,*/ NO_PICTURE=8, SOLID = 16, SURFACE_FREE = 32, FIT_SURFACE = 64, BLIT_SATURATE = 128, BLIT_MULTIPLY = 256, ALPHA_FREE=512};
223b71206888 Initial import
thib
parents:
diff changeset
74 private:
223b71206888 Initial import
thib
parents:
diff changeset
75 int attribute;
223b71206888 Initial import
thib
parents:
diff changeset
76
223b71206888 Initial import
thib
parents:
diff changeset
77 PicRoot* root;
223b71206888 Initial import
thib
parents:
diff changeset
78 iterator z_pos;
223b71206888 Initial import
thib
parents:
diff changeset
79 int surface_x, surface_y, surface_w, surface_h;
223b71206888 Initial import
thib
parents:
diff changeset
80 Surface* surface_back;
223b71206888 Initial import
thib
parents:
diff changeset
81 Surface* surface_own;
223b71206888 Initial import
thib
parents:
diff changeset
82 const unsigned char* surface_alpha;
223b71206888 Initial import
thib
parents:
diff changeset
83 Rect surface_alpha_rect;
223b71206888 Initial import
thib
parents:
diff changeset
84 int distance_root;
223b71206888 Initial import
thib
parents:
diff changeset
85
223b71206888 Initial import
thib
parents:
diff changeset
86 void Blit(const Rect& rpos);
223b71206888 Initial import
thib
parents:
diff changeset
87 void Blit(void) {
223b71206888 Initial import
thib
parents:
diff changeset
88 is_cached = true;
223b71206888 Initial import
thib
parents:
diff changeset
89 Blit(Rect(0, 0, rel_pos.width(), rel_pos.height()));
223b71206888 Initial import
thib
parents:
diff changeset
90 }
223b71206888 Initial import
thib
parents:
diff changeset
91 /*
223b71206888 Initial import
thib
parents:
diff changeset
92 ** rpos : relative position to the widget
223b71206888 Initial import
thib
parents:
diff changeset
93 ** ppos : relative position to the parent
223b71206888 Initial import
thib
parents:
diff changeset
94 ** ppos = parent_pos(rpos)
223b71206888 Initial import
thib
parents:
diff changeset
95 ** rpos = child_pos(ppos, parent->this_widget)
223b71206888 Initial import
thib
parents:
diff changeset
96 ** cpos : relative position to a child widget
223b71206888 Initial import
thib
parents:
diff changeset
97 ** cpos = child_pos(rpos, a_child_widget)
223b71206888 Initial import
thib
parents:
diff changeset
98 ** apos : absolute position in the screen
223b71206888 Initial import
thib
parents:
diff changeset
99 ** apos = QueryAbsPos(rpos);
223b71206888 Initial import
thib
parents:
diff changeset
100 ** or
223b71206888 Initial import
thib
parents:
diff changeset
101 ** Rect ppos = rel_pos;
223b71206888 Initial import
thib
parents:
diff changeset
102 ** apos = parent->QueryAbsPos(ppos);
223b71206888 Initial import
thib
parents:
diff changeset
103 ** the latter form is used for 'rel_pos',
223b71206888 Initial import
thib
parents:
diff changeset
104 ** because rel_pos is defined as the relative position to the parent
223b71206888 Initial import
thib
parents:
diff changeset
105 */
223b71206888 Initial import
thib
parents:
diff changeset
106 Rect QueryAbsPos(Rect& ppos); // この picture 内の rel_pos を表示するのに実際に必要な絶対座標を得る
223b71206888 Initial import
thib
parents:
diff changeset
107
223b71206888 Initial import
thib
parents:
diff changeset
108 static Rect child_pos(Rect rpos, PicBase* child) { /* return 'cpos' */
223b71206888 Initial import
thib
parents:
diff changeset
109 rpos.intersect(child->rel_pos);
223b71206888 Initial import
thib
parents:
diff changeset
110 rpos.rmove( -(child->rel_pos.lx), -(child->rel_pos.ty));
223b71206888 Initial import
thib
parents:
diff changeset
111 return rpos;
223b71206888 Initial import
thib
parents:
diff changeset
112 }
223b71206888 Initial import
thib
parents:
diff changeset
113 Rect parent_pos(Rect rpos) { /* return 'ppos' */
223b71206888 Initial import
thib
parents:
diff changeset
114 rpos.rmove(rel_pos.lx, rel_pos.ty);
223b71206888 Initial import
thib
parents:
diff changeset
115 rpos.intersect(rel_pos);
223b71206888 Initial import
thib
parents:
diff changeset
116 return rpos;
223b71206888 Initial import
thib
parents:
diff changeset
117 }
223b71206888 Initial import
thib
parents:
diff changeset
118 void SetEventWidget(class PicWidget* widget);
223b71206888 Initial import
thib
parents:
diff changeset
119 public:
223b71206888 Initial import
thib
parents:
diff changeset
120 PicBase(const Rect& rel_pos, PicContainer* parent, int attr);
223b71206888 Initial import
thib
parents:
diff changeset
121 virtual ~PicBase();
223b71206888 Initial import
thib
parents:
diff changeset
122 void InitRoot(PicRoot* r) { root = r;} // only called from PicRoot::PicRoot
223b71206888 Initial import
thib
parents:
diff changeset
123
223b71206888 Initial import
thib
parents:
diff changeset
124 void ReBlit(const Rect& rpos);
223b71206888 Initial import
thib
parents:
diff changeset
125 void ReBlit(void) { ReBlit(Rect(0, 0, rel_pos.width(), rel_pos.height()));}
223b71206888 Initial import
thib
parents:
diff changeset
126 void ExecReBlit(const Rect& rpos);
223b71206888 Initial import
thib
parents:
diff changeset
127 void SimpleBlit(Surface* screen);
223b71206888 Initial import
thib
parents:
diff changeset
128
223b71206888 Initial import
thib
parents:
diff changeset
129 virtual void RMove(int add_x, int add_y);
223b71206888 Initial import
thib
parents:
diff changeset
130 void Move(int new_rx, int new_ry);
223b71206888 Initial import
thib
parents:
diff changeset
131 #define ZMOVE_TOP ((PicBase*)0xffff00ff) /* 最前面へ */
223b71206888 Initial import
thib
parents:
diff changeset
132 #define ZMOVE_BOTTOM ((PicBase*)0xffff0fff) /* 最背面へ */
223b71206888 Initial import
thib
parents:
diff changeset
133 void ZMove(PicBase* back); // back の前に移動(back と自分は同じ親を持つこと)
223b71206888 Initial import
thib
parents:
diff changeset
134
223b71206888 Initial import
thib
parents:
diff changeset
135 void SetSurface(Surface* new_surface, int x, int y, int attribute = 0);
223b71206888 Initial import
thib
parents:
diff changeset
136 void SetSurface(const char* new_surface, int x, int y);
223b71206888 Initial import
thib
parents:
diff changeset
137 void SetSurfacePos(int x, int y);
223b71206888 Initial import
thib
parents:
diff changeset
138 int SurfacePosX(void);
223b71206888 Initial import
thib
parents:
diff changeset
139 int SurfacePosY(void);
223b71206888 Initial import
thib
parents:
diff changeset
140 void SetSurfaceRect(const Rect& r);
223b71206888 Initial import
thib
parents:
diff changeset
141 void SetSurfaceAlpha(const unsigned char* alpha, const Rect& rect);
223b71206888 Initial import
thib
parents:
diff changeset
142 void SetSurfaceAlphaFile(const char* file);
223b71206888 Initial import
thib
parents:
diff changeset
143 void SetSurfaceColorKey(int r, int g, int b);
223b71206888 Initial import
thib
parents:
diff changeset
144 void SetSurfaceAttribute(int attribute);
223b71206888 Initial import
thib
parents:
diff changeset
145 void SetSurfaceFreeFlag(bool flag=true);
223b71206888 Initial import
thib
parents:
diff changeset
146 void SetClipArea(const Rect& r);
223b71206888 Initial import
thib
parents:
diff changeset
147
223b71206888 Initial import
thib
parents:
diff changeset
148 void hide(void);
223b71206888 Initial import
thib
parents:
diff changeset
149 void show_all(void);
223b71206888 Initial import
thib
parents:
diff changeset
150 void show(void);
223b71206888 Initial import
thib
parents:
diff changeset
151
223b71206888 Initial import
thib
parents:
diff changeset
152 int PosX(void) const { return rel_pos.lx;}
223b71206888 Initial import
thib
parents:
diff changeset
153 int PosY(void) const { return rel_pos.ty;}
223b71206888 Initial import
thib
parents:
diff changeset
154 int Width(void) const { return rel_pos.width();}
223b71206888 Initial import
thib
parents:
diff changeset
155 int Height(void) const { return rel_pos.height();}
223b71206888 Initial import
thib
parents:
diff changeset
156 int DistanceRoot(void) const { return distance_root; }
223b71206888 Initial import
thib
parents:
diff changeset
157 bool IsHidden(void) { return is_hidden_now;}
223b71206888 Initial import
thib
parents:
diff changeset
158 bool IsParent(PicBase* pic);
223b71206888 Initial import
thib
parents:
diff changeset
159
223b71206888 Initial import
thib
parents:
diff changeset
160 std::vector<PicAnm*> anm;
223b71206888 Initial import
thib
parents:
diff changeset
161 void ClearAnm(void);
223b71206888 Initial import
thib
parents:
diff changeset
162 };
223b71206888 Initial import
thib
parents:
diff changeset
163
223b71206888 Initial import
thib
parents:
diff changeset
164 class PicContainer : public PicBase {
223b71206888 Initial import
thib
parents:
diff changeset
165 friend class PicBase;
223b71206888 Initial import
thib
parents:
diff changeset
166
223b71206888 Initial import
thib
parents:
diff changeset
167 void BlitBack(iterator z, Rect rpos); // z より後ろの領域を描画
223b71206888 Initial import
thib
parents:
diff changeset
168 void BlitFront(iterator z, Rect rpos); // z を含め、zより前の領域を描画
223b71206888 Initial import
thib
parents:
diff changeset
169 void BlitChildren(Rect rpos);
223b71206888 Initial import
thib
parents:
diff changeset
170 void BlitSelf(Rect rpos);
223b71206888 Initial import
thib
parents:
diff changeset
171 void BlitSelf(void) {
223b71206888 Initial import
thib
parents:
diff changeset
172 is_cached = true;
223b71206888 Initial import
thib
parents:
diff changeset
173 BlitSelf(Rect(0, 0, rel_pos.width(), rel_pos.height()));
223b71206888 Initial import
thib
parents:
diff changeset
174 }
223b71206888 Initial import
thib
parents:
diff changeset
175 public:
223b71206888 Initial import
thib
parents:
diff changeset
176 List children;
223b71206888 Initial import
thib
parents:
diff changeset
177 private:
223b71206888 Initial import
thib
parents:
diff changeset
178
223b71206888 Initial import
thib
parents:
diff changeset
179 void set_showflag(void);
223b71206888 Initial import
thib
parents:
diff changeset
180 void set_nowhiddenflag(bool is_hide);
223b71206888 Initial import
thib
parents:
diff changeset
181 public:
223b71206888 Initial import
thib
parents:
diff changeset
182 PicContainer(const Rect& rel_pos, PicContainer* parent, int attr);
223b71206888 Initial import
thib
parents:
diff changeset
183 ~PicContainer();
223b71206888 Initial import
thib
parents:
diff changeset
184 PicBase* create_leaf(const Rect& rel_pos, int attr);
223b71206888 Initial import
thib
parents:
diff changeset
185 PicContainer* create_node(const Rect& rel_pos, int attr);
223b71206888 Initial import
thib
parents:
diff changeset
186 PicRoot& Root(void) { return *root;}
223b71206888 Initial import
thib
parents:
diff changeset
187 void RMove(int add_x, int add_y);
223b71206888 Initial import
thib
parents:
diff changeset
188 };
223b71206888 Initial import
thib
parents:
diff changeset
189
223b71206888 Initial import
thib
parents:
diff changeset
190 typedef enum { NO_MASK, ALPHA_MASK, COLOR_MASK} MaskType;
223b71206888 Initial import
thib
parents:
diff changeset
191 struct PicRoot {
223b71206888 Initial import
thib
parents:
diff changeset
192 class PicContainer* root;
223b71206888 Initial import
thib
parents:
diff changeset
193 private:
223b71206888 Initial import
thib
parents:
diff changeset
194 class FileToSurface* ftosurface;
223b71206888 Initial import
thib
parents:
diff changeset
195 struct UpdateItem {
223b71206888 Initial import
thib
parents:
diff changeset
196 PicBase* pic;
223b71206888 Initial import
thib
parents:
diff changeset
197 Rect rpos;
223b71206888 Initial import
thib
parents:
diff changeset
198 Rect apos;
223b71206888 Initial import
thib
parents:
diff changeset
199 static bool less(const UpdateItem&, const UpdateItem&);
223b71206888 Initial import
thib
parents:
diff changeset
200 UpdateItem(PicBase* p, const Rect& _rpos, const Rect& _apos) : pic(p), rpos(_rpos), apos(_apos) {}
223b71206888 Initial import
thib
parents:
diff changeset
201 };
223b71206888 Initial import
thib
parents:
diff changeset
202 std::vector<UpdateItem> update_rects;
223b71206888 Initial import
thib
parents:
diff changeset
203
223b71206888 Initial import
thib
parents:
diff changeset
204 friend class FileToSurface;
223b71206888 Initial import
thib
parents:
diff changeset
205 void DeleteSurfaceImpl(Surface* s) const;
223b71206888 Initial import
thib
parents:
diff changeset
206 public:
223b71206888 Initial import
thib
parents:
diff changeset
207 void Update(PicBase* pic, const Rect& rpos, const Rect& apos);
223b71206888 Initial import
thib
parents:
diff changeset
208 void DeleteUpdatePic(PicBase* pic);
223b71206888 Initial import
thib
parents:
diff changeset
209 void ExecUpdate(void);
223b71206888 Initial import
thib
parents:
diff changeset
210 void SetWindowCaption(const char* caption);
223b71206888 Initial import
thib
parents:
diff changeset
211
223b71206888 Initial import
thib
parents:
diff changeset
212 // Surface 操作
223b71206888 Initial import
thib
parents:
diff changeset
213 Surface* NewSurfaceFromRGBAData(int w, int h, char* data, MaskType with_mask) const; // data は malloc されたものであること(SDLの内部仕様)
223b71206888 Initial import
thib
parents:
diff changeset
214 Surface* NewSurface(int w, int h, MaskType with_mask) const;
223b71206888 Initial import
thib
parents:
diff changeset
215 Surface* NewSurface(const char* filename, MaskType with_mask = ALPHA_MASK);
223b71206888 Initial import
thib
parents:
diff changeset
216 Surface* RotZoomSurface(Surface* from, double zoom, double rotate_angle);
223b71206888 Initial import
thib
parents:
diff changeset
217 void DeleteSurface(Surface* s);
223b71206888 Initial import
thib
parents:
diff changeset
218 void BlitSurface(Surface* src, const Rect& src_rpos, const unsigned char* alpha, const Rect& alpha_r, Surface* dest, const Rect& dest_rpos, int attribute) const;
223b71206888 Initial import
thib
parents:
diff changeset
219 void BlitSurface(Surface* src, const Rect& src_rpos, Surface* dest, const Rect& dest_rpos) const {
223b71206888 Initial import
thib
parents:
diff changeset
220 BlitSurface(src, src_rpos, 0, Rect(0,0), dest, dest_rpos, 0);
223b71206888 Initial import
thib
parents:
diff changeset
221 }
223b71206888 Initial import
thib
parents:
diff changeset
222 static bool with_mask(Surface* src);
223b71206888 Initial import
thib
parents:
diff changeset
223
223b71206888 Initial import
thib
parents:
diff changeset
224 Surface* surface;
223b71206888 Initial import
thib
parents:
diff changeset
225 Surface* hw_surface;
223b71206888 Initial import
thib
parents:
diff changeset
226 int width, height;
223b71206888 Initial import
thib
parents:
diff changeset
227 PicRoot(void);
223b71206888 Initial import
thib
parents:
diff changeset
228 ~PicRoot();
223b71206888 Initial import
thib
parents:
diff changeset
229 PicBase* create_leaf(const Rect& apos, int attr) {
223b71206888 Initial import
thib
parents:
diff changeset
230 return root->create_leaf(apos, attr);
223b71206888 Initial import
thib
parents:
diff changeset
231 }
223b71206888 Initial import
thib
parents:
diff changeset
232 PicContainer* create_node(const Rect& apos, int attr) {
223b71206888 Initial import
thib
parents:
diff changeset
233 return root->create_node(apos, attr);
223b71206888 Initial import
thib
parents:
diff changeset
234 }
223b71206888 Initial import
thib
parents:
diff changeset
235 };
223b71206888 Initial import
thib
parents:
diff changeset
236
223b71206888 Initial import
thib
parents:
diff changeset
237 class PicWidget {
223b71206888 Initial import
thib
parents:
diff changeset
238 PicBase* pic; /* 本来継承するべきだが、遅延初期化したいので instance */
223b71206888 Initial import
thib
parents:
diff changeset
239 public:
223b71206888 Initial import
thib
parents:
diff changeset
240 PicWidget(void);
223b71206888 Initial import
thib
parents:
diff changeset
241 virtual ~PicWidget();
223b71206888 Initial import
thib
parents:
diff changeset
242 void SetPic(PicBase* new_pic);
223b71206888 Initial import
thib
parents:
diff changeset
243 PicBase* Pic(void);
223b71206888 Initial import
thib
parents:
diff changeset
244 PicContainer* PicNode(void);
223b71206888 Initial import
thib
parents:
diff changeset
245 virtual void activate(void);
223b71206888 Initial import
thib
parents:
diff changeset
246 virtual void deactivate(void);
223b71206888 Initial import
thib
parents:
diff changeset
247 virtual void SetRegion(const Rect& apos);
223b71206888 Initial import
thib
parents:
diff changeset
248 void show(void);
223b71206888 Initial import
thib
parents:
diff changeset
249 void hide(void);
223b71206888 Initial import
thib
parents:
diff changeset
250 void show_all(void);
223b71206888 Initial import
thib
parents:
diff changeset
251 };
223b71206888 Initial import
thib
parents:
diff changeset
252
223b71206888 Initial import
thib
parents:
diff changeset
253 #endif /* PICTURE */