Skip to content

Commit

Permalink
Removed all mappings to C# structures because their empty constructor…
Browse files Browse the repository at this point in the history
…s are not correctly wrapped yet.

Also had to update C++# because some of the default parameters which used structures exposed problems when they were changed to use classes.

Signed-off-by: Dimitar Dobrev <[email protected]>
  • Loading branch information
ddobrev committed Sep 17, 2016
1 parent 78e975d commit 8febd13
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 40 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.6.1 - 17.9.2016
Fixed:
- Removed all mappings to C# structures because their empty constructors are not correctly wrapped yet.

0.6.0 - 14.9.2016
BREAKING: The bindings are now named according to the pattern:
Qt<module>.Sharp
Expand Down
12 changes: 6 additions & 6 deletions QtSharp.CLI/QtSharp.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,27 +63,27 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="CppSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.dll</HintPath>
<HintPath>..\packages\CppSharp.0.7.2\lib\CppSharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.AST, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.AST.dll</HintPath>
<HintPath>..\packages\CppSharp.0.7.2\lib\CppSharp.AST.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.Generator, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.Generator.dll</HintPath>
<HintPath>..\packages\CppSharp.0.7.2\lib\CppSharp.Generator.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.Parser, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.Parser.dll</HintPath>
<HintPath>..\packages\CppSharp.0.7.2\lib\CppSharp.Parser.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.Parser.CLI, Version=0.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.Parser.CLI.dll</HintPath>
<HintPath>..\packages\CppSharp.0.7.2\lib\CppSharp.Parser.CLI.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.Runtime, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.Runtime.dll</HintPath>
<HintPath>..\packages\CppSharp.0.7.2\lib\CppSharp.Runtime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand Down
2 changes: 1 addition & 1 deletion QtSharp.CLI/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Baseclass.Contrib.Nuget.Output" version="2.1.0" targetFramework="net451" />
<package id="CppSharp" version="0.7.1" targetFramework="net451" developmentDependency="true" />
<package id="CppSharp" version="0.7.2" targetFramework="net451" developmentDependency="true" />
</packages>
27 changes: 13 additions & 14 deletions QtSharp/CompileInlinesPass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,26 @@ public CompileInlinesPass(string qmake, string make)

public override bool VisitLibrary(ASTContext context)
{
string error;
const string qtVersionVariable = "QT_VERSION";
var qtVersion = ProcessHelper.Run(this.qmake, string.Format("-query {0}", qtVersionVariable), out error);
var qtVersionFile = Path.Combine(this.Context.Options.OutputDir, qtVersionVariable);
var qtVersionFileInfo = new FileInfo(qtVersionFile);
var text = string.Empty;
if (!qtVersionFileInfo.Exists || (text = File.ReadAllText(qtVersionFile)) != qtVersion)
{
File.WriteAllText(qtVersionFile, qtVersion);
qtVersionFileInfo = new FileInfo(qtVersionFile);
}
var dir = Platform.IsMacOS ? this.Context.Options.OutputDir : Path.Combine(this.Context.Options.OutputDir, "release");
foreach (var module in this.Context.Options.Modules)
{
string error;
const string qtVersionVariable = "QT_VERSION";
var qtVersion = ProcessHelper.Run(this.qmake, string.Format("-query {0}", qtVersionVariable), out error);
var qtVersionFile = Path.Combine(this.Context.Options.OutputDir, qtVersionVariable);
var dir = Platform.IsMacOS ? this.Context.Options.OutputDir : Path.Combine(this.Context.Options.OutputDir, "release");
var inlines = Path.GetFileName(string.Format("{0}{1}.{2}", Platform.IsWindows ? string.Empty : "lib",
module.InlinesLibraryName, Platform.IsMacOS ? "dylib" : "dll"));
var libFile = Path.Combine(dir, inlines);
var qtVersionFileInfo = new FileInfo(qtVersionFile);
var inlinesFileInfo = new FileInfo(libFile);
string text = string.Empty;
if (!qtVersionFileInfo.Exists || (text = File.ReadAllText(qtVersionFile)) != qtVersion ||
!inlinesFileInfo.Exists || qtVersionFileInfo.CreationTimeUtc > inlinesFileInfo.CreationTimeUtc ||
qtVersionFileInfo.LastWriteTimeUtc > inlinesFileInfo.LastWriteTimeUtc)
if (!inlinesFileInfo.Exists || qtVersionFileInfo.LastWriteTimeUtc > inlinesFileInfo.LastWriteTimeUtc)
{
if (text != qtVersion)
{
File.WriteAllText(qtVersionFile, qtVersion);
}
if (!this.CompileInlines(module))
{
continue;
Expand Down
12 changes: 0 additions & 12 deletions QtSharp/QtSharp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,6 @@ public void Preprocess(Driver driver, ASTContext lib)
IgnorePrivateDeclarations(unit);
}
}
lib.SetClassAsValueType("QByteArray");
lib.SetClassAsValueType("QLocale");
lib.SetClassAsValueType("QModelIndex");
lib.SetClassAsValueType("QPoint");
lib.SetClassAsValueType("QPointF");
lib.SetClassAsValueType("QSize");
lib.SetClassAsValueType("QSizeF");
lib.SetClassAsValueType("QRect");
lib.SetClassAsValueType("QRectF");
lib.SetClassAsValueType("QGenericArgument");
lib.SetClassAsValueType("QGenericReturnArgument");
lib.SetClassAsValueType("QVariant");

// QString is type-mapped to string so we only need two methods for the conversion
var qString = lib.FindCompleteClass("QString");
Expand Down
12 changes: 6 additions & 6 deletions QtSharp/QtSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,27 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="CppSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.dll</HintPath>
<HintPath>..\packages\CppSharp.0.7.2\lib\CppSharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.AST, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.AST.dll</HintPath>
<HintPath>..\packages\CppSharp.0.7.2\lib\CppSharp.AST.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.Generator, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.Generator.dll</HintPath>
<HintPath>..\packages\CppSharp.0.7.2\lib\CppSharp.Generator.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.Parser, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.Parser.dll</HintPath>
<HintPath>..\packages\CppSharp.0.7.2\lib\CppSharp.Parser.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.Parser.CLI, Version=0.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.Parser.CLI.dll</HintPath>
<HintPath>..\packages\CppSharp.0.7.2\lib\CppSharp.Parser.CLI.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.Runtime, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.Runtime.dll</HintPath>
<HintPath>..\packages\CppSharp.0.7.2\lib\CppSharp.Runtime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="HtmlAgilityPack, Version=1.4.9.5, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
Expand Down
2 changes: 1 addition & 1 deletion QtSharp/packages.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Baseclass.Contrib.Nuget.Output" version="2.1.0" targetFramework="net451" />
<package id="CppSharp" version="0.7.1" targetFramework="net451" developmentDependency="true" />
<package id="CppSharp" version="0.7.2" targetFramework="net451" developmentDependency="true" />
<package id="HtmlAgilityPack" version="1.4.9.5" targetFramework="net451" />
<package id="zlib.net" version="1.0.4" targetFramework="net451" />
</packages>

0 comments on commit 8febd13

Please sign in to comment.