]> gitweb.factorcode.org Git - factor.git/blob - basis/windows/com/syntax/syntax-docs.factor
62a3c6eaa0b37954880da08257397a25371f13dd
[factor.git] / basis / windows / com / syntax / syntax-docs.factor
1 USING: help.markup help.syntax io kernel math quotations
2 multiline ;
3 IN: windows.com.syntax
4
5 HELP: GUID:
6 { $syntax "GUID: {01234567-89ab-cdef-0123-456789abcdef}" }
7 { $description "\nCreate a COM globally-unique identifier (GUID) literal at parse time, and push it onto the data stack." } ;
8
9 HELP: COM-INTERFACE:
10 { $syntax <"
11 COM-INTERFACE: <interface> <parent> <iid>
12     <function-1> ( <params1> )
13     <function-2> ( <params2> )
14     ... ;
15 "> }
16 { $description "\nFor the interface " { $snippet "<interface>" } ", a word " { $snippet "<interface>-iid ( -- iid )" } " is defined to push the interface GUID (IID) onto the stack. Words of the form " { $snippet "<interface>::<function>" } " are also defined to invoke each method, as well as the methods inherited from " { $snippet "<parent>" } ". A " { $snippet "<parent>" } " of " { $snippet "f" } " indicates that the interface is a root interface. (Note that COM conventions demand that all interfaces at least inherit from " { $snippet "IUnknown" } ".)\n\nExample:" }
17 { $code <"
18 COM-INTERFACE: IUnknown f {00000000-0000-0000-C000-000000000046}
19     HRESULT QueryInterface ( REFGUID iid, void** ppvObject )
20     ULONG AddRef ( )
21     ULONG Release ( ) ;
22
23 COM-INTERFACE: ISimple IUnknown {216fb341-0eb2-44b1-8edb-60b76e353abc}
24     HRESULT returnOK ( )
25     HRESULT returnError ( ) ;
26
27 COM-INTERFACE: IInherited ISimple {9620ecec-8438-423b-bb14-86f835aa40dd}
28     int getX ( )
29     void setX ( int newX ) ;
30 "> } ;