Skip to content

Commit

Permalink
welder looks better on mac (application name, menu bar); provide impl…
Browse files Browse the repository at this point in the history
…ementation of hashCode for proxy interface implementations in arc
  • Loading branch information
conanite committed May 29, 2010
1 parent d78869f commit 513f6a3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/arc/lib/midi/midi.arc
Expand Up @@ -263,6 +263,18 @@
(cons (+ semitones car.n) cdr.n))
(fn (note) (note-apply f note))))

(mac three-note-sequence args
(let f (fn (seq2)
(list (mksym 's seq2.0 '/ seq2.1)
'(note v1 (o v2 mf) (o length 1))
`(mono (note v1 length)
((note 'transpose ,seq2.0) v2 length)
((note 'transpose ,seq2.1) v2 length))))
`(defs ,@(mappend f (tuples args 2)))))

(three-note-sequence
-5 -8 -4 -2 2 4 3 1 4 2 5 2)

(mac four-note-sequence args
(let f (fn (seq3)
(list (mksym 's seq3.0 '/ seq3.1 '/ seq3.2)
Expand Down
2 changes: 1 addition & 1 deletion src/arc/rainbow.sh
@@ -1,3 +1,3 @@
CP=`echo rainbow/java-lib/* | sed 's/ /\:/g'`
java -Xmx1G -Dswing.aatext=true -server -cp rainbow.jar:$CP rainbow.Console $*
java -Xmx1G -Xdock:name=Rainbow -Dswing.aatext=true -server -cp rainbow.jar:$CP rainbow.Console $*

9 changes: 9 additions & 0 deletions src/arc/rainbow/welder.arc
Expand Up @@ -721,7 +721,16 @@

(assign open-welders (table))

(java-imports javax.swing UIManager)
(java-imports java.lang System)

(def welder-first-time ()
(UIManager 'setLookAndFeel UIManager.getSystemLookAndFeelClassName)
(System 'setProperty "apple.laf.useScreenMenuBar" "true")
(assign welder-first-time nilfn))

(def welder ((o file) (o txt))
(welder-first-time)
(let wname (if file canonical-path.file
txt "*scratch(#((len open-welders)))*"
"*scratch*")
Expand Down
2 changes: 2 additions & 0 deletions src/java/rainbow/types/JavaProxy.java
Expand Up @@ -54,6 +54,8 @@ public Object invoke2(Object target, Method method, Object[] arguments) throws T
}
if (method.getName().equals("toString")) {
return "Arc implementation of " + interfaces + " : " + functions.toString();
} else if (method.getName().equals("hashCode")) {
return this.hashCode();
} else {
if (strict) {
throw new ArcError("No implementation provided for " + method + "; implementations include " + functions);
Expand Down

0 comments on commit 513f6a3

Please sign in to comment.