blob: 5e0c5de255544e7aaa20b6e258ae1b9f111716b9 [file] [log] [blame]
DRC3080ec42011-10-12 20:00:55 +00001/* Copyright (C) 2011 TigerVNC Team. All Rights Reserved.
2 *
3 * This is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This software is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this software; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16 * USA.
17 */
18
19#ifndef OS_W32TIGER_H
20#define OS_W32TIGER_H
21
22#ifdef WIN32
23
24#include <windows.h>
25#include <wininet.h>
26#include <shlobj.h>
27#include <shlguid.h>
28#include <wininet.h>
29
30
31/* MSLLHOOKSTRUCT structure*/
32#ifndef LLMHF_INJECTED
33#define LLMHF_INJECTED 0x00000001
34#endif
35
36
37/* IActiveDesktop. As of 2011-10-12, MinGW does not define
38 IActiveDesktop in any way (see tracker 2877129), while MinGW64 is
39 broken: has the headers but not the lib symbols. */
40#ifndef HAVE_ACTIVE_DESKTOP_H
41extern const GUID CLSID_ActiveDesktop;
42extern const GUID IID_IActiveDesktop;
43
44/* IActiveDesktop::AddUrl */
45#define ADDURL_SILENT 0x0001
46
47/* IActiveDesktop::AddDesktopItemWithUI */
48#define DTI_ADDUI_DEFAULT 0x00000000
49#define DTI_ADDUI_DISPSUBWIZARD 0x00000001
50#define DTI_ADDUI_POSITIONITEM 0x00000002
51
52/* IActiveDesktop::ModifyDesktopItem */
53#define COMP_ELEM_TYPE 0x00000001
54#define COMP_ELEM_CHECKED 0x00000002
55#define COMP_ELEM_DIRTY 0x00000004
56#define COMP_ELEM_NOSCROLL 0x00000008
57#define COMP_ELEM_POS_LEFT 0x00000010
58#define COMP_ELEM_POS_TOP 0x00000020
59#define COMP_ELEM_SIZE_WIDTH 0x00000040
60#define COMP_ELEM_SIZE_HEIGHT 0x00000080
61#define COMP_ELEM_POS_ZINDEX 0x00000100
62#define COMP_ELEM_SOURCE 0x00000200
63#define COMP_ELEM_FRIENDLYNAME 0x00000400
64#define COMP_ELEM_SUBSCRIBEDURL 0x00000800
65#define COMP_ELEM_ORIGINAL_CSI 0x00001000
66#define COMP_ELEM_RESTORED_CSI 0x00002000
67#define COMP_ELEM_CURITEMSTATE 0x00004000
68#define COMP_ELEM_ALL 0x00007FFF /* OR-ed all COMP_ELEM_ */
69
70/* IActiveDesktop::GetWallpaper */
71#define AD_GETWP_BMP 0x00000000
72#define AD_GETWP_IMAGE 0x00000001
73#define AD_GETWP_LAST_APPLIED 0x00000002
74
75/* IActiveDesktop::ApplyChanges */
76#define AD_APPLY_SAVE 0x00000001
77#define AD_APPLY_HTMLGEN 0x00000002
78#define AD_APPLY_REFRESH 0x00000004
79#define AD_APPLY_ALL 0x00000007 /* OR-ed three AD_APPLY_ above */
80#define AD_APPLY_FORCE 0x00000008
81#define AD_APPLY_BUFFERED_REFRESH 0x00000010
82#define AD_APPLY_DYNAMICREFRESH 0x00000020
83
84/* Structures for IActiveDesktop */
85typedef struct {
86 DWORD dwSize;
87 int iLeft;
88 int iTop;
89 DWORD dwWidth;
90 DWORD dwHeight;
91 DWORD dwItemState;
92} COMPSTATEINFO, *LPCOMPSTATEINFO;
93typedef const COMPSTATEINFO *LPCCOMPSTATEINFO;
94
95typedef struct {
96 DWORD dwSize;
97 int iLeft;
98 int iTop;
99 DWORD dwWidth;
100 DWORD dwHeight;
101 int izIndex;
102 BOOL fCanResize;
103 BOOL fCanResizeX;
104 BOOL fCanResizeY;
105 int iPreferredLeftPercent;
106 int iPreferredTopPercent;
107} COMPPOS, *LPCOMPPOS;
108typedef const COMPPOS *LPCCOMPPOS;
109
110typedef struct {
111 DWORD dwSize;
112 DWORD dwID;
113 int iComponentType;
114 BOOL fChecked;
115 BOOL fDirty;
116 BOOL fNoScroll;
117 COMPPOS cpPos;
118 WCHAR wszFriendlyName[MAX_PATH];
119 WCHAR wszSource[INTERNET_MAX_URL_LENGTH];
120 WCHAR wszSubscribedURL[INTERNET_MAX_URL_LENGTH];
121 DWORD dwCurItemState;
122 COMPSTATEINFO csiOriginal;
123 COMPSTATEINFO csiRestored;
124} COMPONENT, *LPCOMPONENT;
125typedef const COMPONENT *LPCCOMPONENT;
126
127typedef struct {
128 DWORD dwSize;
129 BOOL fEnableComponents;
130 BOOL fActiveDesktop;
131} COMPONENTSOPT, *LPCOMPONENTSOPT;
132typedef const COMPONENTSOPT *LPCCOMPONENTSOPT;
133
134typedef struct {
135 DWORD dwSize;
136 DWORD dwStyle;
137} WALLPAPEROPT, *LPWALLPAPEROPT;
138typedef const WALLPAPEROPT *LPCWALLPAPEROPT;
139
140/* WALLPAPEROPT styles */
141#define WPSTYLE_CENTER 0x0
142#define WPSTYLE_TILE 0x1
143#define WPSTYLE_STRETCH 0x2
144#define WPSTYLE_MAX 0x3
145
146/* Those two are defined in Windows 7 and newer, we don't need them now */
147#if 0
148#define WPSTYLE_KEEPASPECT 0x3
149#define WPSTYLE_CROPTOFIT 0x4
150#endif
151
152#define INTERFACE IActiveDesktop
153DECLARE_INTERFACE_(IActiveDesktop, IUnknown)
154{
155 STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
156 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
157 STDMETHOD_(ULONG,Release)(THIS) PURE;
158 STDMETHOD(AddDesktopItem)(THIS_ LPCOMPONENT,DWORD) PURE;
159 STDMETHOD(AddDesktopItemWithUI)(THIS_ HWND,LPCOMPONENT,DWORD) PURE;
160 STDMETHOD(AddUrl)(THIS_ HWND,LPCWSTR,LPCOMPONENT,DWORD) PURE;
161 STDMETHOD(ApplyChanges)(THIS_ DWORD) PURE;
162 STDMETHOD(GenerateDesktopItemHtml)(THIS_ LPCWSTR,LPCOMPONENT,DWORD) PURE;
163 STDMETHOD(GetDesktopItem)(THIS_ int,LPCOMPONENT,DWORD) PURE;
164 STDMETHOD(GetDesktopItemByID)(THIS_ DWORD,LPCOMPONENT,DWORD) PURE;
165 STDMETHOD(GetDesktopItemBySource)(THIS_ LPCWSTR,LPCOMPONENT,DWORD) PURE;
166 STDMETHOD(GetDesktopItemCount)(THIS_ LPINT,DWORD) PURE;
167 STDMETHOD(GetDesktopItemOptions)(THIS_ LPCOMPONENTSOPT,DWORD) PURE;
168 STDMETHOD(GetPattern)(THIS_ LPWSTR,UINT,DWORD) PURE;
169 STDMETHOD(GetWallpaper)(THIS_ LPWSTR,UINT,DWORD) PURE;
170 STDMETHOD(GetWallpaperOptions)(THIS_ LPWALLPAPEROPT,DWORD) PURE;
171 STDMETHOD(ModifyDesktopItem)(THIS_ LPCCOMPONENT,DWORD) PURE;
172 STDMETHOD(RemoveDesktopItem)(THIS_ LPCCOMPONENT,DWORD) PURE;
173 STDMETHOD(SetDesktopItemOptions)(THIS_ LPCCOMPONENTSOPT,DWORD) PURE;
174 STDMETHOD(SetPattern)(THIS_ LPCWSTR,DWORD) PURE;
175 STDMETHOD(SetWallpaper)(THIS_ LPCWSTR,DWORD) PURE;
176 STDMETHOD(SetWallpaperOptions)(THIS_ LPCWALLPAPEROPT,DWORD) PURE;
177};
178#undef INTERFACE
179#endif /* HAVE_ACTIVE_DESKTOP_H */
180
181#endif /* WIN32 */
182#endif /* OS_W32TIGER_H */