#define GHI_RPC_RESTORE_DEFAULT_GUEST_HANDLER "ghi.guest.handler.restoreDefault"
#define GHI_RPC_OUTLOOK_SET_TEMP_FOLDER "ghi.guest.outlook.set.tempFolder"
#define GHI_RPC_OUTLOOK_RESTORE_TEMP_FOLDER "ghi.guest.outlook.restore.tempFolder"
-#define GHI_RPC_TRASH_FOLDER_ACTION "ghi.guest.trashFolder.action"
-#define GHI_RPC_TRASH_FOLDER_GET_ICON "ghi.guest.trashFolder.getIcon"
#define GHI_RPC_TRAY_ICON_START_UPDATES "ghi.guest.trayIcon.startUpdates"
#define GHI_RPC_TRAY_ICON_STOP_UPDATES "ghi.guest.trayIcon.stopUpates"
#define GHI_RPC_TRAY_ICON_SEND_EVENT "ghi.guest.trayIcon.sendEvent"
#define UNITY_RPC_UNITY_ACTIVE "unity.active"
#define GHI_RPC_LAUNCHMENU_CHANGE "tools.ghi.launchmenu.change"
#define GHI_RPC_PROTOCOL_HANDLER_INFO "tools.ghi.protocolhandler.info"
-#define GHI_RPC_TRASH_FOLDER_STATE "ghi.guest.trashFolder.state"
#define GHI_RPC_TRAY_ICON_UPDATE "ghi.guest.trayIcon.update"
#define GHI_RPC_HOST_SHELL_ACTION "ghi.host.shell.action"
#define UNITY_RPC_REQUEST_OPERATION "unity.operation.request"
GHI_CAP_SET_HANDLER = 14, // supports setting the handler for types/protocols
UNITY_CAP_STATUS_UNITY_ACTIVE = 15, // supports GuestRpc bits for Unity Status
GHI_CAP_SET_OUTLOOK_TEMP_FOLDER = 16, // supports setting the Outlook temp folder
- GHI_CAP_TRASH_FOLDER = 17, // supports ghi.guest.trashFolder.action,
- // ghi.guest.trashFolder.state, and
- // ghi.guest.trashFolder.getIcon commands
+ // 17 is obsolete, do not use
CAP_SET_TOPO_MODES = 18, // supports setting topology modes in video driver
GHI_CAP_TRAY_ICONS = 19, // supports ghi.guest.trayIcon commands
GHI_CAP_SET_FOCUSED_WINDOW = 20, // supports ghi.guest.setFocusedWindow
{ GHI_CAP_SET_HANDLER, GHI_CAP_VMDB_PATH, "setHandler" },
{ UNITY_CAP_STATUS_UNITY_ACTIVE, UNITY_CAP_VMDB_PATH, "unityActive" },
{ GHI_CAP_SET_OUTLOOK_TEMP_FOLDER, GHI_CAP_VMDB_PATH, "setOutlookTempFolder" },
- { GHI_CAP_TRASH_FOLDER, GHI_CAP_VMDB_PATH, "trashFolder" },
{ CAP_SET_TOPO_MODES, CAP_VMDB_PATH, "displayTopologyModesSet" },
{ GHI_CAP_TRAY_ICONS, GHI_CAP_VMDB_PATH, "trayIcons" },
{ GHI_CAP_SET_FOCUSED_WINDOW, GHI_CAP_VMDB_PATH, "setFocusedWindow"},
RPCGEN_SRCS += ghiSetFocusedWindow_xdr.c
RPCGEN_SRCS += ghiSetGuestHandler_xdr.c
RPCGEN_SRCS += ghiSetOutlookTempFolder_xdr.c
-RPCGEN_SRCS += ghiTrashFolder_xdr.c
RPCGEN_SRCS += unityActive_xdr.c
RPCGEN_SRCS += unity_xdr.c
RPCGEN_HDRS += ghiSetFocusedWindow.h
RPCGEN_HDRS += ghiSetGuestHandler.h
RPCGEN_HDRS += ghiSetOutlookTempFolder.h
-RPCGEN_HDRS += ghiTrashFolder.h
RPCGEN_HDRS += unityActive.h
RPCGEN_HDRS += unity.h
ghiSetOutlookTempFolder_xdr.c: ghiSetOutlookTempFolder.x ghiSetOutlookTempFolder.h
$(RPCGEN) $(RPCGENFLAGS) -c -o $@ $(builddir)/ghiSetOutlookTempFolder.x
-ghiTrashFolder.h: ghiTrashFolder.x
- if [ $(top_builddir) != $(top_srcdir) ]; then \
- cp -f $(top_srcdir)/services/plugins/unity/ghiCommonDefines.h $(builddir); \
- cp -f $(top_srcdir)/services/plugins/unity/ghiTrashFolder.x $(builddir); \
- fi
- $(RPCGEN) $(RPCGENFLAGS) -h -o $@ $(builddir)/ghiTrashFolder.x
- $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp
- mv $@.tmp $@
- $(MKDIR_P) $(top_builddir)/lib/include/guestrpc
- cp $@ $(top_builddir)/lib/include/guestrpc
-
-ghiTrashFolder_xdr.c: ghiTrashFolder.x ghiTrashFolder.h
- $(RPCGEN) $(RPCGENFLAGS) -c -o $@ $(builddir)/ghiTrashFolder.x
-
unityActive.h: unityActive.x
if [ $(top_builddir) != $(top_srcdir) ]; then \
cp -f $(top_srcdir)/services/plugins/unity/unityActive.x $(builddir); \
typedef struct GHIHostCallbacks {
GHILaunchMenuChangeRPCFn launchMenuChange;
- GHISendTrashFolderStateRPCFn sendTrashFolderState;
} GHIHostCallbacks;
Bool GHI_IsSupported(void);
#include "guestrpc/ghiShellAction.h"
#include "guestrpc/ghiStartMenu.h"
#include "guestrpc/ghiTrayIcon.h"
-#include "guestrpc/ghiTrashFolder.h"
#include "vmware/guestrpc/capabilities.h"
static DynBuf gTcloUpdate;
}
-/*
- *-----------------------------------------------------------------------------
- *
- * GHITcloTrashFolderAction --
- *
- * Wrapper function for the ghi.guest.trashFolder.action RPC.
- *
- * Results:
- * TRUE on success, FALSE on failure.
- *
- * Side effects:
- * XXX.
- *
- *-----------------------------------------------------------------------------
- */
-
-gboolean
-GHITcloTrashFolderAction(RpcInData *data) // IN/OUT:
-{
- Bool ret = FALSE;
-
- Debug("%s: Enter.\n", __FUNCTION__);
-
- /* Check our arguments. */
- ASSERT(data);
- if (!data) {
- return FALSE;
- }
-
- ASSERT(data->name);
- ASSERT(data->args);
-
- if (!data->name || !data->args) {
- Debug("%s: Invalid arguments.\n", __FUNCTION__);
- return RPCIN_SETRETVALS(data, "Invalid arguments.", FALSE);
- }
-
- Debug("%s: Got RPC, name: \"%s\", argument length: %"FMTSZ"u.\n",
- __FUNCTION__, data->name, data->argsSize);
-
- /*
- * XXX: Trash/Recycle Folder support is not used by the host at this time
- * so we can ignore this RPC.
- */
-
- /*
- * We don't have any out parameters, so we write empty values into the
- * result fields of the RpcInData structure.
- */
- RPCIN_SETRETVALS(data, "", FALSE);
-
- /* Set our return value and return to the caller. */
- ret = TRUE;
-
- Debug("%s: Exit.\n", __FUNCTION__);
- return ret;
-}
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * GHISendTrashFolderStateRPC --
- *
- * Send the ghi.guest.trashFolder.state RPC to the host. This function is
- * used by the platform-specific GHI backends to notify the host when the
- * state of the Trash (aka Recycle Bin) folder changes. Currently, the only
- * information sent using this RPC is the empty/non-empty state of the
- * Trash folder.
- *
- * Results:
- * TRUE if RPC was sent successfully, FALSE otherwise.
- *
- * Side effects:
- * XXX.
- *
- *-----------------------------------------------------------------------------
- */
-
-Bool
-GHISendTrashFolderStateRPC(Bool empty) // IN: TRUE if the trash folder is empty.
-{
- Bool ret = FALSE;
- DynBuf outBuf;
-
- GHITrashFolderStateV1 *v1ptr = NULL;
- GHITrashFolderState msg;
- XDR xdrs;
-
- Debug("%s: Enter.\n", __FUNCTION__);
-
- memset(&msg, 0, sizeof msg);
- DynBuf_Init(&outBuf);
-
- /* Create the GHITrashFolderStateV1 structure to send. */
- v1ptr = (GHITrashFolderStateV1*) Util_SafeMalloc(sizeof *v1ptr);
- if (NULL == v1ptr) {
- Debug("%s: Failed to allocate trash folder state buffer.\n", __FUNCTION__);
- goto exit;
- }
-
- v1ptr->empty = empty;
-
- /* Create the GHITrashFolderState structure to send. */
- msg.ver = GHI_TRASH_FOLDER_STATE_V1;
- msg.GHITrashFolderState_u.trashFolderStateV1 = v1ptr;
- v1ptr = NULL; /* This will be freed by VMX_XDR_FREE(). */
-
- /* Create a new DynXdr structure for this message. */
- ASSERT_MEM_ALLOC(DynXdr_Create(&xdrs));
-
- /* Encode the structure into our DynXdr. */
- if (!xdr_GHITrashFolderState(&xdrs, &msg)) {
- Debug("%s: Failed to encode XDR data.\n", __FUNCTION__);
- goto exit;
- }
-
- /* Append our RPC name and a space to the DynBuf. */
- if (!DynBuf_Append(&outBuf,
- GHI_RPC_TRASH_FOLDER_STATE,
- strlen(GHI_RPC_TRASH_FOLDER_STATE))) {
- Debug("%s: Failed to append RPC name to DynBuf.\n", __FUNCTION__);
- goto exit;
- }
-
- if (!DynBuf_Append(&outBuf, " ", 1)) {
- Debug("%s: Failed to append space to DynBuf.\n", __FUNCTION__);
- goto exit;
- }
-
- /* Append the XDR serialized data to the DynBuf. */
- if (!DynBuf_Append(&outBuf, DynXdr_Get(&xdrs), xdr_getpos(&xdrs)) )
- {
- Debug("%s: Failed to append XDR serialized data to DynBuf.\n",
- __FUNCTION__);
- goto exit;
- }
-
- if (!RpcOut_SendOneRaw(DynBuf_Get(&outBuf),
- DynBuf_GetSize(&outBuf),
- NULL,
- NULL)) {
- Debug("%s: Failed to send RPC to host!\n", __FUNCTION__);
- goto exit;
- }
- ret = TRUE;
-
-exit:
- DynBuf_Destroy(&outBuf);
- DynXdr_Destroy(&xdrs, TRUE);
- VMX_XDR_FREE(xdr_GHITrashFolderState, &msg);
- Debug("%s: Exit.\n", __FUNCTION__);
- return ret;
-}
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * GHITcloTrashFolderGetIcon --
- *
- * Return the icon for the Trash folder (aka Recycle Bin) to the host.
- *
- * Results:
- * TRUE on success, FALSE on failure.
- *
- * Side effects:
- * XXX.
- *
- *-----------------------------------------------------------------------------
- */
-
-gboolean
-GHITcloTrashFolderGetIcon(RpcInData *data) // IN/OUT:
-{
- Bool ret = FALSE;
-
- Debug("%s: Enter.\n", __FUNCTION__);
-
- /* Check our arguments. */
- ASSERT(data);
- ASSERT(data->name);
-
- if (!(data && data->name)) {
- Debug("%s: Invalid arguments.\n", __FUNCTION__);
- goto exit;
- }
-
- Debug("%s: Got RPC, name: \"%s\", argument length: %"FMTSZ"u.\n",
- __FUNCTION__, data->name, data->argsSize);
-
-
- /*
- * XXX: Trash/Recycle Folder support is not used by the host at this time
- * so we can ignore this RPC.
- */
-
- /*
- * Write the result into the RPC out parameters.
- */
- RPCIN_SETRETVALS(data, "", FALSE);
-
- ret = TRUE;
-
-exit:
- Debug("%s: Exit.\n", __FUNCTION__);
- return ret;
-}
-
-
/*
*-----------------------------------------------------------------------------
*
void GHITcloInit();
void GHITcloCleanup();
- /*
- * RPC Entry points
- */
+ /* RPC Entry points */
gboolean GHITcloGetBinaryInfo(RpcInData *data);
gboolean GHITcloGetBinaryHandlers(RpcInData *data);
gboolean GHITcloGetStartMenuItem(RpcInData *data);
gboolean GHITcloCloseStartMenu(RpcInData *data);
gboolean GHITcloShellOpen(RpcInData *data);
gboolean GHITcloShellAction(RpcInData *data);
-
gboolean GHITcloSetGuestHandler(RpcInData *data);
gboolean GHITcloRestoreDefaultGuestHandler(RpcInData *data);
-
- /*
- * RPC Handlers
- */
-
- /* ghi.guest.outlook.set.tempFolder */
gboolean GHITcloSetOutlookTempFolder(RpcInData* data);
-
- /* ghi.guest.outlook.restore.tempFolder */
gboolean GHITcloRestoreOutlookTempFolder(RpcInData* data);
-
- /* ghi.guest.trashFolder.action */
- gboolean GHITcloTrashFolderAction(RpcInData *data);
-
- /* ghi.guest.trashFolder.getIcon */
- gboolean GHITcloTrashFolderGetIcon(RpcInData *data);
-
- /* ghi.guest.trayIcon.sendEvent */
gboolean GHITcloTrayIconSendEvent(RpcInData *data);
-
- /* ghi.guest.trayIcon.startUpdates */
gboolean GHITcloTrayIconStartUpdates(RpcInData *data);
-
- /* ghi.guest.trayIcon.stopUpdates */
gboolean GHITcloTrayIconStopUpdates(RpcInData *data);
-
- /* ghi.guest.setFocusedWindow */
gboolean GHITcloSetFocusedWindow(RpcInData *data);
-
- /* ghi.guest.getExecInfoHash */
gboolean GHITcloGetExecInfoHash(RpcInData *data);
- /*
- * Send a tray icon update to the host.
- */
- Bool GHISendTrayIconUpdateRpc(XDR *xdrs);
-
/* Callback functions to send data to the host */
+ Bool GHISendTrayIconUpdateRpc(XDR *xdrs);
Bool GHILaunchMenuChangeRPC(int numFolderKeys, const char **folderKeysChanged);
- Bool GHISendTrashFolderStateRPC(Bool empty);
};
-
+++ /dev/null
-/*********************************************************
- * Copyright (C) 2009 VMware, Inc. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation version 2.1 and no later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- *********************************************************/
-
-/*
- * ghiTrashFolder.x --
- *
- * Definition of the data structures used in the GuestRpc commands that
- * manipulate the Trash folder (aka Recycle Bin).
- */
-
-/*
- * Using the opaque type causes rpcgen to emit code that calls the htonl and
- * ntohl functions. On Windows, these functions are defined in winsock2.h, so
- * we need to #include that header in the generated code.
- */
-%#ifdef WIN32
-%#include "winsock2.h"
-%#endif /* WIN32 */
-
-enum GHITrashFolderActionVersion {
- GHI_TRASH_FOLDER_ACTION_V1 = 1
-};
-
-enum GHITrashFolderStateVersion {
- GHI_TRASH_FOLDER_STATE_V1 = 1
-};
-
-enum GHITrashFolderGetIconVersion {
- GHI_TRASH_FOLDER_GET_ICON_V1 = 1
-};
-
-/* The maximum length of the verb to apply to the trash folder. */
-const GHI_TRASH_FOLDER_ACTION_MAX_LEN = 64;
-
-/*
- * The maximum size of the trash folder icon, 48x48x4 bytes, plus
- * 1,024 bytes for the PNG metadata.
- */
-const GHI_TRASH_FOLDER_MAX_ICON_SIZE = 10240;
-
-struct GHITrashFolderActionV1 {
- string action<GHI_TRASH_FOLDER_ACTION_MAX_LEN>;
-};
-
-struct GHITrashFolderStateV1 {
- Bool empty;
-};
-
-struct GHITrashFolderGetIconV1 {
- int height;
- int width;
- opaque pngData<GHI_TRASH_FOLDER_MAX_ICON_SIZE>;
-};
-
-union GHITrashFolderAction switch (GHITrashFolderActionVersion ver) {
-case GHI_TRASH_FOLDER_ACTION_V1:
- struct GHITrashFolderActionV1 *trashFolderActionV1;
-};
-
-union GHITrashFolderState switch (GHITrashFolderStateVersion ver) {
-case GHI_TRASH_FOLDER_STATE_V1:
- struct GHITrashFolderStateV1 *trashFolderStateV1;
-};
-
-union GHITrashFolderGetIcon switch (GHITrashFolderGetIconVersion ver) {
-case GHI_TRASH_FOLDER_GET_ICON_V1:
- struct GHITrashFolderGetIconV1 *trashFolderGetIconV1;
-};
GHIHostCallbacks ghiHostCallbacks;
memset(&ghiHostCallbacks, 0, sizeof ghiHostCallbacks);
ghiHostCallbacks.launchMenuChange = &GHILaunchMenuChangeRPC;
- ghiHostCallbacks.sendTrashFolderState = &GHISendTrashFolderStateRPC;
+
#if defined(G_PLATFORM_WIN32)
GHI_Init(ctx->mainLoop, NULL, ghiHostCallbacks);
GHI_RegisterNotifyIconCallback(&gNotifyIconCallback);
rpcList.push_back(RpcChannelCallbackEntry(GHI_RPC_RESTORE_DEFAULT_GUEST_HANDLER, GHITcloRestoreDefaultGuestHandler));
rpcList.push_back(RpcChannelCallbackEntry(GHI_RPC_OUTLOOK_SET_TEMP_FOLDER, GHITcloSetOutlookTempFolder));
rpcList.push_back(RpcChannelCallbackEntry(GHI_RPC_OUTLOOK_RESTORE_TEMP_FOLDER, GHITcloRestoreOutlookTempFolder));
- rpcList.push_back(RpcChannelCallbackEntry(GHI_RPC_TRASH_FOLDER_ACTION, GHITcloTrashFolderAction));
- rpcList.push_back(RpcChannelCallbackEntry(GHI_RPC_TRASH_FOLDER_GET_ICON, GHITcloTrashFolderGetIcon));
rpcList.push_back(RpcChannelCallbackEntry(GHI_RPC_TRAY_ICON_SEND_EVENT, GHITcloTrayIconSendEvent));
rpcList.push_back(RpcChannelCallbackEntry(GHI_RPC_TRAY_ICON_START_UPDATES, GHITcloTrayIconStartUpdates));
rpcList.push_back(RpcChannelCallbackEntry(GHI_RPC_TRAY_ICON_STOP_UPDATES, GHITcloTrayIconStopUpdates));