From 07f4d19947420806464e2f485250e50ee42f8e16 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Mon, 1 Jan 2018 15:01:04 -0800 Subject: [PATCH] cocoa.touchbar: use arrays of strings instead of enums. --- basis/cocoa/touchbar/touchbar.factor | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/basis/cocoa/touchbar/touchbar.factor b/basis/cocoa/touchbar/touchbar.factor index 8b9bfd4284..e040840b93 100644 --- a/basis/cocoa/touchbar/touchbar.factor +++ b/basis/cocoa/touchbar/touchbar.factor @@ -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 -> 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 { void { id SEL id } } ?-> setDefaultItemIdentifiers: ] + [ swap { void { id SEL id } } ?-> setCustomizationAllowedItemIdentifiers: ] [ nip ] } 2cleave ;