]> gitweb.factorcode.org Git - factor.git/blob - basis/windows/com/com.factor
windows.gdiplus: clean up so it loads
[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     [
40         void* malloc-object &free
41         [ IUnknown::QueryInterface ole32-error ] keep *void*
42     ] with-destructors ;
43
44 : com-add-ref ( interface -- interface )
45      [ IUnknown::AddRef drop ] keep ; inline
46
47 : com-release ( interface -- )
48     IUnknown::Release drop ; inline
49
50 : with-com-interface ( interface quot -- )
51     over [ com-release ] curry [ ] cleanup ; inline
52
53 DESTRUCTOR: com-release
54
55 ! XXX interfaces used by other libraries that should be fleshed out
56 C-TYPE: IStream
57