Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[fix #106] move the MacRuby Samples to https://github.com/MacRuby/Mac…

  • Loading branch information...
commit b2a60ce52989906e03106bb5d654abd530da8681 1 parent 191a994
@Watson1978 Watson1978 authored
Showing with 4 additions and 42,599 deletions.
  1. +3 −0  ChangeLog.markdown
  2. +0 −5 misc/release/package_script/postinstall
  3. +1 −10 rakelib/install.rake
  4. +0 −35 sample-macruby/ABPresence/ABPersonDisplayName.rb
  5. +0 −289 sample-macruby/ABPresence/ABPresence.xcodeproj/project.pbxproj
  6. BIN  sample-macruby/ABPresence/English.lproj/InfoPlist.strings
  7. +0 −47 sample-macruby/ABPresence/English.lproj/MainMenu.nib/classes.nib
  8. +0 −18 sample-macruby/ABPresence/English.lproj/MainMenu.nib/info.nib
  9. BIN  sample-macruby/ABPresence/English.lproj/MainMenu.nib/keyedobjects.nib
  10. +0 −28 sample-macruby/ABPresence/Info.plist
  11. +0 −90 sample-macruby/ABPresence/PeopleDataSource.rb
  12. +0 −49 sample-macruby/ABPresence/ServiceWatcher.rb
  13. +0 −14 sample-macruby/ABPresence/main.m
  14. +0 −24 sample-macruby/ABPresence/rb_main.rb
  15. BIN  sample-macruby/AnimatingViews/AnimatingViews.xcodeproj/.project.pbxproj.in.swp
  16. +0 −287 sample-macruby/AnimatingViews/AnimatingViews.xcodeproj/project.pbxproj
  17. BIN  sample-macruby/AnimatingViews/English.lproj/InfoPlist.strings
  18. +0 −54 sample-macruby/AnimatingViews/English.lproj/MainMenu.nib/classes.nib
  19. +0 −19 sample-macruby/AnimatingViews/English.lproj/MainMenu.nib/info.nib
  20. BIN  sample-macruby/AnimatingViews/English.lproj/MainMenu.nib/keyedobjects.nib
  21. +0 −28 sample-macruby/AnimatingViews/Info.plist
  22. +0 −126 sample-macruby/AnimatingViews/SimpleLayoutView.rb
  23. +0 −14 sample-macruby/AnimatingViews/main.m
  24. +0 −22 sample-macruby/AnimatingViews/rb_main.rb
  25. +0 −200 sample-macruby/CircleView/CircleView.rb
  26. +0 −308 sample-macruby/CircleView/CircleView.xcodeproj/project.pbxproj
  27. BIN  sample-macruby/CircleView/English.lproj/InfoPlist.strings
  28. +0 −26 sample-macruby/CircleView/English.lproj/MainMenu.nib/classes.nib
  29. +0 −20 sample-macruby/CircleView/English.lproj/MainMenu.nib/info.nib
  30. BIN  sample-macruby/CircleView/English.lproj/MainMenu.nib/objects.nib
  31. +0 −28 sample-macruby/CircleView/Info.plist
  32. +0 −14 sample-macruby/CircleView/main.m
  33. +0 −22 sample-macruby/CircleView/rb_main.rb
  34. +0 −27 sample-macruby/DTrace/collected_objects.d
  35. +0 −29 sample-macruby/DTrace/collected_objects64.d
  36. +0 −22 sample-macruby/DTrace/gc.d
  37. +0 −24 sample-macruby/DTrace/methods_count.d
  38. +0 −23 sample-macruby/DTrace/methods_duration.d
  39. +0 −89 sample-macruby/DotView/DotView.rb
  40. +0 −281 sample-macruby/DotView/DotView.xcodeproj/project.pbxproj
  41. BIN  sample-macruby/DotView/English.lproj/InfoPlist.strings
  42. +0 −17 sample-macruby/DotView/English.lproj/MainMenu.nib/classes.nib
  43. +0 −18 sample-macruby/DotView/English.lproj/MainMenu.nib/info.nib
  44. BIN  sample-macruby/DotView/English.lproj/MainMenu.nib/objects.nib
  45. +0 −28 sample-macruby/DotView/Info.plist
  46. +0 −14 sample-macruby/DotView/main.m
  47. +0 −22 sample-macruby/DotView/rb_main.rb
  48. +0 −297 sample-macruby/EmbeddedMacRuby/EmbeddedMacRuby.xcodeproj/project.pbxproj
  49. +0 −7 sample-macruby/EmbeddedMacRuby/EmbeddedMacRuby_Prefix.pch
  50. BIN  sample-macruby/EmbeddedMacRuby/English.lproj/InfoPlist.strings
  51. +0 −3,164 sample-macruby/EmbeddedMacRuby/English.lproj/MainMenu.nib/designable.nib
  52. BIN  sample-macruby/EmbeddedMacRuby/English.lproj/MainMenu.nib/keyedobjects.nib
  53. +0 −28 sample-macruby/EmbeddedMacRuby/Info.plist
  54. +0 −19 sample-macruby/EmbeddedMacRuby/MyController.h
  55. +0 −41 sample-macruby/EmbeddedMacRuby/MyController.m
  56. +0 −14 sample-macruby/EmbeddedMacRuby/main.m
  57. BIN  sample-macruby/FlickrDemo/English.lproj/InfoPlist.strings
  58. +0 −3,487 sample-macruby/FlickrDemo/English.lproj/MainMenu.nib/designable.nib
  59. BIN  sample-macruby/FlickrDemo/English.lproj/MainMenu.nib/keyedobjects.nib
  60. +0 −289 sample-macruby/FlickrDemo/FlickrDemo.xcodeproj/project.pbxproj
  61. +0 −152 sample-macruby/FlickrDemo/FlickrDemoController.rb
  62. +0 −28 sample-macruby/FlickrDemo/Info.plist
  63. BIN  sample-macruby/FlickrDemo/less.png
  64. +0 −14 sample-macruby/FlickrDemo/main.m
  65. BIN  sample-macruby/FlickrDemo/more.png
  66. +0 −24 sample-macruby/FlickrDemo/rb_main.rb
  67. BIN  sample-macruby/MacOnRack/English.lproj/InfoPlist.strings
  68. +0 −2,708 sample-macruby/MacOnRack/English.lproj/MainMenu.nib/designable.nib
  69. BIN  sample-macruby/MacOnRack/English.lproj/MainMenu.nib/keyedobjects.nib
  70. +0 −28 sample-macruby/MacOnRack/Info.plist
  71. +0 −477 sample-macruby/MacOnRack/MacOnRack.xcodeproj/project.pbxproj
  72. +0 −31 sample-macruby/MacOnRack/README.markdown
  73. +0 −14 sample-macruby/MacOnRack/application_controller.rb
  74. +0 −14 sample-macruby/MacOnRack/main.m
  75. +0 −78 sample-macruby/MacOnRack/rack_url_protocol.rb
  76. +0 −23 sample-macruby/MacOnRack/rb_main.rb
  77. +0 −384 sample-macruby/MarkdownViewer/MarkdownViewer.xcodeproj/project.pbxproj
  78. +0 −7 sample-macruby/MarkdownViewer/MarkdownViewer.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  79. +0 −102 sample-macruby/MarkdownViewer/MarkdownViewer/AppDelegate.rb
  80. +0 −26 sample-macruby/MarkdownViewer/MarkdownViewer/Markdown.rb
  81. +0 −20 sample-macruby/MarkdownViewer/MarkdownViewer/MarkdownView.rb
  82. +0 −47 sample-macruby/MarkdownViewer/MarkdownViewer/MarkdownViewer-Info.plist
  83. +0 −7 sample-macruby/MarkdownViewer/MarkdownViewer/MarkdownViewer-Prefix.pch
  84. BIN  sample-macruby/MarkdownViewer/MarkdownViewer/MarkdownViewer.icns
  85. +0 −2  sample-macruby/MarkdownViewer/MarkdownViewer/en.lproj/InfoPlist.strings
  86. +0 −1,355 sample-macruby/MarkdownViewer/MarkdownViewer/en.lproj/MainMenu.xib
  87. +0 −41 sample-macruby/MarkdownViewer/MarkdownViewer/init.html
  88. +0 −14 sample-macruby/MarkdownViewer/MarkdownViewer/main.m
  89. +0 −22 sample-macruby/MarkdownViewer/MarkdownViewer/rb_main.rb
  90. +0 −81 sample-macruby/MarkdownViewer/MarkdownViewer/style.css
  91. +0 −8 sample-macruby/MarkdownViewer/README.md
  92. +0 −27 sample-macruby/OutlineView/DataSource.rb
  93. BIN  sample-macruby/OutlineView/English.lproj/InfoPlist.strings
  94. +0 −2,764 sample-macruby/OutlineView/English.lproj/MainMenu.nib/designable.nib
  95. BIN  sample-macruby/OutlineView/English.lproj/MainMenu.nib/keyedobjects.nib
  96. +0 −44 sample-macruby/OutlineView/FileSystemItem.rb
  97. +0 −28 sample-macruby/OutlineView/Info.plist
  98. +0 −291 sample-macruby/OutlineView/OutlineView.xcodeproj/project.pbxproj
  99. +0 −14 sample-macruby/OutlineView/main.m
  100. +0 −22 sample-macruby/OutlineView/rb_main.rb
  101. +0 −5 sample-macruby/PagePacker/AppController.rb
  102. +0 −77 sample-macruby/PagePacker/CatalogController.rb
  103. +0 −55 sample-macruby/PagePacker/DraggingSourcePDFView.rb
  104. +0 −40 sample-macruby/PagePacker/English.lproj/CatalogController.nib/classes.nib
  105. +0 −16 sample-macruby/PagePacker/English.lproj/CatalogController.nib/info.nib
  106. BIN  sample-macruby/PagePacker/English.lproj/CatalogController.nib/keyedobjects.nib
  107. +0 −26 sample-macruby/PagePacker/English.lproj/Credits.rtf
  108. BIN  sample-macruby/PagePacker/English.lproj/InfoPlist.strings
  109. +0 −21 sample-macruby/PagePacker/English.lproj/MainMenu.nib/classes.nib
  110. +0 −21 sample-macruby/PagePacker/English.lproj/MainMenu.nib/info.nib
  111. BIN  sample-macruby/PagePacker/English.lproj/MainMenu.nib/keyedobjects.nib
  112. +0 −18 sample-macruby/PagePacker/English.lproj/MyDocument.nib/classes.nib
  113. +0 −16 sample-macruby/PagePacker/English.lproj/MyDocument.nib/info.nib
  114. BIN  sample-macruby/PagePacker/English.lproj/MyDocument.nib/keyedobjects.nib
  115. BIN  sample-macruby/PagePacker/English.lproj/PagePackerHelp/PagePackerHelp.helpindex
  116. BIN  sample-macruby/PagePacker/English.lproj/PagePackerHelp/graphics/abprint.png
  117. BIN  sample-macruby/PagePacker/English.lproj/PagePackerHelp/graphics/addpage.png
  118. BIN  sample-macruby/PagePacker/English.lproj/PagePackerHelp/graphics/catalog.png
  119. BIN  sample-macruby/PagePacker/English.lproj/PagePackerHelp/graphics/cut.jpg
  120. BIN  sample-macruby/PagePacker/English.lproj/PagePackerHelp/graphics/fold1.jpg
  121. BIN  sample-macruby/PagePacker/English.lproj/PagePackerHelp/graphics/fold2.jpg
  122. BIN  sample-macruby/PagePacker/English.lproj/PagePackerHelp/graphics/fold3.jpg
  123. BIN  sample-macruby/PagePacker/English.lproj/PagePackerHelp/graphics/iCal.png
  124. BIN  sample-macruby/PagePacker/English.lproj/PagePackerHelp/graphics/noword.gif
  125. BIN  sample-macruby/PagePacker/English.lproj/PagePackerHelp/graphics/ready2print.png
  126. BIN  sample-macruby/PagePacker/English.lproj/PagePackerHelp/graphics/voila.jpg
  127. BIN  sample-macruby/PagePacker/English.lproj/PagePackerHelp/graphics/webpage.png
  128. +0 −135 sample-macruby/PagePacker/English.lproj/PagePackerHelp/html/style.css
  129. BIN  sample-macruby/PagePacker/English.lproj/PagePackerHelp/ppicon16.png
  130. +0 −131 sample-macruby/PagePacker/English.lproj/PagePackerHelp/swtitle.html
  131. +0 −47 sample-macruby/PagePacker/English.lproj/PreferenceController.nib/classes.nib
  132. +0 −20 sample-macruby/PagePacker/English.lproj/PreferenceController.nib/info.nib
  133. BIN  sample-macruby/PagePacker/English.lproj/PreferenceController.nib/keyedobjects.nib
  134. BIN  sample-macruby/PagePacker/Generic.icns
  135. +0 −9 sample-macruby/PagePacker/GeometryUtilities.rb
  136. +0 −53 sample-macruby/PagePacker/Info.plist
  137. +0 −29 sample-macruby/PagePacker/Japanese.lproj/Credits.rtf
  138. BIN  sample-macruby/PagePacker/Japanese.lproj/InfoPlist.strings
  139. +0 −4 sample-macruby/PagePacker/Japanese.lproj/MainMenu.nib/classes.nib
  140. +0 −17 sample-macruby/PagePacker/Japanese.lproj/MainMenu.nib/info.nib
  141. BIN  sample-macruby/PagePacker/Japanese.lproj/MainMenu.nib/keyedobjects.nib
  142. +0 −7 sample-macruby/PagePacker/Japanese.lproj/MyDocument.nib/classes.nib
  143. +0 −12 sample-macruby/PagePacker/Japanese.lproj/MyDocument.nib/info.nib
  144. BIN  sample-macruby/PagePacker/Japanese.lproj/MyDocument.nib/keyedobjects.nib
  145. +0 −39 sample-macruby/PagePacker/MyDocument.rb
  146. +0 −4 sample-macruby/PagePacker/PDFUtility.rb
  147. BIN  sample-macruby/PagePacker/PPApp.icns
  148. +0 −130 sample-macruby/PagePacker/PackModel.rb
  149. +0 −437 sample-macruby/PagePacker/PackerView.rb
  150. +0 −30 sample-macruby/PagePacker/PageInfo.rb
  151. +0 −283 sample-macruby/PagePacker/PagePacker.sdef
  152. +0 −433 sample-macruby/PagePacker/PagePacker.xcodeproj/project.pbxproj
  153. +0 −36 sample-macruby/PagePacker/PagePacker_Prefix.pch
  154. +0 −87 sample-macruby/PagePacker/PreferenceController.rb
  155. +0 −41 sample-macruby/PagePacker/README
  156. +0 −30 sample-macruby/PagePacker/RoundCloseButtonCell.rb
  157. +0 −95 sample-macruby/PagePacker/Scriptability.rb
  158. +0 −15 sample-macruby/PagePacker/TextDisplayView.rb
  159. +0 −6 sample-macruby/PagePacker/main.m
  160. BIN  sample-macruby/PagePacker/pages.pdf
  161. +0 −15 sample-macruby/PagePacker/rb_main.rb
  162. +0 −148 sample-macruby/PathDemo/DemoView.rb
  163. BIN  sample-macruby/PathDemo/English.lproj/InfoPlist.strings
  164. +0 −14 sample-macruby/PathDemo/English.lproj/MainMenu.nib/classes.nib
  165. +0 −26 sample-macruby/PathDemo/English.lproj/MainMenu.nib/info.nib
  166. BIN  sample-macruby/PathDemo/English.lproj/MainMenu.nib/objects.nib
  167. +0 −28 sample-macruby/PathDemo/Info.plist
  168. +0 −285 sample-macruby/PathDemo/PathDemo.xcodeproj/project.pbxproj
  169. +0 −32 sample-macruby/PathDemo/PathDemoController.rb
  170. +0 −14 sample-macruby/PathDemo/main.m
  171. +0 −22 sample-macruby/PathDemo/rb_main.rb
  172. BIN  sample-macruby/PhileasFrog/English.lproj/InfoPlist.strings
  173. +0 −3,390 sample-macruby/PhileasFrog/English.lproj/MainMenu.nib/designable.nib
  174. BIN  sample-macruby/PhileasFrog/English.lproj/MainMenu.nib/keyedobjects.nib
  175. +0 −28 sample-macruby/PhileasFrog/Info.plist
  176. +0 −9 sample-macruby/PhileasFrog/Rakefile
  177. BIN  sample-macruby/PhileasFrog/akaDylan Plain.ttf
  178. +0 −37 sample-macruby/PhileasFrog/cocoa-ext/ns_button.rb
  179. +0 −286 sample-macruby/PhileasFrog/game_controller.rb
  180. +0 −217 sample-macruby/PhileasFrog/game_data.rb
  181. +0 −36 sample-macruby/PhileasFrog/game_items/bomb.rb
  182. +0 −92 sample-macruby/PhileasFrog/game_items/falling_ruby.rb
  183. +0 −38 sample-macruby/PhileasFrog/game_items/game_item.rb
  184. +0 −103 sample-macruby/PhileasFrog/game_items/player.rb
  185. +0 −47 sample-macruby/PhileasFrog/game_items/vehicle.rb
  186. +0 −98 sample-macruby/PhileasFrog/game_loop.rb
  187. BIN  sample-macruby/PhileasFrog/graphics/asteroid.pdf
  188. BIN  sample-macruby/PhileasFrog/graphics/background_level_1.pdf
  189. BIN  sample-macruby/PhileasFrog/graphics/background_level_2.pdf
  190. BIN  sample-macruby/PhileasFrog/graphics/bomb.pdf
  191. BIN  sample-macruby/PhileasFrog/graphics/frog_level_1.pdf
  192. BIN  sample-macruby/PhileasFrog/graphics/frog_level_2.pdf
  193. BIN  sample-macruby/PhileasFrog/graphics/fullscreen.pdf
  194. BIN  sample-macruby/PhileasFrog/graphics/game_over.pdf
  195. BIN  sample-macruby/PhileasFrog/graphics/heart.pdf
  196. BIN  sample-macruby/PhileasFrog/graphics/intro_bg.pdf
  197. BIN  sample-macruby/PhileasFrog/graphics/intro_screen.pdf
  198. BIN  sample-macruby/PhileasFrog/graphics/nenuphar.pdf
  199. BIN  sample-macruby/PhileasFrog/graphics/ruby-black.pdf
  200. BIN  sample-macruby/PhileasFrog/graphics/ruby.pdf
  201. BIN  sample-macruby/PhileasFrog/graphics/splash_1.pdf
  202. BIN  sample-macruby/PhileasFrog/graphics/splash_2.pdf
  203. BIN  sample-macruby/PhileasFrog/graphics/star.pdf
  204. BIN  sample-macruby/PhileasFrog/graphics/x.pdf
  205. +0 −149 sample-macruby/PhileasFrog/image_layer.rb
  206. +0 −90 sample-macruby/PhileasFrog/keyboard_control_view.rb
  207. +0 −25 sample-macruby/PhileasFrog/main.m
  208. +0 −58 sample-macruby/PhileasFrog/modules/game_config.rb
  209. +0 −52 sample-macruby/PhileasFrog/modules/player_position.rb
  210. +0 −42 sample-macruby/PhileasFrog/modules/sound_effects.rb
  211. +0 −84 sample-macruby/PhileasFrog/modules/visual_effects.rb
  212. BIN  sample-macruby/PhileasFrog/phileas.icns
  213. +0 −544 sample-macruby/PhileasFrog/phileas_frog.xcodeproj/project.pbxproj
  214. +0 −48 sample-macruby/PhileasFrog/rb_main.rb
  215. BIN  sample-macruby/PhileasFrog/sounds/level_1.mp3
  216. BIN  sample-macruby/PhileasFrog/sounds/level_2.mp3
  217. +0 −17 sample-macruby/RoundTransparentWindow/Controller.rb
  218. +0 −40 sample-macruby/RoundTransparentWindow/CustomView.rb
  219. +0 −69 sample-macruby/RoundTransparentWindow/CustomWindow.rb
  220. +0 −1,887 sample-macruby/RoundTransparentWindow/English.lproj/MainMenu.nib/designable.nib
  221. BIN  sample-macruby/RoundTransparentWindow/English.lproj/MainMenu.nib/keyedobjects.nib
  222. +0 −28 sample-macruby/RoundTransparentWindow/Info.plist
  223. +0 −289 sample-macruby/RoundTransparentWindow/RoundTransparentWindow.xcodeproj/project.pbxproj
  224. BIN  sample-macruby/RoundTransparentWindow/circle.tif
  225. +0 −16 sample-macruby/RoundTransparentWindow/main.m
  226. BIN  sample-macruby/RoundTransparentWindow/pentagram.tif
  227. +0 −22 sample-macruby/RoundTransparentWindow/rb_main.rb
  228. +0 −17 sample-macruby/Scripts/circle.rb
  229. +0 −116 sample-macruby/Scripts/darkroom.rb
  230. +0 −34 sample-macruby/Scripts/gcd/futures.rb
  231. +0 −19 sample-macruby/Scripts/gcd/sleeping_barber.rb
  232. +0 −158 sample-macruby/Scripts/growl/growl.rb
  233. +0 −30 sample-macruby/Scripts/growl/growl_block_sample.rb
  234. +0 −37 sample-macruby/Scripts/growl/growl_delegate_sample.rb
  235. +0 −27 sample-macruby/Scripts/growl/growl_helpers.rb
  236. +0 −47 sample-macruby/Scripts/hello_world.rb
  237. +0 −68 sample-macruby/Scripts/javascript.rb
  238. +0 −129 sample-macruby/Scripts/jumpy.rb
  239. +0 −65 sample-macruby/Scripts/locator.rb
  240. +0 −6 sample-macruby/Scripts/notify_post.rb
  241. +0 −36 sample-macruby/Scripts/pdf2tiff.rb
  242. +0 −127 sample-macruby/Scripts/rss_parser.rb
  243. +0 −145 sample-macruby/Scripts/search_to_pdf.rb
  244. +0 −61 sample-macruby/Scripts/transparent_hello.rb
  245. +0 −199 sample-macruby/Scripts/web_server.rb
  246. +0 −22 sample-macruby/Scripts/webrick.rb
  247. BIN  sample-macruby/Sketch/Arrow.tiff
  248. BIN  sample-macruby/Sketch/Circle.tiff
  249. BIN  sample-macruby/Sketch/Cross.tiff
  250. BIN  sample-macruby/Sketch/Draw2App.icns
  251. BIN  sample-macruby/Sketch/Draw2File.icns
  252. +0 −3,593 sample-macruby/Sketch/English.lproj/Draw2.nib/designable.nib
  253. BIN  sample-macruby/Sketch/English.lproj/Draw2.nib/keyedobjects.nib
  254. +0 −870 sample-macruby/Sketch/English.lproj/DrawWindow.nib/designable.nib
  255. BIN  sample-macruby/Sketch/English.lproj/DrawWindow.nib/keyedobjects.nib
  256. +0 −1,124 sample-macruby/Sketch/English.lproj/GridPanel.nib/designable.nib
  257. BIN  sample-macruby/Sketch/English.lproj/GridPanel.nib/keyedobjects.nib
  258. +0 −1,900 sample-macruby/Sketch/English.lproj/Inspector.nib/designable.nib
  259. BIN  sample-macruby/Sketch/English.lproj/Inspector.nib/keyedobjects.nib
  260. +0 −957 sample-macruby/Sketch/English.lproj/Preferences.nib/designable.nib
  261. BIN  sample-macruby/Sketch/English.lproj/Preferences.nib/keyedobjects.nib
  262. BIN  sample-macruby/Sketch/English.lproj/SKTError.strings
  263. +0 −93 sample-macruby/Sketch/English.lproj/Sketch.scriptTerminology
  264. +0 −837 sample-macruby/Sketch/English.lproj/ToolPalette.nib/designable.nib
  265. BIN  sample-macruby/Sketch/English.lproj/ToolPalette.nib/keyedobjects.nib
  266. +0 −108 sample-macruby/Sketch/Info.plist
  267. BIN  sample-macruby/Sketch/InfoPlist.strings
  268. BIN  sample-macruby/Sketch/Line.tiff
  269. +0 −14 sample-macruby/Sketch/README
  270. +0 −85 sample-macruby/Sketch/Rakefile
  271. +0 −133 sample-macruby/Sketch/ReadMe.rtf
  272. BIN  sample-macruby/Sketch/Rectangle.tiff
  273. +0 −471 sample-macruby/Sketch/Ruby Sketch.xcodeproj/project.pbxproj
  274. +0 −184 sample-macruby/Sketch/SKTAppDelegate.rb
  275. +0 −61 sample-macruby/Sketch/SKTCircle.rb
  276. +0 −592 sample-macruby/Sketch/SKTDocument.rb
  277. +0 −80 sample-macruby/Sketch/SKTError.rb
  278. +0 −690 sample-macruby/Sketch/SKTGraphic.rb
Sorry, we could not display the entire diff because too many files (351) changed.
View
3  ChangeLog.markdown
@@ -1,3 +1,6 @@
+# 0.13
+ * Move the MacRuby Samples to https://github.com/MacRuby/MacRubySamples
+
# 0.12
MacRuby 0.12 was a milestone release...
View
5 misc/release/package_script/postinstall
@@ -29,9 +29,4 @@ if [ ! -L "$DEST_NIBTOOL_PATH" ] ; then
ln -s "$NIBTOOL" "$DEST_NIBTOOL_PATH"
fi
-# copy the Examples
-USER_EXAMPLE_DIR=~/Documents/MacRubyExamples
-mkdir -p "$USER_EXAMPLE_DIR"
-cp -R /tmp/macruby/sample-macruby/ "$USER_EXAMPLE_DIR"
-
exit 0
View
11 rakelib/install.rake
@@ -133,10 +133,6 @@ module Installer
`xcode-select -print-path`.chomp
end
- def xcode_example_dir
- File.expand_path "~/Documents/MacRubyExamples"
- end
-
def xcode3_2_template_dir
'/Library/Application Support/Developer/Shared/Xcode'
end
@@ -348,7 +344,7 @@ namespace :install do
end
desc 'Install all Xcode related things'
- task :xcode_support => [:nibtool, :xcode_templates, :xcode_samples]
+ task :xcode_support => [:nibtool, :xcode_templates]
task :nibtool do
puts 'Installing IB support'
@@ -366,9 +362,4 @@ namespace :install do
install_recursive 'misc/xcode-templates', xcode3_2_template_dir, :mode => prog_mode
end
- task :xcode_samples do
- puts 'Installing MacRuby sample projects'
- install_recursive 'sample-macruby', xcode_example_dir, :mode => script_mode
- end
-
end
View
35 sample-macruby/ABPresence/ABPersonDisplayName.rb
@@ -1,35 +0,0 @@
-class ABPerson
-
- # Pull first and last name, organization, and record flags
- # If the entry is a company, display the organization name instead
- def displayName
- firstName = valueForProperty KABFirstNameProperty
- lastName = valueForProperty KABLastNameProperty
- companyName = valueForProperty KABOrganizationProperty
- flagsValue = valueForProperty KABPersonFlags
-
- flags = flagsValue ? flagsValue.intValue : 0
- if (flags & KABShowAsMask) == KABShowAsCompany
- return companyName if companyName and companyName.length > 0
- end
-
- lastNameFirst = (flags & KABNameOrderingMask) == KABLastNameFirst
- hasFirstName = firstName and firstName.length > 0
- hasLastName = lastName and lastName.length > 0
-
- if hasLastName and hasFirstName
- if lastNameFirst
- "#{lastName} #{firstname}"
- else
- "#{firstName} #{lastName}"
- end
- elsif hasLastName
- lastName
- elsif hasFirstName
- firstName
- else
- 'n/a'
- end
- end
-
-end
View
289 sample-macruby/ABPresence/ABPresence.xcodeproj/project.pbxproj
@@ -1,289 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 44;
- objects = {
-
-/* Begin PBXBuildFile section */
- 4DB13B050D87490900AFF86D /* ServiceWatcher.rb in Resources */ = {isa = PBXBuildFile; fileRef = 4DB13B040D87490900AFF86D /* ServiceWatcher.rb */; };
- 4DB13B070D874B2500AFF86D /* PeopleDataSource.rb in Resources */ = {isa = PBXBuildFile; fileRef = 4DB13B060D874B2500AFF86D /* PeopleDataSource.rb */; };
- 4DB13B0F0D874D2100AFF86D /* ABPersonDisplayName.rb in Resources */ = {isa = PBXBuildFile; fileRef = 4DB13B0E0D874D2100AFF86D /* ABPersonDisplayName.rb */; };
- 4DE339F70D74FCDD00ADB6EE /* rb_main.rb in Resources */ = {isa = PBXBuildFile; fileRef = 4DE339F60D74FCDD00ADB6EE /* rb_main.rb */; };
- 4DE3BE140D8651D900ECA448 /* MacRuby.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DE3BE130D8651D900ECA448 /* MacRuby.framework */; };
- 8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
- 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
- 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
- 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXFileReference section */
- 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
- 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
- 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
- 29B97319FDCFA39411CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = "<group>"; };
- 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
- 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
- 4DB13B040D87490900AFF86D /* ServiceWatcher.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = ServiceWatcher.rb; sourceTree = "<group>"; };
- 4DB13B060D874B2500AFF86D /* PeopleDataSource.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = PeopleDataSource.rb; sourceTree = "<group>"; };
- 4DB13B0E0D874D2100AFF86D /* ABPersonDisplayName.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = ABPersonDisplayName.rb; sourceTree = "<group>"; };
- 4DE339F60D74FCDD00ADB6EE /* rb_main.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = rb_main.rb; sourceTree = "<group>"; };
- 4DE3BE130D8651D900ECA448 /* MacRuby.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MacRuby.framework; path = /Library/Frameworks/MacRuby.framework; sourceTree = "<absolute>"; };
- 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
- 8D1107320486CEB800E47090 /* ABPresence.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ABPresence.app; sourceTree = BUILT_PRODUCTS_DIR; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 8D11072E0486CEB800E47090 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
- 4DE3BE140D8651D900ECA448 /* MacRuby.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 080E96DDFE201D6D7F000001 /* Classes */ = {
- isa = PBXGroup;
- children = (
- 4DB13B0E0D874D2100AFF86D /* ABPersonDisplayName.rb */,
- 4DB13B060D874B2500AFF86D /* PeopleDataSource.rb */,
- 4DB13B040D87490900AFF86D /* ServiceWatcher.rb */,
- );
- name = Classes;
- sourceTree = "<group>";
- };
- 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
- isa = PBXGroup;
- children = (
- 4DE3BE130D8651D900ECA448 /* MacRuby.framework */,
- 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
- );
- name = "Linked Frameworks";
- sourceTree = "<group>";
- };
- 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
- isa = PBXGroup;
- children = (
- 29B97324FDCFA39411CA2CEA /* AppKit.framework */,
- 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
- 29B97325FDCFA39411CA2CEA /* Foundation.framework */,
- );
- name = "Other Frameworks";
- sourceTree = "<group>";
- };
- 19C28FACFE9D520D11CA2CBB /* Products */ = {
- isa = PBXGroup;
- children = (
- 8D1107320486CEB800E47090 /* ABPresence.app */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- 29B97314FDCFA39411CA2CEA /* ABPresence */ = {
- isa = PBXGroup;
- children = (
- 080E96DDFE201D6D7F000001 /* Classes */,
- 29B97315FDCFA39411CA2CEA /* Other Sources */,
- 29B97317FDCFA39411CA2CEA /* Resources */,
- 29B97323FDCFA39411CA2CEA /* Frameworks */,
- 19C28FACFE9D520D11CA2CBB /* Products */,
- );
- name = ABPresence;
- sourceTree = "<group>";
- };
- 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
- isa = PBXGroup;
- children = (
- 4DE339F60D74FCDD00ADB6EE /* rb_main.rb */,
- 29B97316FDCFA39411CA2CEA /* main.m */,
- );
- name = "Other Sources";
- sourceTree = "<group>";
- };
- 29B97317FDCFA39411CA2CEA /* Resources */ = {
- isa = PBXGroup;
- children = (
- 8D1107310486CEB800E47090 /* Info.plist */,
- 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
- 29B97318FDCFA39411CA2CEA /* MainMenu.nib */,
- );
- name = Resources;
- sourceTree = "<group>";
- };
- 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
- isa = PBXGroup;
- children = (
- 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
- 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
- );
- name = Frameworks;
- sourceTree = "<group>";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 8D1107260486CEB800E47090 /* ABPresence */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "ABPresence" */;
- buildPhases = (
- 8D1107290486CEB800E47090 /* Resources */,
- 8D11072C0486CEB800E47090 /* Sources */,
- 8D11072E0486CEB800E47090 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = ABPresence;
- productInstallPath = "$(HOME)/Applications";
- productName = ABPresence;
- productReference = 8D1107320486CEB800E47090 /* ABPresence.app */;
- productType = "com.apple.product-type.application";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 29B97313FDCFA39411CA2CEA /* Project object */ = {
- isa = PBXProject;
- buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ABPresence" */;
- compatibilityVersion = "Xcode 3.0";
- hasScannedForEncodings = 1;
- mainGroup = 29B97314FDCFA39411CA2CEA /* ABPresence */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 8D1107260486CEB800E47090 /* ABPresence */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
- 8D1107290486CEB800E47090 /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */,
- 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
- 4DE339F70D74FCDD00ADB6EE /* rb_main.rb in Resources */,
- 4DB13B050D87490900AFF86D /* ServiceWatcher.rb in Resources */,
- 4DB13B070D874B2500AFF86D /* PeopleDataSource.rb in Resources */,
- 4DB13B0F0D874D2100AFF86D /* ABPersonDisplayName.rb in Resources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
- 8D11072C0486CEB800E47090 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 8D11072D0486CEB800E47090 /* main.m in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXVariantGroup section */
- 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
- isa = PBXVariantGroup;
- children = (
- 089C165DFE840E0CC02AAC07 /* English */,
- );
- name = InfoPlist.strings;
- sourceTree = "<group>";
- };
- 29B97318FDCFA39411CA2CEA /* MainMenu.nib */ = {
- isa = PBXVariantGroup;
- children = (
- 29B97319FDCFA39411CA2CEA /* English */,
- );
- name = MainMenu.nib;
- sourceTree = "<group>";
- };
-/* End PBXVariantGroup section */
-
-/* Begin XCBuildConfiguration section */
- C01FCF4B08A954540054247B /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = YES;
- GCC_MODEL_TUNING = G5;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- INFOPLIST_FILE = Info.plist;
- INSTALL_PATH = "$(HOME)/Applications";
- PRODUCT_NAME = ABPresence;
- WRAPPER_EXTENSION = app;
- ZERO_LINK = YES;
- };
- name = Debug;
- };
- C01FCF4C08A954540054247B /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_MODEL_TUNING = G5;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- INFOPLIST_FILE = Info.plist;
- INSTALL_PATH = "$(HOME)/Applications";
- PRODUCT_NAME = ABPresence;
- WRAPPER_EXTENSION = app;
- };
- name = Release;
- };
- C01FCF4F08A954540054247B /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ARCHS = "$(NATIVE_ARCH_ACTUAL)";
- GCC_ENABLE_OBJC_GC = required;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- PREBINDING = NO;
- };
- name = Debug;
- };
- C01FCF5008A954540054247B /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ARCHS = "$(NATIVE_ARCH_ACTUAL)";
- GCC_ENABLE_OBJC_GC = required;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- PREBINDING = NO;
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "ABPresence" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- C01FCF4B08A954540054247B /* Debug */,
- C01FCF4C08A954540054247B /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ABPresence" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- C01FCF4F08A954540054247B /* Debug */,
- C01FCF5008A954540054247B /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
-}
View
BIN  sample-macruby/ABPresence/English.lproj/InfoPlist.strings
Binary file not shown
View
47 sample-macruby/ABPresence/English.lproj/MainMenu.nib/classes.nib
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>IBClasses</key>
- <array>
- <dict>
- <key>CLASS</key>
- <string>FirstResponder</string>
- <key>LANGUAGE</key>
- <string>ObjC</string>
- <key>SUPERCLASS</key>
- <string>NSObject</string>
- </dict>
- <dict>
- <key>CLASS</key>
- <string>PeopleDataSource</string>
- <key>LANGUAGE</key>
- <string>ObjC</string>
- <key>OUTLETS</key>
- <dict>
- <key>serviceWatcher</key>
- <string>id</string>
- <key>table</key>
- <string>NSTableView</string>
- </dict>
- <key>SUPERCLASS</key>
- <string>NSObject</string>
- </dict>
- <dict>
- <key>CLASS</key>
- <string>ServiceWatcher</string>
- <key>LANGUAGE</key>
- <string>ObjC</string>
- <key>OUTLETS</key>
- <dict>
- <key>dataSource</key>
- <string>id</string>
- </dict>
- <key>SUPERCLASS</key>
- <string>NSObject</string>
- </dict>
- </array>
- <key>IBVersion</key>
- <string>1</string>
-</dict>
-</plist>
View
18 sample-macruby/ABPresence/English.lproj/MainMenu.nib/info.nib
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>IBFramework Version</key>
- <string>629</string>
- <key>IBLastKnownRelativeProjectPath</key>
- <string>../../ABPresence.xcodeproj</string>
- <key>IBOldestOS</key>
- <integer>5</integer>
- <key>IBOpenObjects</key>
- <array/>
- <key>IBSystem Version</key>
- <string>9C31</string>
- <key>targetFramework</key>
- <string>IBCocoaFramework</string>
-</dict>
-</plist>
View
BIN  sample-macruby/ABPresence/English.lproj/MainMenu.nib/keyedobjects.nib
Binary file not shown
View
28 sample-macruby/ABPresence/Info.plist
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundleIconFile</key>
- <string></string>
- <key>CFBundleIdentifier</key>
- <string>com.yourcompany.ABPresence</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>${PRODUCT_NAME}</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>1.0</string>
- <key>NSMainNibFile</key>
- <string>MainMenu</string>
- <key>NSPrincipalClass</key>
- <string>NSApplication</string>
-</dict>
-</plist>
View
90 sample-macruby/ABPresence/PeopleDataSource.rb
@@ -1,90 +0,0 @@
-class PeopleDataSource
-
- attr_accessor :table, :serviceWatcher
-
- # Initialize and register for AddressBook notifications
- def awakeFromNib
- @imPersonStatus = []
- @abPeople = []
-
- nCenter = NSNotificationCenter.defaultCenter
- nCenter.addObserver self,
- selector:'abDatabaseChangedExternallyNotification:',
- name:KABDatabaseChangedExternallyNotification,
- object:nil
-
- reloadABPeople
- @serviceWatcher.startMonitoring
- end
-
- # Data Loading
- def bestStatusForPerson(person)
- bestStatus = IMPersonStatusOffline # Let's assume they're offline to start
- IMService.allServices.each do |service|
- snames = service.screenNamesForPerson person
- if snames
- snames.each do |screenName|
- dict = service.infoForScreenName screenName
- next if dict.nil?
- status = dict[IMPersonStatusKey]
- next if status.nil?
- thisStatus = status.intValue
- if thisStatus > bestStatus
- bestStatus = thisStatus
- end
- end
- end
- end
- return bestStatus
- end
-
- # This dumps all the status information and rebuilds the array against the current @abPeople
- # Fairly expensive, so this is only done when necessary
- def rebuildStatusInformation
- @imPersonStatus = @abPeople.map { |person| bestStatusForPerson(person) }
- @table.reloadData
- end
-
- # Rebuild status information for a given person, much faster than a full rebuild
- def rebuildStatusInformationForPerson forPerson
- @abPeople.each_with_index do |person, i|
- next unless person == forPerson
- @imPersonStatus[i] = bestStatusForPerson(person)
- end
- @table.reloadData
- end
-
- # This will do a full flush of people in our AB Cache, along with rebuilding their status
- def reloadABPeople
- @abPeople = ABAddressBook.sharedAddressBook.people.sort do |x, y|
- x.displayName <=> y.displayName
- end
- rebuildStatusInformation
- end
-
- # NSTableView Data Source
-
- def numberOfRowsInTableView tableView
- @abPeople ? @abPeople.size : 0
- end
-
- def tableView tableView, objectValueForTableColumn:tableColumn, row:row
- case tableColumn.identifier
- when 'image'
- status = @imPersonStatus[row]
- NSImage.imageNamed IMService.imageNameForStatus(status)
- when 'name'
- @abPeople[row].displayName
- end
- end
-
- # Notifications
-
- # If the AB database changes, force a reload of everyone
- # We could look in the notification to catch differential updates, but for now
- # this is fine.
- def abDatabaseChangedExternallyNotification notification
- reloadABPeople
- end
-
-end
View
49 sample-macruby/ABPresence/ServiceWatcher.rb
@@ -1,49 +0,0 @@
-class ServiceWatcher
-
- attr_accessor :dataSource
-
- def startMonitoring
- nCenter = IMService.notificationCenter
- nCenter.addObserver self,
- selector:'imPersonStatusChangedNotification:',
- name:IMPersonStatusChangedNotification,
- object:nil
- nCenter.addObserver self,
- selector:'imPersonInfoChangedNotification:',
- name:IMPersonInfoChangedNotification,
- object:nil
- end
-
- def stopMonitoring
- IMService.notificationCenter.removeObserver self
- end
-
- def forwardToObservers notification
- service = notification.object
- screenName = notification.userInfo.objectForKey IMPersonScreenNameKey
- nCenter = NSNotificationCenter.defaultCenter
- people = service.peopleWithScreenName screenName
- if people
- nCenter = NSNotificationCenter.defaultCenter
- people.each do |person|
- @dataSource.rebuildStatusInformationForPerson person
- end
- end
- end
-
- # Received from IMService's custom notification center. Posted when a different user (screenName) logs in, logs off, goes away,
- # and so on. This notification is for the IMService object.The user information dictionary will always contain an
- # IMPersonScreenNameKey and an IMPersonStatusKey, and no others.
- def imPersonStatusChangedNotification notification
- forwardToObservers notification
- end
-
- # Received from IMService's custom notification center. Posted when a screenName changes some aspect of their published information.
- # This notification is for the IMService object. The user information dictionary will always contain an IMPersonScreenNameKey and may
- # contain any of the following keys as described by "Dictionary Keys" in this document: <tt>IMPersonStatusMessageKey, IMPersonIdleSinceKey,
- # IMPersonFirstNameKey, IMPersonLastNameKey, IMPersonEmailKey, IMPersonPictureDataKey, IMPersonAVBusyKey, IMPersonCapabilitiesKey</tt>.
- # If a particular attribute has been removed, the value for the relevant key will be NSNull.
- def imPersonInfoChangedNotification notification
- forwardToObservers notification
- end
-end
View
14 sample-macruby/ABPresence/main.m
@@ -1,14 +0,0 @@
-//
-// main.m
-// ABPresence
-//
-// Created by Laurent Sansonetti on 3/11/08.
-// Copyright __MyCompanyName__ 2008. All rights reserved.
-//
-
-#import <MacRuby/MacRuby.h>
-
-int main(int argc, char *argv[])
-{
- return macruby_main("rb_main.rb", argc, argv);
-}
View
24 sample-macruby/ABPresence/rb_main.rb
@@ -1,24 +0,0 @@
-#
-# rb_main.rb
-# ABPresence
-#
-# Created by Laurent Sansonetti on 3/11/08.
-# Copyright __MyCompanyName__ 2008. All rights reserved.
-#
-
-# Loading the Cocoa framework. If you need to load more frameworks, you can
-# do that here too.
-framework 'Cocoa'
-framework 'AddressBook'
-framework 'InstantMessage'
-
-# Loading all the Ruby project files.
-dir_path = NSBundle.mainBundle.resourcePath.fileSystemRepresentation
-Dir.entries(dir_path).each do |path|
- if path != File.basename(__FILE__) and path[-3..-1] == '.rb'
- require(path)
- end
-end
-
-# Starting the Cocoa main loop.
-NSApplicationMain(0, nil)
View
BIN  sample-macruby/AnimatingViews/AnimatingViews.xcodeproj/.project.pbxproj.in.swp
Binary file not shown
View
287 sample-macruby/AnimatingViews/AnimatingViews.xcodeproj/project.pbxproj
@@ -1,287 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 44;
- objects = {
-
-/* Begin PBXBuildFile section */
- 4D40C25C0D7E28B200917EB8 /* SimpleLayoutView.rb in Resources */ = {isa = PBXBuildFile; fileRef = 4D40C25B0D7E28B200917EB8 /* SimpleLayoutView.rb */; };
- 4DE339F70D74FCDD00ADB6EE /* rb_main.rb in Resources */ = {isa = PBXBuildFile; fileRef = 4DE339F60D74FCDD00ADB6EE /* rb_main.rb */; };
- 4DE3BD540D863C7300ECA448 /* MacRuby.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DE3BD530D863C7300ECA448 /* MacRuby.framework */; };
- 8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
- 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
- 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
- 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXFileReference section */
- 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
- 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
- 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
- 29B97319FDCFA39411CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = "<group>"; };
- 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
- 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
- 4D40C25B0D7E28B200917EB8 /* SimpleLayoutView.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = SimpleLayoutView.rb; sourceTree = "<group>"; };
- 4DE339F60D74FCDD00ADB6EE /* rb_main.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = rb_main.rb; sourceTree = "<group>"; };
- 4DE3BD530D863C7300ECA448 /* MacRuby.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MacRuby.framework; path = /Library/Frameworks/MacRuby.framework; sourceTree = "<absolute>"; };
- 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
- 8D1107320486CEB800E47090 /* AnimatingViews.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AnimatingViews.app; sourceTree = BUILT_PRODUCTS_DIR; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 8D11072E0486CEB800E47090 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
- 4DE3BD540D863C7300ECA448 /* MacRuby.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 080E96DDFE201D6D7F000001 /* Classes */ = {
- isa = PBXGroup;
- children = (
- 4D40C25B0D7E28B200917EB8 /* SimpleLayoutView.rb */,
- );
- name = Classes;
- sourceTree = "<group>";
- };
- 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
- isa = PBXGroup;
- children = (
- 4DE3BD530D863C7300ECA448 /* MacRuby.framework */,
- 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
- );
- name = "Linked Frameworks";
- sourceTree = "<group>";
- };
- 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
- isa = PBXGroup;
- children = (
- 29B97324FDCFA39411CA2CEA /* AppKit.framework */,
- 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
- 29B97325FDCFA39411CA2CEA /* Foundation.framework */,
- );
- name = "Other Frameworks";
- sourceTree = "<group>";
- };
- 19C28FACFE9D520D11CA2CBB /* Products */ = {
- isa = PBXGroup;
- children = (
- 8D1107320486CEB800E47090 /* AnimatingViews.app */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- 29B97314FDCFA39411CA2CEA /* AnimatingViews */ = {
- isa = PBXGroup;
- children = (
- 080E96DDFE201D6D7F000001 /* Classes */,
- 29B97315FDCFA39411CA2CEA /* Other Sources */,
- 29B97317FDCFA39411CA2CEA /* Resources */,
- 29B97323FDCFA39411CA2CEA /* Frameworks */,
- 19C28FACFE9D520D11CA2CBB /* Products */,
- );
- name = AnimatingViews;
- sourceTree = "<group>";
- };
- 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
- isa = PBXGroup;
- children = (
- 4DE339F60D74FCDD00ADB6EE /* rb_main.rb */,
- 29B97316FDCFA39411CA2CEA /* main.m */,
- );
- name = "Other Sources";
- sourceTree = "<group>";
- };
- 29B97317FDCFA39411CA2CEA /* Resources */ = {
- isa = PBXGroup;
- children = (
- 8D1107310486CEB800E47090 /* Info.plist */,
- 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
- 29B97318FDCFA39411CA2CEA /* MainMenu.nib */,
- );
- name = Resources;
- sourceTree = "<group>";
- };
- 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
- isa = PBXGroup;
- children = (
- 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
- 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
- );
- name = Frameworks;
- sourceTree = "<group>";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 8D1107260486CEB800E47090 /* AnimatingViews */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "AnimatingViews" */;
- buildPhases = (
- 8D1107290486CEB800E47090 /* Resources */,
- 8D11072C0486CEB800E47090 /* Sources */,
- 8D11072E0486CEB800E47090 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = AnimatingViews;
- productInstallPath = "$(HOME)/Applications";
- productName = AnimatingViews;
- productReference = 8D1107320486CEB800E47090 /* AnimatingViews.app */;
- productType = "com.apple.product-type.application";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 29B97313FDCFA39411CA2CEA /* Project object */ = {
- isa = PBXProject;
- buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "AnimatingViews" */;
- compatibilityVersion = "Xcode 3.0";
- hasScannedForEncodings = 1;
- mainGroup = 29B97314FDCFA39411CA2CEA /* AnimatingViews */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 8D1107260486CEB800E47090 /* AnimatingViews */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
- 8D1107290486CEB800E47090 /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */,
- 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
- 4DE339F70D74FCDD00ADB6EE /* rb_main.rb in Resources */,
- 4D40C25C0D7E28B200917EB8 /* SimpleLayoutView.rb in Resources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
- 8D11072C0486CEB800E47090 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 8D11072D0486CEB800E47090 /* main.m in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXVariantGroup section */
- 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
- isa = PBXVariantGroup;
- children = (
- 089C165DFE840E0CC02AAC07 /* English */,
- );
- name = InfoPlist.strings;
- sourceTree = "<group>";
- };
- 29B97318FDCFA39411CA2CEA /* MainMenu.nib */ = {
- isa = PBXVariantGroup;
- children = (
- 29B97319FDCFA39411CA2CEA /* English */,
- );
- name = MainMenu.nib;
- sourceTree = "<group>";
- };
-/* End PBXVariantGroup section */
-
-/* Begin XCBuildConfiguration section */
- C01FCF4B08A954540054247B /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = YES;
- GCC_MODEL_TUNING = G5;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- INFOPLIST_FILE = Info.plist;
- INSTALL_PATH = "$(HOME)/Applications";
- PRODUCT_NAME = AnimatingViews;
- WRAPPER_EXTENSION = app;
- ZERO_LINK = YES;
- };
- name = Debug;
- };
- C01FCF4C08A954540054247B /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_MODEL_TUNING = G5;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- INFOPLIST_FILE = Info.plist;
- INSTALL_PATH = "$(HOME)/Applications";
- PRODUCT_NAME = AnimatingViews;
- WRAPPER_EXTENSION = app;
- };
- name = Release;
- };
- C01FCF4F08A954540054247B /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ARCHS = "$(NATIVE_ARCH_ACTUAL)";
- GCC_ENABLE_OBJC_GC = required;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- HEADER_SEARCH_PATHS = "";
- LIBRARY_SEARCH_PATHS = "";
- OTHER_LDFLAGS = "";
- PREBINDING = NO;
- };
- name = Debug;
- };
- C01FCF5008A954540054247B /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ARCHS = "$(NATIVE_ARCH_ACTUAL)";
- GCC_ENABLE_OBJC_GC = required;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- HEADER_SEARCH_PATHS = "";
- LIBRARY_SEARCH_PATHS = "";
- OTHER_LDFLAGS = "";
- PREBINDING = NO;
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "AnimatingViews" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- C01FCF4B08A954540054247B /* Debug */,
- C01FCF4C08A954540054247B /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- C01FCF4E08A954540054247B /* Build configuration list for PBXProject "AnimatingViews" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- C01FCF4F08A954540054247B /* Debug */,
- C01FCF5008A954540054247B /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
-}
View
BIN  sample-macruby/AnimatingViews/English.lproj/InfoPlist.strings
Binary file not shown
View
54 sample-macruby/AnimatingViews/English.lproj/MainMenu.nib/classes.nib
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>IBClasses</key>
- <array>
- <dict>
- <key>ACTIONS</key>
- <dict>
- <key>addABox:</key>
- <string>id</string>
- <key>changeLayout:</key>
- <string>id</string>
- <key>removeLastBox:</key>
- <string>id</string>
- </dict>
- <key>CLASS</key>
- <string>SimpleLayoutView</string>
- <key>LANGUAGE</key>
- <string>ObjC</string>
- <key>OUTLETS</key>
- <dict>
- <key>boxColorField</key>
- <string>NSColorWell</string>
- </dict>
- <key>SUPERCLASS</key>
- <string>NSView</string>
- </dict>
- <dict>
- <key>ACTIONS</key>
- <dict>
- <key>addABox:</key>
- <string>id</string>
- <key>alignSubviewsHorizontally:</key>
- <string>id</string>
- <key>alignSubviewsInAGrid:</key>
- <string>id</string>
- <key>alignSubviewsVertically:</key>
- <string>id</string>
- <key>removeLastBox:</key>
- <string>id</string>
- </dict>
- <key>CLASS</key>
- <string>OrganizingView</string>
- <key>LANGUAGE</key>
- <string>ObjC</string>
- <key>SUPERCLASS</key>
- <string>NSView</string>
- </dict>
- </array>
- <key>IBVersion</key>
- <string>1</string>
-</dict>
-</plist>
View
19 sample-macruby/AnimatingViews/English.lproj/MainMenu.nib/info.nib
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>IBFramework Version</key>
- <string>595</string>
- <key>IBOldestOS</key>
- <integer>-111</integer>
- <key>IBOpenObjects</key>
- <array>
- <integer>24</integer>
- <integer>377</integer>
- </array>
- <key>IBSystem Version</key>
- <string>9A399</string>
- <key>targetFramework</key>
- <string>IBCocoaFramework</string>
-</dict>
-</plist>
View
BIN  sample-macruby/AnimatingViews/English.lproj/MainMenu.nib/keyedobjects.nib
Binary file not shown
View
28 sample-macruby/AnimatingViews/Info.plist
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundleIconFile</key>
- <string></string>
- <key>CFBundleIdentifier</key>
- <string>com.yourcompany.AnimatingViews</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>${PRODUCT_NAME}</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>1.0</string>
- <key>NSMainNibFile</key>
- <string>MainMenu</string>
- <key>NSPrincipalClass</key>
- <string>NSApplication</string>
-</dict>
-</plist>
View
126 sample-macruby/AnimatingViews/SimpleLayoutView.rb
@@ -1,126 +0,0 @@
-class SimpleLayoutView < NSView
-
- attr_accessor :boxColorField
-
- # Default separation between items, and default size of added subviews
- SEPARATION = 10.0
- BOXWIDTH = 80.0
- BOXHEIGHT = 80.0
-
- # Layout styles
- ColumnLayout = 0
- RowLayout = 1
- GridLayout = 2
-
- # By default NSColorPanel does not show an alpha (opacity) slider; enable it
- def awakeFromNib
- NSColorPanel.sharedColorPanel.showsAlpha = true
- end
-
- # Start off in column mode
- attr_reader :layoutStyle
- def initWithFrame frame
- if super
- @layoutStyle = ColumnLayout
- end
- return self
- end
-
- def setLayoutStyle style
- if @layoutStyle != style
- @layoutStyle = style
- layout!
- end
- end
-
- # This method returns a rect that is integral in base coordinates
- def integralRect rect
- convertRectFromBase NSIntegralRect(convertRectToBase(rect))
- end
-
- # This method simply computes the new layout, and calls setFrame: on all
- # subview with their locations. Since the calls are made to the subviews'
- # animators, the subview animate to their new locations.
- def layout!
- case @layoutStyle
- when ColumnLayout
- # Starting point: center bottom of view.
- point = NSPoint.new(bounds.size.width / 2.0, 0.0)
- subviews.each do |view|
- # Centered horizontally, stacked higher.
- frame = NSRect.new(NSPoint.new(point.x - BOXWIDTH / 2.0, point.y),
- NSSize.new(BOXWIDTH, BOXHEIGHT))
- view.animator.frame = integralRect(frame)
- # Next view location; we're stacking higher.
- point.y += frame.size.width + SEPARATION
- end
- when RowLayout
- # Starting point: center left edge of view.
- point = NSPoint.new(0.0, bounds.size.height / 2.0)
- subviews.each do |view|
- # Centered vertically, stacked left to right.
- frame = NSRect.new(NSPoint.new(point.x, point.y - BOXHEIGHT / 2.0),
- NSSize.new(BOXWIDTH, BOXHEIGHT))
- view.animator.frame = integralRect(frame)
- # Next view location.
- point.x += frame.size.width + SEPARATION
- end
- when GridLayout
- # Put the views in a roughly square grid.
- viewsPerSide = Math.sqrt(subviews.size).ceil
- i = 0
- # Starting at the bottom left corner.
- point = NSZeroPoint.dup
- subviews.each do |view|
- frame = NSRect.new(NSPoint.new(point.x, point.y),
- NSSize.new(BOXWIDTH, BOXHEIGHT))
- view.animator.frame = integralRect(frame)
- # Stack them horizontally.
- point.x += BOXWIDTH + SEPARATION
- # And if we have enough on this row, move up to the next.
- if (i += 1) % viewsPerSide == 0
- point.x = 0
- point.y += BOXHEIGHT + SEPARATION
- end
- end
- end
- end
-
- # Changing frame (which is what happens when the window is resized) should
- # cause relayout.
- def setFrameSize frame
- super
- layout!
- end
-
- # Create a new view to be added/animated. Any kind of view can be added here,
- # we go for simple colored box using the Leopard "custom" box type.
- def viewToBeAdded
- frame = NSRect.new(NSZeroPoint, NSSize.new(BOXWIDTH, BOXHEIGHT))
- box = NSBox.alloc.initWithFrame frame
- box.boxType = NSBoxCustom
- box.borderType = NSLineBorder
- box.titlePosition = NSNoTitle
- box.fillColor = @boxColorField.color
- return box
- end
-
- # Action methods to add/remove boxes, giving us something to animate.
- # Note that we cause a relayout here; a better design is to relayout in the
- # view automatically on addition/removal of subviews.
- def addABox(sender)
- addSubview viewToBeAdded
- layout!
- end
-
- def removeLastBox(sender)
- subviews.lastObject.removeFromSuperview
- layout!
- end
-
- # Action method to change layout style.
- def changeLayout(sender)
- setLayoutStyle sender.selectedTag
- end
-
-end
View
14 sample-macruby/AnimatingViews/main.m
@@ -1,14 +0,0 @@
-//
-// main.m
-// AnimatingViews
-//
-// Created by Laurent Sansonetti on 3/4/08.
-// Copyright __MyCompanyName__ 2008. All rights reserved.
-//
-
-#import <MacRuby/MacRuby.h>
-
-int main(int argc, char *argv[])
-{
- return macruby_main("rb_main.rb", argc, argv);
-}
View
22 sample-macruby/AnimatingViews/rb_main.rb
@@ -1,22 +0,0 @@
-#
-# rb_main.rb
-# AnimatingViews
-#
-# Created by Laurent Sansonetti on 3/4/08.
-# Copyright __MyCompanyName__ 2008. All rights reserved.
-#
-
-# Loading the Cocoa framework. If you need to load more frameworks, you can
-# do that here too.
-framework 'Cocoa'
-
-# Loading all the Ruby project files.
-dir_path = NSBundle.mainBundle.resourcePath.fileSystemRepresentation
-Dir.entries(dir_path).each do |path|
- if path != File.basename(__FILE__) and path[-3..-1] == '.rb'
- require(path)
- end
-end
-
-# Starting the Cocoa main loop.
-NSApplicationMain(0, nil)
View
200 sample-macruby/CircleView/CircleView.rb
@@ -1,200 +0,0 @@
-
-class CircleView < NSView
-
- # Many of the methods here are similar to those in the simpler DotView example.
- # See that example for detailed explanations; here we will discuss those
- # features that are unique to CircleView.
-
- # CircleView draws text around a circle, using Cocoa's text system for
- # glyph generation and layout, then calculating the positions of glyphs
- # based on that layout, and using NSLayoutManager for drawing.
-
- def initWithFrame(frame)
- super(frame)
-
- # First, we set default values for the various parameters.
- @center = NSPoint.new
- @center.x = frame.size.width / 2.0
- @center.y = frame.size.height / 2.0
- @radius = 115.0
- @startingAngle = @angularVelocity = Math::PI / 2.0
-
- # Next, we create and initialize instances of the three
- # basic non-view components of the text system:
- # an NSTextStorage, an NSLayoutManager, and an NSTextContainer.
- @textStorage = NSTextStorage.alloc.initWithString "Here's to the crazy ones, the misfits, the rebels, the troublemakers, the round pegs in the square holes, the ones who see things differently."
- @layoutManager = NSLayoutManager.new
- @textContainer = NSTextContainer.new
- @layoutManager.addTextContainer @textContainer
- @textStorage.addLayoutManager @layoutManager
-
- # Screen fonts are not suitable for scaled or rotated drawing.
- # Views that use NSLayoutManager directly for text drawing should
- # set this parameter appropriately.
- @layoutManager.usesScreenFonts = false
-
- # Returning a reference to self is mandatory in Cocoa initializers.
- return self
- end
-
- def drawRect(rect)
- NSColor.whiteColor.set
- NSRectFill(bounds)
-
- # Note that usedRectForTextContainer: does not force layout, so it must
- # be called after glyphRangeForTextContainer:, which does force layout.
-
- glyphRange = @layoutManager.glyphRangeForTextContainer @textContainer
- usedRect = @layoutManager.usedRectForTextContainer @textContainer
- context = NSGraphicsContext.currentContext
-
- glyphRange.location.upto(glyphRange.location + glyphRange.length - 1) do |i|
- lineFragmentRect = @layoutManager.lineFragmentRectForGlyphAtIndex i, effectiveRange:nil
- layoutLocation = @layoutManager.locationForGlyphAtIndex(i)
- transform = NSAffineTransform.transform
-
- # Here layoutLocation is the location (in container coordinates) where the glyph was laid out.
- layoutLocation.x += lineFragmentRect.origin.x
- layoutLocation.y += lineFragmentRect.origin.y
-
- # We then use the layoutLocation to calculate an appropriate position for the glyph
- # around the circle (by angle and distance, or viewLocation in rectangular coordinates).
- distance = @radius + usedRect.size.height - layoutLocation.y
- angle = @startingAngle + layoutLocation.x / distance
-
- viewLocation = NSPoint.new
- viewLocation.x = @center.x + distance * Math.sin(angle);
- viewLocation.y = @center.y + distance * Math.cos(angle);
-
- # We use a different affine transform for each glyph, to position and rotate it
- # based on its calculated position around the circle.
- transform.translateXBy viewLocation.x, yBy:viewLocation.y
- transform.rotateByRadians(-angle)
-
- # We save and restore the graphics state so that the transform applies only to this glyph.
- context.saveGraphicsState
- transform.concat
- # drawGlyphsForGlyphRange: draws the glyph at its laid-out location in container coordinates.
- # Since we are using the transform to place the glyph, we subtract the laid-out location here.
- @layoutManager.drawGlyphsForGlyphRange NSRange.new(i, 1), atPoint:NSPoint.new(-layoutLocation.x, -layoutLocation.y)
- context.restoreGraphicsState
- end
- end
-
- def isOpaque
- true
- end
-
- # DotView changes location on mouse up, but here we choose to do so
- # on mouse down and mouse drags, so the text will follow the mouse.
-
- def mouseDown(event)
- centerWithEvent(event)
- end
-
- def mouseDragged(event)
- centerWithEvent(event)
- end
-
- def centerWithEvent(event)
- location = event.locationInWindow
- @center = convertPoint location, fromView:nil
- setNeedsDisplay true
- end
-
- # DotView uses action methods to set its parameters. Here we have
- # factored each of those into a method to set each parameter directly
- # and a separate action method.
-
- def setColor(color)
- # Text drawing uses the attributes set on the text storage rather
- # than drawing context attributes like the current color.
- @textStorage.addAttribute NSForegroundColorAttributeName, value:color, range:NSRange.new(0, @textStorage.length)
- setNeedsDisplay true
- end
-
- def setRadius(distance)
- @radius = distance
- setNeedsDisplay true
- end
-
- def setStartingAngle(angle)
- @startingAngle = angle
- setNeedsDisplay true
- end
-
- def setAngularVelocity(velocity)
- @angularVelocity = velocity
- setNeedsDisplay true
- end
-
- def setString(string)
- @textStorage.replaceCharactersInRange(NSRange.new(0, @textStorage.length), withString:string)
- setNeedsDisplay true
- end
-
- def takeColorFrom(sender)
- setColor sender.color
- end
-
- def takeRadiusFrom(sender)
- setRadius sender.doubleValue
- end
-
- def takeStartingAngleFrom(sender)
- setStartingAngle sender.doubleValue
- end
-
- def takeAngularVelocityFrom(sender)
- setAngularVelocity sender.doubleValue
- end
-
- def takeStringFrom(sender)
- setString sender.stringValue
- end
-
- def startAnimation(sender)
- stopAnimation sender
-
- # We schedule a timer for a desired 30fps animation rate.
- # In performAnimation: we determine exactly
- # how much time has elapsed and animate accordingly.
- @timer = NSTimer.scheduledTimerWithTimeInterval 1.0/30.0,
- target:self,
- selector:'performAnimation:',
- userInfo:nil,
- repeats:true
-
- # The next two lines make sure that animation will continue to occur
- # while modal panels are displayed and while event tracking is taking
- # place (for example, while a slider is being dragged).
- NSRunLoop.currentRunLoop.addTimer @timer, forMode:NSModalPanelRunLoopMode
- NSRunLoop.currentRunLoop.addTimer @timer, forMode:NSEventTrackingRunLoopMode
-
- @lastTime = NSDate.timeIntervalSinceReferenceDate
- end
-
- def stopAnimation(sender)
- if @timer
- @timer.invalidate
- @timer = nil
- end
- end
-
- def toggleAnimation(sender)
- if @timer
- stopAnimation sender
- else
- startAnimation sender
- end
- end
-
- def performAnimation timer
- # We determine how much time has elapsed since the last animation,
- # and we advance the angle accordingly.
- thisTime = NSDate.timeIntervalSinceReferenceDate
- setStartingAngle @startingAngle + @angularVelocity * (thisTime - @lastTime)
- @lastTime = thisTime
- end
-
-end
View
308 sample-macruby/CircleView/CircleView.xcodeproj/project.pbxproj
@@ -1,308 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 44;
- objects = {
-
-/* Begin PBXBuildFile section */
- 4D667B310D791D5400771E47 /* CircleView.rb in Resources */ = {isa = PBXBuildFile; fileRef = 4D667B300D791D5400771E47 /* CircleView.rb */; };
- 4DE339F70D74FCDD00ADB6EE /* rb_main.rb in Resources */ = {isa = PBXBuildFile; fileRef = 4DE339F60D74FCDD00ADB6EE /* rb_main.rb */; };
- 4DE3BDC90D8650CF00ECA448 /* MacRuby.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DE3BDC80D8650CF00ECA448 /* MacRuby.framework */; };
- 8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
- 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
- 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
- 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXFileReference section */
- 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
- 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
- 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
- 29B97319FDCFA39411CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = "<group>"; };
- 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
- 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
- 4D667B300D791D5400771E47 /* CircleView.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = CircleView.rb; sourceTree = "<group>"; };
- 4DE339F60D74FCDD00ADB6EE /* rb_main.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = rb_main.rb; sourceTree = "<group>"; };
- 4DE3BDC80D8650CF00ECA448 /* MacRuby.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MacRuby.framework; path = /Library/Frameworks/MacRuby.framework; sourceTree = "<absolute>"; };
- 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
- 8D1107320486CEB800E47090 /* CircleView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CircleView.app; sourceTree = BUILT_PRODUCTS_DIR; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 8D11072E0486CEB800E47090 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
- 4DE3BDC90D8650CF00ECA448 /* MacRuby.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 080E96DDFE201D6D7F000001 /* Classes */ = {
- isa = PBXGroup;
- children = (
- 4D667B300D791D5400771E47 /* CircleView.rb */,
- );
- name = Classes;
- sourceTree = "<group>";
- };
- 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
- isa = PBXGroup;
- children = (
- 4DE3BDC80D8650CF00ECA448 /* MacRuby.framework */,
- 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
- );
- name = "Linked Frameworks";
- sourceTree = "<group>";
- };
- 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
- isa = PBXGroup;
- children = (
- 29B97324FDCFA39411CA2CEA /* AppKit.framework */,
- 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
- 29B97325FDCFA39411CA2CEA /* Foundation.framework */,
- );
- name = "Other Frameworks";
- sourceTree = "<group>";
- };
- 19C28FACFE9D520D11CA2CBB /* Products */ = {
- isa = PBXGroup;
- children = (
- 8D1107320486CEB800E47090 /* CircleView.app */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- 29B97314FDCFA39411CA2CEA /* CircleView */ = {
- isa = PBXGroup;
- children = (
- 080E96DDFE201D6D7F000001 /* Classes */,
- 29B97315FDCFA39411CA2CEA /* Other Sources */,
- 29B97317FDCFA39411CA2CEA /* Resources */,
- 29B97323FDCFA39411CA2CEA /* Frameworks */,
- 19C28FACFE9D520D11CA2CBB /* Products */,
- );
- name = CircleView;
- sourceTree = "<group>";
- };
- 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
- isa = PBXGroup;
- children = (
- 4DE339F60D74FCDD00ADB6EE /* rb_main.rb */,
- 29B97316FDCFA39411CA2CEA /* main.m */,
- );
- name = "Other Sources";
- sourceTree = "<group>";
- };
- 29B97317FDCFA39411CA2CEA /* Resources */ = {
- isa = PBXGroup;
- children = (
- 8D1107310486CEB800E47090 /* Info.plist */,
- 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
- 29B97318FDCFA39411CA2CEA /* MainMenu.nib */,
- );
- name = Resources;
- sourceTree = "<group>";
- };
- 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
- isa = PBXGroup;
- children = (
- 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
- 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
- );
- name = Frameworks;
- sourceTree = "<group>";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 8D1107260486CEB800E47090 /* CircleView */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "CircleView" */;
- buildPhases = (
- 8D1107290486CEB800E47090 /* Resources */,
- 8D11072C0486CEB800E47090 /* Sources */,
- 8D11072E0486CEB800E47090 /* Frameworks */,
- 4D667B0A0D791CCE00771E47 /* ShellScript */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = CircleView;
- productInstallPath = "$(HOME)/Applications";
- productName = CircleView;
- productReference = 8D1107320486CEB800E47090 /* CircleView.app */;
- productType = "com.apple.product-type.application";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 29B97313FDCFA39411CA2CEA /* Project object */ = {
- isa = PBXProject;
- buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CircleView" */;
- compatibilityVersion = "Xcode 3.0";
- hasScannedForEncodings = 1;
- mainGroup = 29B97314FDCFA39411CA2CEA /* CircleView */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 8D1107260486CEB800E47090 /* CircleView */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
- 8D1107290486CEB800E47090 /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */,
- 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
- 4DE339F70D74FCDD00ADB6EE /* rb_main.rb in Resources */,
- 4D667B310D791D5400771E47 /* CircleView.rb in Resources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXShellScriptBuildPhase section */
- 4D667B0A0D791CCE00771E47 /* ShellScript */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "export ";
- };
-/* End PBXShellScriptBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
- 8D11072C0486CEB800E47090 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 8D11072D0486CEB800E47090 /* main.m in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXVariantGroup section */
- 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
- isa = PBXVariantGroup;
- children = (
- 089C165DFE840E0CC02AAC07 /* English */,
- );
- name = InfoPlist.strings;
- sourceTree = "<group>";
- };
- 29B97318FDCFA39411CA2CEA /* MainMenu.nib */ = {
- isa = PBXVariantGroup;
- children = (
- 29B97319FDCFA39411CA2CEA /* English */,
- );
- name = MainMenu.nib;
- sourceTree = "<group>";
- };
-/* End PBXVariantGroup section */
-
-/* Begin XCBuildConfiguration section */
- C01FCF4B08A954540054247B /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = YES;
- GCC_MODEL_TUNING = G5;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- INFOPLIST_FILE = Info.plist;
- INSTALL_PATH = "$(HOME)/Applications";
- PRODUCT_NAME = CircleView;
- WRAPPER_EXTENSION = app;
- ZERO_LINK = YES;
- };
- name = Debug;
- };
- C01FCF4C08A954540054247B /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_MODEL_TUNING = G5;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- INFOPLIST_FILE = Info.plist;
- INSTALL_PATH = "$(HOME)/Applications";
- PRODUCT_NAME = CircleView;
- WRAPPER_EXTENSION = app;
- };
- name = Release;
- };
- C01FCF4F08A954540054247B /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ARCHS = "$(NATIVE_ARCH_ACTUAL)";
- GCC_ENABLE_OBJC_GC = required;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- HEADER_SEARCH_PATHS = "";
- LIBRARY_SEARCH_PATHS = "";
- OTHER_CFLAGS = "";
- OTHER_CPLUSPLUSFLAGS = "";
- OTHER_LDFLAGS = "";
- PREBINDING = NO;
- };
- name = Debug;
- };
- C01FCF5008A954540054247B /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ARCHS = "$(NATIVE_ARCH_ACTUAL)";
- GCC_ENABLE_OBJC_GC = required;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- HEADER_SEARCH_PATHS = "";
- LIBRARY_SEARCH_PATHS = "";
- OTHER_CFLAGS = "";
- OTHER_CPLUSPLUSFLAGS = "";
- OTHER_LDFLAGS = "";
- PREBINDING = NO;
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "CircleView" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- C01FCF4B08A954540054247B /* Debug */,
- C01FCF4C08A954540054247B /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CircleView" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- C01FCF4F08A954540054247B /* Debug */,
- C01FCF5008A954540054247B /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
-}
View
BIN  sample-macruby/CircleView/English.lproj/InfoPlist.strings
Binary file not shown
View
26 sample-macruby/CircleView/English.lproj/MainMenu.nib/classes.nib
@@ -1,26 +0,0 @@
-{
- IBClasses = (
- {
- ACTIONS = {
- startAnimation = id;
- stopAnimation = id;
- takeAngularVelocityFrom = id;
- takeColorFrom = id;
- takeRadiusFrom = id;
- takeStartingAngleFrom = id;
- takeStringFrom = id;
- toggleAnimation = id;
- };
- CLASS = CircleView;
- LANGUAGE = ObjC;
- SUPERCLASS = NSView;
- },
- {
- ACTIONS = {showHelp = id; };
- CLASS = FirstResponder;
- LANGUAGE = ObjC;
- SUPERCLASS = NSObject;
- }
- );
- IBVersion = 1;
-}
View
20 sample-macruby/CircleView/English.lproj/MainMenu.nib/info.nib
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>IBEditorPositions</key>
- <dict>
- <key>29</key>
- <string>146 255 133 44 0 0 1440 878 </string>
- </dict>
- <key>IBFramework Version</key>
- <string>326.0</string>
- <key>IBOpenObjects</key>
- <array>
- <integer>29</integer>
- <integer>21</integer>
- </array>
- <key>IBSystem Version</key>
- <string>7A181</string>
-</dict>
-</plist>
View
BIN  sample-macruby/CircleView/English.lproj/MainMenu.nib/objects.nib
Binary file not shown
View
28 sample-macruby/CircleView/Info.plist
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundleIconFile</key>
- <string></string>
- <key>CFBundleIdentifier</key>
- <string>com.yourcompany.CircleView</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>${PRODUCT_NAME}</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>1.0</string>
- <key>NSMainNibFile</key>
- <string>MainMenu</string>
- <key>NSPrincipalClass</key>
- <string>NSApplication</string>
-</dict>
-</plist>
View
14 sample-macruby/CircleView/main.m
@@ -1,14 +0,0 @@
-//
-// main.m
-// CircleView
-//
-// Created by Laurent Sansonetti on 2/29/08.
-// Copyright __MyCompanyName__ 2008. All rights reserved.
-//
-
-#import <MacRuby/MacRuby.h>
-
-int main(int argc, char *argv[])
-{
- return macruby_main("rb_main.rb", argc, argv);
-}
View
22 sample-macruby/CircleView/rb_main.rb
@@ -1,22 +0,0 @@
-#
-# rb_main.rb
-# CircleView
-#
-# Created by Laurent Sansonetti on 2/29/08.
-# Copyright __MyCompanyName__ 2008. All rights reserved.
-#
-
-# Loading the Cocoa framework. If you need to load more frameworks, you can
-# do that here too.
-framework 'Cocoa'
-
-# Loading all the Ruby project files.
-dir_path = NSBundle.mainBundle.resourcePath.fileSystemRepresentation
-Dir.entries(dir_path).each do |path|
- if path != File.basename(__FILE__) and path[-3..-1] == '.rb'
- require(path)
- end
-end
-
-# Starting the Cocoa main loop.
-NSApplicationMain(0, nil)
View
27 sample-macruby/DTrace/collected_objects.d
@@ -1,27 +0,0 @@
-#!/usr/sbin/dtrace -s
-
-/* This script should be run against MacRuby 32-bit */
-
-#pragma D option quiet
-
-BEGIN
-{
- printf("Target pid: %d\n\n", $target);
-}
-
-objc$target::-finalize:entry
-{
- isaptr = *(uint32_t *)copyin(arg0, 4);
- classnameptr = *(uint32_t *)copyin(isaptr + 8, 4);
- classname = copyinstr(classnameptr);
-
- @[classname] = count();
-}
-
-END
-{
- printf("\n");
- printf("%50s %-10s\n", "CLASS", "COUNT");
- printf("--------------------------------------------------------------------------------\n");
- printa("%50s %-10@d\n", @);
-}
View
29 sample-macruby/DTrace/collected_objects64.d
@@ -1,29 +0,0 @@
-#!/usr/sbin/dtrace -s
-
-/* This script should be run against MacRuby 64-bit */
-
-#pragma D option quiet
-
-BEGIN
-{
- printf("Target pid: %d\n\n", $target);
-}
-
-objc$target::-finalize:entry
-{
- isaptr = *(uint64_t *)copyin(arg0, 8);
- class_rw_t = *(uint64_t *)copyin(isaptr + (4 * 8), 8);
- class_ro_t = *(uint64_t *)copyin(class_rw_t + (2 * 4), 8);
- classnameptr = *(uint64_t *)copyin(class_ro_t + (4 * 4) + 8, 8);
- classname = copyinstr(classnameptr);
-
- @[classname] = count();
-}
-
-END
-{
- printf("\n");
- printf("%50s %-10s\n", "CLASS", "COUNT");
- printf("--------------------------------------------------------------------------------\n");
- printa("%50s %-10@d\n", @);
-}
View
22 sample-macruby/DTrace/gc.d
@@ -1,22 +0,0 @@
-#!/usr/sbin/dtrace -s
-
-#pragma D option quiet
-
-BEGIN
-{
- printf("Target pid: %d\n\n", $target);
- printf("%-10s %-10s %-10s %-10s\n", "OBJECTS", "BYTES", "DURATION", "TYPE");
- printf("--------------------------------------------------------------------------------\n");
-}
-
-pid$target::auto_trace_collection_begin:entry
-{
- self->starttime = walltimestamp / 1000;
-}
-
-pid$target::auto_trace_collection_end:entry
-{
- printf("%-10d %-10d %-10d %-10s\n", arg2, arg3,
- (walltimestamp / 1000) - self->starttime,
- arg1 ? "generational" : "full");
-}
View
24 sample-macruby/DTrace/methods_count.d
@@ -1,24 +0,0 @@
-#!/usr/sbin/dtrace -s
-
-#pragma D option quiet
-
-BEGIN
-{
- printf("Target pid: %d\n\n", $target);
-}
-
-macruby$target:::method-entry
-{
-/* printf("%30s:%-5d %s#%s\n", copyinstr(arg2), arg3,
- copyinstr(arg0), copyinstr(arg1));
-*/
- @methods_count[copyinstr(arg0), copyinstr(arg1)] = count();
-}
-
-END
-{
- printf("\n");
- printf("%30s %-30s %s\n", "CLASS", "METHOD", "COUNT");
- printf("--------------------------------------------------------------------------------\n");
- printa("%30s %-30s %@d\n", @methods_count);
-}
View
23 sample-macruby/DTrace/methods_duration.d
@@ -1,23 +0,0 @@
-#!/usr/sbin/dtrace -s
-
-#pragma D option quiet
-
-BEGIN
-{
- printf("Target pid: %d\n\n", $target);
- printf("%20s %-5s %10s %-30s %10s\n", "FILE", "LINE", "CLASS", "METHOD",
- "DURATION");
- printf("--------------------------------------------------------------------------------\n");
-}