update cocoa bridge to use c-type words
parent
c5dd8d0b20
commit
cc5f9ff98a
|
@ -16,11 +16,11 @@ CLASS: {
|
||||||
{ +superclass+ "NSObject" }
|
{ +superclass+ "NSObject" }
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "perform:" "void" { "id" "SEL" "id" }
|
{ "perform:" void { id SEL id }
|
||||||
[ 2drop callbacks get at try ]
|
[ 2drop callbacks get at try ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "dealloc" "void" { "id" "SEL" }
|
{ "dealloc" void { id SEL }
|
||||||
[
|
[
|
||||||
drop
|
drop
|
||||||
dup callbacks get delete-at
|
dup callbacks get delete-at
|
||||||
|
|
|
@ -8,8 +8,8 @@ CLASS: {
|
||||||
{ +name+ "Foo" }
|
{ +name+ "Foo" }
|
||||||
} {
|
} {
|
||||||
"foo:"
|
"foo:"
|
||||||
"void"
|
void
|
||||||
{ "id" "SEL" "NSRect" }
|
{ id SEL NSRect }
|
||||||
[ gc "x" set 2drop ]
|
[ gc "x" set 2drop ]
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
@ -30,8 +30,8 @@ CLASS: {
|
||||||
{ +name+ "Bar" }
|
{ +name+ "Bar" }
|
||||||
} {
|
} {
|
||||||
"bar"
|
"bar"
|
||||||
"NSRect"
|
NSRect
|
||||||
{ "id" "SEL" }
|
{ id SEL }
|
||||||
[ 2drop test-foo "x" get ]
|
[ 2drop test-foo "x" get ]
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
@ -52,13 +52,13 @@ CLASS: {
|
||||||
{ +name+ "Bar" }
|
{ +name+ "Bar" }
|
||||||
} {
|
} {
|
||||||
"bar"
|
"bar"
|
||||||
"NSRect"
|
NSRect
|
||||||
{ "id" "SEL" }
|
{ id SEL }
|
||||||
[ 2drop test-foo "x" get ]
|
[ 2drop test-foo "x" get ]
|
||||||
} {
|
} {
|
||||||
"babb"
|
"babb"
|
||||||
"int"
|
int
|
||||||
{ "id" "SEL" "int" }
|
{ id SEL int }
|
||||||
[ 2nip sq ]
|
[ 2nip sq ]
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,12 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors alien alien.c-types alien.strings arrays assocs
|
USING: accessors alien alien.c-types alien.strings arrays assocs
|
||||||
classes.struct continuations combinators compiler compiler.alien
|
classes.struct continuations combinators compiler compiler.alien
|
||||||
stack-checker kernel math namespaces make quotations sequences
|
core-graphics.types stack-checker kernel math namespaces make
|
||||||
strings words cocoa.runtime io macros memoize io.encodings.utf8
|
quotations sequences strings words cocoa.runtime cocoa.types io
|
||||||
effects libc libc.private lexer init core-foundation fry
|
macros memoize io.encodings.utf8 effects layouts libc
|
||||||
generalizations specialized-arrays ;
|
libc.private lexer init core-foundation fry generalizations
|
||||||
|
specialized-arrays ;
|
||||||
|
QUALIFIED-WITH: alien.c-types c
|
||||||
IN: cocoa.messages
|
IN: cocoa.messages
|
||||||
|
|
||||||
SPECIALIZED-ARRAY: void*
|
SPECIALIZED-ARRAY: void*
|
||||||
|
@ -98,75 +100,84 @@ class-init-hooks [ H{ } clone ] initialize
|
||||||
SYMBOL: objc>alien-types
|
SYMBOL: objc>alien-types
|
||||||
|
|
||||||
H{
|
H{
|
||||||
{ "c" "char" }
|
{ "c" c:char }
|
||||||
{ "i" "int" }
|
{ "i" c:int }
|
||||||
{ "s" "short" }
|
{ "s" c:short }
|
||||||
{ "C" "uchar" }
|
{ "C" c:uchar }
|
||||||
{ "I" "uint" }
|
{ "I" c:uint }
|
||||||
{ "S" "ushort" }
|
{ "S" c:ushort }
|
||||||
{ "f" "float" }
|
{ "f" c:float }
|
||||||
{ "d" "double" }
|
{ "d" c:double }
|
||||||
{ "B" "bool" }
|
{ "B" c:bool }
|
||||||
{ "v" "void" }
|
{ "v" c:void }
|
||||||
{ "*" "char*" }
|
{ "*" c:char* }
|
||||||
{ "?" "unknown_type" }
|
{ "?" unknown_type }
|
||||||
{ "@" "id" }
|
{ "@" id }
|
||||||
{ "#" "Class" }
|
{ "#" Class }
|
||||||
{ ":" "SEL" }
|
{ ":" SEL }
|
||||||
}
|
}
|
||||||
"ptrdiff_t" heap-size {
|
cell {
|
||||||
{ 4 [ H{
|
{ 4 [ H{
|
||||||
{ "l" "long" }
|
{ "l" c:long }
|
||||||
{ "q" "longlong" }
|
{ "q" c:longlong }
|
||||||
{ "L" "ulong" }
|
{ "L" c:ulong }
|
||||||
{ "Q" "ulonglong" }
|
{ "Q" c:ulonglong }
|
||||||
} ] }
|
} ] }
|
||||||
{ 8 [ H{
|
{ 8 [ H{
|
||||||
{ "l" "long32" }
|
{ "l" long32 }
|
||||||
{ "q" "long" }
|
{ "q" long }
|
||||||
{ "L" "ulong32" }
|
{ "L" ulong32 }
|
||||||
{ "Q" "ulong" }
|
{ "Q" ulong }
|
||||||
} ] }
|
} ] }
|
||||||
} case
|
} case
|
||||||
assoc-union objc>alien-types set-global
|
assoc-union objc>alien-types set-global
|
||||||
|
|
||||||
|
SYMBOL: objc>struct-types
|
||||||
|
|
||||||
|
H{
|
||||||
|
{ "_NSPoint" NSPoint }
|
||||||
|
{ "NSPoint" NSPoint }
|
||||||
|
{ "CGPoint" NSPoint }
|
||||||
|
{ "_NSRect" NSRect }
|
||||||
|
{ "NSRect" NSRect }
|
||||||
|
{ "CGRect" NSRect }
|
||||||
|
{ "_NSSize" NSSize }
|
||||||
|
{ "NSSize" NSSize }
|
||||||
|
{ "CGSize" NSSize }
|
||||||
|
{ "_NSRange" NSRange }
|
||||||
|
{ "NSRange" NSRange }
|
||||||
|
} objc>struct-types set-global
|
||||||
|
|
||||||
! The transpose of the above map
|
! The transpose of the above map
|
||||||
SYMBOL: alien>objc-types
|
SYMBOL: alien>objc-types
|
||||||
|
|
||||||
objc>alien-types get [ swap ] assoc-map
|
objc>alien-types get [ swap ] assoc-map
|
||||||
! A hack...
|
! A hack...
|
||||||
"ptrdiff_t" heap-size {
|
cell {
|
||||||
{ 4 [ H{
|
{ 4 [ H{
|
||||||
{ "NSPoint" "{_NSPoint=ff}" }
|
{ NSPoint "{_NSPoint=ff}" }
|
||||||
{ "NSRect" "{_NSRect={_NSPoint=ff}{_NSSize=ff}}" }
|
{ NSRect "{_NSRect={_NSPoint=ff}{_NSSize=ff}}" }
|
||||||
{ "NSSize" "{_NSSize=ff}" }
|
{ NSSize "{_NSSize=ff}" }
|
||||||
{ "NSRange" "{_NSRange=II}" }
|
{ NSRange "{_NSRange=II}" }
|
||||||
{ "NSInteger" "i" }
|
{ NSInteger "i" }
|
||||||
{ "NSUInteger" "I" }
|
{ NSUInteger "I" }
|
||||||
{ "CGFloat" "f" }
|
{ CGFloat "f" }
|
||||||
} ] }
|
} ] }
|
||||||
{ 8 [ H{
|
{ 8 [ H{
|
||||||
{ "NSPoint" "{CGPoint=dd}" }
|
{ NSPoint "{CGPoint=dd}" }
|
||||||
{ "NSRect" "{CGRect={CGPoint=dd}{CGSize=dd}}" }
|
{ NSRect "{CGRect={CGPoint=dd}{CGSize=dd}}" }
|
||||||
{ "NSSize" "{CGSize=dd}" }
|
{ NSSize "{CGSize=dd}" }
|
||||||
{ "NSRange" "{_NSRange=QQ}" }
|
{ NSRange "{_NSRange=QQ}" }
|
||||||
{ "NSInteger" "q" }
|
{ NSInteger "q" }
|
||||||
{ "NSUInteger" "Q" }
|
{ NSUInteger "Q" }
|
||||||
{ "CGFloat" "d" }
|
{ CGFloat "d" }
|
||||||
} ] }
|
} ] }
|
||||||
} case
|
} case
|
||||||
assoc-union alien>objc-types set-global
|
assoc-union alien>objc-types set-global
|
||||||
|
|
||||||
: internal-cocoa-type? ( c-type -- ? )
|
|
||||||
[ "?" = ] [ first CHAR: _ = ] bi or ;
|
|
||||||
|
|
||||||
: warn-c-type ( c-type -- )
|
|
||||||
dup internal-cocoa-type?
|
|
||||||
[ drop ] [ "Warning: no such C type: " write print ] if ;
|
|
||||||
|
|
||||||
: objc-struct-type ( i string -- ctype )
|
: objc-struct-type ( i string -- ctype )
|
||||||
[ CHAR: = ] 2keep index-from swap subseq
|
[ CHAR: = ] 2keep index-from swap subseq
|
||||||
dup c-types get key? [ warn-c-type "void*" ] unless ;
|
objc>struct-types get at* [ drop void* ] unless ;
|
||||||
|
|
||||||
ERROR: no-objc-type name ;
|
ERROR: no-objc-type name ;
|
||||||
|
|
||||||
|
@ -177,9 +188,9 @@ ERROR: no-objc-type name ;
|
||||||
: (parse-objc-type) ( i string -- ctype )
|
: (parse-objc-type) ( i string -- ctype )
|
||||||
[ [ 1 + ] dip ] [ nth ] 2bi {
|
[ [ 1 + ] dip ] [ nth ] 2bi {
|
||||||
{ [ dup "rnNoORV" member? ] [ drop (parse-objc-type) ] }
|
{ [ dup "rnNoORV" member? ] [ drop (parse-objc-type) ] }
|
||||||
{ [ dup CHAR: ^ = ] [ 3drop "void*" ] }
|
{ [ dup CHAR: ^ = ] [ 3drop void* ] }
|
||||||
{ [ dup CHAR: { = ] [ drop objc-struct-type ] }
|
{ [ dup CHAR: { = ] [ drop objc-struct-type ] }
|
||||||
{ [ dup CHAR: [ = ] [ 3drop "void*" ] }
|
{ [ dup CHAR: [ = ] [ 3drop void* ] }
|
||||||
[ 2nip decode-type ]
|
[ 2nip decode-type ]
|
||||||
} cond ;
|
} cond ;
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,8 @@ CLASS: {
|
||||||
{ +name+ "Bar" }
|
{ +name+ "Bar" }
|
||||||
} {
|
} {
|
||||||
"bar:"
|
"bar:"
|
||||||
"float"
|
float
|
||||||
{ "id" "SEL" "NSRect" }
|
{ id SEL NSRect }
|
||||||
[
|
[
|
||||||
[ origin>> [ x>> ] [ y>> ] bi + ]
|
[ origin>> [ x>> ] [ y>> ] bi + ]
|
||||||
[ size>> [ w>> ] [ h>> ] bi + ]
|
[ size>> [ w>> ] [ h>> ] bi + ]
|
||||||
|
|
|
@ -218,7 +218,7 @@ CLASS: {
|
||||||
{ +name+ "FactorApplicationDelegate" }
|
{ +name+ "FactorApplicationDelegate" }
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "applicationDidUpdate:" "void" { "id" "SEL" "id" }
|
{ "applicationDidUpdate:" void { id SEL id }
|
||||||
[ 3drop reset-run-loop ]
|
[ 3drop reset-run-loop ]
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
! Copyright (C) 2006, 2009 Slava Pestov.
|
! Copyright (C) 2006, 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: alien.syntax cocoa cocoa.nibs cocoa.application
|
USING: alien.syntax cocoa cocoa.nibs cocoa.application
|
||||||
cocoa.classes cocoa.dialogs cocoa.pasteboard cocoa.subclassing
|
cocoa.classes cocoa.dialogs cocoa.pasteboard cocoa.runtime
|
||||||
core-foundation core-foundation.strings help.topics kernel
|
cocoa.subclassing core-foundation core-foundation.strings
|
||||||
memory namespaces parser system ui ui.tools.browser
|
help.topics kernel memory namespaces parser system ui
|
||||||
ui.tools.listener ui.backend.cocoa eval locals
|
ui.tools.browser ui.tools.listener ui.backend.cocoa eval
|
||||||
vocabs.refresh ;
|
locals vocabs.refresh ;
|
||||||
|
FROM: alien.c-types => int void ;
|
||||||
IN: ui.backend.cocoa.tools
|
IN: ui.backend.cocoa.tools
|
||||||
|
|
||||||
: finder-run-files ( alien -- )
|
: finder-run-files ( alien -- )
|
||||||
|
@ -25,43 +26,43 @@ CLASS: {
|
||||||
{ +name+ "FactorWorkspaceApplicationDelegate" }
|
{ +name+ "FactorWorkspaceApplicationDelegate" }
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "application:openFiles:" "void" { "id" "SEL" "id" "id" }
|
{ "application:openFiles:" void { id SEL id id }
|
||||||
[ [ 3drop ] dip finder-run-files ]
|
[ [ 3drop ] dip finder-run-files ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "applicationShouldHandleReopen:hasVisibleWindows:" "int" { "id" "SEL" "id" "int" }
|
{ "applicationShouldHandleReopen:hasVisibleWindows:" int { id SEL id int }
|
||||||
[ [ 3drop ] dip 0 = [ show-listener ] when 1 ]
|
[ [ 3drop ] dip 0 = [ show-listener ] when 1 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "factorListener:" "id" { "id" "SEL" "id" }
|
{ "factorListener:" id { id SEL id }
|
||||||
[ 3drop show-listener f ]
|
[ 3drop show-listener f ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "factorBrowser:" "id" { "id" "SEL" "id" }
|
{ "factorBrowser:" id { id SEL id }
|
||||||
[ 3drop show-browser f ]
|
[ 3drop show-browser f ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "newFactorListener:" "id" { "id" "SEL" "id" }
|
{ "newFactorListener:" id { id SEL id }
|
||||||
[ 3drop listener-window f ]
|
[ 3drop listener-window f ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "newFactorBrowser:" "id" { "id" "SEL" "id" }
|
{ "newFactorBrowser:" id { id SEL id }
|
||||||
[ 3drop browser-window f ]
|
[ 3drop browser-window f ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "runFactorFile:" "id" { "id" "SEL" "id" }
|
{ "runFactorFile:" id { id SEL id }
|
||||||
[ 3drop menu-run-files f ]
|
[ 3drop menu-run-files f ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "saveFactorImage:" "id" { "id" "SEL" "id" }
|
{ "saveFactorImage:" id { id SEL id }
|
||||||
[ 3drop save f ]
|
[ 3drop save f ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "saveFactorImageAs:" "id" { "id" "SEL" "id" }
|
{ "saveFactorImageAs:" id { id SEL id }
|
||||||
[ 3drop menu-save-image f ]
|
[ 3drop menu-save-image f ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "refreshAll:" "id" { "id" "SEL" "id" }
|
{ "refreshAll:" id { id SEL id }
|
||||||
[ 3drop [ refresh-all ] \ refresh-all call-listener f ]
|
[ 3drop [ refresh-all ] \ refresh-all call-listener f ]
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
@ -79,13 +80,13 @@ CLASS: {
|
||||||
{ +name+ "FactorServiceProvider" }
|
{ +name+ "FactorServiceProvider" }
|
||||||
} {
|
} {
|
||||||
"evalInListener:userData:error:"
|
"evalInListener:userData:error:"
|
||||||
"void"
|
void
|
||||||
{ "id" "SEL" "id" "id" "id" }
|
{ id SEL id id id }
|
||||||
[ nip [ eval-listener f ] do-service 2drop ]
|
[ nip [ eval-listener f ] do-service 2drop ]
|
||||||
} {
|
} {
|
||||||
"evalToString:userData:error:"
|
"evalToString:userData:error:"
|
||||||
"void"
|
void
|
||||||
{ "id" "SEL" "id" "id" "id" }
|
{ id SEL id id id }
|
||||||
[ nip [ eval>string ] do-service 2drop ]
|
[ nip [ eval>string ] do-service 2drop ]
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
USING: accessors alien alien.c-types alien.data alien.strings
|
USING: accessors alien alien.c-types alien.data alien.strings
|
||||||
arrays assocs cocoa kernel math cocoa.messages cocoa.subclassing
|
arrays assocs cocoa kernel math cocoa.messages cocoa.subclassing
|
||||||
cocoa.classes cocoa.views cocoa.application cocoa.pasteboard
|
cocoa.classes cocoa.views cocoa.application cocoa.pasteboard
|
||||||
cocoa.types cocoa.windows sequences io.encodings.utf8 ui ui.private
|
cocoa.runtime cocoa.types cocoa.windows sequences io.encodings.utf8
|
||||||
ui.gadgets ui.gadgets.private ui.gadgets.worlds ui.gestures
|
ui ui.private ui.gadgets ui.gadgets.private ui.gadgets.worlds ui.gestures
|
||||||
core-foundation.strings core-graphics core-graphics.types threads
|
core-foundation.strings core-graphics core-graphics.types threads
|
||||||
combinators math.rectangles ;
|
combinators math.rectangles ;
|
||||||
IN: ui.backend.cocoa.views
|
IN: ui.backend.cocoa.views
|
||||||
|
@ -148,76 +148,76 @@ CLASS: {
|
||||||
}
|
}
|
||||||
|
|
||||||
! Rendering
|
! Rendering
|
||||||
{ "drawRect:" "void" { "id" "SEL" "NSRect" }
|
{ "drawRect:" void { id SEL NSRect }
|
||||||
[ 2drop window relayout-1 yield ]
|
[ 2drop window relayout-1 yield ]
|
||||||
}
|
}
|
||||||
|
|
||||||
! Events
|
! Events
|
||||||
{ "acceptsFirstMouse:" "char" { "id" "SEL" "id" }
|
{ "acceptsFirstMouse:" char { id SEL id }
|
||||||
[ 3drop 1 ]
|
[ 3drop 1 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "mouseEntered:" "void" { "id" "SEL" "id" }
|
{ "mouseEntered:" void { id SEL id }
|
||||||
[ nip send-mouse-moved ]
|
[ nip send-mouse-moved ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "mouseExited:" "void" { "id" "SEL" "id" }
|
{ "mouseExited:" void { id SEL id }
|
||||||
[ 3drop forget-rollover ]
|
[ 3drop forget-rollover ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "mouseMoved:" "void" { "id" "SEL" "id" }
|
{ "mouseMoved:" void { id SEL id }
|
||||||
[ nip send-mouse-moved ]
|
[ nip send-mouse-moved ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "mouseDragged:" "void" { "id" "SEL" "id" }
|
{ "mouseDragged:" void { id SEL id }
|
||||||
[ nip send-mouse-moved ]
|
[ nip send-mouse-moved ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "rightMouseDragged:" "void" { "id" "SEL" "id" }
|
{ "rightMouseDragged:" void { id SEL id }
|
||||||
[ nip send-mouse-moved ]
|
[ nip send-mouse-moved ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "otherMouseDragged:" "void" { "id" "SEL" "id" }
|
{ "otherMouseDragged:" void { id SEL id }
|
||||||
[ nip send-mouse-moved ]
|
[ nip send-mouse-moved ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "mouseDown:" "void" { "id" "SEL" "id" }
|
{ "mouseDown:" void { id SEL id }
|
||||||
[ nip send-button-down$ ]
|
[ nip send-button-down$ ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "mouseUp:" "void" { "id" "SEL" "id" }
|
{ "mouseUp:" void { id SEL id }
|
||||||
[ nip send-button-up$ ]
|
[ nip send-button-up$ ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "rightMouseDown:" "void" { "id" "SEL" "id" }
|
{ "rightMouseDown:" void { id SEL id }
|
||||||
[ nip send-button-down$ ]
|
[ nip send-button-down$ ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "rightMouseUp:" "void" { "id" "SEL" "id" }
|
{ "rightMouseUp:" void { id SEL id }
|
||||||
[ nip send-button-up$ ]
|
[ nip send-button-up$ ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "otherMouseDown:" "void" { "id" "SEL" "id" }
|
{ "otherMouseDown:" void { id SEL id }
|
||||||
[ nip send-button-down$ ]
|
[ nip send-button-down$ ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "otherMouseUp:" "void" { "id" "SEL" "id" }
|
{ "otherMouseUp:" void { id SEL id }
|
||||||
[ nip send-button-up$ ]
|
[ nip send-button-up$ ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "scrollWheel:" "void" { "id" "SEL" "id" }
|
{ "scrollWheel:" void { id SEL id }
|
||||||
[ nip send-wheel$ ]
|
[ nip send-wheel$ ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "keyDown:" "void" { "id" "SEL" "id" }
|
{ "keyDown:" void { id SEL id }
|
||||||
[ nip send-key-down-event ]
|
[ nip send-key-down-event ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "keyUp:" "void" { "id" "SEL" "id" }
|
{ "keyUp:" void { id SEL id }
|
||||||
[ nip send-key-up-event ]
|
[ nip send-key-up-event ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "validateUserInterfaceItem:" "char" { "id" "SEL" "id" }
|
{ "validateUserInterfaceItem:" char { id SEL id }
|
||||||
[
|
[
|
||||||
nip -> action
|
nip -> action
|
||||||
2dup [ window ] [ utf8 alien>string ] bi* validate-action
|
2dup [ window ] [ utf8 alien>string ] bi* validate-action
|
||||||
|
@ -225,57 +225,57 @@ CLASS: {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "undo:" "id" { "id" "SEL" "id" }
|
{ "undo:" id { id SEL id }
|
||||||
[ nip undo-action send-action$ ]
|
[ nip undo-action send-action$ ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "redo:" "id" { "id" "SEL" "id" }
|
{ "redo:" id { id SEL id }
|
||||||
[ nip redo-action send-action$ ]
|
[ nip redo-action send-action$ ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "cut:" "id" { "id" "SEL" "id" }
|
{ "cut:" id { id SEL id }
|
||||||
[ nip cut-action send-action$ ]
|
[ nip cut-action send-action$ ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "copy:" "id" { "id" "SEL" "id" }
|
{ "copy:" id { id SEL id }
|
||||||
[ nip copy-action send-action$ ]
|
[ nip copy-action send-action$ ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "paste:" "id" { "id" "SEL" "id" }
|
{ "paste:" id { id SEL id }
|
||||||
[ nip paste-action send-action$ ]
|
[ nip paste-action send-action$ ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "delete:" "id" { "id" "SEL" "id" }
|
{ "delete:" id { id SEL id }
|
||||||
[ nip delete-action send-action$ ]
|
[ nip delete-action send-action$ ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "selectAll:" "id" { "id" "SEL" "id" }
|
{ "selectAll:" id { id SEL id }
|
||||||
[ nip select-all-action send-action$ ]
|
[ nip select-all-action send-action$ ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "newDocument:" "id" { "id" "SEL" "id" }
|
{ "newDocument:" id { id SEL id }
|
||||||
[ nip new-action send-action$ ]
|
[ nip new-action send-action$ ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "openDocument:" "id" { "id" "SEL" "id" }
|
{ "openDocument:" id { id SEL id }
|
||||||
[ nip open-action send-action$ ]
|
[ nip open-action send-action$ ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "saveDocument:" "id" { "id" "SEL" "id" }
|
{ "saveDocument:" id { id SEL id }
|
||||||
[ nip save-action send-action$ ]
|
[ nip save-action send-action$ ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "saveDocumentAs:" "id" { "id" "SEL" "id" }
|
{ "saveDocumentAs:" id { id SEL id }
|
||||||
[ nip save-as-action send-action$ ]
|
[ nip save-as-action send-action$ ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "revertDocumentToSaved:" "id" { "id" "SEL" "id" }
|
{ "revertDocumentToSaved:" id { id SEL id }
|
||||||
[ nip revert-action send-action$ ]
|
[ nip revert-action send-action$ ]
|
||||||
}
|
}
|
||||||
|
|
||||||
! Multi-touch gestures: this is undocumented.
|
! Multi-touch gestures: this is undocumented.
|
||||||
! http://cocoadex.com/2008/02/nsevent-modifications-swipe-ro.html
|
! http://cocoadex.com/2008/02/nsevent-modifications-swipe-ro.html
|
||||||
{ "magnifyWithEvent:" "void" { "id" "SEL" "id" }
|
{ "magnifyWithEvent:" void { id SEL id }
|
||||||
[
|
[
|
||||||
nip
|
nip
|
||||||
dup -> deltaZ sgn {
|
dup -> deltaZ sgn {
|
||||||
|
@ -286,7 +286,7 @@ CLASS: {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "swipeWithEvent:" "void" { "id" "SEL" "id" }
|
{ "swipeWithEvent:" void { id SEL id }
|
||||||
[
|
[
|
||||||
nip
|
nip
|
||||||
dup -> deltaX sgn {
|
dup -> deltaX sgn {
|
||||||
|
@ -305,14 +305,14 @@ CLASS: {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
! "rotateWithEvent:" "void" { "id" "SEL" "id" }}
|
! "rotateWithEvent:" void { id SEL id }}
|
||||||
|
|
||||||
{ "acceptsFirstResponder" "char" { "id" "SEL" }
|
{ "acceptsFirstResponder" char { id SEL }
|
||||||
[ 2drop 1 ]
|
[ 2drop 1 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
! Services
|
! Services
|
||||||
{ "validRequestorForSendType:returnType:" "id" { "id" "SEL" "id" "id" }
|
{ "validRequestorForSendType:returnType:" id { id SEL id id }
|
||||||
[
|
[
|
||||||
! We return either self or nil
|
! We return either self or nil
|
||||||
[ over window-focus ] 2dip
|
[ over window-focus ] 2dip
|
||||||
|
@ -320,7 +320,7 @@ CLASS: {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "writeSelectionToPasteboard:types:" "char" { "id" "SEL" "id" "id" }
|
{ "writeSelectionToPasteboard:types:" char { id SEL id id }
|
||||||
[
|
[
|
||||||
CF>string-array NSStringPboardType swap member? [
|
CF>string-array NSStringPboardType swap member? [
|
||||||
[ drop window-focus gadget-selection ] dip over
|
[ drop window-focus gadget-selection ] dip over
|
||||||
|
@ -329,7 +329,7 @@ CLASS: {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "readSelectionFromPasteboard:" "char" { "id" "SEL" "id" }
|
{ "readSelectionFromPasteboard:" char { id SEL id }
|
||||||
[
|
[
|
||||||
pasteboard-string dup [
|
pasteboard-string dup [
|
||||||
[ drop window ] dip swap user-input 1
|
[ drop window ] dip swap user-input 1
|
||||||
|
@ -338,60 +338,60 @@ CLASS: {
|
||||||
}
|
}
|
||||||
|
|
||||||
! Text input
|
! Text input
|
||||||
{ "insertText:" "void" { "id" "SEL" "id" }
|
{ "insertText:" void { id SEL id }
|
||||||
[ nip CF>string swap window user-input ]
|
[ nip CF>string swap window user-input ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "hasMarkedText" "char" { "id" "SEL" }
|
{ "hasMarkedText" char { id SEL }
|
||||||
[ 2drop 0 ]
|
[ 2drop 0 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "markedRange" "NSRange" { "id" "SEL" }
|
{ "markedRange" NSRange { id SEL }
|
||||||
[ 2drop 0 0 <NSRange> ]
|
[ 2drop 0 0 <NSRange> ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "selectedRange" "NSRange" { "id" "SEL" }
|
{ "selectedRange" NSRange { id SEL }
|
||||||
[ 2drop 0 0 <NSRange> ]
|
[ 2drop 0 0 <NSRange> ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "setMarkedText:selectedRange:" "void" { "id" "SEL" "id" "NSRange" }
|
{ "setMarkedText:selectedRange:" void { id SEL id NSRange }
|
||||||
[ 2drop 2drop ]
|
[ 2drop 2drop ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "unmarkText" "void" { "id" "SEL" }
|
{ "unmarkText" void { id SEL }
|
||||||
[ 2drop ]
|
[ 2drop ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "validAttributesForMarkedText" "id" { "id" "SEL" }
|
{ "validAttributesForMarkedText" id { id SEL }
|
||||||
[ 2drop NSArray -> array ]
|
[ 2drop NSArray -> array ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "attributedSubstringFromRange:" "id" { "id" "SEL" "NSRange" }
|
{ "attributedSubstringFromRange:" id { id SEL NSRange }
|
||||||
[ 3drop f ]
|
[ 3drop f ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "characterIndexForPoint:" "NSUInteger" { "id" "SEL" "NSPoint" }
|
{ "characterIndexForPoint:" NSUInteger { id SEL NSPoint }
|
||||||
[ 3drop 0 ]
|
[ 3drop 0 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "firstRectForCharacterRange:" "NSRect" { "id" "SEL" "NSRange" }
|
{ "firstRectForCharacterRange:" NSRect { id SEL NSRange }
|
||||||
[ 3drop 0 0 0 0 <CGRect> ]
|
[ 3drop 0 0 0 0 <CGRect> ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "conversationIdentifier" "NSInteger" { "id" "SEL" }
|
{ "conversationIdentifier" NSInteger { id SEL }
|
||||||
[ drop alien-address ]
|
[ drop alien-address ]
|
||||||
}
|
}
|
||||||
|
|
||||||
! Initialization
|
! Initialization
|
||||||
{ "updateFactorGadgetSize:" "void" { "id" "SEL" "id" }
|
{ "updateFactorGadgetSize:" void { id SEL id }
|
||||||
[ 2drop [ window ] [ view-dim ] bi >>dim drop yield ]
|
[ 2drop [ window ] [ view-dim ] bi >>dim drop yield ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "doCommandBySelector:" "void" { "id" "SEL" "SEL" }
|
{ "doCommandBySelector:" void { id SEL SEL }
|
||||||
[ 3drop ]
|
[ 3drop ]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "initWithFrame:pixelFormat:" "id" { "id" "SEL" "NSRect" "id" }
|
{ "initWithFrame:pixelFormat:" id { id SEL NSRect id }
|
||||||
[
|
[
|
||||||
[ drop ] 2dip
|
[ drop ] 2dip
|
||||||
SUPER-> initWithFrame:pixelFormat:
|
SUPER-> initWithFrame:pixelFormat:
|
||||||
|
@ -399,13 +399,13 @@ CLASS: {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "isOpaque" "char" { "id" "SEL" }
|
{ "isOpaque" char { id SEL }
|
||||||
[
|
[
|
||||||
2drop 0
|
2drop 0
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "dealloc" "void" { "id" "SEL" }
|
{ "dealloc" void { id SEL }
|
||||||
[
|
[
|
||||||
drop
|
drop
|
||||||
[ unregister-window ]
|
[ unregister-window ]
|
||||||
|
@ -430,19 +430,19 @@ CLASS: {
|
||||||
{ +name+ "FactorWindowDelegate" }
|
{ +name+ "FactorWindowDelegate" }
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "windowDidMove:" "void" { "id" "SEL" "id" }
|
{ "windowDidMove:" void { id SEL id }
|
||||||
[
|
[
|
||||||
2nip -> object [ -> contentView window ] keep save-position
|
2nip -> object [ -> contentView window ] keep save-position
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "windowDidBecomeKey:" "void" { "id" "SEL" "id" }
|
{ "windowDidBecomeKey:" void { id SEL id }
|
||||||
[
|
[
|
||||||
2nip -> object -> contentView window focus-world
|
2nip -> object -> contentView window focus-world
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "windowDidResignKey:" "void" { "id" "SEL" "id" }
|
{ "windowDidResignKey:" void { id SEL id }
|
||||||
[
|
[
|
||||||
forget-rollover
|
forget-rollover
|
||||||
2nip -> object -> contentView
|
2nip -> object -> contentView
|
||||||
|
@ -452,13 +452,13 @@ CLASS: {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "windowShouldClose:" "char" { "id" "SEL" "id" }
|
{ "windowShouldClose:" char { id SEL id }
|
||||||
[
|
[
|
||||||
3drop 1
|
3drop 1
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
{ "windowWillClose:" "void" { "id" "SEL" "id" }
|
{ "windowWillClose:" void { id SEL id }
|
||||||
[
|
[
|
||||||
2nip -> object -> contentView window ungraft
|
2nip -> object -> contentView window ungraft
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue