comparison window/picture.h @ 65:4416cfac86ae

Convert EUC-JP files to UTF8
author Thibaut Girka <thib@sitedethib.com>
date Fri, 26 Nov 2010 10:53:15 +0100
parents e16e13d8cd68
children 1fd20d231376
comparison
equal deleted inserted replaced
64:045ca45f9610 65:4416cfac86ae
42 42
43 namespace Event { 43 namespace Event {
44 class Video; 44 class Video;
45 } 45 }
46 46
47 /* PicBase の内容をイベントと連動させるためのインターフェース */ 47 /* PicBase 絎鴻ゃ潟eゃ潟帥若с若 */
48 class PicAnm { 48 class PicAnm {
49 public: 49 public:
50 typedef std::vector<PicBase*>::iterator iterator; 50 typedef std::vector<PicBase*>::iterator iterator;
51 std::vector<PicBase*> pic; 51 std::vector<PicBase*> pic;
52 PicAnm(PicBase* pic); 52 PicAnm(PicBase* pic);
102 ** Rect ppos = rel_pos; 102 ** Rect ppos = rel_pos;
103 ** apos = parent->QueryAbsPos(ppos); 103 ** apos = parent->QueryAbsPos(ppos);
104 ** the latter form is used for 'rel_pos', 104 ** the latter form is used for 'rel_pos',
105 ** because rel_pos is defined as the relative position to the parent 105 ** because rel_pos is defined as the relative position to the parent
106 */ 106 */
107 Rect QueryAbsPos(Rect& ppos); // この picture 内の rel_pos を表示するのに実際に必要な絶対座標を得る 107 Rect QueryAbsPos(Rect& ppos); // picture rel_pos 茵腓冴絎綽荀腟九上婚罔緇
108 108
109 static Rect child_pos(Rect rpos, PicBase* child) { /* return 'cpos' */ 109 static Rect child_pos(Rect rpos, PicBase* child) { /* return 'cpos' */
110 rpos.intersect(child->rel_pos); 110 rpos.intersect(child->rel_pos);
111 rpos.rmove( -(child->rel_pos.lx), -(child->rel_pos.ty)); 111 rpos.rmove( -(child->rel_pos.lx), -(child->rel_pos.ty));
112 return rpos; 112 return rpos;
127 void ExecReBlit(const Rect& rpos); 127 void ExecReBlit(const Rect& rpos);
128 void SimpleBlit(Surface* screen); 128 void SimpleBlit(Surface* screen);
129 129
130 virtual void RMove(int add_x, int add_y); 130 virtual void RMove(int add_x, int add_y);
131 void Move(int new_rx, int new_ry); 131 void Move(int new_rx, int new_ry);
132 #define ZMOVE_TOP ((PicBase*)0xffff00ff) /* 最前面へ */ 132 #define ZMOVE_TOP ((PicBase*)0xffff00ff) /* ≪ */
133 #define ZMOVE_BOTTOM ((PicBase*)0xffff0fff) /* 最背面へ */ 133 #define ZMOVE_BOTTOM ((PicBase*)0xffff0fff) /* ≪ */
134 void ZMove(PicBase* back); // back の前に移動(back と自分は同じ親を持つこと) 134 void ZMove(PicBase* back); // back 腱糸(back 荀ゃ)
135 135
136 void SetSurface(Surface* new_surface, int x, int y, int attribute = 0); 136 void SetSurface(Surface* new_surface, int x, int y, int attribute = 0);
137 void SetSurface(const char* new_surface, int x, int y); 137 void SetSurface(const char* new_surface, int x, int y);
138 void SetSurfacePos(int x, int y); 138 void SetSurfacePos(int x, int y);
139 int SurfacePosX(void); 139 int SurfacePosX(void);
164 164
165 class PicContainer : public PicBase { 165 class PicContainer : public PicBase {
166 private: 166 private:
167 friend class PicBase; 167 friend class PicBase;
168 168
169 void BlitBack(iterator z, Rect rpos); // z より後ろの領域を描画 169 void BlitBack(iterator z, Rect rpos); // z 緇
170 void BlitFront(iterator z, Rect rpos); // z を含め、zより前の領域を描画 170 void BlitFront(iterator z, Rect rpos); // z z
171 void BlitChildren(Rect rpos); 171 void BlitChildren(Rect rpos);
172 void BlitSelf(Rect rpos); 172 void BlitSelf(Rect rpos);
173 void BlitSelf(void) { 173 void BlitSelf(void) {
174 is_cached = true; 174 is_cached = true;
175 BlitSelf(Rect(0, 0, rel_pos.width(), rel_pos.height())); 175 BlitSelf(Rect(0, 0, rel_pos.width(), rel_pos.height()));
210 void Update(PicBase* pic, const Rect& rpos, const Rect& apos); 210 void Update(PicBase* pic, const Rect& rpos, const Rect& apos);
211 void DeleteUpdatePic(PicBase* pic); 211 void DeleteUpdatePic(PicBase* pic);
212 void ExecUpdate(void); 212 void ExecUpdate(void);
213 void SetWindowCaption(const char* caption); 213 void SetWindowCaption(const char* caption);
214 214
215 // Surface 操作 215 // Surface 篏
216 Surface* NewSurfaceFromRGBAData(int w, int h, char* data, MaskType with_mask) const; // data は malloc されたものであること(SDLの内部仕様) 216 Surface* NewSurfaceFromRGBAData(int w, int h, char* data, MaskType with_mask) const; // data malloc с(SDL篁罕)
217 Surface* NewSurface(int w, int h, MaskType with_mask) const; 217 Surface* NewSurface(int w, int h, MaskType with_mask) const;
218 Surface* NewSurface(const char* filename, MaskType with_mask = ALPHA_MASK); 218 Surface* NewSurface(const char* filename, MaskType with_mask = ALPHA_MASK);
219 Surface* RotZoomSurface(Surface* from, double zoom, double rotate_angle); 219 Surface* RotZoomSurface(Surface* from, double zoom, double rotate_angle);
220 void DeleteSurface(Surface* s); 220 void DeleteSurface(Surface* s);
221 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; 221 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;
237 } 237 }
238 }; 238 };
239 239
240 class PicWidget { 240 class PicWidget {
241 private: 241 private:
242 PicBase* pic; /* 本来継承するべきだが、遅延初期化したいので instance */ 242 PicBase* pic; /* ョ帥鴻綮九 instance */
243 public: 243 public:
244 PicWidget(void); 244 PicWidget(void);
245 virtual ~PicWidget(); 245 virtual ~PicWidget();
246 void SetPic(PicBase* new_pic); 246 void SetPic(PicBase* new_pic);
247 PicBase* Pic(void); 247 PicBase* Pic(void);