From f0aeb69301f3776f481f4c57b3264748e4a73676 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sun, 25 Nov 2007 17:50:53 +0000 Subject: [PATCH] * Added the various C# projects to the Visual Studio solution and slightly fixed the bindings so that they now work with the Microsoft CLR. --- csharp/Caca.cs | 2 +- csharp/Cucul.cs | 8 ++--- msvc/caca-sharp.csproj | 53 +++++++++++++++++++++++++++++++ msvc/cucul-sharp.csproj | 45 ++++++++++++++++++++++++++ msvc/libcaca.sln | 70 +++++++++++++++++++++++++++++++++++++++++ msvc/test-csharp.csproj | 52 ++++++++++++++++++++++++++++++ 6 files changed, 225 insertions(+), 5 deletions(-) create mode 100755 msvc/caca-sharp.csproj create mode 100755 msvc/cucul-sharp.csproj create mode 100755 msvc/test-csharp.csproj diff --git a/csharp/Caca.cs b/csharp/Caca.cs index b467326..9e64c9f 100644 --- a/csharp/Caca.cs +++ b/csharp/Caca.cs @@ -193,7 +193,7 @@ namespace Caca } } - public unsafe class CacaDisplay : IDisposable + public class CacaDisplay : IDisposable { private IntPtr _cv; private IntPtr _dp; diff --git a/csharp/Cucul.cs b/csharp/Cucul.cs index 2f0be9b..b7dd311 100644 --- a/csharp/Cucul.cs +++ b/csharp/Cucul.cs @@ -56,7 +56,7 @@ namespace Cucul BLINK = 0x08; } - public unsafe class CuculCanvas : IDisposable + public class CuculCanvas : IDisposable { public readonly IntPtr _cv; @@ -403,7 +403,7 @@ namespace Cucul public int ditherBitmap(int x, int y, int w, int h, CuculDither d, object data) { - GCHandle gch = GCHandle.Alloc(data); + GCHandle gch = GCHandle.Alloc(data, GCHandleType.Pinned); int ret = cucul_dither_bitmap(_cv, x, y, w, h, d._dither, gch.AddrOfPinnedObject()); gch.Free(); @@ -411,7 +411,7 @@ namespace Cucul } } - public unsafe class CuculAttr + public class CuculAttr { private int _attr; @@ -445,7 +445,7 @@ namespace Cucul } } - public unsafe class CuculDither : IDisposable + public class CuculDither : IDisposable { public readonly IntPtr _dither; diff --git a/msvc/caca-sharp.csproj b/msvc/caca-sharp.csproj new file mode 100755 index 0000000..28a3795 --- /dev/null +++ b/msvc/caca-sharp.csproj @@ -0,0 +1,53 @@ + + + Debug + AnyCPU + 8.0.50727 + 2.0 + {046BD004-7B02-4521-BF01-9D9042F19AD5} + Library + Properties + caca_sharp + caca-sharp + + + true + full + false + Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + {C05C1521-F4E2-48D8-BD83-786EF345A887} + cucul-sharp + + + + + diff --git a/msvc/cucul-sharp.csproj b/msvc/cucul-sharp.csproj new file mode 100755 index 0000000..5b3ecdd --- /dev/null +++ b/msvc/cucul-sharp.csproj @@ -0,0 +1,45 @@ + + + Debug + AnyCPU + 8.0.50727 + 2.0 + {C05C1521-F4E2-48D8-BD83-786EF345A887} + Library + Properties + cucul_sharp.vsproj + cucul-sharp.vsproj + + + true + full + false + Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + Release\ + TRACE + prompt + 4 + + + + + + + + + + + diff --git a/msvc/libcaca.sln b/msvc/libcaca.sln index ddabaee..229aa93 100644 --- a/msvc/libcaca.sln +++ b/msvc/libcaca.sln @@ -19,28 +19,98 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cacademo", "cacademo.vcproj {8951ECB0-7CFE-41AB-A426-98D7C441BEA4} = {8951ECB0-7CFE-41AB-A426-98D7C441BEA4} EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cucul-sharp", "cucul-sharp.csproj", "{C05C1521-F4E2-48D8-BD83-786EF345A887}" + ProjectSection(ProjectDependencies) = postProject + {44303C1F-BB6A-4C4B-BB19-7D475348F151} = {44303C1F-BB6A-4C4B-BB19-7D475348F151} + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "caca-sharp", "caca-sharp.csproj", "{046BD004-7B02-4521-BF01-9D9042F19AD5}" + ProjectSection(ProjectDependencies) = postProject + {8951ECB0-7CFE-41AB-A426-98D7C441BEA4} = {8951ECB0-7CFE-41AB-A426-98D7C441BEA4} + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "test-csharp", "test-csharp.csproj", "{6EB34142-45E0-4BF3-8F75-81F4F604EAAA}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms Debug|Win32 = Debug|Win32 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F25D1237-9ED8-4343-B958-308C95FE392F}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {F25D1237-9ED8-4343-B958-308C95FE392F}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {F25D1237-9ED8-4343-B958-308C95FE392F}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {F25D1237-9ED8-4343-B958-308C95FE392F}.Debug|Win32.ActiveCfg = Debug|Win32 {F25D1237-9ED8-4343-B958-308C95FE392F}.Debug|Win32.Build.0 = Debug|Win32 + {F25D1237-9ED8-4343-B958-308C95FE392F}.Release|Any CPU.ActiveCfg = Release|Win32 + {F25D1237-9ED8-4343-B958-308C95FE392F}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {F25D1237-9ED8-4343-B958-308C95FE392F}.Release|Mixed Platforms.Build.0 = Release|Win32 {F25D1237-9ED8-4343-B958-308C95FE392F}.Release|Win32.ActiveCfg = Release|Win32 {F25D1237-9ED8-4343-B958-308C95FE392F}.Release|Win32.Build.0 = Release|Win32 + {44303C1F-BB6A-4C4B-BB19-7D475348F151}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {44303C1F-BB6A-4C4B-BB19-7D475348F151}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {44303C1F-BB6A-4C4B-BB19-7D475348F151}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {44303C1F-BB6A-4C4B-BB19-7D475348F151}.Debug|Win32.ActiveCfg = Debug|Win32 {44303C1F-BB6A-4C4B-BB19-7D475348F151}.Debug|Win32.Build.0 = Debug|Win32 + {44303C1F-BB6A-4C4B-BB19-7D475348F151}.Release|Any CPU.ActiveCfg = Release|Win32 + {44303C1F-BB6A-4C4B-BB19-7D475348F151}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {44303C1F-BB6A-4C4B-BB19-7D475348F151}.Release|Mixed Platforms.Build.0 = Release|Win32 {44303C1F-BB6A-4C4B-BB19-7D475348F151}.Release|Win32.ActiveCfg = Release|Win32 {44303C1F-BB6A-4C4B-BB19-7D475348F151}.Release|Win32.Build.0 = Release|Win32 + {8951ECB0-7CFE-41AB-A426-98D7C441BEA4}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {8951ECB0-7CFE-41AB-A426-98D7C441BEA4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {8951ECB0-7CFE-41AB-A426-98D7C441BEA4}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {8951ECB0-7CFE-41AB-A426-98D7C441BEA4}.Debug|Win32.ActiveCfg = Debug|Win32 {8951ECB0-7CFE-41AB-A426-98D7C441BEA4}.Debug|Win32.Build.0 = Debug|Win32 + {8951ECB0-7CFE-41AB-A426-98D7C441BEA4}.Release|Any CPU.ActiveCfg = Release|Win32 + {8951ECB0-7CFE-41AB-A426-98D7C441BEA4}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {8951ECB0-7CFE-41AB-A426-98D7C441BEA4}.Release|Mixed Platforms.Build.0 = Release|Win32 {8951ECB0-7CFE-41AB-A426-98D7C441BEA4}.Release|Win32.ActiveCfg = Release|Win32 {8951ECB0-7CFE-41AB-A426-98D7C441BEA4}.Release|Win32.Build.0 = Release|Win32 + {EE082122-5ECD-4DB4-93C7-145392074F8B}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {EE082122-5ECD-4DB4-93C7-145392074F8B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {EE082122-5ECD-4DB4-93C7-145392074F8B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {EE082122-5ECD-4DB4-93C7-145392074F8B}.Debug|Win32.ActiveCfg = Debug|Win32 {EE082122-5ECD-4DB4-93C7-145392074F8B}.Debug|Win32.Build.0 = Debug|Win32 + {EE082122-5ECD-4DB4-93C7-145392074F8B}.Release|Any CPU.ActiveCfg = Release|Win32 + {EE082122-5ECD-4DB4-93C7-145392074F8B}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {EE082122-5ECD-4DB4-93C7-145392074F8B}.Release|Mixed Platforms.Build.0 = Release|Win32 {EE082122-5ECD-4DB4-93C7-145392074F8B}.Release|Win32.ActiveCfg = Release|Win32 {EE082122-5ECD-4DB4-93C7-145392074F8B}.Release|Win32.Build.0 = Release|Win32 + {C05C1521-F4E2-48D8-BD83-786EF345A887}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C05C1521-F4E2-48D8-BD83-786EF345A887}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C05C1521-F4E2-48D8-BD83-786EF345A887}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {C05C1521-F4E2-48D8-BD83-786EF345A887}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {C05C1521-F4E2-48D8-BD83-786EF345A887}.Debug|Win32.ActiveCfg = Debug|Any CPU + {C05C1521-F4E2-48D8-BD83-786EF345A887}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C05C1521-F4E2-48D8-BD83-786EF345A887}.Release|Any CPU.Build.0 = Release|Any CPU + {C05C1521-F4E2-48D8-BD83-786EF345A887}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {C05C1521-F4E2-48D8-BD83-786EF345A887}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {C05C1521-F4E2-48D8-BD83-786EF345A887}.Release|Win32.ActiveCfg = Release|Any CPU + {046BD004-7B02-4521-BF01-9D9042F19AD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {046BD004-7B02-4521-BF01-9D9042F19AD5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {046BD004-7B02-4521-BF01-9D9042F19AD5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {046BD004-7B02-4521-BF01-9D9042F19AD5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {046BD004-7B02-4521-BF01-9D9042F19AD5}.Debug|Win32.ActiveCfg = Debug|Any CPU + {046BD004-7B02-4521-BF01-9D9042F19AD5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {046BD004-7B02-4521-BF01-9D9042F19AD5}.Release|Any CPU.Build.0 = Release|Any CPU + {046BD004-7B02-4521-BF01-9D9042F19AD5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {046BD004-7B02-4521-BF01-9D9042F19AD5}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {046BD004-7B02-4521-BF01-9D9042F19AD5}.Release|Win32.ActiveCfg = Release|Any CPU + {6EB34142-45E0-4BF3-8F75-81F4F604EAAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6EB34142-45E0-4BF3-8F75-81F4F604EAAA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6EB34142-45E0-4BF3-8F75-81F4F604EAAA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {6EB34142-45E0-4BF3-8F75-81F4F604EAAA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {6EB34142-45E0-4BF3-8F75-81F4F604EAAA}.Debug|Win32.ActiveCfg = Debug|Any CPU + {6EB34142-45E0-4BF3-8F75-81F4F604EAAA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6EB34142-45E0-4BF3-8F75-81F4F604EAAA}.Release|Any CPU.Build.0 = Release|Any CPU + {6EB34142-45E0-4BF3-8F75-81F4F604EAAA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {6EB34142-45E0-4BF3-8F75-81F4F604EAAA}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {6EB34142-45E0-4BF3-8F75-81F4F604EAAA}.Release|Win32.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/msvc/test-csharp.csproj b/msvc/test-csharp.csproj new file mode 100755 index 0000000..567354c --- /dev/null +++ b/msvc/test-csharp.csproj @@ -0,0 +1,52 @@ + + + + Debug + AnyCPU + 8.0.50727 + 2.0 + {6EB34142-45E0-4BF3-8F75-81F4F604EAAA} + Exe + Properties + test_csharp + test-csharp + + + true + full + false + Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + Release\ + TRACE + prompt + 4 + + + + + + + + + {046BD004-7B02-4521-BF01-9D9042F19AD5} + caca-sharp + + + {C05C1521-F4E2-48D8-BD83-786EF345A887} + cucul-sharp + + +