annotate window/widget.h @ 18:4d7486cb20a9

Sync with upstream
author thib
date Tue, 16 Sep 2008 15:30:03 +0000
parents 223b71206888
children 5ae5533b3a9a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
223b71206888 Initial import
thib
parents:
diff changeset
1 #ifndef __WIDGET_H__
223b71206888 Initial import
thib
parents:
diff changeset
2 #define __WIDGET_H__
223b71206888 Initial import
thib
parents:
diff changeset
3
223b71206888 Initial import
thib
parents:
diff changeset
4 #include<vector>
223b71206888 Initial import
thib
parents:
diff changeset
5 #include"font/font.h"
223b71206888 Initial import
thib
parents:
diff changeset
6 #include"font/text.h"
223b71206888 Initial import
thib
parents:
diff changeset
7 #include"event.h"
223b71206888 Initial import
thib
parents:
diff changeset
8 #include"picture.h"
223b71206888 Initial import
thib
parents:
diff changeset
9
223b71206888 Initial import
thib
parents:
diff changeset
10 #define TimeCursor WidTimeCursor
223b71206888 Initial import
thib
parents:
diff changeset
11 #define MouseCursor WidMouseCursor
223b71206888 Initial import
thib
parents:
diff changeset
12 #define Button WidButton
223b71206888 Initial import
thib
parents:
diff changeset
13 #define Scale WidScale
223b71206888 Initial import
thib
parents:
diff changeset
14 #define Label WidLabel
223b71206888 Initial import
thib
parents:
diff changeset
15 #define Dialog WidDialog
223b71206888 Initial import
thib
parents:
diff changeset
16 #define TextButton WidTextButton
223b71206888 Initial import
thib
parents:
diff changeset
17 #define Text WidText
223b71206888 Initial import
thib
parents:
diff changeset
18 #define AnmTime WidAnmTime
223b71206888 Initial import
thib
parents:
diff changeset
19 #define AnmMove WidAnmMove
223b71206888 Initial import
thib
parents:
diff changeset
20 #define AnmAlpha WidAnmAlpha
223b71206888 Initial import
thib
parents:
diff changeset
21 #define AnmPtnSolid WidAnmPtnSolid
223b71206888 Initial import
thib
parents:
diff changeset
22 #define AnmPtnAlpha WidAnmPtnAlpha
223b71206888 Initial import
thib
parents:
diff changeset
23
223b71206888 Initial import
thib
parents:
diff changeset
24 // namespace Widget {
223b71206888 Initial import
thib
parents:
diff changeset
25
223b71206888 Initial import
thib
parents:
diff changeset
26 struct TimeCursor : public Event::Time, PicWidget {
223b71206888 Initial import
thib
parents:
diff changeset
27 int x,y,dx,dy, nptn;
223b71206888 Initial import
thib
parents:
diff changeset
28 int old_time, count, interval;
223b71206888 Initial import
thib
parents:
diff changeset
29 TimeCursor(Event::Container& container, int _interval, PicContainer* parent, const char* fname, int sx, int sy, int sdx, int sdy, int nptn, const Rect& r);
223b71206888 Initial import
thib
parents:
diff changeset
30 void Elapsed(unsigned int current_time);
223b71206888 Initial import
thib
parents:
diff changeset
31 };
223b71206888 Initial import
thib
parents:
diff changeset
32
223b71206888 Initial import
thib
parents:
diff changeset
33 struct MouseCursor : public Event::Video, PicWidget {
223b71206888 Initial import
thib
parents:
diff changeset
34 int x, y;
223b71206888 Initial import
thib
parents:
diff changeset
35 Event::Container& container;
223b71206888 Initial import
thib
parents:
diff changeset
36 MouseCursor(Event::Container& container, PicContainer* parent, const char* s, int x, int y, int w, int h);
223b71206888 Initial import
thib
parents:
diff changeset
37 MouseCursor(Event::Container& container, PicContainer* parent, Surface* s, int x, int y, int w, int h);
223b71206888 Initial import
thib
parents:
diff changeset
38 ~MouseCursor();
223b71206888 Initial import
thib
parents:
diff changeset
39 static bool Motionfunc(int x, int y, void* pointer);
223b71206888 Initial import
thib
parents:
diff changeset
40 };
223b71206888 Initial import
thib
parents:
diff changeset
41
223b71206888 Initial import
thib
parents:
diff changeset
42 struct Button : public Event::Video, PicWidget {
223b71206888 Initial import
thib
parents:
diff changeset
43 int sx, sy, sdx, sdy, nptn;
223b71206888 Initial import
thib
parents:
diff changeset
44 bool is_in;
223b71206888 Initial import
thib
parents:
diff changeset
45 bool is_toggled;
223b71206888 Initial import
thib
parents:
diff changeset
46 bool is_toggle_switch;
223b71206888 Initial import
thib
parents:
diff changeset
47 Button(Event::Container& container, PicContainer* parent, const char* s, int sx, int sy, int sdx, int sdy, int nptn, const Rect& r, int _z);
223b71206888 Initial import
thib
parents:
diff changeset
48 Button(Event::Container& container, PicContainer* parent, Surface* s, int sx, int sy, int sdx, int sdy, int nptn, const Rect& r, int _z);
223b71206888 Initial import
thib
parents:
diff changeset
49 ~Button();
223b71206888 Initial import
thib
parents:
diff changeset
50 void Press(void);
223b71206888 Initial import
thib
parents:
diff changeset
51 void Release(void);
223b71206888 Initial import
thib
parents:
diff changeset
52 void Drag(int x_from, int y_from, int x_to, int y_to);
223b71206888 Initial import
thib
parents:
diff changeset
53 void In(void);
223b71206888 Initial import
thib
parents:
diff changeset
54 void Out(void);
223b71206888 Initial import
thib
parents:
diff changeset
55 void Toggle(bool new_toggle);
223b71206888 Initial import
thib
parents:
diff changeset
56 typedef void (*PressFunc)(void* pointer, Button* from);
223b71206888 Initial import
thib
parents:
diff changeset
57 typedef void (*DragFunc)(int x_from, int y_from, int x_to, int y_to, void* pointer, Button* from);
223b71206888 Initial import
thib
parents:
diff changeset
58 PressFunc press_func;
223b71206888 Initial import
thib
parents:
diff changeset
59 void* press_pointer;
223b71206888 Initial import
thib
parents:
diff changeset
60 DragFunc drag_func;
223b71206888 Initial import
thib
parents:
diff changeset
61 void* drag_pointer;
223b71206888 Initial import
thib
parents:
diff changeset
62
223b71206888 Initial import
thib
parents:
diff changeset
63 /* ·Ñ¾µ */
223b71206888 Initial import
thib
parents:
diff changeset
64 void activate(void) { Event::Video::activate();}
223b71206888 Initial import
thib
parents:
diff changeset
65 void deactivate(void) { Event::Video::deactivate();}
223b71206888 Initial import
thib
parents:
diff changeset
66 void SetRegion(const Rect& new_rect) { Event::Video::SetRegion(new_rect);}
223b71206888 Initial import
thib
parents:
diff changeset
67 };
223b71206888 Initial import
thib
parents:
diff changeset
68 struct Scale : Event::Video, PicWidget {
223b71206888 Initial import
thib
parents:
diff changeset
69 private:
223b71206888 Initial import
thib
parents:
diff changeset
70 Button* arrow_down, *arrow_up;
223b71206888 Initial import
thib
parents:
diff changeset
71 Button* cursor;
223b71206888 Initial import
thib
parents:
diff changeset
72 PicContainer* panel;
223b71206888 Initial import
thib
parents:
diff changeset
73 Event::Container& container;
223b71206888 Initial import
thib
parents:
diff changeset
74 PicContainer* parent;
223b71206888 Initial import
thib
parents:
diff changeset
75 Color cursor_color;
223b71206888 Initial import
thib
parents:
diff changeset
76
223b71206888 Initial import
thib
parents:
diff changeset
77 int mouse_x, mouse_y;
223b71206888 Initial import
thib
parents:
diff changeset
78 enum {scale_max = 65536};
223b71206888 Initial import
thib
parents:
diff changeset
79 int min, max;
223b71206888 Initial import
thib
parents:
diff changeset
80 int value;
223b71206888 Initial import
thib
parents:
diff changeset
81 int value_add;
223b71206888 Initial import
thib
parents:
diff changeset
82 int value_dragstart;
223b71206888 Initial import
thib
parents:
diff changeset
83 int cursor_width;
223b71206888 Initial import
thib
parents:
diff changeset
84 bool is_vertical;
223b71206888 Initial import
thib
parents:
diff changeset
85
223b71206888 Initial import
thib
parents:
diff changeset
86 public:
223b71206888 Initial import
thib
parents:
diff changeset
87
223b71206888 Initial import
thib
parents:
diff changeset
88 Scale(Event::Container& container, PicContainer* parent, const Rect& r_orig, const Color& cursor_color, bool _is_vertical);
223b71206888 Initial import
thib
parents:
diff changeset
89 void InitCursor(int cursor_width_ratio); // 1024=max
223b71206888 Initial import
thib
parents:
diff changeset
90 void SetRange(int min, int max);
223b71206888 Initial import
thib
parents:
diff changeset
91 void SetValue(int value);
223b71206888 Initial import
thib
parents:
diff changeset
92 int GetValue(void) const;
223b71206888 Initial import
thib
parents:
diff changeset
93 typedef void (*ChangeFunc)(void* pointer, Scale* from);
223b71206888 Initial import
thib
parents:
diff changeset
94 ChangeFunc change_func;
223b71206888 Initial import
thib
parents:
diff changeset
95 void* change_pointer;
223b71206888 Initial import
thib
parents:
diff changeset
96 private:
223b71206888 Initial import
thib
parents:
diff changeset
97 void Init(Rect r_orig);
223b71206888 Initial import
thib
parents:
diff changeset
98 int CalcValue(void);
223b71206888 Initial import
thib
parents:
diff changeset
99 void SetScaleValue(int value);
223b71206888 Initial import
thib
parents:
diff changeset
100
223b71206888 Initial import
thib
parents:
diff changeset
101 // callback
223b71206888 Initial import
thib
parents:
diff changeset
102 static void PressArrowDown(void* pointer, Button* from);
223b71206888 Initial import
thib
parents:
diff changeset
103 static void PressArrowUp(void* pointer, Button* from);
223b71206888 Initial import
thib
parents:
diff changeset
104 static void PressCursor(void* pointer, Button* from);
223b71206888 Initial import
thib
parents:
diff changeset
105 static void DragCursor(int x_from, int y_from,int x, int y, void* pointer, Button* from);
223b71206888 Initial import
thib
parents:
diff changeset
106
223b71206888 Initial import
thib
parents:
diff changeset
107 // ·Ñ¾µ¡§Event::Video
223b71206888 Initial import
thib
parents:
diff changeset
108 void Press(void);
223b71206888 Initial import
thib
parents:
diff changeset
109 void Motion(int x, int y);
223b71206888 Initial import
thib
parents:
diff changeset
110
223b71206888 Initial import
thib
parents:
diff changeset
111 /* ·Ñ¾µ : PicWidget */
223b71206888 Initial import
thib
parents:
diff changeset
112 void activate(void) { Event::Video::activate();}
223b71206888 Initial import
thib
parents:
diff changeset
113 void deactivate(void) { Event::Video::deactivate();}
223b71206888 Initial import
thib
parents:
diff changeset
114 void SetRegion(const Rect& new_rect) { Event::Video::SetRegion(new_rect);}
223b71206888 Initial import
thib
parents:
diff changeset
115 };
223b71206888 Initial import
thib
parents:
diff changeset
116
223b71206888 Initial import
thib
parents:
diff changeset
117 struct TextButton : public Button {
223b71206888 Initial import
thib
parents:
diff changeset
118 enum Attribute {CENTER=1, REVERSE=2, NOPADDING=4};
223b71206888 Initial import
thib
parents:
diff changeset
119 PicRoot& root;
223b71206888 Initial import
thib
parents:
diff changeset
120 Surface* surface;
223b71206888 Initial import
thib
parents:
diff changeset
121 Attribute attribute;
223b71206888 Initial import
thib
parents:
diff changeset
122 int text_size;
223b71206888 Initial import
thib
parents:
diff changeset
123 Color fore, pressed, back;
223b71206888 Initial import
thib
parents:
diff changeset
124 TextButton(Event::Container& container, PicContainer* parent, const char* s, int text_size, Attribute attr, const Rect& r, int _z, const Color& fore, const Color& pressed, const Color& back);
223b71206888 Initial import
thib
parents:
diff changeset
125 void SetText(const char* s, const Color& fore, const Color& pressed, const Color& back);
223b71206888 Initial import
thib
parents:
diff changeset
126 void SetText(const char* s) {
223b71206888 Initial import
thib
parents:
diff changeset
127 SetText(s, fore, pressed, back);
223b71206888 Initial import
thib
parents:
diff changeset
128 }
223b71206888 Initial import
thib
parents:
diff changeset
129 ~TextButton();
223b71206888 Initial import
thib
parents:
diff changeset
130 };
223b71206888 Initial import
thib
parents:
diff changeset
131
223b71206888 Initial import
thib
parents:
diff changeset
132 struct Text : public Event::Video, Event::Time, PicWidget {
223b71206888 Initial import
thib
parents:
diff changeset
133 typedef TextGlyphStream::iterator iterator;
223b71206888 Initial import
thib
parents:
diff changeset
134
223b71206888 Initial import
thib
parents:
diff changeset
135 private:
223b71206888 Initial import
thib
parents:
diff changeset
136 Event::Container& event;
223b71206888 Initial import
thib
parents:
diff changeset
137 public:
223b71206888 Initial import
thib
parents:
diff changeset
138 PicBase* pictext;
223b71206888 Initial import
thib
parents:
diff changeset
139 private:
223b71206888 Initial import
thib
parents:
diff changeset
140 TimeCursor* cursor;
223b71206888 Initial import
thib
parents:
diff changeset
141 Surface* surface;
223b71206888 Initial import
thib
parents:
diff changeset
142 TextGlyphStream gstream;
223b71206888 Initial import
thib
parents:
diff changeset
143 std::vector<int> bottom_pos; // ¹Ô¹â¤µ(height)¤ÎÎß·×ÃÍ
223b71206888 Initial import
thib
parents:
diff changeset
144 XKFont::HorizLayout layout;
223b71206888 Initial import
thib
parents:
diff changeset
145 int fontsize;
223b71206888 Initial import
thib
parents:
diff changeset
146
223b71206888 Initial import
thib
parents:
diff changeset
147 iterator cur_pos;
223b71206888 Initial import
thib
parents:
diff changeset
148 int line_number;
223b71206888 Initial import
thib
parents:
diff changeset
149 Rect srcrect;
223b71206888 Initial import
thib
parents:
diff changeset
150 int press_count;
223b71206888 Initial import
thib
parents:
diff changeset
151 int scrolled_count;
223b71206888 Initial import
thib
parents:
diff changeset
152 int scroll_height;
223b71206888 Initial import
thib
parents:
diff changeset
153 bool window_activated;
223b71206888 Initial import
thib
parents:
diff changeset
154 bool cursor_activated;
223b71206888 Initial import
thib
parents:
diff changeset
155
223b71206888 Initial import
thib
parents:
diff changeset
156 int speed; // chars / sec or -1
223b71206888 Initial import
thib
parents:
diff changeset
157 int wait_delay; // msec
223b71206888 Initial import
thib
parents:
diff changeset
158 int old_time;
223b71206888 Initial import
thib
parents:
diff changeset
159 int wait_starttime;
223b71206888 Initial import
thib
parents:
diff changeset
160
223b71206888 Initial import
thib
parents:
diff changeset
161 int CalcScrollHeight(void);
223b71206888 Initial import
thib
parents:
diff changeset
162 void DrawText(int& nChar);
223b71206888 Initial import
thib
parents:
diff changeset
163 void Scrollup(int& nChar);
223b71206888 Initial import
thib
parents:
diff changeset
164 public:
223b71206888 Initial import
thib
parents:
diff changeset
165 Text(Event::Container& container, PicContainer* parent, const Rect& r, const Rect& text_r, int fontsize);
223b71206888 Initial import
thib
parents:
diff changeset
166 ~Text();
223b71206888 Initial import
thib
parents:
diff changeset
167
223b71206888 Initial import
thib
parents:
diff changeset
168 TextStream stream;
223b71206888 Initial import
thib
parents:
diff changeset
169 enum {PREPARE, DRAW, WAIT, SCROLL, DRAW2, WAIT2} status;
223b71206888 Initial import
thib
parents:
diff changeset
170
223b71206888 Initial import
thib
parents:
diff changeset
171 void Clear(void);
223b71206888 Initial import
thib
parents:
diff changeset
172 void Start(void);
223b71206888 Initial import
thib
parents:
diff changeset
173 void Flush(void);
223b71206888 Initial import
thib
parents:
diff changeset
174
223b71206888 Initial import
thib
parents:
diff changeset
175 void Elapsed(unsigned int current_time);
223b71206888 Initial import
thib
parents:
diff changeset
176 static bool Pressed(int x, int y, void* pointer);
223b71206888 Initial import
thib
parents:
diff changeset
177 void activate(void);
223b71206888 Initial import
thib
parents:
diff changeset
178 void deactivate(void);
223b71206888 Initial import
thib
parents:
diff changeset
179 void SetSpeed(int new_speed);
223b71206888 Initial import
thib
parents:
diff changeset
180 void SetWait(int new_wait);
223b71206888 Initial import
thib
parents:
diff changeset
181
223b71206888 Initial import
thib
parents:
diff changeset
182 void SetCursor(TimeCursor* cursor);
223b71206888 Initial import
thib
parents:
diff changeset
183 };
223b71206888 Initial import
thib
parents:
diff changeset
184
223b71206888 Initial import
thib
parents:
diff changeset
185 extern void SetFont(const char* fontname);
223b71206888 Initial import
thib
parents:
diff changeset
186
223b71206888 Initial import
thib
parents:
diff changeset
187 struct Label : PicWidget{
223b71206888 Initial import
thib
parents:
diff changeset
188 private:
223b71206888 Initial import
thib
parents:
diff changeset
189 Surface* surface;
223b71206888 Initial import
thib
parents:
diff changeset
190 bool is_center;
223b71206888 Initial import
thib
parents:
diff changeset
191 PicRoot& root;
223b71206888 Initial import
thib
parents:
diff changeset
192 int text_size;
223b71206888 Initial import
thib
parents:
diff changeset
193 public:
223b71206888 Initial import
thib
parents:
diff changeset
194 Label(PicContainer* parent, const Rect& r_orig, bool is_center=true, const char* text=0, int textsize = 26);
223b71206888 Initial import
thib
parents:
diff changeset
195 ~Label();
223b71206888 Initial import
thib
parents:
diff changeset
196 void SetText(const char* text);
223b71206888 Initial import
thib
parents:
diff changeset
197 };
223b71206888 Initial import
thib
parents:
diff changeset
198
223b71206888 Initial import
thib
parents:
diff changeset
199 class Dialog : public Event::Video, PicWidget {
223b71206888 Initial import
thib
parents:
diff changeset
200 Surface* surface_btn;
223b71206888 Initial import
thib
parents:
diff changeset
201 Surface* surface_diag;
223b71206888 Initial import
thib
parents:
diff changeset
202 public:
223b71206888 Initial import
thib
parents:
diff changeset
203 enum { WAIT, OK, CANCEL} status;
223b71206888 Initial import
thib
parents:
diff changeset
204 Dialog(Event::Container& container, PicContainer* parent, const char* text, bool with_cancel);
223b71206888 Initial import
thib
parents:
diff changeset
205 ~Dialog();
223b71206888 Initial import
thib
parents:
diff changeset
206 static void press_ok(void* pointer, Button* btn);
223b71206888 Initial import
thib
parents:
diff changeset
207 static void press_cancel(void* pointer, Button* btn);
223b71206888 Initial import
thib
parents:
diff changeset
208 static void DrawBox(Surface* s, const Rect& r);
223b71206888 Initial import
thib
parents:
diff changeset
209 typedef void (*SetFunc)(void* pointer, Dialog* from);
223b71206888 Initial import
thib
parents:
diff changeset
210 SetFunc set_func;
223b71206888 Initial import
thib
parents:
diff changeset
211 void* set_pointer;
223b71206888 Initial import
thib
parents:
diff changeset
212 };
223b71206888 Initial import
thib
parents:
diff changeset
213
223b71206888 Initial import
thib
parents:
diff changeset
214 struct AnmTime : public Event::Time, PicAnm {
223b71206888 Initial import
thib
parents:
diff changeset
215 enum { PLAYING=1, FINISHED=3 } status;
223b71206888 Initial import
thib
parents:
diff changeset
216 unsigned int start_time;
223b71206888 Initial import
thib
parents:
diff changeset
217 unsigned int total_time;
223b71206888 Initial import
thib
parents:
diff changeset
218 int all_count;
223b71206888 Initial import
thib
parents:
diff changeset
219
223b71206888 Initial import
thib
parents:
diff changeset
220 AnmTime(Event::Container& container, PicBase* _pic, int total_time, int all_count = 0);
223b71206888 Initial import
thib
parents:
diff changeset
221 AnmTime(Event::Container& container, std::vector<PicBase*> _pic, int total_time, int all_count = 0);
223b71206888 Initial import
thib
parents:
diff changeset
222 virtual ~AnmTime() {}
223b71206888 Initial import
thib
parents:
diff changeset
223 void SetAllCount(int new_all_count) { all_count = new_all_count; }
223b71206888 Initial import
thib
parents:
diff changeset
224 void SetTotalTime(int new_total) { total_time = new_total; }
223b71206888 Initial import
thib
parents:
diff changeset
225 void Elapsed(unsigned int current_time);
223b71206888 Initial import
thib
parents:
diff changeset
226 void Play(void) {
223b71206888 Initial import
thib
parents:
diff changeset
227 start_time = 0;
223b71206888 Initial import
thib
parents:
diff changeset
228 status = PLAYING;
223b71206888 Initial import
thib
parents:
diff changeset
229 }
223b71206888 Initial import
thib
parents:
diff changeset
230
223b71206888 Initial import
thib
parents:
diff changeset
231 virtual void Start(void) {};
223b71206888 Initial import
thib
parents:
diff changeset
232 virtual void Exec(int count) = 0;
223b71206888 Initial import
thib
parents:
diff changeset
233 virtual void Finish(void) {};
223b71206888 Initial import
thib
parents:
diff changeset
234 void Abort(void);
223b71206888 Initial import
thib
parents:
diff changeset
235 bool IsEnd(void);
223b71206888 Initial import
thib
parents:
diff changeset
236 };
223b71206888 Initial import
thib
parents:
diff changeset
237
223b71206888 Initial import
thib
parents:
diff changeset
238 struct AnmMove : public AnmTime {
223b71206888 Initial import
thib
parents:
diff changeset
239 Rect from, to;
223b71206888 Initial import
thib
parents:
diff changeset
240 AnmMove(Event::Container& container, PicBase* _pic, const Rect& to, int total_time);
223b71206888 Initial import
thib
parents:
diff changeset
241 void Exec(int count);
223b71206888 Initial import
thib
parents:
diff changeset
242 };
223b71206888 Initial import
thib
parents:
diff changeset
243 #define ALPHA_MAX 255
223b71206888 Initial import
thib
parents:
diff changeset
244 struct AnmAlpha : public AnmTime {
223b71206888 Initial import
thib
parents:
diff changeset
245 int from, to;
223b71206888 Initial import
thib
parents:
diff changeset
246 unsigned char alpha; Rect alpha_r;
223b71206888 Initial import
thib
parents:
diff changeset
247 AnmAlpha(Event::Container& container, PicBase* _pic, int alpha_from, int alpha_to, int total_time);
223b71206888 Initial import
thib
parents:
diff changeset
248 AnmAlpha(Event::Container& container, std::vector<PicBase*> _pic, int alpha_from, int alpha_to, int total_time);
223b71206888 Initial import
thib
parents:
diff changeset
249 void Start(void);
223b71206888 Initial import
thib
parents:
diff changeset
250 void Exec(int count);
223b71206888 Initial import
thib
parents:
diff changeset
251 void Finish(void);
223b71206888 Initial import
thib
parents:
diff changeset
252 };
223b71206888 Initial import
thib
parents:
diff changeset
253 struct AnmAlphaMove : public AnmTime {
223b71206888 Initial import
thib
parents:
diff changeset
254 struct Ptn {
223b71206888 Initial import
thib
parents:
diff changeset
255 Rect pos;
223b71206888 Initial import
thib
parents:
diff changeset
256 Rect surface_pos;
223b71206888 Initial import
thib
parents:
diff changeset
257 unsigned char alpha;
223b71206888 Initial import
thib
parents:
diff changeset
258 unsigned int next_tick;
223b71206888 Initial import
thib
parents:
diff changeset
259 Ptn(const Rect& _r, const Rect& _surface_r, unsigned char _a, unsigned int _n) :
223b71206888 Initial import
thib
parents:
diff changeset
260 pos(_r), surface_pos(_surface_r), alpha(_a), next_tick(_n) {}
223b71206888 Initial import
thib
parents:
diff changeset
261 };
223b71206888 Initial import
thib
parents:
diff changeset
262 std::vector<Ptn> ptns;
223b71206888 Initial import
thib
parents:
diff changeset
263 int cur_count;
223b71206888 Initial import
thib
parents:
diff changeset
264 AnmAlphaMove(Event::Container& container, PicBase* _pic);
223b71206888 Initial import
thib
parents:
diff changeset
265 void SetPtn(void);
223b71206888 Initial import
thib
parents:
diff changeset
266 void Exec(int count);
223b71206888 Initial import
thib
parents:
diff changeset
267 void Finish(void);
223b71206888 Initial import
thib
parents:
diff changeset
268 };
223b71206888 Initial import
thib
parents:
diff changeset
269 struct AnmPtnSolid : public AnmTime {
223b71206888 Initial import
thib
parents:
diff changeset
270 AnmPtnSolid(Event::Container& container, PicBase* _pic, const unsigned char* ptn, const Rect& alpha_r, int total_time);
223b71206888 Initial import
thib
parents:
diff changeset
271 ~AnmPtnSolid() { delete[] alpha; }
223b71206888 Initial import
thib
parents:
diff changeset
272 const unsigned char* ptn;
223b71206888 Initial import
thib
parents:
diff changeset
273 int ptn_len;
223b71206888 Initial import
thib
parents:
diff changeset
274 unsigned char* alpha;
223b71206888 Initial import
thib
parents:
diff changeset
275 Rect alpha_r;
223b71206888 Initial import
thib
parents:
diff changeset
276
223b71206888 Initial import
thib
parents:
diff changeset
277 void Start(void);
223b71206888 Initial import
thib
parents:
diff changeset
278 void Exec(int count);
223b71206888 Initial import
thib
parents:
diff changeset
279 void Finish(void);
223b71206888 Initial import
thib
parents:
diff changeset
280 };
223b71206888 Initial import
thib
parents:
diff changeset
281 struct AnmPtnAlpha : public AnmTime {
223b71206888 Initial import
thib
parents:
diff changeset
282 AnmPtnAlpha(Event::Container& container, PicBase* _pic, const unsigned char* ptn, const Rect& alpha_r, int alpha_bandwidth, int total_time);
223b71206888 Initial import
thib
parents:
diff changeset
283 ~AnmPtnAlpha() { delete[] alpha; }
223b71206888 Initial import
thib
parents:
diff changeset
284 const unsigned char* ptn;
223b71206888 Initial import
thib
parents:
diff changeset
285 int ptn_len;
223b71206888 Initial import
thib
parents:
diff changeset
286 int band;
223b71206888 Initial import
thib
parents:
diff changeset
287 unsigned char* alpha;
223b71206888 Initial import
thib
parents:
diff changeset
288 Rect alpha_r;
223b71206888 Initial import
thib
parents:
diff changeset
289 void Start(void);
223b71206888 Initial import
thib
parents:
diff changeset
290 void Exec(int count);
223b71206888 Initial import
thib
parents:
diff changeset
291 void Finish(void);
223b71206888 Initial import
thib
parents:
diff changeset
292 };
223b71206888 Initial import
thib
parents:
diff changeset
293
223b71206888 Initial import
thib
parents:
diff changeset
294 // } /* end of namespace Widget */
223b71206888 Initial import
thib
parents:
diff changeset
295
223b71206888 Initial import
thib
parents:
diff changeset
296 #undef Text
223b71206888 Initial import
thib
parents:
diff changeset
297
223b71206888 Initial import
thib
parents:
diff changeset
298 #endif
223b71206888 Initial import
thib
parents:
diff changeset
299