Commit Graph

13 Commits

Author SHA1 Message Date
Colin Walters
611929ec55 [giroffsets] Also update this code for change to signed enumeration values 2010-04-07 11:29:55 -04:00
Johan Dahlin
6b0463dd16 [girepository] Remove trailing whitespace 2010-03-24 15:02:05 -03:00
Colin Walters
3a8a1d2653 [g-ir-compiler] Slightly less lame error messages
To make things really better we should track the line origin of
element from the .gir file (and actually we need to do better
checking in the scanner), but this is slightly less lame.
2010-02-11 17:18:28 -05:00
Colin Walters
f2f0625622 [girffi] Clean up API, add g_function_info_prep_invoker
Rather than having bindings use g_function_info_invoke, which is basically
a toy/demo API, export a convenience utility function which takes the introspection
information and sets up things we need to pass to libffi.

Then invocation can be done directly to libffi by a binding.

As part of this work, remove some (unused by gjs) public functions from the
girffi API, and instead export a function to map to libffi which can work
semi-correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=604074
2009-12-16 18:17:12 -05:00
Tomeu Vizoso
03dc6a590b Implement callbacks as part of struct fields. Fixes #557383
gir: embed <callback> inside <field>
typelib: if a field contains a callback, store it just after the FieldBlob
girepository API: no additions
2009-11-11 13:55:00 +01:00
Johan Dahlin
fe8c6d34c4 Add gtk-doc support 2009-02-12 01:32:25 -02:00
Colin Walters
306ca05c5e Bug 569408, Bug 568680 - Scanner misses fields (at least in GObject.Object)
The scanner misses all fields of the GObject struct -- there
are no <field> children of the <class> element for GObject in the GIR. This of
course yields wrong field offsets for all derived objects.

svn path=/trunk/; revision=1079
2009-02-02 16:31:06 +00:00
Colin Walters
4e5037e0f3 Bug 563469 – Arrays not treated correctly in struct offset calculation
Arrays are currently not handled specially, and hence treated as pointers in
giroffsets.c:get_field_size_alignment(), which is (obviously) wrong.

svn path=/trunk/; revision=1078
2009-02-02 16:31:02 +00:00
Owen Taylor
05d5158001 Add "storage type" to the typelib data for enums
In order to set and get enum and flag fields in structures, we need
to know the integral type that the enumeration is stored as. We are already
computing that at compile time in order to compute struct offsets, so the
easiest thing to do is to save that in the typelib.

* docs/typelib-format.txt girepository/girnode.[ch] girepository/giroffsets.c
girepository/gtypelib.h: Add 'storage_type' to the typelib format for EnumBlob
and compute and save it at compile time.

* girepository/girepository.h girepository/ginfo.c:
Add g_enum_info_get_storage_type().

* girepository/gfield.c: Implement reading and writing enum and flags fields
based on the storage type.

http://bugzilla.gnome.org/show_bug.cgi?id=561296

svn path=/trunk/; revision=944
2008-11-18 12:29:10 +00:00
Owen Taylor
7c221ce28b Compute field offsets and overall size for object structures
2008-11-11  Owen Taylor  <otaylor@redhat.com>

        Compute field offsets and overall size for object structures

        Bug 560326 – Fails to build Gtk-2.0.typelib with "Unexpected non-pointer
        field of type object in structure"

        Do basic computation of field offsets for objects and interfaces;
        this doesn't attempt to address all of the "mess" for virtual
        functions described in Bug 560281.

svn path=/trunk/; revision=888
2008-11-11 21:10:12 +00:00
Owen Taylor
ac8db19d3f Include fully-qualified names in all error messages.
2008-11-11  Owen Taylor  <otaylor@redhat.com>

        * girepository/giroffsets.c: Include fully-qualified names in
        all error messages.

svn path=/trunk/; revision=884
2008-11-11 15:25:51 +00:00
Owen Taylor
9d4aa3bba3 Fail gracefully with an informative error message when recursion is
2008-11-11  Owen Taylor  <otaylor@redhat.com>

        * girepository/giroffsets.c: Fail gracefully with an informative
        error message when recursion is encountered when computing a
        structure size.

svn path=/trunk/; revision=882
2008-11-11 13:45:13 +00:00
Owen Taylor
31a7f413d6 Bug 560252 - Compute field offsets before writing typelib
girnode.h: Store the total size and alignment for
 GIrNodeStruct/Boxed/Union.

giroffset.c: New file implementing computation of structure
 field offsets.

girnode.c: Compute structure field offsets before writing types
 into the typelib.

docs/typelib-format.txt: Document that a field offset of 0xFFFF
means "unknown". Also fix description of the discriminator_offset
field for unions.

svn path=/trunk/; revision=876
2008-11-11 05:10:36 +00:00