| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
It's not used in GTK 4.
|
|
|
|
| |
Those methods require a Gdk.ContentFormats object.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
An attempt to pass a Path object as a filename results in a TypeError:
"Must be bytes, not PosixPath". A simple way to accept Path objects
would be unconditionally turning them into strings, but since native
paths may be bytes as well, this might break applications relying on
being able to bytes-based filename. Instead, convert the path into an
appropriate representation (string or bytes) using os.fspath(). It
internally tests whether the path is a PathLike object and does the
right thing.
Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk>
|
|
|
|
|
|
| |
In theory it should no longer be needed, but PyPy hasn't
updated this part of their implementation yet, and not initing
threads will lead to crashes due to missing GIL init.
|
|
|
|
|
|
|
|
|
|
| |
If C code calls g_object_new() for a GInitiallyUnowned subclass
implemented in python, the expectation is to receive a floating
reference.
The solution is used is the same picked for
5efe2e5c8458d9f4d72329ea1209d96b5ebecfb4, this is simply a special
case that was omitted at the time.
|
| |
|
| |
|
|
|
|
|
|
| |
If gobject-introspection adds a new scope that we do not handle, we
should definitely not error out. Printing out a critical warning and
asking to file an issue should be enough.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Python 3.10, the code raised an ImportWarning:
ImportWarning: DynamicImporter.find_spec() not found; falling back to find_module()
See https://docs.python.org/3.10/whatsnew/3.10.html#deprecated
> Starting in this release, there will be a concerted effort to begin cleaning
> up old import semantics that were kept for Python 2.7 compatibility.
> Specifically, find_loader()/find_module() (superseded by find_spec()),
> load_module() (superseded by exec_module()), module_repr()
> (which the import system takes care of for you),
> the __package__ attribute (superseded by __spec__.parent),
> the __loader__ attribute (superseded by __spec__.loader),
> and the __cached__ attribute (superseded by __spec__.cached)
> will slowly be removed (as well as other classes and methods in importlib).
> ImportWarning and/or DeprecationWarning will be raised as appropriate to help
> identify code which needs updating during this transition.
Fixes https://gitlab.gnome.org/GNOME/pygobject/-/issues/473
|
|
|
|
|
|
|
|
| |
It got renamed in gtk 4.1.0, see https://gitlab.gnome.org/GNOME/gtk/-/commit/a1216599ff6b39bca3e936fbf
To avoid an API break and make porting easier provide both versions for
all users.
Fixes #467
|
|
|
|
|
|
| |
Found by Coverity.
https://bugzilla.redhat.com/show_bug.cgi?id=1938851
|
|
|
|
|
|
|
|
|
|
| |
Up until now this raised an exception "This method is currently unsupported.".
With Gtk.Widget.destroy() gone in gtk4 and that method often being used to remove
references to other objects and breaking cycles this is the next best thing
on a lower level and should make porting a bit easier.
Fixes #470
|
|
|
|
|
|
|
|
|
|
|
|
| |
In a4880dbc4575fadc0e3 a special case for partial() was added to handle gtk4 template
callbacks. This in turn broken normal usage of partial objects.
To work around that add a special marker in the gtk template code for now until
we find a better fix.
Also adds a test so this doesn't happen again.
Fixes #464
|
|
|
|
|
|
|
|
|
| |
This is a follow of the previous commit which fixes template support
in GTK4 by adding GtkBuilerScope. It is extended to support a scope
object (it can be a python object or a dictionnary). This scope object
is used to define the scope the builder should operate in. A new
GtkBuilder constructor is introduced to be able to define this scope
object.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Gtk.Widget.set_connect_func() does not exist anymore and signals are
automatically connected. Instead, a GtkBuilderScope needs to be used
to create GtkBuilder's closure functions.
pygobject closure support is extended to support
functools.partial. This is used to create a GtkBuilder closure
function with an object different from the current object.
See MR https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1204 and
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1230
Closes: #380
|
|
|
|
|
|
|
|
|
|
| |
This function use CompareDataFunc which works with pointers and
doesn't know anything about GObjects.
The same logic as in Gio.List.sort and Gio.List.insert_sorted is
used.
An associated unit_test is also added.
|
|
|
|
|
|
|
|
|
|
| |
GTK4 removed the Gtk.Container interface, and added API on Gtk.Widget
to iterate over children instead.
Making Widgets iterable allows to easily loop over the children and
check is a widget is a child of an other one.
A new test is also added.
|
|
|
|
|
|
| |
Basically everything where we hav a transition path that works for
both gtk3 and 4. We'll need to add new deprecation warnings for gtk3
once things have settled down.
|
| |
|
|
|
|
| |
skip template/builder tests for now as they require larger changes
|
|
|
|
| |
pack1/2 are gone
|
| |
|
| |
|
|
|
|
|
| |
We don't need to override anything, once we drop the deprecated
compatibility layer for pygtk.
|
|
|
|
|
| |
Drop all the deprecated compatibility layer for pygtk, and the
inheritance from GtkContainer.
|
|
|
|
| |
The Container class does not exist any more.
|
|
|
|
| |
Similar to what the Gdk.py overrides do.
|
|
|
|
|
|
| |
Py_TYPE was changed to a function in Python 3.10. Suggested approach is
to use Py_SET_TYPE macro instead, see:
https://docs.python.org/3.10/whatsnew/3.10.html.
|
| |
|
|
|
|
|
|
|
| |
PyUnicode_GET_SIZE() is deprecated and actually wrong in case wchar_t
is not 4 bytes and high code points, use PyUnicode_GET_LENGTH() instead.
Fixes a deprecation warning with Python 3.9
|
|
|
|
|
|
| |
The GIL is now created by Python at initialization time no matter what.
PyEval_InitThreads() triggers a deprecation warning and will be removed in
3.10 so don't use it with 3.9+.
|
|
|
|
| |
So user have more control on whether to build it or not
|
|
|
|
|
|
|
| |
override is there
Also make it conditional on the Gtk.Widget method existing since that was only
added with gtk 3.20 and we support 3.18+.
|
|
|
|
|
|
|
|
| |
Fixes #371. Gtk.Button.set_focus_on_click and Gtk.Button.get_focus_on_click
are deprecated since version 3.20. This override calls the Gtk.Widget methods
so that users don't get a deprecation message.
Signed-off-by: Dan Yeaw <dan@yeaw.me>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
init_template method is automatically called when a widget is
created and it is not supposed to be called multiple times. That is
why this method is turned into a no-op after its first call via a
lambda function.
init_template can still be called after a widget creation (and it is
supposed to do nothing). However, a second call will result in a crash
because the lambda function has a parameter while init_template is not
supposed to have any parameter.
This issue is fixed by removing the parameter of the lambda function.
A new test is also added to assert that a second init_template call
does nothing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a widget is inside a template it is created through a
g_object_new and does not have a python wrapper when
pygobject__g_instance_init is called. In that case, a wrapper is
created and the "__init__" method is called to instantiate it. Then,
"init_template" is called to init its own template (if it exists).
However, "init_template" needs to be called before the object
constructor in order to create and instantiate all its children,
signals and properties.
This issue is fixed by calling init_template before the contructor if
the python object has been created through g_object_new.
A new test for the template hierarchy is added (based on an example
from Marinus Schraal).
Closes: #257, #386
|
| |
|
|
|
|
| |
This is a leftover from when things were split up
|
|
|
|
| |
Less macro magic
|
|
|
|
| |
Less macro magic
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
TreeModel.sort_new_with_model exist
In https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1134 the method was changed to a constructor
which means the API is different between older and newer gtk.
Add fallbacks for both in our overrides so both ways work all the time.
|
|
|
|
|
|
|
| |
It has been removed (gtk commit
4dd780a96b1d37903ab88a4ae4536329cd9e164e)
The associated tests are updated or skipped for Gtk 4.
|
|
|
|
|
|
|
| |
It has been removed (gtk commit
44e153d8a8679633681dd3ae2029735255e4f839).
The associated test is removed.
|
|
|
|
| |
These API's have been removed (gtk commit 7ee5779efcf5).
|
|
|
|
| |
This issue was introduced in a102f046a178472278522e3e9d7c0b40ecd52ade.
|
|
|
|
|
|
|
|
| |
This makes it easier to track upstream changes without us having to
rebuild docker images.
Downside is that we don't control it and API is still changing,
so allow the job to fail.
|