Commit Graph

350 Commits

Author SHA1 Message Date
Johan Dahlin
91459565ef Improve the error message 2009-12-09 16:39:47 -02:00
Bastien Nocera
e3cd97d492 Make error more verbose in parser
By printing the function when arguments are missing

https://bugzilla.gnome.org/show_bug.cgi?id=604161
2009-12-09 11:22:24 +00:00
Iain Nicol
c22f11f1b8 Remove some unportable integral type size assumptions
https://bugzilla.gnome.org/show_bug.cgi?id=602762
2009-12-02 10:45:20 -02:00
Jasper Lievisse Adriaanse
a7c04b69de Fix build on OpenBSD
Due to a missing header, gobject-introspection fails to compile on OpenBSD.
And only due to headers-including-headers practice this doesn't blow up on
many other platforms.

https://bugzilla.gnome.org/show_bug.cgi?id=596226
2009-12-02 10:39:31 -02:00
Maxim Ermilov
4b796371ae GI_TYPE_TAG_VOID != ffi_type_void
https://bugzilla.gnome.org/show_bug.cgi?id=603157
2009-12-02 10:37:19 -02:00
Maxim Ermilov
a668ac5303 Plug a leak in g_callable_info_get_ffi_return_type
https://bugzilla.gnome.org/show_bug.cgi?id=603526
2009-12-02 10:19:45 -02:00
Simon van der Linden
46e36632af Add a method to compare infos
Add g_base_info_equal.
2009-11-20 10:40:07 +01:00
Tomeu Vizoso
43f1c2db17 Add g_ir_ffi_convert_arguments 2009-11-12 10:53:45 +01: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
Colin Walters
8ba5a13d17 [gtypelib.h] Document SimpleTypeBlob more 2009-11-04 11:43:13 -05:00
Colin Walters
6b5a358371 Use best known derived parent
In the case where a known class derives from a hidden one, we want
to use the most-derived parent class, rather than simply falling back
to GObject.

Example:
ShellEmbedWidget in gnome-shell derives from ClutterGLXTexturePixmap from clutter,
which is a hidden class.  ClutterGLXTexturePixmap's parent itself is
ClutterX11TexturePixmap, which is also hidden.  But its parent is
ClutterTexture, which we do know.  Use that.

https://bugzilla.gnome.org/show_bug.cgi?id=598993
2009-10-21 14:19:26 -04:00
Colin Walters
7e7f7599b9 Correctly ref repository in GIUnresolvedInfo
Followup to previous patch.
2009-09-04 17:02:14 -04:00
Colin Walters
5f6b975d87 Bug 593322 - Fix unref of GIUnresolvedInfo instances
We are treating GIUnresolvedInfo as a GIBaseInfo, but the structures
had drifted out of sync.  Add a repository pointer and bring them
back into sync.

Based on a report and patch from Jan Hudec <bulb@ucw.cz>
2009-09-04 16:52:35 -04:00
Colin Walters
1735ebde9a [typelib] Clean up dlopen handling
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.
2009-08-19 11:05:08 -04:00
Owen W. Taylor
90de854ee5 Don't open shared libraries twice
If loading a referenced shared library succeeds, don't try loading it again.

http://bugzilla.gnome.org/show_bug.cgi?id=591737
2009-08-13 15:56:04 -04:00
Owen W. Taylor
46d5a2392d Fix checks in gfield.c
When checking if the readable/writable flags are missing for the fields
we are trying to read and write, use (a & flag) == 0, not (!a & flag).

http://bugzilla.gnome.org/show_bug.cgi?id=579727
2009-07-09 11:06:20 +01:00
Dan Winship
933fcbc88c Sync the basic types array in girnode.c:serialize_type with GITypeTag
Fixes a crash compiling GIRepository-2.0.gir.

http://bugzilla.gnome.org/show_bug.cgi?id=587823
2009-07-06 11:32:41 -04:00
Tobias Mueller
65e241fab8 Name unions to enable compilation on Solaris
Patch by Brian Cameron <brian.cameron@sun.com>.
Fixes bug 578199.
2009-06-24 23:52:05 +02:00
Mark Lee
378350f3a9 Bug 584423 – Add short/ushort support
Add type tags for short and ushort, plus all of the requisite code needed
to utilize them in libgirepository.
Add support in the scanner's AST files.
Add test functions to the everything library and the expected gir file.

gtypelib.c constant validation fixed by Colin Walters <walters@verbum.org>
2009-06-22 14:01:56 -04:00
Simon van der Linden
0a046b7aa0 Bug 585328 - Only set zero_terminated flag for types we know are
Rationalize our setting of the zero_terminated flag; we shouldn't
set it if the gir doesn't say to.
2009-06-17 17:32:48 -04:00
C. Scott Ananian
1a256fd7bd Bug 585584: Fix warnings in girparser backtrace functionality and compiler.c 2009-06-12 12:31:43 -04:00
Holger Hans Peter Freyther
5917b5ba42 Make g-ir-compiler find files installed by make install
When ./configure --prefix $HOME/some/where is used gobject-introspection
will happily install the files into $HOME/some/where/data/gir-1.0 but
it will refuse to find them. Apply the same trick as in
girepository/girepository.c:init_globals to find the gir files.

Unifiy the name gir-1.0 in GIR_SUFFIX and use it throughout the
project, introduce GIR_DIR which holds the path to the gir files and
update girparser and transformer.py to look into this path.
2009-06-11 13:53:01 -04:00
C. Scott Ananian
7f29f620a4 Update doc comments.
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.
2009-05-12 16:11:32 +01:00
Dan Winship
c5930c73c5 Fix 'Could not find GIR file ...' error to use right filename.
Also plug a leak; girname was previously only freed on error.
2009-03-28 08:34:36 -04:00
Andreas Rottmann
7937dd000e Bug 576605 - Get rid of GI_SCOPE_TYPE_OBJECT
Remove support for (scope object) as it lacks a real use case.
2009-03-27 19:31:55 +01:00
Didier 'Ptitjes
a515ab13b0 Bug 576323 - Fix inner constant parsing Signed-off-by: Didier 'Ptitjes <ptitjes@free.fr>
Signed-off-by: Colin Walters <walters@verbum.org>
2009-03-24 15:21:53 -04:00
Colin Walters
2898d23962 Bug 564016 - Include c:prefix in typelib, use it to optimize find_by_gtype
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.
2009-03-17 16:29:08 -04:00
Colin Walters
7299c89fc9 Bug 557383 - Virtual method support
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.
2009-03-05 15:52:12 -05:00
Colin Walters
cd845500a5 Bug 571548 - Generic attributes
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.
2009-03-03 17:26:37 -05:00
Colin Walters
86587133cd Add a parent parmeter to g_ir_node_build_typelib
This will be useful for later changes which need to inspect the parent.
2009-02-27 19:12:24 -05:00
Colin Walters
9dbb0bf80f Bug 572434 - Associate interfaces with their C structures
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.
2009-02-25 17:31:49 -05:00
Johan Bilien
f13354f9ea Bug 572965 – Allow generic marshaller to be called without parameters
girepository/ginvoke.c: handle the case where n_param_values == 0.
tests/invoke/genericmarshaller.c: add a test case for this.
2009-02-24 15:22:59 +00:00
Colin Walters
86c1c58917 typelib building: Compress 5 arguments for g_ir_node_build_typelib
This makes it easier to add more over time without changing lots
of unrelated code.
2009-02-20 11:05:53 -05:00
Colin Walters
9a467b6cd8 Further cleanup for commented-out Union discriminator handling 2009-02-19 11:18:48 -05:00
Colin Walters
865ac8e510 Fix bad merge introduced in commit b006d50 2009-02-19 09:56:20 -05:00
Colin Walters
361de29ba0 Bug 571373 - Add padding to typelib objects
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.
2009-02-18 21:54:04 -05:00
Colin Walters
8abbc0b2f9 Bug 571373 - Remove hardcoded sizes/offsets in girnode.c
Where appropriate we now use G_STRUCT_OFFSET and sizeof()
instead of hardcoded integers.  Add comments for some special
cases.
2009-02-18 21:54:03 -05:00
Colin Walters
b4d4ca5d38 Bug 571373 - Remove hardcoded offsets in ginfo.c
In a few places we had hardcoded sizes for accessing structure members
and computing into variable size arrays.  Remove those.
2009-02-18 21:54:03 -05:00
Colin Walters
83c0d9b93b Bug 571373 - Consistently use sizeof () inside gtypelib and girmodule
This not only makes it easier to change these structures, it becomes
clearer exactly what each magic number is just for reference.
2009-02-18 21:54:03 -05:00
Colin Walters
ff6c10e53c Bug 571373 - Move typelib docs from typelib-format.txt into girepository.h
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.
2009-02-18 21:53:59 -05:00
Colin Walters
3333e4ed9e Merge branch 'master' of ssh://walters@git.gnome.org/git/gobject-introspection 2009-02-13 11:25:23 -05:00
Robert Carr
cd46d2fa0b Fix build 2009-02-12 09:51:16 -05:00
Johan Dahlin
fe8c6d34c4 Add gtk-doc support 2009-02-12 01:32:25 -02:00
Colin Walters
0a74fdfec0 Bug 567906 - Put pkg-config dependencies in .gir files
When generating a .gir file, we now first parse all of our .gir includes
to pick up their <package> headers.  Then, we merge that with the set of
--pkg arguments passed to us, run pkg-config to gather the arguments,
and finally save the merged pkg-config list to our new .gir file.

This is useful for software which needs to map from .gir to pkg-config
in a programmatic way.
2009-02-11 15:03:16 -05:00
Colin Walters
97a2e7f5fc Bug 571248 - Ignore unknown elements in girparser
We want the gir to be extensible.

svn path=/trunk/; revision=1096
2009-02-11 00:08:49 +00:00
Rober Carr
3490a56ba4 Bug 569633 – Typelib compiler fails with vararg callbacks
2009-02-10  Rober Carr <carrr@rpi.edu>

	Bug 569633 – Typelib compiler fails with vararg callbacks

	* girepository/girparser.c: Also filter out callback functions
	which take vararg arguments.

svn path=/trunk/; revision=1095
2009-02-10 23:34:04 +00:00
Johan Dahlin
8c2ef112b7 Rename namespace to namespace_ to make the header compilable with a C++ compiler
svn path=/trunk/; revision=1094
2009-02-10 21:01:08 +00:00
Colin Walters
ff6b28c17b Bug 551738 - Associate classes with their structs
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
2009-02-06 18:37:13 +00:00
Colin Walters
1b22fa426f girnode.c: Fix copy & paste error
This line is almost certainly a copy & paste error.  It appears to be
harmless, but it's better to not have it.

svn path=/trunk/; revision=1085
2009-02-05 18:00:00 +00:00
Johan Dahlin
314ad462dc Add utility functions for invocing closures given a GICallableInfo using
2009-02-04  Johan Dahlin  <jdahlin@async.com.br>

    * girepository/Makefile.am:
    * girepository/girffi.c (g_callable_info_get_ffi_arg_types),
    (g_callable_info_get_ffi_return_type),
    (g_callable_info_prepare_closure), (g_callable_info_free_closure):
    * girepository/girffi.h:
    Add utility functions for invocing closures given a GICallableInfo
    using libffi.


svn path=/trunk/; revision=1084
2009-02-05 00:40:14 +00:00