]> gitweb.factorcode.org Git - factor.git/commitdiff
cocoa.touchbar: use arrays of strings instead of enums.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 1 Jan 2018 23:01:04 +0000 (15:01 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 2 Jan 2018 00:00:19 +0000 (16:00 -0800)
basis/cocoa/touchbar/touchbar.factor

index 8b9bfd42849c64e591515985d4b0b1c5bb328e2b..e040840b9320289355e7e7d91094c9b9e32f909b 100644 (file)
@@ -1,22 +1,14 @@
 ! Copyright (C) 2017 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors alien.c-types alien.enums alien.syntax cocoa
-cocoa.classes cocoa.messages cocoa.runtime combinators
-core-foundation.strings kernel locals namespaces sequences words ;
+USING: alien.c-types cocoa cocoa.classes cocoa.messages
+cocoa.runtime combinators core-foundation.strings kernel locals
+;
 IN: cocoa.touchbar
 
-! ui.backend.cocoa.views creates buttons for each of these actions
-ENUM: default-touchbar refresh-all-action auto-use-action ;
-
-: enum>CFStringArray ( seq -- alien )
-    enum>keys
-    NSArray -> alloc
-        swap <CFStringArray> -> initWithArray: ;
-
-: make-touchbar ( enum self -- touchbar )
+: make-touchbar ( seq self -- touchbar )
     [ NSTouchBar -> alloc -> init dup ] dip -> setDelegate: {
-        [ swap enum>CFStringArray { void { id SEL id } } ?-> setDefaultItemIdentifiers: ]
-        [ swap enum>CFStringArray { void { id SEL id } } ?-> setCustomizationAllowedItemIdentifiers: ]
+        [ swap <CFStringArray> { void { id SEL id } } ?-> setDefaultItemIdentifiers: ]
+        [ swap <CFStringArray> { void { id SEL id } } ?-> setCustomizationAllowedItemIdentifiers: ]
         [ nip ]
     } 2cleave ;