Had to change gapi2xml.pl to use the new properties method/macro in gtkwindow.c
- Issue, "invisible-chars" and "inner-border" is generated twice in gtkentry.c
Made patch to gwin32registrykey to use little endian by default. So Windows om ARM may fail.
This fixes an issue where unref would get called too often because the
ownership has changed when passing an instance to the native side.
See https://github.com/mono/gtk-sharp/pull/112 for more details.
Some types need special methods to convert an object to a GLib.Value.
The type system will look for a SetGValue method with a "ref GLib.Value"
parameter and invoke it.
A special case in the generation is needed because this is a non-static
method with the Handle being passed as the second parameter and the
GLib.Value as the first. Without this fix, the generator would generate
the Handle for the first parameter and then the GLib.Value.
Signed-off-by: Bertrand Lorentz <bertrand.lorentz@gmail.com>
If the parent already has a GType property, add a "new" keywords to hide
it.
This eliminates a lot of warnings when using classes derived from
Opaque. Closes issue #100.
Signed-off-by: Bertrand Lorentz <bertrand.lorentz@gmail.com>
A static getter method would always generate a Handle parameter even
though some types do not have a Handle, for example structs.
Closes issue #99.
Signed-off-by: Bertrand Lorentz <bertrand.lorentz@gmail.com>
Fixed length arrays are available in gobject introspection and are
already converted by the bindinator tool. The array_len attribute was
only used in structs.
This adds support for them as method parameters, generating the correct
code for them. Fixes issue #98.
Signed-off-by: Bertrand Lorentz <bertrand.lorentz@gmail.com>
When dealing with several namespaces there might be classes with the same name
(especially Global which is autogenerated in g-i based bindings). On generation
the file would be overriden by the last occurence in the xml. To encounter
this every namespace has it's own directory now. This also improves structure
a lot when dealing with big libraries.
Also do the necessary adaption for the build and the csproj files.
For method with optional parameters, when generating the overload
without the optional parameters, mark the overload as static if the
original method is static.
A similar situation to what is described in commit e48ac63d54 also
happens with signal callbacks: some signals are passed a native object
that is wrapped in an IDisposable managed object, which is then passed
as an argument to the signal handler. We need to dispose those objects
when the signal handler is done.
Those parameters will now be disposed in a finally {...} block, after
the signal handler has returned. This means that handlers should not
keep a reference to such a parameter, as it will be disposed right after
they return.
This change only affects the Cairo.Context parameter of the Widget.Drawn
signal, but it was badly needed, as shown by the Pixbuf demo in the
GtkDemo sample, which was leaking tens of MBs of memory.
Some virtual methods are passed a native object that is wrapped in an
IDisposable managed object, which is then passed on to the managed
overrides. We need to dispose those objects as soon as possible,
otherwise their native counterpart will not be freed until the next
garbage collection. Requiring the overrides to dispose them would be
cumbersome and error-prone.
Those parameters will now be disposed in a finally {...} block, after
the virtual method has returned. This means that overrides should not
keep a reference to such a parameter outside of the scope of the method,
as it will be diposed when the method returns.
This change only affects Cairo.Context parameter for now, but it was
particularly needed for them, as they could happily hold on to tens of
MBs of memory until the next garbage collection.
There are two elements repeated in this expression:
(( ((A) || (B)) || (B)) && C)
We can simplify "(A || B) || B" to simply "A || B",
so the result is a bit more readable this way:
(A || B) && C
There is no null check after these casts so if they fail they would
generate a NullReferenceException. By changing them to static casts
we would get a InvalidCastException which are much less misleading.
In the same way all GLib.Object-derived classes provided by the
generator have a GType static property (i.e. Gtk.Widget), we need
the same for the *Adapter classes, to access their GType without having
an instance of it. (The first use case would be GStreamerSharp's
Gst.Bin.IterateAllByInterface ().)
For this, we cannot simply add the property to all adapter classes
and be done, because it would clash with a property which is already
there, but is non-static, that has the same name and same value
(this property is needed for complying GInterfaceAdapter abstract
class), so we rename this property to GInterfaceGType because
using this name for the static one would not be consistent with the
rest of the classes generated which already provide the static one
with the name "GType".
This "Implementor" suffix was refactored recently (in commit
6cb03440c1) to be accessed via the ImplementorName property. So we
eliminate now the last occurrence of it in hardcoded form.
The parser will be going away at some point in the future, but we
will still need the fixup step. And the fixup step is really more
of a preliminary step for the generator anyway.
Made NativeStructGen more consistent with the way Gdk.Event
and Pango.Attribute are handled. Also increases performance
because reflection is not needed anymore to marshal these
kind of structs.