]> gitweb.factorcode.org Git - factor.git/blob - basis/windows/com/com.factor
Merge branches 'master' and 'cleanup' into cleanup
[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 C-TYPE: IAdviseSink
14 C-TYPE: IEnumFORMATETC
15 C-TYPE: IEnumSTATDATA
16
17 COM-INTERFACE: IDataObject IUnknown {0000010E-0000-0000-C000-000000000046}
18     HRESULT GetData ( FORMATETC* pFormatetc, STGMEDIUM* pmedium )
19     HRESULT GetDataHere ( FORMATETC* pFormatetc, STGMEDIUM* pmedium )
20     HRESULT QueryGetData ( FORMATETC* pFormatetc )
21     HRESULT GetCanonicalFormatEtc ( FORMATETC* pFormatetcIn, FORMATETC* pFormatetcOut )
22     HRESULT SetData ( FORMATETC* pFormatetc, STGMEDIUM* pmedium, BOOL fRelease )
23     HRESULT EnumFormatEtc ( DWORD dwDirection, IEnumFORMATETC** ppenumFormatetc )
24     HRESULT DAdvise ( FORMATETC* pFormatetc, DWORD advf, IAdviseSink* pAdvSink, DWORD* pdwConnection )
25     HRESULT DUnadvise ( DWORD pdwConnection )
26     HRESULT EnumDAdvise ( IEnumSTATDATA** ppenumAdvise ) ;
27
28 COM-INTERFACE: IDropTarget IUnknown {00000122-0000-0000-C000-000000000046}
29     HRESULT DragEnter ( IDataObject* pDataObject, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect )
30     HRESULT DragOver ( DWORD grfKeyState, POINTL pt, DWORD* pdwEffect )
31     HRESULT DragLeave ( )
32     HRESULT Drop ( IDataObject* pDataObject, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect ) ;
33
34 FUNCTION: HRESULT RegisterDragDrop ( HWND hWnd, IDropTarget* pDropTarget ) ;
35 FUNCTION: HRESULT RevokeDragDrop ( HWND hWnd ) ;
36 FUNCTION: void ReleaseStgMedium ( LPSTGMEDIUM pmedium ) ;
37
38 : com-query-interface ( interface iid -- interface' )
39     { void* }
40     [ IUnknown::QueryInterface ole32-error ]
41     with-out-parameters ;
42
43 : com-add-ref ( interface -- interface )
44      [ IUnknown::AddRef drop ] keep ; inline
45
46 : com-release ( interface -- )
47     IUnknown::Release drop ; inline
48
49 : with-com-interface ( interface quot -- )
50     over [ com-release ] curry [ ] cleanup ; inline
51
52 DESTRUCTOR: com-release