summaryrefslogtreecommitdiff
path: root/girepository/gtypelib.h
Commit message (Collapse)AuthorAgeFilesLines
* [gtypelib.ch] Rename to gitypelib.chJohan Dahlin2010-05-311-1108/+0
| | | | | Rename gtypelib.h -> gitypelib-internal.h and rename gtypelib.c to gitypelib.c
* Support (out caller-allocates)Colin Walters2010-05-261-3/+3
| | | | | | | | | | | | | | | | | | | | | 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
* [girepository] Document most of the structsJohan Dahlin2010-05-181-10/+38
|
* [girepository] Update gtk-doc syntaxJohan Dahlin2010-05-181-1/+1
| | | | Update the gtk-doc syntax to remove a couple of warnings
* Add support for GArrays: add g_type_info_get_array_type() and properly scan ↵Tomeu Vizoso2010-05-041-1/+7
| | | | | | | | 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-7/+1
| | | | | | 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-1/+7
| | | | | | | | 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-1/+4
| | | | | | | | 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
* [typelib] Remove space/indent mismatchJohan Dahlin2010-03-251-5/+5
|
* [girepository] Remove trailing whitespaceJohan Dahlin2010-03-241-126/+126
|
* 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-1/+3
| | | | | | gir: embed <callback> inside <field> typelib: if a field contains a callback, store it just after the FieldBlob girepository API: no additions
* [gtypelib.h] Document SimpleTypeBlob moreColin Walters2009-11-041-0/+14
|
* [typelib] Clean up dlopen handlingColin Walters2009-08-191-0/+1
| | | | | | | | | | | | It's was busted that g_typelib_new_* does the dlopen() since that caused g-ir-compiler to load the modules even though it wasn't going to do anything with them. Instead, change things so that g_module_symbol does the dlopen on-demand. Remove the extra dlopen(NULL) inside girepository.c, we had another already in gtypelib.c. Thanks to Owen Taylor for suggesting this approach.
* Name unions to enable compilation on SolarisTobias Mueller2009-06-241-2/+2
| | | | | Patch by Brian Cameron <brian.cameron@sun.com>. Fixes bug 578199.
* Update doc comments.C. Scott Ananian2009-05-121-3/+1
| | | | | | The enumeration values cited here were out of date. Rewrite to eliminate the explicit mention of the enumeration value, to prevent it from drifting out of date again in the future.
* Bug 564016 - Include c:prefix in typelib, use it to optimize find_by_gtypeColin Walters2009-03-171-0/+1
| | | | | | | Parse the c:prefix from the .gir, include it in the header. Armed with this information, we can now optimize lookups of GTypes because we have the requirement that GTypes must start with the c:prefix. We do fall back though if a lookup fails.
* Bug 557383 - Virtual method supportColin Walters2009-03-051-3/+5
| | | | | | | | | | | | | | | | 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-15/+16
| | | | | | | | 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.
* Bug 572434 - Associate interfaces with their C structuresColin Walters2009-02-251-3/+6
| | | | | | | | 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.
* Bug 571373 - Add padding to typelib objectsColin Walters2009-02-181-3/+26
| | | | | | Expand various typelib objects to ensure we have at least 16 bits left for each one to add another string indirection or directory offset, and also that we have at least a few bits for more flags.
* Bug 571373 - Move typelib docs from typelib-format.txt into girepository.hColin Walters2009-02-181-57/+530
| | | | | | typelib-format.txt was growing out of date; a good solution to this is to move it closer to the code it's documenting. By doing this we also gain the ability to use gtk-doc on it.
* Bug 551738 - Associate classes with their structsColin Walters2009-02-061-2/+5
| | | | | | | | | | | | | | | | | | | | | 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-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Bug 559705 – Missing association between static methods and classesColin Walters2008-11-251-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | 2008-11-25 Colin Walters <walters@verbum.org> Bug 559705 – Missing association between static methods and classes * docs/typelib-format.txt: * girepository/ginfo.c (g_function_info_get_flags): * girepository/girmodule.c (g_ir_module_build_typelib): * girepository/girnode.c (g_ir_node_get_size), (g_ir_node_build_typelib): * girepository/girparser.c (start_function): * girepository/gtypelib.c (g_typelib_check_sanity), (validate_header), (validate_function_blob): * girepository/gtypelib.h: * giscanner/ast.py: * giscanner/girwriter.py: * giscanner/glibtransformer.py: * tests/scanner/foo-1.0-expected.gir: * tests/scanner/foo-1.0-expected.tgir: * tests/scanner/foo.h: svn path=/trunk/; revision=972
* Add "storage type" to the typelib data for enumsOwen Taylor2008-11-181-1/+2
| | | | | | | | | | | | | | | | | | | | | 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
* Bug 560825 – Add size and alignment to typelibOwen Taylor2008-11-161-2/+8
| | | | | | | | | | | | | | | | Include the size and alignment of structures and unions in the typelib, and add getter methods to retrieve them from GIStructInfo/GIUnionInfo. * docs/typelib-format.txt girepository/gtypelib.h girepository/girnode.c girepository/girmodule.c girepository/gtypelib.c: Add size and alignment to StructBlob and UnionBlob. * girepository/ginfo.c girepository/girepository.h: Add g_[struct|union]_get[size|alignment](). * test/offsets/gen-gitestoffsets: Test overall structure size and alignment. svn path=/trunk/; revision=930
* Bug 557786 - support fixed size arraysColin Walters2008-10-251-2/+6
| | | | 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-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-4/+5
| | | | svn path=/trunk/; revision=757
* Bug 556048 – Crash in g_irepository_find_by_gtypeTommi Komulainen2008-10-121-0/+7
| | | | | | | | * girepository/gtypelib.h (BLOB_IS_REGISTERED_TYPE): added * girepository/girepository.c (find_interface): Fix find_by_gtype case to get the type name from right offset svn path=/trunk/; revision=686
* make 'unregistered' one bit wide as everywhere elseTommi Komulainen2008-10-121-1/+2
| | | | | | | | | 2008-10-12 Tommi Komulainen <tommi.komulainen@iki.fi> * girepository/gtypelib.h (RegisteredTypeBlob): make 'unregistered' one bit wide as everywhere else svn path=/trunk/; revision=684
* Bug 552858: versioningColin Walters2008-10-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a big patch. You should probably remove your installation tree to be cleaner. * docs/typelib-format.txt: Add nsversion entry which holds version of namespace. * girepository/girepository.h: Add 'version' parameter to g_irepository_require. This may be NULL. Normally bindings should pass an explicit version though. * girepository/girepository.c: Lots of infrastructure to support versioning. Add some more documentation. Disallow some usage of NULL namespaces. * girepository/girmodule.c: Add version parameter. * girepository/gtypelib.c: Update header size. * giscanner/ast.py: Add version to Namespace. * giscanner/girparser.py: Parse version attribute from XML, pass to Namespace. * giscanner/girwriter.py: Write out version parameter. * giscanner/transformer.py: Clean up include registration. * tests/*: Add version attribute. * tests/invoke/invoke.c: Don't try looking up test before it's loaded in repository. * tools/generate.c: Output version parameter. * gir/Makefile.am: Add 2.0 version to .gir files. svn path=/trunk/; revision=677
* Bug 555294: Add support for multiple shared libraries per typelib.Lucas Rocha2008-10-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | 2008-10-06 Lucas Rocha <lucasr@gnome.org> Bug 555294: Add support for multiple shared libraries per typelib. * girepository/ginvoke.c (g_function_info_invoke), girepository/ginfo.c(g_registered_type_info_get_g_type): use g_typelib_symbol instead of g_module_symbol. * girepository/girepository.h: remove g_typelib_set_module and add g_typelib_symbol. * girepository/gtypelib.[ch] (find_some_symbol, _g_typelib_init, g_typelib_new_from_memory, g_typelib_new_from_const_memory, g_typelib_free, g_typelib_symbol): chnage GTypeLib to hold a list of modules instead of just one. The symbol lookup is now abstracted behind g_typelib_symbol which tries to find the passed symbol name in one of its modules. * giscanner/girwriter.py, tools/g-ir-scanner: change scanner to read and write shared_library attribute as a comma-separated list of libs. svn path=/trunk/; revision=660
* Put dependencies in typelibs, resolve them when loadingColin Walters2008-08-301-0/+2
| | | | | | | | | | | | | | | | | | | * gir/Makefile.am: Dep on Makefile * girepository/ginfo.c: Print out a nicer error message if we failed to load something. * girepository/girepository.c: Clean up default typelib handling; remove global default_typelib variable. Ensure we handle NULL repository in more places. Support dependency resolution. * tests/Makefile.am: Kill off gobject.gir, it conflicts with the real one. * tests/Object.gir: Depend on GObject. * tools/generate.c: Take --includedir argument to say which directories to search for typelibs. Print out dependencies. svn path=/trunk/; revision=541
* Change type of bitfield fields from guint to the most suitable smallerTor Lillqvist2008-08-281-87/+87
| | | | | | | | | | | | 2008-08-28 Tor Lillqvist <tml@novell.com> * girepository/gtypelib.h: Change type of bitfield fields from guint to the most suitable smaller type. This makes the struct sizes match the ones on Linux that the sanity check expects when using gcc -mms-bitfields on Windows. svn path=/trunk/; revision=508
* Remove usage of (GAPI-oriented) TypeTag in favor of GITypeTag fromColin Walters2008-08-121-36/+0
| | | | | | | | | | | | | 2008-08-12 Colin Walters <walters@verbum.org> * girepository/girparser.c, girepository/gtypelib.c, girepository/gtypelib.h, girepository/girnode.c: Remove usage of (GAPI-oriented) TypeTag in favor of GITypeTag from girepository.h. svn path=/trunk/; revision=347
* Rename metadata to typelib in variable names, comments and apis.Johan Dahlin2008-08-091-6/+6
| | | | | | | | | | | 2008-08-09 Johan Dahlin <johan@gnome.org> * *.[ch]: Rename metadata to typelib in variable names, comments and apis. svn path=/trunk/; revision=339
* Merge in the gir-compiler branch. Thanks to Philip and Colin for theirJohan Dahlin2008-08-081-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-08-08 Johan Dahlin <johan@gnome.org> * girepository/gtypelib.c (validate_header): * girepository/gtypelib.h: * giscanner/ast.py: * giscanner/girwriter.py: * giscanner/sourcescanner.c (gi_source_symbol_ref), (gi_source_symbol_unref): * tests/array.test: * tests/boxed.test: * tests/constant.test: * tests/enum.test: * tests/errors.test: * tests/function.test: * tests/gobject.test: * tests/interface.test: * tests/invoke/Makefile.am: * tests/invoke/testfns.xml: * tests/object.test: * tests/parser/Makefile.am: * tests/roundtrips.sh: * tests/struct.test: * tests/types.test: * tests/union.test: * tests/xref1.test: * tests/xref2.test: * tools/Makefile.am: * tools/compiler.c (main): * tools/generate.c (write_callable_info), (write_function_info), (write_repository): * tools/gidlmodule.c: * tools/gidlmodule.h: * tools/gidlnode.c: * tools/gidlnode.h: * tools/gidlparser.c: * tools/gidlparser.h: * tools/gidlwriter.c: * tools/gidlwriter.h: * tools/scanner.c (create_node_from_gtype), (create_node_from_ctype), (g_igenerator_process_properties), (g_igenerator_process_signals), (g_igenerator_create_object), (g_igenerator_create_interface), (g_igenerator_create_boxed), (g_igenerator_create_enum), (g_igenerator_create_flags), (g_igenerator_process_function_symbol), (g_igenerator_process_unregistered_struct_typedef), (g_igenerator_process_struct_typedef), (g_igenerator_process_union_typedef), (g_igenerator_process_enum_typedef), (g_igenerator_process_function_typedef), (g_igenerator_process_constant), (g_igenerator_process_symbols), (g_igenerator_add_module), (g_igenerator_add_include_idl): Merge in the gir-compiler branch. Thanks to Philip and Colin for their help. svn path=/trunk/; revision=325
* tools/gidlnode.cPhilip Van Hoof2008-06-081-0/+549
2008-06-08 Philip Van Hoof <pvanhoof@gnome.org> * girepository/girepository.c: * girepository/gtypelib.c: * girepository/ginfo.c: * girepository/ginvoke.c: * girepository/girepository.h: * girepository/gtypelib.h: * girepository/gmetadata.c: * girepository/Makefile.am: * girepository/gmetadata.h: * tools/compiler.c: * tools/gidlmodule.c: * tools/gidlnode.c * tools/generate.c: * tools/gidlmodule.h: * tools/gidlparser.c: Renamed GMetadata to GTypelib svn path=/trunk/; revision=288