summaryrefslogtreecommitdiff
path: root/giscanner/gdumpparser.py
Commit message (Collapse)AuthorAgeFilesLines
* scanner: Replace GInitiallyUnowned field sharing with generic solutionSimon Feltman2014-01-041-11/+0
| | | | | | | | | | | | Remove GInitiallyUnowned special case in gdumpparser where fields are copied from GObject. Add generic solution where anytime we have multiple typedef structs, the fields become shared: typedef struct _Foo Foo; typedef struct _Foo Bar; struct _Foo {...}; https://bugzilla.gnome.org/show_bug.cgi?id=581525
* giscanner: fix typoDieter Verfaillie2013-10-081-1/+1
|
* giscanner: remove dead codeDieter Verfaillie2013-10-081-8/+0
| | | | | Last call sites where removed in 36aa515f1036978ced8d4ffb808260844f7229e0 about 3 years ago.
* tests: Update misc/pep8.py to 1.4.5Dieter Verfaillie2013-05-071-6/+3
| | | | | | | | | | | | | | | | | Version in our tree is a wee bit outdated. For example, later work will introduce an utf8 encoded python source file which our old pep8.py does not yet understand (yeah, it really was *that* ancient)... Updated from: https://raw.github.com/jcrocholl/pep8/1.4.5/pep8.py Takes 552c1f1525e37a30376790151c1ba437776682c5, f941537d1c0a40f0906490ed160db6c79af572d3, 5a4afe2a77d0ff7d9fea13dd93c3304a6ca993de and a17f157e19bd6792c00321c8020dca5e5a281f45 into account... https://bugzilla.gnome.org/show_bug.cgi?id=699535
* giscanner: prefer "except X as e" over "except X, e"Dieter Verfaillie2013-04-091-7/+7
| | | | | | It's more readable and as an added bonus Python 3 compatible. https://bugzilla.gnome.org/show_bug.cgi?id=697616
* Fix matching of methods named *_get_type()Matthew Booth2012-03-061-11/+5
| | | | | | | | | | | | | The code which heuristically turned functions into class methods would always ignore any function called *_get_type or *_get_gtype. However, the code which looked for GI metadata functions to execute them was much more comprehensive, checking not just the name, but also that it had no parameters and that it returned a GType. This change abstracts the more comprehensive check into the Function class, and uses the same check in both places. https://bugzilla.gnome.org/show_bug.cgi?id=671218
* scanner: Don't add redundant notify signalColin Walters2011-09-121-4/+0
| | | | It was actually introduced by e0fea819f0da1ca60cce3280e7e21f3d2955be3a
* scanner: Only add notify signal to Object, not ParamSpec etc.Colin Walters2011-09-121-3/+4
|
* scanner: Add "notify" signal to GObjectColin Walters2011-09-091-0/+3
| | | | | For gjs we want to switch to using introspection data for signals, and the "notify" signal being missing from GObject was a problem.
* Avoid most of the special-casing of GObject.Object in the scannerPavel Holejsovsky2011-08-281-48/+14
| | | | | | | | | There were some cases of handling GObject and GInitiallyUnowned which were not necessary. Removing special cases from them simplified code and as a bonus it added 'GObject::notify' signal into GIR, which was not there previously. https://bugzilla.gnome.org/show_bug.cgi?id=657446
* Properly handle GParamSpec and descendantsPavel Holejsovsky2011-08-251-6/+21
| | | | | | | GParamSpec is introspected as fundamental class, and all GObject classes derived from it (e.g. GParamSpecChar) are marked as such. https://bugzilla.gnome.org/show_bug.cgi?id=656440
* Make sure signal works when there isn't one specifiedJohan Dahlin2011-08-131-1/+1
|
* Add signal flagsJohan Dahlin2011-08-131-1/+8
| | | | | | This adds all GSignalFlags into the gir. https://bugzilla.gnome.org/show_bug.cgi?id=656457
* Switch to storing string form of error quarksDan Winship2011-08-121-6/+35
| | | | | | | | | | | | | | | | Instead of storing the name of the function to call to get the error quark, store the string form of the error quark, which we derive from the introspection binary during scanning. Update EnumBlob and GIEnumInfo to include the new information. This will allow determining a back-mapping from error quark to error domain without having to dlsym() and call all the known error quark functions. Based on earlier patches from Owen Taylor and Maxim Ermilov. https://bugzilla.gnome.org/show_bug.cgi?id=602516
* Reverting "Workaround for CairoRectangleInt exposed in Gdk-3.0.gir"Pavel Holejsovsky2011-07-291-5/+0
| | | | This was not meant to be pushed (yet). Sorry for confusion.
* Workaround for CairoRectangleInt exposed in Gdk-3.0.girPavel Holejsovsky2011-07-291-0/+5
| | | | | | | | | This is simple workaround which ignores CairoRectangleInt boxed type appearing as defined by libgdk, because libgdk simply aliases this gtype for GdkRectangle (as it also typedef's GdkRectangle to cairo_rectangle_int_t). https://bugzilla.gnome.org/show_bug.cgi?id=655423
* gdumpparser.py: Limit line length to 100Colin Walters2011-06-091-1/+3
|
* Rework how fundamental GObject types are introspectedGiovanni Campagna2011-06-081-21/+30
| | | | | | | | | | | Change the special code for handling GObject and GInitiallyUnowned so that it exposes GParamSpec as a class, and it allows GVariant to have a GType without using the deprecate g_variant_get_gtype. It is a sort of ABI break, in that new typelibs won't work with previous versions of libgirepository. https://bugzilla.gnome.org/show_bug.cgi?id=646635
* Add boxed types definition for GLibGiovanni Campagna2011-06-041-17/+5
| | | | | | | | | | Use the new glib-boxed.h header from gobject to pair structure definitions with boxed types in the GLib namespace, improving the introspection coverage and removing some hacks. Some fixes from Colin Walters <walters@verbum.org> https://bugzilla.gnome.org/show_bug.cgi?id=646635
* scanner: Support _get_gtype() as a GType creation suffixColin Walters2011-06-031-4/+7
| | | | | | Based on a patch by Giovanni Campagna <gcampagna@src.gnome.org> https://bugzilla.gnome.org/show_bug.cgi?id=646635
* scanner: Fix handling of property transferColin Walters2011-01-051-3/+1
| | | | | | * gdumpparser.py was incorrectly passing the ctype for transfer * Property constructor wasn't actually doing anything with passed transfer * Parse transfer-ownership in girparser
* Make sure we don't mark GInitiallyUnownedClass as disguisedTomeu Vizoso2010-12-061-0/+1
|
* Handle enumerations with the full range of signed and unsigned valuesOwen W. Taylor2010-11-011-7/+25
| | | | | | | | | | | | | The C compiler will pick an enumeration type that accomodates the specified values for the enumeration, so ignoring 64-bit enumerations, we can have enumeration values from MININT32 to MAXUINT32. To handle this properly: - Use gint64 for holding eumeration values when scanning - Add a 'unsigned_value' bit to ValueBlob so we can distinguish the int32 vs. uint32 cases in the typelib - Change the return value of g_value_info_get_value() to gint64. https://bugzilla.gnome.org/show_bug.cgi?id=629704
* scanner: Don't leave temporary directory around if we failColin Walters2010-10-071-1/+3
| | | | | ...by default. However, the GI_SCANNER_DEBUG=save-temps option helps for debugging.
* Set c_symbol_prefix in the GVariant special caseTomeu Vizoso2010-09-171-0/+1
|
* scanner: Add temporary workaround for GStreamerColin Walters2010-09-151-0/+2
| | | | | | | Also document/bug link the other workarounds; just made up a convention for ## WORKAROUND ## See: https://bugzilla.gnome.org/show_bug.cgi?id=550616
* scanner: Add GType for GVariantColin Walters2010-09-131-5/+10
| | | | This needs a manual override since GVariant is a fundamental.
* scanner: Bomb out more obviously if a namespace contains class name = namespaceColin Walters2010-09-131-0/+6
| | | | | If you pass --namespace=FooBar, and have a GObject named FooBar, we'd assert. Give the user an obvious error message.
* scanner: Allow gstreamer's GParamSpecMiniObject throughColin Walters2010-09-101-0/+13
| | | | | | | | It's wrong, but they can't change it now, so work around it here. https://bugzilla.gnome.org/show_bug.cgi?id=550616 https://bugzilla.gnome.org/show_bug.cgi?id=629306
* scanner: Kill glibastColin Walters2010-09-081-43/+67
| | | | | | | | | | | | It was a stupid abstraction split, we only support GObject. * Clean up how we handle c:type - we only set it if we've actually seen a corresponding structure. * Add a warning if we don't see the structure typedef for an interface, since that's pretty bogus. (And fix regress.h to have one) * Rename the "type_name" attribute internally to "gtype_name" for clarity.
* [scanner] Fundamental problems are not fatalJohan Dahlin2010-09-071-1/+2
|
* Fix typo (reported by philn-tp)Tomeu Vizoso2010-09-031-1/+1
|
* [scanner] Move a function from transformer to astJohan Dahlin2010-09-021-6/+6
| | | | | It doesn't use any internal state, so it can easily be moved over to the type as a factory function
* [scanner] Move over remaining callsites to messageJohan Dahlin2010-09-021-2/+2
| | | | | Move the remaining callsites over to the new message module
* [scanner] Simplify strip_identifer/strip_symbolJohan Dahlin2010-09-021-16/+29
| | | | | | | | The strip_* functions are problematic since they have a fatal switch which determines if the message should kill the scanner. Change the api to make it easier to extend with other logging categories and move over the callsites to use the new message module
* [transformer] Don't pass around source scannerJohan Dahlin2010-09-021-2/+0
| | | | Pass around its symbols instead
* scanner: Better handling of GType namesColin Walters2010-09-011-6/+6
| | | | | | | | Before, Type instances could be indeterminate, holding a "ctype", which means "This is some unresolved string". However, we also get data from GType, so add gtype_name as another indeterminate state. Clean up how we create and resolve Type instances from GType data.
* scanner: Avoid internal invalid Type instances from parentsColin Walters2010-08-311-2/+3
| | | | | We were adding a trailing ',' in the parent string, clean that up; and don't attempt to create a Type from the empty string.
* major: Fix parent for GInitiallyUnownedColin Walters2010-08-311-1/+1
|
* Major rewriteColin Walters2010-08-311-0/+455
One of the first big changes in this rewrite is changing the Type object to have separate target_fundamental and target_giname properties, rather than just being strings. Previously in the scanner, it was awful because we used heuristics around strings. The ast.py is refactored so that not everything is a Node - that was a rather useless abstraction. Now, only things which can have a GIName are Node. E.g. Type and Field are no longer Node. More things were merged from glibast.py into ast.py, since it isn't a very useful split. transformer.py gains more intelligence and will e.g. turn GLib.List into a List() object earlier. The namespace processing is a lot cleaner now; since we parse the included .girs, we know the C prefix for each namespace, and have functions to parse both C type names (GtkFooBar) and symbols gtk_foo_bar into their symbols cleanly. Type resolution is much, much saner because we know Type(target_giname=Gtk.Foo) maps to the namespace Gtk. glibtransformer.py now just handles the XML processing from the dump, and a few miscellaneous things. The major heavy lifting now lives in primarytransformer.py, which is a combination of most of annotationparser.py and half of glibtransformer.py. annotationparser.py now literally just parses annotations; it's no longer in the business of e.g. guessing transfer too. finaltransformer.py is a new file which does post-analysis for "introspectability" mainly. girparser.c is fixed for some introspectable=0 processing.