Like the AUTORADIOBUTTON, the parent of a RADIOBUTTON style button
[wine] / dlls / ddraw / dclipper / main.c
1 /*              DirectDrawClipper implementation
2  *
3  * Copyright 2000 Marcus Meissner
4  */
5
6 #include "config.h"
7 #include "winerror.h"
8
9 #include <unistd.h>
10 #include <assert.h>
11 #include <fcntl.h>
12 #include <string.h>
13 #include <stdlib.h>
14 #include <stdio.h>
15
16 #include "debugtools.h"
17 #include "ddraw_private.h"
18
19 DEFAULT_DEBUG_CHANNEL(ddraw);
20
21 /******************************************************************************
22  *                      DirectDrawCreateClipper (DDRAW.7)
23  */
24 HRESULT WINAPI DirectDrawCreateClipper(
25     DWORD dwFlags, LPDIRECTDRAWCLIPPER *lplpDDClipper, LPUNKNOWN pUnkOuter
26 ) {
27     IDirectDrawClipperImpl** ilplpDDClipper=(IDirectDrawClipperImpl**)lplpDDClipper;
28     TRACE("(%08lx,%p,%p)\n", dwFlags, ilplpDDClipper, pUnkOuter);
29
30     *ilplpDDClipper = (IDirectDrawClipperImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirectDrawClipperImpl));
31     ICOM_VTBL(*ilplpDDClipper) = &ddclipvt;
32     (*ilplpDDClipper)->ref = 1;
33     (*ilplpDDClipper)->hWnd = 0; 
34     return DD_OK;
35 }
36
37 /******************************************************************************
38  *                      IDirectDrawClipper
39  */
40 static HRESULT WINAPI IDirectDrawClipperImpl_SetHwnd(
41     LPDIRECTDRAWCLIPPER iface, DWORD dwFlags, HWND hWnd
42 ) {
43     ICOM_THIS(IDirectDrawClipperImpl,iface);
44
45     TRACE("(%p)->SetHwnd(0x%08lx,0x%08lx)\n",This,dwFlags,(DWORD)hWnd);
46     if( dwFlags ) {
47         FIXME("dwFlags = 0x%08lx, not supported.\n",dwFlags);
48         return DDERR_INVALIDPARAMS; 
49     }
50
51     This->hWnd = hWnd;
52     return DD_OK;
53 }
54
55 static ULONG WINAPI IDirectDrawClipperImpl_Release(LPDIRECTDRAWCLIPPER iface) {
56     ICOM_THIS(IDirectDrawClipperImpl,iface);
57     TRACE("(%p)->() decrementing from %lu.\n", This, This->ref );
58
59     This->ref--;
60     if (This->ref)
61         return This->ref;
62     HeapFree(GetProcessHeap(),0,This);
63     return S_OK;
64 }
65
66 static HRESULT WINAPI IDirectDrawClipperImpl_GetClipList(
67     LPDIRECTDRAWCLIPPER iface,LPRECT rects,LPRGNDATA lprgn,LPDWORD hmm
68 ) {
69     ICOM_THIS(IDirectDrawClipperImpl,iface);
70     FIXME("(%p,%p,%p,%p),stub!\n",This,rects,lprgn,hmm);
71     if (hmm) *hmm=0;
72     return DD_OK;
73 }
74
75 static HRESULT WINAPI IDirectDrawClipperImpl_SetClipList(
76     LPDIRECTDRAWCLIPPER iface,LPRGNDATA lprgn,DWORD hmm
77 ) {
78     ICOM_THIS(IDirectDrawClipperImpl,iface);
79     FIXME("(%p,%p,%ld),stub!\n",This,lprgn,hmm);
80     return DD_OK;
81 }
82
83 static HRESULT WINAPI IDirectDrawClipperImpl_QueryInterface(
84     LPDIRECTDRAWCLIPPER iface, REFIID riid, LPVOID* ppvObj
85 ) {
86     ICOM_THIS(IDirectDrawClipperImpl,iface);
87     FIXME("(%p)->(%p,%p),stub!\n",This,riid,ppvObj);
88     return OLE_E_ENUM_NOMORE;
89 }
90
91 static ULONG WINAPI IDirectDrawClipperImpl_AddRef( LPDIRECTDRAWCLIPPER iface )
92 {
93     ICOM_THIS(IDirectDrawClipperImpl,iface);
94     TRACE("(%p)->() incrementing from %lu.\n", This, This->ref );
95     return ++(This->ref);
96 }
97
98 static HRESULT WINAPI IDirectDrawClipperImpl_GetHWnd(
99     LPDIRECTDRAWCLIPPER iface, HWND* hWndPtr
100 ) {
101     ICOM_THIS(IDirectDrawClipperImpl,iface);
102     FIXME("(%p)->(%p),stub!\n",This,hWndPtr);
103
104     *hWndPtr = This->hWnd; 
105
106     return DD_OK;
107 }
108
109 static HRESULT WINAPI IDirectDrawClipperImpl_Initialize(
110      LPDIRECTDRAWCLIPPER iface, LPDIRECTDRAW lpDD, DWORD dwFlags
111 ) {
112     ICOM_THIS(IDirectDrawClipperImpl,iface);
113     FIXME("(%p)->(%p,0x%08lx),stub!\n",This,lpDD,dwFlags);
114     return DD_OK;
115 }
116
117 static HRESULT WINAPI IDirectDrawClipperImpl_IsClipListChanged(
118     LPDIRECTDRAWCLIPPER iface, BOOL* lpbChanged
119 ) {
120     ICOM_THIS(IDirectDrawClipperImpl,iface);
121     FIXME("(%p)->(%p),stub!\n",This,lpbChanged);
122     return DD_OK;
123 }
124
125 ICOM_VTABLE(IDirectDrawClipper) ddclipvt = 
126 {
127     ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
128     IDirectDrawClipperImpl_QueryInterface,
129     IDirectDrawClipperImpl_AddRef,
130     IDirectDrawClipperImpl_Release,
131     IDirectDrawClipperImpl_GetClipList,
132     IDirectDrawClipperImpl_GetHWnd,
133     IDirectDrawClipperImpl_Initialize,
134     IDirectDrawClipperImpl_IsClipListChanged,
135     IDirectDrawClipperImpl_SetClipList,
136     IDirectDrawClipperImpl_SetHwnd
137 };