hotcocoa 0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/bin/hotcocoa +31 -0
- data/lib/hotcocoa/application_builder.rb +320 -0
- data/lib/hotcocoa/attributed_string.rb +143 -0
- data/lib/hotcocoa/behaviors.rb +7 -0
- data/lib/hotcocoa/data_sources/combo_box_data_source.rb +44 -0
- data/lib/hotcocoa/data_sources/table_data_source.rb +18 -0
- data/lib/hotcocoa/delegate_builder.rb +85 -0
- data/lib/hotcocoa/graphics/canvas.rb +836 -0
- data/lib/hotcocoa/graphics/color.rb +781 -0
- data/lib/hotcocoa/graphics/elements/particle.rb +75 -0
- data/lib/hotcocoa/graphics/elements/rope.rb +99 -0
- data/lib/hotcocoa/graphics/elements/sandpainter.rb +71 -0
- data/lib/hotcocoa/graphics/gradient.rb +63 -0
- data/lib/hotcocoa/graphics/image.rb +488 -0
- data/lib/hotcocoa/graphics/path.rb +325 -0
- data/lib/hotcocoa/graphics/pdf.rb +71 -0
- data/lib/hotcocoa/graphics.rb +161 -0
- data/lib/hotcocoa/kernel_ext.rb +14 -0
- data/lib/hotcocoa/kvo_accessors.rb +48 -0
- data/lib/hotcocoa/layout_view.rb +448 -0
- data/lib/hotcocoa/mapper.rb +227 -0
- data/lib/hotcocoa/mapping_methods.rb +40 -0
- data/lib/hotcocoa/mappings/alert.rb +25 -0
- data/lib/hotcocoa/mappings/application.rb +112 -0
- data/lib/hotcocoa/mappings/array_controller.rb +87 -0
- data/lib/hotcocoa/mappings/box.rb +39 -0
- data/lib/hotcocoa/mappings/button.rb +92 -0
- data/lib/hotcocoa/mappings/collection_view.rb +44 -0
- data/lib/hotcocoa/mappings/color.rb +28 -0
- data/lib/hotcocoa/mappings/column.rb +21 -0
- data/lib/hotcocoa/mappings/combo_box.rb +24 -0
- data/lib/hotcocoa/mappings/control.rb +33 -0
- data/lib/hotcocoa/mappings/font.rb +44 -0
- data/lib/hotcocoa/mappings/gradient.rb +15 -0
- data/lib/hotcocoa/mappings/image.rb +15 -0
- data/lib/hotcocoa/mappings/image_view.rb +43 -0
- data/lib/hotcocoa/mappings/label.rb +25 -0
- data/lib/hotcocoa/mappings/layout_view.rb +9 -0
- data/lib/hotcocoa/mappings/menu.rb +71 -0
- data/lib/hotcocoa/mappings/menu_item.rb +47 -0
- data/lib/hotcocoa/mappings/movie.rb +13 -0
- data/lib/hotcocoa/mappings/movie_view.rb +27 -0
- data/lib/hotcocoa/mappings/notification.rb +17 -0
- data/lib/hotcocoa/mappings/popup.rb +110 -0
- data/lib/hotcocoa/mappings/progress_indicator.rb +68 -0
- data/lib/hotcocoa/mappings/scroll_view.rb +29 -0
- data/lib/hotcocoa/mappings/search_field.rb +9 -0
- data/lib/hotcocoa/mappings/secure_text_field.rb +17 -0
- data/lib/hotcocoa/mappings/segmented_control.rb +97 -0
- data/lib/hotcocoa/mappings/slider.rb +25 -0
- data/lib/hotcocoa/mappings/sort_descriptor.rb +13 -0
- data/lib/hotcocoa/mappings/sound.rb +9 -0
- data/lib/hotcocoa/mappings/speech_synthesizer.rb +25 -0
- data/lib/hotcocoa/mappings/split_view.rb +21 -0
- data/lib/hotcocoa/mappings/status_bar.rb +7 -0
- data/lib/hotcocoa/mappings/status_item.rb +9 -0
- data/lib/hotcocoa/mappings/table_view.rb +110 -0
- data/lib/hotcocoa/mappings/text_field.rb +41 -0
- data/lib/hotcocoa/mappings/text_view.rb +13 -0
- data/lib/hotcocoa/mappings/timer.rb +25 -0
- data/lib/hotcocoa/mappings/toolbar.rb +97 -0
- data/lib/hotcocoa/mappings/toolbar_item.rb +36 -0
- data/lib/hotcocoa/mappings/view.rb +67 -0
- data/lib/hotcocoa/mappings/web_view.rb +22 -0
- data/lib/hotcocoa/mappings/window.rb +118 -0
- data/lib/hotcocoa/mappings/xml_parser.rb +41 -0
- data/lib/hotcocoa/mappings.rb +109 -0
- data/lib/hotcocoa/mvc.rb +175 -0
- data/lib/hotcocoa/notification_listener.rb +62 -0
- data/lib/hotcocoa/object_ext.rb +22 -0
- data/lib/hotcocoa/plist.rb +45 -0
- data/lib/hotcocoa/standard_rake_tasks.rb +17 -0
- data/lib/hotcocoa/template.rb +27 -0
- data/lib/hotcocoa/virtual_file_system.rb +172 -0
- data/lib/hotcocoa.rb +26 -0
- data/template/Rakefile +5 -0
- data/template/config/build.yml +8 -0
- data/template/lib/application.rb +45 -0
- data/template/lib/menu.rb +32 -0
- data/template/resources/HotCocoa.icns +0 -0
- data/test/test_helper.rb +3 -0
- data/test/test_hotcocoa.rb +11 -0
- 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
|
data/test/test_helper.rb
ADDED
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
|
+
|