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