hotcocoa 0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. data/History.txt +4 -0
  2. data/bin/hotcocoa +31 -0
  3. data/lib/hotcocoa/application_builder.rb +320 -0
  4. data/lib/hotcocoa/attributed_string.rb +143 -0
  5. data/lib/hotcocoa/behaviors.rb +7 -0
  6. data/lib/hotcocoa/data_sources/combo_box_data_source.rb +44 -0
  7. data/lib/hotcocoa/data_sources/table_data_source.rb +18 -0
  8. data/lib/hotcocoa/delegate_builder.rb +85 -0
  9. data/lib/hotcocoa/graphics/canvas.rb +836 -0
  10. data/lib/hotcocoa/graphics/color.rb +781 -0
  11. data/lib/hotcocoa/graphics/elements/particle.rb +75 -0
  12. data/lib/hotcocoa/graphics/elements/rope.rb +99 -0
  13. data/lib/hotcocoa/graphics/elements/sandpainter.rb +71 -0
  14. data/lib/hotcocoa/graphics/gradient.rb +63 -0
  15. data/lib/hotcocoa/graphics/image.rb +488 -0
  16. data/lib/hotcocoa/graphics/path.rb +325 -0
  17. data/lib/hotcocoa/graphics/pdf.rb +71 -0
  18. data/lib/hotcocoa/graphics.rb +161 -0
  19. data/lib/hotcocoa/kernel_ext.rb +14 -0
  20. data/lib/hotcocoa/kvo_accessors.rb +48 -0
  21. data/lib/hotcocoa/layout_view.rb +448 -0
  22. data/lib/hotcocoa/mapper.rb +227 -0
  23. data/lib/hotcocoa/mapping_methods.rb +40 -0
  24. data/lib/hotcocoa/mappings/alert.rb +25 -0
  25. data/lib/hotcocoa/mappings/application.rb +112 -0
  26. data/lib/hotcocoa/mappings/array_controller.rb +87 -0
  27. data/lib/hotcocoa/mappings/box.rb +39 -0
  28. data/lib/hotcocoa/mappings/button.rb +92 -0
  29. data/lib/hotcocoa/mappings/collection_view.rb +44 -0
  30. data/lib/hotcocoa/mappings/color.rb +28 -0
  31. data/lib/hotcocoa/mappings/column.rb +21 -0
  32. data/lib/hotcocoa/mappings/combo_box.rb +24 -0
  33. data/lib/hotcocoa/mappings/control.rb +33 -0
  34. data/lib/hotcocoa/mappings/font.rb +44 -0
  35. data/lib/hotcocoa/mappings/gradient.rb +15 -0
  36. data/lib/hotcocoa/mappings/image.rb +15 -0
  37. data/lib/hotcocoa/mappings/image_view.rb +43 -0
  38. data/lib/hotcocoa/mappings/label.rb +25 -0
  39. data/lib/hotcocoa/mappings/layout_view.rb +9 -0
  40. data/lib/hotcocoa/mappings/menu.rb +71 -0
  41. data/lib/hotcocoa/mappings/menu_item.rb +47 -0
  42. data/lib/hotcocoa/mappings/movie.rb +13 -0
  43. data/lib/hotcocoa/mappings/movie_view.rb +27 -0
  44. data/lib/hotcocoa/mappings/notification.rb +17 -0
  45. data/lib/hotcocoa/mappings/popup.rb +110 -0
  46. data/lib/hotcocoa/mappings/progress_indicator.rb +68 -0
  47. data/lib/hotcocoa/mappings/scroll_view.rb +29 -0
  48. data/lib/hotcocoa/mappings/search_field.rb +9 -0
  49. data/lib/hotcocoa/mappings/secure_text_field.rb +17 -0
  50. data/lib/hotcocoa/mappings/segmented_control.rb +97 -0
  51. data/lib/hotcocoa/mappings/slider.rb +25 -0
  52. data/lib/hotcocoa/mappings/sort_descriptor.rb +13 -0
  53. data/lib/hotcocoa/mappings/sound.rb +9 -0
  54. data/lib/hotcocoa/mappings/speech_synthesizer.rb +25 -0
  55. data/lib/hotcocoa/mappings/split_view.rb +21 -0
  56. data/lib/hotcocoa/mappings/status_bar.rb +7 -0
  57. data/lib/hotcocoa/mappings/status_item.rb +9 -0
  58. data/lib/hotcocoa/mappings/table_view.rb +110 -0
  59. data/lib/hotcocoa/mappings/text_field.rb +41 -0
  60. data/lib/hotcocoa/mappings/text_view.rb +13 -0
  61. data/lib/hotcocoa/mappings/timer.rb +25 -0
  62. data/lib/hotcocoa/mappings/toolbar.rb +97 -0
  63. data/lib/hotcocoa/mappings/toolbar_item.rb +36 -0
  64. data/lib/hotcocoa/mappings/view.rb +67 -0
  65. data/lib/hotcocoa/mappings/web_view.rb +22 -0
  66. data/lib/hotcocoa/mappings/window.rb +118 -0
  67. data/lib/hotcocoa/mappings/xml_parser.rb +41 -0
  68. data/lib/hotcocoa/mappings.rb +109 -0
  69. data/lib/hotcocoa/mvc.rb +175 -0
  70. data/lib/hotcocoa/notification_listener.rb +62 -0
  71. data/lib/hotcocoa/object_ext.rb +22 -0
  72. data/lib/hotcocoa/plist.rb +45 -0
  73. data/lib/hotcocoa/standard_rake_tasks.rb +17 -0
  74. data/lib/hotcocoa/template.rb +27 -0
  75. data/lib/hotcocoa/virtual_file_system.rb +172 -0
  76. data/lib/hotcocoa.rb +26 -0
  77. data/template/Rakefile +5 -0
  78. data/template/config/build.yml +8 -0
  79. data/template/lib/application.rb +45 -0
  80. data/template/lib/menu.rb +32 -0
  81. data/template/resources/HotCocoa.icns +0 -0
  82. data/test/test_helper.rb +3 -0
  83. data/test/test_hotcocoa.rb +11 -0
  84. metadata +137 -0
@@ -0,0 +1,45 @@
1
+ require 'rubygems'
2
+ require 'hotcocoa'
3
+
4
+ # Replace the following code with your own hotcocoa code
5
+
6
+ class Application
7
+
8
+ include HotCocoa
9
+
10
+ def start
11
+ application :name => "__APPLICATION_NAME__" do |app|
12
+ app.delegate = self
13
+ window :frame => [100, 100, 500, 500], :title => "__APPLICATION_NAME__" do |win|
14
+ win << label(:text => "Hello from HotCocoa", :layout => {:start => false})
15
+ win.will_close { exit }
16
+ end
17
+ end
18
+ end
19
+
20
+ # file/open
21
+ def on_open(menu)
22
+ end
23
+
24
+ # file/new
25
+ def on_new(menu)
26
+ end
27
+
28
+ # help menu item
29
+ def on_help(menu)
30
+ end
31
+
32
+ # This is commented out, so the minimize menu item is disabled
33
+ #def on_minimize(menu)
34
+ #end
35
+
36
+ # window/zoom
37
+ def on_zoom(menu)
38
+ end
39
+
40
+ # window/bring_all_to_front
41
+ def on_bring_all_to_front(menu)
42
+ end
43
+ end
44
+
45
+ Application.new.start
@@ -0,0 +1,32 @@
1
+ module HotCocoa
2
+ def application_menu
3
+ menu do |main|
4
+ main.submenu :apple do |apple|
5
+ apple.item :about, :title => "About #{NSApp.name}"
6
+ apple.separator
7
+ apple.item :preferences, :key => ","
8
+ apple.separator
9
+ apple.submenu :services
10
+ apple.separator
11
+ apple.item :hide, :title => "Hide #{NSApp.name}", :key => "h"
12
+ apple.item :hide_others, :title => "Hide Others", :key => "h", :modifiers => [:command, :alt]
13
+ apple.item :show_all, :title => "Show All"
14
+ apple.separator
15
+ apple.item :quit, :title => "Quit #{NSApp.name}", :key => "q"
16
+ end
17
+ main.submenu :file do |file|
18
+ file.item :new, :key => "n"
19
+ file.item :open, :key => "o"
20
+ end
21
+ main.submenu :window do |win|
22
+ win.item :minimize, :key => "m"
23
+ win.item :zoom
24
+ win.separator
25
+ win.item :bring_all_to_front, :title => "Bring All to Front", :key => "o"
26
+ end
27
+ main.submenu :help do |help|
28
+ help.item :help, :title => "#{NSApp.name} Help"
29
+ end
30
+ end
31
+ end
32
+ end
Binary file
@@ -0,0 +1,3 @@
1
+ require 'stringio'
2
+ require 'test/unit'
3
+ require File.dirname(__FILE__) + '/../lib/hotcocoa'
@@ -0,0 +1,11 @@
1
+ require File.dirname(__FILE__) + '/test_helper.rb'
2
+
3
+ class TestHotcocoa < Test::Unit::TestCase
4
+
5
+ def setup
6
+ end
7
+
8
+ def test_truth
9
+ assert true
10
+ end
11
+ end
metadata ADDED
@@ -0,0 +1,137 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hotcocoa
3
+ version: !ruby/object:Gem::Version
4
+ version: "0.5"
5
+ platform: ruby
6
+ authors:
7
+ - Richard Kilmer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2010-01-20 00:00:00 -05:00
13
+ default_executable: hotcocoa
14
+ dependencies: []
15
+
16
+ description: HotCocoa is a Cococa mapping library for MacRuby. It simplifies the use of complex Cocoa classes using DSL techniques.
17
+ email: rich@infoether.com
18
+ executables:
19
+ - hotcocoa
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
24
+ files:
25
+ - lib/hotcocoa/application_builder.rb
26
+ - lib/hotcocoa/attributed_string.rb
27
+ - lib/hotcocoa/behaviors.rb
28
+ - lib/hotcocoa/data_sources/combo_box_data_source.rb
29
+ - lib/hotcocoa/data_sources/table_data_source.rb
30
+ - lib/hotcocoa/delegate_builder.rb
31
+ - lib/hotcocoa/graphics/canvas.rb
32
+ - lib/hotcocoa/graphics/color.rb
33
+ - lib/hotcocoa/graphics/elements/particle.rb
34
+ - lib/hotcocoa/graphics/elements/rope.rb
35
+ - lib/hotcocoa/graphics/elements/sandpainter.rb
36
+ - lib/hotcocoa/graphics/gradient.rb
37
+ - lib/hotcocoa/graphics/image.rb
38
+ - lib/hotcocoa/graphics/path.rb
39
+ - lib/hotcocoa/graphics/pdf.rb
40
+ - lib/hotcocoa/graphics.rb
41
+ - lib/hotcocoa/kernel_ext.rb
42
+ - lib/hotcocoa/kvo_accessors.rb
43
+ - lib/hotcocoa/layout_view.rb
44
+ - lib/hotcocoa/mapper.rb
45
+ - lib/hotcocoa/mapping_methods.rb
46
+ - lib/hotcocoa/mappings/alert.rb
47
+ - lib/hotcocoa/mappings/application.rb
48
+ - lib/hotcocoa/mappings/array_controller.rb
49
+ - lib/hotcocoa/mappings/box.rb
50
+ - lib/hotcocoa/mappings/button.rb
51
+ - lib/hotcocoa/mappings/collection_view.rb
52
+ - lib/hotcocoa/mappings/color.rb
53
+ - lib/hotcocoa/mappings/column.rb
54
+ - lib/hotcocoa/mappings/combo_box.rb
55
+ - lib/hotcocoa/mappings/control.rb
56
+ - lib/hotcocoa/mappings/font.rb
57
+ - lib/hotcocoa/mappings/gradient.rb
58
+ - lib/hotcocoa/mappings/image.rb
59
+ - lib/hotcocoa/mappings/image_view.rb
60
+ - lib/hotcocoa/mappings/label.rb
61
+ - lib/hotcocoa/mappings/layout_view.rb
62
+ - lib/hotcocoa/mappings/menu.rb
63
+ - lib/hotcocoa/mappings/menu_item.rb
64
+ - lib/hotcocoa/mappings/movie.rb
65
+ - lib/hotcocoa/mappings/movie_view.rb
66
+ - lib/hotcocoa/mappings/notification.rb
67
+ - lib/hotcocoa/mappings/popup.rb
68
+ - lib/hotcocoa/mappings/progress_indicator.rb
69
+ - lib/hotcocoa/mappings/scroll_view.rb
70
+ - lib/hotcocoa/mappings/search_field.rb
71
+ - lib/hotcocoa/mappings/secure_text_field.rb
72
+ - lib/hotcocoa/mappings/segmented_control.rb
73
+ - lib/hotcocoa/mappings/slider.rb
74
+ - lib/hotcocoa/mappings/sort_descriptor.rb
75
+ - lib/hotcocoa/mappings/sound.rb
76
+ - lib/hotcocoa/mappings/speech_synthesizer.rb
77
+ - lib/hotcocoa/mappings/split_view.rb
78
+ - lib/hotcocoa/mappings/status_bar.rb
79
+ - lib/hotcocoa/mappings/status_item.rb
80
+ - lib/hotcocoa/mappings/table_view.rb
81
+ - lib/hotcocoa/mappings/text_field.rb
82
+ - lib/hotcocoa/mappings/text_view.rb
83
+ - lib/hotcocoa/mappings/timer.rb
84
+ - lib/hotcocoa/mappings/toolbar.rb
85
+ - lib/hotcocoa/mappings/toolbar_item.rb
86
+ - lib/hotcocoa/mappings/view.rb
87
+ - lib/hotcocoa/mappings/web_view.rb
88
+ - lib/hotcocoa/mappings/window.rb
89
+ - lib/hotcocoa/mappings/xml_parser.rb
90
+ - lib/hotcocoa/mappings.rb
91
+ - lib/hotcocoa/mvc.rb
92
+ - lib/hotcocoa/notification_listener.rb
93
+ - lib/hotcocoa/object_ext.rb
94
+ - lib/hotcocoa/plist.rb
95
+ - lib/hotcocoa/standard_rake_tasks.rb
96
+ - lib/hotcocoa/template.rb
97
+ - lib/hotcocoa/virtual_file_system.rb
98
+ - lib/hotcocoa.rb
99
+ - template/config/build.yml
100
+ - template/lib/application.rb
101
+ - template/lib/menu.rb
102
+ - template/Rakefile
103
+ - template/resources/HotCocoa.icns
104
+ - test/test_helper.rb
105
+ - test/test_hotcocoa.rb
106
+ - bin/hotcocoa
107
+ - History.txt
108
+ has_rdoc: true
109
+ homepage: http://github.com/richkilmer/hotcocoa
110
+ licenses: []
111
+
112
+ post_install_message:
113
+ rdoc_options: []
114
+
115
+ require_paths:
116
+ - lib
117
+ required_ruby_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ version: "0"
122
+ version:
123
+ required_rubygems_version: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - ">="
126
+ - !ruby/object:Gem::Version
127
+ version: "0"
128
+ version:
129
+ requirements: []
130
+
131
+ rubyforge_project: hotcocoa
132
+ rubygems_version: 1.3.5
133
+ signing_key:
134
+ specification_version: 3
135
+ summary: Cococa mapping library for MacRuby
136
+ test_files: []
137
+