summaryrefslogtreecommitdiff
path: root/girepository/girnode.h
Commit message (Collapse)AuthorAgeFilesLines
* Support the (transfer) annotation for properties.Tomeu Vizoso2010-06-081-0/+2
| | | | | | | | | | | | * girepository/*: Add g_property_info_get_ownership_transfer() and write the transfer attribute of properties into the typelib. * giscanner/*: Parse the (transfer) annotation and write it into the .gir. * tools/generate.c: Read the transfer annotation for properties and write to the .tgir. https://bugzilla.gnome.org/show_bug.cgi?id=620484
* Support (out caller-allocates)Colin Walters2010-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | People have wanted support for marking (out) on functions of the form: /** * clutter_color_from_pixel: * @pixel: A pixel * @color: (out): Color to initialize with value of @pixel */ void clutter_color_from_pixel (guint32 pixel, ClutterColor *color); Where the caller is supposed to have allocated the argument; the C function just initializes it. This patch adds support for this argument passing style to introspection. In this case, we see the (out), and notice that there's only a single indirection (*) on the argument, and assume that this means (out caller-allocates). https://bugzilla.gnome.org/show_bug.cgi?id=604749
* Add support for GArrays: add g_type_info_get_array_type() and properly scan ↵Tomeu Vizoso2010-05-041-0/+1
| | | | | | | | GArray args Based on a previous patch by C. Scott Ananian <cscott@litl.com> https://bugzilla.gnome.org/show_bug.cgi?id=581687
* Revert "Add support for GArrays: add g_type_info_get_array_type() and ↵Tomeu Vizoso2010-05-031-1/+0
| | | | | | properly scan GArray args" This reverts commit 87291e08b0fd34b62e1ad9811c174108b38311a9.
* Add support for GArrays: add g_type_info_get_array_type() and properly scan ↵Tomeu Vizoso2010-04-301-0/+1
| | | | | | | | GArray args Based on a previous patch by C. Scott Ananian <cscott@litl.com> https://bugzilla.gnome.org/show_bug.cgi?id=581687
* Add support for foreign structsJohan Dahlin2010-03-251-0/+1
| | | | | | | | Foreign structs are special in the sense that there might be native bindings (for instance PyCairo for PyGI) that provides the same functionallity as the introspected variant. https://bugzilla.gnome.org/show_bug.cgi?id=610357
* [girepository] Remove trailing whitespaceJohan Dahlin2010-03-241-31/+31
|
* Enumerations can be negativeColin Walters2010-03-181-1/+1
| | | | | | | Change the internal type for ValueBlob to gint32, since it's perfectly valid for enumerations to have negative values. https://bugzilla.gnome.org/show_bug.cgi?id=613203
* Implement callbacks as part of struct fields. Fixes #557383Tomeu Vizoso2009-11-111-0/+1
| | | | | | gir: embed <callback> inside <field> typelib: if a field contains a callback, store it just after the FieldBlob girepository API: no additions
* Bug 557383 - Virtual method supportColin Walters2009-03-051-0/+2
| | | | | | | | | | | | | | | | Broadly speaking, this change adds the concept of <vfunc> to the .gir. The typelib already had most of the infrastructure for virtual functions, though there is one API addition. The scanner assumes that any class callback slot that doesn't match a signal name is a virtual. In the .gir, we write out *both* the <method> wrapper and a <vfunc>. If we can determine an association between them (based on the names matching, or a new Virtual: annotation), then we notate that in the .gir. The typelib gains an association from the vfunc to the function, if it exists. This will be useful for bindings since they already know how to consume FunctionInfo.
* Bug 571548 - Generic attributesColin Walters2009-03-031-0/+7
| | | | | | | | We now support an extensible mechanism where arbitrary key-value pairs may be associated with almost all items, including objects, methods, and properties. These attributes appear in both the .gir and the .typelib.
* Add a parent parmeter to g_ir_node_build_typelibColin Walters2009-02-271-0/+1
| | | | This will be useful for later changes which need to inspect the parent.
* Bug 572434 - Associate interfaces with their C structuresColin Walters2009-02-251-2/+2
| | | | | | | | Similar to GObject class structs, we pair up GInterfaces with their C structures. Also, move some GLib-specific things into glibast.py, and make the naming more generic.
* typelib building: Compress 5 arguments for g_ir_node_build_typelibColin Walters2009-02-201-8/+13
| | | | | This makes it easier to add more over time without changing lots of unrelated code.
* Bug 551738 - Associate classes with their structsColin Walters2009-02-061-0/+2
| | | | | | | | | | | | | | | | | | | | | Inside glibtransformer, we now look at structures ending in "Class" and see if they have an associated GlibObject (i.e. a structure of the same name without the "Class" suffix). If found, pair them up. The .gir file for <class> gains an attribute denoting its associated class struct. Any <record> many now have a glib:is-class-struct-for annotation which tells which (if any) <class> for which it defines the layout. In the .typelib, we record the association between the class and its structure. Generic structures however just have a boolean saying whether they're a class struct. (Going from a generic class struct to its class should not be necessary). Finally, we expose GIRepository APIs to access both bits of information from the .typelib. svn path=/trunk/; revision=1088
* Bug 556489 – callback annotationsAndreas Rottmann2009-01-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-01-03 Andreas Rottmann <a.rottmann@gmx.at> Bug 556489 – callback annotations * giscanner/transformer.py * tools/generate.c (write_callable_info): Write out the new scope, closure and destroy attributes. * giscanner/transformer.py (Transformer._type_is_callback): New method, checking if a given type is a callback. (Transformer._augment_callback_params): New method; adds information (closure, destroy) to callback parameters. (Transformer._handle_closure, Transformer._handle_destroy): New methods, auxiliary to _augment_callback_params. (Transformer._create_function): Call _augment_callback_params(). (Transformer._create_parameter): Handle scope option. (Transformer._create_typedef_callback): New method, creates a callback, and registers it in the typedef namespace (Transformer._create_typedef): Use _create_typedef_callback() instead of the plain _create_callback(). * giscanner/ast.py (Parameter): Added callback-related fields. * giscanner/girwriter.py: Write out new Parameter fields. * girepository/girnode.h (GIrNodeParam): Added fields scope, closure and destroy. * girepository/gtypelib.h (ArgBlob): Ditto. * girepository/girparser.c (start_parameter): Handle new fields. * girepository/girmodule.c (g_ir_module_build_typelib): Adjust arg_blob_size, bump major version due to this change. * girepository/girnode.c (g_ir_node_get_full_size_internal) (g_ir_node_build_typelib) * girepository/gtypelib.c (g_typelib_check_sanity): ArgBlob size adjustments. (g_ir_node_build_typelib): Fill in new ArgBlob flags from param. * girepository/girepository.h (GIScope): New enumeration, listing the different possible scopes for callbacks. * girepository/ginfo.c (g_arg_info_get_scope) (g_arg_info_get_closure, g_arg_info_get_destroy): Accessors for callback-related argument indices (callback scope, closure for a callback, destroy notification for a callback). * tests/scanner/: Added testcases for new features. svn path=/trunk/; revision=998
* Add "storage type" to the typelib data for enumsOwen Taylor2008-11-181-0/+1
| | | | | | | | | | | | | | | | | | | | | 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
* Compute field offsets and overall size for object structuresOwen Taylor2008-11-111-0/+3
| | | | | | | | | | | | | | | 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
* Bug 560252 - Compute field offsets before writing typelibOwen Taylor2008-11-111-0/+16
| | | | | | | | | | | | | | | | | 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
* Bug 560250 - Fully parse included modulesOwen Taylor2008-11-111-0/+8
| | | | | | | | | | | For some things, like computing structure offsets to put into the typelib we need more than just the aliases from included modules. Do a completel parse of included modules and store in module->included_modules. Also add g_ir_find_node() to find node information from within the active set of modules and their includes. svn path=/trunk/; revision=874
* Bug 560248 – "disguised structures"Owen Taylor2008-11-101-0/+1
| | | | | | | | | | | | | | Certain types like GIConv and GdkAtom are pointers internally but don't look like pointers when referenced. They have the form. typedef struct _X *X; Parse these as structures/records but mark them in the gir with a 'disguised' attribute so that we know that they need special handling. In the typelib treat them like any other structure. svn path=/trunk/; revision=872
* Bug 557786 - support fixed size arraysColin Walters2008-10-251-0/+2
| | | | svn path=/trunk/; revision=814
* Bug 557405 – Use 'allow-none' consistentlyTommi Komulainen2008-10-221-1/+1
| | | | | | | | | | | | | | | | | | 2008-10-22 Tommi Komulainen <tommi.komulainen@iki.fi> * docs/typelib-format.txt: * girepository/ginfo.c (g_arg_info_may_be_null): * girepository/girnode.c (g_ir_node_build_typelib): * girepository/girnode.h (struct _GIrNodeParam): * girepository/girparser.c (start_parameter): * girepository/girwriter.c (function_generate): * girepository/gtypelib.h (ArgBlob): * tests/errors.gir: * tests/function.gir: * tools/generate.c (write_callable_info): Use 'allow-none' consistently throughout svn path=/trunk/; revision=782
* Bug 557241 – "throws" flag for functionsJohan Bilien2008-10-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-10-21 Johan Bilien <jobi@via.ecp.fr> Bug 557241 – "throws" flag for functions * tests/scanner/drawable-1.0-expected.gir, tests/scanner/drawable-injected-1.0-expected.gir, tests/scanner/drawable.[ch]: add simple test for throwing function (has GError ** as last argument) * giscanner/ast.py: add a 'throws' flag to Function * giscanner/glibtransformer.py: if a function's last paramerter is a GError, set the 'throws' flag and remove that parameter * giscanner/girwriter.py: write out the 'throws' attribute * giscanner/girparser.py: support parsing the 'throws' attribute * tests/repository/gitestthrows.c: add a simple test to check the throws flag in a typelib and invoke the function * girepository/ginfo.c, girepository/girnode.[ch], girepository/girnode.h, girepository/girparser.c, girepository/girepository.h: Add and parse the GI_FUNCTION_THROWS flag * girepository/ginvoke.c: if a function throws, add a GError as last arguments, and propagate the error to the invoker. svn path=/trunk/; revision=773
* Bug 557011 - Add g_object_info_get_abstractColin Walters2008-10-201-0/+1
| | | | svn path=/trunk/; revision=757
* Merge branch 'bug552393-varargs'Colin Walters2008-10-021-0/+2
| | | | svn path=/trunk/; revision=643
* Allow both union and struct to be boxed or notColin Walters2008-09-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | * girepository/girnode.c: Allow gtype_name and gtype_init in struct and union. * girepository/girparser.c: Parse glib: boxed bits for both structure and union. * girepository/gtypelib.c: Don't barf if structure is boxed. * giscanner/girparser.py: Parse new XML format. * giscanner/girwriter.py: Write out new XML format. * giscanner/glibast.py: Define new classes which are both Boxed and Struct/Union, as well as an "Other" for everything else. * giscanner/glibtransformer.py: Handle boxed types specially; we try to merge them with a struct/union if one exists, otherwise fall back to generic boxed. * tests/*: Update. * tools/generate.c: Write out new format. svn path=/trunk/; revision=575
* Make enum serializing functions public. Clean up some whitespace.Johan Dahlin2008-08-181-0/+1
| | | | | | | | | | | | | | 2008-08-18 Johan Dahlin <johan@gnome.org> * girepository/girepository.c (g_type_tag_to_string): * girepository/girepository.h: * girepository/girnode.c (g_ir_node_get_full_size_internal), (find_entry_node): * girepository/girnode.h: Make enum serializing functions public. Clean up some whitespace. svn path=/trunk/; revision=394
* Rename metadata to typelib in variable names, comments and apis.Johan Dahlin2008-08-091-14/+14
| | | | | | | | | | | 2008-08-09 Johan Dahlin <johan@gnome.org> * *.[ch]: Rename metadata to typelib in variable names, comments and apis. svn path=/trunk/; revision=339
* Move shared *.[ch] files to girepository from toolsJohan Dahlin2008-08-091-0/+334
2008-08-09 Johan Dahlin <johan@gnome.org> * girepository/Makefile.am: * tools/Makefile.am: * tools/girmodule.c: * tools/girmodule.h: * tools/girnode.c: * tools/girnode.h: * tools/girparser.c: * tools/girparser.h: * tools/girwriter.c: * tools/girwriter.h: Move shared *.[ch] files to girepository from tools svn path=/trunk/; revision=337