[macruby-changes] [256] MacRuby/branches/testing/sample-macruby
source_changes at macosforge.org
source_changes at macosforge.org
Thu Jun 5 22:23:11 PDT 2008
Revision: 256
http://trac.macosforge.org/projects/ruby/changeset/256
Author: lsansonetti at apple.com
Date: 2008-06-05 22:23:10 -0700 (Thu, 05 Jun 2008)
Log Message:
-----------
merged from trunk
Modified Paths:
--------------
MacRuby/branches/testing/sample-macruby/About MacRuby Examples.rtf
MacRuby/branches/testing/sample-macruby/CircleView/CircleView.rb
MacRuby/branches/testing/sample-macruby/CircleView/main.m
Added Paths:
-----------
MacRuby/branches/testing/sample-macruby/PhotocastViewer/
MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/
MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/InfoPlist.strings
MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/
MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/classes.nib
MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/info.nib
MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/keyedobjects.nib
MacRuby/branches/testing/sample-macruby/PhotocastViewer/Info.plist
MacRuby/branches/testing/sample-macruby/PhotocastViewer/PhotocastViewer.xcodeproj/
MacRuby/branches/testing/sample-macruby/PhotocastViewer/PhotocastViewer.xcodeproj/project.pbxproj
MacRuby/branches/testing/sample-macruby/PhotocastViewer/PhotocastViewerController.rb
MacRuby/branches/testing/sample-macruby/PhotocastViewer/main.m
MacRuby/branches/testing/sample-macruby/PhotocastViewer/rb_main.rb
MacRuby/branches/testing/sample-macruby/Scripts/darkroom.rb
MacRuby/branches/testing/sample-macruby/Scripts/pdf2tiff.rb
MacRuby/branches/testing/sample-macruby/ViewModelDemo/
MacRuby/branches/testing/sample-macruby/ViewModelDemo/Controller.rb
MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/
MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/InfoPlist.strings
MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/
MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/classes.nib
MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/info.nib
MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/objects.nib
MacRuby/branches/testing/sample-macruby/ViewModelDemo/Info.plist
MacRuby/branches/testing/sample-macruby/ViewModelDemo/Superview.rb
MacRuby/branches/testing/sample-macruby/ViewModelDemo/ViewModel.rb
MacRuby/branches/testing/sample-macruby/ViewModelDemo/ViewModelDemo.xcodeproj/
MacRuby/branches/testing/sample-macruby/ViewModelDemo/ViewModelDemo.xcodeproj/project.pbxproj
MacRuby/branches/testing/sample-macruby/ViewModelDemo/main.m
MacRuby/branches/testing/sample-macruby/ViewModelDemo/rb_main.rb
Removed Paths:
-------------
MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/
MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/InfoPlist.strings
MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/
MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/classes.nib
MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/info.nib
MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/keyedobjects.nib
MacRuby/branches/testing/sample-macruby/PhotocastViewer/Info.plist
MacRuby/branches/testing/sample-macruby/PhotocastViewer/PhotocastViewer.xcodeproj/
MacRuby/branches/testing/sample-macruby/PhotocastViewer/PhotocastViewer.xcodeproj/project.pbxproj
MacRuby/branches/testing/sample-macruby/PhotocastViewer/PhotocastViewerController.rb
MacRuby/branches/testing/sample-macruby/PhotocastViewer/main.m
MacRuby/branches/testing/sample-macruby/PhotocastViewer/rb_main.rb
MacRuby/branches/testing/sample-macruby/ViewModelDemo/Controller.rb
MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/
MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/InfoPlist.strings
MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/
MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/classes.nib
MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/info.nib
MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/objects.nib
MacRuby/branches/testing/sample-macruby/ViewModelDemo/Info.plist
MacRuby/branches/testing/sample-macruby/ViewModelDemo/Superview.rb
MacRuby/branches/testing/sample-macruby/ViewModelDemo/ViewModel.rb
MacRuby/branches/testing/sample-macruby/ViewModelDemo/ViewModelDemo.xcodeproj/
MacRuby/branches/testing/sample-macruby/ViewModelDemo/ViewModelDemo.xcodeproj/project.pbxproj
MacRuby/branches/testing/sample-macruby/ViewModelDemo/main.m
MacRuby/branches/testing/sample-macruby/ViewModelDemo/rb_main.rb
Modified: MacRuby/branches/testing/sample-macruby/About MacRuby Examples.rtf
===================================================================
--- MacRuby/branches/testing/sample-macruby/About MacRuby Examples.rtf 2008-06-06 05:06:01 UTC (rev 255)
+++ MacRuby/branches/testing/sample-macruby/About MacRuby Examples.rtf 2008-06-06 05:23:10 UTC (rev 256)
@@ -1,8 +1,8 @@
-{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf270
+{\rtf1\ansi\ansicpg1252\cocoartf949
{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 LucidaGrande;\f2\froman\fcharset0 Times-Roman;
}
{\colortbl;\red255\green255\blue255;}
-\vieww18720\viewh20420\viewkind0
+\vieww18720\viewh16000\viewkind0
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\li1120\fi-400\ri140\ql\qnatural
\f0\fs30 \cf0 \
@@ -41,6 +41,14 @@
\b PathDemo
\b0 Path operations (circles, rectangles, B\'e9zier paths)\
\
+
+\b PhotocastViewer
+\b0 ImageKit and PubSub frameworks\
+\
+
+\b ViewModelDemo
+\b0 NSView, NSTimer\
+\
You will also find some standalone scripts in the
\b Scripts
\b0 directory. These \
@@ -48,6 +56,6 @@
\pard\tx960\tx4320\tx5760\tx6720\tx7680\tx8640\tx9600\li4300\fi-3360\ri-1180\ql\qnatural
\cf0 \
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\li960\fi-20\ri-1180\ql\qnatural
-\cf0 The source code of all MacRuby examples is covered by the Ruby license, which can be found online at: {\field{\*\fldinst{HYPERLINK "http://www.ruby-lang.org/en/LICENSE.txt"}}{\fldrslt http://www.ruby-lang.org/en/LICENSE.txt}}\
+\cf0 The source code of all MacRuby examples, unless specified, is covered by the Ruby license, which can be found online at: {\field{\*\fldinst{HYPERLINK "http://www.ruby-lang.org/en/LICENSE.txt"}}{\fldrslt http://www.ruby-lang.org/en/LICENSE.txt}}\
\
}
\ No newline at end of file
Modified: MacRuby/branches/testing/sample-macruby/CircleView/CircleView.rb
===================================================================
--- MacRuby/branches/testing/sample-macruby/CircleView/CircleView.rb 2008-06-06 05:06:01 UTC (rev 255)
+++ MacRuby/branches/testing/sample-macruby/CircleView/CircleView.rb 2008-06-06 05:23:10 UTC (rev 256)
@@ -159,25 +159,11 @@
# We schedule a timer for a desired 30fps animation rate.
# In performAnimation: we determine exactly
# how much time has elapsed and animate accordingly.
-
-=begin
- @timer = NSTimer.timerWithTimeInterval 1.0/30.0,
- target:self,
- selector:'performAnimation:',
- userInfo:nil,
- repeats:true
-=end
-
- #@timer = Foo.foo(self)
-
-#=begin
@timer = NSTimer.scheduledTimerWithTimeInterval 1.0/30.0,
target:self,
selector:'performAnimation:',
userInfo:nil,
repeats:true
-#=end
- p @timer
# The next two lines make sure that animation will continue to occur
# while modal panels are displayed and while event tracking is taking
Modified: MacRuby/branches/testing/sample-macruby/CircleView/main.m
===================================================================
--- MacRuby/branches/testing/sample-macruby/CircleView/main.m 2008-06-06 05:06:01 UTC (rev 255)
+++ MacRuby/branches/testing/sample-macruby/CircleView/main.m 2008-06-06 05:23:10 UTC (rev 256)
@@ -8,16 +8,6 @@
#import <MacRuby/MacRuby.h>
-#import <Cocoa/Cocoa.h>
- at interface Foo
- at end
- at implementation Foo
-+(id)foo:(id)rcv
-{
- return [NSTimer scheduledTimerWithTimeInterval:1.0/30.0 target:rcv selector:@selector(performAnimation:) userInfo:nil repeats:true];
-}
- at end
-
int main(int argc, char *argv[])
{
return macruby_main("rb_main.rb", argc, argv);
Copied: MacRuby/branches/testing/sample-macruby/PhotocastViewer (from rev 255, MacRuby/trunk/sample-macruby/PhotocastViewer)
Copied: MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj (from rev 255, MacRuby/trunk/sample-macruby/PhotocastViewer/English.lproj)
Deleted: MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/InfoPlist.strings
===================================================================
(Binary files differ)
Copied: MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/InfoPlist.strings (from rev 255, MacRuby/trunk/sample-macruby/PhotocastViewer/English.lproj/InfoPlist.strings)
===================================================================
(Binary files differ)
Copied: MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib (from rev 255, MacRuby/trunk/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib)
Deleted: MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/classes.nib
===================================================================
--- MacRuby/trunk/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/classes.nib 2008-06-06 05:06:01 UTC (rev 255)
+++ MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/classes.nib 2008-06-06 05:23:10 UTC (rev 256)
@@ -1,59 +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>IKImageBrowserView</string>
- <key>LANGUAGE</key>
- <string>ObjC</string>
- <key>OUTLETS</key>
- <dict>
- <key>_dataSource</key>
- <string>id</string>
- <key>_delegate</key>
- <string>id</string>
- <key>_dragDestinationDelegate</key>
- <string>id</string>
- <key>_horizontalScroller</key>
- <string>NSScroller</string>
- <key>_verticalScroller</key>
- <string>NSScroller</string>
- </dict>
- <key>SUPERCLASS</key>
- <string>NSView</string>
- </dict>
- <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>NSObject</string>
- <key>LANGUAGE</key>
- <string>ObjC</string>
- </dict>
- <dict>
- <key>ACTIONS</key>
- <dict>
- <key>parse</key>
- <string>id</string>
- <key>zoomChanged</key>
- <string>id</string>
- </dict>
- <key>CLASS</key>
- <string>PhotocastViewerController</string>
- <key>LANGUAGE</key>
- <string>ObjC</string>
- </dict>
- </array>
- <key>IBVersion</key>
- <string>1</string>
-</dict>
-</plist>
Copied: MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/classes.nib (from rev 255, MacRuby/trunk/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/classes.nib)
===================================================================
--- MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/classes.nib (rev 0)
+++ MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/classes.nib 2008-06-06 05:23:10 UTC (rev 256)
@@ -0,0 +1,59 @@
+<?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>IKImageBrowserView</string>
+ <key>LANGUAGE</key>
+ <string>ObjC</string>
+ <key>OUTLETS</key>
+ <dict>
+ <key>_dataSource</key>
+ <string>id</string>
+ <key>_delegate</key>
+ <string>id</string>
+ <key>_dragDestinationDelegate</key>
+ <string>id</string>
+ <key>_horizontalScroller</key>
+ <string>NSScroller</string>
+ <key>_verticalScroller</key>
+ <string>NSScroller</string>
+ </dict>
+ <key>SUPERCLASS</key>
+ <string>NSView</string>
+ </dict>
+ <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>NSObject</string>
+ <key>LANGUAGE</key>
+ <string>ObjC</string>
+ </dict>
+ <dict>
+ <key>ACTIONS</key>
+ <dict>
+ <key>parse</key>
+ <string>id</string>
+ <key>zoomChanged</key>
+ <string>id</string>
+ </dict>
+ <key>CLASS</key>
+ <string>PhotocastViewerController</string>
+ <key>LANGUAGE</key>
+ <string>ObjC</string>
+ </dict>
+ </array>
+ <key>IBVersion</key>
+ <string>1</string>
+</dict>
+</plist>
Deleted: MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/info.nib
===================================================================
--- MacRuby/trunk/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/info.nib 2008-06-06 05:06:01 UTC (rev 255)
+++ MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/info.nib 2008-06-06 05:23:10 UTC (rev 256)
@@ -1,20 +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>../../PhotocastViewer.xcodeproj</string>
- <key>IBOldestOS</key>
- <integer>5</integer>
- <key>IBOpenObjects</key>
- <array>
- <integer>231</integer>
- </array>
- <key>IBSystem Version</key>
- <string>9A581</string>
- <key>targetFramework</key>
- <string>IBCocoaFramework</string>
-</dict>
-</plist>
Copied: MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/info.nib (from rev 255, MacRuby/trunk/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/info.nib)
===================================================================
--- MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/info.nib (rev 0)
+++ MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/info.nib 2008-06-06 05:23:10 UTC (rev 256)
@@ -0,0 +1,20 @@
+<?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>../../PhotocastViewer.xcodeproj</string>
+ <key>IBOldestOS</key>
+ <integer>5</integer>
+ <key>IBOpenObjects</key>
+ <array>
+ <integer>231</integer>
+ </array>
+ <key>IBSystem Version</key>
+ <string>9A581</string>
+ <key>targetFramework</key>
+ <string>IBCocoaFramework</string>
+</dict>
+</plist>
Deleted: MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/keyedobjects.nib
===================================================================
(Binary files differ)
Copied: MacRuby/branches/testing/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/keyedobjects.nib (from rev 255, MacRuby/trunk/sample-macruby/PhotocastViewer/English.lproj/MainMenu.nib/keyedobjects.nib)
===================================================================
(Binary files differ)
Deleted: MacRuby/branches/testing/sample-macruby/PhotocastViewer/Info.plist
===================================================================
--- MacRuby/trunk/sample-macruby/PhotocastViewer/Info.plist 2008-06-06 05:06:01 UTC (rev 255)
+++ MacRuby/branches/testing/sample-macruby/PhotocastViewer/Info.plist 2008-06-06 05:23:10 UTC (rev 256)
@@ -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.PhotocastViewer</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>
Copied: MacRuby/branches/testing/sample-macruby/PhotocastViewer/Info.plist (from rev 255, MacRuby/trunk/sample-macruby/PhotocastViewer/Info.plist)
===================================================================
--- MacRuby/branches/testing/sample-macruby/PhotocastViewer/Info.plist (rev 0)
+++ MacRuby/branches/testing/sample-macruby/PhotocastViewer/Info.plist 2008-06-06 05:23:10 UTC (rev 256)
@@ -0,0 +1,28 @@
+<?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.PhotocastViewer</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>
Copied: MacRuby/branches/testing/sample-macruby/PhotocastViewer/PhotocastViewer.xcodeproj (from rev 255, MacRuby/trunk/sample-macruby/PhotocastViewer/PhotocastViewer.xcodeproj)
Deleted: MacRuby/branches/testing/sample-macruby/PhotocastViewer/PhotocastViewer.xcodeproj/project.pbxproj
===================================================================
--- MacRuby/trunk/sample-macruby/PhotocastViewer/PhotocastViewer.xcodeproj/project.pbxproj 2008-06-06 05:06:01 UTC (rev 255)
+++ MacRuby/branches/testing/sample-macruby/PhotocastViewer/PhotocastViewer.xcodeproj/project.pbxproj 2008-06-06 05:23:10 UTC (rev 256)
@@ -1,281 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 44;
- objects = {
-
-/* Begin PBXBuildFile section */
- 4D3CB8F50DF8C15800AC5F00 /* PhotocastViewerController.rb in Resources */ = {isa = PBXBuildFile; fileRef = 4D3CB8F40DF8C15800AC5F00 /* PhotocastViewerController.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>"; };
- 4D3CB8F40DF8C15800AC5F00 /* PhotocastViewerController.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = PhotocastViewerController.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 /* PhotocastViewer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PhotocastViewer.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 = (
- 4D3CB8F40DF8C15800AC5F00 /* PhotocastViewerController.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 /* PhotocastViewer.app */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- 29B97314FDCFA39411CA2CEA /* PhotocastViewer */ = {
- isa = PBXGroup;
- children = (
- 080E96DDFE201D6D7F000001 /* Classes */,
- 29B97315FDCFA39411CA2CEA /* Other Sources */,
- 29B97317FDCFA39411CA2CEA /* Resources */,
- 29B97323FDCFA39411CA2CEA /* Frameworks */,
- 19C28FACFE9D520D11CA2CBB /* Products */,
- );
- name = PhotocastViewer;
- 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 /* PhotocastViewer */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "PhotocastViewer" */;
- buildPhases = (
- 8D1107290486CEB800E47090 /* Resources */,
- 8D11072C0486CEB800E47090 /* Sources */,
- 8D11072E0486CEB800E47090 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = PhotocastViewer;
- productInstallPath = "$(HOME)/Applications";
- productName = PhotocastViewer;
- productReference = 8D1107320486CEB800E47090 /* PhotocastViewer.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 "PhotocastViewer" */;
- compatibilityVersion = "Xcode 3.0";
- hasScannedForEncodings = 1;
- mainGroup = 29B97314FDCFA39411CA2CEA /* PhotocastViewer */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 8D1107260486CEB800E47090 /* PhotocastViewer */,
- );
- };
-/* 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 */,
- 4D3CB8F50DF8C15800AC5F00 /* PhotocastViewerController.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 = PhotocastViewer;
- 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 = PhotocastViewer;
- WRAPPER_EXTENSION = app;
- };
- name = Release;
- };
- C01FCF4F08A954540054247B /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- GCC_ENABLE_OBJC_GC = required;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- PREBINDING = NO;
- SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
- };
- name = Debug;
- };
- C01FCF5008A954540054247B /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- GCC_ENABLE_OBJC_GC = required;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- PREBINDING = NO;
- SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "PhotocastViewer" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- C01FCF4B08A954540054247B /* Debug */,
- C01FCF4C08A954540054247B /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- C01FCF4E08A954540054247B /* Build configuration list for PBXProject "PhotocastViewer" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- C01FCF4F08A954540054247B /* Debug */,
- C01FCF5008A954540054247B /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
-}
Copied: MacRuby/branches/testing/sample-macruby/PhotocastViewer/PhotocastViewer.xcodeproj/project.pbxproj (from rev 255, MacRuby/trunk/sample-macruby/PhotocastViewer/PhotocastViewer.xcodeproj/project.pbxproj)
===================================================================
--- MacRuby/branches/testing/sample-macruby/PhotocastViewer/PhotocastViewer.xcodeproj/project.pbxproj (rev 0)
+++ MacRuby/branches/testing/sample-macruby/PhotocastViewer/PhotocastViewer.xcodeproj/project.pbxproj 2008-06-06 05:23:10 UTC (rev 256)
@@ -0,0 +1,281 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 44;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 4D3CB8F50DF8C15800AC5F00 /* PhotocastViewerController.rb in Resources */ = {isa = PBXBuildFile; fileRef = 4D3CB8F40DF8C15800AC5F00 /* PhotocastViewerController.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>"; };
+ 4D3CB8F40DF8C15800AC5F00 /* PhotocastViewerController.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = PhotocastViewerController.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 /* PhotocastViewer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PhotocastViewer.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 = (
+ 4D3CB8F40DF8C15800AC5F00 /* PhotocastViewerController.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 /* PhotocastViewer.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 29B97314FDCFA39411CA2CEA /* PhotocastViewer */ = {
+ isa = PBXGroup;
+ children = (
+ 080E96DDFE201D6D7F000001 /* Classes */,
+ 29B97315FDCFA39411CA2CEA /* Other Sources */,
+ 29B97317FDCFA39411CA2CEA /* Resources */,
+ 29B97323FDCFA39411CA2CEA /* Frameworks */,
+ 19C28FACFE9D520D11CA2CBB /* Products */,
+ );
+ name = PhotocastViewer;
+ 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 /* PhotocastViewer */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "PhotocastViewer" */;
+ buildPhases = (
+ 8D1107290486CEB800E47090 /* Resources */,
+ 8D11072C0486CEB800E47090 /* Sources */,
+ 8D11072E0486CEB800E47090 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = PhotocastViewer;
+ productInstallPath = "$(HOME)/Applications";
+ productName = PhotocastViewer;
+ productReference = 8D1107320486CEB800E47090 /* PhotocastViewer.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 "PhotocastViewer" */;
+ compatibilityVersion = "Xcode 3.0";
+ hasScannedForEncodings = 1;
+ mainGroup = 29B97314FDCFA39411CA2CEA /* PhotocastViewer */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 8D1107260486CEB800E47090 /* PhotocastViewer */,
+ );
+ };
+/* 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 */,
+ 4D3CB8F50DF8C15800AC5F00 /* PhotocastViewerController.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 = PhotocastViewer;
+ 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 = PhotocastViewer;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+ C01FCF4F08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_ENABLE_OBJC_GC = required;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ PREBINDING = NO;
+ SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
+ };
+ name = Debug;
+ };
+ C01FCF5008A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_ENABLE_OBJC_GC = required;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ PREBINDING = NO;
+ SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "PhotocastViewer" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4B08A954540054247B /* Debug */,
+ C01FCF4C08A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ C01FCF4E08A954540054247B /* Build configuration list for PBXProject "PhotocastViewer" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4F08A954540054247B /* Debug */,
+ C01FCF5008A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
+}
Deleted: MacRuby/branches/testing/sample-macruby/PhotocastViewer/PhotocastViewerController.rb
===================================================================
--- MacRuby/trunk/sample-macruby/PhotocastViewer/PhotocastViewerController.rb 2008-06-06 05:06:01 UTC (rev 255)
+++ MacRuby/branches/testing/sample-macruby/PhotocastViewer/PhotocastViewerController.rb 2008-06-06 05:23:10 UTC (rev 256)
@@ -1,80 +0,0 @@
-class PhotocastViewerController < NSWindowController
-
- ib_outlet :imageBrowserView
-
- def awakeFromNib
- @cache = []
- @imageBrowserView.animates = true
- @imageBrowserView.dataSource = self
- @imageBrowserView.delegate = self
-
- NSNotificationCenter.defaultCenter.addObserver self,
- selector:'feedRefreshed:',
- name:PSFeedRefreshingNotification,
- object:nil
- end
-
- # Actions
-
- def zoomChanged(sender)
- @imageBrowserView.zoomValue = sender.floatValue
- end
-
- def parse(sender)
- urlString = sender.stringValue
- url = NSURL.URLWithString(urlString)
- feed = PSFeed.alloc.initWithURL(url)
- feed.refresh(nil)
- end
-
- def feedRefreshed(notification)
- feed = notification.object
- @results = feed.entryEnumeratorSortedBy(nil).allObjects
- @cache.clear
- @imageBrowserView.reloadData
- end
-
- # Image browser datasource/delegate
-
- def numberOfItemsInImageBrowser(browser)
- @results ? @results.size : 0
- end
-
- def imageBrowser(browser, itemAtIndex:index)
- photo = @cache[index]
- if photo.nil?
- entry = @results[index]
- url = entry.content.HTMLString.scan(/<img\s+src="([^"]+)"/)[0][0]
- photo = RSSPhoto.new(url)
- @cache[index] = photo
- end
- return photo
- end
-
- def imageBrowser(browser, cellWasDoubleClickedAtIndex:index)
- NSWorkspace.sharedWorkspace.openURL @cache[index].url
- end
-end
-
-class RSSPhoto
- attr_reader :url
-
- def initialize(url)
- @urlString = url
- @url = NSURL.alloc.initWithString url
- end
-
- # IKImageBrowserItem protocol conformance
-
- def imageUID
- @urlString
- end
-
- def imageRepresentationType
- :IKImageBrowserNSImageRepresentationType
- end
-
- def imageRepresentation
- @image ||= NSImage.alloc.initByReferencingURL @url
- end
-end
Copied: MacRuby/branches/testing/sample-macruby/PhotocastViewer/PhotocastViewerController.rb (from rev 255, MacRuby/trunk/sample-macruby/PhotocastViewer/PhotocastViewerController.rb)
===================================================================
--- MacRuby/branches/testing/sample-macruby/PhotocastViewer/PhotocastViewerController.rb (rev 0)
+++ MacRuby/branches/testing/sample-macruby/PhotocastViewer/PhotocastViewerController.rb 2008-06-06 05:23:10 UTC (rev 256)
@@ -0,0 +1,80 @@
+class PhotocastViewerController < NSWindowController
+
+ ib_outlet :imageBrowserView
+
+ def awakeFromNib
+ @cache = []
+ @imageBrowserView.animates = true
+ @imageBrowserView.dataSource = self
+ @imageBrowserView.delegate = self
+
+ NSNotificationCenter.defaultCenter.addObserver self,
+ selector:'feedRefreshed:',
+ name:PSFeedRefreshingNotification,
+ object:nil
+ end
+
+ # Actions
+
+ def zoomChanged(sender)
+ @imageBrowserView.zoomValue = sender.floatValue
+ end
+
+ def parse(sender)
+ urlString = sender.stringValue
+ url = NSURL.URLWithString(urlString)
+ feed = PSFeed.alloc.initWithURL(url)
+ feed.refresh(nil)
+ end
+
+ def feedRefreshed(notification)
+ feed = notification.object
+ @results = feed.entryEnumeratorSortedBy(nil).allObjects
+ @cache.clear
+ @imageBrowserView.reloadData
+ end
+
+ # Image browser datasource/delegate
+
+ def numberOfItemsInImageBrowser(browser)
+ @results ? @results.size : 0
+ end
+
+ def imageBrowser(browser, itemAtIndex:index)
+ photo = @cache[index]
+ if photo.nil?
+ entry = @results[index]
+ url = entry.content.HTMLString.scan(/<img\s+src="([^"]+)"/)[0][0]
+ photo = RSSPhoto.new(url)
+ @cache[index] = photo
+ end
+ return photo
+ end
+
+ def imageBrowser(browser, cellWasDoubleClickedAtIndex:index)
+ NSWorkspace.sharedWorkspace.openURL @cache[index].url
+ end
+end
+
+class RSSPhoto
+ attr_reader :url
+
+ def initialize(url)
+ @urlString = url
+ @url = NSURL.alloc.initWithString url
+ end
+
+ # IKImageBrowserItem protocol conformance
+
+ def imageUID
+ @urlString
+ end
+
+ def imageRepresentationType
+ :IKImageBrowserNSImageRepresentationType
+ end
+
+ def imageRepresentation
+ @image ||= NSImage.alloc.initByReferencingURL @url
+ end
+end
Deleted: MacRuby/branches/testing/sample-macruby/PhotocastViewer/main.m
===================================================================
--- MacRuby/trunk/sample-macruby/PhotocastViewer/main.m 2008-06-06 05:06:01 UTC (rev 255)
+++ MacRuby/branches/testing/sample-macruby/PhotocastViewer/main.m 2008-06-06 05:23:10 UTC (rev 256)
@@ -1,14 +0,0 @@
-//
-// main.m
-// PhotocastViewer
-//
-// Created by Laurent Sansonetti on 6/5/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);
-}
Copied: MacRuby/branches/testing/sample-macruby/PhotocastViewer/main.m (from rev 255, MacRuby/trunk/sample-macruby/PhotocastViewer/main.m)
===================================================================
--- MacRuby/branches/testing/sample-macruby/PhotocastViewer/main.m (rev 0)
+++ MacRuby/branches/testing/sample-macruby/PhotocastViewer/main.m 2008-06-06 05:23:10 UTC (rev 256)
@@ -0,0 +1,14 @@
+//
+// main.m
+// PhotocastViewer
+//
+// Created by Laurent Sansonetti on 6/5/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);
+}
Deleted: MacRuby/branches/testing/sample-macruby/PhotocastViewer/rb_main.rb
===================================================================
--- MacRuby/trunk/sample-macruby/PhotocastViewer/rb_main.rb 2008-06-06 05:06:01 UTC (rev 255)
+++ MacRuby/branches/testing/sample-macruby/PhotocastViewer/rb_main.rb 2008-06-06 05:23:10 UTC (rev 256)
@@ -1,24 +0,0 @@
-#
-# rb_main.rb
-# PhotocastViewer
-#
-# Created by Laurent Sansonetti on 6/5/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 'Quartz'
-framework 'PubSub'
-
-# 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)
Copied: MacRuby/branches/testing/sample-macruby/PhotocastViewer/rb_main.rb (from rev 255, MacRuby/trunk/sample-macruby/PhotocastViewer/rb_main.rb)
===================================================================
--- MacRuby/branches/testing/sample-macruby/PhotocastViewer/rb_main.rb (rev 0)
+++ MacRuby/branches/testing/sample-macruby/PhotocastViewer/rb_main.rb 2008-06-06 05:23:10 UTC (rev 256)
@@ -0,0 +1,24 @@
+#
+# rb_main.rb
+# PhotocastViewer
+#
+# Created by Laurent Sansonetti on 6/5/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 'Quartz'
+framework 'PubSub'
+
+# 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)
Copied: MacRuby/branches/testing/sample-macruby/Scripts/darkroom.rb (from rev 255, MacRuby/trunk/sample-macruby/Scripts/darkroom.rb)
===================================================================
--- MacRuby/branches/testing/sample-macruby/Scripts/darkroom.rb (rev 0)
+++ MacRuby/branches/testing/sample-macruby/Scripts/darkroom.rb 2008-06-06 05:23:10 UTC (rev 256)
@@ -0,0 +1,116 @@
+#!/usr/bin/env ruby
+#
+# DarkRoom
+# Takes fullsize screenshots of a web page.
+# Copyright (c) 2007 Justin Palmer.
+# Rewrote for MacRuby by Laurent Sansonetti.
+#
+# Released under an MIT LICENSE
+#
+# Usage
+# ====
+# ruby ./darkroom.rb http://activereload.net
+# ruby ./darkroom.rb --output=google.png http://google.com
+# ruby ./darkroom.rb --width=400 --delay=5 http://yahoo.com
+#
+
+require 'optparse'
+
+framework 'WebKit'
+
+module ActiveReload
+ module DarkRoom
+ USER_AGENT = "DarkRoom/0.1"
+ class Photographer
+ def initialize
+ options = {}
+ opts = OptionParser.new do |opts|
+ opts.banner = "Usage: #$0 [options] URL"
+
+ opts.on('-w', '--width=[WIDTH]', Integer, 'Force width of the screenshot') do |v|
+ options[:width] = v
+ end
+
+ opts.on('-h', '--height=[HEIGHT]', Integer, 'Force height of screenshot') do |v|
+ options[:height] = v
+ end
+
+ opts.on('-o', '--output=[FILENAME]', String, 'Specify filename for saving') do |v|
+ options[:output] = v
+ end
+
+ opts.on('-d', '--delay=[DELAY]', Integer, 'Delay in seconds to give web page assets time to load') do |v|
+ options[:delay] = v
+ end
+
+ opts.on_tail('-h', '--help', 'Display this message and exit') do
+ puts opts
+ exit
+ end
+ end.parse!
+ options[:width] ||= 1024
+ options[:height] ||= 0
+ options[:website] = ARGV.first || 'http://ruby-lang.org'
+ Camera.shoot(options)
+ end
+ end
+
+ class Camera
+ def self.shoot(options)
+ app = NSApplication.sharedApplication
+ delegate = Processor.new
+ delegate.options = options
+ app.delegate = delegate
+ app.run
+ end
+ end
+
+ class Processor
+ attr_accessor :options, :web_view
+
+ def initialize
+ rect = [-16000.0, -16000.0, 100, 100]
+ win = NSWindow.alloc.initWithContentRect rect,
+ styleMask:NSBorderlessWindowMask,
+ backing:2,
+ defer:0
+
+ @web_view = WebView.alloc.initWithFrame rect
+ @web_view.mainFrame.frameView.allowsScrolling = false
+ @web_view.applicationNameForUserAgent = USER_AGENT
+ @web_view.frameLoadDelegate = self
+
+ win.contentView = @web_view
+ end
+
+ def applicationDidFinishLaunching(notification)
+ @options[:output] ||= "#{Time.now.strftime('%m-%d-%y-%H%I%S')}.png"
+ @web_view.window.contentSize = [@options[:width], @options[:height]]
+ @web_view.frameSize = [@options[:width], @options[:height]]
+ @web_view.mainFrame.loadRequest NSURLRequest.requestWithURL NSURL.URLWithString @options[:website]
+ end
+
+ def webView(web_view, didFinishLoadForFrame:frame)
+ viewport = web_view.mainFrame.frameView.documentView
+ viewport.window.orderFront(nil)
+ viewport.window.display
+ viewport.window.contentSize = [@options[:width], (@options[:height] > 0 ? @options[:height] : viewport.bounds.size.height)]
+ viewport.frame = viewport.bounds
+ sleep(@options[:delay]) if @options[:delay]
+ capture_and_save viewport
+ end
+
+ def capture_and_save(view)
+ view.lockFocus
+ bitmap = NSBitmapImageRep.alloc.initWithFocusedViewRect view.bounds
+ view.unlockFocus
+
+ repr = bitmap.representationUsingType NSPNGFileType, properties:nil
+ repr.writeToFile @options[:output], atomically:true
+ NSApplication.sharedApplication.terminate nil
+ end
+ end
+ end
+end
+
+ActiveReload::DarkRoom::Photographer.new
Copied: MacRuby/branches/testing/sample-macruby/Scripts/pdf2tiff.rb (from rev 255, MacRuby/trunk/sample-macruby/Scripts/pdf2tiff.rb)
===================================================================
--- MacRuby/branches/testing/sample-macruby/Scripts/pdf2tiff.rb (rev 0)
+++ MacRuby/branches/testing/sample-macruby/Scripts/pdf2tiff.rb 2008-06-06 05:23:10 UTC (rev 256)
@@ -0,0 +1,36 @@
+#!/usr/bin/env ruby
+#
+# pdf2tiff.rb
+#
+# Convert a PDF document into a series of TIFF images
+#
+# Created by Ernest Prabhakar. Copyright 2007 Apple, Inc. All Rights Reserved
+# Ported to MacRuby by Laurent Sansonetti.
+#
+
+framework 'Quartz'
+
+unless ARGV.size >= 1
+ $stderr.puts "Usage: #{__FILE__} [file1.pdf] [file2.pdf] ..."
+ exit 1
+end
+
+NSApplication.sharedApplication
+
+ARGV.each do |path|
+ url = NSURL.fileURLWithPath path
+ file = path.split("/")[-1]
+ root = file.split(".")[0]
+
+ pdfdoc = PDFDocument.alloc.initWithURL url
+
+ pdfdoc.pageCount.times do |i|
+ page = pdfdoc.pageAtIndex i
+ pdfdata = page.dataRepresentation
+ image = NSImage.alloc.initWithData pdfdata
+ tiffdata = image.TIFFRepresentation
+ outfile = "#{root}_#{i}.tiff"
+ puts "Writing #{page.description} to #{outfile} for #{path}"
+ tiffdata.writeToFile outfile, atomically:false
+ end
+end
Copied: MacRuby/branches/testing/sample-macruby/ViewModelDemo (from rev 255, MacRuby/trunk/sample-macruby/ViewModelDemo)
Deleted: MacRuby/branches/testing/sample-macruby/ViewModelDemo/Controller.rb
===================================================================
--- MacRuby/trunk/sample-macruby/ViewModelDemo/Controller.rb 2008-06-06 05:06:01 UTC (rev 255)
+++ MacRuby/branches/testing/sample-macruby/ViewModelDemo/Controller.rb 2008-06-06 05:23:10 UTC (rev 256)
@@ -1,109 +0,0 @@
-class Controller
-
- ib_outlet :mySuperview, :numberText, :speedText, :numberSlider, :speedSlider
-
- def init
- super
-
- @objs = [] # This will hold the ViewModel objects.
-
- # A global flag to keep track of whether one of the subviews is moving.
- # There is no particular reason why I used a global instead of a method call
- # to mySuperview to retrieve an objMoving instance variable. A global
- # just seems perfectly acceptable for this kind of thing.
- $objMoving = false
-
- self
- end
-
- def awakeFromNib
- for n in 0..(@numberSlider.intValue-1)
- addNewViewModel
- end
- end
-
- def adjustNumberOfViewModels
- desired = @numberSlider.intValue
- current = @objs.length
-
- if current < desired
- for n in 1..(desired-current)
- addNewViewModel
- end
- end
-
- if current > desired
- until @objs.length == desired
- @objs.last.removeFromSuperview
- @objs.pop
- end
- end
- end
-
- def addNewViewModel
- myRect = getRandomViewRect
- # Create a new ViewModel object, which is a subclass of NSView.
- myObj = ViewModel.alloc.initWithFrame myRect
- # Just for testing, the object knows its number.
- myObj.setNum @objs.size
- # Add it to the superview
- @mySuperview.addSubview myObj
- # Add it to the array
- @objs.push myObj
- end
-
- ib_action :numberSliderAction do |sender|
- number = @numberSlider.intValue
- @numberText.stringValue = "Number: " + number.to_s
- adjustNumberOfViewModels
- end
-
- ib_action :moveButtonAction do |sender|
- # Assign new destinations to the objects
- @objs.each do |obj|
- destPt = getRandomViewPoint
- obj.setMoveDestination destPt
- speed = @speedSlider.floatValue
- obj.setSpeed speed
- obj.startMovement
- end
- end
-
- ib_action :speedSliderAction do |sender|
- # No need to store the speed in an instance variable, since the speed is read
- # right from the control in moveButtonAction. Just update the speed text.
- speed = @speedSlider.floatValue
- @objs.each do |obj|
- if obj.speed > 0 # object is moving
- obj.setSpeed speed
- end
- end
- speed = speed.to_i
- @speedText.stringValue = "Speed: " + speed.to_s
- end
-
- def getRandomViewRect
- rx = rand(@mySuperview.bounds.size.width - SQUARE_SIZE)
- ry = rand(@mySuperview.bounds.size.height - SQUARE_SIZE)
- NSRect.new(NSPoint.new(rx, ry), NSSize.new(SQUARE_SIZE, SQUARE_SIZE))
- end
-
- def getRandomViewPoint
- rx = rand(@mySuperview.bounds.size.width - SQUARE_SIZE)
- ry = rand(@mySuperview.bounds.size.height - SQUARE_SIZE)
- NSPoint.new(rx, ry)
- end
-
- def handleEvents
- app = NSApplication.sharedApplication
- event = app.nextEventMatchingMask NSAnyEventMask,
- untilDate:NSDate.dateWithTimeIntervalSinceNow(0.01),
- inMode:OSX.NSDefaultRunLoopMode,
- dequeue:true
- if event
- # Could put special event handling here.
- app.sendEvent(event)
- end
- end
-
-end
Copied: MacRuby/branches/testing/sample-macruby/ViewModelDemo/Controller.rb (from rev 255, MacRuby/trunk/sample-macruby/ViewModelDemo/Controller.rb)
===================================================================
--- MacRuby/branches/testing/sample-macruby/ViewModelDemo/Controller.rb (rev 0)
+++ MacRuby/branches/testing/sample-macruby/ViewModelDemo/Controller.rb 2008-06-06 05:23:10 UTC (rev 256)
@@ -0,0 +1,109 @@
+class Controller
+
+ ib_outlet :mySuperview, :numberText, :speedText, :numberSlider, :speedSlider
+
+ def init
+ super
+
+ @objs = [] # This will hold the ViewModel objects.
+
+ # A global flag to keep track of whether one of the subviews is moving.
+ # There is no particular reason why I used a global instead of a method call
+ # to mySuperview to retrieve an objMoving instance variable. A global
+ # just seems perfectly acceptable for this kind of thing.
+ $objMoving = false
+
+ self
+ end
+
+ def awakeFromNib
+ for n in 0..(@numberSlider.intValue-1)
+ addNewViewModel
+ end
+ end
+
+ def adjustNumberOfViewModels
+ desired = @numberSlider.intValue
+ current = @objs.length
+
+ if current < desired
+ for n in 1..(desired-current)
+ addNewViewModel
+ end
+ end
+
+ if current > desired
+ until @objs.length == desired
+ @objs.last.removeFromSuperview
+ @objs.pop
+ end
+ end
+ end
+
+ def addNewViewModel
+ myRect = getRandomViewRect
+ # Create a new ViewModel object, which is a subclass of NSView.
+ myObj = ViewModel.alloc.initWithFrame myRect
+ # Just for testing, the object knows its number.
+ myObj.setNum @objs.size
+ # Add it to the superview
+ @mySuperview.addSubview myObj
+ # Add it to the array
+ @objs.push myObj
+ end
+
+ ib_action :numberSliderAction do |sender|
+ number = @numberSlider.intValue
+ @numberText.stringValue = "Number: " + number.to_s
+ adjustNumberOfViewModels
+ end
+
+ ib_action :moveButtonAction do |sender|
+ # Assign new destinations to the objects
+ @objs.each do |obj|
+ destPt = getRandomViewPoint
+ obj.setMoveDestination destPt
+ speed = @speedSlider.floatValue
+ obj.setSpeed speed
+ obj.startMovement
+ end
+ end
+
+ ib_action :speedSliderAction do |sender|
+ # No need to store the speed in an instance variable, since the speed is read
+ # right from the control in moveButtonAction. Just update the speed text.
+ speed = @speedSlider.floatValue
+ @objs.each do |obj|
+ if obj.speed > 0 # object is moving
+ obj.setSpeed speed
+ end
+ end
+ speed = speed.to_i
+ @speedText.stringValue = "Speed: " + speed.to_s
+ end
+
+ def getRandomViewRect
+ rx = rand(@mySuperview.bounds.size.width - SQUARE_SIZE)
+ ry = rand(@mySuperview.bounds.size.height - SQUARE_SIZE)
+ NSRect.new(NSPoint.new(rx, ry), NSSize.new(SQUARE_SIZE, SQUARE_SIZE))
+ end
+
+ def getRandomViewPoint
+ rx = rand(@mySuperview.bounds.size.width - SQUARE_SIZE)
+ ry = rand(@mySuperview.bounds.size.height - SQUARE_SIZE)
+ NSPoint.new(rx, ry)
+ end
+
+ def handleEvents
+ app = NSApplication.sharedApplication
+ event = app.nextEventMatchingMask NSAnyEventMask,
+ untilDate:NSDate.dateWithTimeIntervalSinceNow(0.01),
+ inMode:OSX.NSDefaultRunLoopMode,
+ dequeue:true
+ if event
+ # Could put special event handling here.
+ app.sendEvent(event)
+ end
+ end
+
+end
Copied: MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj (from rev 255, MacRuby/trunk/sample-macruby/ViewModelDemo/English.lproj)
Deleted: MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/InfoPlist.strings
===================================================================
(Binary files differ)
Copied: MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/InfoPlist.strings (from rev 255, MacRuby/trunk/sample-macruby/ViewModelDemo/English.lproj/InfoPlist.strings)
===================================================================
(Binary files differ)
Copied: MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib (from rev 255, MacRuby/trunk/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib)
Deleted: MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/classes.nib
===================================================================
--- MacRuby/trunk/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/classes.nib 2008-06-06 05:06:01 UTC (rev 255)
+++ MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/classes.nib 2008-06-06 05:23:10 UTC (rev 256)
@@ -1,26 +0,0 @@
-{
- IBClasses = (
- {
- ACTIONS = {moveButtonAction = id; numberSliderAction = id; speedSliderAction = id; };
- CLASS = Controller;
- LANGUAGE = ObjC;
- OUTLETS = {
- mySuperview = id;
- numberSlider = id;
- numberText = id;
- speedSlider = id;
- speedText = id;
- };
- SUPERCLASS = NSObject;
- },
- {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
- {
- ACTIONS = {shadowSwitchAction = id; };
- CLASS = MySuperview;
- LANGUAGE = ObjC;
- OUTLETS = {controller = id; moveToTopSwitch = id; shadowSwitch = id; };
- SUPERCLASS = NSView;
- }
- );
- IBVersion = 1;
-}
\ No newline at end of file
Copied: MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/classes.nib (from rev 255, MacRuby/trunk/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/classes.nib)
===================================================================
--- MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/classes.nib (rev 0)
+++ MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/classes.nib 2008-06-06 05:23:10 UTC (rev 256)
@@ -0,0 +1,26 @@
+{
+ IBClasses = (
+ {
+ ACTIONS = {moveButtonAction = id; numberSliderAction = id; speedSliderAction = id; };
+ CLASS = Controller;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ mySuperview = id;
+ numberSlider = id;
+ numberText = id;
+ speedSlider = id;
+ speedText = id;
+ };
+ SUPERCLASS = NSObject;
+ },
+ {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
+ {
+ ACTIONS = {shadowSwitchAction = id; };
+ CLASS = MySuperview;
+ LANGUAGE = ObjC;
+ OUTLETS = {controller = id; moveToTopSwitch = id; shadowSwitch = id; };
+ SUPERCLASS = NSView;
+ }
+ );
+ IBVersion = 1;
+}
\ No newline at end of file
Deleted: MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/info.nib
===================================================================
--- MacRuby/trunk/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/info.nib 2008-06-06 05:06:01 UTC (rev 255)
+++ MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/info.nib 2008-06-06 05:23:10 UTC (rev 256)
@@ -1,22 +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>IBDocumentLocation</key>
- <string>41 53 356 240 0 0 1680 1028 </string>
- <key>IBEditorPositions</key>
- <dict>
- <key>29</key>
- <string>78 576 338 44 0 0 1680 1028 </string>
- </dict>
- <key>IBFramework Version</key>
- <string>446.1</string>
- <key>IBOpenObjects</key>
- <array>
- <integer>21</integer>
- <integer>29</integer>
- </array>
- <key>IBSystem Version</key>
- <string>8N1051</string>
-</dict>
-</plist>
Copied: MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/info.nib (from rev 255, MacRuby/trunk/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/info.nib)
===================================================================
--- MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/info.nib (rev 0)
+++ MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/info.nib 2008-06-06 05:23:10 UTC (rev 256)
@@ -0,0 +1,22 @@
+<?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>IBDocumentLocation</key>
+ <string>41 53 356 240 0 0 1680 1028 </string>
+ <key>IBEditorPositions</key>
+ <dict>
+ <key>29</key>
+ <string>78 576 338 44 0 0 1680 1028 </string>
+ </dict>
+ <key>IBFramework Version</key>
+ <string>446.1</string>
+ <key>IBOpenObjects</key>
+ <array>
+ <integer>21</integer>
+ <integer>29</integer>
+ </array>
+ <key>IBSystem Version</key>
+ <string>8N1051</string>
+</dict>
+</plist>
Deleted: MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/objects.nib
===================================================================
(Binary files differ)
Copied: MacRuby/branches/testing/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/objects.nib (from rev 255, MacRuby/trunk/sample-macruby/ViewModelDemo/English.lproj/MainMenu.nib/objects.nib)
===================================================================
(Binary files differ)
Deleted: MacRuby/branches/testing/sample-macruby/ViewModelDemo/Info.plist
===================================================================
--- MacRuby/trunk/sample-macruby/ViewModelDemo/Info.plist 2008-06-06 05:06:01 UTC (rev 255)
+++ MacRuby/branches/testing/sample-macruby/ViewModelDemo/Info.plist 2008-06-06 05:23:10 UTC (rev 256)
@@ -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.ViewModelDemo</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>
Copied: MacRuby/branches/testing/sample-macruby/ViewModelDemo/Info.plist (from rev 255, MacRuby/trunk/sample-macruby/ViewModelDemo/Info.plist)
===================================================================
--- MacRuby/branches/testing/sample-macruby/ViewModelDemo/Info.plist (rev 0)
+++ MacRuby/branches/testing/sample-macruby/ViewModelDemo/Info.plist 2008-06-06 05:23:10 UTC (rev 256)
@@ -0,0 +1,28 @@
+<?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.ViewModelDemo</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>
Deleted: MacRuby/branches/testing/sample-macruby/ViewModelDemo/Superview.rb
===================================================================
--- MacRuby/trunk/sample-macruby/ViewModelDemo/Superview.rb 2008-06-06 05:06:01 UTC (rev 255)
+++ MacRuby/branches/testing/sample-macruby/ViewModelDemo/Superview.rb 2008-06-06 05:23:10 UTC (rev 256)
@@ -1,77 +0,0 @@
-
-class MySuperview < NSView
-
- ib_outlet :controller, :shadowSwitch, :moveToTopSwitch
-
- attr_reader :shadowSwitch, :moveToTopSwitch
-
- def initWithFrame(frame)
- super
- return self
- end
-
- def awakeFromNib
- @timer = nil
- end
-
- def drawRect(rect)
- # Draw the background only since the ViewModel objects (subviews) will
- # draw themselves automatically.
- # An appropriate rect passed in to this method will keep objects from
- # unnecessarily drawing themselves.
- NSColor.whiteColor.set
- NSBezierPath.fillRect(rect)
- end
-
- def shadowSwitchAction(sender)
- setNeedsDisplay true
- end
-
- def mouseDown(event)
- puts "MySuperview clicked."
- end
-
- def moveSubviewToTop(mySubview)
- # Moves the given subview to the top, for drawing order purposes
- addSubview_positioned_relativeTo_(mySubview, NSWindowBelow, subviews.lastObject)
- end
-
- def moveSubviewToIndex(mySubview, i)
- # An index of 0 will move it behind all others
- addSubview_positioned_relativeTo_(mySubview, NSWindowBelow, subviews.objectAtIndex(i))
- end
-
- def startTimer
- if @timer == nil
- @timer = NSTimer.scheduledTimerWithTimeInterval 1.0/60.0,
- target:self,
- selector:'timerAction',
- userInfo:nil,
- repeats:true
- puts "startTimer"
- end
- end
-
- def timerAction
- numMoving = 0
- subviews.each do |sv|
- # The move function returns 0 if object is not moving, 1 otherwise
- numMoving += sv.moveToDestination
- end
-
- if numMoving == 0
- endTimer
- $objMoving = false
- return
- end
-
- setNeedsDisplay true
- end
-
- def endTimer
- puts "endTimer"
- @timer.invalidate
- @timer = nil
- end
-
-end
Copied: MacRuby/branches/testing/sample-macruby/ViewModelDemo/Superview.rb (from rev 255, MacRuby/trunk/sample-macruby/ViewModelDemo/Superview.rb)
===================================================================
--- MacRuby/branches/testing/sample-macruby/ViewModelDemo/Superview.rb (rev 0)
+++ MacRuby/branches/testing/sample-macruby/ViewModelDemo/Superview.rb 2008-06-06 05:23:10 UTC (rev 256)
@@ -0,0 +1,77 @@
+
+class MySuperview < NSView
+
+ ib_outlet :controller, :shadowSwitch, :moveToTopSwitch
+
+ attr_reader :shadowSwitch, :moveToTopSwitch
+
+ def initWithFrame(frame)
+ super
+ return self
+ end
+
+ def awakeFromNib
+ @timer = nil
+ end
+
+ def drawRect(rect)
+ # Draw the background only since the ViewModel objects (subviews) will
+ # draw themselves automatically.
+ # An appropriate rect passed in to this method will keep objects from
+ # unnecessarily drawing themselves.
+ NSColor.whiteColor.set
+ NSBezierPath.fillRect(rect)
+ end
+
+ def shadowSwitchAction(sender)
+ setNeedsDisplay true
+ end
+
+ def mouseDown(event)
+ puts "MySuperview clicked."
+ end
+
+ def moveSubviewToTop(mySubview)
+ # Moves the given subview to the top, for drawing order purposes
+ addSubview_positioned_relativeTo_(mySubview, NSWindowBelow, subviews.lastObject)
+ end
+
+ def moveSubviewToIndex(mySubview, i)
+ # An index of 0 will move it behind all others
+ addSubview_positioned_relativeTo_(mySubview, NSWindowBelow, subviews.objectAtIndex(i))
+ end
+
+ def startTimer
+ if @timer == nil
+ @timer = NSTimer.scheduledTimerWithTimeInterval 1.0/60.0,
+ target:self,
+ selector:'timerAction',
+ userInfo:nil,
+ repeats:true
+ puts "startTimer"
+ end
+ end
+
+ def timerAction
+ numMoving = 0
+ subviews.each do |sv|
+ # The move function returns 0 if object is not moving, 1 otherwise
+ numMoving += sv.moveToDestination
+ end
+
+ if numMoving == 0
+ endTimer
+ $objMoving = false
+ return
+ end
+
+ setNeedsDisplay true
+ end
+
+ def endTimer
+ puts "endTimer"
+ @timer.invalidate
+ @timer = nil
+ end
+
+end
Deleted: MacRuby/branches/testing/sample-macruby/ViewModelDemo/ViewModel.rb
===================================================================
--- MacRuby/trunk/sample-macruby/ViewModelDemo/ViewModel.rb 2008-06-06 05:06:01 UTC (rev 255)
+++ MacRuby/branches/testing/sample-macruby/ViewModelDemo/ViewModel.rb 2008-06-06 05:23:10 UTC (rev 256)
@@ -1,161 +0,0 @@
-# This is an example of an combination object: model and view. A number of these are
-# created and added to the superview (see Controller).
-
-SQUARE_SIZE = 50
-STROKE_WIDTH = 10
-SHADOW_OFFSET = 5
-SHADOW_BLUR = 3
-
-class ViewModel < NSView
-
- attr_reader :speed
-
- def initWithFrame(frame)
- super
-
- @stroke = STROKE_WIDTH
- @color = getRandomColor
- @speed = 0
- setupShadows
- setupDrawRect
-
- return self
- end
-
- def setNum(n)
- @num = n
- end
-
- def setupShadows
- # The shadow will automagically "mask" any white part in a drawn image.
- # Shadows also work with drawn paths, but leave room for the shadow in the frame
- # (if object drawing fills frame, then shadow won't be visible).
-
- @onShadow = NSShadow.new
- offset = NSSize.new(SHADOW_OFFSET, -SHADOW_OFFSET)
- @onShadow.shadowOffset = offset # required to get a shadow.
- @onShadow.shadowBlurRadius = SHADOW_BLUR # default is 0.
- # The following is not needed since it matches the default. Change if desired.
- @onShadow.shadowColor = NSColor.blackColor.colorWithAlphaComponent(0.33)
-
- # For the off shadow, all that is needed is to create it. It defaults to "no shadow" settings.
- @offShadow = NSShadow.new
- end
-
- def setupDrawRect
- # The draw rect is smaller than the frame, to leave room for the shadow and the stroke width.
- @drawRect = NSRect.new(NSPoint.new(@stroke/2, SHADOW_OFFSET + @stroke/2),
- NSSize.new(bounds.size.width - SHADOW_OFFSET - @stroke, bounds.size.height - SHADOW_OFFSET - @stroke))
- end
-
- def getRandomColor
- red = rand(256)/256.0 #forces float
- green = rand(256)/256.0
- blue = rand(256)/256.0
- NSColor.colorWithCalibratedRed red, green:green, blue:blue, alpha:1.0
- end
-
- def drawRect(rect)
- if superview.shadowSwitch.state == 1
- @onShadow.set
- else
- @offShadow.set
- end
-
- @color.set
- NSBezierPath.setDefaultLineWidth(@stroke)
- NSBezierPath.strokeRect(@drawRect)
- end
-
- def mouseDown(event)
- puts "mouseDown for obj #{@num}"
-
- # It can be useful to keep this point so that the relationship (distance) between
- # the object and the pointer can be maintained during a mouseDragged event.
- # Object-local coordinates.
- @mouseDownPoint = convertPoint event.locationInWindow, fromView:nil
-
- # Put this subview on top, if control is set.
- if superview.moveToTopSwitch.state == 1
- superview.moveSubviewToTop(self)
- # or, to move it behind the others:
- #superview.moveSubviewToIndex(self, 0)
- end
- end
-
- def mouseDragged(event)
- myPoint = NSPoint.new(event.locationInWindow.x - superview.frame.origin.x,
- event.locationInWindow.y - superview.frame.origin.y)
- myPoint.x -= @mouseDownPoint.x
- myPoint.y -= @mouseDownPoint.y
-
- if @speed > 0 # was in the process of animating to a new location
- @speed = 0 # stop the movement
- end
-
- # There is no need to redraw all the objects during a drag.
- # This method keeps dragging very smooth, even with lots of objects on the screen.
- # Mark the old rect as needing an update...
- superview.needsDisplayInRect = frame
- # ...update the position...
- self.frameOrigin = myPoint
- # ...and mark the new one too.
- superview.needsDisplayInRect = frame
- end
-
- def setMoveDestination(destPt)
- if destPt.x != frame.origin.x or destPt.y != frame.origin.y
- @destPt = destPt
- end
- end
-
- def setSpeed(speed)
- @speed = speed
- @angle = getAngleInRadians(frame.origin, @destPt)
- @xDelta = Math.sin(@angle) * @speed
- @yDelta = Math.cos(@angle) * @speed
- end
-
- def startMovement
- # Set the global so the app knows that an object is moving
- $objMoving = true
- # start the timer (superview checks to see if it is already going)
- superview.startTimer
- end
-
- def moveToDestination
- return 0 if speed == 0
- currPt = frame.origin
- if currPt == @destPt # reached destination
- @speed = 0
- return 0
- end
-
- if (currPt.x - @destPt.x).abs < @speed
- currPt.x = @destPt.x
- else
- currPt.x += @xDelta
- end
-
- if (currPt.y - @destPt.y).abs < @speed
- currPt.y = @destPt.y
- else
- currPt.y += @yDelta
- end
-
- # Unlike with dragging, during animation it is inefficient for each object
- # to call "setNeedsDisplay" as it moves. It is much better to just update the
- # object's position and let the superview call setNeedsDisplay once.
- self.frameOrigin = currPt
-
- return 1 # yes, this object is still moving
- end
-
- def getAngleInRadians(p1, p2) # points
- x = p2.x - p1.x
- y = p2.y - p1.y
- Math.atan2(x,y)
- end
-
-end
-
Copied: MacRuby/branches/testing/sample-macruby/ViewModelDemo/ViewModel.rb (from rev 255, MacRuby/trunk/sample-macruby/ViewModelDemo/ViewModel.rb)
===================================================================
--- MacRuby/branches/testing/sample-macruby/ViewModelDemo/ViewModel.rb (rev 0)
+++ MacRuby/branches/testing/sample-macruby/ViewModelDemo/ViewModel.rb 2008-06-06 05:23:10 UTC (rev 256)
@@ -0,0 +1,161 @@
+# This is an example of an combination object: model and view. A number of these are
+# created and added to the superview (see Controller).
+
+SQUARE_SIZE = 50
+STROKE_WIDTH = 10
+SHADOW_OFFSET = 5
+SHADOW_BLUR = 3
+
+class ViewModel < NSView
+
+ attr_reader :speed
+
+ def initWithFrame(frame)
+ super
+
+ @stroke = STROKE_WIDTH
+ @color = getRandomColor
+ @speed = 0
+ setupShadows
+ setupDrawRect
+
+ return self
+ end
+
+ def setNum(n)
+ @num = n
+ end
+
+ def setupShadows
+ # The shadow will automagically "mask" any white part in a drawn image.
+ # Shadows also work with drawn paths, but leave room for the shadow in the frame
+ # (if object drawing fills frame, then shadow won't be visible).
+
+ @onShadow = NSShadow.new
+ offset = NSSize.new(SHADOW_OFFSET, -SHADOW_OFFSET)
+ @onShadow.shadowOffset = offset # required to get a shadow.
+ @onShadow.shadowBlurRadius = SHADOW_BLUR # default is 0.
+ # The following is not needed since it matches the default. Change if desired.
+ @onShadow.shadowColor = NSColor.blackColor.colorWithAlphaComponent(0.33)
+
+ # For the off shadow, all that is needed is to create it. It defaults to "no shadow" settings.
+ @offShadow = NSShadow.new
+ end
+
+ def setupDrawRect
+ # The draw rect is smaller than the frame, to leave room for the shadow and the stroke width.
+ @drawRect = NSRect.new(NSPoint.new(@stroke/2, SHADOW_OFFSET + @stroke/2),
+ NSSize.new(bounds.size.width - SHADOW_OFFSET - @stroke, bounds.size.height - SHADOW_OFFSET - @stroke))
+ end
+
+ def getRandomColor
+ red = rand(256)/256.0 #forces float
+ green = rand(256)/256.0
+ blue = rand(256)/256.0
+ NSColor.colorWithCalibratedRed red, green:green, blue:blue, alpha:1.0
+ end
+
+ def drawRect(rect)
+ if superview.shadowSwitch.state == 1
+ @onShadow.set
+ else
+ @offShadow.set
+ end
+
+ @color.set
+ NSBezierPath.setDefaultLineWidth(@stroke)
+ NSBezierPath.strokeRect(@drawRect)
+ end
+
+ def mouseDown(event)
+ puts "mouseDown for obj #{@num}"
+
+ # It can be useful to keep this point so that the relationship (distance) between
+ # the object and the pointer can be maintained during a mouseDragged event.
+ # Object-local coordinates.
+ @mouseDownPoint = convertPoint event.locationInWindow, fromView:nil
+
+ # Put this subview on top, if control is set.
+ if superview.moveToTopSwitch.state == 1
+ superview.moveSubviewToTop(self)
+ # or, to move it behind the others:
+ #superview.moveSubviewToIndex(self, 0)
+ end
+ end
+
+ def mouseDragged(event)
+ myPoint = NSPoint.new(event.locationInWindow.x - superview.frame.origin.x,
+ event.locationInWindow.y - superview.frame.origin.y)
+ myPoint.x -= @mouseDownPoint.x
+ myPoint.y -= @mouseDownPoint.y
+
+ if @speed > 0 # was in the process of animating to a new location
+ @speed = 0 # stop the movement
+ end
+
+ # There is no need to redraw all the objects during a drag.
+ # This method keeps dragging very smooth, even with lots of objects on the screen.
+ # Mark the old rect as needing an update...
+ superview.needsDisplayInRect = frame
+ # ...update the position...
+ self.frameOrigin = myPoint
+ # ...and mark the new one too.
+ superview.needsDisplayInRect = frame
+ end
+
+ def setMoveDestination(destPt)
+ if destPt.x != frame.origin.x or destPt.y != frame.origin.y
+ @destPt = destPt
+ end
+ end
+
+ def setSpeed(speed)
+ @speed = speed
+ @angle = getAngleInRadians(frame.origin, @destPt)
+ @xDelta = Math.sin(@angle) * @speed
+ @yDelta = Math.cos(@angle) * @speed
+ end
+
+ def startMovement
+ # Set the global so the app knows that an object is moving
+ $objMoving = true
+ # start the timer (superview checks to see if it is already going)
+ superview.startTimer
+ end
+
+ def moveToDestination
+ return 0 if speed == 0
+ currPt = frame.origin
+ if currPt == @destPt # reached destination
+ @speed = 0
+ return 0
+ end
+
+ if (currPt.x - @destPt.x).abs < @speed
+ currPt.x = @destPt.x
+ else
+ currPt.x += @xDelta
+ end
+
+ if (currPt.y - @destPt.y).abs < @speed
+ currPt.y = @destPt.y
+ else
+ currPt.y += @yDelta
+ end
+
+ # Unlike with dragging, during animation it is inefficient for each object
+ # to call "setNeedsDisplay" as it moves. It is much better to just update the
+ # object's position and let the superview call setNeedsDisplay once.
+ self.frameOrigin = currPt
+
+ return 1 # yes, this object is still moving
+ end
+
+ def getAngleInRadians(p1, p2) # points
+ x = p2.x - p1.x
+ y = p2.y - p1.y
+ Math.atan2(x,y)
+ end
+
+end
+
Copied: MacRuby/branches/testing/sample-macruby/ViewModelDemo/ViewModelDemo.xcodeproj (from rev 255, MacRuby/trunk/sample-macruby/ViewModelDemo/ViewModelDemo.xcodeproj)
Deleted: MacRuby/branches/testing/sample-macruby/ViewModelDemo/ViewModelDemo.xcodeproj/project.pbxproj
===================================================================
--- MacRuby/trunk/sample-macruby/ViewModelDemo/ViewModelDemo.xcodeproj/project.pbxproj 2008-06-06 05:06:01 UTC (rev 255)
+++ MacRuby/branches/testing/sample-macruby/ViewModelDemo/ViewModelDemo.xcodeproj/project.pbxproj 2008-06-06 05:23:10 UTC (rev 256)
@@ -1,289 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 44;
- objects = {
-
-/* Begin PBXBuildFile section */
- 4D3CB8A20DF8BB7E00AC5F00 /* Controller.rb in Resources */ = {isa = PBXBuildFile; fileRef = 4D3CB8A10DF8BB7E00AC5F00 /* Controller.rb */; };
- 4D3CB8A40DF8BCF900AC5F00 /* Superview.rb in Resources */ = {isa = PBXBuildFile; fileRef = 4D3CB8A30DF8BCF900AC5F00 /* Superview.rb */; };
- 4D3CB8A60DF8BD8E00AC5F00 /* ViewModel.rb in Resources */ = {isa = PBXBuildFile; fileRef = 4D3CB8A50DF8BD8E00AC5F00 /* ViewModel.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>"; };
- 4D3CB8A10DF8BB7E00AC5F00 /* Controller.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = Controller.rb; sourceTree = "<group>"; };
- 4D3CB8A30DF8BCF900AC5F00 /* Superview.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = Superview.rb; sourceTree = "<group>"; };
- 4D3CB8A50DF8BD8E00AC5F00 /* ViewModel.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = ViewModel.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 /* ViewModelDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ViewModelDemo.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 = (
- 4D3CB8A10DF8BB7E00AC5F00 /* Controller.rb */,
- 4D3CB8A30DF8BCF900AC5F00 /* Superview.rb */,
- 4D3CB8A50DF8BD8E00AC5F00 /* ViewModel.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 /* ViewModelDemo.app */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- 29B97314FDCFA39411CA2CEA /* ViewModelDemo */ = {
- isa = PBXGroup;
- children = (
- 080E96DDFE201D6D7F000001 /* Classes */,
- 29B97315FDCFA39411CA2CEA /* Other Sources */,
- 29B97317FDCFA39411CA2CEA /* Resources */,
- 29B97323FDCFA39411CA2CEA /* Frameworks */,
- 19C28FACFE9D520D11CA2CBB /* Products */,
- );
- name = ViewModelDemo;
- 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 /* ViewModelDemo */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "ViewModelDemo" */;
- buildPhases = (
- 8D1107290486CEB800E47090 /* Resources */,
- 8D11072C0486CEB800E47090 /* Sources */,
- 8D11072E0486CEB800E47090 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = ViewModelDemo;
- productInstallPath = "$(HOME)/Applications";
- productName = ViewModelDemo;
- productReference = 8D1107320486CEB800E47090 /* ViewModelDemo.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 "ViewModelDemo" */;
- compatibilityVersion = "Xcode 3.0";
- hasScannedForEncodings = 1;
- mainGroup = 29B97314FDCFA39411CA2CEA /* ViewModelDemo */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 8D1107260486CEB800E47090 /* ViewModelDemo */,
- );
- };
-/* 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 */,
- 4D3CB8A20DF8BB7E00AC5F00 /* Controller.rb in Resources */,
- 4D3CB8A40DF8BCF900AC5F00 /* Superview.rb in Resources */,
- 4D3CB8A60DF8BD8E00AC5F00 /* ViewModel.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 = ViewModelDemo;
- 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 = ViewModelDemo;
- WRAPPER_EXTENSION = app;
- };
- name = Release;
- };
- C01FCF4F08A954540054247B /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- GCC_ENABLE_OBJC_GC = required;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- PREBINDING = NO;
- SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
- };
- name = Debug;
- };
- C01FCF5008A954540054247B /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- GCC_ENABLE_OBJC_GC = required;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- PREBINDING = NO;
- SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "ViewModelDemo" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- C01FCF4B08A954540054247B /* Debug */,
- C01FCF4C08A954540054247B /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ViewModelDemo" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- C01FCF4F08A954540054247B /* Debug */,
- C01FCF5008A954540054247B /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
-}
Copied: MacRuby/branches/testing/sample-macruby/ViewModelDemo/ViewModelDemo.xcodeproj/project.pbxproj (from rev 255, MacRuby/trunk/sample-macruby/ViewModelDemo/ViewModelDemo.xcodeproj/project.pbxproj)
===================================================================
--- MacRuby/branches/testing/sample-macruby/ViewModelDemo/ViewModelDemo.xcodeproj/project.pbxproj (rev 0)
+++ MacRuby/branches/testing/sample-macruby/ViewModelDemo/ViewModelDemo.xcodeproj/project.pbxproj 2008-06-06 05:23:10 UTC (rev 256)
@@ -0,0 +1,289 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 44;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 4D3CB8A20DF8BB7E00AC5F00 /* Controller.rb in Resources */ = {isa = PBXBuildFile; fileRef = 4D3CB8A10DF8BB7E00AC5F00 /* Controller.rb */; };
+ 4D3CB8A40DF8BCF900AC5F00 /* Superview.rb in Resources */ = {isa = PBXBuildFile; fileRef = 4D3CB8A30DF8BCF900AC5F00 /* Superview.rb */; };
+ 4D3CB8A60DF8BD8E00AC5F00 /* ViewModel.rb in Resources */ = {isa = PBXBuildFile; fileRef = 4D3CB8A50DF8BD8E00AC5F00 /* ViewModel.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>"; };
+ 4D3CB8A10DF8BB7E00AC5F00 /* Controller.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = Controller.rb; sourceTree = "<group>"; };
+ 4D3CB8A30DF8BCF900AC5F00 /* Superview.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = Superview.rb; sourceTree = "<group>"; };
+ 4D3CB8A50DF8BD8E00AC5F00 /* ViewModel.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = ViewModel.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 /* ViewModelDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ViewModelDemo.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 = (
+ 4D3CB8A10DF8BB7E00AC5F00 /* Controller.rb */,
+ 4D3CB8A30DF8BCF900AC5F00 /* Superview.rb */,
+ 4D3CB8A50DF8BD8E00AC5F00 /* ViewModel.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 /* ViewModelDemo.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 29B97314FDCFA39411CA2CEA /* ViewModelDemo */ = {
+ isa = PBXGroup;
+ children = (
+ 080E96DDFE201D6D7F000001 /* Classes */,
+ 29B97315FDCFA39411CA2CEA /* Other Sources */,
+ 29B97317FDCFA39411CA2CEA /* Resources */,
+ 29B97323FDCFA39411CA2CEA /* Frameworks */,
+ 19C28FACFE9D520D11CA2CBB /* Products */,
+ );
+ name = ViewModelDemo;
+ 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 /* ViewModelDemo */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "ViewModelDemo" */;
+ buildPhases = (
+ 8D1107290486CEB800E47090 /* Resources */,
+ 8D11072C0486CEB800E47090 /* Sources */,
+ 8D11072E0486CEB800E47090 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = ViewModelDemo;
+ productInstallPath = "$(HOME)/Applications";
+ productName = ViewModelDemo;
+ productReference = 8D1107320486CEB800E47090 /* ViewModelDemo.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 "ViewModelDemo" */;
+ compatibilityVersion = "Xcode 3.0";
+ hasScannedForEncodings = 1;
+ mainGroup = 29B97314FDCFA39411CA2CEA /* ViewModelDemo */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 8D1107260486CEB800E47090 /* ViewModelDemo */,
+ );
+ };
+/* 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 */,
+ 4D3CB8A20DF8BB7E00AC5F00 /* Controller.rb in Resources */,
+ 4D3CB8A40DF8BCF900AC5F00 /* Superview.rb in Resources */,
+ 4D3CB8A60DF8BD8E00AC5F00 /* ViewModel.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 = ViewModelDemo;
+ 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 = ViewModelDemo;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+ C01FCF4F08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_ENABLE_OBJC_GC = required;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ PREBINDING = NO;
+ SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
+ };
+ name = Debug;
+ };
+ C01FCF5008A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_ENABLE_OBJC_GC = required;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ PREBINDING = NO;
+ SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "ViewModelDemo" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4B08A954540054247B /* Debug */,
+ C01FCF4C08A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ViewModelDemo" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4F08A954540054247B /* Debug */,
+ C01FCF5008A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
+}
Deleted: MacRuby/branches/testing/sample-macruby/ViewModelDemo/main.m
===================================================================
--- MacRuby/trunk/sample-macruby/ViewModelDemo/main.m 2008-06-06 05:06:01 UTC (rev 255)
+++ MacRuby/branches/testing/sample-macruby/ViewModelDemo/main.m 2008-06-06 05:23:10 UTC (rev 256)
@@ -1,14 +0,0 @@
-//
-// main.m
-// ViewModelDemo
-//
-// Created by Laurent Sansonetti on 6/5/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);
-}
Copied: MacRuby/branches/testing/sample-macruby/ViewModelDemo/main.m (from rev 255, MacRuby/trunk/sample-macruby/ViewModelDemo/main.m)
===================================================================
--- MacRuby/branches/testing/sample-macruby/ViewModelDemo/main.m (rev 0)
+++ MacRuby/branches/testing/sample-macruby/ViewModelDemo/main.m 2008-06-06 05:23:10 UTC (rev 256)
@@ -0,0 +1,14 @@
+//
+// main.m
+// ViewModelDemo
+//
+// Created by Laurent Sansonetti on 6/5/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);
+}
Deleted: MacRuby/branches/testing/sample-macruby/ViewModelDemo/rb_main.rb
===================================================================
--- MacRuby/trunk/sample-macruby/ViewModelDemo/rb_main.rb 2008-06-06 05:06:01 UTC (rev 255)
+++ MacRuby/branches/testing/sample-macruby/ViewModelDemo/rb_main.rb 2008-06-06 05:23:10 UTC (rev 256)
@@ -1,22 +0,0 @@
-#
-# rb_main.rb
-# ViewModelDemo
-#
-# Created by Laurent Sansonetti on 6/5/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)
Copied: MacRuby/branches/testing/sample-macruby/ViewModelDemo/rb_main.rb (from rev 255, MacRuby/trunk/sample-macruby/ViewModelDemo/rb_main.rb)
===================================================================
--- MacRuby/branches/testing/sample-macruby/ViewModelDemo/rb_main.rb (rev 0)
+++ MacRuby/branches/testing/sample-macruby/ViewModelDemo/rb_main.rb 2008-06-06 05:23:10 UTC (rev 256)
@@ -0,0 +1,22 @@
+#
+# rb_main.rb
+# ViewModelDemo
+#
+# Created by Laurent Sansonetti on 6/5/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)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macruby-changes/attachments/20080605/bf54a4e6/attachment-0001.htm
More information about the macruby-changes
mailing list