-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathInterface.html
More file actions
329 lines (277 loc) · 12.1 KB
/
Copy pathInterface.html
File metadata and controls
329 lines (277 loc) · 12.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Interface - User interface system. : OpenKore source code documentation</title>
<link rel="stylesheet" type="text/css" href="openkore.css">
<link rel="stylesheet" type="text/css" href="highlight.css">
<!-- Fix broken PNG transparency for IE/Win5-6+ -->
<!--[if gte IE 5.5000]>
<script type="text/javascript" src="pngfix.js"></script>
<![endif]-->
</head>
<body>
<div id="title">OpenKore source code documentation</div>
<div id="navigation">
<ul>
<li><a href="http://www.openkore.com/">Main website</a></li>
<li><a href="index.html">Table of contents</a></li>
<li><b>Interface</b></li>
</ul>
</div>
<div id="main">
<h1>Interface - User interface system.</h1>
In OpenKore, the user interface code is seperated from the core code.
Each user interface is implemented in a class. The Interface class is an
abstract base class for all OpenKore user interface classes.
<p><table class="functionIndex">
<tr><th colspan="3">Functions in this module</th></tr><tr onclick="location.href='#$interface->beep';">
<td class="return-type">void</td>
<td class="func"><a href="#$interface->beep">$interface->beep</a></td>
<td class="decl">()</td>
</tr><tr onclick="location.href='#$interface->errorDialog';">
<td class="return-type">void</td>
<td class="func"><a href="#$interface->errorDialog">$interface->errorDialog</a></td>
<td class="decl">(<span class="type">String</span> message, [boolean fatal = true])</td>
</tr><tr onclick="location.href='#$interface->getInput';">
<td class="return-type">String</td>
<td class="func"><a href="#$interface->getInput">$interface->getInput</a></td>
<td class="decl">(<span class="type">float</span> timeout)</td>
</tr><tr onclick="location.href='#$interface->iterate';">
<td class="return-type">void</td>
<td class="func"><a href="#$interface->iterate">$interface->iterate</a></td>
<td class="decl">()</td>
</tr><tr onclick="location.href='#$interface->mainLoop';">
<td class="return-type">void</td>
<td class="func"><a href="#$interface->mainLoop">$interface->mainLoop</a></td>
<td class="decl">()</td>
</tr><tr onclick="location.href='#$interface->query';">
<td class="return-type">String</td>
<td class="func"><a href="#$interface->query">$interface->query</a></td>
<td class="decl">(<span class="type">String</span> message, options...)</td>
</tr><tr onclick="location.href='#$interface->showMenu';">
<td class="return-type">int</td>
<td class="func"><a href="#$interface->showMenu">$interface->showMenu</a></td>
<td class="decl">(<span class="type">String</span> message, Array<String>* choices, options...)</td>
</tr><tr onclick="location.href='#$interface->title';">
<td class="return-type">String</td>
<td class="func"><a href="#$interface->title">$interface->title</a></td>
<td class="decl">(<span class="type">[String</span> title])</td>
</tr><tr onclick="location.href='#$interface->writeOutput';">
<td class="return-type">void</td>
<td class="func"><a href="#$interface->writeOutput">$interface->writeOutput</a></td>
<td class="decl">(<span class="type">String</span> type, String message, String domain)</td>
</tr><tr onclick="location.href='#Interface->loadInterface';">
<td class="return-type"></td>
<td class="func"><a href="#Interface->loadInterface">Interface->loadInterface</a></td>
<td class="decl">(<span class="type">String</span> name)</td>
</tr>
</table>
<p><hr class="details_sep">
<h2>Details</h2>
<div class="details">
<p>
<div class="function"><a name="$interface->beep"></a>
<h3>$interface->beep</h3>
<dl>
<dt class="decl">
<span class="return-type"> void</span> <strong>$interface->beep</strong>()
</dt>
<dd>
<div class="desc">Emit a beep on the available audio device.</div>
</dd>
</dl>
</div>
<p><hr class="function_sep"><p>
<div class="function"><a name="$interface->errorDialog"></a>
<h3>$interface->errorDialog</h3>
<dl>
<dt class="decl">
<span class="return-type"> void</span> <strong>$interface->errorDialog</strong>(<span class="type">String</span> message, [boolean fatal = true])
</dt>
<dd>
<dl class="params_and_returns">
<dt class="params"><strong>Parameters:</strong></dt>
<dd class="param"><code>message</code> : The error message to display.</dd>
<dd class="param"><code>fatal</code> : Indicate that this is a fatal error (meaning that the application will exit after this dialog is closed). If set, the console interfaces will warn the user that the app is about to exit.</dd>
<dt class="requires"><strong>Requires:</strong></dt>
<dd class="requires">defined($message)</dd>
</dl><p>
<div class="desc">Display an error dialog. This function blocks until the user has closed the
dialog.
<p>
Consider using <a href="Log.html#Log::error"><code>Log::error()</code></a> if your message is not a fatal error, because
<a href="Log.html#Log::error"><code>Log::error()</code></a> does not require any user interaction.</div>
</dd>
</dl>
</div>
<p><hr class="function_sep"><p>
<div class="function"><a name="$interface->getInput"></a>
<h3>$interface->getInput</h3>
<dl>
<dt class="decl">
<span class="return-type"> String</span> <strong>$interface->getInput</strong>(<span class="type">float</span> timeout)
</dt>
<dd>
<dl class="params_and_returns">
<dt class="params"><strong>Parameters:</strong></dt>
<dd class="param"><code>timeout</code> : Number of second to wait until keyboard data is available. Negative numbers will wait forever, 0 will not wait at all.</dd>
<dt class="returns"><strong>Returns:</strong></dt>
<dd class="returns">The keyboard data (excluding newline), or undef if there's no keyboard data available.</dd>
</dl><p>
<div class="desc">Reads keyboard data.</div>
</dd>
</dl>
</div>
<p><hr class="function_sep"><p>
<div class="function"><a name="$interface->iterate"></a>
<h3>$interface->iterate</h3>
<dl>
<dt class="decl">
<span class="return-type"> void</span> <strong>$interface->iterate</strong>()
</dt>
<dd>
<div class="desc">Process messages in the user interface message queue.
In other words: make sure the user interface updates itself.
(redraw controls when necessary, etc.)</div>
</dd>
</dl>
</div>
<p><hr class="function_sep"><p>
<div class="function"><a name="$interface->mainLoop"></a>
<h3>$interface->mainLoop</h3>
<dl>
<dt class="decl">
<span class="return-type"> void</span> <strong>$interface->mainLoop</strong>()
</dt>
<dd>
<div class="desc">Enter the interface's main loop.</div>
</dd>
</dl>
</div>
<p><hr class="function_sep"><p>
<div class="function"><a name="$interface->query"></a>
<h3>$interface->query</h3>
<dl>
<dt class="decl">
<span class="return-type"> String</span> <strong>$interface->query</strong>(<span class="type">String</span> message, options...)
</dt>
<dd>
<dl class="params_and_returns">
<dt class="params"><strong>Parameters:</strong></dt>
<dd class="param"><code>message</code> : A message to display when asking for input.</dd>
<dt class="requires"><strong>Requires:</strong></dt>
<dd class="requires">defined($message)</dd>
<dt class="returns"><strong>Returns:</strong></dt>
<dd class="returns">The user input, or undef if the user cancelled.</dd>
</dl><p>
<div class="desc">Ask the user to enter a one-line input text.
The following options are allowed:
<ul>
<li>cancelable - Whether the user is allowed to enter nothing. If this is set to true,
then the user will be asked the same thing over and over until he
replies with a non-empty input. The default is true.</li>
<li>title - A title to display in the query dialog. The default is "Query".</li>
<li>isPassword - Whether this query is a password query. The default is false.
</li>
</ul></div>
</dd>
</dl>
</div>
<p><hr class="function_sep"><p>
<div class="function"><a name="$interface->showMenu"></a>
<h3>$interface->showMenu</h3>
<dl>
<dt class="decl">
<span class="return-type"> int</span> <strong>$interface->showMenu</strong>(<span class="type">String</span> message, Array<String>* choices, options...)
</dt>
<dd>
<dl class="params_and_returns">
<dt class="params"><strong>Parameters:</strong></dt>
<dd class="param"><code>message</code> : The message to display while asking the user to make a choice.</dd>
<dd class="param"><code>choices</code> : The possible choices.</dd>
<dd class="param"><code> for all $k in @{$choices}</code> : defined($k)</dd>
<dt class="requires"><strong>Requires:</strong></dt>
<dd class="requires"> defined($message) defined($choices)</dd>
<dt class="ensures"><strong>Ensures:</strong></dt>
<dd class="ensures">-1 <= result < <code>@{</code>$choices}</dd>
<dt class="returns"><strong>Returns:</strong></dt>
<dd class="returns">The index of the chosen item, or -1 if the user cancelled.</dd>
</dl><p>
<div class="desc">Ask the user to choose an item from a menu of choices.
<p>
The following options are allowed:
<ul>
<li>title - The title to display when presenting the choices to the user.
The default is 'Menu'.</li>
<li>cancelable - Whether the user is allowed to not choose.
The default is true.
</li>
</ul></div>
</dd>
</dl>
</div>
<p><hr class="function_sep"><p>
<div class="function"><a name="$interface->title"></a>
<h3>$interface->title</h3>
<dl>
<dt class="decl">
<span class="return-type"> String</span> <strong>$interface->title</strong>(<span class="type">[String</span> title])
</dt>
<dd>
<div class="desc">If <code>$title</code> is given, set the interface's window's title to <code>$title</code>.
If not given, returns the current window title.</div>
</dd>
</dl>
</div>
<p><hr class="function_sep"><p>
<div class="function"><a name="$interface->writeOutput"></a>
<h3>$interface->writeOutput</h3>
<dl>
<dt class="decl">
<span class="return-type"> void</span> <strong>$interface->writeOutput</strong>(<span class="type">String</span> type, String message, String domain)
</dt>
<dd>
<dl class="params_and_returns">
<dt class="requires"><strong>Requires:</strong></dt>
<dd class="requires">defined($type) && defined($message) && defined($domain)</dd>
</dl><p>
<div class="desc">Writes a message to the interface's console.
This method should not be used directly, use <a href="Log.html#Log::message"><code>Log::message()</code></a> instead.</div>
</dd>
</dl>
</div>
<p><hr class="function_sep"><p>
<div class="function"><a name="Interface->loadInterface"></a>
<h3>Interface->loadInterface</h3>
<dl>
<dt class="decl">
<span class="return-type"> </span><strong>Interface->loadInterface</strong>(<span class="type">String</span> name)
</dt>
<dd>
<dl class="params_and_returns">
<dt class="params"><strong>Parameters:</strong></dt>
<dd class="param"><code>name</code> : The class name of the interface to load, excluding the 'Interface::' prefix.</dd>
<dt class="returns"><strong>Returns:</strong></dt>
<dd class="returns">The newly created interface object.</dd>
</dl><p>
<div class="desc">Create a new interface of the specified class.
<p>
Throws ModuleLoadException if the interface's Perl module cannot be loaded.
Throws ClassCreateException if the interface class cannot be created.</div>
</dd>
</dl>
</div>
</div>
<p><hr><p>
<div id="footer">
<ul>
<li><a href="http://validator.w3.org/check?uri=referer" title="Valid HTML 4.01!"><img src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" height="31" width="88"></a></li>
<li><a href="http://www.mozilla.com/" title="Get Firefox - Take Back the Web"><img width="104" height="32" src="http://www.mozilla.org/products/firefox/buttons/getfirefox_small.png" alt="Get Firefox - Take Back the Web"></a></li>
<li><a href="http://www.mozilla.com/" title="If you were looking at this page in any browser but Microsoft Internet Explorer, it would look and run better and faster"><img width="45" height="45" src="http://linuxart.com/img/noIE-small.png" alt="If you were looking at this page in any browser but Microsoft Internet Explorer, it would look and run better and faster"></a></li>
</ul>
Last modified: Fri Nov 16 10:05:11 2012
</div>
</div>
</body>
</html>