From cca66b9ec4e494c1d919bff0f71a820d8afab1fa Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:24:48 +0200 Subject: Adding upstream version 1.2.2. Signed-off-by: Daniel Baumann --- share/extensions/inkex/gui/__init__.py | 50 ++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 share/extensions/inkex/gui/__init__.py (limited to 'share/extensions/inkex/gui/__init__.py') diff --git a/share/extensions/inkex/gui/__init__.py b/share/extensions/inkex/gui/__init__.py new file mode 100644 index 0000000..27e1b0b --- /dev/null +++ b/share/extensions/inkex/gui/__init__.py @@ -0,0 +1,50 @@ +# +# Copyright 2011-2022 Martin Owens +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# +# pylint: disable=wrong-import-position +""" +This a wrapper layer to make interacting with Gtk a little less painful. +The main issues with Gtk is that it expects an aweful lot of the developer, +code which is repeated over and over and patterns which every single developer +will use are not given easy to use convience functions. + +This makes Gtk programming WET, unattractive and error prone. This module steps +inbetween and adds in all those missing bits. It's not meant to replace Gtk and +certainly it's possible to use Gtk and threading directly. + +.. versionadded:: 1.2 +""" + +import threading +import os +import logging + +from ..utils import DependencyError + +try: + import gi + + gi.require_version("Gtk", "3.0") +except ImportError: # pragma: no cover + raise DependencyError( + "You are missing the required libraries for Gtk." + " Please report this problem to the Inkscape developers." + ) + +from .app import GtkApp +from .window import Window, ChildWindow, FakeWidget +from .listview import TreeView, IconView, ViewColumn, ViewSort, Separator +from .pixmap import PixmapManager -- cgit v1.2.3