summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove PyGObjectWeakRef now that g_binding_unbind existsSimon Feltman2013-10-143-75/+44
| | | | | | | Remove the static code for managing GBinding weak references now that GLib has a method (unbind) for clearing out bindings. https://bugzilla.gnome.org/show_bug.cgi?id=699571
* Fix GArray, GList, GSList, and GHashTable marshaling leaksSimon Feltman2013-10-142-47/+84
| | | | | | | | | | | Remove calling of cleanup code for transfer-everything modes by ensuring cleanup_data is set to NULL in from_py marshalers. Use array and hash table ref/unref functions for container transfer mode to ensure we have a valid container ref after invoke and during from_py cleanup of contents. Rework restrictions with to_py marshaling cleanup so we always unref the container for transfer-everything and transfer-container modes. https://bugzilla.gnome.org/show_bug.cgi?id=693402
* Add cleanup_data argument used for Python to C marshaler cleanupSimon Feltman2013-10-147-105/+177
| | | | | | | | | | | | | | | | | Add a new output argument to all from_py marshalers which is used for keeping track of marshaling data that later needs cleanup. Previously most marshalers would rely on the GIArgument->v_pointer as the means for data cleanup. However, this pointer would get clobbered in the case of bi-directional arguments (inout) and the memory lost. Use the new cleanup_data for storing temporarily wrapped C arrays so we don't need to re-calculate the length argument during cleanup. Additionally delay the from_py marshaling cleanup function until after _invoke_marshal_out_args is called. This gives inout arguments which don't modify the pointer sufficient time to exist until they marshaled back to Python (gi_marshalling_tests_gvalue_inout). https://bugzilla.gnome.org/show_bug.cgi?id=693402
* Add support for variable user data argumentsSimon Feltman2013-10-149-89/+177
| | | | | | | | | | | Support a variable number of user data arguments for all callback connection function where the user data is the last explicit argument. This adds convience as well as consistency with the rest of PyGObject. Cleanup overrides for GLib.idle_add, timeout_add, timeout_add_seconds, io_add_watch, and child_watch_add which manually implemented this feature. https://bugzilla.gnome.org/show_bug.cgi?id=640812
* Bump glib and g-i dependencies to latest stable.Martin Pitt2013-10-143-6/+5
| | | | | | | glib 2.38 and g-i 1.38 are from stable GNOME 3.10 which we now assume as minimal version. Drop @unittest.skipUnless tags from tests which didn't work with g-i 1.36.
* Fix TypeError when setting drag target_list to NoneNuno Araujo2013-10-142-2/+4
| | | | | | | | | | | | | | | | When calling Widget.drag_dest_set_target_list(None) or Widget.drag_source_set_target_list(None) a "TypeError: 'NoneType' object is not iterable" is thrown. According to Gtk documentation [1] [2], this shouldn't be the case since client code should be able to pass NULL in calls made to gtk_drag_dest_set_target_list and gtk_drag_source_set_target_list. We now check if the target_list is None and do not try to create a TargetList if it is the case. [1] https://developer.gnome.org/gtk3/3.10/gtk3-Drag-and-Drop.html#gtk-drag-dest-set-target-list [2] https://developer.gnome.org/gtk3/3.10/gtk3-Drag-and-Drop.html#gtk-drag-source-set-target-list https://bugzilla.gnome.org/show_bug.cgi?id=709926
* Use qdata for wrapper retrieval in toggle reference notificationsSimon Feltman2013-10-101-7/+14
| | | | | | | | | | | | Replace usage of user data holding PyGObject wrappers in toggle ref notifications with GObject qdata retrieval. This fixes thread safety issues where a toggle notify may be called from another thread during the PyGObject wrappers dealloc. In this case the toggle notify is blocked because the GIL is held in dealloc, and when it continues, the user data would be holding an invalid PyGObject wrapper. Using qdata solves this by ensuring the wrapper retrieval is done within the safety of the GIL and may turn up as NULL. https://bugzilla.gnome.org/show_bug.cgi?id=709223
* Add expected failure to deal with fixes in gimarshallingtests.cSimon Feltman2013-10-101-1/+5
| | | | | | | Fix test_object_full_inout based on newer gimarshallingtests.c > 1.38.0. Add expectedFailure to deal with previous versions of gimarshallingtests.c. https://bugzilla.gnome.org/show_bug.cgi?id=709796
* Fix memory leaks for inout array argumentsSimon Feltman2013-10-083-4/+11
| | | | | | | | Add tracking for array allocations to from_py marashalers in the argument states extra data (arg_data). This is then used later for inout marshaling cleanup to call the array cleanup function. https://bugzilla.gnome.org/show_bug.cgi?id=693402
* Fix to Python marshaling leaks for arrays holding GVariantsSimon Feltman2013-10-071-16/+18
| | | | | | | | | | | | Add early check for array items holding pointers and simply assign the pointer to GIArgument.v_pointer prior giving it to the per-item marshaler. This simplifies marshaling and fixes leaks regarding arrays of GVariants by removing the unneeded g_variant_ref_sink (variants are always pointers). Conditionalize the use of g_variant_ref_sink based on transfer mode in the per-item marshaler. This fixes a reference leak where we are given ownership of the variant (transfer full) but added a new ref anyway. https://bugzilla.gnome.org/show_bug.cgi?id=693402
* Cleanup per-item array marshaling code for flat arraysSimon Feltman2013-10-072-48/+71
| | | | | | | | | | | Add an early per-item check which tests if the item being marshaled is a pointer and simply copies the pointer into the array. This takes care of the GdkAtom and GVariant special cases because these items are always reported as pointers. Fix error condition cleanup code when an item fails marshaling in the middle of an array. https://bugzilla.gnome.org/show_bug.cgi?id=693402
* Fix GValue array marshaling leaks and crash falloutSimon Feltman2013-10-076-9/+78
| | | | | | | | | | | | | * Decrement references for results of PySequence_GetItem. There were a few places we were not decrementing the Python reference, leaking the value. * Add tracking of Python arguments with recursive marshaling cleanup. This allows arrays of GValues which have been coerced from Python types to be properly free'd (also fixes bug 703662). * Use g_variant_ref for variant arguments marked as transfer everything. This fixes double free's caused by the decrementing of PySequence_GetItem results. https://bugzilla.gnome.org/show_bug.cgi?id=693402
* Refactor GLib.io_add_watch to make it more testableSimon Feltman2013-10-071-5/+18
| | | | | | | | | | Break the argument munging code into a separate function which can be tested in isolation of adding an io watch. Add additional failing test which specifies all args as keywords which we eventually need to support for consistency with the rest of PyGObject. https://bugzilla.gnome.org/show_bug.cgi?id=640812
* Refactor GLib.child_watch_add to make it more testableSimon Feltman2013-10-072-57/+56
| | | | | | | | | | Break the argument munging code into a separate function which can be tested in isolation of adding a child watch. Update tests to reflect this. Add additional failing test which specify all args as keywords which we eventually need to support for consistency with the rest of PyGObject. https://bugzilla.gnome.org/show_bug.cgi?id=640812
* Don't pass None to callbacks when user data is not specifiedSimon Feltman2013-10-073-13/+16
| | | | | | | | For APIs which support a callback and optional user data, don't pass the user data to the callback if it was not explicitly specified when the callback was connected. https://bugzilla.gnome.org/show_bug.cgi?id=640812
* Add missing methods on PyGIBaseInfo and sub-classesSimon Feltman2013-10-073-8/+677
| | | | | | Expose all methods of GIBaseBase info and its sub-classes. https://bugzilla.gnome.org/show_bug.cgi?id=709008
* Expose all GI enum and flags typesSimon Feltman2013-10-073-15/+158
| | | | | | | | | | Add new types for GIDirection, GITransfer, GIArrayType, GIScopeType, GIVFuncInfoFlags, GIFieldInfoFlags, GIFuncitonInfoFlags, GITypeTag, and GInfoType. These types are found in the gi._gi module exposed without the "GI" prefix and contain all of their values as class attributes. e.g. gi._gi.Transfer.EVERYTHING. https://bugzilla.gnome.org/show_bug.cgi?id=709008
* Avoid calling g_base_info_get_name on GI_INFO_TYPE_TYPESimon Feltman2013-10-071-10/+25
| | | | | | | | | Calling g_base_info_get_name on infos tagged with GI_INFO_TYPE_TYPE will cause a crash. Avoid this by adding _safe_base_info_get_name and using that throughout the bindings. Logged GI bug as: https://bugzilla.gnome.org/show_bug.cgi?id=709456 https://bugzilla.gnome.org/show_bug.cgi?id=709008
* Add GIBaseInfo.equal methodSimon Feltman2013-10-072-8/+25
| | | | | | | | Break PyGIBaseInfo rich compare into two methods: equal and richcompare. Equal is a direct exposure of the GI method and richcompare makes use of this with additional support for Pyton "==" and "!=" operators. https://bugzilla.gnome.org/show_bug.cgi?id=709008
* Move info string retrieval into generic functionSimon Feltman2013-10-071-2/+13
| | | | | | | Add get_info_string for sharing binding of simple string retrieval on GIBaseInfo objects. https://bugzilla.gnome.org/show_bug.cgi?id=709008
* Move child info retrieval into generic functionSimon Feltman2013-10-071-33/+23
| | | | | | | | | Add a generic function for bindings which return a single child info. This trivializes binding methods like PyGIObjectInfo.get_parent and fixes leaks in PyGIObjectInfo.get_class_struct and PyGIVFuncInfo.get_invoker. https://bugzilla.gnome.org/show_bug.cgi?id=709008
* Move info tuple retrieval into generic functionSimon Feltman2013-10-071-410/+59
| | | | | | | | Create new generic function for retrieving a tuple of child infos. This greatly simplifies all the bindings which return tuples from a common pattern of functions on GIBaseInfo based instances. https://bugzilla.gnome.org/show_bug.cgi?id=709008
* tests: Update check.valgrind with always-malloc and add logging optionsSimon Feltman2013-10-063-1/+16
| | | | | | | | Based on notes in https://wiki.gnome.org/Valgrind we need to use always-malloc for valgrind runs. Add check.valgrindlog and check.valgrindxml which output valgrind logs into an ignored local tmp. Output logs are named <head-sha>-$TEST_NAMES.log so we can track commits and use diff tools on the logs.
* Move existing repository tests into test_repositorySimon Feltman2013-10-042-38/+28
| | | | | | | Move flags and enum double registration tests into test_repository.py. Remove duplicate ObjectInfo tests from test_gi.py. https://bugzilla.gnome.org/show_bug.cgi?id=709008
* Add unittests for GIRepositorySimon Feltman2013-10-042-0/+171
| | | | | | | Add basic unittests for the existing classes and methods exposed for the GIRepository module (gi._gi). https://bugzilla.gnome.org/show_bug.cgi?id=709008
* Derive SignalInfo info from CallableInfoSimon Feltman2013-10-041-3/+4
| | | | | | | | Change Python class derivation of PyGISignalInfo to use PyGICallableInfo as the base class. This accurately reflects the GI class layout and provides the callable information for signals. https://bugzilla.gnome.org/show_bug.cgi?id=709008
* Use PYGLIB_PyLong_FromLong for GIDirection returnSimon Feltman2013-10-041-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=709008
* Fix memory leak for caller allocated GValue out argumentsSimon Feltman2013-10-031-5/+6
| | | | | | | | | | | Swizzle the order of type checks in _cleanup_caller_allocates so G_TYPE_VALUE arguments are checked before G_TYPE_BOXED. The ordering is important because G_TYPE_VALUE is a sub-type of boxed and so its specialized cleanup code was never being called (g_value_unset). Additionally update check to use g_type_is_a instead of a compare to handle the potential case of a G_TYPE_VALUE sub-type. https://bugzilla.gnome.org/show_bug.cgi?id=709397
* Add support for default arguments annotated with allow-noneSimon Feltman2013-09-268-49/+162
| | | | | | | | | | | | Support default value of NULL for tail end arguments which are marked with allow-none. The implementation uses a place holder object for un-supplied arguments which are annotated with allow-none. This is then used later during marshaling to supply NULL as the default. Additionally support an implicit default for callback user_data using the same technique. https://bugzilla.gnome.org/show_bug.cgi?id=640812
* cache refactoring: Move arg cache field assignments into _arg_cache_newSimon Feltman2013-09-261-12/+11
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=640812
* cache refactoring: Cleanup array length argument marshalingSimon Feltman2013-09-262-79/+71
| | | | | | | | | | Add shared function: _arg_cache_array_len_arg_setup for use with both to and from array marshaling setup. This function consolidates all of the edge cases regarding array length setup and removes the need for flagging arguments with PYGI_META_ARG_TYPE_CHILD_NEEDS_UPDATE. https://bugzilla.gnome.org/show_bug.cgi?id=640812
* cache refactoring: Move variable declarations to blocks where they are usedSimon Feltman2013-09-261-11/+14
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=640812
* cache refactoring: Remove continue statements from _args_cache_generateSimon Feltman2013-09-261-65/+61
| | | | | | | | Remove continue and goto statements from the large loop within _args_cache_generate. This simplifies the sharing of parts of the loop for future refactoring. https://bugzilla.gnome.org/show_bug.cgi?id=640812
* cache refactoring: Use bit field for PyGIDirection instead of enumSimon Feltman2013-09-262-35/+35
| | | | | | | | | This supports cleaner logic when testing the direction of arguments due to the majority of these tests being along the lines of: (direction == FROM_PYTHON || direction == BIDIRECTIONAL) Which is replaced with: (direction & FROM_PYTHON) https://bugzilla.gnome.org/show_bug.cgi?id=640812
* cache refactoring: Remove special case marshaling for instance argumentsSimon Feltman2013-09-264-107/+16
| | | | | | | | | | | Remove duplicate code for marshaling struct and objects for instance arguments. Re-use individual cache marshalers for structs and objects with the instance argument. This required removal of passing GITypeInfo to the marshaler because it is not available for instance arguments. Instead always assume "is_pointer" for the instance argument by using the cache. https://bugzilla.gnome.org/show_bug.cgi?id=640812
* cache refactoring: Use GPtrArray for callable arg cacheSimon Feltman2013-09-256-52/+62
| | | | | | | | Replace manual management of the C array holding individual argument caches with usage of GPtrArray. This provides storage of the array length along with item memory management. https://bugzilla.gnome.org/show_bug.cgi?id=640812
* cache refactoring: Move PyGI direction code into new functionSimon Feltman2013-09-251-21/+21
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=640812
* cache refactoring: Add comments to callable cache structureSimon Feltman2013-09-251-1/+12
| | | | | | Add comments to count fields on _PyGICallableCache. https://bugzilla.gnome.org/show_bug.cgi?id=640812
* Remove support for allowing PyObjects as void pointersSimon Feltman2013-09-253-30/+9
| | | | | | | | | Final removal of marshaling Python object addresses as void pointers. This ensures we can successfully pass integer values as the pointer without the Python object leaking or crashing due to invalid memory. https://bugzilla.gnome.org/show_bug.cgi?id=688081
* configure.ac: bump trunk to 3.11.1Simon Feltman2013-09-251-1/+1
|
* configure.ac: post-release bump to 3.10.1Simon Feltman2013-09-231-1/+1
|
* release 3.10.03.10.0Simon Feltman2013-09-232-2/+5
|
* Fix test_gi.TestProjectVersion.test_version_str()Martin Pitt2013-09-231-1/+1
| | | | | In this test case we only do a string comparison, not a proper "by version component" numerical one. So relax the test to also work with 3.10.
* release 3.9.923.9.92Martin Pitt2013-09-161-0/+7
|
* Update current maintainers list in READMESimon Feltman2013-09-161-1/+2
|
* Fix union argument regression when marshaling from pythonSimon Feltman2013-09-161-24/+29
| | | | | | | | | | Check for union members when marshaling boxed types from Python. This is a regression caused by stricter type checking added when merging code from pygi-argument.c. Re-add pyg_boxed_check to the same bit of code in addition to __gtype__ checking to avoid a double regression. https://bugzilla.gnome.org/show_bug.cgi?id=703873
* Fix GLib.Source sub-classing with initializer argsSimon Feltman2013-09-112-1/+12
| | | | | | | Add variable args and keyword args to the GLib.Source.__new__ method to support sub-classes which want to implement __init__. https://bugzilla.gnome.org/show_bug.cgi?id=707904
* Copy __doc__ when wrapping functionVratislav Podzimek2013-09-051-0/+1
| | | | | Signed-off-by: Vratislav Podzimek <vpodzime@redhat.com> Signed-off-by: Martin Pitt <martinpitt@gnome.org>
* configure.ac: post-release bump to 3.9.92Martin Pitt2013-09-021-1/+1
|
* release 3.9.913.9.91Martin Pitt2013-09-021-0/+10
|