Skip to content

Commit

Permalink
Use the correct class name in ImplementClass.
Browse files Browse the repository at this point in the history
and add the needed import for ObjectG.

Fixes: #325
  • Loading branch information
MikeWey committed Mar 25, 2021
1 parent 12989bb commit a047f57
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion generated/gtkd/gtkd/Implement.d
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ template ImplementClassImpl(Klass, Impl)
string result;

result ~= "import glib.Str;\n"~
"import gobject.ObjectG;\n"~
"import gobject.Type : Type;\n"~
"import gobject.c.functions : g_type_class_peek_parent, g_object_get_data;\n";

Expand Down Expand Up @@ -174,7 +175,10 @@ template ImplementClassImpl(Klass, Impl)
!implements!Impl(toCamelCase!Impl() ~ names[i].capitalizeFirst) )
//TODO: __traits(isOverrideFunction, Foo.foo) ?
{
result ~= "\t"~ toCamelCase!GtkClass() ~"."~ names[i] ~" = &"~ toCamelCase!Impl() ~ names[i].capitalizeFirst ~";\n";
static if ( is(GtkClass == getClass!Klass) )
result ~= "\tparentClass."~ names[i] ~" = &"~ toCamelCase!Impl() ~ names[i].capitalizeFirst ~";\n";
else
result ~= "\t"~ toCamelCase!GtkClass() ~"."~ names[i] ~" = &"~ toCamelCase!Impl() ~ names[i].capitalizeFirst ~";\n";
}
}

Expand Down

0 comments on commit a047f57

Please sign in to comment.