syntax: more fixes

locals-and-roots
Doug Coleman 2016-06-05 17:07:04 -07:00
parent 045077fd3f
commit 98d9e2eb9c
4 changed files with 26 additions and 28 deletions

View File

@ -202,8 +202,8 @@ ERROR: no-objc-type name ;
[ [ 1 + ] dip ] [ nth ] 2bi {
{ [ dup "rnNoORV" member? ] [ drop (parse-objc-type) ] }
{ [ dup char: ^ = ] [ 3drop void* ] }
{ [ dup char: { = ] [ drop objc-struct-type ] }
{ [ dup char: [ = ] [ 3drop void* ] }
{ [ dup char: \{ = ] [ drop objc-struct-type ] }
{ [ dup char: \[ = ] [ 3drop void* ] }
[ 2nip decode-type ]
} cond ;

View File

@ -47,18 +47,18 @@ CONSTANT: NSOpenGLCPSurfaceOpacity 236 ;
[ -> alloc ]
[ [ 0 0 ] dip first2 <CGRect> ]
[ handle>> ] tri*
-> initWithFrame:pixelFormat:
dup 1 -> setPostsBoundsChangedNotifications:
dup 1 -> setPostsFrameChangedNotifications: ;
send\ initWithFrame:pixelFormat:
dup 1 send\ setPostsBoundsChangedNotifications:
dup 1 send\ setPostsFrameChangedNotifications: ;
: view-dim ( view -- dim )
-> bounds
send\ bounds
[ CGRect-w >fixnum ] [ CGRect-h >fixnum ] bi
2array ;
: mouse-location ( view event -- loc )
[
-> locationInWindow f -> convertPoint:fromView:
send\ locationInWindow f send\ convertPoint:fromView:
[ x>> ] [ y>> ] bi
] [ drop -> frame CGRect-h ] 2bi
swap - [ >integer ] bi@ 2array ;

View File

@ -22,19 +22,19 @@ CONSTANT: NSBackingStoreNonretained 1 ;
CONSTANT: NSBackingStoreBuffered 2 ;
: <NSWindow> ( rect style class -- window )
[ -> alloc ] curry 2dip NSBackingStoreBuffered 1
-> initWithContentRect:styleMask:backing:defer: ;
[ send\ alloc ] curry 2dip NSBackingStoreBuffered 1
send\ initWithContentRect:styleMask:backing:defer: ;
: class-for-style ( style -- NSWindow/NSPanel )
0x1ef0 bitand zero? NSWindow NSPanel ? ;
: <ViewWindow> ( view rect style -- window )
dup class-for-style <NSWindow> [ swap -> setContentView: ] keep
dup dup -> contentView -> setInitialFirstResponder:
dup 1 -> setAcceptsMouseMovedEvents:
dup 0 -> setReleasedWhenClosed: ;
dup class-for-style <NSWindow> [ swap send\ setContentView: ] keep
dup dup send\ contentView send\ setInitialFirstResponder:
dup 1 send\ setAcceptsMouseMovedEvents:
dup 0 send\ setReleasedWhenClosed: ;
: window-content-rect ( window -- rect )
dup -> class swap
[ -> frame ] [ -> styleMask ] bi
-> contentRectForFrameRect:styleMask: ;
dup send\ class swap
[ send\ frame ] [ send\ styleMask ] bi
send\ contentRectForFrameRect:styleMask: ;

View File

@ -4,13 +4,11 @@
! lexable-core-paths [ dup . flush path>literals ] map-zip
"resource:ffi" vocabs-from
{ "cocoa.dialogs" "opengl.gl.extensions" "python.syntax"
"windows.com.syntax" "x11.syntax"
"cocoa.application" "opencl.syntax" "mongodb.tuple" "cuda.syntax" "core-foundation.strings"
"cocoa.windows" "cocoa.views" "cocoa.subclassing"
"cocoa.nibs" "cocoa.plists" "cocoa" "cocoa.messages"
"gobject-introspection" "cocoa.apple-script" } diff
[ dup . flush vocab>literals ] map-zip
{ "x11.syntax" "windows.com.syntax" "python.syntax" "opengl.gl.extensions"
"opencl.syntax" "mongodb.tuple" "cuda.syntax" "core-foundation.strings"
"cocoa.subclassing" "cocoa" "cocoa.apple-script" "gobject-introspection" } diff
[ dup <vocab-link> . flush vocab>literals ] map-zip
"resource:language" vocabs-from
{ "constructors" "descriptive" "eval" "functors" "literals"
@ -24,19 +22,19 @@
"compiler.cfg.instructions.syntax" "cpu.x86.assembler.syntax"
"io.encodings.euc" "peg.ebnf" "prettyprint.stylesheet" "slots.syntax"
} diff
[ dup . flush vocab>literals ] map-zip
[ dup <vocab-link> . flush vocab>literals ] map-zip
"resource:frameworks" vocabs-from
{ "ui.theme.switching" "ui.backend.cocoa.views" "ui.backend.cocoa.tools"
"ui.backend.gtk" "ui.backend.cocoa" "gpu.demos.raytrace" "gpu.demos.bunny"
"gpu.shaders" "gpu.render" "game.worlds" "ui" "db.postgresql.errors" } diff
[ dup . flush vocab>literals ] map-zip
[ dup <vocab-link> . flush vocab>literals ] map-zip
"resource:demos" vocabs-from
{ "talks.vpri-talk" "talks.tc-lisp-talk" "talks.minneapolis-talk" "talks.google-tech-talk"
{ "talks.vpri-talk" "talks.tc-lisp-talk" "talks.minneapolis-talk" "talks.google-tech-talk"
"talks.galois-talk" "talks.otug-talk" "smalltalk.selectors" "smalltalk.parser"
"smalltalk.library" "webkit-demo" "bunny.outlined" "project-euler.common" } diff
[ dup . flush vocab>literals ] map-zip
"smalltalk.library" "bunny.outlined" "project-euler.common" } diff
[ dup <vocab-link> . flush vocab>literals ] map-zip
in: syntax