ui.backend.cocoa.views: maybe this works on 10.6.
parent
886cf4df07
commit
1209d5287d
|
@ -1,7 +0,0 @@
|
||||||
USING: cocoa.subclassing ;
|
|
||||||
IN: ui.backend.cocoa.views.non-retina
|
|
||||||
|
|
||||||
CLASS: BaseFactorView < NSOpenGLView NSTextInput
|
|
||||||
[
|
|
||||||
|
|
||||||
]
|
|
|
@ -1 +0,0 @@
|
||||||
macosx
|
|
|
@ -1 +0,0 @@
|
||||||
macosx
|
|
|
@ -1,13 +0,0 @@
|
||||||
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
|
|
||||||
]
|
|
||||||
]
|
|
|
@ -2,11 +2,11 @@
|
||||||
! 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.data alien.strings
|
USING: accessors alien alien.c-types alien.data alien.strings
|
||||||
arrays assocs cocoa cocoa.application cocoa.classes
|
arrays assocs cocoa cocoa.application cocoa.classes
|
||||||
cocoa.pasteboard cocoa.runtime cocoa.subclassing cocoa.types
|
cocoa.messages cocoa.pasteboard cocoa.runtime cocoa.subclassing
|
||||||
cocoa.views combinators core-foundation.strings core-graphics
|
cocoa.types cocoa.views combinators core-foundation.strings
|
||||||
core-graphics.types core-text io.encodings.utf8 kernel locals
|
core-graphics core-graphics.types core-text io.encodings.utf8
|
||||||
math math.order math.rectangles namespaces opengl sequences
|
kernel locals math math.order math.rectangles namespaces opengl
|
||||||
system-info threads ui.gadgets ui.gadgets.private
|
sequences system-info threads ui.gadgets ui.gadgets.private
|
||||||
ui.gadgets.worlds ui.gestures ui.private vocabs vocabs.parser ;
|
ui.gadgets.worlds ui.gestures ui.private vocabs vocabs.parser ;
|
||||||
IN: ui.backend.cocoa.views
|
IN: ui.backend.cocoa.views
|
||||||
|
|
||||||
|
@ -146,13 +146,22 @@ 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
|
|
||||||
[
|
[
|
||||||
|
|
||||||
|
METHOD: void prepareOpenGL [
|
||||||
|
|
||||||
|
self "setWantsBestResolutionOpenGLSurface:" [
|
||||||
|
1 swap execute( x x x -- )
|
||||||
|
] when-method
|
||||||
|
|
||||||
|
self "backingScaleFactor" [
|
||||||
|
execute( x x -- x ) dup 1.0 > [
|
||||||
|
gl-scale-factor set-global t retina? set-global
|
||||||
|
] [ drop ] if
|
||||||
|
] when-method
|
||||||
|
]
|
||||||
|
|
||||||
! Rendering
|
! Rendering
|
||||||
METHOD: void drawRect: NSRect rect [ self window [ draw-world ] when* ]
|
METHOD: void drawRect: NSRect rect [ self window [ draw-world ] when* ]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue