]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Internal branch sync. Included in this change:
authorVMware, Inc <>
Tue, 24 Aug 2010 18:22:55 +0000 (11:22 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Tue, 24 Aug 2010 18:22:55 +0000 (11:22 -0700)
. ghi: use the base glib types for main loop and service objects rather than
  passing the ToolsAppCtx pointer around.

. changes in shared code that don't affect open-vm-tools functionality.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/include/loglevel_user.h
open-vm-tools/services/plugins/dndcp/stringxx/string.cc
open-vm-tools/services/plugins/dndcp/stringxx/string.hh
open-vm-tools/services/plugins/unity/ghIntegration/ghIntegration.c
open-vm-tools/services/plugins/unity/ghIntegration/ghIntegration.h
open-vm-tools/services/plugins/unity/ghIntegration/ghIntegrationInt.h
open-vm-tools/services/plugins/unity/ghIntegration/ghIntegrationX11.c
open-vm-tools/services/plugins/unity/unityPlugin.cpp
open-vm-tools/services/plugins/unity/unitylib/unity.c
open-vm-tools/services/plugins/unity/unitylib/unity.h
open-vm-tools/services/plugins/unity/unitylib/unityInt.h

index c4af9bc11e3c4bd4cca085836328eb26db770ab4..362feb7d37fbda8b38baa47ae95eb7b32fa57252 100644 (file)
    LOGLEVEL_VAR(syncWaitQ), \
    LOGLEVEL_VAR(sg), /* lib/sg */ \
    LOGLEVEL_VAR(wrapLib),  \
+   LOGLEVEL_VAR(bluetooth),  \
    LOGLEVEL_VAR(digestlib) \
 
 LOGLEVEL_EXTENSION_DECLARE(LOGLEVEL_USER);
index d218cf19adfcfd5553b56c16cb692452e05e7eff..db6bf9e71b4dbee4428305afb986a839323977a3 100644 (file)
@@ -1095,6 +1095,17 @@ string::append(const string &s, // IN
 }
 
 
+string&
+string::append(const char *s,   // IN
+               size_type n)     // IN
+{
+   InvalidateCache();
+   mUstr.append(s, n);
+
+   return *this;
+}
+
+
 /*
  *-----------------------------------------------------------------------------
  *
index 6e1f8c5528165538c815ba93b07b16110866f808..03146c70fd2466df142edf078be89df6b279607e 100644 (file)
@@ -149,6 +149,7 @@ public:
    // String-level member methods.
    string& append(const string &s);
    string& append(const string &s, size_type i, size_type n);
+   string& append(const char *s, size_type n);
    string& assign(const string &s);
    void push_back(value_type uc);
    void clear();
index 42a99dd111bc9ed3fd39f56263c7a400abcaedc9..844ce83fc745ea45aca7198062cdce0dd292beb6 100644 (file)
@@ -143,12 +143,13 @@ GHI_UnregisterCaps(void)
  */
 
 void
-GHI_Init(void *ctx)                         // IN
+GHI_Init(GMainLoop *mainLoop, // IN
+         const char **envp)   // IN
 {
    Debug("%s: Enter.\n", __FUNCTION__);
 
    // Call the platform-specific initialization function.
-   ghiPlatformData = GHIPlatformInit((ToolsAppCtx*) ctx);
+   ghiPlatformData = GHIPlatformInit(mainLoop, envp);
    if (!ghiPlatformData) {
       // TODO: We should report this failure to the caller.
       Debug("%s: GHIPlatformInit returned NULL pointer!\n", __FUNCTION__);
index 62e3472eea2c99f24a35ad72643f2cded4b0875b..19345fc754b0bd5de1cb87a35a65ba025841b58f 100644 (file)
 extern "C" {
 #endif
 
+#include <glib.h>
+
 #include "vmware.h"
 
 Bool GHI_IsSupported(void);
-void GHI_Init(void *ctx);
+void GHI_Init(GMainLoop *mainLoop, const char **envp);
 void GHI_Cleanup(void);
 void GHI_RegisterCaps(void);
 void GHI_UnregisterCaps(void);
index 17983b69ffdcb75141788c7190835ba7f9e80af7..bf3d9ab926f82e1ffcada592145c56e731601a22 100644 (file)
@@ -107,7 +107,7 @@ RpcInRet GHITcloGetExecInfoHash(RpcInData *data);
  */
 
 Bool GHIPlatformIsSupported(void);
-GHIPlatform *GHIPlatformInit(ToolsAppCtx *ctx);
+GHIPlatform *GHIPlatformInit(GMainLoop *mainLoop, const char **envp);
 void GHIPlatformCleanup(GHIPlatform *ghip);
 Bool GHIPlatformGetBinaryInfo(GHIPlatform *ghip,
                               const char *pathURIUtf8,
index 433a3d9d0360ffbbd7e624e1f5811866f1f4b937..75ed2e2347eb4d65bbea1706c2d7b61221611b82 100644 (file)
@@ -344,13 +344,14 @@ GHIPlatformIsSupported(void)
  */
 
 GHIPlatform *
-GHIPlatformInit(ToolsAppCtx *ctx)                          // IN
+GHIPlatformInit(GMainLoop *mainLoop,   // IN
+                const char **envp)     // IN
 {
    GHIPlatform *ghip;
 
    ghip = Util_SafeCalloc(1, sizeof *ghip);
    ghip->directoriesTracked = g_array_new(FALSE, FALSE, sizeof(GHIDirectoryWatch));
-   ghip->nativeEnviron = ctx->envp;
+   ghip->nativeEnviron = envp;
    ghip->appsByWindowExecutable =
       g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
    AppUtil_Init();
index 5dc48b2579598d2f54ba7f03e86a887a8a5a5ab2..9770209cd00716be90c623a8338e95bf389a1bef 100644 (file)
@@ -49,9 +49,13 @@ UnityPlugin::UnityPlugin(ToolsAppCtx *ctx)
 {
    ASSERT(ctx);
 
-   Unity_Init(NULL, NULL, ctx);
+   Unity_Init(NULL, NULL, ctx->serviceObj);
 
-   GHI_Init(ctx);
+#if defined(G_PLATFORM_WIN32)
+   GHI_Init(ctx->mainLoop, NULL);
+#else
+   GHI_Init(ctx->mainLoop, ctx->envp);
+#endif // G_PLATFORM_WIN32
 
    if (g_key_file_get_boolean(ctx->config, CONFGROUPNAME_UNITY,
                               CONFNAME_UNITY_ENABLEDEBUG, NULL)) {
index bd3efb802f2b45079112637c25edca1cdc92235e..a9c5525474f867d4dc16ff68cec2d40a52b4359b 100644 (file)
@@ -81,7 +81,7 @@ static void UnityUpdateCallbackFn(void *param, UnityUpdate *update);
 static void UnitySetAddHiddenWindows(Bool enabled);
 static void UnitySetInterlockMinimizeOperation(Bool enabled);
 static void UnitySetSendWindowContents(Bool enabled);
-static void FireEnterUnitySignal(ToolsAppCtx *ctx, gboolean entered);
+static void FireEnterUnitySignal(gpointer serviceObj, gboolean entered);
 static void UnitySetDisableCompositing(Bool disabled);
 
 /*
@@ -250,7 +250,7 @@ Unity_IsActive(void)
 void
 Unity_Init(GuestApp_Dict *conf,                                    // IN
            int *blockedWnd,                                        // IN
-           ToolsAppCtx *ctx)                                       // IN
+           gpointer serviceObj)                                    // IN
 {
    Debug("Unity_Init\n");
 
@@ -285,8 +285,12 @@ Unity_Init(GuestApp_Dict *conf,                                    // IN
 
    unity.virtDesktopArray.desktopCount = 0;
 
+   /*
+    * Cache the service object and use it to create the enter/exit Unity signal.
+    */
+   unity.serviceObj = serviceObj;
    g_signal_new(UNITY_SIG_ENTER_LEAVE_UNITY,
-                G_OBJECT_TYPE(ctx->serviceObj),
+                G_OBJECT_TYPE(serviceObj),
                 (GSignalFlags) 0,
                 0,
                 NULL,
@@ -315,7 +319,7 @@ Unity_Init(GuestApp_Dict *conf,                                    // IN
  */
 
 void
-Unity_Cleanup(ToolsAppCtx *ctx)    // IN
+Unity_Cleanup()
 {
    UnityPlatform *up;
 
@@ -325,7 +329,9 @@ Unity_Cleanup(ToolsAppCtx *ctx)    // IN
    /*
     * Exit Unity.
     */
-   Unity_Exit(ctx);
+   Unity_Exit();
+
+   unity.serviceObj = NULL;
 
    /*
     * Do one-time final platform-specific cleanup.
@@ -399,7 +405,7 @@ Unity_SetActiveDnDDetWnd(UnityDnD *state)
  */
 
 void
-Unity_Exit(ToolsAppCtx *ctx) // IN
+Unity_Exit()
 {
    int featureIndex = 0;
 
@@ -426,7 +432,7 @@ Unity_Exit(ToolsAppCtx *ctx) // IN
       UnityPlatformRestoreSystemSettings(unity.up);
 
       unity.isEnabled = FALSE;
-      FireEnterUnitySignal(ctx, FALSE);
+      FireEnterUnitySignal(unity.serviceObj, FALSE);
    }
 }
 
@@ -573,7 +579,7 @@ UnityTcloEnter(RpcInData *data)         //  IN/OUT
        *    catched for Unity DnD.
        */
       UnityPlatformUpdateDnDDetWnd(unity.up, TRUE);
-      FireEnterUnitySignal(data->appCtx, TRUE);
+      FireEnterUnitySignal(unity.serviceObj, TRUE);
       unity.isEnabled = TRUE;
    }
 
@@ -610,7 +616,7 @@ UnityTcloExit(RpcInData *data)   // IN/OUT
 
    Debug("UnityTcloExit.\n");
 
-   Unity_Exit(data->appCtx);
+   Unity_Exit();
 
    UnityUpdateState();
    return RPCIN_SETRETVALS(data, "", TRUE);
@@ -2948,11 +2954,11 @@ exit:
  */
 
 static void
-FireEnterUnitySignal(ToolsAppCtx *ctx,
+FireEnterUnitySignal(gpointer serviceObj,
                      gboolean enter)
 {
    Debug("%s: enter. enter argument is set to %s\n", __FUNCTION__, enter ? "true" : "false");
-   g_signal_emit_by_name(ctx->serviceObj,
+   g_signal_emit_by_name(serviceObj,
                          UNITY_SIG_ENTER_LEAVE_UNITY,
                          enter);
 }
index 5ff70d43689d76278ec21a46a1a951343bf7ceeb..3494ade5f63ba30ded7e308d84801011b07b7e32 100644 (file)
 #ifndef _UNITY_H_
 #define _UNITY_H_
 
+#include <glib.h>
 #include <string.h>
 #include "dndGuest.h"
 #include "dbllnklst.h"
 #include "guestApp.h"
 #include "dynbuf.h"
-#include "vmware/tools/plugin.h"
 #include "str.h"
 #ifdef _WIN32
 #include "libExport.hh"
@@ -89,12 +89,12 @@ extern "C" {
 
 void Unity_Init(GuestApp_Dict *conf,
                 int *blockedWnd,
-                ToolsAppCtx *ctx);
+                gpointer serviceObj);
 Bool Unity_IsActive(void);
 Bool Unity_IsSupported(void);
 void Unity_SetActiveDnDDetWnd(UnityDnD *state);
-void Unity_Exit(ToolsAppCtx *ctx);
-void Unity_Cleanup(ToolsAppCtx *ctx);
+void Unity_Exit(void);
+void Unity_Cleanup(void);
 void Unity_RegisterCaps(void);
 void Unity_UnregisterCaps(void);
 void Unity_UnityToLocalPoint(UnityPoint *localPt, UnityPoint *unityPt);
index 4e9e96fa16bfe05f13f145898342968efba69357..a4a25cee85d2fbf0b78907d8336be8725788c581 100644 (file)
@@ -50,6 +50,7 @@ typedef struct UnityState {
    UnityVirtualDesktopArray virtDesktopArray;   // Virtual desktop configuration
    UnityUpdateChannel updateChannel;            // Unity update transmission channel.
    UnityPlatform *up; // Platform-specific state
+   gpointer serviceObj; // 'Plugin' Host service object - used for signaling Unity state
 } UnityState;
 
 extern UnityState unity;