cocoa: fix requirement that mac deploys have high reflection.
parent
929fca6b7e
commit
7d0039babe
|
@ -1,19 +1,16 @@
|
||||||
! 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: compiler io kernel cocoa.runtime cocoa.subclassing
|
USING: cocoa.messages compiler.units core-foundation.bundles
|
||||||
cocoa.messages cocoa.types sequences words vocabs parser
|
init io kernel lexer namespaces sequences sets vocabs ;
|
||||||
core-foundation.bundles namespaces assocs hashtables
|
|
||||||
compiler.units lexer init ;
|
|
||||||
FROM: cocoa.messages => selector ;
|
FROM: cocoa.messages => selector ;
|
||||||
IN: cocoa
|
IN: cocoa
|
||||||
|
|
||||||
: (remember-send) ( selector variable -- )
|
|
||||||
[ dupd ?set-at ] change-global ;
|
|
||||||
|
|
||||||
SYMBOL: sent-messages
|
SYMBOL: sent-messages
|
||||||
|
|
||||||
|
sent-messages [ HS{ } clone ] initialize
|
||||||
|
|
||||||
: remember-send ( selector -- )
|
: remember-send ( selector -- )
|
||||||
sent-messages (remember-send) ;
|
sent-messages get-global adjoin ;
|
||||||
|
|
||||||
SYNTAX: -> scan-token dup remember-send suffix! \ send suffix! ;
|
SYNTAX: -> scan-token dup remember-send suffix! \ send suffix! ;
|
||||||
|
|
||||||
|
@ -22,16 +19,12 @@ SYNTAX: SEL:
|
||||||
[ remember-send ]
|
[ remember-send ]
|
||||||
[ <selector> suffix! \ selector suffix! ] bi ;
|
[ <selector> suffix! \ selector suffix! ] bi ;
|
||||||
|
|
||||||
SYNTAX: SEND:
|
|
||||||
scan-token
|
|
||||||
[ remember-send ]
|
|
||||||
[ <selector> suffix! \ selector suffix! ]
|
|
||||||
[ suffix! \ lookup-sender suffix! ] tri ;
|
|
||||||
|
|
||||||
SYMBOL: super-sent-messages
|
SYMBOL: super-sent-messages
|
||||||
|
|
||||||
|
super-sent-messages [ HS{ } clone ] initialize
|
||||||
|
|
||||||
: remember-super-send ( selector -- )
|
: remember-super-send ( selector -- )
|
||||||
super-sent-messages (remember-send) ;
|
super-sent-messages get-global adjoin ;
|
||||||
|
|
||||||
SYNTAX: SUPER-> scan-token dup remember-super-send suffix! \ super-send suffix! ;
|
SYNTAX: SUPER-> scan-token dup remember-super-send suffix! \ super-send suffix! ;
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,11 @@ IN: ui.backend.cocoa.views
|
||||||
|
|
||||||
: button ( event -- n )
|
: button ( event -- n )
|
||||||
#! Cocoa -> Factor UI button mapping
|
#! Cocoa -> Factor UI button mapping
|
||||||
-> buttonNumber H{ { 0 1 } { 2 2 } { 1 3 } } at ;
|
-> buttonNumber {
|
||||||
|
{ 0 [ 1 ] }
|
||||||
|
{ 1 [ 3 ] }
|
||||||
|
{ 2 [ 2 ] }
|
||||||
|
} case ;
|
||||||
|
|
||||||
CONSTANT: modifiers
|
CONSTANT: modifiers
|
||||||
{
|
{
|
||||||
|
@ -154,10 +158,12 @@ CLASS: FactorView < NSOpenGLView NSTextInput
|
||||||
self SEL: setWantsBestResolutionOpenGLSurface:
|
self SEL: setWantsBestResolutionOpenGLSurface:
|
||||||
-> respondsToSelector: c-bool> [
|
-> respondsToSelector: c-bool> [
|
||||||
|
|
||||||
self SEND: setWantsBestResolutionOpenGLSurface:
|
self SEL: setWantsBestResolutionOpenGLSurface: 1
|
||||||
1 swap execute( x x x -- )
|
void f "objc_msgSend" { id SEL char } alien-invoke
|
||||||
|
|
||||||
|
self SEL: backingScaleFactor
|
||||||
|
double f "objc_msgSend" { id SEL } alien-invoke
|
||||||
|
|
||||||
self SEND: backingScaleFactor execute( x x -- x )
|
|
||||||
dup 1.0 > [
|
dup 1.0 > [
|
||||||
gl-scale-factor set-global t retina? set-global
|
gl-scale-factor set-global t retina? set-global
|
||||||
cached-lines get-global clear-assoc
|
cached-lines get-global clear-assoc
|
||||||
|
@ -397,7 +403,10 @@ CLASS: FactorWindowDelegate < NSObject
|
||||||
|
|
||||||
notification -> object dup SEL: backingScaleFactor
|
notification -> object dup SEL: backingScaleFactor
|
||||||
-> respondsToSelector: c-bool> [
|
-> respondsToSelector: c-bool> [
|
||||||
SEND: backingScaleFactor execute( x x -- x )
|
|
||||||
|
SEL: backingScaleFactor
|
||||||
|
double f "objc_msgSend" { id SEL } alien-invoke
|
||||||
|
|
||||||
[ [ 1.0 > ] keep f ? gl-scale-factor set-global ]
|
[ [ 1.0 > ] keep f ? gl-scale-factor set-global ]
|
||||||
[ 1.0 > retina? set-global ] bi
|
[ 1.0 > retina? set-global ] bi
|
||||||
] [ drop ] if
|
] [ drop ] if
|
||||||
|
|
Loading…
Reference in New Issue