1
/*********************************************************
2
* Copyright (C) 2007 VMware, Inc. All rights reserved.
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License as published
6
* by the Free Software Foundation version 2.1 and no later version.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10
* or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
11
* License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program; if not, write to the Free Software Foundation, Inc.,
15
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17
*********************************************************/
20
* @file unityPlatform.h
22
* Implementation specific functionality
25
#ifndef _UNITY_PLATFORM_H_
26
#define _UNITY_PLATFORM_H_
28
#include "unityWindowTracker.h"
32
* Container used to store and send Unity updates.
36
DynBuf updates; ///< See @ref vmtools_unity_uwtGuestRpc.
37
size_t cmdSize; /**< @brief Size of RpcOut command prefix.
38
Used as a convenient offset within #updates when
39
resetting the update buffer. */
50
typedef struct _UnityPlatform UnityPlatform;
53
* Implemented by unityPlatform[Win32|X11|Cocoa (ha!)].c
59
Bool UnityPlatformIsSupported(void);
60
UnityPlatform *UnityPlatformInit(UnityWindowTracker *tracker,
61
UnityUpdateChannel *updateChannel,
63
DesktopSwitchCallbackManager *desktopSwitchCallbackMgr);
64
void UnityPlatformCleanup(UnityPlatform *up);
65
void UnityPlatformRegisterCaps(UnityPlatform *up);
66
void UnityPlatformUnregisterCaps(UnityPlatform *up);
67
Bool UnityPlatformUpdateWindowState(UnityPlatform *up,
68
UnityWindowTracker *tracker);
69
void UnityPlatformSaveSystemSettings(UnityPlatform *up);
70
void UnityPlatformRestoreSystemSettings(UnityPlatform *up);
71
Bool UnityPlatformGetWindowPath(UnityPlatform *up,
73
DynBuf *windowPathUtf8,
74
DynBuf *execPathUtf8);
75
Bool UnityPlatformGetNativeWindowPath(UnityPlatform *up,
78
Bool UnityPlatformGetBinaryInfo(UnityPlatform *up,
81
Bool UnityPlatformSetTopWindowGroup(UnityPlatform *up,
82
UnityWindowId *windows,
83
unsigned int windowCount);
84
Bool UnityPlatformCloseWindow(UnityPlatform *up, UnityWindowId window);
85
Bool UnityPlatformShowWindow(UnityPlatform *up, UnityWindowId window);
86
Bool UnityPlatformHideWindow(UnityPlatform *up, UnityWindowId window);
87
Bool UnityPlatformMinimizeWindow(UnityPlatform *up, UnityWindowId window);
88
Bool UnityPlatformUnminimizeWindow(UnityPlatform *up, UnityWindowId window);
89
Bool UnityPlatformMaximizeWindow(UnityPlatform *up, UnityWindowId window);
90
Bool UnityPlatformUnmaximizeWindow(UnityPlatform *up, UnityWindowId window);
91
Bool UnityPlatformGetWindowContents(UnityPlatform *up,
96
Bool UnityPlatformMoveResizeWindow(UnityPlatform *up,
98
UnityRect *moveResizeRect);
99
void UnityPlatformShowTaskbar(UnityPlatform *up, Bool showTaskbar);
100
Bool UnityPlatformGetIconData(UnityPlatform *up,
101
UnityWindowId window,
102
UnityIconType iconType,
103
UnityIconSize iconSize,
108
Bool UnityPlatformSetDesktopWorkAreas(UnityPlatform *up,
109
UnityRect workAreas[],
110
uint32 numWorkAreas);
111
Bool UnityPlatformSetDesktopConfig(UnityPlatform *up,
112
const UnityVirtualDesktopArray *desktops);
113
Bool UnityPlatformSetInitialDesktop(UnityPlatform *up,
114
UnityDesktopId desktopId);
115
Bool UnityPlatformSetDesktopActive(UnityPlatform *up,
116
UnityDesktopId desktopId);
117
Bool UnityPlatformSetWindowDesktop(UnityPlatform *up,
118
UnityWindowId windowId,
119
UnityDesktopId desktopId);
120
Bool UnityPlatformStickWindow(UnityPlatform *up,
121
UnityWindowId windowId);
122
Bool UnityPlatformUnstickWindow(UnityPlatform *up,
123
UnityWindowId windowId);
124
void UnityPlatformSetInterlockMinimizeOperation(UnityPlatform *up,Bool enabled);
125
Bool UnityPlatformConfirmMinimizeOperation(UnityPlatform *up,
126
UnityWindowId windowId,
129
Bool UnityPlatformIsUnityRunning(UnityPlatform *up);
130
Bool UnityPlatformStartHelperThreads(UnityPlatform *up);
131
void UnityPlatformKillHelperThreads(UnityPlatform *up);
132
void UnityPlatformUnlock(UnityPlatform *up);
133
void UnityPlatformLock(UnityPlatform *up);
134
void UnityPlatformUpdateDnDDetWnd(UnityPlatform *up,
136
void UnityPlatformSetActiveDnDDetWnd(UnityPlatform *up, UnityDnD *detWnd);
138
void UnityPlatformDoUpdate(UnityPlatform *up, Bool incremental);
140
void UnityPlatformSetConfigDesktopColor(UnityPlatform *up, int desktopColor);
142
Bool UnityPlatformRequestWindowContents(UnityPlatform *up,
143
UnityWindowId windowIds[],
144
uint32 numWindowIds);
147
* Function called by UnityUpdateCallbackFn whenever a window is removed from
150
* NOTE: This function is called with the platform lock held.
152
void UnityPlatformWillRemoveWindow(UnityPlatform *up, UnityWindowId windowId);
154
/* Functions implemented in unity.c for use by the platform-specific code. */
155
void UnityGetUpdateCommon(int flags, DynBuf *buf);
156
Bool UnityUpdateChannelInit(UnityUpdateChannel *updateChannel);
157
void UnityUpdateChannelCleanup(UnityUpdateChannel *updateChannel);
158
Bool UnitySendUpdates(UnityUpdateChannel *updateChannel);
159
Bool UnitySendRequestMinimizeOperation(UnityWindowId windowId, uint32 sequence);
161
/* Sends the provided window contents to the host. */
162
Bool UnitySendWindowContents(UnityWindowId windowID,
165
const char *imageData,
170
#endif // __cplusplus