Mercurial > otakunoraifu
annotate scn2k/scn2k_text.h @ 56:c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
* splitted scn2k.h into smaller header files
* moved some definitions from scn2k_*.cc to the header files
* moved opcode implementation to scn2k_*impl.cc
author | thib |
---|---|
date | Thu, 30 Apr 2009 19:05:09 +0000 |
parents | |
children | 6d9146f56ccf |
rev | line source |
---|---|
56
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
1 /* |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
2 * Copyright (c) 2009 Thibaut GIRKA |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
3 * Copyright (c) 2004-2006 Kazunori "jagarl" Ueno |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
4 * All rights reserved. |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
5 * |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
6 * Redistribution and use in source and binary forms, with or without |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
7 * modification, are permitted provided that the following conditions |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
8 * are met: |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
9 * 1. Redistributions of source code must retain the above copyright |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
10 * notice, this list of conditions and the following disclaimer. |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
11 * 2. Redistributions in binary form must reproduce the above copyright |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
12 * notice, this list of conditions and the following disclaimer in the |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
13 * documentation and/or other materials provided with the distribution. |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
14 * 3. The name of the author may not be used to endorse or promote products |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
15 * derived from this software without specific prior written permission. |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
16 * |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
27 */ |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
28 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
29 #ifndef __SCN2K_TEXT_H__ |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
30 #define __SCN2K_TEXT_H__ |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
31 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
32 #include <vector> |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
33 #include <map> |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
34 #include <list> |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
35 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
36 #include "scn2k_cmd.h" |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
37 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
38 #include "window/event.h" |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
39 #include "window/picture.h" |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
40 #include "window/widget.h" |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
41 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
42 #include "font/text.h" |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
43 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
44 #include "system/system_config.h" |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
45 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
46 using namespace std; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
47 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
48 void dprintf(const char* fmt, ...); //FIXME |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
49 void eprintf(const char* fmt, ...); //FIXME |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
50 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
51 // kanji conv : デバッグ表示用 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
52 void kconv(const unsigned char* src, unsigned char* dest); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
53 void kconv_rev(const unsigned char* src, unsigned char* dest); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
54 string kconv(const string& s); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
55 string kconv_rev(const string& s); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
56 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
57 /**************************************************************:: |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
58 ** |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
59 ** TimerAtom |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
60 */ |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
61 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
62 struct TimerAtom { |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
63 int from; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
64 int to; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
65 unsigned int start_time; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
66 unsigned int total_time; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
67 }; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
68 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
69 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
70 /**************************************************************:: |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
71 ** |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
72 ** BacklogItem |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
73 */ |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
74 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
75 struct BacklogItem { |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
76 enum {SaveSelect = -2}; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
77 int scn, pos; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
78 int koe; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
79 std::string face; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
80 struct TextStream text; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
81 BacklogItem(void); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
82 void Clear(void); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
83 void AddTextPos(Cmd&); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
84 void DeleteTextPos(); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
85 void SetSavepos(int pos); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
86 BacklogItem& operator =(const BacklogItem&); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
87 }; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
88 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
89 /**************************************************************:: |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
90 ** |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
91 ** TextWindow |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
92 */ |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
93 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
94 struct TextWindow { |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
95 /* @@@ : SetWindowColor での surface 再設定に注意 */ |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
96 WidText* wid; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
97 bool name_visible; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
98 WidLabel* name; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
99 PicContainer* name_container; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
100 PicBase* face; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
101 PicBase* face_pics[8]; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
102 TextWindow(PicContainer& parent, Event::Container& event, int window_no, void* callback); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
103 ~TextWindow(); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
104 Rect WakuSize(PicContainer& pic, int waku_no); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
105 void MakeWaku(PicContainer& pic, Event::Container& event, int waku_no,int window_no, bool* use_btn, void* callback); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
106 void show(void); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
107 void hide(void); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
108 void ShowFace(const char* path); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
109 void ResetFace(void); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
110 void StartText(const TextStream& _stream); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
111 void SetName(const char* n); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
112 }; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
113 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
114 /**************************************************************:: |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
115 ** |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
116 ** SaveFaceHash |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
117 */ |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
118 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
119 struct SaveFaceHash { // バックログセーブ時の顔画像管理を行う |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
120 map<string, int> facetonum; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
121 typedef pair<string,int> Node; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
122 typedef list<Node> List; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
123 List container; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
124 int id_max; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
125 static int size_max; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
126 SaveFaceHash() : id_max(0) {} |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
127 void NewNode(string face, int face_id); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
128 int Add(string face); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
129 string Get(int num); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
130 }; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
131 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
132 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
133 /**************************************************************:: |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
134 ** |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
135 ** Text |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
136 */ |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
137 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
138 class Text : public CommandHandler { |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
139 public: |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
140 Text(Event::Container& _event, PicContainer& _parent); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
141 ~Text(); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
142 void InitWindow(void); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
143 void Exec(Cmd& cmd); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
144 bool Wait(unsigned int current_time, Cmd& cmd); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
145 void SetSkipMode(SkipMode _mode); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
146 void hide(void); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
147 void show(void) { show(text_window_number); } |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
148 void show(int num); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
149 void Save(std::string& str, bool select_save); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
150 void Load(const char* str); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
151 void DrawBacklog(BacklogItem& item, Cmd& cmd); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
152 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
153 static void PressFuncSkip(void* pointer, WidButton* from); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
154 static void PressFuncLoad(void* pointer, WidButton* from); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
155 static void PressFuncSave(void* pointer, WidButton* from); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
156 static void PressFuncBacklog(void* pointer, WidButton* from); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
157 static void PressFuncBacklogFwd(void* pointer, WidButton* from); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
158 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
159 private: |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
160 void SetWindowColor(int r, int g, int b, int a, bool is_transparent); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
161 void SetTextSpeed(int new_speed); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
162 void SetTextWait(int new_wait); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
163 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
164 void CreateSelect(Cmd& cmd); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
165 void CreateSelBG(void); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
166 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
167 void AddText(const char* str); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
168 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
169 static void PressFuncButton(void* pointer, WidButton* from); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
170 static bool PressFunc(int x, int y, void* pointer); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
171 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
172 void SetCursor(int num); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
173 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
174 public: |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
175 vector<BacklogItem> backlog; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
176 BacklogItem backlog_item; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
177 TextWindow* text; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
178 typedef enum {NORMAL=0, WAIT_TEXT=1, WAIT=2, |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
179 WAIT_CLICK=3, WAIT_ABORT=4, WAIT_CLICK_MOUSEPOS = 5, |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
180 WAIT_CLICK_MOUSEPOSEND_L = 6, WAIT_CLICK_MOUSEPOSEND_R = 7, |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
181 WAIT_SELECT_INBOX = 10, WAIT_SELECT_OUTBOX=11, WAIT_SELECT_VALUE = 12, |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
182 WAIT_EXTRN_MASK = 64, SAVEMASK = 128, LOADMASK = 256, SKIPMASK = 512, |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
183 CLEARSCR_MASK = 1024, STATSAVE_MASK = 2048, CLEARSCR_WAIT_MASK=(1<<12), |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
184 SKIPEND_MASK = (1<<13), BACKLOG_MASK=(1<<14), BACKLOG_MASK_FWD=(1<<15), |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
185 BACKLOG_MASK_KOE=(1<<16), BACKLOG_WAIT_MASK=(1<<17), |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
186 ALLMASK = (CLEARSCR_MASK | WAIT_EXTRN_MASK | SAVEMASK | |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
187 LOADMASK | SKIPMASK | BACKLOG_MASK | BACKLOG_MASK_FWD | |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
188 BACKLOG_MASK_KOE | BACKLOG_WAIT_MASK | STATSAVE_MASK | |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
189 CLEARSCR_WAIT_MASK | SKIPEND_MASK) |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
190 } Status; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
191 Status status, status_saved, status_mask; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
192 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
193 private: |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
194 std::string ruby_text; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
195 bool ruby_text_flag; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
196 unsigned int wait_time; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
197 unsigned int old_time; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
198 unsigned int base_time; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
199 int text_window_number; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
200 bool text_parsing; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
201 TextStream text_stream; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
202 SkipMode skip_mode; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
203 int save_selectcount; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
204 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
205 std::map<int, TimerAtom> timer_var; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
206 std::vector<WidTextButton*> selects; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
207 std::vector<int> sel_backlog_pos; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
208 string replace_name[26]; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
209 string replace_name2[26]; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
210 PicContainer* sel_widget; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
211 PicWidget* backlog_widget; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
212 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
213 BacklogItem cur_backlog_item; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
214 BacklogItem drawn_backlog_item; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
215 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
216 TextWindow* widgets[32]; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
217 WidTimeCursor* kcursor; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
218 Surface* sel_bg1; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
219 Surface* sel_bg2; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
220 Rect sel_bg_rect; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
221 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
222 VarInfo wait_savedvar[2]; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
223 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
224 AyuSysConfig *config; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
225 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
226 Event::Container& event; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
227 PicContainer& parent; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
228 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
229 //Opcode handling |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
230 void impl_txtClear(Cmd& cmd); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
231 void impl_logKoe(Cmd& cmd); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
232 void impl_pause(Cmd& cmd); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
233 void impl_br(Cmd& cmd); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
234 void impl_FaceOpen(Cmd& cmd); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
235 void impl_FaceClear(Cmd& cmd); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
236 void impl_doRuby(Cmd& cmd); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
237 void impl_TextWindow(Cmd& cmd); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
238 void impl_msgClear(Cmd& cmd); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
239 void impl_FastText(Cmd& cmd); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
240 void impl_createSelect(Cmd& cmd); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
241 void impl_ShowBackground(Cmd& cmd); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
242 void impl_SetSkipMode(Cmd& cmd); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
243 void impl_Wait(Cmd& cmd); |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
244 }; |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
245 |
c7bcc0ec2267
* replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff
changeset
|
246 #endif |