]> gitweb.factorcode.org Git - factor.git/commitdiff
ui.backend.cocoa.views: maybe this works on 10.6.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 29 Mar 2013 21:18:33 +0000 (14:18 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 29 Mar 2013 21:18:57 +0000 (14:18 -0700)
basis/ui/backend/cocoa/views/non-retina/non-retina.factor [deleted file]
basis/ui/backend/cocoa/views/non-retina/platforms.txt [deleted file]
basis/ui/backend/cocoa/views/retina/platforms.txt [deleted file]
basis/ui/backend/cocoa/views/retina/retina.factor [deleted file]
basis/ui/backend/cocoa/views/views.factor

diff --git a/basis/ui/backend/cocoa/views/non-retina/non-retina.factor b/basis/ui/backend/cocoa/views/non-retina/non-retina.factor
deleted file mode 100644 (file)
index 4cc904c..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-USING: cocoa.subclassing ;
-IN: ui.backend.cocoa.views.non-retina
-
-CLASS: BaseFactorView < NSOpenGLView NSTextInput
-[
-
-]
diff --git a/basis/ui/backend/cocoa/views/non-retina/platforms.txt b/basis/ui/backend/cocoa/views/non-retina/platforms.txt
deleted file mode 100644 (file)
index 6e806f4..0000000
+++ /dev/null
@@ -1 +0,0 @@
-macosx
diff --git a/basis/ui/backend/cocoa/views/retina/platforms.txt b/basis/ui/backend/cocoa/views/retina/platforms.txt
deleted file mode 100644 (file)
index 6e806f4..0000000
+++ /dev/null
@@ -1 +0,0 @@
-macosx
diff --git a/basis/ui/backend/cocoa/views/retina/retina.factor b/basis/ui/backend/cocoa/views/retina/retina.factor
deleted file mode 100644 (file)
index 3fcdc73..0000000
+++ /dev/null
@@ -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
-    ]
-]
index 052a6a8d6523319dfb053b2e9a23fa323eecb9b6..86ae4771026e70e12f27968f18c62eab30c3cd8f 100644 (file)
@@ -2,11 +2,11 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien alien.c-types alien.data alien.strings
 arrays assocs cocoa cocoa.application cocoa.classes
-cocoa.pasteboard cocoa.runtime cocoa.subclassing cocoa.types
-cocoa.views combinators core-foundation.strings core-graphics
-core-graphics.types core-text io.encodings.utf8 kernel locals
-math math.order math.rectangles namespaces opengl sequences
-system-info threads ui.gadgets ui.gadgets.private
+cocoa.messages cocoa.pasteboard cocoa.runtime cocoa.subclassing
+cocoa.types cocoa.views combinators core-foundation.strings
+core-graphics core-graphics.types core-text io.encodings.utf8
+kernel locals math math.order math.rectangles namespaces opengl
+sequences system-info threads ui.gadgets ui.gadgets.private
 ui.gadgets.worlds ui.gestures ui.private vocabs vocabs.parser ;
 IN: ui.backend.cocoa.views
 
@@ -146,13 +146,22 @@ CONSTANT: selector>action H{
     selector>action at
     [ swap world-focus parents-handle-gesture? t ] [ drop f f ] if* ;
 
-<<
-os-version { 10 7 0 } after=? "retina" "non-retina" ?
-"ui.backend.cocoa.views." prepend use-vocab
->>
-
-CLASS: FactorView < BaseFactorView
+CLASS: FactorView < NSOpenGLView NSTextInput
 [
+
+    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
     METHOD: void drawRect: NSRect rect [ self window [ draw-world ] when* ]