]> gitweb.factorcode.org Git - factor.git/blob - basis/windows/com/com.factor
update windows vocabs to load without c-type strings
[factor.git] / basis / windows / com / com.factor
1 USING: alien alien.c-types alien.destructors windows.com.syntax
2 windows.ole32 windows.types continuations kernel alien.syntax
3 libc destructors accessors alien.data ;
4 IN: windows.com
5
6 LIBRARY: ole32
7
8 COM-INTERFACE: IUnknown f {00000000-0000-0000-C000-000000000046}
9     HRESULT QueryInterface ( REFGUID iid, void** ppvObject )
10     ULONG AddRef ( )
11     ULONG Release ( ) ;
12
13 TYPEDEF: void* IAdviseSink*
14
15 COM-INTERFACE: IDataObject IUnknown {0000010E-0000-0000-C000-000000000046}
16     HRESULT GetData ( FORMATETC* pFormatetc, STGMEDIUM* pmedium )
17     HRESULT GetDataHere ( FORMATETC* pFormatetc, STGMEDIUM* pmedium )
18     HRESULT QueryGetData ( FORMATETC* pFormatetc )
19     HRESULT GetCanonicalFormatEtc ( FORMATETC* pFormatetcIn, FORMATETC* pFormatetcOut )
20     HRESULT SetData ( FORMATETC* pFormatetc, STGMEDIUM* pmedium, BOOL fRelease )
21     HRESULT EnumFormatEtc ( DWORD dwDirection, IEnumFORMATETC** ppenumFormatetc )
22     HRESULT DAdvise ( FORMATETC* pFormatetc, DWORD advf, IAdviseSink* pAdvSink, DWORD* pdwConnection )
23     HRESULT DUnadvise ( DWORD pdwConnection )
24     HRESULT EnumDAdvise ( IEnumSTATDATA** ppenumAdvise ) ;
25
26 COM-INTERFACE: IDropTarget IUnknown {00000122-0000-0000-C000-000000000046}
27     HRESULT DragEnter ( IDataObject* pDataObject, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect )
28     HRESULT DragOver ( DWORD grfKeyState, POINTL pt, DWORD* pdwEffect )
29     HRESULT DragLeave ( )
30     HRESULT Drop ( IDataObject* pDataObject, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect ) ;
31
32 FUNCTION: HRESULT RegisterDragDrop ( HWND hWnd, IDropTarget* pDropTarget ) ;
33 FUNCTION: HRESULT RevokeDragDrop ( HWND hWnd ) ;
34 FUNCTION: void ReleaseStgMedium ( LPSTGMEDIUM pmedium ) ;
35
36 : com-query-interface ( interface iid -- interface' )
37     [
38         "void*" malloc-object &free
39         [ IUnknown::QueryInterface ole32-error ] keep *void*
40     ] with-destructors ;
41
42 : com-add-ref ( interface -- interface )
43      [ IUnknown::AddRef drop ] keep ; inline
44
45 : com-release ( interface -- )
46     IUnknown::Release drop ; inline
47
48 : with-com-interface ( interface quot -- )
49     over [ com-release ] curry [ ] cleanup ; inline
50
51 DESTRUCTOR: com-release