]> gitweb.factorcode.org Git - factor.git/commitdiff
cocoa: CLASS: ; -> <CLASS: ;CLASS>
authorDoug Coleman <doug.coleman@gmail.com>
Sun, 6 Aug 2017 01:54:02 +0000 (20:54 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 6 Aug 2017 01:54:02 +0000 (20:54 -0500)
<CLASS: is a container like <PRIVATE and <FUNCTOR:

basis/cocoa/cocoa-tests.factor
basis/cocoa/subclassing/subclassing-docs.factor
basis/cocoa/subclassing/subclassing.factor
basis/tools/deploy/test/14/14.factor
basis/ui/backend/cocoa/cocoa.factor
basis/ui/backend/cocoa/tools/tools.factor
basis/ui/backend/cocoa/views/views.factor

index 454af95e4189a7a12e6dbbdaf07f249f3b071313..8b661b908d41681e1f0e05f728da1285e1dc02e9 100644 (file)
@@ -3,11 +3,11 @@ cocoa.types compiler.test core-graphics.types kernel math memory
 namespaces tools.test ;
 IN: cocoa.tests
 
-CLASS: Foo < NSObject
+<CLASS: Foo < NSObject
     METHOD: void foo: NSRect rect [
         gc rect "x" set
     ] ;
-;
+;CLASS>
 
 : test-foo ( -- )
     Foo -> alloc -> init
@@ -21,9 +21,9 @@ CLASS: Foo < NSObject
 { 101.0 } [ "x" get CGRect-w ] unit-test
 { 102.0 } [ "x" get CGRect-h ] unit-test
 
-CLASS: Bar < NSObject
+<CLASS: Bar < NSObject
     METHOD: NSRect bar [ test-foo "x" get ] ;
-;
+;CLASS>
 
 { } [
     Bar [
@@ -39,11 +39,11 @@ CLASS: Bar < NSObject
 { 102.0 } [ "x" get CGRect-h ] unit-test
 
 ! Make sure that we can add methods
-CLASS: Bar < NSObject
+<CLASS: Bar < NSObject
     METHOD: NSRect bar [ test-foo "x" get ] ;
 
     METHOD: int babb: int x [ x sq ] ;
-;
+;CLASS>
 
 { 144 } [
     Bar [
index 98df64036448e9ebf1e59719bd59d744952fcf44..45669ff2473388c656e36c7808464cea36b9ca7f 100644 (file)
@@ -1,23 +1,23 @@
 USING: help.markup help.syntax strings alien hashtables ;
 IN: cocoa.subclassing
 
-HELP: CLASS:
-{ $syntax "CLASS: name < superclass protocols... imeth... ;" }
+HELP: <CLASS:
+{ $syntax "<CLASS: name < superclass protocols... imeth... ;CLASS>" }
 { $values { "name" "a new class name" } { "superclass" "a superclass name" } { "protocols" "zero or more protocol names" } { "imeth" "instance method definitions using " { $link POSTPONE: METHOD: } } }
 { $description "Defines a new Objective C class. Instance methods are defined with the " { $link POSTPONE: METHOD: } " parsing word."
 $nl
 "This word is preferred to calling " { $link define-objc-class } ", because it creates a class word in the " { $vocab-link "cocoa.classes" } " vocabulary at parse time, allowing code to refer to the class word in the same source file where the class is defined." } ;
 
-{ define-objc-class POSTPONE: CLASS: POSTPONE: METHOD: } related-words
+{ define-objc-class POSTPONE: <CLASS: POSTPONE: METHOD: } related-words
 
 HELP: METHOD:
 { $syntax "METHOD: return foo: type1 arg1 bar: type2 arg2 baz: ... [ body ] ;" }
 { $values { "return" "a C type name" } { "type1" "a C type name" } { "arg1" "a local variable name" } { "body" "arbitrary code" } }
-{ $description "Defines a method inside of a " { $link POSTPONE: CLASS: } " form." } ;
+{ $description "Defines a method inside of a " { $link POSTPONE: <CLASS: } " form." } ;
 
 ARTICLE: "objc-subclassing" "Subclassing Objective C classes"
 "Objective C classes can be subclassed, with new methods defined in Factor, using parsing words:"
-{ $subsections POSTPONE: CLASS: POSTPONE: METHOD: }
+{ $subsections POSTPONE: <CLASS: POSTPONE: METHOD: }
 "Objective C class definitions are saved in the image. If the image is saved and Factor is restarted with the saved image, custom class definitions are made available to the Objective C runtime when they are first accessed from within Factor." ;
 
 ABOUT: "objc-subclassing"
index 4063ce68dacd1b888584cbf3942439f526a0900c..b737a3cfce472e0d5b083548a0f15c1b41449236 100644 (file)
@@ -74,11 +74,13 @@ C: <cocoa-protocol> cocoa-protocol
 SYNTAX: COCOA-PROTOCOL:
     scan-token <cocoa-protocol> suffix! ;
 
-SYNTAX: CLASS:
+SYMBOL: ;CLASS>
+
+SYNTAX: <CLASS:
     scan-token
     "<" expect
     scan-token
-    \ ; parse-until [ cocoa-protocol? ] partition
+    \ ;CLASS> parse-until [ cocoa-protocol? ] partition
     [ [ name>> ] map ] dip define-objc-class ;
 
 : (parse-selector) ( -- )
index f8dd0db174ea52bc2d68e926fde11e5baa0072fb..d1872afff3182f812b5837f97b7766af8614928f 100644 (file)
@@ -6,13 +6,13 @@ kernel math ;
 FROM: alien.c-types => float ;
 IN: tools.deploy.test.14
 
-CLASS: Bar < NSObject
+<CLASS: Bar < NSObject
     METHOD: float bar: NSRect rect [
         rect origin>> [ x>> ] [ y>> ] bi +
         rect size>> [ w>> ] [ h>> ] bi +
         +
     ] ;
-;
+;CLASS>
 
 : main ( -- )
     Bar -> alloc -> init
index 3d5635ddd37788cfc727a109578c5077e62de127..08cc6136a56b955d32e74b20480e061c85988c22 100644 (file)
@@ -195,14 +195,14 @@ M: cocoa-ui-backend system-alert
         } cleave
     ] [ 2drop ] if* ;
 
-CLASS: FactorApplicationDelegate < NSObject
+<CLASS: FactorApplicationDelegate < NSObject
 
     METHOD: void applicationDidUpdate: id obj [ reset-thread-timer ] ;
 
     METHOD: char applicationShouldTerminateAfterLastWindowClosed: id app [
         ui-stop-after-last-window? get 1 0 ?
     ] ;
-;
+;CLASS>
 
 : install-app-delegate ( -- )
     NSApp FactorApplicationDelegate install-delegate ;
index a514d8c10223d06078eb6006a04381b93fd4f888..c8f3b7ae45836844b28904eed0b0384ec92c35af 100644 (file)
@@ -21,7 +21,7 @@ IN: ui.backend.cocoa.tools
     image-path save-panel [ save-image ] when* ;
 
 ! Handle Open events from the Finder
-CLASS: FactorWorkspaceApplicationDelegate < FactorApplicationDelegate
+<CLASS: FactorWorkspaceApplicationDelegate < FactorApplicationDelegate
 
     METHOD: void application: id app openFiles: id files [ files finder-run-files ] ;
 
@@ -46,7 +46,7 @@ CLASS: FactorWorkspaceApplicationDelegate < FactorApplicationDelegate
     METHOD: id switchDarkTheme: id app [ dark-mode f ] ;
 
     METHOD: id refreshAll: id app [ [ refresh-all ] \ refresh-all call-listener f ] ;
-;
+;CLASS>
 
 : install-app-delegate ( -- )
     NSApp FactorWorkspaceApplicationDelegate install-delegate ;
@@ -57,7 +57,7 @@ CLASS: FactorWorkspaceApplicationDelegate < FactorApplicationDelegate
     dup [ quot call( string -- result/f ) ] when
     [ pboard set-pasteboard-string ] when* ;
 
-CLASS: FactorServiceProvider < NSObject
+<CLASS: FactorServiceProvider < NSObject
 
     METHOD: void evalInListener: id pboard userData: id userData error: id error
     [ pboard error [ eval-listener f ] do-service ] ;
@@ -67,7 +67,7 @@ CLASS: FactorServiceProvider < NSObject
         pboard error
         [ [ (eval>string) ] with-interactive-vocabs ] do-service
     ] ;
-;
+;CLASS>
 
 : register-services ( -- )
     NSApp
index a5b1dd431324e4aa4518283b7d8d630a45028911..49478dfb3286b1ed772b451e97ffeab0a1860fba 100644 (file)
@@ -161,7 +161,7 @@ CONSTANT: selector>action H{
     selector>action at
     [ swap world-focus parents-handle-gesture? t ] [ drop f f ] if* ;
 
-CLASS: FactorView < NSOpenGLView
+<CLASS: FactorView < NSOpenGLView
     COCOA-PROTOCOL: NSTextInput
 
     METHOD: void prepareOpenGL [
@@ -388,7 +388,7 @@ CLASS: FactorView < NSOpenGLView
         self remove-observer
         self SUPER-> dealloc
     ] ;
-;
+;CLASS>
 
 : sync-refresh-to-screen ( GLView -- )
     -> openGLContext -> CGLContextObj NSOpenGLCPSwapInterval 1 int <ref>
@@ -400,7 +400,7 @@ CLASS: FactorView < NSOpenGLView
 : save-position ( world window -- )
     -> frame CGRect-top-left 2array >>window-loc drop ;
 
-CLASS: FactorWindowDelegate < NSObject
+<CLASS: FactorWindowDelegate < NSObject
 
     METHOD: void windowDidMove: id notification
     [
@@ -444,7 +444,7 @@ CLASS: FactorWindowDelegate < NSObject
             [ 1.0 > retina? set-global ] bi
         ] [ drop ] if
     ] ;
-;
+;CLASS>
 
 : install-window-delegate ( window -- )
     FactorWindowDelegate install-delegate ;