context 0.0.16 → 0.0.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. data/AUTHORS +1 -0
  2. data/COPYING +679 -0
  3. data/README +188 -0
  4. data/Rakefile.rb +64 -18
  5. data/lib/Context/Bridge.rb +7 -6
  6. data/lib/Context/Context.rb +14 -35
  7. data/lib/Context/Gtk/Widget.rb +139 -33
  8. data/lib/Context/Log.rb +10 -0
  9. data/lib/Context/Publisher.rb +108 -0
  10. data/lib/Context/Spec.rb +8 -0
  11. data/lib/Context/Version.rb +1 -1
  12. data/lib/Context/View.rb +16 -15
  13. data/lib/Context/Views/Gtk/PageView.rb +3 -23
  14. data/lib/Context/Views/Gtk/Widgets/MainWindow.rb +70 -0
  15. data/lib/Context/Views/Gtk/Widgets/VBox.rb +29 -0
  16. data/lib/Context/Widget.rb +18 -27
  17. data/spec/Context/Bridge_spec.rb +19 -20
  18. data/spec/Context/Context_spec.rb +77 -63
  19. data/spec/Context/Gtk/Widget_spec.rb +23 -23
  20. data/spec/Context/Publisher_spec.rb +53 -0
  21. data/spec/Context/View_spec.rb +10 -14
  22. data/spec/Context/Views/Gtk/PageView_spec.rb +25 -9
  23. data/spec/Context/require_all_spec.rb +14 -7
  24. data/test_results.html +84 -121
  25. metadata +74 -128
  26. data/coverage/-usr-local-lib-site_ruby-1_8-atk_rb.html +0 -612
  27. data/coverage/-usr-local-lib-site_ruby-1_8-gdk_pixbuf2_rb.html +0 -637
  28. data/coverage/-usr-local-lib-site_ruby-1_8-glib2_rb.html +0 -829
  29. data/coverage/-usr-local-lib-site_ruby-1_8-gtk2-base_rb.html +0 -709
  30. data/coverage/-usr-local-lib-site_ruby-1_8-gtk2_rb.html +0 -623
  31. data/coverage/-usr-local-lib-site_ruby-1_8-pango_rb.html +0 -665
  32. data/coverage/-var-lib-gems-1_8-gems-cairo-1_7_0-src-lib-cairo-color_rb.html +0 -865
  33. data/coverage/-var-lib-gems-1_8-gems-cairo-1_7_0-src-lib-cairo-colors_rb.html +0 -1266
  34. data/coverage/-var-lib-gems-1_8-gems-cairo-1_7_0-src-lib-cairo-constants_rb.html +0 -632
  35. data/coverage/-var-lib-gems-1_8-gems-cairo-1_7_0-src-lib-cairo-context-blur_rb.html +0 -655
  36. data/coverage/-var-lib-gems-1_8-gems-cairo-1_7_0-src-lib-cairo-context-circle_rb.html +0 -619
  37. data/coverage/-var-lib-gems-1_8-gems-cairo-1_7_0-src-lib-cairo-context-color_rb.html +0 -621
  38. data/coverage/-var-lib-gems-1_8-gems-cairo-1_7_0-src-lib-cairo-context-path_rb.html +0 -726
  39. data/coverage/-var-lib-gems-1_8-gems-cairo-1_7_0-src-lib-cairo-context-rectangle_rb.html +0 -643
  40. data/coverage/-var-lib-gems-1_8-gems-cairo-1_7_0-src-lib-cairo-context-triangle_rb.html +0 -622
  41. data/coverage/-var-lib-gems-1_8-gems-cairo-1_7_0-src-lib-cairo-context_rb.html +0 -639
  42. data/coverage/-var-lib-gems-1_8-gems-cairo-1_7_0-src-lib-cairo-paper_rb.html +0 -793
  43. data/coverage/-var-lib-gems-1_8-gems-cairo-1_7_0-src-lib-cairo-papers_rb.html +0 -651
  44. data/coverage/-var-lib-gems-1_8-gems-cairo-1_7_0-src-lib-cairo-path_rb.html +0 -625
  45. data/coverage/-var-lib-gems-1_8-gems-cairo-1_7_0-src-lib-cairo-point_rb.html +0 -617
  46. data/coverage/-var-lib-gems-1_8-gems-cairo-1_7_0-src-lib-cairo_rb.html +0 -756
  47. data/coverage/index.html +0 -1170
  48. data/coverage/lib-Context-Bridge_rb.html +0 -673
  49. data/coverage/lib-Context-Context_rb.html +0 -756
  50. data/coverage/lib-Context-EnumeratedType_rb.html +0 -661
  51. data/coverage/lib-Context-ExecutionProxy_rb.html +0 -671
  52. data/coverage/lib-Context-Gtk-App_rb.html +0 -638
  53. data/coverage/lib-Context-Gtk-Key_rb.html +0 -664
  54. data/coverage/lib-Context-Gtk-Widget_rb.html +0 -667
  55. data/coverage/lib-Context-KeyAssignment_rb.html +0 -641
  56. data/coverage/lib-Context-KeyMap_rb.html +0 -653
  57. data/coverage/lib-Context-Key_rb.html +0 -667
  58. data/coverage/lib-Context-View_rb.html +0 -659
  59. data/coverage/lib-Context-Views-Gtk-PageView_rb.html +0 -660
  60. data/coverage/lib-Context-Views-PageView_rb.html +0 -627
  61. data/coverage/lib-Context-Widget_rb.html +0 -650
  62. data/coverage/lib-Context-require_all_rb.html +0 -623
  63. data/doc/classes/Context.html +0 -174
  64. data/doc/classes/Context/Bridge.html +0 -296
  65. data/doc/classes/Context/Context.html +0 -564
  66. data/doc/classes/Context/EnumeratedType.html +0 -283
  67. data/doc/classes/Context/ExecutionProxy.html +0 -228
  68. data/doc/classes/Context/Gtk.html +0 -126
  69. data/doc/classes/Context/Gtk/App.html +0 -217
  70. data/doc/classes/Context/Gtk/Key.html +0 -292
  71. data/doc/classes/Context/Gtk/PageView.html +0 -245
  72. data/doc/classes/Context/Gtk/PageView/MainWindow.html +0 -200
  73. data/doc/classes/Context/Gtk/Widget.html +0 -311
  74. data/doc/classes/Context/Key.html +0 -305
  75. data/doc/classes/Context/Key/Modifier.html +0 -117
  76. data/doc/classes/Context/KeyAssignment.html +0 -234
  77. data/doc/classes/Context/KeyMap.html +0 -273
  78. data/doc/classes/Context/PageView.html +0 -180
  79. data/doc/classes/Context/View.html +0 -334
  80. data/doc/classes/Context/Widget.html +0 -298
  81. data/doc/classes/Kernel.html +0 -148
  82. data/doc/classes/Object.html +0 -196
  83. data/doc/created.rid +0 -1
  84. data/doc/files/lib/Context/Bridge_rb.html +0 -108
  85. data/doc/files/lib/Context/Context_rb.html +0 -109
  86. data/doc/files/lib/Context/EnumeratedType_rb.html +0 -101
  87. data/doc/files/lib/Context/ExecutionProxy_rb.html +0 -101
  88. data/doc/files/lib/Context/Gtk/App_rb.html +0 -110
  89. data/doc/files/lib/Context/Gtk/Key_rb.html +0 -109
  90. data/doc/files/lib/Context/Gtk/Widget_rb.html +0 -109
  91. data/doc/files/lib/Context/KeyAssignment_rb.html +0 -108
  92. data/doc/files/lib/Context/KeyMap_rb.html +0 -109
  93. data/doc/files/lib/Context/Key_rb.html +0 -108
  94. data/doc/files/lib/Context/Version_rb.html +0 -101
  95. data/doc/files/lib/Context/View_rb.html +0 -101
  96. data/doc/files/lib/Context/Views/Gtk/PageView_rb.html +0 -111
  97. data/doc/files/lib/Context/Views/PageView_rb.html +0 -108
  98. data/doc/files/lib/Context/Widget_rb.html +0 -101
  99. data/doc/files/lib/Context/require_all_rb.html +0 -101
  100. data/doc/fr_class_index.html +0 -46
  101. data/doc/fr_file_index.html +0 -42
  102. data/doc/fr_method_index.html +0 -103
  103. data/doc/index.html +0 -24
  104. data/doc/rdoc-style.css +0 -208
  105. data/lib/Context/EnumeratedType.rb +0 -51
  106. data/lib/Context/ExecutionProxy.rb +0 -61
  107. data/lib/Context/Gtk/Key.rb +0 -54
  108. data/lib/Context/Key.rb +0 -57
  109. data/lib/Context/KeyAssignment.rb +0 -31
  110. data/lib/Context/KeyMap.rb +0 -43
  111. data/spec/Context/EnumeratedType_spec.rb +0 -51
  112. data/spec/Context/ExecutionProxy_spec.rb +0 -28
  113. data/spec/Context/Gtk/Key_spec.rb +0 -45
  114. data/spec/Context/KeyAssignment_spec.rb +0 -26
  115. data/spec/Context/KeyMap_spec.rb +0 -64
  116. data/spec/Context/Key_spec.rb +0 -22
  117. data/spec/Context/Widget_spec.rb +0 -15
@@ -1,305 +0,0 @@
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>Class: Context::Key</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>Class</strong></td>
53
- <td class="class-name-in-header">Context::Key</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/Context/Key_rb.html">
59
- lib/Context/Key.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- <tr class="top-aligned-row">
66
- <td><strong>Parent:</strong></td>
67
- <td>
68
- <a href="../Object.html">
69
- Object
70
- </a>
71
- </td>
72
- </tr>
73
- </table>
74
- </div>
75
- <!-- banner header -->
76
-
77
- <div id="bodyContent">
78
-
79
-
80
-
81
- <div id="contextContent">
82
-
83
- <div id="description">
84
- <p>
85
- Represents a keypress. Each key is represented by a character and a
86
- modifier (e.g., the control key)
87
- </p>
88
- <p>
89
- One could argue that this doesn&#8216;t deserve to be here at all. It is
90
- possible that some UI types won&#8216;t have a keyboard at all. However
91
- given that most will operate the same way indicates that it should have
92
- some level of abstraction. I have a feeling that this is YAGNI, though. And
93
- as such it might disappear at any point.
94
- </p>
95
-
96
- </div>
97
-
98
-
99
- </div>
100
-
101
- <div id="method-list">
102
- <h3 class="section-bar">Methods</h3>
103
-
104
- <div class="name-list">
105
- <a href="#M000074">eql?</a>&nbsp;&nbsp;
106
- <a href="#M000075">hash</a>&nbsp;&nbsp;
107
- <a href="#M000072">new</a>&nbsp;&nbsp;
108
- <a href="#M000073">null</a>&nbsp;&nbsp;
109
- <a href="#M000076">null?</a>&nbsp;&nbsp;
110
- </div>
111
- </div>
112
-
113
- </div>
114
-
115
-
116
- <!-- if includes -->
117
-
118
- <div id="section">
119
-
120
- <div id="class-list">
121
- <h3 class="section-bar">Classes and Modules</h3>
122
-
123
- Class <a href="Key/Modifier.html" class="link">Context::Key::Modifier</a><br />
124
-
125
- </div>
126
-
127
-
128
-
129
-
130
- <div id="attribute-list">
131
- <h3 class="section-bar">Attributes</h3>
132
-
133
- <div class="name-list">
134
- <table>
135
- <tr class="top-aligned-row context-row">
136
- <td class="context-item-name">character</td>
137
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
138
- <td class="context-item-desc"></td>
139
- </tr>
140
- <tr class="top-aligned-row context-row">
141
- <td class="context-item-name">modifier</td>
142
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
143
- <td class="context-item-desc"></td>
144
- </tr>
145
- </table>
146
- </div>
147
- </div>
148
-
149
-
150
-
151
- <!-- if method_list -->
152
- <div id="methods">
153
- <h3 class="section-bar">Public Class methods</h3>
154
-
155
- <div id="method-M000072" class="method-detail">
156
- <a name="M000072"></a>
157
-
158
- <div class="method-heading">
159
- <a href="#M000072" class="method-signature">
160
- <span class="method-name">new</span><span class="method-args">(modifier, character)</span>
161
- </a>
162
- </div>
163
-
164
- <div class="method-description">
165
- <p><a class="source-toggle" href="#"
166
- onclick="toggleCode('M000072-source');return false;">[Source]</a></p>
167
- <div class="method-source-code" id="M000072-source">
168
- <pre>
169
- <span class="ruby-comment cmt"># File lib/Context/Key.rb, line 26</span>
170
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">modifier</span>, <span class="ruby-identifier">character</span>)
171
- <span class="ruby-ivar">@modifier</span> = <span class="ruby-identifier">modifier</span>
172
- <span class="ruby-ivar">@character</span> = <span class="ruby-identifier">character</span>
173
- <span class="ruby-keyword kw">end</span>
174
- </pre>
175
- </div>
176
- </div>
177
- </div>
178
-
179
- <div id="method-M000073" class="method-detail">
180
- <a name="M000073"></a>
181
-
182
- <div class="method-heading">
183
- <a href="#M000073" class="method-signature">
184
- <span class="method-name">null</span><span class="method-args">()</span>
185
- </a>
186
- </div>
187
-
188
- <div class="method-description">
189
- <p>
190
- A non key that can be used as an error condition. Note: Perhaps this should
191
- be a constant??? Currently key.eql?(<a
192
- href="Key.html#M000073">Key.null</a>) will work, but key == <a
193
- href="Key.html#M000073">Key.null</a> won&#8216;t. FIXME
194
- </p>
195
- <p><a class="source-toggle" href="#"
196
- onclick="toggleCode('M000073-source');return false;">[Source]</a></p>
197
- <div class="method-source-code" id="M000073-source">
198
- <pre>
199
- <span class="ruby-comment cmt"># File lib/Context/Key.rb, line 35</span>
200
- <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Key</span>.<span class="ruby-identifier">null</span>
201
- <span class="ruby-constant">Key</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Modifier</span>.<span class="ruby-constant">NONE</span>, <span class="ruby-value str">'\0'</span>)
202
- <span class="ruby-keyword kw">end</span>
203
- </pre>
204
- </div>
205
- </div>
206
- </div>
207
-
208
- <h3 class="section-bar">Public Instance methods</h3>
209
-
210
- <div id="method-M000074" class="method-detail">
211
- <a name="M000074"></a>
212
-
213
- <div class="method-heading">
214
- <a href="#M000074" class="method-signature">
215
- <span class="method-name">eql?</span><span class="method-args">(key)</span>
216
- </a>
217
- </div>
218
-
219
- <div class="method-description">
220
- <p>
221
- Returns true if the two keys have the same character and modifier.
222
- </p>
223
- <p><a class="source-toggle" href="#"
224
- onclick="toggleCode('M000074-source');return false;">[Source]</a></p>
225
- <div class="method-source-code" id="M000074-source">
226
- <pre>
227
- <span class="ruby-comment cmt"># File lib/Context/Key.rb, line 40</span>
228
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">eql?</span>(<span class="ruby-identifier">key</span>)
229
- (<span class="ruby-ivar">@modifier</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">modifier</span>) <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-ivar">@character</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">character</span>)
230
- <span class="ruby-keyword kw">end</span>
231
- </pre>
232
- </div>
233
- </div>
234
- </div>
235
-
236
- <div id="method-M000075" class="method-detail">
237
- <a name="M000075"></a>
238
-
239
- <div class="method-heading">
240
- <a href="#M000075" class="method-signature">
241
- <span class="method-name">hash</span><span class="method-args">()</span>
242
- </a>
243
- </div>
244
-
245
- <div class="method-description">
246
- <p>
247
- Creates a <a href="Key.html#M000075">hash</a> for the key. This is needed
248
- for the <a href="KeyMap.html">KeyMap</a> which is implemented as a <a
249
- href="Key.html#M000075">hash</a>.
250
- </p>
251
- <p><a class="source-toggle" href="#"
252
- onclick="toggleCode('M000075-source');return false;">[Source]</a></p>
253
- <div class="method-source-code" id="M000075-source">
254
- <pre>
255
- <span class="ruby-comment cmt"># File lib/Context/Key.rb, line 46</span>
256
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hash</span>
257
- <span class="ruby-identifier">hashValue</span> = <span class="ruby-ivar">@modifier</span>.<span class="ruby-identifier">to_s</span>
258
- <span class="ruby-identifier">hashValue</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@character</span>
259
- <span class="ruby-identifier">hashValue</span>.<span class="ruby-identifier">hash</span>
260
- <span class="ruby-keyword kw">end</span>
261
- </pre>
262
- </div>
263
- </div>
264
- </div>
265
-
266
- <div id="method-M000076" class="method-detail">
267
- <a name="M000076"></a>
268
-
269
- <div class="method-heading">
270
- <a href="#M000076" class="method-signature">
271
- <span class="method-name">null?</span><span class="method-args">()</span>
272
- </a>
273
- </div>
274
-
275
- <div class="method-description">
276
- <p>
277
- Returns true if the key is equal to <a
278
- href="Key.html#M000073">Key.null</a>.
279
- </p>
280
- <p><a class="source-toggle" href="#"
281
- onclick="toggleCode('M000076-source');return false;">[Source]</a></p>
282
- <div class="method-source-code" id="M000076-source">
283
- <pre>
284
- <span class="ruby-comment cmt"># File lib/Context/Key.rb, line 53</span>
285
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">null?</span>
286
- <span class="ruby-identifier">eql?</span>(<span class="ruby-constant">Key</span>.<span class="ruby-identifier">null</span>)
287
- <span class="ruby-keyword kw">end</span>
288
- </pre>
289
- </div>
290
- </div>
291
- </div>
292
-
293
-
294
- </div>
295
-
296
-
297
- </div>
298
-
299
-
300
- <div id="validator-badges">
301
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
302
- </div>
303
-
304
- </body>
305
- </html>
@@ -1,117 +0,0 @@
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>Class: Context::Key::Modifier</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>Class</strong></td>
53
- <td class="class-name-in-header">Context::Key::Modifier</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../../files/lib/Context/Key_rb.html">
59
- lib/Context/Key.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- <tr class="top-aligned-row">
66
- <td><strong>Parent:</strong></td>
67
- <td>
68
- EnumeratedType
69
- </td>
70
- </tr>
71
- </table>
72
- </div>
73
- <!-- banner header -->
74
-
75
- <div id="bodyContent">
76
-
77
-
78
-
79
- <div id="contextContent">
80
-
81
- <div id="description">
82
- <p>
83
- Types of key modifiers. Currently only control or none is supported.
84
- </p>
85
-
86
- </div>
87
-
88
-
89
- </div>
90
-
91
-
92
- </div>
93
-
94
-
95
- <!-- if includes -->
96
-
97
- <div id="section">
98
-
99
-
100
-
101
-
102
-
103
-
104
-
105
-
106
- <!-- if method_list -->
107
-
108
-
109
- </div>
110
-
111
-
112
- <div id="validator-badges">
113
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
114
- </div>
115
-
116
- </body>
117
- </html>
@@ -1,234 +0,0 @@
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>Class: Context::KeyAssignment</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>Class</strong></td>
53
- <td class="class-name-in-header">Context::KeyAssignment</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/Context/KeyAssignment_rb.html">
59
- lib/Context/KeyAssignment.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- <tr class="top-aligned-row">
66
- <td><strong>Parent:</strong></td>
67
- <td>
68
- <a href="../Object.html">
69
- Object
70
- </a>
71
- </td>
72
- </tr>
73
- </table>
74
- </div>
75
- <!-- banner header -->
76
-
77
- <div id="bodyContent">
78
-
79
-
80
-
81
- <div id="contextContent">
82
-
83
- <div id="description">
84
- <p>
85
- Represents the assignment of an action to a key press
86
- </p>
87
-
88
- </div>
89
-
90
-
91
- </div>
92
-
93
- <div id="method-list">
94
- <h3 class="section-bar">Methods</h3>
95
-
96
- <div class="name-list">
97
- <a href="#M000047">handles?</a>&nbsp;&nbsp;
98
- <a href="#M000046">new</a>&nbsp;&nbsp;
99
- <a href="#M000048">try</a>&nbsp;&nbsp;
100
- </div>
101
- </div>
102
-
103
- </div>
104
-
105
-
106
- <!-- if includes -->
107
-
108
- <div id="section">
109
-
110
-
111
-
112
-
113
-
114
- <div id="attribute-list">
115
- <h3 class="section-bar">Attributes</h3>
116
-
117
- <div class="name-list">
118
- <table>
119
- <tr class="top-aligned-row context-row">
120
- <td class="context-item-name">action</td>
121
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
122
- <td class="context-item-desc"></td>
123
- </tr>
124
- </table>
125
- </div>
126
- </div>
127
-
128
-
129
-
130
- <!-- if method_list -->
131
- <div id="methods">
132
- <h3 class="section-bar">Public Class methods</h3>
133
-
134
- <div id="method-M000046" class="method-detail">
135
- <a name="M000046"></a>
136
-
137
- <div class="method-heading">
138
- <a href="#M000046" class="method-signature">
139
- <span class="method-name">new</span><span class="method-args">(key, &amp;action)</span>
140
- </a>
141
- </div>
142
-
143
- <div class="method-description">
144
- <p>
145
- Creates an assignment where action will be called when key is pressed
146
- </p>
147
- <p><a class="source-toggle" href="#"
148
- onclick="toggleCode('M000046-source');return false;">[Source]</a></p>
149
- <div class="method-source-code" id="M000046-source">
150
- <pre>
151
- <span class="ruby-comment cmt"># File lib/Context/KeyAssignment.rb, line 10</span>
152
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">key</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">action</span>)
153
- <span class="ruby-ivar">@key</span> = <span class="ruby-identifier">key</span>
154
- <span class="ruby-ivar">@action</span> = <span class="ruby-identifier">action</span>
155
- <span class="ruby-keyword kw">end</span>
156
- </pre>
157
- </div>
158
- </div>
159
- </div>
160
-
161
- <h3 class="section-bar">Public Instance methods</h3>
162
-
163
- <div id="method-M000047" class="method-detail">
164
- <a name="M000047"></a>
165
-
166
- <div class="method-heading">
167
- <a href="#M000047" class="method-signature">
168
- <span class="method-name">handles?</span><span class="method-args">(key)</span>
169
- </a>
170
- </div>
171
-
172
- <div class="method-description">
173
- <p>
174
- Returns true if this <a href="KeyAssignment.html">KeyAssignment</a> has an
175
- action assigned for key
176
- </p>
177
- <p><a class="source-toggle" href="#"
178
- onclick="toggleCode('M000047-source');return false;">[Source]</a></p>
179
- <div class="method-source-code" id="M000047-source">
180
- <pre>
181
- <span class="ruby-comment cmt"># File lib/Context/KeyAssignment.rb, line 16</span>
182
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handles?</span>(<span class="ruby-identifier">key</span>)
183
- <span class="ruby-ivar">@key</span>.<span class="ruby-identifier">eql?</span>(<span class="ruby-identifier">key</span>)
184
- <span class="ruby-keyword kw">end</span>
185
- </pre>
186
- </div>
187
- </div>
188
- </div>
189
-
190
- <div id="method-M000048" class="method-detail">
191
- <a name="M000048"></a>
192
-
193
- <div class="method-heading">
194
- <a href="#M000048" class="method-signature">
195
- <span class="method-name">try</span><span class="method-args">(key)</span>
196
- </a>
197
- </div>
198
-
199
- <div class="method-description">
200
- <p>
201
- Run the action assigned to key if there is one. Returns true if an action
202
- was run, false otherwise
203
- </p>
204
- <p><a class="source-toggle" href="#"
205
- onclick="toggleCode('M000048-source');return false;">[Source]</a></p>
206
- <div class="method-source-code" id="M000048-source">
207
- <pre>
208
- <span class="ruby-comment cmt"># File lib/Context/KeyAssignment.rb, line 22</span>
209
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">try</span>(<span class="ruby-identifier">key</span>)
210
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">handles?</span>(<span class="ruby-identifier">key</span>)
211
- <span class="ruby-ivar">@action</span>.<span class="ruby-identifier">call</span>
212
- <span class="ruby-keyword kw">true</span>
213
- <span class="ruby-keyword kw">else</span>
214
- <span class="ruby-keyword kw">false</span>
215
- <span class="ruby-keyword kw">end</span>
216
- <span class="ruby-keyword kw">end</span>
217
- </pre>
218
- </div>
219
- </div>
220
- </div>
221
-
222
-
223
- </div>
224
-
225
-
226
- </div>
227
-
228
-
229
- <div id="validator-badges">
230
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
231
- </div>
232
-
233
- </body>
234
- </html>