Fixed DLLMODE handling (--mode is now --subsystem and uses -Wb).
[wine] / dlls / olecli / olecli16.c
1 /*
2  *      OLECLI library
3  *
4  *      Copyright 1995  Martin von Loewis
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 /*      At the moment, these are only empty stubs.
22  */
23
24 #include "config.h"
25
26 #include <stdarg.h>
27
28 #include "windef.h"
29 #include "wine/windef16.h"
30 #include "winbase.h"
31 #include "wingdi.h"
32 #include "wownt32.h"
33 #include "objbase.h"
34 #include "wine/debug.h"
35
36 WINE_DEFAULT_DEBUG_CHANNEL(ole);
37
38 typedef enum
39 {
40     OLE_OK,
41     OLE_WAIT_FOR_RELEASE,
42     OLE_BUSY,
43     OLE_ERROR_PROTECT_ONLY,
44     OLE_ERROR_MEMORY,
45     OLE_ERROR_STREAM,
46     OLE_ERROR_STATIC,
47     OLE_ERROR_BLANK,
48     OLE_ERROR_DRAW,
49     OLE_ERROR_METAFILE,
50     OLE_ERROR_ABORT,
51     OLE_ERROR_CLIPBOARD,
52     OLE_ERROR_FORMAT,
53     OLE_ERROR_OBJECT,
54     OLE_ERROR_OPTION,
55     OLE_ERROR_PROTOCOL,
56     OLE_ERROR_ADDRESS,
57     OLE_ERROR_NOT_EQUAL,
58     OLE_ERROR_HANDLE,
59     OLE_ERROR_GENERIC,
60     OLE_ERROR_CLASS,
61     OLE_ERROR_SYNTAX,
62     OLE_ERROR_DATATYPE,
63     OLE_ERROR_PALETTE,
64     OLE_ERROR_NOT_LINK,
65     OLE_ERROR_NOT_EMPTY,
66     OLE_ERROR_SIZE,
67     OLE_ERROR_DRIVE,
68     OLE_ERROR_NETWORK,
69     OLE_ERROR_NAME,
70     OLE_ERROR_TEMPLATE,
71     OLE_ERROR_NEW,
72     OLE_ERROR_EDIT,
73     OLE_ERROR_OPEN,
74     OLE_ERROR_NOT_OPEN,
75     OLE_ERROR_LAUNCH,
76     OLE_ERROR_COMM,
77     OLE_ERROR_TERMINATE,
78     OLE_ERROR_COMMAND,
79     OLE_ERROR_SHOW,
80     OLE_ERROR_DOVERB,
81     OLE_ERROR_ADVISE_NATIVE,
82     OLE_ERROR_ADVISE_PICT,
83     OLE_ERROR_ADVISE_RENAME,
84     OLE_ERROR_POKE_NATIVE,
85     OLE_ERROR_REQUEST_NATIVE,
86     OLE_ERROR_REQUEST_PICT,
87     OLE_ERROR_SERVER_BLOCKED,
88     OLE_ERROR_REGISTRATION,
89     OLE_ERROR_ALREADY_REGISTERED,
90     OLE_ERROR_TASK,
91     OLE_ERROR_OUTOFDATE,
92     OLE_ERROR_CANT_UPDATE_CLIENT,
93     OLE_ERROR_UPDATE,
94     OLE_ERROR_SETDATA_FORMAT,
95     OLE_ERROR_STATIC_FROM_OTHER_OS,
96     OLE_WARN_DELETE_DATA = 1000
97 } OLESTATUS;
98
99 typedef enum
100 {
101     olerender_none,
102     olerender_draw,
103     olerender_format
104 } OLEOPT_RENDER;
105
106 typedef enum
107 {
108     oleupdate_always,
109     oleupdate_onsave,
110     oleupdate_oncall,
111     oleupdate_onclose
112 } OLEOPT_UPDATE;
113
114 typedef enum {
115     OLE_NONE,     /* none */
116     OLE_DELETE,   /* delete object */
117     OLE_LNKPASTE, /* link paste */
118     OLE_EMBPASTE, /* paste(and update) */
119     OLE_SHOW,
120     OLE_RUN,
121     OLE_ACTIVATE,
122     OLE_UPDATE,
123     OLE_CLOSE,
124     OLE_RECONNECT,
125     OLE_SETUPDATEOPTIONS,
126     OLE_SERVERRUNLAUNCH, /* unlaunch (terminate?) server */
127     OLE_LOADFROMSTREAM,  /* (auto reconnect) */
128     OLE_SETDATA,         /* OleSetData */
129     OLE_REQUESTDATA,     /* OleRequestData */
130     OLE_OTHER,
131     OLE_CREATE,
132     OLE_CREATEFROMTEMPLATE,
133     OLE_CREATELINKFROMFILE,
134     OLE_COPYFROMLNK,
135     OLE_CREATREFROMFILE,
136     OLE_CREATEINVISIBLE
137 } OLE_RELEASE_METHOD;
138
139 typedef LONG LHCLIENTDOC;
140 typedef struct _OLEOBJECT *LPOLEOBJECT;
141 typedef struct _OLECLIENT *LPOLECLIENT;
142 typedef LONG OLECLIPFORMAT;/* dunno about this type, please change/add */
143 typedef OLEOPT_UPDATE *LPOLEOPT_UPDATE;
144 typedef LPCSTR LPCOLESTR16;
145
146 struct _OLESTREAM;
147
148 typedef struct _OLEOBJECTVTBL {
149     void CALLBACK *(*QueryProtocol)(LPOLEOBJECT,LPCOLESTR16);
150     OLESTATUS      (CALLBACK *Release)(LPOLEOBJECT);
151     OLESTATUS      (CALLBACK *Show)(LPOLEOBJECT,BOOL16);
152     OLESTATUS      (CALLBACK *DoVerb)(LPOLEOBJECT,UINT16,BOOL16,BOOL16);
153     OLESTATUS      (CALLBACK *GetData)(LPOLEOBJECT,OLECLIPFORMAT,HANDLE16 *);
154     OLESTATUS      (CALLBACK *SetData)(LPOLEOBJECT,OLECLIPFORMAT,HANDLE16);
155     OLESTATUS      (CALLBACK *SetTargetDevice)(LPOLEOBJECT,HGLOBAL16);
156     OLESTATUS      (CALLBACK *SetBounds)(LPOLEOBJECT,LPRECT16);
157     OLESTATUS      (CALLBACK *EnumFormats)(LPOLEOBJECT,OLECLIPFORMAT);
158     OLESTATUS      (CALLBACK *SetColorScheme)(LPOLEOBJECT,struct tagLOGPALETTE*);
159     OLESTATUS      (CALLBACK *Delete)(LPOLEOBJECT);
160     OLESTATUS      (CALLBACK *SetHostNames)(LPOLEOBJECT,LPCOLESTR16,LPCOLESTR16);
161     OLESTATUS      (CALLBACK *SaveToStream)(LPOLEOBJECT,struct _OLESTREAM*);
162     OLESTATUS      (CALLBACK *Clone)(LPOLEOBJECT,LPOLECLIENT,LHCLIENTDOC,LPCOLESTR16,LPOLEOBJECT *);
163     OLESTATUS      (CALLBACK *CopyFromLink)(LPOLEOBJECT,LPOLECLIENT,LHCLIENTDOC,LPCOLESTR16,LPOLEOBJECT *);
164     OLESTATUS      (CALLBACK *Equal)(LPOLEOBJECT,LPOLEOBJECT);
165     OLESTATUS      (CALLBACK *CopyToClipBoard)(LPOLEOBJECT);
166     OLESTATUS      (CALLBACK *Draw)(LPOLEOBJECT,HDC16,LPRECT16,LPRECT16,HDC16);
167     OLESTATUS      (CALLBACK *Activate)(LPOLEOBJECT,UINT16,BOOL16,BOOL16,HWND16,LPRECT16);
168     OLESTATUS      (CALLBACK *Execute)(LPOLEOBJECT,HGLOBAL16,UINT16);
169     OLESTATUS      (CALLBACK *Close)(LPOLEOBJECT);
170     OLESTATUS      (CALLBACK *Update)(LPOLEOBJECT);
171     OLESTATUS      (CALLBACK *Reconnect)(LPOLEOBJECT);
172     OLESTATUS      (CALLBACK *ObjectConvert)(LPOLEOBJECT,LPCOLESTR16,LPOLECLIENT,LHCLIENTDOC,LPCOLESTR16,LPOLEOBJECT*);
173     OLESTATUS      (CALLBACK *GetLinkUpdateOptions)(LPOLEOBJECT,LPOLEOPT_UPDATE);
174     OLESTATUS      (CALLBACK *SetLinkUpdateOptions)(LPOLEOBJECT,OLEOPT_UPDATE);
175     OLESTATUS      (CALLBACK *Rename)(LPOLEOBJECT,LPCOLESTR16);
176     OLESTATUS      (CALLBACK *QueryName)(LPOLEOBJECT,LPSTR,LPUINT16);
177     OLESTATUS      (CALLBACK *QueryType)(LPOLEOBJECT,LPLONG);
178     OLESTATUS      (CALLBACK *QueryBounds)(LPOLEOBJECT,LPRECT16);
179     OLESTATUS      (CALLBACK *QuerySize)(LPOLEOBJECT,LPDWORD);
180     OLESTATUS      (CALLBACK *QueryOpen)(LPOLEOBJECT);
181     OLESTATUS      (CALLBACK *QueryOutOfDate)(LPOLEOBJECT);
182     OLESTATUS      (CALLBACK *QueryReleaseStatus)(LPOLEOBJECT);
183     OLESTATUS      (CALLBACK *QueryReleaseError)(LPOLEOBJECT);
184     OLE_RELEASE_METHOD (CALLBACK *QueryReleaseMethod)(LPOLEOBJECT);
185     OLESTATUS      (CALLBACK *RequestData)(LPOLEOBJECT,OLECLIPFORMAT);
186     OLESTATUS      (CALLBACK *ObjectLong)(LPOLEOBJECT,UINT16,LPLONG);
187 } OLEOBJECTVTBL;
188 typedef OLEOBJECTVTBL *LPOLEOBJECTVTBL;
189
190 typedef struct _OLEOBJECT
191 {
192     LPOLEOBJECTVTBL lpvtbl;
193 } OLEOBJECT;
194
195 static LONG OLE_current_handle;
196
197 /******************************************************************************
198  *              OleSavedClientDoc       [OLECLI.45]
199  */
200 OLESTATUS WINAPI OleSavedClientDoc16(LHCLIENTDOC hDoc)
201 {
202     FIXME("(%ld: stub\n", hDoc);
203     return OLE_OK;
204 }
205
206 /******************************************************************************
207  *              OleRegisterClientDoc    [OLECLI.41]
208  */
209 OLESTATUS WINAPI OleRegisterClientDoc16(LPCSTR classname, LPCSTR docname,
210                                         LONG reserved, LHCLIENTDOC *hRet )
211 {
212     FIXME("(%s,%s,...): stub\n",classname,docname);
213     *hRet=++OLE_current_handle;
214     return OLE_OK;
215 }
216
217 /******************************************************************************
218  *              OleRenameClientDoc      [OLECLI.43]
219  */
220 OLESTATUS WINAPI OleRenameClientDoc16(LHCLIENTDOC hDoc, LPCSTR newName)
221 {
222     FIXME("(%ld,%s,...): stub\n",hDoc, newName);
223     return OLE_OK;
224 }
225
226 /******************************************************************************
227  *              OleRevokeClientDoc      [OLECLI.42]
228  */
229 OLESTATUS WINAPI OleRevokeClientDoc16(LHCLIENTDOC hServerDoc)
230 {
231     FIXME("(%ld): stub\n",hServerDoc);
232     return OLE_OK;
233 }
234
235 /******************************************************************************
236  *              OleRevertClientDoc      [OLECLI.44]
237  */
238 OLESTATUS WINAPI OleRevertClientDoc16(LHCLIENTDOC hServerDoc)
239 {
240     FIXME("(%ld): stub\n", hServerDoc);
241     return OLE_OK;
242 }
243
244 /******************************************************************************
245  *              OleEnumObjects  [OLECLI.47]
246  */
247 OLESTATUS WINAPI OleEnumObjects16(LHCLIENTDOC hServerDoc, SEGPTR data)
248 {
249     FIXME("(%ld, %04x:%04x): stub\n", hServerDoc, HIWORD(data),
250         LOWORD(data));
251     return OLE_OK;
252 }
253
254 /******************************************************************************
255  *           OleCreateLinkFromClip      [OLECLI.11]
256  */
257 OLESTATUS WINAPI OleCreateLinkFromClip16( LPCSTR name, SEGPTR olecli, LHCLIENTDOC hclientdoc,
258                                           LPCSTR xname, SEGPTR lpoleob, UINT16 render,
259                                           UINT16 clipformat )
260 {
261         FIXME("(%s, %04x:%04x, %ld, %s, %04x:%04x, %d, %d): stub!\n",
262               name, HIWORD(olecli), LOWORD(olecli), hclientdoc, xname, HIWORD(lpoleob),
263               LOWORD(lpoleob), render, clipformat);
264         return OLE_OK;
265 }
266
267 /******************************************************************************
268  *           OleQueryLinkFromClip       [OLECLI.9]
269  */
270 OLESTATUS WINAPI OleQueryLinkFromClip16(LPCSTR name, UINT16 render, UINT16 clipformat)
271 {
272         FIXME("(%s, %d, %d): stub!\n", name, render, clipformat);
273         return OLE_OK;
274 }
275
276 /******************************************************************************
277  *           OleQueryCreateFromClip     [OLECLI.10]
278  */
279 OLESTATUS WINAPI OleQueryCreateFromClip16(LPCSTR name, UINT16 render, UINT16 clipformat)
280 {
281         FIXME("(%s, %d, %d): stub!\n", name, render, clipformat);
282         return OLE_OK;
283 }
284
285 /******************************************************************************
286  *              OleIsDcMeta     [OLECLI.60]
287  */
288 BOOL16 WINAPI OleIsDcMeta16(HDC16 hdc)
289 {
290     return GetObjectType( HDC_32(hdc) ) == OBJ_METADC;
291 }
292
293 /******************************************************************************
294  *              OleQueryType    [OLECLI.14]
295  */
296 OLESTATUS WINAPI OleQueryType16(LPOLEOBJECT oleob,  SEGPTR xlong) {
297         FIXME("(%p, %p): stub!\n", oleob, MapSL(xlong));
298         return OLE_OK;
299 }
300
301 /******************************************************************************
302  *              OleCreateFromClip       [OLECLI.12]
303  */
304 OLESTATUS WINAPI OleCreateFromClip16( LPCSTR name, SEGPTR olecli, LHCLIENTDOC hclientdoc,
305                                       LPCSTR xname, SEGPTR lpoleob,
306                                       UINT16 render, UINT16 clipformat )
307 {
308         FIXME("(%s, %04x:%04x, %ld, %s, %04x:%04x, %d, %d): stub!\n",
309               name, HIWORD(olecli), LOWORD(olecli), hclientdoc, xname, HIWORD(lpoleob),
310               LOWORD(lpoleob), render, clipformat);
311         return OLE_OK;
312 }