ruby-snarl 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/doc/classes/AutoSnarl.html +170 -0
- data/doc/classes/Snarl.html +457 -0
- data/doc/classes/Snarl/SnarlAPI.html +255 -0
- data/doc/created.rid +1 -0
- data/doc/files/examples/example1_rb.html +108 -0
- data/doc/files/examples/example2_rb.html +108 -0
- data/doc/files/examples/example3_rb.html +108 -0
- data/doc/files/examples/example4_rb.html +108 -0
- data/doc/files/lib/autosnarl_rb.html +108 -0
- data/doc/files/lib/snarl_rb.html +109 -0
- data/doc/fr_class_index.html +29 -0
- data/doc/fr_file_index.html +32 -0
- data/doc/fr_method_index.html +40 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/examples/example1.rb +3 -0
- data/examples/example2.rb +14 -0
- data/examples/example3.rb +9 -0
- data/examples/example4.rb +11 -0
- data/examples/test.png +0 -0
- data/icons/accept.png +0 -0
- data/icons/exclamation.png +0 -0
- data/icons/information.png +0 -0
- data/lib/autosnarl.rb +47 -0
- data/lib/snarl.rb +151 -0
- data/readme.txt +70 -0
- data/ruby-snarl.gemspec +18 -0
- data/test/readme.txt +8 -0
- metadata +83 -0
@@ -0,0 +1,255 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Module: Snarl::SnarlAPI</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">Snarl::SnarlAPI</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/snarl_rb.html">
|
59
|
+
lib/snarl.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
<div id="description">
|
76
|
+
<p>
|
77
|
+
This is the lowlevel API implemenation using DL and a few handy constants
|
78
|
+
from the snarl api and the Win32 API Note that I have jump through some
|
79
|
+
hoops to get the array of characters to work corretly — if you know a
|
80
|
+
better way please send me (phurley@gmail.com) a note.
|
81
|
+
</p>
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
|
86
|
+
</div>
|
87
|
+
|
88
|
+
<div id="method-list">
|
89
|
+
<h3 class="section-bar">Methods</h3>
|
90
|
+
|
91
|
+
<div class="name-list">
|
92
|
+
<a href="#M000012">send</a>
|
93
|
+
<a href="#M000011">to_cha</a>
|
94
|
+
</div>
|
95
|
+
</div>
|
96
|
+
|
97
|
+
</div>
|
98
|
+
|
99
|
+
|
100
|
+
<!-- if includes -->
|
101
|
+
|
102
|
+
<div id="section">
|
103
|
+
|
104
|
+
|
105
|
+
<div id="constants-list">
|
106
|
+
<h3 class="section-bar">Constants</h3>
|
107
|
+
|
108
|
+
<div class="name-list">
|
109
|
+
<table summary="Constants">
|
110
|
+
<tr class="top-aligned-row context-row">
|
111
|
+
<td class="context-item-name">SNARL_SHOW</td>
|
112
|
+
<td>=</td>
|
113
|
+
<td class="context-item-value">1</td>
|
114
|
+
</tr>
|
115
|
+
<tr class="top-aligned-row context-row">
|
116
|
+
<td class="context-item-name">SNARL_HIDE</td>
|
117
|
+
<td>=</td>
|
118
|
+
<td class="context-item-value">2</td>
|
119
|
+
</tr>
|
120
|
+
<tr class="top-aligned-row context-row">
|
121
|
+
<td class="context-item-name">SNARL_UPDATE</td>
|
122
|
+
<td>=</td>
|
123
|
+
<td class="context-item-value">3</td>
|
124
|
+
</tr>
|
125
|
+
<tr class="top-aligned-row context-row">
|
126
|
+
<td class="context-item-name">SNARL_IS_VISIBLE</td>
|
127
|
+
<td>=</td>
|
128
|
+
<td class="context-item-value">4</td>
|
129
|
+
</tr>
|
130
|
+
<tr class="top-aligned-row context-row">
|
131
|
+
<td class="context-item-name">SNARL_GET_VERSION</td>
|
132
|
+
<td>=</td>
|
133
|
+
<td class="context-item-value">5</td>
|
134
|
+
</tr>
|
135
|
+
<tr class="top-aligned-row context-row">
|
136
|
+
<td class="context-item-name">SNARL_REGISTER_CONFIG_WINDOW</td>
|
137
|
+
<td>=</td>
|
138
|
+
<td class="context-item-value">6</td>
|
139
|
+
</tr>
|
140
|
+
<tr class="top-aligned-row context-row">
|
141
|
+
<td class="context-item-name">SNARL_REVOKE_CONFIG_WINDOW</td>
|
142
|
+
<td>=</td>
|
143
|
+
<td class="context-item-value">7</td>
|
144
|
+
</tr>
|
145
|
+
<tr class="top-aligned-row context-row">
|
146
|
+
<td class="context-item-name">SNARL_TEXT_LENGTH</td>
|
147
|
+
<td>=</td>
|
148
|
+
<td class="context-item-value">1024</td>
|
149
|
+
</tr>
|
150
|
+
<tr class="top-aligned-row context-row">
|
151
|
+
<td class="context-item-name">WM_COPYDATA</td>
|
152
|
+
<td>=</td>
|
153
|
+
<td class="context-item-value">0x4a</td>
|
154
|
+
</tr>
|
155
|
+
<tr class="top-aligned-row context-row">
|
156
|
+
<td class="context-item-name">SnarlStruct</td>
|
157
|
+
<td>=</td>
|
158
|
+
<td class="context-item-value">struct [ "int cmd", "long id", "long timeout", "long data2", "char title[#{SNARL_TEXT_LENGTH}]", "char text[#{SNARL_TEXT_LENGTH}]", "char icon[#{SNARL_TEXT_LENGTH}]", ]</td>
|
159
|
+
</tr>
|
160
|
+
<tr class="top-aligned-row context-row">
|
161
|
+
<td class="context-item-name">CopyDataStruct</td>
|
162
|
+
<td>=</td>
|
163
|
+
<td class="context-item-value">struct [ "long dwData", "long cbData", "void* lpData", ]</td>
|
164
|
+
</tr>
|
165
|
+
</table>
|
166
|
+
</div>
|
167
|
+
</div>
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
<!-- if method_list -->
|
175
|
+
<div id="methods">
|
176
|
+
<h3 class="section-bar">Public Class methods</h3>
|
177
|
+
|
178
|
+
<div id="method-M000012" class="method-detail">
|
179
|
+
<a name="M000012"></a>
|
180
|
+
|
181
|
+
<div class="method-heading">
|
182
|
+
<a href="#M000012" class="method-signature">
|
183
|
+
<span class="method-name">send</span><span class="method-args">(ss)</span>
|
184
|
+
</a>
|
185
|
+
</div>
|
186
|
+
|
187
|
+
<div class="method-description">
|
188
|
+
<p>
|
189
|
+
Send the structure off to snarl, the routine will return (if everything
|
190
|
+
goes well) the result of SendMessage which has an overloaded meaning based
|
191
|
+
upon the cmd being sent
|
192
|
+
</p>
|
193
|
+
<p><a class="source-toggle" href="#"
|
194
|
+
onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
|
195
|
+
<div class="method-source-code" id="M000012-source">
|
196
|
+
<pre>
|
197
|
+
<span class="ruby-comment cmt"># File lib/snarl.rb, line 60</span>
|
198
|
+
60: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">ss</span>)
|
199
|
+
61: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">isWindow</span>(<span class="ruby-identifier">hwnd</span> = <span class="ruby-identifier">findWindow</span>(<span class="ruby-keyword kw">nil</span>, <span class="ruby-value str">'Snarl'</span>))
|
200
|
+
62: <span class="ruby-identifier">cd</span> = <span class="ruby-constant">CopyDataStruct</span>.<span class="ruby-identifier">malloc</span>
|
201
|
+
63: <span class="ruby-identifier">cd</span>.<span class="ruby-identifier">dwData</span> = <span class="ruby-value">2</span>
|
202
|
+
64: <span class="ruby-identifier">cd</span>.<span class="ruby-identifier">cbData</span> = <span class="ruby-identifier">ss</span>.<span class="ruby-identifier">size</span>
|
203
|
+
65: <span class="ruby-identifier">cd</span>.<span class="ruby-identifier">lpData</span> = <span class="ruby-identifier">ss</span>.<span class="ruby-identifier">to_ptr</span>
|
204
|
+
66: <span class="ruby-identifier">sendMessage</span>(<span class="ruby-identifier">hwnd</span>, <span class="ruby-constant">WM_COPYDATA</span>, <span class="ruby-value">0</span>, <span class="ruby-identifier">cd</span>.<span class="ruby-identifier">to_ptr</span>)
|
205
|
+
67: <span class="ruby-keyword kw">end</span>
|
206
|
+
68: <span class="ruby-keyword kw">end</span>
|
207
|
+
</pre>
|
208
|
+
</div>
|
209
|
+
</div>
|
210
|
+
</div>
|
211
|
+
|
212
|
+
<div id="method-M000011" class="method-detail">
|
213
|
+
<a name="M000011"></a>
|
214
|
+
|
215
|
+
<div class="method-heading">
|
216
|
+
<a href="#M000011" class="method-signature">
|
217
|
+
<span class="method-name">to_cha</span><span class="method-args">(str)</span>
|
218
|
+
</a>
|
219
|
+
</div>
|
220
|
+
|
221
|
+
<div class="method-description">
|
222
|
+
<p>
|
223
|
+
character array hoop jumping, we take the passed string and convert it into
|
224
|
+
an array of integers, padded out to the correct length <a
|
225
|
+
href="SnarlAPI.html#M000011">to_cha</a> —> to character array I do
|
226
|
+
this as it seems necessary to fit the DL API, if there is a better way
|
227
|
+
please let me know
|
228
|
+
</p>
|
229
|
+
<p><a class="source-toggle" href="#"
|
230
|
+
onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
|
231
|
+
<div class="method-source-code" id="M000011-source">
|
232
|
+
<pre>
|
233
|
+
<span class="ruby-comment cmt"># File lib/snarl.rb, line 52</span>
|
234
|
+
52: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_cha</span>(<span class="ruby-identifier">str</span>)
|
235
|
+
53: <span class="ruby-identifier">result</span> = <span class="ruby-identifier">str</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/(.)/</span>).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">ch</span><span class="ruby-operator">|</span> <span class="ruby-identifier">ch</span>[<span class="ruby-value">0</span>] }.<span class="ruby-identifier">compact</span>
|
236
|
+
54: <span class="ruby-identifier">result</span> <span class="ruby-operator">+</span> <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">SNARL_TEXT_LENGTH</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">size</span>, <span class="ruby-value">0</span>)
|
237
|
+
55: <span class="ruby-keyword kw">end</span>
|
238
|
+
</pre>
|
239
|
+
</div>
|
240
|
+
</div>
|
241
|
+
</div>
|
242
|
+
|
243
|
+
|
244
|
+
</div>
|
245
|
+
|
246
|
+
|
247
|
+
</div>
|
248
|
+
|
249
|
+
|
250
|
+
<div id="validator-badges">
|
251
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
252
|
+
</div>
|
253
|
+
|
254
|
+
</body>
|
255
|
+
</html>
|
data/doc/created.rid
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Mon Aug 07 12:53:22 Eastern Standard Time 2006
|
@@ -0,0 +1,108 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>File: example1.rb</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="fileHeader">
|
50
|
+
<h1>example1.rb</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>examples/example1.rb
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Mon Aug 07 11:44:02 Eastern Standard Time 2006</td>
|
60
|
+
</tr>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
|
72
|
+
<div id="requires-list">
|
73
|
+
<h3 class="section-bar">Required files</h3>
|
74
|
+
|
75
|
+
<div class="name-list">
|
76
|
+
snarl
|
77
|
+
</div>
|
78
|
+
</div>
|
79
|
+
|
80
|
+
</div>
|
81
|
+
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
|
86
|
+
<!-- if includes -->
|
87
|
+
|
88
|
+
<div id="section">
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
<!-- if method_list -->
|
98
|
+
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
|
103
|
+
<div id="validator-badges">
|
104
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
105
|
+
</div>
|
106
|
+
|
107
|
+
</body>
|
108
|
+
</html>
|
@@ -0,0 +1,108 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>File: example2.rb</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="fileHeader">
|
50
|
+
<h1>example2.rb</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>examples/example2.rb
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Mon Aug 07 11:44:02 Eastern Standard Time 2006</td>
|
60
|
+
</tr>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
|
72
|
+
<div id="requires-list">
|
73
|
+
<h3 class="section-bar">Required files</h3>
|
74
|
+
|
75
|
+
<div class="name-list">
|
76
|
+
snarl
|
77
|
+
</div>
|
78
|
+
</div>
|
79
|
+
|
80
|
+
</div>
|
81
|
+
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
|
86
|
+
<!-- if includes -->
|
87
|
+
|
88
|
+
<div id="section">
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
<!-- if method_list -->
|
98
|
+
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
|
103
|
+
<div id="validator-badges">
|
104
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
105
|
+
</div>
|
106
|
+
|
107
|
+
</body>
|
108
|
+
</html>
|