From: VMware, Inc <> Date: Mon, 22 Aug 2011 20:21:04 +0000 (-0700) Subject: Move unity back-ends into subdirs. X-Git-Tag: 2011.08.21-471295~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c514f538dcb3cacde6f2cfe628435c7810feae0d;p=thirdparty%2Fopen-vm-tools.git Move unity back-ends into subdirs. Move the per-platform unity code into subdirs. This change has the makefile and source code changes required. Note that I had to rename lib/unity/x11/platform.cc to lib/unity/x11/x11platform.cc to work around a problem in the open-vm-tools build; platform.h was renamed for consistency. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/lib/include/unityCommon.h b/open-vm-tools/lib/include/unityCommon.h index 823475621..cddd353a9 100644 --- a/open-vm-tools/lib/include/unityCommon.h +++ b/open-vm-tools/lib/include/unityCommon.h @@ -188,8 +188,9 @@ #ifndef _UNITY_COMMON_H_ #define _UNITY_COMMON_H_ -#define UNITY_MAX_SETTOP_WINDOW_COUNT 100 +#include "vmware.h" +#define UNITY_MAX_SETTOP_WINDOW_COUNT 100 /* * Unity, GHI GuestRPC interface. diff --git a/open-vm-tools/services/plugins/unity/Makefile.am b/open-vm-tools/services/plugins/unity/Makefile.am index ec64feb13..ecdc54906 100644 --- a/open-vm-tools/services/plugins/unity/Makefile.am +++ b/open-vm-tools/services/plugins/unity/Makefile.am @@ -70,14 +70,16 @@ libunity_la_SOURCES += ghIntegration/platform.cc libunity_la_SOURCES += ghIntegration/pseudoAppMgr.cc libunity_la_SOURCES += unitylib/unity.c +libunity_la_SOURCES += unitylib/unityInt.h libunity_la_SOURCES += unitylib/unityPlatform.h -libunity_la_SOURCES += unitylib/unityPlatformX11.cc -libunity_la_SOURCES += unitylib/unityPlatformX11Settings.cc -libunity_la_SOURCES += unitylib/unityPlatformX11Window.cc -libunity_la_SOURCES += unitylib/unityX11.h +libunity_la_SOURCES += unitylib/debug.c +libunity_la_SOURCES += unitylib/event.cc +libunity_la_SOURCES += unitylib/settings.cc +libunity_la_SOURCES += unitylib/util.cc +libunity_la_SOURCES += unitylib/window.cc libunity_la_SOURCES += unitylib/windowPathFactory.cc -libunity_la_SOURCES += unitylib/x11Event.cc -libunity_la_SOURCES += unitylib/x11Util.cc +libunity_la_SOURCES += unitylib/x11Platform.cc +libunity_la_SOURCES += unitylib/x11Platform.h libunity_la_SOURCES += unityWindowTracker/unityWindowTracker.c diff --git a/open-vm-tools/services/plugins/unity/unityTclo.cpp b/open-vm-tools/services/plugins/unity/unityTclo.cpp index d72ad5d15..1a0a87458 100644 --- a/open-vm-tools/services/plugins/unity/unityTclo.cpp +++ b/open-vm-tools/services/plugins/unity/unityTclo.cpp @@ -47,6 +47,7 @@ extern "C" { #include "guestrpc/unityActive.h" #include "rpcin.h" #include "rpcout.h" + #include "str.h" #include "strutil.h" #if defined(OPEN_VM_TOOLS) #include "unitylib/unity.h" diff --git a/open-vm-tools/services/plugins/unity/unitylib/debug.c b/open-vm-tools/services/plugins/unity/unitylib/debug.c new file mode 100644 index 000000000..54f0fe4df --- /dev/null +++ b/open-vm-tools/services/plugins/unity/unitylib/debug.c @@ -0,0 +1,75 @@ +/********************************************************* + * Copyright (C) 2010 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. + * + *********************************************************/ + +/* + * debug.c -- + * + * Debugging functions for unity window manager intergration. + * + */ + +#include "vmware.h" +#include "debug.h" +#include "util.h" +#include "region.h" +#include "unityPlatform.h" +#include "unityWindowTracker.h" + +/* + *----------------------------------------------------------------------------- + * + * UnityDebug_Init -- + * + * One time initialization stuff. Create our Window GDI objects. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +UnityDebug_Init(UnityWindowTracker *tracker) // IN +{ +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityDebug_OnUpdate -- + * + * Called everytime we get an update request from the tools. Just + * invalidate the debug window to trigger a repaint. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +UnityDebug_OnUpdate(void) +{ +} diff --git a/open-vm-tools/services/plugins/unity/unitylib/x11Event.cc b/open-vm-tools/services/plugins/unity/unitylib/event.cc similarity index 98% rename from open-vm-tools/services/plugins/unity/unitylib/x11Event.cc rename to open-vm-tools/services/plugins/unity/unitylib/event.cc index f269b8c8c..de1f5f003 100644 --- a/open-vm-tools/services/plugins/unity/unitylib/x11Event.cc +++ b/open-vm-tools/services/plugins/unity/unitylib/event.cc @@ -17,19 +17,19 @@ *********************************************************/ /** - * @file x11Event.c + * @file event.cc * * Provides code relating the Glib main loop and Xlib/X11 event sources. */ extern "C" { -#include -#include -#include "vmware.h" + #include + #include + #include "vmware.h" } -#include "unityX11.h" +#include "x11Platform.h" /* diff --git a/open-vm-tools/services/plugins/unity/unitylib/unityPlatformX11Settings.cc b/open-vm-tools/services/plugins/unity/unitylib/settings.cc similarity index 99% rename from open-vm-tools/services/plugins/unity/unitylib/unityPlatformX11Settings.cc rename to open-vm-tools/services/plugins/unity/unitylib/settings.cc index 3cb68588b..b152b3b56 100644 --- a/open-vm-tools/services/plugins/unity/unitylib/unityPlatformX11Settings.cc +++ b/open-vm-tools/services/plugins/unity/unitylib/settings.cc @@ -17,16 +17,16 @@ *********************************************************/ /* - * unityPlatformX11Settings.c -- + * settings.cc -- * * Handles saving and restoring various system settings that are needed for Unity to * work well. */ -#include "unityX11.h" +#include "x11Platform.h" #if !defined(VM_HAVE_X11_SS_EXT) && !defined(USING_AUTOCONF) -#error "We're not building with the X11 ScreenSaver extension." + #error "We're not building with the X11 ScreenSaver extension." #endif diff --git a/open-vm-tools/services/plugins/unity/unitylib/unity.c b/open-vm-tools/services/plugins/unity/unitylib/unity.c index a3dcb2403..37042e80d 100644 --- a/open-vm-tools/services/plugins/unity/unitylib/unity.c +++ b/open-vm-tools/services/plugins/unity/unitylib/unity.c @@ -39,22 +39,14 @@ * @li UnityRpcGH */ +#include +#include #include "vmware.h" #include "debug.h" -#include "util.h" -#include "strutil.h" -#include "region.h" -#include "unityWindowTracker.h" -#include "unityCommon.h" -#include "unity.h" +#include "unityDebug.h" #include "unityInt.h" #include "unityPlatform.h" -#include "unityDebug.h" #include "vmware/tools/unityevents.h" -#include "vmware/tools/plugin.h" -#include "appUtil.h" -#include -#include /* * Singleton object for tracking the state of the service. @@ -64,9 +56,7 @@ UnityState unity; /* * Helper Functions */ - static void UnityUpdateCallbackFn(void *param, UnityUpdate *update); - static void UnitySetAddHiddenWindows(Bool enabled); static void UnitySetInterlockMinimizeOperation(Bool enabled); static void UnitySetSendWindowContents(Bool enabled); @@ -77,7 +67,6 @@ static void UnitySetDisableCompositing(Bool disabled); * Dispatch table for Unity window commands. All commands performing actions on * guest unity windows go here. */ - typedef struct { const char *name; Bool (*exec)(UnityPlatform *up, UnityWindowId window); @@ -133,7 +122,6 @@ static UnityFeatureSetter unityFeatureTable[] = { {0, NULL} }; - /* *---------------------------------------------------------------------------- * diff --git a/open-vm-tools/services/plugins/unity/unitylib/unity.h b/open-vm-tools/services/plugins/unity/unitylib/unity.h index 26c6f0585..8a48281ce 100644 --- a/open-vm-tools/services/plugins/unity/unitylib/unity.h +++ b/open-vm-tools/services/plugins/unity/unitylib/unity.h @@ -26,14 +26,10 @@ #define _UNITY_H_ #include -#include #include "dndGuest.h" -#include "dbllnklst.h" #include "dynbuf.h" -#include "str.h" #ifdef _WIN32 -#include "libExport.hh" -#include "unityCommon.h" + #include "libExport.hh" #endif #include "unityWindowTracker.h" @@ -42,7 +38,7 @@ * on host desktop. Right now we have 4 DnD detection window. 2 for DnD version 2 * or older, 2 for DnD version 3 or newer. */ -enum{ +enum { UNITY_BLOCKED_WND_DND_FULL_DET_V2 = 0, UNITY_BLOCKED_WND_DND_DET_V2 = 1, UNITY_BLOCKED_WND_DND_FULL_DET_V3 = 2, @@ -53,14 +49,12 @@ enum{ /* * Maximum number of virtual desktops supported. */ - #define MAX_VIRT_DESK 64 /* * Represents a virtual desktop coordinates in the virtual desktop grid. * The grid might look like {1,1} {1,2} {2,1} {2,2} or {1,1} {1,2} {1,2} etc. */ - typedef struct UnityVirtualDesktop { int32 x; int32 y; @@ -85,7 +79,6 @@ typedef struct { /* * Represents a virtual desktop configuration. */ - typedef struct UnityVirtualDesktopArray { size_t desktopCount; // number of desktops in the grid UnityVirtualDesktop desktops[MAX_VIRT_DESK]; // array of desktops @@ -99,14 +92,12 @@ typedef struct DesktopSwitchCallbackManager DesktopSwitchCallbackManager; * The Unity library requires these functions to be provided so that the host * is correctly updated as to changes of window state (essentially relaying the * Unity protocol to the host). + * + * Prepares, builds and sends a sequence of Unity Window Tracker updates back + * to the host. flags is passed back to the UnityWindowTracker_RequestUpdates() + * function to set what type of updates are + * required - see bora/lib/public/unityWindowTracker.h */ - - /* - * Prepares, builds and sends a sequence of Unity Window Tracker updates back - * to the host. flags is passed back to the UnityWindowTracker_RequestUpdates() - * function to set what type of updates are - * required - see bora/lib/public/unityWindowTracker.h - */ typedef Bool (*UnityHostChannelBuildUpdateCallback)(void *param, int flags); /* @@ -159,12 +150,12 @@ void Unity_Cleanup(void); void Unity_UnityToLocalPoint(UnityPoint *localPt, UnityPoint *unityPt); void Unity_LocalToUnityPoint(UnityPoint *unityPt, UnityPoint *localPt); void Unity_GetWindowCommandList(char ***commandList); - void Unity_SetActiveDnDDetWnd(UnityDnD *state); #ifdef _WIN32 LIB_EXPORT HWND Unity_GetHwndFromUnityId(UnityWindowId id); #endif + void Unity_SetUnityOptions(uint32 newFeaturesMask); /* @@ -239,5 +230,4 @@ void Unity_InitializeDebugger(void); #ifdef __cplusplus }; #endif // __cplusplus - #endif diff --git a/open-vm-tools/services/plugins/unity/unitylib/unityPlatform.h b/open-vm-tools/services/plugins/unity/unitylib/unityPlatform.h index 68b3e1472..5534dc469 100644 --- a/open-vm-tools/services/plugins/unity/unitylib/unityPlatform.h +++ b/open-vm-tools/services/plugins/unity/unitylib/unityPlatform.h @@ -22,16 +22,14 @@ * Implementation specific functionality */ -#ifndef _UNITY_PLATFORM_H_ -#define _UNITY_PLATFORM_H_ +#ifndef _UNITYPLATFORM_H_ +#define _UNITYPLATFORM_H_ #ifdef __cplusplus extern "C" { #endif // __cplusplus - #include "unityWindowTracker.h" #include "unity.h" - #ifdef __cplusplus }; #endif // __cplusplus @@ -138,4 +136,4 @@ void UnityPlatformSetDisableCompositing(UnityPlatform *up, Bool disabled); }; #endif // __cplusplus -#endif +#endif // _UNITYPLATFORM_H_ diff --git a/open-vm-tools/services/plugins/unity/unitylib/x11Util.cc b/open-vm-tools/services/plugins/unity/unitylib/util.cc similarity index 98% rename from open-vm-tools/services/plugins/unity/unitylib/x11Util.cc rename to open-vm-tools/services/plugins/unity/unitylib/util.cc index bf621b6a8..186055aaf 100644 --- a/open-vm-tools/services/plugins/unity/unitylib/x11Util.cc +++ b/open-vm-tools/services/plugins/unity/unitylib/util.cc @@ -17,12 +17,12 @@ *********************************************************/ /** - * @file x11Util.c + * @file util.cc * * This file just adds some random X utility functions. */ -#include "unityX11.h" +#include "x11Platform.h" /* diff --git a/open-vm-tools/services/plugins/unity/unitylib/unityPlatformX11Window.cc b/open-vm-tools/services/plugins/unity/unitylib/window.cc similarity index 99% rename from open-vm-tools/services/plugins/unity/unitylib/unityPlatformX11Window.cc rename to open-vm-tools/services/plugins/unity/unitylib/window.cc index 1d02e3b2e..66964b5c2 100644 --- a/open-vm-tools/services/plugins/unity/unitylib/unityPlatformX11Window.cc +++ b/open-vm-tools/services/plugins/unity/unitylib/window.cc @@ -17,13 +17,13 @@ *********************************************************/ /* - * unityPlatformX11Window.c -- + * window.cc -- * * Implementation of Unity for guest operating systems that use the X11 windowing * system. This file implements per-window operations (move, minimize, etc.) */ -#include "unityX11.h" +#include "x11Platform.h" extern "C" { #include "base64.h" #include "region.h" diff --git a/open-vm-tools/services/plugins/unity/unitylib/unityPlatformX11.cc b/open-vm-tools/services/plugins/unity/unitylib/x11Platform.cc similarity index 99% rename from open-vm-tools/services/plugins/unity/unitylib/unityPlatformX11.cc rename to open-vm-tools/services/plugins/unity/unitylib/x11Platform.cc index b2fd068fc..903199938 100644 --- a/open-vm-tools/services/plugins/unity/unitylib/unityPlatformX11.cc +++ b/open-vm-tools/services/plugins/unity/unitylib/x11Platform.cc @@ -17,15 +17,15 @@ *********************************************************/ /** - * @file unityPlatformX11.c + * @file x11Platform.cc * - * Implementation of Unity for guest operating systems that use the X11 windowing - * system. This file holds the basic things such as initialization/destruction of the - * UnityPlatform object, overall event handling, and handling of some Unity - * RPCs that are not window-centric. + * Implementation of Unity for guest operating systems that use the X11 window + * system. This file holds the basic things such as initialization/destruction + * of the UnityPlatform object, overall event handling, and handling of some + * Unity RPCs that are not window-centric. */ -#include "unityX11.h" +#include "x11Platform.h" extern "C" { #include "appUtil.h" diff --git a/open-vm-tools/services/plugins/unity/unitylib/unityX11.h b/open-vm-tools/services/plugins/unity/unitylib/x11Platform.h similarity index 99% rename from open-vm-tools/services/plugins/unity/unitylib/unityX11.h rename to open-vm-tools/services/plugins/unity/unitylib/x11Platform.h index fb5c76ed4..64b506c15 100644 --- a/open-vm-tools/services/plugins/unity/unitylib/unityX11.h +++ b/open-vm-tools/services/plugins/unity/unitylib/x11Platform.h @@ -17,13 +17,13 @@ *********************************************************/ /* - * unityX11.h -- + * x11Platform.h -- * * Internal state shared between the various modules that implement Unity for X11. */ -#ifndef _UNITY_X11_H_ -#define _UNITY_X11_H_ +#ifndef _X11PLATFORM_H_ +#define _X11PLATFORM_H_ /* * It's necessary to include glib, gtk+, and Xlib before the rest of the header files, @@ -493,4 +493,4 @@ void UnityX11EventTeardownSource(UnityPlatform *up); Bool UnityX11Util_IsWindowDecorationWidget(UnityPlatform *up, Window operand); -#endif +#endif // _X11PLATFORM_H_