| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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 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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Expose all methods of GIBaseBase info and its sub-classes.
https://bugzilla.gnome.org/show_bug.cgi?id=709008
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Add get_info_string for sharing binding of simple string retrieval on
GIBaseInfo objects.
https://bugzilla.gnome.org/show_bug.cgi?id=709008
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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 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 basic unittests for the existing classes and methods exposed for
the GIRepository module (gi._gi).
https://bugzilla.gnome.org/show_bug.cgi?id=709008
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=709008
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=640812
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=640812
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=640812
|
|
|
|
|
|
| |
Add comments to count fields on _PyGICallableCache.
https://bugzilla.gnome.org/show_bug.cgi?id=640812
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
Signed-off-by: Vratislav Podzimek <vpodzime@redhat.com>
Signed-off-by: Martin Pitt <martinpitt@gnome.org>
|
| |
|
| |
|