gtk: Do not use glue anymore!

This commit is contained in:
Thibault Saunier 2017-10-04 10:39:38 -03:00
parent 12ec179f4a
commit 3fdb4f47f1
5 changed files with 14 additions and 20 deletions

View file

@ -23,8 +23,7 @@ namespace Gtk {
{
this.Key = key;
this.AccelMods = mods;
this._bitfield0 = 0;
this.AccelFlags = flags;
this.AccelFlags = (ushort)flags;
}
}
}

View file

@ -3,7 +3,8 @@
<attr path="/api/namespace/struct[@cname='GtkAccelKey']/field[@cname='accel_key']" name="type">GdkKey</attr>
<attr path="/api/namespace/struct[@cname='GtkAccelKey']/field[@cname='accel_key']" name="name">Key</attr>
<attr path="/api/namespace/struct[@cname='GtkAccelKey']/field[@cname='accel_mods']" name="type">GdkModifierType</attr>
<attr path="/api/namespace/struct[@cname='GtkAccelKey']/field[@cname='accel_flags']" name="type">GtkAccelFlags</attr>
<attr path="/api/namespace/struct[@cname='GtkAccelKey']/field[@cname='accel_flags']" name="type">guint16</attr>
<remove-attr path="/api/namespace/struct[@cname='GtkAccelKey']/field[@cname='accel_flags']" name="bits"/>
<attr path="/api/namespace/struct[@cname='GtkActionEntry']" name="hidden">1</attr>
<attr path="/api/namespace/struct[@cname='GtkRadioActionEntry']" name="hidden">1</attr>
<attr path="/api/namespace/struct[@cname='GtkToggleActionEntry']" name="hidden">1</attr>
@ -906,6 +907,10 @@
<attr path="/api/namespace/object[@cname='GtkWindow']/property[@cname='is-maximized']" name="name">Maximized</attr>
<attr path="/api/namespace/object[@cname='GtkWindow']/signal[@name='ActivateDefault']" name="name">DefaultActivated</attr>
<attr path="/api/namespace/object[@cname='GtkWindow']/signal[@name='ActivateFocus']" name="name">FocusActivated</attr>
<attr path="/api/namespace/object/class_struct[@cname='GtkRangeClass']/field[@name='Gchar']" name="name" max-matches="1">slider_detail</attr>
<attr path="/api/namespace/object/class_struct[@cname='GtkRangeClass']/field[@name='slider_detail']" name="type">gchar*</attr>
<attr path="/api/namespace/object/class_struct[@cname='GtkRangeClass']/field[@name='Gchar']" name="name">stepper_detail</attr>
<attr path="/api/namespace/object/class_struct[@cname='GtkRangeClass']/field[@name='stepper_detail']" name="type">gchar*</attr>
<attr path="/api/namespace/struct[@cname='GtkBindingArg']" name="hidden">1</attr>
<attr path="/api/namespace/struct[@cname='GtkBindingEntry']" name="hidden">1</attr>
<attr path="/api/namespace/struct[@cname='GtkBindingSet']" name="hidden">1</attr>

View file

@ -37,7 +37,7 @@ namespace Gtk {
public void AddAccelerator (string accel_signal, AccelGroup accel_group, AccelKey accel_key)
{
this.AddAccelerator (accel_signal, accel_group, (uint) accel_key.Key, accel_key.AccelMods, accel_key.AccelFlags);
this.AddAccelerator (accel_signal, accel_group, (uint) accel_key.Key, accel_key.AccelMods, (Gtk.AccelFlags) accel_key.AccelFlags);
}
/*
@ -110,9 +110,12 @@ namespace Gtk {
if (ActivateMarshalCallback == null)
ActivateMarshalCallback = new ClosureMarshal (ActivateMarshal_cb);
GtkWidgetClass klass = GetClassStruct (gtype, false);
klass.ActivateSignal = RegisterSignal ("activate_signal", gtype, GLib.Signal.Flags.RunLast, GLib.GType.None, new GLib.GType [0], ActivateMarshalCallback);
OverrideClassStruct (gtype, klass);
unsafe {
uint* raw_ptr = (uint*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("activate_signal"));
*raw_ptr = RegisterSignal ("activate_signal", gtype, GLib.Signal.Flags.RunLast, GLib.GType.None,
new GLib.GType [0], ActivateMarshalCallback);
}
}
[GLib.DefaultSignalHandler (Type=typeof (Gtk.Widget), ConnectionMethod="ConnectActivate")]

View file

@ -1074,12 +1074,10 @@ source_gen = custom_target(assembly_name + 'codegen',
'--extra-includes', cairo_api_includes,
'--extra-includes', gdk_api_includes,
'--extra-includes', atk_api_includes,
'--glue-file', gluefile,
'--glue-includes', glueincludes,
'--out', meson.current_build_dir(),
'--files', ';'.join(generated_sources),
'--assembly-name', assembly_name,
'--glue-libname', gluefile,
'--schema', schema,
],
depends: [gapi_codegen, gapi_fixup])

View file

@ -140,17 +140,6 @@ gtk_sharp = library(assembly_name, source_gen, sources, assemblyinfo,
install_dir: lib_install_dir
)
gluegen = custom_target('gtkgluegen',
input: raw_api_fname,
output: 'generate.c',
command: [generate_api, '--fakeglue'],
depends: [source_gen])
library('gtksharpglue-3', gluegen,
dependencies: [glib_dep, gio_dep, atk_dep, gdk_dep, gtk_dep],
c_args: ['-Wno-error=discarded-qualifiers'],
install: install)
nuget_infos += [['GtkSharp', gtk_sharp, ['GlibSharp', 'GioSharp',
'AtkSharp', 'GdkSharp']]]
install_infos += [assembly_name, gtk_sharp.full_path()]