summaryrefslogtreecommitdiff
path: root/girepository
Commit message (Collapse)AuthorAgeFilesLines
* girepository: Also store GType cache missesCarlos Garnacho2019-11-141-1/+14
| | | | | | | | | | | | | | | | | | | | | There are notably 4 classes of GTypes where a girepository lookup might fail: - GTypes from private interfaces in public objects (eg. MetaCullable in mutter) - GTypes for private base objects with public interfaces (eg. GLocalFile in GLib) - GTypes registered from the language, and presumably not coming from the GIR - GTypes of objects/interfaces that we didn't load a typelib for It is moot to look for those over and over again, and a full lookup can be taxing if looking up for a method/property on objects with those characteristics. It seems we can cache the misses too, so next lookups are just as quick as an introspected GType. The cache is invalidated after loading new typelibs, in case some of the previously missed GTypes is now properly introspected.
* girepository: Fix memory leakPhilip Chimento2019-10-101-0/+2
| | | | In g_irepository_get_object_gtype_interfaces()
* build: use proper dylib versioning on macOSTom Schoonjans2019-09-101-1/+11
|
* Make meson.override_find_program working on more complex use casesThibault Saunier2019-08-151-0/+4
| | | | | | | Add some missing `meson.override_find_program` And make sure that the `.gir` we build are found when used uninstalled as a concequence of `meson.override_find_program`.
* structinfo: Fix offset in find_method()Florian Müllner2019-08-141-4/+1
| | | | | | | | The current offset only considers the fields themselves, but not the optional embedded type that may follow each field. Use the existing helper function instead of computing the offset to fix the issue.
* meson: don't pass "install" to configure_file() unless really neededChristoph Reiter2019-07-261-1/+0
| | | | | | | | | | In our case it was never needed because it defaults to true if install_dir is set, which it always is for all calls. This avoids a warning when running with newer meson where it complains that install is only available with 0.50+. Fixes #298
* scanner: parse and expose function macrosMathieu Duponchelle2019-07-191-1/+6
| | | | | This is useful for documentation tools, and other utilities that rely on full introspection of the C API of a given library.
* girepository: Return pointer array for interface cachePhilip Chimento2019-06-202-4/+4
| | | | | | | | | | | | | In g_irepository_get_object_gtype_interfaces(), returning the address of the first GIBaseInfo* does not work reliably, because the GIBaseInfos are not necessarily stored contiguously. So the second and subsequent ones might be garbage. Instead, return the address of the array of GIBaseInfo pointers. Add a test that verifies the functionality, as well. This is unfortunately an API and ABI break.
* build: Force-include msvc_recommended_pragmas.h on Visual StudioChun-wei Fan2019-04-302-31/+50
| | | | | | | | | | By doing so, we essentially cover the various compiler flags that we want to use for non-Visual Studio builds to check for warnings that might cause real concern. This also skips the checks for the various GCC-isque CFlag checks that are scattered in the various build files on Visual Studio builds, since they are essentially meaningless on Visual Studio builds.
* Fix a possible use-after-free.Elliott Sales de Andrade2019-02-021-1/+1
| | | | | | If g_mapped_file_new fails, then `version` will be freed, but it was already added to the hash table. This means there could be a use-after-free while doing a lookup on the hash table the next time.
* Fix possible leak of transitive dependency name.Elliott Sales de Andrade2019-02-021-1/+2
| | | | | | If a transitive dependency appears twice, the original pointer will be removed from the hash table. Since these names were created by g_strsplit, they need to be freed, or they will leak.
* repository: Fix annotation for g_irepository_get_object_gtype_interfaces()Rico Tzschichholz2019-01-161-2/+2
| | | | Introduced by 9826d952358c8330d72ecba062f489fbdc31bbd1
* repository: g_irepository_get_object_gtype_interfacesColin Walters2019-01-092-0/+105
| | | | | | | | | | | Bindings in some cases need to look up information from a GType dynamically. Support that better by supplying a cache for this information. (Rebased and versioning / gtk-doc stuff added by Philip Chimento.) Closes #38. See gjs#55.
* ci: enable -Werror for msys2+mesonChristoph Reiter2019-01-012-0/+3
|
* Cleanup strict-prototypes warningsTomasz Miąsko2018-12-203-5/+4
|
* meson: add default compiler warning flags and enable -Werror on CIChristoph Reiter2018-12-182-5/+40
| | | | | | | | This enables various compiler warnings project wide and disables the triggered ones for each library/executable. This should give us roughly the same behaviour as with autotools. Tested with gcc8 and clang7.
* meson: Use `copy` instead of an empty configurationEmmanuele Bassi2018-12-181-1/+1
| | | | | The configure_file target has grown a `copy` argument to avoid using an empty configuration_data object since Meson 0.47.
* girepository: Add version macros and functions. Fixes #200Christoph Reiter2018-12-165-1/+179
| | | | | | | | | | | This adds the following macros and functions: GI_MAJOR_VERSION, GI_MICRO_VERSION, GI_MINOR_VERSION, GI_CHECK_VERSION, gi_get_major_version,gi_get_micro_version, gi_get_minor_version. Since we share a prefix with glib we have to namespace these by using the gi_ prefix. g_gi would also work but we already export symbols with gi_ like gi_cclosure_marshal_generic(), gi_type_tag_get_ffi_type() and gi_type_info_extract_ffi_return_value(), so let's not add another naming scheme.
* baseinfo: don't abort when calling g_base_info_get_name() on a GITypeInfo. ↵Christoph Reiter2018-12-151-0/+1
| | | | | | | | | | Fixes #96 GITypeInfo is a GIBaseInfo so calling g_base_info_get_name() on it should do something sensible. g_base_info_get_name() has always been documented to return NULL in case no name is available so return that instead.
* giobjectinfo: Fix some documentation for find_vfunc_using_interfacesJasper St. Pierre2018-12-151-2/+2
| | | | See #66
* docs: Field offsets are in the units of bytesTomasz Miąsko2018-12-141-1/+1
|
* docs: Remove everything not related to libgirepository and restructure. ↵Christoph Reiter2018-12-143-3/+3
| | | | | | | | | | | | | Fixes #244 The gtk-doc docs were including some bits of overal g-i docs but mostly unfinished and outdated. We now have the general docs in sphinx so remove the duplication and make the gtk-docs just about the libgirepository API and nothing more. This also renames some titles and fixes some missing links in the struct hierarchy while at it.
* docs: fix gtk-doc warnings and update version infosChristoph Reiter2018-12-0922-48/+55
| | | | | | | | Move things around and rename things until gtk-doc is happy. This also moves the "Since" annotations to the next stable releases and adds version added info for g_callable_info_get_instance_ownership_transfer() and g_struct_info_find_field().
* writer: Include documentation and symbol position in source filesThibault Saunier2018-11-281-1/+8
| | | | | | | | | | | Some documentation tool (as hotdoc[0]) need to have information about symbol declaration and documentation positions in the source files to be able to do smart indexing (automatically build the documenation index). [0] https://hotdoc.github.io/ Fixes #175
* girnode: remove wrongly added g_assert_not_reached(). Fixes #218Christoph Reiter2018-08-031-1/+1
| | | | | Added in 9535fc48. After the switch it calls _g_ir_node_build_typelib() again handling the other types.
* girepository: port from g_type_class_add_private() to G_ADD_PRIVATE()Christoph Reiter2018-07-301-5/+2
| | | | This lets us enable -Wdeprecated-declarations
* build: enable -Wredundant-declsChristoph Reiter2018-07-291-9/+0
| | | | | The ffi decls were added in cbdd9ee09e367e4dd to work around broken ffi headers. Let's assume this is fixed now.
* build: enable -Wswitch-defaultChristoph Reiter2018-07-297-0/+24
| | | | | | | In case the surrounding code handles missing cases break, otherwise add a g_assert_not_reached(). The generated parser code triggers this as well, so disable it there only.
* build: enable -Wtype-limitsChristoph Reiter2018-07-291-1/+1
| | | | hashv is unsigned, no need to check if >= 0
* build: enable -Wimplicit-fallthroughChristoph Reiter2018-07-291-1/+1
| | | | and fix a missplaced break
* build: enable -WshadowChristoph Reiter2018-07-294-24/+25
|
* build: enable -Wcast-function-typeChristoph Reiter2018-07-292-2/+2
| | | | | | | | Where it's easy add dummy args to match the cast; where the target is a subset just prevent the warning with a cast to void*. Provide a real copy function for the boxed type code in regress_foo. This code is never executed afaics, but why not.
* build: enable -Wsuggest-attribute=formatChristoph Reiter2018-07-291-0/+3
| | | | And use G_GNUC_PRINTF for the suggested function.
* build: enable -Wdouble-promotionChristoph Reiter2018-07-291-1/+1
|
* build: enable -Wincompatible-pointer-typesChristoph Reiter2018-07-291-1/+1
|
* build: enable -Wdiscarded-qualifiersChristoph Reiter2018-07-292-2/+2
| | | | | Except for the Python module because nothing in the CPython API is marked const and we'd have to cast everywhere.
* gdump: Fix print-format error while GFlagsValue->value is an unsigned intRico Tzschichholz2018-07-041-1/+1
|
* girepository: Properly acquire and check pointer valuesChun-wei Fan2018-04-202-4/+4
| | | | | | | | | | | | | | | | | | | | | On Windows (Visual Studio at least), unsigned longs are always 4 bytes, on both 32-bit and x64 Windows, so we cannot use unsigned longs to deal with pointers on 64-bit builds, as pointers are 8 bytes on 64-bit Windows, which may well render the pointer (which we acquired from libffi) invalid. This will fix crashes in PyGObject which are manifested when launching the cairo-demo example sript (intermittent) and when clicking on "Interactive Dialog" button in the Dialog demo in the PyGObject GTK+ Code demos before entering anything in Entry 1 and Entry 2, when running on x64 Visual Studio builds of the GTK+/PyGObject stack. Also use size_t instead of unsigned long in gthash.c when we check that memory & 0x3 is 0, to silence compiler warnings from enabling /Wp64, which is used to detect portability problems on Visual Studio when doing x86->x64 code builds. https://bugzilla.gnome.org/show_bug.cgi?id=702788
* g-ir-scanner: Don't require SRCDIR and BUILDDIR env varsNirbheek Chauhan2018-03-101-2/+6
| | | | | | | | | | | | | When building with Meson, we cannot set environment variables while running custom targets and our builddir layout is different from Autotools anyway. Now g-ir-scanner and friends can autodetect when they're being run uninstalled by Meson and will find _giscanner.so and the giscanner python files in the build directory. This is very similar to what gdbus-codegen uses in glib/gio. Same for girepository/gdump.c.
* meson: Use glib_dep and configinc for girepositoryNirbheek Chauhan2018-03-102-17/+12
| | | | | | glib_dep is what is actually needed to #include <glib.h>, not gobject_dep. It works incidentally with system gobject/glib but not when built via subprojects.
* Initial work on meson portPatrick Griffis2018-03-102-0/+213
|
* docs: Mention GI_TYPELIB_PATHEmmanuele Bassi2018-01-301-2/+14
| | | | | | | The rules for searching typelib files should be properly documented, as well as the way to modify the search paths. https://bugzilla.gnome.org/show_bug.cgi?id=699328
* Skip unused generic marshallerEmmanuele Bassi2018-01-301-1/+1
| | | | You typically want to use the version in GObject, not this one.
* Remove unnecessary transfer annotationEmmanuele Bassi2018-01-301-1/+1
| | | | Integers do not need a transfer annotation.
* Increase MAX_NAME_LENLeslie Giles2017-12-191-1/+1
| | | | | | | | | | | | | | There is no real limit on the length of an identifier, and some toolchains easily hit the current limit of 200 characters. According to this answer on StackOverflow, 2048 seems to be the limit on MSVC and ICC: https://stackoverflow.com/questions/6007568/what-is-max-length-for-an-c-c-identifier-on-common-build-systems So let's use that. https://bugzilla.gnome.org/show_bug.cgi?id=764791
* girepository: Don't skip g_irepository_get_option_group()Patrick Griffis2017-10-221-1/+1
| | | | | | This function works fine via introspection https://bugzilla.gnome.org/show_bug.cgi?id=786665
* Use locale-independent functions to parse numbersEmmanuele Bassi2017-09-241-3/+3
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=788087
* docs: manifest typelib format portabilityNicola Fontana2017-09-101-0/+3
| | | | | | | Apart the endianness of its scalar values the typelib binary format must be considered arch-independent: make it clear in the docs. https://bugzilla.gnome.org/show_bug.cgi?id=764116
* girepository: Annotate array and array-length parameterRico Tzschichholz2016-12-103-6/+6
|
* girepository: Annotate iterator arguments as (inout)Rico Tzschichholz2016-09-152-2/+2
|