Skip to content

Commit

Permalink
Wrapped QtQuick (just the library, no QML support yet) and QtMultimedia.
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitar Dobrev <[email protected]>
  • Loading branch information
ddobrev committed Dec 11, 2015
1 parent 5750b55 commit d279d68
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
0.0.6 - 11.12.2015
Added:
- Bindings for QtQuick (just the library, no QtQuick/QML support yet) and QtMultimedia.

0.0.5 - 19.11.2015
Added:
- A binding for QtQml (just the library, no QtQuick/QML support yet).

0.0.4 - 18.11.2015
Added:
- A binding for QtNetwork.
Expand Down
4 changes: 3 additions & 1 deletion QtSharp.CLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ public static int Main(string[] args)
"Qt5ScriptTools",
"Qt5Sensors",
"Qt5SerialPort",
"Qt5Svg"
"Qt5Svg",
"Qt5Multimedia",
"Qt5Quick"
};
if (debug)
{
Expand Down
4 changes: 3 additions & 1 deletion QtSharp/GenerateSignalEventsPass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ public override bool VisitClassDecl(Class @class)
return false;
}
foreach (var method in from method in @class.Methods
where method.Access != AccessSpecifier.Private && method.AccessDecl != null
where method.Access != AccessSpecifier.Private && method.AccessDecl != null &&
// HACK: work around https://llvm.org/bugs/show_bug.cgi?id=24655
!method.IsConstructor && !method.IsDestructor && !method.IsOperator
select method)
{
this.HandleQSignal(@class, method);
Expand Down
35 changes: 35 additions & 0 deletions QtSharp/IQQmlParserStatus.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
namespace QtQml
{ /// <summary>
/// <para>The QQmlParserStatus class provides updates on the QML parser state.</para>
/// </summary>
/// <remarks>
/// <para>QQmlParserStatus provides a mechanism for classes instantiated by a QQmlEngine to receive notification at key points in their creation.</para>
/// <para>This class is often used for optimization purposes, as it allows you to defer an expensive operation until after all the properties have been set on an object. For example, QML's Text element uses the parser status to defer text layout until all of its properties have been set (we don't want to layout when the text is assigned, and then relayout when the font is assigned, and relayout again when the width is assigned, and so on).</para>
/// <para>Be aware that QQmlParserStatus methods are only called when a class is instantiated by a QQmlEngine. If you create the same class directly from C++, these methods will not be called automatically. To avoid this problem, it is recommended that you start deferring operations from classBegin instead of from the initial creation of your class. This will still prevent multiple revaluations during initial binding assignment in QML, but will not defer operations invoked from C++.</para>
/// <para>To use QQmlParserStatus, you must inherit both a QObject-derived class and QQmlParserStatus, and use the Q_INTERFACES() macro.</para>
/// <para>class MyObject : public QObject, public QQmlParserStatus</para>
/// <para>{</para>
/// <para> Q_OBJECT</para>
/// <para> Q_INTERFACES(QQmlParserStatus)</para>
/// <para></para>
/// <para>public:</para>
/// <para> MyObject(QObject *parent = 0);</para>
/// <para> ...</para>
/// <para> void classBegin();</para>
/// <para> void componentComplete();</para>
/// <para>}</para>
/// <para>The Qt Quick 1 version of this class is named QDeclarativeParserStatus.</para>
/// </remarks>
public unsafe partial interface IQQmlParserStatus
{
/// <summary>
/// <para>Invoked after class creation, but before any properties have been set.</para>
/// </summary>
void ClassBegin();

/// <summary>
/// <para>Invoked after the root component that caused this instantiation has completed construction. At this point all static values and binding values have been assigned to the class.</para>
/// </summary>
void ComponentComplete();
}
}
4 changes: 4 additions & 0 deletions QtSharp/QtSharp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ public void Setup(Driver driver)
// HACK: work around https://github.com/mono/CppSharp/issues/582
driver.Options.CodeFiles.Add(Path.Combine(dir, "IQAccessibleActionInterface.cs"));
break;
case "Qml":
// HACK: work around https://github.com/mono/CppSharp/issues/582
driver.Options.CodeFiles.Add(Path.Combine(dir, "IQQmlParserStatus.cs"));
break;
}
var extension = Path.GetExtension(this.library);
this.LibraryName = driver.Options.LibraryName + extension;
Expand Down
3 changes: 3 additions & 0 deletions QtSharp/QtSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
<None Include="IQAccessibleActionInterface.cs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="IQQmlParserStatus.cs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ProcessHelper.cs" />
<None Include="packages.config" />
Expand Down

0 comments on commit d279d68

Please sign in to comment.