rum 0.0.1-universal-darwin-10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. data/CHANGELOG +3 -0
  2. data/README +30 -0
  3. data/Rakefile +134 -0
  4. data/bin/rum-client +124 -0
  5. data/doc/basic.rb +10 -0
  6. data/doc/doc.html +602 -0
  7. data/doc/example.rb +59 -0
  8. data/doc/reference.rb +415 -0
  9. data/doc/resources/bg.png +0 -0
  10. data/doc/resources/bottom.png +0 -0
  11. data/doc/resources/build.rb +235 -0
  12. data/doc/resources/doc.haml +167 -0
  13. data/doc/resources/emacs-auto-completion.png +0 -0
  14. data/doc/resources/flash.png +0 -0
  15. data/doc/resources/highlight.css +94 -0
  16. data/doc/resources/intro.rb +17 -0
  17. data/doc/resources/left.png +0 -0
  18. data/doc/resources/logo.png +0 -0
  19. data/doc/resources/screen.css +420 -0
  20. data/doc/resources/screenshot.png +0 -0
  21. data/doc/resources/top.png +0 -0
  22. data/ext/mac/keyboard_hook/English.lproj/InfoPlist.strings +0 -0
  23. data/ext/mac/keyboard_hook/Event.h +17 -0
  24. data/ext/mac/keyboard_hook/Event.m +18 -0
  25. data/ext/mac/keyboard_hook/EventTap.h +11 -0
  26. data/ext/mac/keyboard_hook/EventTap.m +77 -0
  27. data/ext/mac/keyboard_hook/Info.plist +26 -0
  28. data/ext/mac/keyboard_hook/KeyboardHook.xcodeproj/TemplateIcon.icns +0 -0
  29. data/ext/mac/keyboard_hook/KeyboardHook.xcodeproj/project.pbxproj +323 -0
  30. data/ext/mac/keyboard_hook/KeyboardHook_Prefix.pch +7 -0
  31. data/ext/mac/keyboard_hook/version.plist +16 -0
  32. data/ext/windows/keyboard_hook/extconf.rb +2 -0
  33. data/ext/windows/keyboard_hook/keyboard_hook.c +126 -0
  34. data/ext/windows/system/autohotkey_stuff.c +255 -0
  35. data/ext/windows/system/autohotkey_stuff.h +2 -0
  36. data/ext/windows/system/clipboard_watcher.c +58 -0
  37. data/ext/windows/system/clipboard_watcher.h +2 -0
  38. data/ext/windows/system/extconf.rb +3 -0
  39. data/ext/windows/system/input_box.c +239 -0
  40. data/ext/windows/system/input_box.h +4 -0
  41. data/ext/windows/system/system.c +273 -0
  42. data/lib/rum.rb +4 -0
  43. data/lib/rum/apps.rb +4 -0
  44. data/lib/rum/barrel.rb +157 -0
  45. data/lib/rum/barrel/emacs.rb +44 -0
  46. data/lib/rum/barrel/emacs_client.rb +74 -0
  47. data/lib/rum/core.rb +125 -0
  48. data/lib/rum/dsl.rb +109 -0
  49. data/lib/rum/gui.rb +93 -0
  50. data/lib/rum/help.rb +128 -0
  51. data/lib/rum/hotkey_core.rb +479 -0
  52. data/lib/rum/mac.rb +18 -0
  53. data/lib/rum/mac/app.rb +4 -0
  54. data/lib/rum/mac/apps.rb +19 -0
  55. data/lib/rum/mac/gui.rb +26 -0
  56. data/lib/rum/mac/gui/CocoaDialog.app/Contents/Info.plist +28 -0
  57. data/lib/rum/mac/gui/CocoaDialog.app/Contents/MacOS/CocoaDialog +0 -0
  58. data/lib/rum/mac/gui/CocoaDialog.app/Contents/Resources/Info.plist +28 -0
  59. data/lib/rum/mac/gui/CocoaDialog.app/Contents/Resources/InfoPlist.strings +0 -0
  60. data/lib/rum/mac/gui/CocoaDialog.app/Contents/Resources/Inputbox.nib/classes.nib +51 -0
  61. data/lib/rum/mac/gui/CocoaDialog.app/Contents/Resources/Inputbox.nib/info.nib +16 -0
  62. data/lib/rum/mac/gui/CocoaDialog.app/Contents/Resources/Inputbox.nib/keyedobjects.nib +0 -0
  63. data/lib/rum/mac/gui/CocoaDialog.app/Contents/Resources/MainMenu.nib/classes.nib +7 -0
  64. data/lib/rum/mac/gui/CocoaDialog.app/Contents/Resources/MainMenu.nib/info.nib +21 -0
  65. data/lib/rum/mac/gui/CocoaDialog.app/Contents/Resources/MainMenu.nib/info.nib.orig +21 -0
  66. data/lib/rum/mac/gui/CocoaDialog.app/Contents/Resources/MainMenu.nib/objects.nib +0 -0
  67. data/lib/rum/mac/gui/CocoaDialog.app/Contents/Resources/MainMenu.nib/objects.nib.orig +0 -0
  68. data/lib/rum/mac/gui/CocoaDialog.app/Contents/Resources/Msgbox.nib/classes.nib +27 -0
  69. data/lib/rum/mac/gui/CocoaDialog.app/Contents/Resources/Msgbox.nib/info.nib +16 -0
  70. data/lib/rum/mac/gui/CocoaDialog.app/Contents/Resources/Msgbox.nib/keyedobjects.nib +0 -0
  71. data/lib/rum/mac/gui/Growl.framework/Growl +0 -0
  72. data/lib/rum/mac/gui/Growl.framework/Versions/A/Growl +0 -0
  73. data/lib/rum/mac/gui/Growl.framework/Versions/A/Headers/Growl.h +6 -0
  74. data/lib/rum/mac/gui/Growl.framework/Versions/A/Headers/GrowlApplicationBridge-Carbon.h +780 -0
  75. data/lib/rum/mac/gui/Growl.framework/Versions/A/Headers/GrowlApplicationBridge.h +575 -0
  76. data/lib/rum/mac/gui/Growl.framework/Versions/A/Headers/GrowlDefines.h +348 -0
  77. data/lib/rum/mac/gui/Growl.framework/Versions/A/Resources/Info.plist +24 -0
  78. data/lib/rum/mac/gui/growl.rb +54 -0
  79. data/lib/rum/mac/irb/completion.rb +207 -0
  80. data/lib/rum/mac/keyboard_hook.rb +73 -0
  81. data/lib/rum/mac/keyboard_hook/KeyboardHook.framework/KeyboardHook +0 -0
  82. data/lib/rum/mac/keyboard_hook/KeyboardHook.framework/Versions/A/KeyboardHook +0 -0
  83. data/lib/rum/mac/keyboard_hook/KeyboardHook.framework/Versions/A/Resources/English.lproj/InfoPlist.strings +0 -0
  84. data/lib/rum/mac/keyboard_hook/KeyboardHook.framework/Versions/A/Resources/Info.plist +22 -0
  85. data/lib/rum/mac/layouts.rb +146 -0
  86. data/lib/rum/mac/system.rb +45 -0
  87. data/lib/rum/remote.rb +48 -0
  88. data/lib/rum/server.rb +92 -0
  89. data/lib/rum/windows.rb +23 -0
  90. data/lib/rum/windows/app.rb +72 -0
  91. data/lib/rum/windows/apps.rb +25 -0
  92. data/lib/rum/windows/gui.rb +116 -0
  93. data/lib/rum/windows/keyboard.rb +80 -0
  94. data/lib/rum/windows/keyboard_hook.rb +20 -0
  95. data/lib/rum/windows/layouts.rb +232 -0
  96. data/lib/rum/windows/system.rb +310 -0
  97. data/lib/rum/windows/system_foreign_functions.rb +129 -0
  98. data/rum.gemspec +14 -0
  99. metadata +166 -0
@@ -0,0 +1,348 @@
1
+ //
2
+ // GrowlDefines.h
3
+ //
4
+
5
+ #ifndef _GROWLDEFINES_H
6
+ #define _GROWLDEFINES_H
7
+
8
+ #ifdef __OBJC__
9
+ #define XSTR(x) (@x)
10
+ #define STRING_TYPE NSString *
11
+ #else
12
+ #define XSTR CFSTR
13
+ #define STRING_TYPE CFStringRef
14
+ #endif
15
+
16
+ /*! @header GrowlDefines.h
17
+ * @abstract Defines all the notification keys.
18
+ * @discussion Defines all the keys used for registration with Growl and for
19
+ * Growl notifications.
20
+ *
21
+ * Most applications should use the functions or methods of Growl.framework
22
+ * instead of posting notifications such as those described here.
23
+ * @updated 2004-01-25
24
+ */
25
+
26
+ // UserInfo Keys for Registration
27
+ #pragma mark UserInfo Keys for Registration
28
+
29
+ /*! @group Registration userInfo keys */
30
+ /* @abstract Keys for the userInfo dictionary of a GROWL_APP_REGISTRATION distributed notification.
31
+ * @discussion The values of these keys describe the application and the
32
+ * notifications it may post.
33
+ *
34
+ * Your application must register with Growl before it can post Growl
35
+ * notifications (and have them not be ignored). However, as of Growl 0.6,
36
+ * posting GROWL_APP_REGISTRATION notifications directly is no longer the
37
+ * preferred way to register your application. Your application should instead
38
+ * use Growl.framework's delegate system.
39
+ * See +[GrowlApplicationBridge setGrowlDelegate:] or Growl_SetDelegate for
40
+ * more information.
41
+ */
42
+
43
+ /*! @defined GROWL_APP_NAME
44
+ * @abstract The name of your application.
45
+ * @discussion The name of your application. This should remain stable between
46
+ * different versions and incarnations of your application.
47
+ * For example, "SurfWriter" is a good app name, whereas "SurfWriter 2.0" and
48
+ * "SurfWriter Lite" are not.
49
+ */
50
+ #define GROWL_APP_NAME XSTR("ApplicationName")
51
+ /*! @defined GROWL_APP_ID
52
+ * @abstract The bundle identifier of your application.
53
+ * @discussion The bundle identifier of your application. This key should
54
+ * be unique for your application while there may be several applications
55
+ * with the same GROWL_APP_NAME.
56
+ * This key is optional.
57
+ */
58
+ #define GROWL_APP_ID XSTR("ApplicationId")
59
+ /*! @defined GROWL_APP_ICON
60
+ * @abstract The image data for your application's icon.
61
+ * @discussion Image data representing your application's icon. This may be
62
+ * superimposed on a notification icon as a badge, used as the notification
63
+ * icon when a notification-specific icon is not supplied, or ignored
64
+ * altogether, depending on the display. Must be in a format supported by
65
+ * NSImage, such as TIFF, PNG, GIF, JPEG, BMP, PICT, or PDF.
66
+ *
67
+ * Optional. Not supported by all display plugins.
68
+ */
69
+ #define GROWL_APP_ICON XSTR("ApplicationIcon")
70
+ /*! @defined GROWL_NOTIFICATIONS_DEFAULT
71
+ * @abstract The array of notifications to turn on by default.
72
+ * @discussion These are the names of the notifications that should be enabled
73
+ * by default when your application registers for the first time. If your
74
+ * application reregisters, Growl will look here for any new notification
75
+ * names found in GROWL_NOTIFICATIONS_ALL, but ignore any others.
76
+ */
77
+ #define GROWL_NOTIFICATIONS_DEFAULT XSTR("DefaultNotifications")
78
+ /*! @defined GROWL_NOTIFICATIONS_ALL
79
+ * @abstract The array of all notifications your application can send.
80
+ * @discussion These are the names of all of the notifications that your
81
+ * application may post. See GROWL_NOTIFICATION_NAME for a discussion of good
82
+ * notification names.
83
+ */
84
+ #define GROWL_NOTIFICATIONS_ALL XSTR("AllNotifications")
85
+ /*! @defined GROWL_NOTIFICATIONS_HUMAN_READABLE_DESCRIPTIONS
86
+ * @abstract A dictionary of human-readable names for your notifications.
87
+ * @discussion By default, the Growl UI will display notifications by the names given in GROWL_NOTIFICATIONS_ALL
88
+ * which correspond to the GROWL_NOTIFICATION_NAME. This dictionary specifies the human-readable name to display.
89
+ * The keys of the dictionary are GROWL_NOTIFICATION_NAME strings; the objects are the human-readable versions.
90
+ * For any GROWL_NOTIFICATION_NAME not specific in this dictionary, the GROWL_NOTIFICATION_NAME will be displayed.
91
+ *
92
+ * This key is optional.
93
+ */
94
+ #define GROWL_NOTIFICATIONS_HUMAN_READABLE_NAMES XSTR("HumanReadableNames")
95
+ /*! @defined GROWL_NOTIFICATIONS_DESCRIPTIONS
96
+ * @abstract A dictionary of descriptions of _when_ each notification occurs
97
+ * @discussion This is an NSDictionary whose keys are GROWL_NOTIFICATION_NAME strings and whose objects are
98
+ * descriptions of _when_ each notification occurs, such as "You received a new mail message" or
99
+ * "A file finished downloading".
100
+ *
101
+ * This key is optional.
102
+ */
103
+ #define GROWL_NOTIFICATIONS_DESCRIPTIONS XSTR("NotificationDescriptions")
104
+
105
+ /*! @defined GROWL_TICKET_VERSION
106
+ * @abstract The version of your registration ticket.
107
+ * @discussion Include this key in a ticket plist file that you put in your
108
+ * application bundle for auto-discovery. The current ticket version is 1.
109
+ */
110
+ #define GROWL_TICKET_VERSION XSTR("TicketVersion")
111
+ // UserInfo Keys for Notifications
112
+ #pragma mark UserInfo Keys for Notifications
113
+
114
+ /*! @group Notification userInfo keys */
115
+ /* @abstract Keys for the userInfo dictionary of a GROWL_NOTIFICATION distributed notification.
116
+ * @discussion The values of these keys describe the content of a Growl
117
+ * notification.
118
+ *
119
+ * Not all of these keys are supported by all displays. Only the name, title,
120
+ * and description of a notification are universal. Most of the built-in
121
+ * displays do support all of these keys, and most other visual displays
122
+ * probably will also. But, as of 0.6, the Log, MailMe, and Speech displays
123
+ * support only textual data.
124
+ */
125
+
126
+ /*! @defined GROWL_NOTIFICATION_NAME
127
+ * @abstract The name of the notification.
128
+ * @discussion The name of the notification. Note that if you do not define
129
+ * GROWL_NOTIFICATIONS_HUMAN_READABLE_NAMES when registering your ticket originally this name
130
+ * will the one displayed within the Growl preference pane and should be human-readable.
131
+ */
132
+ #define GROWL_NOTIFICATION_NAME XSTR("NotificationName")
133
+ /*! @defined GROWL_NOTIFICATION_TITLE
134
+ * @abstract The title to display in the notification.
135
+ * @discussion The title of the notification. Should be very brief.
136
+ * The title usually says what happened, e.g. "Download complete".
137
+ */
138
+ #define GROWL_NOTIFICATION_TITLE XSTR("NotificationTitle")
139
+ /*! @defined GROWL_NOTIFICATION_DESCRIPTION
140
+ * @abstract The description to display in the notification.
141
+ * @discussion The description should be longer and more verbose than the title.
142
+ * The description usually tells the subject of the action,
143
+ * e.g. "Growl-0.6.dmg downloaded in 5.02 minutes".
144
+ */
145
+ #define GROWL_NOTIFICATION_DESCRIPTION XSTR("NotificationDescription")
146
+ /*! @defined GROWL_NOTIFICATION_ICON
147
+ * @discussion Image data for the notification icon. Must be in a format
148
+ * supported by NSImage, such as TIFF, PNG, GIF, JPEG, BMP, PICT, or PDF.
149
+ *
150
+ * Optional. Not supported by all display plugins.
151
+ */
152
+ #define GROWL_NOTIFICATION_ICON XSTR("NotificationIcon")
153
+ /*! @defined GROWL_NOTIFICATION_APP_ICON
154
+ * @discussion Image data for the application icon, in case GROWL_APP_ICON does
155
+ * not apply for some reason. Must be in a format supported by NSImage, such
156
+ * as TIFF, PNG, GIF, JPEG, BMP, PICT, or PDF.
157
+ *
158
+ * Optional. Not supported by all display plugins.
159
+ */
160
+ #define GROWL_NOTIFICATION_APP_ICON XSTR("NotificationAppIcon")
161
+ /*! @defined GROWL_NOTIFICATION_PRIORITY
162
+ * @discussion The priority of the notification as an integer number from
163
+ * -2 to +2 (+2 being highest).
164
+ *
165
+ * Optional. Not supported by all display plugins.
166
+ */
167
+ #define GROWL_NOTIFICATION_PRIORITY XSTR("NotificationPriority")
168
+ /*! @defined GROWL_NOTIFICATION_STICKY
169
+ * @discussion A Boolean number controlling whether the notification is sticky.
170
+ *
171
+ * Optional. Not supported by all display plugins.
172
+ */
173
+ #define GROWL_NOTIFICATION_STICKY XSTR("NotificationSticky")
174
+ /*! @defined GROWL_NOTIFICATION_CLICK_CONTEXT
175
+ * @abstract Identifies which notification was clicked.
176
+ * @discussion An identifier for the notification for clicking purposes.
177
+ *
178
+ * This will be passed back to the application when the notification is
179
+ * clicked. It must be plist-encodable (a data, dictionary, array, number, or
180
+ * string object), and it should be unique for each notification you post.
181
+ * A good click context would be a UUID string returned by NSProcessInfo or
182
+ * CFUUID.
183
+ *
184
+ * Optional. Not supported by all display plugins.
185
+ */
186
+ #define GROWL_NOTIFICATION_CLICK_CONTEXT XSTR("NotificationClickContext")
187
+
188
+ /*! @defined GROWL_DISPLAY_PLUGIN
189
+ * @discussion The name of a display plugin which should be used for this notification.
190
+ * Optional. If this key is not set or the specified display plugin does not
191
+ * exist, the display plugin stored in the application ticket is used. This key
192
+ * allows applications to use different default display plugins for their
193
+ * notifications. The user can still override those settings in the preference
194
+ * pane.
195
+ */
196
+ #define GROWL_DISPLAY_PLUGIN XSTR("NotificationDisplayPlugin")
197
+
198
+ /*! @defined GROWL_NOTIFICATION_IDENTIFIER
199
+ * @abstract An identifier for the notification for coalescing purposes.
200
+ * Notifications with the same identifier fall into the same class; only
201
+ * the last notification of a class is displayed on the screen. If a
202
+ * notification of the same class is currently being displayed, it is
203
+ * replaced by this notification.
204
+ *
205
+ * Optional. Not supported by all display plugins.
206
+ */
207
+ #define GROWL_NOTIFICATION_IDENTIFIER XSTR("GrowlNotificationIdentifier")
208
+
209
+ /*! @defined GROWL_APP_PID
210
+ * @abstract The process identifier of the process which sends this
211
+ * notification. If this field is set, the application will only receive
212
+ * clicked and timed out notifications which originate from this process.
213
+ *
214
+ * Optional.
215
+ */
216
+ #define GROWL_APP_PID XSTR("ApplicationPID")
217
+
218
+ /*! @defined GROWL_NOTIFICATION_PROGRESS
219
+ * @abstract If this key is set, it should contain a double value wrapped
220
+ * in a NSNumber which describes some sort of progress (from 0.0 to 100.0).
221
+ * If this is key is not set, no progress bar is shown.
222
+ *
223
+ * Optional. Not supported by all display plugins.
224
+ */
225
+ #define GROWL_NOTIFICATION_PROGRESS XSTR("NotificationProgress")
226
+
227
+ // Notifications
228
+ #pragma mark Notifications
229
+
230
+ /*! @group Notification names */
231
+ /* @abstract Names of distributed notifications used by Growl.
232
+ * @discussion These are notifications used by applications (directly or
233
+ * indirectly) to interact with Growl, and by Growl for interaction between
234
+ * its components.
235
+ *
236
+ * Most of these should no longer be used in Growl 0.6 and later, in favor of
237
+ * Growl.framework's GrowlApplicationBridge APIs.
238
+ */
239
+
240
+ /*! @defined GROWL_APP_REGISTRATION
241
+ * @abstract The distributed notification for registering your application.
242
+ * @discussion This is the name of the distributed notification that can be
243
+ * used to register applications with Growl.
244
+ *
245
+ * The userInfo dictionary for this notification can contain these keys:
246
+ * <ul>
247
+ * <li>GROWL_APP_NAME</li>
248
+ * <li>GROWL_APP_ICON</li>
249
+ * <li>GROWL_NOTIFICATIONS_ALL</li>
250
+ * <li>GROWL_NOTIFICATIONS_DEFAULT</li>
251
+ * </ul>
252
+ *
253
+ * No longer recommended as of Growl 0.6. An alternate method of registering
254
+ * is to use Growl.framework's delegate system.
255
+ * See +[GrowlApplicationBridge setGrowlDelegate:] or Growl_SetDelegate for
256
+ * more information.
257
+ */
258
+ #define GROWL_APP_REGISTRATION XSTR("GrowlApplicationRegistrationNotification")
259
+ /*! @defined GROWL_APP_REGISTRATION_CONF
260
+ * @abstract The distributed notification for confirming registration.
261
+ * @discussion The name of the distributed notification sent to confirm the
262
+ * registration. Used by the Growl preference pane. Your application probably
263
+ * does not need to use this notification.
264
+ */
265
+ #define GROWL_APP_REGISTRATION_CONF XSTR("GrowlApplicationRegistrationConfirmationNotification")
266
+ /*! @defined GROWL_NOTIFICATION
267
+ * @abstract The distributed notification for Growl notifications.
268
+ * @discussion This is what it all comes down to. This is the name of the
269
+ * distributed notification that your application posts to actually send a
270
+ * Growl notification.
271
+ *
272
+ * The userInfo dictionary for this notification can contain these keys:
273
+ * <ul>
274
+ * <li>GROWL_NOTIFICATION_NAME (required)</li>
275
+ * <li>GROWL_NOTIFICATION_TITLE (required)</li>
276
+ * <li>GROWL_NOTIFICATION_DESCRIPTION (required)</li>
277
+ * <li>GROWL_NOTIFICATION_ICON</li>
278
+ * <li>GROWL_NOTIFICATION_APP_ICON</li>
279
+ * <li>GROWL_NOTIFICATION_PRIORITY</li>
280
+ * <li>GROWL_NOTIFICATION_STICKY</li>
281
+ * <li>GROWL_NOTIFICATION_CLICK_CONTEXT</li>
282
+ * <li>GROWL_APP_NAME (required)</li>
283
+ * </ul>
284
+ *
285
+ * No longer recommended as of Growl 0.6. Three alternate methods of posting
286
+ * notifications are +[GrowlApplicationBridge notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:],
287
+ * Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext, and
288
+ * Growl_PostNotification.
289
+ */
290
+ #define GROWL_NOTIFICATION XSTR("GrowlNotification")
291
+ /*! @defined GROWL_SHUTDOWN
292
+ * @abstract The distributed notification name that tells Growl to shutdown.
293
+ * @discussion The Growl preference pane posts this notification when the
294
+ * "Stop Growl" button is clicked.
295
+ */
296
+ #define GROWL_SHUTDOWN XSTR("GrowlShutdown")
297
+ /*! @defined GROWL_PING
298
+ * @abstract A distributed notification to check whether Growl is running.
299
+ * @discussion This is used by the Growl preference pane. If it receives a
300
+ * GROWL_PONG, the preference pane takes this to mean that Growl is running.
301
+ */
302
+ #define GROWL_PING XSTR("Honey, Mind Taking Out The Trash")
303
+ /*! @defined GROWL_PONG
304
+ * @abstract The distributed notification sent in reply to GROWL_PING.
305
+ * @discussion GrowlHelperApp posts this in reply to GROWL_PING.
306
+ */
307
+ #define GROWL_PONG XSTR("What Do You Want From Me, Woman")
308
+ /*! @defined GROWL_IS_READY
309
+ * @abstract The distributed notification sent when Growl starts up.
310
+ * @discussion GrowlHelperApp posts this when it has begin listening on all of
311
+ * its sources for new notifications. GrowlApplicationBridge (in
312
+ * Growl.framework), upon receiving this notification, reregisters using the
313
+ * registration dictionary supplied by its delegate.
314
+ */
315
+ #define GROWL_IS_READY XSTR("Lend Me Some Sugar; I Am Your Neighbor!")
316
+ /*! @defined GROWL_NOTIFICATION_CLICKED
317
+ * @abstract The distributed notification sent when a supported notification is clicked.
318
+ * @discussion When a Growl notification with a click context is clicked on by
319
+ * the user, Growl posts this distributed notification.
320
+ * The GrowlApplicationBridge responds to this notification by calling a
321
+ * callback in its delegate.
322
+ */
323
+ #define GROWL_NOTIFICATION_CLICKED XSTR("GrowlClicked!")
324
+ #define GROWL_NOTIFICATION_TIMED_OUT XSTR("GrowlTimedOut!")
325
+
326
+ /*! @group Other symbols */
327
+ /* Symbols which don't fit into any of the other categories. */
328
+
329
+ /*! @defined GROWL_KEY_CLICKED_CONTEXT
330
+ * @abstract Used internally as the key for the clickedContext passed over DNC.
331
+ * @discussion This key is used in GROWL_NOTIFICATION_CLICKED, and contains the
332
+ * click context that was supplied in the original notification.
333
+ */
334
+ #define GROWL_KEY_CLICKED_CONTEXT XSTR("ClickedContext")
335
+ /*! @defined GROWL_REG_DICT_EXTENSION
336
+ * @abstract The filename extension for registration dictionaries.
337
+ * @discussion The GrowlApplicationBridge in Growl.framework registers with
338
+ * Growl by creating a file with the extension of .(GROWL_REG_DICT_EXTENSION)
339
+ * and opening it in the GrowlHelperApp. This happens whether or not Growl is
340
+ * running; if it was stopped, it quits immediately without listening for
341
+ * notifications.
342
+ */
343
+ #define GROWL_REG_DICT_EXTENSION XSTR("growlRegDict")
344
+
345
+
346
+ #define GROWL_POSITION_PREFERENCE_KEY @"GrowlSelectedPosition"
347
+
348
+ #endif //ndef _GROWLDEFINES_H
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleDevelopmentRegion</key>
6
+ <string>English</string>
7
+ <key>CFBundleExecutable</key>
8
+ <string>Growl</string>
9
+ <key>CFBundleIdentifier</key>
10
+ <string>com.growl.growlframework</string>
11
+ <key>CFBundleInfoDictionaryVersion</key>
12
+ <string>6.0</string>
13
+ <key>CFBundlePackageType</key>
14
+ <string>FMWK</string>
15
+ <key>CFBundleShortVersionString</key>
16
+ <string>1.2.1</string>
17
+ <key>CFBundleSignature</key>
18
+ <string>GRRR</string>
19
+ <key>CFBundleVersion</key>
20
+ <string>1.2.1</string>
21
+ <key>NSPrincipalClass</key>
22
+ <string>GrowlApplicationBridge</string>
23
+ </dict>
24
+ </plist>
@@ -0,0 +1,54 @@
1
+ module Rum
2
+ module Gui
3
+ module Growl
4
+ class Notifier
5
+ def initialize application_name, notification_name
6
+ @application_name = application_name
7
+ @notification_name = notification_name
8
+ @callbacks = {}
9
+ GrowlApplicationBridge.setGrowlDelegate(self)
10
+ end
11
+
12
+ def registrationDictionaryForGrowl
13
+ notifications = [@notification_name]
14
+ { TicketVersion: 1, AllNotifications: notifications,
15
+ DefaultNotifications: notifications, ApplicationId: ''}
16
+ end
17
+
18
+ def applicationNameForGrowl
19
+ @application_name
20
+ end
21
+
22
+ def growlNotificationWasClicked click_context
23
+ @callbacks[click_context].call
24
+ end
25
+
26
+ def notify(title, description, sticky, callback)
27
+ if callback
28
+ click_context = callback.object_id
29
+ @callbacks[click_context] = callback
30
+ end
31
+ GrowlApplicationBridge.notifyWithTitle(title.to_s,
32
+ description: description.to_s,
33
+ notificationName: @notification_name,
34
+ iconData: nil,
35
+ priority: 0,
36
+ isSticky: !!sticky,
37
+ clickContext: click_context)
38
+ end
39
+ end
40
+
41
+ def self.auto_setup
42
+ framework File.join(File.dirname(__FILE__), 'Growl.framework')
43
+ @@notifier = Notifier.new('Rum', 'Notification')
44
+ end
45
+
46
+ private
47
+
48
+ def message_backend(text, title, sticky, callback)
49
+ title ||= 'Rum' # Mac Growl needs a title
50
+ @@notifier.notify(title, text, sticky, callback)
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,207 @@
1
+ #
2
+ # irb/completor.rb -
3
+ # $Release Version: 0.9$
4
+ # $Revision: 23233 $
5
+ # by Keiju ISHITSUKA(keiju@ishitsuka.com)
6
+ # From Original Idea of shugo@ruby-lang.org
7
+ #
8
+
9
+ require "readline"
10
+
11
+ module IRB
12
+ module InputCompletor
13
+
14
+ @RCS_ID='-$Id: completion.rb 23233 2009-04-19 13:35:47Z yugui $-'
15
+
16
+ ReservedWords = [
17
+ "BEGIN", "END",
18
+ "alias", "and",
19
+ "begin", "break",
20
+ "case", "class",
21
+ "def", "defined", "do",
22
+ "else", "elsif", "end", "ensure",
23
+ "false", "for",
24
+ "if", "in",
25
+ "module",
26
+ "next", "nil", "not",
27
+ "or",
28
+ "redo", "rescue", "retry", "return",
29
+ "self", "super",
30
+ "then", "true",
31
+ "undef", "unless", "until",
32
+ "when", "while",
33
+ "yield",
34
+ ]
35
+
36
+ CompletionProc = proc { |input|
37
+ bind = IRB.conf[:MAIN_CONTEXT].workspace.binding
38
+
39
+ # puts "input: #{input}"
40
+
41
+ case input
42
+ when /^(\/[^\/]*\/)\.([^.]*)$/
43
+ # Regexp
44
+ receiver = $1
45
+ message = Regexp.quote($2)
46
+
47
+ candidates = Regexp.instance_methods.collect{|m| m.to_s}
48
+ select_message(receiver, message, candidates)
49
+
50
+ when /^([^\]]*\])\.([^.]*)$/
51
+ # Array
52
+ receiver = $1
53
+ message = Regexp.quote($2)
54
+
55
+ candidates = Array.instance_methods.collect{|m| m.to_s}
56
+ select_message(receiver, message, candidates)
57
+
58
+ when /^([^\}]*\})\.([^.]*)$/
59
+ # Proc or Hash
60
+ receiver = $1
61
+ message = Regexp.quote($2)
62
+
63
+ candidates = Proc.instance_methods.collect{|m| m.to_s}
64
+ candidates |= Hash.instance_methods.collect{|m| m.to_s}
65
+ select_message(receiver, message, candidates)
66
+
67
+ when /^(:[^:.]*)$/
68
+ # Symbol
69
+ if Symbol.respond_to?(:all_symbols)
70
+ sym = $1
71
+ candidates = Symbol.all_symbols.collect{|s| ":" + s.id2name}
72
+ candidates.grep(/^#{sym}/)
73
+ else
74
+ []
75
+ end
76
+
77
+ when /^::([A-Z][^:\.\(]*)$/
78
+ # Absolute Constant or class methods
79
+ receiver = $1
80
+ candidates = Object.constants.collect{|m| m.to_s}
81
+ candidates.grep(/^#{receiver}/).collect{|e| "::" + e}
82
+
83
+ when /^(((::)?[A-Z][^:.\(]*)+)::?([^:.]*)$/
84
+ # Constant or class methods
85
+ receiver = $1
86
+ message = Regexp.quote($4)
87
+ begin
88
+ candidates = eval("#{receiver}.constants.collect{|m| m.to_s}", bind)
89
+ candidates |= eval("#{receiver}.methods.collect{|m| m.to_s}", bind)
90
+ rescue Exception
91
+ candidates = []
92
+ end
93
+ candidates.grep(/^#{message}/).collect{|e| receiver + "::" + e}
94
+
95
+ when /^(:[^:.]+)\.([^.]*)$/
96
+ # Symbol
97
+ receiver = $1
98
+ message = Regexp.quote($2)
99
+
100
+ candidates = Symbol.instance_methods.collect{|m| m.to_s}
101
+ select_message(receiver, message, candidates)
102
+
103
+ when /^(-?(0[dbo])?[0-9_]+(\.[0-9_]+)?([eE]-?[0-9]+)?)\.([^.]*)$/
104
+ # Numeric
105
+ receiver = $1
106
+ message = Regexp.quote($5)
107
+
108
+ begin
109
+ candidates = eval(receiver, bind).methods.collect{|m| m.to_s}
110
+ rescue Exception
111
+ candidates = []
112
+ end
113
+ select_message(receiver, message, candidates)
114
+
115
+ when /^(-?0x[0-9a-fA-F_]+)\.([^.]*)$/
116
+ # Numeric(0xFFFF)
117
+ receiver = $1
118
+ message = Regexp.quote($2)
119
+
120
+ begin
121
+ candidates = eval(receiver, bind).methods.collect{|m| m.to_s}
122
+ rescue Exception
123
+ candidates = []
124
+ end
125
+ select_message(receiver, message, candidates)
126
+
127
+ when /^(\$[^.]*)$/
128
+ regmessage = Regexp.new(Regexp.quote($1))
129
+ candidates = global_variables.collect{|m| m.to_s}.grep(regmessage)
130
+
131
+ # when /^(\$?(\.?[^.]+)+)\.([^.]*)$/
132
+ when /^((\.?[^.]+)+)\.([^.]*)$/
133
+ # variable
134
+ receiver = $1
135
+ message = Regexp.quote($3)
136
+
137
+ gv = eval("global_variables", bind).collect{|m| m.to_s}
138
+ lv = eval("local_variables", bind).collect{|m| m.to_s}
139
+ cv = eval("self.class.constants", bind).collect{|m| m.to_s}
140
+
141
+ if (gv | lv | cv).include?(receiver)
142
+ # foo.func and foo is local var.
143
+ candidates = eval("#{receiver}.methods", bind).collect{|m| m.to_s}
144
+ elsif /^[A-Z]/ =~ receiver and /\./ !~ receiver
145
+ # Foo::Bar.func
146
+ begin
147
+ candidates = eval("#{receiver}.methods", bind).collect{|m| m.to_s}
148
+ rescue Exception
149
+ candidates = []
150
+ end
151
+ else
152
+ # func1.func2
153
+ candidates = []
154
+ ObjectSpace.each_object(Module){|m|
155
+ begin
156
+ name = m.name
157
+ rescue Exception
158
+ name = ""
159
+ end
160
+ next if name != "IRB::Context" and
161
+ /^(IRB|SLex|RubyLex|RubyToken)/ =~ name
162
+ candidates.concat m.instance_methods(false).collect{|x| x.to_s}
163
+ }
164
+ candidates.sort!
165
+ candidates.uniq!
166
+ end
167
+ select_message(receiver, message, candidates)
168
+
169
+ when /^\.([^.]*)$/
170
+ # unknown(maybe String)
171
+
172
+ receiver = ""
173
+ message = Regexp.quote($1)
174
+
175
+ candidates = String.instance_methods(true).collect{|m| m.to_s}
176
+ select_message(receiver, message, candidates)
177
+
178
+ else
179
+ candidates = eval("methods | private_methods | local_variables | self.class.constants", bind).collect{|m| m.to_s}
180
+
181
+ (candidates|ReservedWords).grep(/^#{Regexp.quote(input)}/)
182
+ end
183
+ }
184
+
185
+ Operators = ["%", "&", "*", "**", "+", "-", "/",
186
+ "<", "<<", "<=", "<=>", "==", "===", "=~", ">", ">=", ">>",
187
+ "[]", "[]=", "^", "!", "!=", "!~"]
188
+
189
+ def self.select_message(receiver, message, candidates)
190
+ candidates.grep(/^#{message}/).collect do |e|
191
+ case e
192
+ when /^[a-zA-Z_]/
193
+ receiver + "." + e
194
+ when /^[0-9]/
195
+ when *Operators
196
+ #receiver + " " + e
197
+ end
198
+ end
199
+ end
200
+ end
201
+ end
202
+
203
+ if Readline.respond_to?("basic_word_break_characters=")
204
+ Readline.basic_word_break_characters= " \t\n\"\\'`><=;|&{("
205
+ end
206
+ Readline.completion_append_character = nil
207
+ Readline.completion_proc = IRB::InputCompletor::CompletionProc