-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnw_api.html
257 lines (250 loc) · 9.61 KB
/
nw_api.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title> nw api - native widgets API </title>
<script src="jquery.js"></script>
<script src="jquery-cookie.js"></script>
<script src="jquery-tablesorter.js"></script>
<script src="strftime.js"></script>
<script src="mustache.js"></script>
<script src="config.js"></script>
<script src="main.js"></script>
<link rel="stylesheet" type="text/css" href="templates/reset.css" />
<link rel="stylesheet" type="text/css" href="templates/hack.css" />
<link rel="stylesheet" type="text/css" id="lights_css" />
<script>
var DOCNAME = 'nw_api'
var PROJECT = 'nw'
//set the lights before rendering starts
set_lights()
</script>
</head>
<body>
<header>
<div class="container">
<div class="btn-container btn-lights-container">
<a href="#" class="btn btn-lights" id="lights">lights</a>
</div>
<div class="btn-container btn-home-container">
<a href="/" class="btn btn-home">luapower</a>
</div>
<table id="header_table">
<tr>
<td style="vertical-align: middle;" width="100%">
<h1> nw api </h1>
<h2> native widgets API </h2>
</td>
<td style="vertical-align: middle;" align="right" style="height: 150px">
<table><tr><td>
<div class="doc" id="package_info_container">
<div id="package_info"> </div>
<div id="commit_log"> </div>
</div>
<a href="https://github.com/luapower/nw" class="btn btn-rightside btn-github"><span class="icon"></span>View on GitHub</a>
</td></tr><tr><td>
<a href="https://github.com/luapower/nw/tarball/master" class="btn btn-rightside">Download as .tar.gz</a>
</td></tr><tr><td>
<a href="https://github.com/luapower/nw/zipball/master" class="btn btn-rightside">Download as .zip</a>
</td></tr></table>
</td>
</tr>
</table>
<div class="btn-container btn-discuss-container">
<a href="https://github.com/luapower/nw/issues/new" target="_blank"
class="btn btn-rightside btn-discuss"><span class="icon"></span>Discuss</a>
</div>
</div>
</header>
<div class="bg-container">
<div class="bg-center-container">
<div class="bg bg-nw" style="background-image: url('bg/nw.png');"></div>
</div>
</div>
<div class="under-header">
<div class="container">
<div id="toc_container" class="toc_container doc"></div>
<button id=tab1_button class="tab_button hidden">Documentation</button>
<button id=tab2_button class="tab_button hidden">Package Info</button>
<div id="tabs_cointainer">
<div id="tab1_container">
<section class="doc">
<span id="module_info"></span>
<h2 id="local-nw-requirenw"><code>local nw = require'nw'</code></h2>
<blockquote>
<p>In the following table "?" means boolean.</p>
</blockquote>
<table>
<col width="15%" />
<col width="29%" />
<col width="31%" />
<col width="23%" />
<tbody>
<tr class="odd">
<td align="left"><strong>topic</strong></td>
<td align="left"><strong>actions</strong></td>
<td align="left"><strong>queries</strong></td>
<td align="left"><strong>events</strong></td>
</tr>
<tr class="even">
<td align="left">backends</td>
<td align="left">nw:init([backendname])</td>
<td align="left">nw.backends-> {OS = backendname}<br />nw.backend.name -> name<br />nw:os() -> os_version<br />nw:os(compat_version) -> ?</td>
<td align="left"></td>
</tr>
<tr class="odd">
<td align="left">OOP</td>
<td align="left">obj:override(method, func)</td>
<td align="left"></td>
<td align="left"></td>
</tr>
<tr class="even">
<td align="left">events</td>
<td align="left">obj:observe(event, func)</td>
<td align="left"></td>
<td align="left">obj:event(name, args...)<br />obj:<eventname>(args...)</td>
</tr>
<tr class="odd">
<td align="left">app singleton</td>
<td align="left"></td>
<td align="left">nw:app() -> app</td>
<td align="left"></td>
</tr>
<tr class="even">
<td align="left">message loop</td>
<td align="left">app:run()<br />app:stop()</td>
<td align="left">app:running()</td>
<td align="left"></td>
</tr>
<tr class="odd">
<td align="left">quitting</td>
<td align="left">app:autoquit(?)<br />win:autoquit(?)<br />app:quit()</td>
<td align="left">app:autoquit() -> ?<br />win:autoquit() -> ?</td>
<td align="left"><br /><br />app:quitting() -> ?</td>
</tr>
<tr class="even">
<td align="left">time</td>
<td align="left"></td>
<td align="left">app:time() -> time<br />app:timediff(time1, time2) -> ms</td>
<td align="left"></td>
</tr>
<tr class="odd">
<td align="left">timers</td>
<td align="left">app:runevery(seconds, func)<br />app:runafter(seconds, func)</td>
<td align="left"></td>
<td align="left">func() -> continue?</td>
</tr>
<tr class="even">
<td align="left">window list</td>
<td align="left"></td>
<td align="left">app:windows([order]) -> {win1,...}<br />app:window_count() -> n</td>
<td align="left">app:window_created()<br />app:window_closed()</td>
</tr>
<tr class="odd">
<td align="left">windows</td>
<td align="left">app:window(params) -> win<br />win:close()</td>
<td align="left"><br />win:dead() -> ?</td>
<td align="left"><br />win:closing() -> ?<br />win:closed()</td>
</tr>
<tr class="even">
<td align="left">app activation</td>
<td align="left">app:activate()<br /></td>
<td align="left">app:active() -> ?<br /></td>
<td align="left">app:activated()<br />app:deactivated()</td>
</tr>
<tr class="odd">
<td align="left">window activation</td>
<td align="left">win:activate()</td>
<td align="left">win:active() -> ?<br />app:active_window() -> win</td>
<td align="left">win:activated()<br />win:deactivated()</td>
</tr>
<tr class="even">
<td align="left">window state</td>
<td align="left">win:show()<br />win:hide()<br />win:minimize()<br />win:maximize()<br />win:restore()<br />win:shownormal()<br />win:fullscreen()</td>
<td align="left">win:visible() -> ?<br /><br />win:minimized() -> ?<br />win:maximized() -> ?<br /><br /><br />win:fullscreen() -> ?</td>
<td align="left"></td>
</tr>
<tr class="odd">
<td align="left">position</td>
<td align="left">win:frame_rect(x, y, w, h)</td>
<td align="left">win:frame_rect() -> x, y, w, h<br />win:client_rect() -> x, y, w, h</td>
<td align="left">win:resizing(how, x, y, w, h) -> x, y, w, h<br />win:resized()</td>
</tr>
<tr class="even">
<td align="left">displays</td>
<td align="left"></td>
<td align="left">app:displays() -> {disp1, ...}<br />app:display_count() -> n<br />app:active_display() -> disp<br />win:display() -> disp<br />disp:rect() -> x, y, w, h<br />disp:client_rect() -> x, y, w, h</td>
<td align="left">app:displays_changed()</td>
</tr>
<tr class="odd">
<td align="left">mouse pointer</td>
<td align="left">win:cursor(name)</td>
<td align="left"></td>
<td align="left"></td>
</tr>
<tr class="even">
<td align="left">frame</td>
<td align="left">win:title(title)<br /><br /><br /><br /><br /><br /><br />win:edgesnapping(?)</td>
<td align="left">win:title() -> title<br />win:frame() -> frame<br />win:minimizable() -> ?<br />win:maximizable() -> ?<br />win:closeable() -> ?<br />win:resizeable() -> ?<br />win:fullscreenable() -> ?<br />win:edgesnapping() -> ?</td>
<td align="left"></td>
</tr>
<tr class="odd">
<td align="left">z-order</td>
<td align="left">win:topmost(?)<br />win:order(z|'back'|'front')</td>
<td align="left">win:topmost() -> ?<br />win:zorder() -> z</td>
<td align="left"></td>
</tr>
<tr class="even">
<td align="left">parent</td>
<td align="left"></td>
<td align="left">win:parent() -> parent</td>
<td align="left"></td>
</tr>
<tr class="odd">
<td align="left">keyboard</td>
<td align="left">app:ignore_numlock(?)</td>
<td align="left">app:ignore_numlock() -> ?<br />win:key(keyquery) -> pressed?</td>
<td align="left">win:keydown(key, vkey)<br />win:keyup(key, vkey)<br />win:keypress(key, vkey)<br />win:keychar(char)</td>
</tr>
<tr class="even">
<td align="left">mouse</td>
<td align="left"></td>
<td align="left">win:mouse() -> m<br />m.x, m.y,<br />m.left, m.right, m.middle,<br />m.ex1, m.ex2<br />win:mouse(var) -> m[var]</td>
<td align="left">win:mousedown(button)<br />win:click(button, count) -> reset?<br />win:mouseup(button)<br />win:mouseenter()<br />win:mouseleave()<br />win:mousemove(x, y)<br />win:mousewheel(delta)<br />win:mousehwheel(delta)</td>
</tr>
<tr class="odd">
<td align="left">rendering</td>
<td align="left">win:invalidate()</td>
<td align="left"></td>
<td align="left">win:render(cr)</td>
</tr>
<tr class="even">
<td align="left">menus</td>
<td align="left">app:menu() -> menu menu:add([i,]text,action) -> i<br />menu:add([i,]text,menu) -> i<br />menu:add(args) -> i<br />menu:set(index, text, action)<br />menu:set(index, text, menu)<br />menu:set(menuitem)<br /><br />menu:checked(index, ?)<br />menu:enabled(index, ?)</td>
<td align="left">win:menubar() -> menu<br /><br /><br /><br />menu:get(index) -> {text=,...}<br /><br />menu:get(index) -> menuitem<br />menu:item_count() -> n<br />menu:checked(index) -> ?<br />menu:enabled(index) -> ?</td>
<td align="left">action()</td>
</tr>
</tbody>
</table>
</section>
</div>
<div id="tab2_container" class="doc"></div>
</div>
</div>
<div class="container">
<footer>
<div id="disqus_thread"></div>
<div class="faint">[email protected] | <a href="http://unlicense.org/">public domain</a></div>
</footer>
</div>
</div>
<script type="text/x-mustache" id=info_tab_template>
<h3>Modules</h3>
<ul>
{{#module_array}}
<li>{{name}}</li>
{{/module_array}}
</ul>
</script>
</body>
</html>