LOGLEVEL_VAR(syncWaitQ), \
LOGLEVEL_VAR(sg), /* lib/sg */ \
LOGLEVEL_VAR(wrapLib), \
+ LOGLEVEL_VAR(bluetooth), \
LOGLEVEL_VAR(digestlib) \
LOGLEVEL_EXTENSION_DECLARE(LOGLEVEL_USER);
}
+string&
+string::append(const char *s, // IN
+ size_type n) // IN
+{
+ InvalidateCache();
+ mUstr.append(s, n);
+
+ return *this;
+}
+
+
/*
*-----------------------------------------------------------------------------
*
// 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();
*/
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__);
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);
*/
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,
*/
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();
{
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)) {
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);
/*
void
Unity_Init(GuestApp_Dict *conf, // IN
int *blockedWnd, // IN
- ToolsAppCtx *ctx) // IN
+ gpointer serviceObj) // IN
{
Debug("Unity_Init\n");
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,
*/
void
-Unity_Cleanup(ToolsAppCtx *ctx) // IN
+Unity_Cleanup()
{
UnityPlatform *up;
/*
* Exit Unity.
*/
- Unity_Exit(ctx);
+ Unity_Exit();
+
+ unity.serviceObj = NULL;
/*
* Do one-time final platform-specific cleanup.
*/
void
-Unity_Exit(ToolsAppCtx *ctx) // IN
+Unity_Exit()
{
int featureIndex = 0;
UnityPlatformRestoreSystemSettings(unity.up);
unity.isEnabled = FALSE;
- FireEnterUnitySignal(ctx, FALSE);
+ FireEnterUnitySignal(unity.serviceObj, FALSE);
}
}
* catched for Unity DnD.
*/
UnityPlatformUpdateDnDDetWnd(unity.up, TRUE);
- FireEnterUnitySignal(data->appCtx, TRUE);
+ FireEnterUnitySignal(unity.serviceObj, TRUE);
unity.isEnabled = TRUE;
}
Debug("UnityTcloExit.\n");
- Unity_Exit(data->appCtx);
+ Unity_Exit();
UnityUpdateState();
return RPCIN_SETRETVALS(data, "", TRUE);
*/
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);
}
#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"
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);
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;