Commit Graph

666 Commits

Author SHA1 Message Date
Johan Dahlin
ab9085eda3 [GIRepository] Rename g_irepository_enumerate
Rename it to g_irepository_enumerate_versions
2010-07-28 08:52:05 -03:00
Tomeu Vizoso
da698167a0 Add g_info_type_to_string (GIInfoType type) 2010-07-28 12:24:10 +02:00
Colin Walters
958b70d8b0 Add g_irepository_enumerate
This will be used for pygobject to enumerate namespaces.
2010-07-27 17:56:36 +02:00
Colin Walters
c0b26bf0a0 [girepository] Include path to file in typelib load failure error
This makes version conflicts more obvious.
2010-07-22 13:48:32 -04:00
Colin Walters
c8fb0f97a8 Fix two compilation warnings 2010-07-19 17:48:17 -04:00
Florian Müllner
5b5ab282a6 [girepository] Fix ordering in override_search_path
Entries in the GI_TYPELIB_PATH environment variable are added to the
global search path in reverse order - instead, add entries in the
same order in which they are specified.
2010-07-15 23:40:28 +02:00
Colin Walters
1b8bf7a4dc [girepository] Actually verify header of loaded typelibs in g_irepository_require
Take a GError * for typelib loading code, validate the header.  This
fixes bizarre errors from gjs where g_irepository_require would happily
load old typelibs.
2010-07-14 11:59:11 -04:00
Colin Walters
3a310fd242 Don't include machine-dependent integral types in the typelib
Previously we had both e.g. GI_TYPE_TAG_LONG and GI_TYPE_TAG_INT64,
but in fact the typelib is already machine-specific, so it makes sense
to just encode this as a fixed type.  The .gir remains abstract.

We also remove size_t from the typelib; one would never want to treat
it differently than an integer.

time_t is removed as well; while bindings like gjs had special handling
to turn it into e.g. a JS Date object, I don't think we should encourage
people to use these POSIX types in their API.  Use GTimeVal or the like
instead.

Because the typelib is now really machine-specific, we need to remove
the -expected.tgirs from git.  (We could potentially add a check
which wasn't just a literal diff later)

https://bugzilla.gnome.org/show_bug.cgi?id=623774
2010-07-09 14:15:52 -04:00
Colin Walters
cf2b0074ad Bump shared library version, typelib version
https://bugzilla.gnome.org/show_bug.cgi?id=623774
2010-07-09 14:15:52 -04:00
Johan Dahlin
4994c3d4b8 Remove trailing whitespace 2010-07-09 10:20:57 -03:00
Johan Dahlin
b6d50e2951 Add support for non-GObject fundamental objects
This patch adds support for instantiable fundamental object types,
which are not GObject based. This is mostly interesting for being
able to support GstMiniObject's which are extensivly used in GStreamer.
Includes a big test case to the Everything module (inspired by
GstMiniObject) which should be used by language bindings who wishes to
test this functionallity.

This patch increases the size of the typelib and breaks compatibility
with older typelibs.

https://bugzilla.gnome.org/show_bug.cgi?id=568913
2010-07-09 10:15:45 -03:00
Colin Walters
68b4fb43bb Move doc to toplevel element, write <any> for unknown containers
Moving to <doc> allows us to better preserve whitespace.  XML has no
facility for whitespace-preserving attributes.

Second, for arrays and lists, both types with unknown element_type can
occur in the current scanner; it's least wrong if we write out an
<any> type.
2010-07-08 14:42:54 -04:00
David Zeuthen
3d0dc7d214 Allow attributes on parameters and return values
Any annotation where the key has a dot in the name will go into the
attribute list. For example

  * @arg: (foo.bar baz): some arg

the parameter @arg will get the attribute with key foo.bar and value
baz. This also works for.

  * Returns: (foo.bar2 baz2): the return value

Also add tests for this new feature.

See https://bugzilla.gnome.org/show_bug.cgi?id=571548

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-06-24 11:53:18 -04:00
David Zeuthen
c57c9efe6f Attribute bug-fixes
Rectify an assumption that nodes are ordered according to offset
- since this assumption was not true, attributes ended up being not
ordered either and the bsearch() when looking up attributes failed
mysteriously. Instead of making such assumptions, simply sort the
list of nodes we want to extract attributes from.

The total attribute size computation was wrong as we didn't properly
descend into subnodes. This resulted in memory access violations
when writing the typelib (because not enough data was allocated).
Instead of having a separate function for this, just include the
attribute size in the existing function.

See https://bugzilla.gnome.org/show_bug.cgi?id=571548

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-06-24 11:53:18 -04:00
Colin Walters
e169006ed6 [girparser] Remove backtrace()
It's not useful; we never got good info from it, and modern operating
systems ship with crash catching systems.
2010-06-22 18:03:36 -04:00
Johan Dahlin
9a9825b0f9 [giregisteredinfo] A Boxed is also a registered type 2010-06-22 10:17:02 -03:00
Colin Walters
2f11782f51 Support introspectable=no attribute, add warnings framework
This work allows us to move closer to replacing gtk-doc, among other
things.  We add a generic attribute "introspectable", and inside the
typelib compiler if we see "introspectable=no", we don't put it in the
typelib.  This replaces the hackish pre-filter for varargs with a much
more generic mechanism.

The varargs is now handled in the scanner, and we emit
introspectable=no for them.

Add generic metadata to Node with references to file/line/column,
which currently comes from symbols.

Add scanner options --warn-all and --warn-error.

https://bugzilla.gnome.org/show_bug.cgi?id=621570
2010-06-17 13:05:59 -04:00
Colin Walters
911d98bb9d More explicitly document how we'll use the version= attribute on repository
I want to start bumping it on incompatible .gir changes.

https://bugzilla.gnome.org/show_bug.cgi?id=621895
2010-06-17 10:49:41 -04:00
Johan Dahlin
c3790c1af7 Revert "Support introspectable=no attribute, add warnings framework"
This reverts commit 074192b89c6afcdd7f062f03989972e44334b8bf.
2010-06-17 09:14:04 -03:00
Colin Walters
97c497bfea Support introspectable=no attribute, add warnings framework
This work allows us to move closer to replacing gtk-doc, among other
things.  We add a generic attribute "introspectable", and inside the
typelib compiler if we see "introspectable=no", we don't put it in the
typelib.  This replaces the hackish pre-filter for varargs with a much
more generic mechanism.

The varargs is now handled in the scanner, and we emit
introspectable=no for them.

Add generic metadata to Node with references to file/line/column,
which currently comes from symbols.

Add scanner options --Wall and --Werror.
2010-06-16 21:58:18 -04:00
Johan Dahlin
1223ef3560 [girparser] Annotate return transfer for public API 2010-06-12 11:31:06 -03:00
Johan Dahlin
adcb85871b [girwriter] Use GSlice 2010-06-12 11:23:21 -03:00
Johan Dahlin
9313f23ed5 [GIVInterfaceInfo] Document and check args 2010-06-12 11:14:36 -03:00
Johan Dahlin
401baff470 [GIObjectInfo] Fix a typo and document a func 2010-06-12 11:14:22 -03:00
Johan Dahlin
a9a1fdabd8 [gir_writer_write] Document properly 2010-06-11 21:06:31 -03:00
Johan Dahlin
2e570b7704 [g_property_info_get_flags] Document properly 2010-06-11 21:06:02 -03:00
Johan Dahlin
bd0c9a4170 [gitypelib-internal.h] Add missing <public> 2010-06-11 21:05:42 -03:00
Johan Dahlin
55c7dc37ac [GIObjectInfo] Document and check types 2010-06-11 20:51:32 -03:00
Johan Dahlin
d89eb01974 [GICallableInfo] Fix a typo in the doc 2010-06-11 20:16:29 -03:00
Johan Dahlin
1eca3abe67 [docs] Add struct hierarchy to each section 2010-06-11 20:16:00 -03:00
Johan Dahlin
5a0016133a [GIVFuncInfo] Document and check args 2010-06-11 11:11:46 -03:00
Johan Dahlin
4af59a4c04 [GIPropertyInfo] Document and check args 2010-06-11 11:10:52 -03:00
Tomeu Vizoso
d9bbf572b0 Allow for methods in GLib
* girepository/gitypelib.c: Don't complain about constructors
  returning types other than objects or interfaces if the container
  type isn't an object or interface itself.

* giscanner/glibtransformer.py: Don't give up parsing a method just
  because it's in the GLib namespace.

https://bugzilla.gnome.org/show_bug.cgi?id=621069
2010-06-09 08:38:04 -03:00
Tomeu Vizoso
ba97c98827 Use a default value for transfer-ownership in properties. 2010-06-08 19:20:06 +02:00
Tomeu Vizoso
518765acf3 Support the (transfer) annotation for properties.
* 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
2010-06-08 17:35:12 +02:00
Johan Dahlin
b2575e8210 Philip, you didn't write all of this 2010-06-08 11:28:02 -03:00
Johan Dahlin
825c230941 [gisignalinfo] Document and check parameters 2010-06-07 17:20:02 -03:00
Johan Dahlin
27511f220b [girwriter] Refactor out of generate.c
Move out the girwriter out of generate.c. Still a private API,
but that will probably change in the future.
2010-06-07 10:52:43 -03:00
Johan Dahlin
06d778dc3c [Makefile.am] Reindent 2010-06-07 10:29:53 -03:00
Johan Dahlin
6b4647c088 [girepository] Kill girffi-private.h 2010-06-06 23:22:57 -03:00
Johan Dahlin
1edafae79e [girepository] Don't include girffi.h everywhere 2010-06-06 23:17:46 -03:00
Johan Dahlin
91c621b9db [giregisteredtypeinfo] Document and check parameters 2010-06-06 23:04:15 -03:00
Johan Dahlin
a23a697664 [gitypes] Remove a comment and move G_END_DECLS 2010-06-06 22:57:28 -03:00
Johan Dahlin
c47ecdee41 [build] Install gistructinfo.h 2010-06-06 22:57:14 -03:00
Johan Dahlin
a2df86f9f6 [giconstantinfo] Document and check parameters 2010-06-06 22:48:08 -03:00
Johan Dahlin
6e11316e28 [gifieldinfo] Document g_field_info_get_flags 2010-06-06 22:47:50 -03:00
Johan Dahlin
501238c318 Remove left-over comments 2010-06-06 22:47:21 -03:00
Johan Dahlin
dc4a7e9e32 [giregisteredtype] Flags have a GType 2010-06-06 22:47:02 -03:00
Johan Dahlin
e57e4f2868 [gifunction.h] Move GIFunctionInfoFlags to gitypes.h 2010-06-06 19:55:00 -03:00
Johan Dahlin
c223abfa36 [girepository] Move the rest out of ginfo.ch 2010-06-06 19:54:53 -03:00