ui.backend.cocoa.views: fix build error on older OSX versions.
parent
8587b90930
commit
3f987b2ffb
|
@ -0,0 +1,7 @@
|
||||||
|
USING: cocoa.subclassing ;
|
||||||
|
IN: ui.backend.cocoa.views.non-retina
|
||||||
|
|
||||||
|
CLASS: BaseFactorView < NSOpenGLView NSTextInput
|
||||||
|
[
|
||||||
|
|
||||||
|
]
|
|
@ -0,0 +1,13 @@
|
||||||
|
USING: alien.c-types cocoa cocoa.subclassing core-text kernel
|
||||||
|
math namespaces opengl ;
|
||||||
|
IN: ui.backend.cocoa.views.retina
|
||||||
|
|
||||||
|
CLASS: BaseFactorView < NSOpenGLView NSTextInput
|
||||||
|
[
|
||||||
|
METHOD: void prepareOpenGL [
|
||||||
|
self 1 -> setWantsBestResolutionOpenGLSurface:
|
||||||
|
self -> backingScaleFactor dup 1.0 > [
|
||||||
|
gl-scale-factor set-global t retina? set-global
|
||||||
|
] [ drop ] if
|
||||||
|
]
|
||||||
|
]
|
|
@ -5,9 +5,9 @@ arrays assocs cocoa cocoa.application cocoa.classes
|
||||||
cocoa.pasteboard cocoa.runtime cocoa.subclassing cocoa.types
|
cocoa.pasteboard cocoa.runtime cocoa.subclassing cocoa.types
|
||||||
cocoa.views combinators core-foundation.strings core-graphics
|
cocoa.views combinators core-foundation.strings core-graphics
|
||||||
core-graphics.types core-text io.encodings.utf8 kernel locals
|
core-graphics.types core-text io.encodings.utf8 kernel locals
|
||||||
math math.rectangles namespaces opengl sequences threads
|
math math.order math.rectangles namespaces opengl sequences
|
||||||
ui.gadgets ui.gadgets.private ui.gadgets.worlds ui.gestures
|
system-info threads ui.gadgets ui.gadgets.private
|
||||||
ui.private ;
|
ui.gadgets.worlds ui.gestures ui.private vocabs vocabs.parser ;
|
||||||
IN: ui.backend.cocoa.views
|
IN: ui.backend.cocoa.views
|
||||||
|
|
||||||
: send-mouse-moved ( view event -- )
|
: send-mouse-moved ( view event -- )
|
||||||
|
@ -146,7 +146,12 @@ CONSTANT: selector>action H{
|
||||||
selector>action at
|
selector>action at
|
||||||
[ swap world-focus parents-handle-gesture? t ] [ drop f f ] if* ;
|
[ swap world-focus parents-handle-gesture? t ] [ drop f f ] if* ;
|
||||||
|
|
||||||
CLASS: FactorView < NSOpenGLView NSTextInput
|
<<
|
||||||
|
os-version { 10 7 0 } after=? "retina" "non-retina" ?
|
||||||
|
"ui.backend.cocoa.views." prepend use-vocab
|
||||||
|
>>
|
||||||
|
|
||||||
|
CLASS: FactorView < BaseFactorView
|
||||||
[
|
[
|
||||||
! Rendering
|
! Rendering
|
||||||
METHOD: void drawRect: NSRect rect [ self window [ draw-world ] when* ]
|
METHOD: void drawRect: NSRect rect [ self window [ draw-world ] when* ]
|
||||||
|
@ -305,13 +310,6 @@ CLASS: FactorView < NSOpenGLView NSTextInput
|
||||||
|
|
||||||
METHOD: NSInteger conversationIdentifier [ self alien-address ]
|
METHOD: NSInteger conversationIdentifier [ self alien-address ]
|
||||||
|
|
||||||
METHOD: void prepareOpenGL [
|
|
||||||
self 1 -> setWantsBestResolutionOpenGLSurface:
|
|
||||||
self -> backingScaleFactor dup 1.0 > [
|
|
||||||
gl-scale-factor set-global t retina? set-global
|
|
||||||
] [ drop ] if
|
|
||||||
]
|
|
||||||
|
|
||||||
! Initialization
|
! Initialization
|
||||||
METHOD: void updateFactorGadgetSize: id notification
|
METHOD: void updateFactorGadgetSize: id notification
|
||||||
[
|
[
|
||||||
|
|
Loading…
Reference in New Issue