[Spice-commits] 4 commits - client/windows

Arnon Gilboa agilboa at kemper.freedesktop.org
Sun Oct 24 23:39:18 PDT 2010


 client/windows/red_window.cpp |   19 ++-
 client/windows/redc.sln       |    6 +
 client/windows/redc.vcproj    |  236 ++++++++++++++++++++++++++++++++++++++++++
 client/windows/stdint.h       |    4 
 4 files changed, 258 insertions(+), 7 deletions(-)

New commits:
commit a0f32b620b333ae538500d21bc85650b3498a705
Author: Arnon Gilboa <agilboa at redhat.com>
Date:   Mon Oct 25 08:35:56 2010 +0200

    spicec-win: add x64 to vcproj & sln (v2)
    
    use CEGUI for x64 as well, no need for the SUPPORT_GUI hack

diff --git a/client/windows/redc.sln b/client/windows/redc.sln
index a948239..3ee7123 100644
--- a/client/windows/redc.sln
+++ b/client/windows/redc.sln
@@ -6,13 +6,19 @@ EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Win32 = Debug|Win32
+		Debug|x64 = Debug|x64
 		Release|Win32 = Release|Win32
+		Release|x64 = Release|x64
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 		{4F03BAF9-DFBC-4CA7-B860-8929555981AE}.Debug|Win32.ActiveCfg = Debug|Win32
 		{4F03BAF9-DFBC-4CA7-B860-8929555981AE}.Debug|Win32.Build.0 = Debug|Win32
+		{4F03BAF9-DFBC-4CA7-B860-8929555981AE}.Debug|x64.ActiveCfg = Debug|x64
+		{4F03BAF9-DFBC-4CA7-B860-8929555981AE}.Debug|x64.Build.0 = Debug|x64
 		{4F03BAF9-DFBC-4CA7-B860-8929555981AE}.Release|Win32.ActiveCfg = Release|Win32
 		{4F03BAF9-DFBC-4CA7-B860-8929555981AE}.Release|Win32.Build.0 = Release|Win32
+		{4F03BAF9-DFBC-4CA7-B860-8929555981AE}.Release|x64.ActiveCfg = Release|x64
+		{4F03BAF9-DFBC-4CA7-B860-8929555981AE}.Release|x64.Build.0 = Release|x64
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
diff --git a/client/windows/redc.vcproj b/client/windows/redc.vcproj
index 4276b90..15a77ac 100644
--- a/client/windows/redc.vcproj
+++ b/client/windows/redc.vcproj
@@ -12,6 +12,9 @@
 		<Platform
 			Name="Win32"
 		/>
+		<Platform
+			Name="x64"
+		/>
 	</Platforms>
 	<ToolFiles>
 	</ToolFiles>
@@ -103,6 +106,94 @@
 			/>
 		</Configuration>
 		<Configuration
+			Name="Debug|x64"
+			OutputDirectory="$(REDC_BUILD_DIR)\$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(REDC_BUILD_DIR)\$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+				CommandLine=""
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+				Description=""
+				CommandLine=""
+				AdditionalDependencies=""
+				Outputs=""
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;..;..\..\common;..\..\..\spice-protocol;..\..\common\win;&quot;..\..\common\win\my_getopt-1.5&quot;;&quot;$(SPICE_LIBS)\include&quot;;&quot;$(SPICE_LIBS)\include\pixman-1&quot;;&quot;$(SPICE_LIBS)\include\CEGUI-0.6.2&quot;"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;SW_CANVAS_CACHE;RED_DEBUG;SW_CANVAS_NO_CHUNKS;_WIN32_WINNT=0x0500;USE_GUI;USE_GLZ;PTW32_STATIC_LIB;CEGUI_STATIC"
+				MinimalRebuild="false"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="1"
+				PrecompiledHeaderThrough="common.h"
+				WarningLevel="3"
+				WarnAsError="false"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="pixman-1D.lib libeay32MTd.lib ssleay32MTd.lib ws2_32.lib msimg32.lib winmm.lib zlibwapiD.lib version.lib pthreadVC2D.lib libjpeg-static-mt-debug.lib libcelt_0_5_1D.lib CEGUIBase_Static_d.lib CEGUIExpatParser_Static_d.lib CEGUIFalagardWRBase_Static_d.lib CEGUITGAImageCodec_Static_d.lib freetype2312MT.lib libexpatMT.lib pcre.lib"
+				OutputFile="$(OutDir)\spicec.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;$(SPICE_LIBS)\lib64&quot;"
+				IgnoreAllDefaultLibraries="false"
+				IgnoreDefaultLibraryNames="MSVCRT.lib"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
 			Name="Release|Win32"
 			OutputDirectory="$(REDC_BUILD_DIR)$(ConfigurationName)"
 			IntermediateDirectory="$(REDC_BUILD_DIR)$(ConfigurationName)"
@@ -152,6 +243,7 @@
 				OutputFile="$(OutDir)\spicec.exe"
 				LinkIncremental="1"
 				AdditionalLibraryDirectories="&quot;$(SPICE_LIBS)\lib&quot;"
+				IgnoreDefaultLibraryNames=""
 				GenerateDebugInformation="true"
 				SubSystem="2"
 				OptimizeReferences="2"
@@ -182,6 +274,90 @@
 				Name="VCPostBuildEventTool"
 			/>
 		</Configuration>
+		<Configuration
+			Name="Release|x64"
+			OutputDirectory="$(REDC_BUILD_DIR)\$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(REDC_BUILD_DIR)\$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+				CommandLine=""
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories=".;..;..\..\..\spice-protocol;..\..\common;..\..\common\win;&quot;..\..\common\win\my_getopt-1.5&quot;;&quot;$(SPICE_LIBS)\include&quot;;&quot;$(SPICE_LIBS)\include\pixman-1&quot;;&quot;$(SPICE_LIBS)\include\CEGUI-0.6.2&quot;"
+				PreprocessorDefinitions="WIN32;_WINDOWS;SW_CANVAS_CACHE;SW_CANVAS_NO_CHUNKS;_WIN32_WINNT=0x0500;USE_GUI;USE_GLZ;PTW32_STATIC_LIB;CEGUI_STATIC"
+				RuntimeLibrary="0"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				WarnAsError="false"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="pixman-1.lib libeay32MT.lib ssleay32MT.lib ws2_32.lib msimg32.lib winmm.lib zlibwapi.lib version.lib pthreadVC2.lib libjpeg-static-mt.lib libcelt_0_5_1.lib CEGUIBase_Static.lib CEGUIExpatParser_Static.lib CEGUIFalagardWRBase_Static.lib CEGUITGAImageCodec_Static.lib freetype2312MT.lib libexpatMT.lib pcre.lib"
+				OutputFile="$(OutDir)\spicec.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;$(SPICE_LIBS)\lib64&quot;"
+				IgnoreAllDefaultLibraries="false"
+				IgnoreDefaultLibraryNames="MSVCRT.lib"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
 	</Configurations>
 	<References>
 	</References>
@@ -320,6 +496,15 @@
 					/>
 				</FileConfiguration>
 				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)\$(InputName)1.obj"
+						XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
 					Name="Release|Win32"
 					>
 					<Tool
@@ -328,6 +513,15 @@
 						XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
 					/>
 				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)\$(InputName)1.obj"
+						XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
+					/>
+				</FileConfiguration>
 			</File>
 			<File
 				RelativePath=".\named_pipe.cpp"
@@ -733,6 +927,17 @@
 				/>
 			</FileConfiguration>
 			<FileConfiguration
+				Name="Debug|x64"
+				>
+				<Tool
+					Name="VCCustomBuildTool"
+					Description="Generating demarshaller"
+					CommandLine="generate.bat&#x0D;&#x0A;"
+					AdditionalDependencies=""
+					Outputs="$(ProjectDir)/../generated_demarshallers.cpp;$(ProjectDir)/../generated_marshallers.cpp"
+				/>
+			</FileConfiguration>
+			<FileConfiguration
 				Name="Release|Win32"
 				>
 				<Tool
@@ -742,6 +947,16 @@
 					Outputs="$(ProjectDir)/../generated_demarshallers.cpp;$(ProjectDir)/../generated_marshallers.cpp"
 				/>
 			</FileConfiguration>
+			<FileConfiguration
+				Name="Release|x64"
+				>
+				<Tool
+					Name="VCCustomBuildTool"
+					Description="Generating demarshaller"
+					CommandLine="generate.bat&#x0D;&#x0A;"
+					Outputs="$(ProjectDir)/../generated_demarshallers.cpp;$(ProjectDir)/../generated_marshallers.cpp"
+				/>
+			</FileConfiguration>
 		</File>
 		<File
 			RelativePath="..\..\spice1.proto"
@@ -758,6 +973,17 @@
 				/>
 			</FileConfiguration>
 			<FileConfiguration
+				Name="Debug|x64"
+				>
+				<Tool
+					Name="VCCustomBuildTool"
+					Description="Generating old demarshaller"
+					CommandLine="generate1.bat&#x0D;&#x0A;"
+					AdditionalDependencies=""
+					Outputs="$(ProjectDir)/../generated_demarshallers1.cpp;$(ProjectDir)/../generated_marshallers1.cpp"
+				/>
+			</FileConfiguration>
+			<FileConfiguration
 				Name="Release|Win32"
 				>
 				<Tool
@@ -767,6 +993,16 @@
 					Outputs="$(ProjectDir)/../generated_demarshallers1.cpp;$(ProjectDir)/../generated_marshallers1.cpp"
 				/>
 			</FileConfiguration>
+			<FileConfiguration
+				Name="Release|x64"
+				>
+				<Tool
+					Name="VCCustomBuildTool"
+					Description="Generating old demarshaller"
+					CommandLine="generate1.bat&#x0D;&#x0A;"
+					Outputs="$(ProjectDir)/../generated_demarshallers1.cpp;$(ProjectDir)/../generated_marshallers1.cpp"
+				/>
+			</FileConfiguration>
 		</File>
 	</Files>
 	<Globals>
commit 79660586188ba968bb95f9ef198f56fa4d1ff972
Author: Arnon Gilboa <agilboa at redhat.com>
Date:   Mon Oct 25 08:35:34 2010 +0200

    spicec-win: map title string from utf8 to utf16
    
    Fix win client broken by the utf8 patch.

diff --git a/client/windows/red_window.cpp b/client/windows/red_window.cpp
index 8248aee..6d8a70d 100644
--- a/client/windows/red_window.cpp
+++ b/client/windows/red_window.cpp
@@ -448,7 +448,14 @@ RedWindow::~RedWindow()
 
 void RedWindow::set_title(std::string& title)
 {
-    SetWindowText(_win, title.c_str());
+    int len = MultiByteToWideChar(CP_UTF8, 0, title.c_str(), title.length(), NULL, 0) + 1;
+    WCHAR* wtitle = new WCHAR[len * sizeof(WCHAR)];
+
+    if (wtitle && MultiByteToWideChar(CP_UTF8, 0, title.c_str(), title.length(), wtitle, len)) {
+        wtitle[len - 1] = L'\0';
+        SetWindowText(_win, wtitle);
+    }
+    delete []wtitle;
 }
 
 void RedWindow::set_icon(Icon* icon)
commit 3d08b908b4c7d260d090094abcb8c287334a6b28
Author: Arnon Gilboa <agilboa at redhat.com>
Date:   Wed Oct 20 18:07:23 2010 +0200

    spicec-win: add #ifndef _WIN64 for u/intptr_t typedefs

diff --git a/client/windows/stdint.h b/client/windows/stdint.h
index 8b94f37..45b133e 100644
--- a/client/windows/stdint.h
+++ b/client/windows/stdint.h
@@ -136,11 +136,13 @@ typedef unsigned long long   uint_fast64_t;
 
 /* 7.18.1.4  Integer types capable of holding object pointers */
 
+#ifndef  _WIN64
+
 typedef int intptr_t;
 
 typedef unsigned uintptr_t;
 
-
+#endif
 
 /* 7.18.1.5  Greatest-width integer types */
 
commit 66d89ee04fe56ec22396448c90bc3ffa3194f978
Author: Arnon Gilboa <agilboa at redhat.com>
Date:   Wed Oct 20 18:05:28 2010 +0200

    spicec-win: Replace Set/GetWindowLong to LongPtr for x64 competability

diff --git a/client/windows/red_window.cpp b/client/windows/red_window.cpp
index 0413945..8248aee 100644
--- a/client/windows/red_window.cpp
+++ b/client/windows/red_window.cpp
@@ -137,7 +137,7 @@ static uint32_t utf16_to_utf32(uint16_t*& utf16, int& len)
 
 LRESULT CALLBACK RedWindow_p::WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
-    RedWindow* window = (RedWindow*)GetWindowLong(hWnd, GWL_USERDATA);
+    RedWindow* window = (RedWindow*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
     ASSERT(window);
 
     switch (message) {
@@ -359,8 +359,8 @@ void RedWindow_p::create(RedWindow& red_window, PixelsSource_p& pixels_source)
         _format = RedDrawable::RGB32;
         break;
     }
-    SetWindowLong(window, GWL_USERDATA, (LONG)&red_window);
-    SetWindowLong(window, GWL_WNDPROC, (LONG)WindowProc);
+    SetWindowLongPtr(window, GWLP_USERDATA, (LONG_PTR)&red_window);
+    SetWindowLongPtr(window, GWLP_WNDPROC, (LONG_PTR)WindowProc);
 }
 
 void RedWindow_p::destroy(PixelsSource_p& pixels_source)
@@ -370,8 +370,8 @@ void RedWindow_p::destroy(PixelsSource_p& pixels_source)
     }
 
     ReleaseDC(_win, pixels_source.dc);
-    SetWindowLong(_win, GWL_WNDPROC, (LONG)DefWindowProc);
-    SetWindowLong(_win, GWL_USERDATA, NULL);
+    SetWindowLongPtr(_win, GWLP_WNDPROC, (LONG_PTR)DefWindowProc);
+    SetWindowLongPtr(_win, GWLP_USERDATA, NULL);
     DestroyWindow(_win);
 }
 


More information about the Spice-commits mailing list