OSDN Git Service

post WM_NULL to attached threads on yamy exit to unmap mayu{32,64}.dll
[yamy/yamy.git] / function.h
1 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r
2 // keymap.h\r
3 \r
4 \r
5 #ifndef _FUNCTION_H\r
6 #  define _FUNCTION_H\r
7 \r
8 \r
9 class SettingLoader;\r
10 class Engine;\r
11 class FunctionParam;\r
12 \r
13 ///\r
14 class FunctionData\r
15 {\r
16 public:\r
17         /// virtual destructor\r
18         virtual ~FunctionData() = 0;\r
19         ///\r
20         virtual void load(SettingLoader *i_sl) = 0;\r
21         ///\r
22         virtual void exec(Engine *i_engine, FunctionParam *i_param) const = 0;\r
23         ///\r
24         virtual const _TCHAR *getName() const = 0;\r
25         ///\r
26         virtual tostream &output(tostream &i_ost) const = 0;\r
27         ///\r
28         virtual FunctionData *clone() const = 0;\r
29 };\r
30 \r
31 /// stream output\r
32 extern tostream &operator<<(tostream &i_ost, const FunctionData *i_data);\r
33 \r
34 \r
35 // create function\r
36 extern FunctionData *createFunctionData(const tstring &i_name);\r
37 \r
38 ///\r
39 enum VKey {\r
40         VKey_extended = 0x100,                  ///\r
41         VKey_released = 0x200,                  ///\r
42         VKey_pressed  = 0x400,                  ///\r
43 };\r
44 \r
45 /// stream output\r
46 extern tostream &operator<<(tostream &i_ost, VKey i_data);\r
47 \r
48 \r
49 ///\r
50 enum ToWindowType {\r
51         ToWindowType_toBegin            = -2,           ///\r
52         ToWindowType_toMainWindow       = -2,           ///\r
53         ToWindowType_toOverlappedWindow = -1,           ///\r
54         ToWindowType_toItself           = 0,            ///\r
55         ToWindowType_toParentWindow     = 1,            ///\r
56 };\r
57 \r
58 /// stream output\r
59 extern tostream &operator<<(tostream &i_ost, ToWindowType i_data);\r
60 \r
61 // get value of ToWindowType\r
62 extern bool getTypeValue(ToWindowType *o_type, const tstring &i_name);\r
63 \r
64 \r
65 ///\r
66 enum GravityType {\r
67         GravityType_C = 0,                              /// center\r
68         GravityType_N = 1 << 0,                 /// north\r
69         GravityType_E = 1 << 1,                 /// east\r
70         GravityType_W = 1 << 2,                 /// west\r
71         GravityType_S = 1 << 3,                 /// south\r
72         GravityType_NW = GravityType_N | GravityType_W, /// north west\r
73         GravityType_NE = GravityType_N | GravityType_E, /// north east\r
74         GravityType_SW = GravityType_S | GravityType_W, /// south west\r
75         GravityType_SE = GravityType_S | GravityType_E, /// south east\r
76 };\r
77 \r
78 /// stream output\r
79 extern tostream &operator<<(tostream &i_ost, GravityType i_data);\r
80 \r
81 /// get value of GravityType\r
82 extern bool getTypeValue(GravityType *o_type, const tstring &i_name);\r
83 \r
84 \r
85 /// enum MouseHookType is defined in hook.h\r
86 extern enum MouseHookType;\r
87 \r
88 /// stream output\r
89 extern tostream &operator<<(tostream &i_ost, MouseHookType i_data);\r
90 \r
91 /// get value of MouseHookType\r
92 extern bool getTypeValue(MouseHookType *o_type, const tstring &i_name);\r
93 \r
94 \r
95 ///\r
96 enum MayuDialogType {\r
97         MayuDialogType_investigate = 0x10000,           ///\r
98         MayuDialogType_log         = 0x20000,           ///\r
99         MayuDialogType_mask        = 0xffff0000,        ///\r
100 };\r
101 \r
102 /// stream output\r
103 extern tostream &operator<<(tostream &i_ost, MayuDialogType i_data);\r
104 \r
105 // get value of MayuDialogType\r
106 bool getTypeValue(MayuDialogType *o_type, const tstring &i_name);\r
107 \r
108 \r
109 ///\r
110 enum ModifierLockType {\r
111         ModifierLockType_Lock0 = Modifier::Type_Lock0, ///\r
112         ModifierLockType_Lock1 = Modifier::Type_Lock1, ///\r
113         ModifierLockType_Lock2 = Modifier::Type_Lock2, ///\r
114         ModifierLockType_Lock3 = Modifier::Type_Lock3, ///\r
115         ModifierLockType_Lock4 = Modifier::Type_Lock4, ///\r
116         ModifierLockType_Lock5 = Modifier::Type_Lock5, ///\r
117         ModifierLockType_Lock6 = Modifier::Type_Lock6, ///\r
118         ModifierLockType_Lock7 = Modifier::Type_Lock7, ///\r
119         ModifierLockType_Lock8 = Modifier::Type_Lock8, ///\r
120         ModifierLockType_Lock9 = Modifier::Type_Lock9, ///\r
121 };\r
122 \r
123 ///\r
124 enum ToggleType {\r
125         ToggleType_toggle       = -1, ///\r
126         ToggleType_off  = 0, ///\r
127         ToggleType_on           = 1, ///\r
128 };\r
129 \r
130 /// stream output\r
131 extern tostream &operator<<(tostream &i_ost, ToggleType i_data);\r
132 \r
133 // get value of ShowCommandType\r
134 extern bool getTypeValue(ToggleType *o_type, const tstring &i_name);\r
135 \r
136 \r
137 /// stream output\r
138 extern tostream &operator<<(tostream &i_ost, ModifierLockType i_data);\r
139 \r
140 // get value of ModifierLockType\r
141 extern bool getTypeValue(ModifierLockType *o_type, const tstring &i_name);\r
142 \r
143 \r
144 ///\r
145 enum ShowCommandType {\r
146         ShowCommandType_hide                    = SW_HIDE, ///\r
147         ShowCommandType_maximize                = SW_MAXIMIZE, ///\r
148         ShowCommandType_minimize                = SW_MINIMIZE, ///\r
149         ShowCommandType_restore         = SW_RESTORE, ///\r
150         ShowCommandType_show                    = SW_SHOW, ///\r
151         ShowCommandType_showDefault             = SW_SHOWDEFAULT, ///\r
152         ShowCommandType_showMaximized           = SW_SHOWMAXIMIZED, ///\r
153         ShowCommandType_showMinimized           = SW_SHOWMINIMIZED, ///\r
154         ShowCommandType_showMinNoActive = SW_SHOWMINNOACTIVE, ///\r
155         ShowCommandType_showNA          = SW_SHOWNA, ///\r
156         ShowCommandType_showNoActivate  = SW_SHOWNOACTIVATE, ///\r
157         ShowCommandType_showNormal              = SW_SHOWNORMAL, ///\r
158 };\r
159 \r
160 /// stream output\r
161 extern tostream &operator<<(tostream &i_ost, ShowCommandType i_data);\r
162 \r
163 // get value of ShowCommandType\r
164 extern bool getTypeValue(ShowCommandType *o_type, const tstring &i_name);\r
165 \r
166 \r
167 ///\r
168 enum TargetWindowType {\r
169         TargetWindowType_overlapped     = 0, ///\r
170         TargetWindowType_mdi            = 1, ///\r
171 };\r
172 \r
173 /// stream output\r
174 extern tostream &operator<<(tostream &i_ost, TargetWindowType i_data);\r
175 \r
176 // get value of ShowCommandType\r
177 extern bool getTypeValue(TargetWindowType *o_type, const tstring &i_name);\r
178 \r
179 \r
180 ///\r
181 enum BooleanType {\r
182         BooleanType_false       = 0, ///\r
183         BooleanType_true        = 1, ///\r
184 };\r
185 \r
186 /// stream output\r
187 extern tostream &operator<<(tostream &i_ost, BooleanType i_data);\r
188 \r
189 // get value of ShowCommandType\r
190 extern bool getTypeValue(BooleanType *o_type, const tstring &i_name);\r
191 \r
192 \r
193 ///\r
194 enum LogicalOperatorType {\r
195         LogicalOperatorType_or  = 0, ///\r
196         LogicalOperatorType_and = 1, ///\r
197 };\r
198 \r
199 /// stream output\r
200 extern tostream &operator<<(tostream &i_ost, LogicalOperatorType i_data);\r
201 \r
202 // get value of LogicalOperatorType\r
203 extern bool getTypeValue(LogicalOperatorType *o_type, const tstring &i_name);\r
204 \r
205 \r
206 ///\r
207 enum WindowMonitorFromType {\r
208         WindowMonitorFromType_primary = 0, ///\r
209         WindowMonitorFromType_current = 1, ///\r
210 };\r
211 \r
212 // stream output\r
213 extern tostream &operator<<(tostream &i_ost, WindowMonitorFromType i_data);\r
214 \r
215 // get value of WindowMonitorFromType\r
216 extern bool getTypeValue(WindowMonitorFromType *o_type, const tstring &i_name);\r
217 \r
218 \r
219 /// stream output\r
220 extern tostream &operator<<(tostream &i_ost,\r
221                                                                 const std::list<tstringq> &i_data);\r
222 \r
223 \r
224 /// string type expression\r
225 class StrExpr;\r
226 \r
227 \r
228 /// string type expression for function arguments\r
229 class StrExprArg\r
230 {\r
231 private:\r
232         StrExpr *m_expr;\r
233 public:\r
234         enum Type {\r
235                 Literal,\r
236                 Builtin,\r
237         };\r
238         StrExprArg();\r
239         StrExprArg(const StrExprArg &i_data);\r
240         StrExprArg(const tstringq &i_symbol, Type i_type);\r
241         ~StrExprArg();\r
242         StrExprArg &operator=(const StrExprArg &i_data);\r
243         tstringq eval() const;\r
244         static void setEngine(const Engine *i_engine);\r
245 };\r
246 \r
247 \r
248 /// stream output\r
249 tostream &operator<<(tostream &i_ost, const StrExprArg &i_data);\r
250 \r
251 \r
252 #endif // !_FUNCTION_H\r