Skip to content

Commit

Permalink
Merge pull request #1164 from gircore/support-class-construct-arguments
Browse files Browse the repository at this point in the history
Class: Add public constructor which support ConstructArguments
  • Loading branch information
badcel authored Jan 24, 2025
2 parents 0bcbea5 + aceb075 commit 323b3ae
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private static string RenderPublicConstructor(GirModel.Class cls)
var owned = Class.IsInitiallyUnowned(cls) ? "false" : "true";

return cls.Final
? $" public {cls.Name}() : this({Class.GetFullyQualifiedInternalHandleName(cls)}.Create({owned}, Array.Empty<GObject.ConstructArgument>())) {{ }}"
: $" public {cls.Name}() : this({Class.GetFullyQualifiedInternalHandleName(cls)}.For<{cls.Name}>({owned}, Array.Empty<GObject.ConstructArgument>())) {{ }}";
? $" public {cls.Name}(params GObject.ConstructArgument[] constructArguments) : this({Class.GetFullyQualifiedInternalHandleName(cls)}.Create({owned}, constructArguments)) {{ }}"
: $" public {cls.Name}(params GObject.ConstructArgument[] constructArguments) : this({Class.GetFullyQualifiedInternalHandleName(cls)}.For<{cls.Name}>({owned}, constructArguments)) {{ }}";
}
}

0 comments on commit 323b3ae

Please sign in to comment.