]> gitweb.factorcode.org Git - factor.git/blob - basis/cocoa/application/application-docs.factor
Merge branch 'master' into experimental (untested!)
[factor.git] / basis / cocoa / application / application-docs.factor
1 USING: debugger quotations help.markup help.syntax strings alien
2 core-foundation core-foundation.strings core-foundation.arrays ;
3 IN: cocoa.application
4
5 HELP: <NSString>
6 { $values { "str" string } { "alien" alien } }
7 { $description "Allocates an autoreleased " { $snippet "CFString" } "." } ;
8
9 { <NSString> <CFString> CF>string } related-words
10
11 HELP: <NSArray>
12 { $values { "seq" "a sequence of " { $link alien } " instances" } { "alien" alien } }
13 { $description "Allocates an autoreleased " { $snippet "CFArray" } "." } ;
14
15 { <NSArray> <CFArray> } related-words
16
17 HELP: with-autorelease-pool
18 { $values { "quot" quotation } }
19 { $description "Sets up a new " { $snippet "NSAutoreleasePool"  } ", calls the quotation and frees the pool." } ;
20
21 HELP: NSApp
22 { $values { "app" "an " { $snippet "NSApplication" } } }
23 { $description "Pushes the current " { $snippet "NSApplication" } " singleton." } ;
24
25 HELP: with-cocoa
26 { $values { "quot" quotation } }
27 { $description "Sets up an autorelease pool, initializes the " { $snippet "NSApplication" } " singleton, and calls the quotation." } ;
28
29 HELP: cocoa-app
30 { $values { "quot" quotation } }
31 { $description "Initializes Cocoa, calls the quotation, and starts the Cocoa event loop." } ;
32
33 HELP: do-event
34 { $values { "app" "an " { $snippet "NSApplication" } } { "?" "a boolean" } }
35 { $description "Processes a pending event in the queue, if any, returning a boolean indicating if there was one. Does not block." } ;
36
37 HELP: add-observer
38 { $values { "observer" "an " { $snippet "NSObject" } } { "selector" string } { "name" "an " { $snippet "NSString" } } { "object" "an " { $snippet "NSObject" } } }
39 { $description "Registers an observer with the " { $snippet "NSNotificationCenter" } " singleton." } ;
40
41 HELP: remove-observer
42 { $values { "observer" "an " { $snippet "NSObject" } } }
43 { $description "Unregisters an observer from the " { $snippet "NSNotificationCenter" } " singleton." } ;
44
45 HELP: install-delegate
46 { $values { "receiver" "an " { $snippet "NSObject" } } { "delegate" "an Objective C class" } }
47 { $description "Sets the receiver's delegate to a new instance of the delegate class." } ;
48
49 HELP: objc-error
50 { $error-description "Thrown by the Objective C runtime when an error occurs, for example, sending a message to an object with an unrecognized selector." } ;
51
52 ARTICLE: "cocoa-application-utils" "Cocoa application utilities"
53 "Utilities:"
54 { $subsection NSApp }
55 { $subsection do-event }
56 { $subsection add-observer }
57 { $subsection remove-observer }
58 { $subsection install-delegate }
59 "Combinators:"
60 { $subsection cocoa-app }
61 { $subsection with-autorelease-pool }
62 { $subsection with-cocoa } ;
63
64 IN: cocoa.application
65 ABOUT: "cocoa-application-utils"