d3d9/tests: Correct nv40 results.
[wine] / dlls / oledlg / oledlg_main.c
1 /*
2  *      OLEDLG library
3  *
4  *      Copyright 1998  Patrik Stridvall
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20
21 #include <stdarg.h>
22
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winerror.h"
26 #include "wingdi.h"
27 #include "winuser.h"
28 #include "oledlg.h"
29 #include "ole2.h"
30 #include "oledlg_private.h"
31
32 #include "wine/debug.h"
33
34 WINE_DEFAULT_DEBUG_CHANNEL(ole);
35
36 HINSTANCE OLEDLG_hInstance = 0;
37
38 UINT cf_embed_source;
39 UINT cf_embedded_object;
40 UINT cf_link_source;
41 UINT cf_object_descriptor;
42 UINT cf_link_src_descriptor;
43 UINT cf_ownerlink;
44 UINT cf_filename;
45 UINT cf_filenamew;
46
47 UINT oleui_msg_help;
48 UINT oleui_msg_enddialog;
49
50 static void register_clipboard_formats(void)
51 {
52     /* These used to be declared in olestd.h, but that seems to have been removed from the api */
53     static const WCHAR CF_EMBEDSOURCEW[]          = { 'E','m','b','e','d',' ','S','o','u','r','c','e',0 };
54     static const WCHAR CF_EMBEDDEDOBJECTW[]       = { 'E','m','b','e','d','d','e','d',' ','O','b','j','e','c','t',0 };
55     static const WCHAR CF_LINKSOURCEW[]           = { 'L','i','n','k',' ','S','o','u','r','c','e',0 };
56     static const WCHAR CF_OBJECTDESCRIPTORW[]     = { 'O','b','j','e','c','t',' ','D','e','s','c','r','i','p','t','o','r',0 };
57     static const WCHAR CF_LINKSRCDESCRIPTORW[]    = { 'L','i','n','k',' ','S','o','u','r','c','e',' ','D','e','s','c','r','i','p','t','o','r',0 };
58     static const WCHAR CF_OWNERLINKW[]            = { 'O','w','n','e','r','L','i','n','k',0 };
59     static const WCHAR CF_FILENAMEW[]             = { 'F','i','l','e','N','a','m','e',0 };
60     static const WCHAR CF_FILENAMEWW[]            = { 'F','i','l','e','N','a','m','e','W',0 };
61
62     /* Load in the same order as native to make debugging easier */
63     cf_object_descriptor    = RegisterClipboardFormatW(CF_OBJECTDESCRIPTORW);
64     cf_link_src_descriptor  = RegisterClipboardFormatW(CF_LINKSRCDESCRIPTORW);
65     cf_embed_source         = RegisterClipboardFormatW(CF_EMBEDSOURCEW);
66     cf_embedded_object      = RegisterClipboardFormatW(CF_EMBEDDEDOBJECTW);
67     cf_link_source          = RegisterClipboardFormatW(CF_LINKSOURCEW);
68     cf_ownerlink            = RegisterClipboardFormatW(CF_OWNERLINKW);
69     cf_filename             = RegisterClipboardFormatW(CF_FILENAMEW);
70     cf_filenamew            = RegisterClipboardFormatW(CF_FILENAMEWW);
71 }
72
73 static void register_messages(void)
74 {
75     oleui_msg_help             = RegisterWindowMessageW(SZOLEUI_MSG_HELPW);
76     oleui_msg_enddialog        = RegisterWindowMessageW(SZOLEUI_MSG_ENDDIALOGW);
77 }
78
79 /***********************************************************************
80  *              DllMain
81  */
82 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
83 {
84     TRACE("%p 0x%x %p\n", hinstDLL, fdwReason, fImpLoad);
85
86     switch(fdwReason) {
87     case DLL_PROCESS_ATTACH:
88         DisableThreadLibraryCalls(hinstDLL);
89         OLEDLG_hInstance = hinstDLL;
90         register_clipboard_formats();
91         register_messages();
92         break;
93     }
94     return TRUE;
95 }
96
97
98 /***********************************************************************
99  *           OleUIAddVerbMenuA (OLEDLG.1)
100  */
101 BOOL WINAPI OleUIAddVerbMenuA(
102   LPOLEOBJECT lpOleObj, LPCSTR lpszShortType,
103   HMENU hMenu, UINT uPos, UINT uIDVerbMin, UINT uIDVerbMax,
104   BOOL bAddConvert, UINT idConvert, HMENU *lphMenu)
105 {
106   FIXME("(%p, %s, %p, %d, %d, %d, %d, %d, %p): stub\n",
107     lpOleObj, debugstr_a(lpszShortType),
108     hMenu, uPos, uIDVerbMin, uIDVerbMax,
109     bAddConvert, idConvert, lphMenu
110   );
111   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
112   return FALSE;
113 }
114
115 /***********************************************************************
116  *           OleUIAddVerbMenuW (OLEDLG.14)
117  */
118 BOOL WINAPI OleUIAddVerbMenuW(
119   LPOLEOBJECT lpOleObj, LPCWSTR lpszShortType,
120   HMENU hMenu, UINT uPos, UINT uIDVerbMin, UINT uIDVerbMax,
121   BOOL bAddConvert, UINT idConvert, HMENU *lphMenu)
122 {
123   FIXME("(%p, %s, %p, %d, %d, %d, %d, %d, %p): stub\n",
124     lpOleObj, debugstr_w(lpszShortType),
125     hMenu, uPos, uIDVerbMin, uIDVerbMax,
126     bAddConvert, idConvert, lphMenu
127   );
128   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
129   return FALSE;
130 }
131
132 /***********************************************************************
133  *           OleUICanConvertOrActivateAs (OLEDLG.2)
134  */
135 BOOL WINAPI OleUICanConvertOrActivateAs(
136     REFCLSID rClsid, BOOL fIsLinkedObject, WORD wFormat)
137 {
138   FIXME("(%p, %d, %hd): stub\n",
139     rClsid, fIsLinkedObject, wFormat
140   );
141   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
142   return FALSE;
143 }
144
145 /***********************************************************************
146  *           OleUIInsertObjectW (OLEDLG.20)
147  */
148 UINT WINAPI OleUIInsertObjectW(LPOLEUIINSERTOBJECTW lpOleUIInsertObject)
149 {
150   FIXME("(%p): stub\n", lpOleUIInsertObject);
151   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
152   return OLEUI_FALSE;
153 }
154
155 /***********************************************************************
156  *           OleUIEditLinksA (OLEDLG.5)
157  */
158 UINT WINAPI OleUIEditLinksA(LPOLEUIEDITLINKSA lpOleUIEditLinks)
159 {
160   FIXME("(%p): stub\n", lpOleUIEditLinks);
161   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
162   return OLEUI_FALSE;
163 }
164
165 /***********************************************************************
166  *           OleUIEditLinksW (OLEDLG.19)
167  */
168 UINT WINAPI OleUIEditLinksW(LPOLEUIEDITLINKSW lpOleUIEditLinks)
169 {
170   FIXME("(%p): stub\n", lpOleUIEditLinks);
171   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
172   return OLEUI_FALSE;
173 }
174
175 /***********************************************************************
176  *           OleUIChangeIconA (OLEDLG.6)
177  */
178 UINT WINAPI OleUIChangeIconA(
179   LPOLEUICHANGEICONA lpOleUIChangeIcon)
180 {
181   FIXME("(%p): stub\n", lpOleUIChangeIcon);
182   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
183   return OLEUI_FALSE;
184 }
185
186 /***********************************************************************
187  *           OleUIChangeIconW (OLEDLG.16)
188  */
189 UINT WINAPI OleUIChangeIconW(
190   LPOLEUICHANGEICONW lpOleUIChangeIcon)
191 {
192   FIXME("(%p): stub\n", lpOleUIChangeIcon);
193   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
194   return OLEUI_FALSE;
195 }
196
197 /***********************************************************************
198  *           OleUIConvertA (OLEDLG.7)
199  */
200 UINT WINAPI OleUIConvertA(LPOLEUICONVERTA lpOleUIConvert)
201 {
202   FIXME("(%p): stub\n", lpOleUIConvert);
203   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
204   return OLEUI_FALSE;
205 }
206
207 /***********************************************************************
208  *           OleUIConvertW (OLEDLG.18)
209  */
210 UINT WINAPI OleUIConvertW(LPOLEUICONVERTW lpOleUIConvert)
211 {
212   FIXME("(%p): stub\n", lpOleUIConvert);
213   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
214   return OLEUI_FALSE;
215 }
216
217 /***********************************************************************
218  *           OleUIBusyA (OLEDLG.8)
219  */
220 UINT WINAPI OleUIBusyA(LPOLEUIBUSYA lpOleUIBusy)
221 {
222   FIXME("(%p): stub\n", lpOleUIBusy);
223   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
224   return OLEUI_FALSE;
225 }
226
227 /***********************************************************************
228  *           OleUIBusyW (OLEDLG.15)
229  */
230 UINT WINAPI OleUIBusyW(LPOLEUIBUSYW lpOleUIBusy)
231 {
232   FIXME("(%p): stub\n", lpOleUIBusy);
233   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
234   return OLEUI_FALSE;
235 }
236
237 /***********************************************************************
238  *           OleUIUpdateLinksA (OLEDLG.9)
239  */
240 BOOL WINAPI OleUIUpdateLinksA(
241   LPOLEUILINKCONTAINERA lpOleUILinkCntr,
242   HWND hwndParent, LPSTR lpszTitle, INT cLinks)
243 {
244   FIXME("(%p, %p, %s, %d): stub\n",
245     lpOleUILinkCntr, hwndParent, debugstr_a(lpszTitle), cLinks
246   );
247   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
248   return FALSE;
249 }
250
251 /***********************************************************************
252  *           OleUIUpdateLinksW (OLEDLG.23)
253  */
254 BOOL WINAPI OleUIUpdateLinksW(
255   LPOLEUILINKCONTAINERW lpOleUILinkCntr,
256   HWND hwndParent, LPWSTR lpszTitle, INT cLinks)
257 {
258   FIXME("(%p, %p, %s, %d): stub\n",
259     lpOleUILinkCntr, hwndParent, debugstr_w(lpszTitle), cLinks
260   );
261   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
262   return FALSE;
263 }
264
265 /***********************************************************************
266  *           OleUIPromptUserA (OLEDLG.10)
267  */
268 INT WINAPIV OleUIPromptUserA(
269   INT nTemplate, HWND hwndParent, ...)
270 {
271   FIXME("(%d, %p, ...): stub\n", nTemplate, hwndParent);
272   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
273   return OLEUI_FALSE;
274 }
275
276 /***********************************************************************
277  *           OleUIPromptUserW (OLEDLG.13)
278  */
279 INT WINAPIV OleUIPromptUserW(
280   INT nTemplate, HWND hwndParent, ...)
281 {
282   FIXME("(%d, %p, ...): stub\n", nTemplate, hwndParent);
283   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
284   return OLEUI_FALSE;
285 }
286
287 /***********************************************************************
288  *           OleUIObjectPropertiesA (OLEDLG.11)
289  */
290 UINT WINAPI OleUIObjectPropertiesA(
291   LPOLEUIOBJECTPROPSA lpOleUIObjectProps)
292 {
293   FIXME("(%p): stub\n", lpOleUIObjectProps);
294   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
295   return OLEUI_FALSE;
296 }
297
298 /***********************************************************************
299  *           OleUIObjectPropertiesW (OLEDLG.21)
300  */
301 UINT WINAPI OleUIObjectPropertiesW(
302   LPOLEUIOBJECTPROPSW lpOleUIObjectProps)
303 {
304   FIXME("(%p): stub\n", lpOleUIObjectProps);
305   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
306   return OLEUI_FALSE;
307 }
308
309 /***********************************************************************
310  *           OleUIChangeSourceA (OLEDLG.12)
311  */
312 UINT WINAPI OleUIChangeSourceA(
313   LPOLEUICHANGESOURCEA lpOleUIChangeSource)
314 {
315   FIXME("(%p): stub\n", lpOleUIChangeSource);
316   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
317   return OLEUI_FALSE;
318 }
319
320 /***********************************************************************
321  *           OleUIChangeSourceW (OLEDLG.17)
322  */
323 UINT WINAPI OleUIChangeSourceW(
324   LPOLEUICHANGESOURCEW lpOleUIChangeSource)
325 {
326   FIXME("(%p): stub\n", lpOleUIChangeSource);
327   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
328   return OLEUI_FALSE;
329 }