mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-05-22 10:22:08 +00:00
Merge pull request #81 from knocte/properties_class_init
glib: install properties before class_init finishes
This commit is contained in:
commit
a4c42994e8
|
@ -206,7 +206,6 @@ namespace GLib {
|
||||||
AddGInterfaces ();
|
AddGInterfaces ();
|
||||||
gtype.EnsureClass (); //calls class_init
|
gtype.EnsureClass (); //calls class_init
|
||||||
|
|
||||||
AddProperties ();
|
|
||||||
ConnectDefaultHandlers ();
|
ConnectDefaultHandlers ();
|
||||||
InvokeTypeInitializers ();
|
InvokeTypeInitializers ();
|
||||||
AddInterfaceProperties ();
|
AddInterfaceProperties ();
|
||||||
|
@ -242,6 +241,8 @@ namespace GLib {
|
||||||
foreach (GInterfaceAdapter adapter in adapters) {
|
foreach (GInterfaceAdapter adapter in adapters) {
|
||||||
InitializeProperties (adapter, gobject_class_handle);
|
InitializeProperties (adapter, gobject_class_handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AddProperties (gobject_class_handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeProperties (GInterfaceAdapter adapter, IntPtr gobject_class_handle)
|
private void InitializeProperties (GInterfaceAdapter adapter, IntPtr gobject_class_handle)
|
||||||
|
@ -288,12 +289,11 @@ namespace GLib {
|
||||||
HandlersOverriden = true;
|
HandlersOverriden = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddProperties ()
|
void AddProperties (IntPtr gobject_class_handle)
|
||||||
{
|
{
|
||||||
if (is_first_subclass) {
|
if (is_first_subclass) {
|
||||||
IntPtr declaring_class = gtype.GetClassPtr ();
|
|
||||||
ParamSpec pspec = new ParamSpec ("gtk-sharp-managed-instance", "", "", GType.Pointer, ParamFlags.Writable | ParamFlags.ConstructOnly);
|
ParamSpec pspec = new ParamSpec ("gtk-sharp-managed-instance", "", "", GType.Pointer, ParamFlags.Writable | ParamFlags.ConstructOnly);
|
||||||
g_object_class_install_property (declaring_class, idx, pspec.Handle);
|
g_object_class_install_property (gobject_class_handle, idx, pspec.Handle);
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue