| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
We need to differentiate between --pkg options we use to parse
ourself, and --pkg-export which are needed for library consumers.
When introspecting a library we won't necessarily have the
pkg-config file built, so add a --pkg-export line so library
authors can explicitly make the .gir -> pkg-config association.
|
|
|
|
|
| |
Adds a (skip) option that can be added to the header of any doc comment
to cause that symbol to be skipped in the .gir output
|
|
|
|
|
| |
Don't hardcode gcc, any cc which handles those options is good
enough; in particular this is reported to fix Sun Studio.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Thanks to commit 6d510b8db, we now no longer need LD_LIBRARY_PATH
to be set for invoking the compiler.
Next, before we were taking the LD_LIBRARY_PATH variable and
turning it into a compile path, presumably to attempt to handle
the cases where we weren't getting the right -L flags. Also
interacting with this was a while ago we weren't really doing
uninstalled libtool libraries correctly, which is probably
how hacks involving LD_LIBRARY_PATH crept into the scanner.
Just require that we're passed the right -L flags, and we
should be doing libtool libraries better now.
|
|
|
|
| |
The last few commits regressed 'check'; fix those up.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In addition to the current --library=<foo>, support --library=lib<foo>.la.
This makes it unambiguous that we are referencing an uninstalled
library and allows accurate extraction of the shared library name
for the uninstalled library.
* tests/scanner/Makefile.am tests/offsets/Makefile.am: Use the
new form of --library=. Also some LD_LIBRARY_PATH frobbing as needed.
*-expected.gir *-expected.tgir: We now pick out the shared library
accurately, so fix shared-library="" in our reference girs. (The
comparison may need some pre-sanitization now to work on non-ELF)
http://bugzilla.gnome.org/show_bug.cgi?id=591669
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using ctypes.util.find_library() to resolve library names to
sonames causes problems with dealing with uninstalled libtool
operation properly. We're unlikely to find any way of combining
the two that will be robust against future changes in both
facilities.
Switch to a different approach - run 'ldd' on the compiled
introspection binary and extract sonames from there This is
less portable but should be quite robust where it works.
utils.py dumper.py: Move libtool-command-line finding into utils.py
girwriter.py: Remove library name resolution from here, expect libraries
to be passed in preresolved.
shlibs.py scannermain.py: New file including resolve_shlibs() to resolve
library names using the introspection binary.
tests/scanner/Makefile.am: Add .libs to LD_LIBRARY_PATH
http://bugzilla.gnome.org/show_bug.cgi?id=591669
|
|
|
|
|
| |
It's allowed for source_filename to be None if we can't match it
up with a file, so just skip the constant in that case.
|
|
|
|
| |
This avoids /tmp noexec madness.
|
|
|
|
|
|
| |
Using CC fails when building gobject-introspection because CC is defined to
be $(SHELL) scripts/shave cc '$(SHAVE_SAVED_CC)'. A more sophisticated fix
will be needed later.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Earlier we were only using the first library specified when
compiling an introspection binary. This breaks builds on Solaris
which doesn't have implicit linking and we need to be able
to specify multiple libraries.
The tension here is primarily related to OS X' distinction between
modules and shared libraries; if we build the custom libraries
in gir-repository as shared libraries, then we can't dlopen them.
If we build them as modules, then the introspection binary compiler
can't link to them.
If we want to fix the OS X build, probably the way to go would be
a special --use-first-library-only option that gets conditionalized
on OS X + gir-repository.
But even better is to finish killing gir-repository entirely.
|
|\ |
|
| |
| |
| |
| | |
Plain fields (i.e. non-callbacks) may have a 'type' annotation now.
|
| |
| |
| |
| |
| |
| |
| | |
Annotation parser patch from: Tim Horton <hortont424@gmail.com>
If an explicit element type is specified, don't override it with
guint8.
|
|/ |
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
You can now specify a nested parameterized type in annotations as
(for example):
@param: (type GLib.HashTable<utf8,GLib.HashTable<utf,utf>>)
or
@param: (element-type utf8 GLib.HashTable<utf,utf>)
New test functions for the Everything typelib show how it works.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Printing to stdout is legitimate.
|
|
|
|
|
|
|
|
|
| |
This patch fixes our default handling of char **. We add Return
node types as a case where we test for array handling.
Remove the hardcoded assumption of array = "no transfer", just
use the separate Parameter/Return cases. This change causes
inout char ** to be transfer="full", but that seems more correct.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we tried to guess what the "underscore version" of a class name
would be, but for classes like NMSetting8021x we'd guess "nm_setting8021x"
instead of "nm_setting_802_1x". All such guesses are subject to error:
instead let's try to use the prefix of the _get_type() method instead, and
only guess if that doesn't work.
We do this for both class names and when detecting methods. An additional
type with a "non-standard" underscored version (TestWi8021x) added to the
everything.[ch] test suite to test proper conversion.
GdkWindow and GObject have unusual get_type methods; add special quirks
to handle these (at least until the methods are renamed upstream).
(Slightly modified for PEP8 compliance by Colin Walters)
Signed-off-by: Colin Walters <walters@verbum.org>
|
|
|
|
|
|
| |
As originally implemented, this annotation was only used for method
overloading (argument signature polymorphism). Allow it to be used to
clean up historically poorly-named methods as well.
|
|
|
|
|
| |
Zero length arrays are a GNU C extension, so this way we don't
fail on non-GCC.
|
|
|
|
|
|
|
|
|
|
| |
This allows to annotate cases where the heuristics don't work.
TODO: According to Juerbi, there are cases where two callbacks refer
to the same user_data, which is prohibited by the current
implementation.
Signed-off-by: Andreas Rottmann <a.rottmann@gmx.at>
|
|
|
|
| |
Add support for the 'Rename To:' annotation for functions and methods.
|
|
|
|
|
|
|
| |
This has a few use cases; the main one in mind right now is that
when we place this in the .typelib as well, we can use it to optimize
lookups based on GType names, by skipping entirely typelibs whose
c:prefix is not a prefix of the target type lookup.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some enums have members which have a common prefix which doesn't
match that of the enum name, but it also longer than the global
namespace prefix. Instead, try stripping the common prefix first,
and only if that fails fall back to the global strip.
Also, for glib-registered enums we were using the nick, which
typically has "-" as a separator. Replace that with "_" for
consistency between unregistered enums and registered.
utils.py:strip_common_prefix is now unused, delete.
|
|
|
|
|
|
| |
We previously supported (type) on signals only, extend it to all cases.
This is useful for a few cases where libraries use a superclass like GtkWidget*
for C convenience, where the actual type is a subclass.
|
|
|
|
|
|
| |
We don't want to pollute the global namespace with our private
libraries. Also, this sidesteps all the craziness that is happening
with OS vendors changing how Python installs modules.
|
|
|
|
|
|
|
|
|
|
|
|
| |
callback signature
Add a heuristic to the scanner that flags arguments of callbacks that
are named 'user_data' (exact match) and have a 'any (void*) type.
These arguments are marked by setting the 'closure' field of ArgBlob
to the index of themselves.
Signed-off-by: Andreas Rottmann <a.rottmann@gmx.at>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Add support for a `(type bitfield)' annotation for enums.
Signed-off-by: Andreas Rottmann <a.rottmann@gmx.at>
|
|
|
|
|
|
|
|
|
|
| |
Allow a documentation block to have options, e.g.:
/*
* SomeType: (OPT-NAME VALUE) ...
*/
Signed-off-by: Andreas Rottmann <a.rottmann@gmx.at>
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
This reverts commit 4470a24e8cf3827efaddcfe240c3271cf1a0d6c0.
Needs more work as it turns out, we need to figure out the binding
story.
|
|
|
|
|
|
|
|
| |
Make the callback grouping heuristic more lax: consider all pointer
parameters ending in 'data' to be the user_data parameter (instead of
requiring an exact 'user_data' name).
Signed-off-by: Andreas Rottmann <a.rottmann@gmx.at>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
In order to determine whether a method is virtual, by default we look
at the class table to find a callback field. This should be fairly reliable,
but we may also later need annotations to more finely control this
in the case of a name clash with a signal.
|
|/
|
|
|
| |
This fixes a cache issue where the pickle in the cache doesn't
have self._pkgconfig_packages set in its instance
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Previously we just supported int and string, add double to this.
Technically we should probably differentiate between float and
double, but it's not likely to be very useful in practice to do so.
|
|
|
|
| |
This makes the dumper not fail for people who set $CC to e.g. "distcc gcc".
|
|
|
|
|
| |
We keep track of the source filename for every symbol. This enables
us to later filter symbols based on that name.
|
|
|
|
|
| |
gvariant uses va_list *; we were previously skipping va_list, we should
skip indirect variants as well.
|
|
|
|
|
| |
Avoids a compilation warning (unused function)
in the generated lexer output.
|
| |
|
| |
|
| |
|