diff --git a/.gitignore b/.gitignore index ca258be..e63dfee 100644 --- a/.gitignore +++ b/.gitignore @@ -70,3 +70,4 @@ gedit-plugins-2.31.1.tar.bz2 /gedit-plugins-3.38.0.tar.xz /gedit-plugins-3.38.1.tar.xz /gedit-plugins-40.0.tar.xz +/gedit-plugins-40.1.tar.xz diff --git a/gedit-plugins.spec b/gedit-plugins.spec index 6e47235..677f3ad 100644 --- a/gedit-plugins.spec +++ b/gedit-plugins.spec @@ -4,17 +4,14 @@ %global tarball_version %%(echo %{version} | tr '~' '.') Name: gedit-plugins -Version: 40.0 -Release: 4%{?dist} +Version: 40.1 +Release: 1%{?dist} Summary: Plugins for gedit License: GPLv2+ URL: https://wiki.gnome.org/Apps/Gedit Source0: https://download.gnome.org/sources/%{name}/40/%{name}-%{tarball_version}.tar.xz -# Backported from upstream -Patch0: remove-tepl.patch - BuildRequires: atk-devel BuildRequires: cairo-devel BuildRequires: gedit-devel @@ -347,6 +344,9 @@ The gedit wordcompletion plugin. %{_datadir}/metainfo/gedit-wordcompletion.metainfo.xml %changelog +* Wed May 05 2021 Kalev Lember - 40.1-1 +- Update to 40.1 + * Tue May 04 2021 Ray Strode - 40.0-4 - Rebuild Related: #1951302 diff --git a/remove-tepl.patch b/remove-tepl.patch deleted file mode 100644 index 69db7a9..0000000 --- a/remove-tepl.patch +++ /dev/null @@ -1,1011 +0,0 @@ -From 2046d92f85cf495ae4f66795b87f8435d3f591b0 Mon Sep 17 00:00:00 2001 -From: Jordan Petridis -Date: Sat, 10 Apr 2021 03:58:21 +0300 -Subject: [PATCH 1/2] Revert "drawspaces: new implementation based on - TeplSpaceDrawerPrefs" - -This reverts commit 2060f8a6a416653791d26352cf012b4c9e9ee9bb. ---- - .../drawspaces.plugin.desktop.in.in | 4 +- - .../gedit-drawspaces-app-activatable.c | 293 ++++++++++++++++-- - .../gedit-drawspaces-app-activatable.h | 32 +- - .../gedit-drawspaces-configurable.ui | 175 +++++++++++ - .../gedit-drawspaces-view-activatable.c | 130 ++++++-- - .../gedit-drawspaces-view-activatable.h | 17 +- - .../drawspaces/gedit-drawspaces.gresource.xml | 6 + - plugins/drawspaces/meson.build | 9 + - ...gnome.gedit.plugins.drawspaces.gschema.xml | 26 +- - po/POTFILES.in | 1 + - 10 files changed, 625 insertions(+), 68 deletions(-) - create mode 100644 plugins/drawspaces/gedit-drawspaces-configurable.ui - create mode 100644 plugins/drawspaces/gedit-drawspaces.gresource.xml - -diff --git a/plugins/drawspaces/drawspaces.plugin.desktop.in.in b/plugins/drawspaces/drawspaces.plugin.desktop.in.in -index 0c5b584..8374851 100644 ---- a/plugins/drawspaces/drawspaces.plugin.desktop.in.in -+++ b/plugins/drawspaces/drawspaces.plugin.desktop.in.in -@@ -3,7 +3,7 @@ Module=drawspaces - IAge=3 - Name=Draw Spaces - Description=Draw spaces and tabs --Authors=Paolo Borelli ;Steve Frécinaux ;Ignacio Casal Quinteiro ;Sébastien Wilmet --Copyright=Copyright © 2006 Paolo Borelli;Copyright © 2007 Steve Frécinaux;Copyright © 2008 Ignacio Casal Quinteiro;Copyright © 2020 Sébastien Wilmet -+Authors=Paolo Borelli ;Steve Frécinaux ;Ignacio Casal Quinteiro -+Copyright=Copyright © 2006 Paolo Borelli;Copyright © 2007 Steve Frécinaux;Copyright © 2008 Ignacio Casal Quinteiro - Website=http://www.gedit.org - Version=@VERSION@ -diff --git a/plugins/drawspaces/gedit-drawspaces-app-activatable.c b/plugins/drawspaces/gedit-drawspaces-app-activatable.c -index 52f31ea..cb3d302 100644 ---- a/plugins/drawspaces/gedit-drawspaces-app-activatable.c -+++ b/plugins/drawspaces/gedit-drawspaces-app-activatable.c -@@ -1,35 +1,62 @@ - /* - * Copyright (C) 2008-2014 Ignacio Casal Quinteiro -- * Copyright (C) 2020 Sébastien Wilmet - * -- * gedit is free software; you can redistribute it and/or modify -+ * 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 2 of the License, or -- * (at your option) any later version. -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. - * -- * gedit is distributed in the hope that it will be useful, -+ * 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 gedit. If not, see . -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -+#include "config.h" - #include "gedit-drawspaces-app-activatable.h" - #include "gedit-drawspaces-view-activatable.h" --#include --#include - --/* TODO: rename the class to GeditDrawspacesPrefs or something like that, since -- * it no longer implements the GeditAppActivatable interface. -- */ -+#include -+#include -+#include -+#include -+#include -+#include - - typedef struct _GeditDrawspacesAppActivatablePrivate - { -- GSettings *settings; -+ GeditApp *app; - } GeditDrawspacesAppActivatablePrivate; - -+typedef struct _DrawspacesConfigureWidget DrawspacesConfigureWidget; -+ -+struct _DrawspacesConfigureWidget -+{ -+ GSettings *settings; -+ guint flags; -+ -+ GtkWidget *content; -+ -+ GtkWidget *draw_tabs; -+ GtkWidget *draw_spaces; -+ GtkWidget *draw_newline; -+ GtkWidget *draw_nbsp; -+ GtkWidget *draw_leading; -+ GtkWidget *draw_text; -+ GtkWidget *draw_trailing; -+}; -+ -+enum -+{ -+ PROP_0, -+ PROP_APP -+}; -+ -+static void gedit_app_activatable_iface_init (GeditAppActivatableInterface *iface); - static void peas_gtk_configurable_iface_init (PeasGtkConfigurableInterface *iface); - - G_DEFINE_DYNAMIC_TYPE_EXTENDED (GeditDrawspacesAppActivatable, -@@ -37,6 +64,8 @@ G_DEFINE_DYNAMIC_TYPE_EXTENDED (GeditDrawspacesAppActivatable, - G_TYPE_OBJECT, - 0, - G_ADD_PRIVATE_DYNAMIC (GeditDrawspacesAppActivatable) -+ G_IMPLEMENT_INTERFACE_DYNAMIC (GEDIT_TYPE_APP_ACTIVATABLE, -+ gedit_app_activatable_iface_init) - G_IMPLEMENT_INTERFACE_DYNAMIC (PEAS_GTK_TYPE_CONFIGURABLE, - peas_gtk_configurable_iface_init)) - -@@ -46,17 +75,63 @@ gedit_drawspaces_app_activatable_dispose (GObject *object) - GeditDrawspacesAppActivatable *activatable = GEDIT_DRAWSPACES_APP_ACTIVATABLE (object); - GeditDrawspacesAppActivatablePrivate *priv = gedit_drawspaces_app_activatable_get_instance_private (activatable); - -- g_clear_object (&priv->settings); -+ g_clear_object (&priv->app); - - G_OBJECT_CLASS (gedit_drawspaces_app_activatable_parent_class)->dispose (object); - } - -+static void -+gedit_drawspaces_app_activatable_set_property (GObject *object, -+ guint prop_id, -+ const GValue *value, -+ GParamSpec *pspec) -+{ -+ GeditDrawspacesAppActivatable *activatable = GEDIT_DRAWSPACES_APP_ACTIVATABLE (object); -+ GeditDrawspacesAppActivatablePrivate *priv = gedit_drawspaces_app_activatable_get_instance_private (activatable); -+ -+ switch (prop_id) -+ { -+ case PROP_APP: -+ priv->app = GEDIT_APP (g_value_dup_object (value)); -+ break; -+ -+ default: -+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -+ break; -+ } -+} -+ -+static void -+gedit_drawspaces_app_activatable_get_property (GObject *object, -+ guint prop_id, -+ GValue *value, -+ GParamSpec *pspec) -+{ -+ GeditDrawspacesAppActivatable *activatable = GEDIT_DRAWSPACES_APP_ACTIVATABLE (object); -+ GeditDrawspacesAppActivatablePrivate *priv = gedit_drawspaces_app_activatable_get_instance_private (activatable); -+ -+ switch (prop_id) -+ { -+ case PROP_APP: -+ g_value_set_object (value, priv->app); -+ break; -+ -+ default: -+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -+ break; -+ } -+} -+ - static void - gedit_drawspaces_app_activatable_class_init (GeditDrawspacesAppActivatableClass *klass) - { - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - object_class->dispose = gedit_drawspaces_app_activatable_dispose; -+ object_class->set_property = gedit_drawspaces_app_activatable_set_property; -+ object_class->get_property = gedit_drawspaces_app_activatable_get_property; -+ -+ g_object_class_override_property (object_class, PROP_APP, "app"); - } - - static void -@@ -65,29 +140,190 @@ gedit_drawspaces_app_activatable_class_finalize (GeditDrawspacesAppActivatableCl - } - - static void --gedit_drawspaces_app_activatable_init (GeditDrawspacesAppActivatable *activatable) -+gedit_drawspaces_app_activatable_init (GeditDrawspacesAppActivatable *self) - { -- GeditDrawspacesAppActivatablePrivate *priv = gedit_drawspaces_app_activatable_get_instance_private (activatable); -+} -+ -+static void -+gedit_drawspaces_app_activatable_activate (GeditAppActivatable *activatable) -+{ -+} -+ -+static void -+gedit_drawspaces_app_activatable_deactivate (GeditAppActivatable *activatable) -+{ -+} -+ -+static void -+gedit_app_activatable_iface_init (GeditAppActivatableInterface *iface) -+{ -+ iface->activate = gedit_drawspaces_app_activatable_activate; -+ iface->deactivate = gedit_drawspaces_app_activatable_deactivate; -+} -+ -+static void -+widget_destroyed (GtkWidget *obj, gpointer widget_pointer) -+{ -+ DrawspacesConfigureWidget *widget = (DrawspacesConfigureWidget *)widget_pointer; -+ -+ gedit_debug (DEBUG_PLUGINS); - -- priv->settings = g_settings_new ("org.gnome.gedit.plugins.drawspaces"); -+ g_object_unref (widget->settings); -+ g_slice_free (DrawspacesConfigureWidget, widget_pointer); -+ -+ gedit_debug_message (DEBUG_PLUGINS, "END"); -+} -+ -+static void -+set_flag (DrawspacesConfigureWidget *widget, guint flag, gboolean active) -+{ -+ widget->flags = active ? widget->flags | flag : widget->flags & ~flag; -+ g_settings_set_flags (widget->settings, -+ SETTINGS_KEY_DRAW_SPACES, -+ widget->flags); -+} -+ -+static void -+on_draw_tabs_toggled (GtkToggleButton *button, -+ DrawspacesConfigureWidget *widget) -+{ -+ set_flag (widget, GEDIT_DRAW_SPACES_TAB, gtk_toggle_button_get_active (button)); -+} -+ -+static void -+on_draw_spaces_toggled (GtkToggleButton *button, -+ DrawspacesConfigureWidget *widget) -+{ -+ set_flag (widget, GEDIT_DRAW_SPACES_SPACE, gtk_toggle_button_get_active (button)); -+} -+ -+static void -+on_draw_newline_toggled (GtkToggleButton *button, -+ DrawspacesConfigureWidget *widget) -+{ -+ set_flag (widget, GEDIT_DRAW_SPACES_NEWLINE, gtk_toggle_button_get_active (button)); -+} -+ -+static void -+on_draw_nbsp_toggled (GtkToggleButton *button, -+ DrawspacesConfigureWidget *widget) -+{ -+ set_flag (widget, GEDIT_DRAW_SPACES_NBSP, gtk_toggle_button_get_active (button)); -+} -+ -+static void -+on_draw_leading_toggled (GtkToggleButton *button, -+ DrawspacesConfigureWidget *widget) -+{ -+ set_flag (widget, GEDIT_DRAW_SPACES_LEADING, gtk_toggle_button_get_active (button)); -+} -+ -+static void -+on_draw_text_toggled (GtkToggleButton *button, -+ DrawspacesConfigureWidget *widget) -+{ -+ set_flag (widget, GEDIT_DRAW_SPACES_TEXT, gtk_toggle_button_get_active (button)); -+} -+ -+static void -+on_draw_trailing_toggled (GtkToggleButton *button, -+ DrawspacesConfigureWidget *widget) -+{ -+ set_flag (widget, GEDIT_DRAW_SPACES_TRAILING, gtk_toggle_button_get_active (button)); -+} -+ -+static DrawspacesConfigureWidget * -+get_configuration_widget (GeditDrawspacesAppActivatable *activatable) -+{ -+ DrawspacesConfigureWidget *widget = NULL; -+ GtkBuilder *builder; -+ -+ gchar *root_objects[] = { -+ "content", -+ NULL -+ }; -+ -+ widget = g_slice_new (DrawspacesConfigureWidget); -+ widget->settings = g_settings_new (DRAWSPACES_SETTINGS_BASE); -+ widget->flags = g_settings_get_flags (widget->settings, -+ SETTINGS_KEY_DRAW_SPACES); -+ -+ builder = gtk_builder_new (); -+ gtk_builder_set_translation_domain (builder, GETTEXT_PACKAGE); -+ gtk_builder_add_objects_from_resource (builder, "/org/gnome/gedit/plugins/drawspaces/ui/gedit-drawspaces-configurable.ui", -+ root_objects, NULL); -+ widget->content = GTK_WIDGET (gtk_builder_get_object (builder, "content")); -+ g_object_ref (widget->content); -+ widget->draw_tabs = GTK_WIDGET (gtk_builder_get_object (builder, "check_button_draw_tabs")); -+ widget->draw_spaces = GTK_WIDGET (gtk_builder_get_object (builder, "check_button_draw_spaces")); -+ widget->draw_newline = GTK_WIDGET (gtk_builder_get_object (builder, "check_button_draw_new_lines")); -+ widget->draw_nbsp = GTK_WIDGET (gtk_builder_get_object (builder, "check_button_draw_nbsp")); -+ widget->draw_leading = GTK_WIDGET (gtk_builder_get_object (builder, "check_button_draw_leading")); -+ widget->draw_text = GTK_WIDGET (gtk_builder_get_object (builder, "check_button_draw_text")); -+ widget->draw_trailing = GTK_WIDGET (gtk_builder_get_object (builder, "check_button_draw_trailing")); -+ g_object_unref (builder); -+ -+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget->draw_tabs), -+ widget->flags & GEDIT_DRAW_SPACES_TAB); -+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget->draw_spaces), -+ widget->flags & GEDIT_DRAW_SPACES_SPACE); -+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget->draw_newline), -+ widget->flags & GEDIT_DRAW_SPACES_NEWLINE); -+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget->draw_nbsp), -+ widget->flags & GEDIT_DRAW_SPACES_NBSP); -+ -+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget->draw_leading), -+ widget->flags & GEDIT_DRAW_SPACES_LEADING); -+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget->draw_text), -+ widget->flags & GEDIT_DRAW_SPACES_TEXT); -+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget->draw_trailing), -+ widget->flags & GEDIT_DRAW_SPACES_TRAILING); -+ -+ g_signal_connect (widget->draw_tabs, -+ "toggled", -+ G_CALLBACK (on_draw_tabs_toggled), -+ widget); -+ g_signal_connect (widget->draw_spaces, -+ "toggled", -+ G_CALLBACK (on_draw_spaces_toggled), -+ widget); -+ g_signal_connect (widget->draw_newline, -+ "toggled", -+ G_CALLBACK (on_draw_newline_toggled), -+ widget); -+ g_signal_connect (widget->draw_nbsp, -+ "toggled", -+ G_CALLBACK (on_draw_nbsp_toggled), -+ widget); -+ g_signal_connect (widget->draw_leading, -+ "toggled", -+ G_CALLBACK (on_draw_leading_toggled), -+ widget); -+ g_signal_connect (widget->draw_text, -+ "toggled", -+ G_CALLBACK (on_draw_text_toggled), -+ widget); -+ g_signal_connect (widget->draw_trailing, -+ "toggled", -+ G_CALLBACK (on_draw_trailing_toggled), -+ widget); -+ -+ g_signal_connect (widget->content, -+ "destroy", -+ G_CALLBACK (widget_destroyed), -+ widget); -+ -+ return widget; - } - - static GtkWidget * - gedit_drawspaces_app_activatable_create_configure_widget (PeasGtkConfigurable *configurable) - { -- GeditDrawspacesAppActivatable *activatable = GEDIT_DRAWSPACES_APP_ACTIVATABLE (configurable); -- GeditDrawspacesAppActivatablePrivate *priv = gedit_drawspaces_app_activatable_get_instance_private (activatable); -- TeplSpaceDrawerPrefs *prefs; -- GtkSourceSpaceDrawer *space_drawer; -+ DrawspacesConfigureWidget *widget; - -- prefs = tepl_space_drawer_prefs_new (); -- space_drawer = tepl_space_drawer_prefs_get_space_drawer (prefs); -- gtk_source_space_drawer_bind_matrix_setting (space_drawer, -- priv->settings, "matrix", -- G_SETTINGS_BIND_DEFAULT | -- G_SETTINGS_BIND_NO_SENSITIVITY); -+ widget = get_configuration_widget (GEDIT_DRAWSPACES_APP_ACTIVATABLE (configurable)); - -- return GTK_WIDGET (prefs); -+ return widget->content; - } - - static void -@@ -102,6 +338,9 @@ peas_register_types (PeasObjectModule *module) - gedit_drawspaces_app_activatable_register_type (G_TYPE_MODULE (module)); - gedit_drawspaces_view_activatable_register (G_TYPE_MODULE (module)); - -+ peas_object_module_register_extension_type (module, -+ GEDIT_TYPE_APP_ACTIVATABLE, -+ GEDIT_TYPE_DRAWSPACES_APP_ACTIVATABLE); - peas_object_module_register_extension_type (module, - PEAS_GTK_TYPE_CONFIGURABLE, - GEDIT_TYPE_DRAWSPACES_APP_ACTIVATABLE); -diff --git a/plugins/drawspaces/gedit-drawspaces-app-activatable.h b/plugins/drawspaces/gedit-drawspaces-app-activatable.h -index f6a80bf..ac93ddc 100644 ---- a/plugins/drawspaces/gedit-drawspaces-app-activatable.h -+++ b/plugins/drawspaces/gedit-drawspaces-app-activatable.h -@@ -1,23 +1,23 @@ - /* - * Copyright (C) 2008-2014 Ignacio Casal Quinteiro -- * Copyright (C) 2020 Sébastien Wilmet - * -- * gedit is free software; you can redistribute it and/or modify -+ * 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 2 of the License, or -- * (at your option) any later version. -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. - * -- * gedit is distributed in the hope that it will be useful, -+ * 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 gedit. If not, see . -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - --#ifndef GEDIT_DRAWSPACES_APP_ACTIVATABLE_H --#define GEDIT_DRAWSPACES_APP_ACTIVATABLE_H -+#ifndef __GEDIT_DRAWSPACES_APP_ACTIVATABLE_H__ -+#define __GEDIT_DRAWSPACES_APP_ACTIVATABLE_H__ - - #include - #include -@@ -26,6 +26,7 @@ G_BEGIN_DECLS - - #define GEDIT_TYPE_DRAWSPACES_APP_ACTIVATABLE (gedit_drawspaces_app_activatable_get_type ()) - #define GEDIT_DRAWSPACES_APP_ACTIVATABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_DRAWSPACES_APP_ACTIVATABLE, GeditDrawspacesAppActivatable)) -+#define GEDIT_DRAWSPACES_APP_ACTIVATABLE_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_DRAWSPACES_APP_ACTIVATABLE, GeditDrawspacesAppActivatable const)) - #define GEDIT_DRAWSPACES_APP_ACTIVATABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_DRAWSPACES_APP_ACTIVATABLE, GeditDrawspacesAppActivatableClass)) - #define GEDIT_IS_DRAWSPACES_APP_ACTIVATABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_DRAWSPACES_APP_ACTIVATABLE)) - #define GEDIT_IS_DRAWSPACES_APP_ACTIVATABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_DRAWSPACES_APP_ACTIVATABLE)) -@@ -44,10 +45,21 @@ struct _GeditDrawspacesAppActivatableClass - GObjectClass parent_class; - }; - --GType gedit_drawspaces_app_activatable_get_type (void); -+enum _GeditDrawSpacesFlags { -+ GEDIT_DRAW_SPACES_SPACE = 1 << 0, -+ GEDIT_DRAW_SPACES_TAB = 1 << 1, -+ GEDIT_DRAW_SPACES_NEWLINE = 1 << 2, -+ GEDIT_DRAW_SPACES_NBSP = 1 << 3, -+ GEDIT_DRAW_SPACES_LEADING = 1 << 4, -+ GEDIT_DRAW_SPACES_TEXT = 1 << 5, -+ GEDIT_DRAW_SPACES_TRAILING = 1 << 6, -+ GEDIT_DRAW_SPACES_ALL = 0x7f -+}; -+ -+GType gedit_drawspaces_app_activatable_get_type (void) G_GNUC_CONST; - - G_MODULE_EXPORT void peas_register_types (PeasObjectModule *module); - - G_END_DECLS - --#endif /* GEDIT_DRAWSPACES_APP_ACTIVATABLE_H */ -+#endif /* __GEDIT_DRAWSPACES_APP_ACTIVATABLE_H__ */ -diff --git a/plugins/drawspaces/gedit-drawspaces-configurable.ui b/plugins/drawspaces/gedit-drawspaces-configurable.ui -new file mode 100644 -index 0000000..52d676d ---- /dev/null -+++ b/plugins/drawspaces/gedit-drawspaces-configurable.ui -@@ -0,0 +1,175 @@ -+ -+ -+ -+ -+ False -+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK -+ 5 -+ center-on-parent -+ dialog -+ -+ -+ True -+ False -+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK -+ vertical -+ 3 -+ -+ -+ True -+ False -+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK -+ end -+ -+ -+ gtk-close -+ True -+ True -+ True -+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK -+ False -+ True -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ False -+ True -+ end -+ 0 -+ -+ -+ -+ -+ True -+ False -+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK -+ 6 -+ vertical -+ 3 -+ -+ -+ Draw spaces -+ True -+ True -+ False -+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK -+ False -+ True -+ -+ -+ False -+ True -+ 0 -+ -+ -+ -+ -+ Draw tabs -+ True -+ True -+ False -+ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK -+ False -+ True -+ -+ -+ False -+ True -+ 1 -+ -+ -+ -+ -+ Draw new lines -+ True -+ True -+ False -+ False -+ True -+ -+ -+ False -+ True -+ 2 -+ -+ -+ -+ -+ Draw non-breaking spaces -+ True -+ True -+ False -+ False -+ True -+ -+ -+ False -+ True -+ 3 -+ -+ -+ -+ -+ Draw leading spaces -+ True -+ True -+ False -+ False -+ True -+ -+ -+ False -+ True -+ 4 -+ -+ -+ -+ -+ Draw spaces in text -+ True -+ True -+ False -+ False -+ True -+ -+ -+ False -+ True -+ 5 -+ -+ -+ -+ -+ Draw trailing spaces -+ True -+ True -+ False -+ False -+ True -+ -+ -+ False -+ True -+ 6 -+ -+ -+ -+ -+ False -+ True -+ 1 -+ -+ -+ -+ -+ -+ button1 -+ -+ -+ -diff --git a/plugins/drawspaces/gedit-drawspaces-view-activatable.c b/plugins/drawspaces/gedit-drawspaces-view-activatable.c -index c6a92b5..c50978d 100644 ---- a/plugins/drawspaces/gedit-drawspaces-view-activatable.c -+++ b/plugins/drawspaces/gedit-drawspaces-view-activatable.c -@@ -1,6 +1,8 @@ - /* -+ * gedit-drawspaces-view-activatable.h -+ * This file is part of gedit -+ * - * Copyright (C) 2008-2014 Ignacio Casal Quinteiro -- * Copyright (C) 2020 Sébastien Wilmet - * - * gedit is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by -@@ -16,7 +18,9 @@ - * along with gedit. If not, see . - */ - -+#include "gedit-drawspaces-app-activatable.h" - #include "gedit-drawspaces-view-activatable.h" -+ - #include - #include - #include -@@ -25,6 +29,9 @@ typedef struct _GeditDrawspacesViewActivatablePrivate - { - GeditView *view; - GSettings *settings; -+ guint flags; -+ -+ guint enable : 1; - } GeditDrawspacesViewActivatablePrivate; - - enum -@@ -50,7 +57,6 @@ gedit_drawspaces_view_activatable_dispose (GObject *object) - GeditDrawspacesViewActivatablePrivate *priv = gedit_drawspaces_view_activatable_get_instance_private (activatable); - - g_clear_object (&priv->view); -- g_clear_object (&priv->settings); - - G_OBJECT_CLASS (gedit_drawspaces_view_activatable_parent_class)->dispose (object); - } -@@ -115,47 +121,133 @@ gedit_drawspaces_view_activatable_class_finalize (GeditDrawspacesViewActivatable - } - - static void --gedit_drawspaces_view_activatable_init (GeditDrawspacesViewActivatable *activatable) -+gedit_drawspaces_view_activatable_init (GeditDrawspacesViewActivatable *self) -+{ -+} -+ -+static void -+get_config_options (GeditDrawspacesViewActivatable *activatable) -+{ -+ GeditDrawspacesViewActivatablePrivate *priv = gedit_drawspaces_view_activatable_get_instance_private (activatable); -+ -+ priv->enable = g_settings_get_boolean (priv->settings, -+ SETTINGS_KEY_SHOW_WHITE_SPACE); -+ -+ priv->flags = g_settings_get_flags (priv->settings, -+ SETTINGS_KEY_DRAW_SPACES); -+} -+ -+static inline void -+parse_flags (guint flags, -+ GtkSourceSpaceTypeFlags *type, -+ GtkSourceSpaceLocationFlags *location) -+{ -+ *type = GTK_SOURCE_SPACE_TYPE_NONE; -+ *location = GTK_SOURCE_SPACE_LOCATION_NONE; -+ -+ if (flags & GEDIT_DRAW_SPACES_SPACE) -+ *type |= GTK_SOURCE_SPACE_TYPE_SPACE; -+ if (flags & GEDIT_DRAW_SPACES_TAB) -+ *type |= GTK_SOURCE_SPACE_TYPE_TAB; -+ if (flags & GEDIT_DRAW_SPACES_NEWLINE) -+ *type |= GTK_SOURCE_SPACE_TYPE_NEWLINE; -+ if (flags & GEDIT_DRAW_SPACES_NBSP) -+ *type |= GTK_SOURCE_SPACE_TYPE_NBSP; -+ -+ if (flags & GEDIT_DRAW_SPACES_LEADING) -+ *location |= GTK_SOURCE_SPACE_LOCATION_LEADING; -+ if (flags & GEDIT_DRAW_SPACES_TEXT) -+ *location |= GTK_SOURCE_SPACE_LOCATION_INSIDE_TEXT; -+ if (flags & GEDIT_DRAW_SPACES_TRAILING) -+ *location |= GTK_SOURCE_SPACE_LOCATION_TRAILING; -+} -+ -+static void -+draw_spaces (GeditDrawspacesViewActivatable *activatable) -+{ -+ GeditDrawspacesViewActivatablePrivate *priv = gedit_drawspaces_view_activatable_get_instance_private (activatable); -+ GtkSourceSpaceDrawer *drawer; -+ GtkSourceSpaceTypeFlags type; -+ GtkSourceSpaceLocationFlags location; -+ -+ parse_flags (priv->flags, &type, &location); -+ -+ drawer = gtk_source_view_get_space_drawer (GTK_SOURCE_VIEW (priv->view)); -+ -+ /* Clear all existing spaces in the matrix before setting */ -+ gtk_source_space_drawer_set_types_for_locations (drawer, GTK_SOURCE_SPACE_LOCATION_ALL, 0); -+ gtk_source_space_drawer_set_types_for_locations (drawer, location, type); -+ gtk_source_space_drawer_set_enable_matrix (drawer, priv->enable); -+} -+ -+static void -+on_draw_spaces_changed (GSettings *settings, -+ const gchar *key, -+ GeditDrawspacesViewActivatable *activatable) - { - GeditDrawspacesViewActivatablePrivate *priv = gedit_drawspaces_view_activatable_get_instance_private (activatable); - -- priv->settings = g_settings_new ("org.gnome.gedit.plugins.drawspaces"); -+ priv->flags = g_settings_get_flags (priv->settings, -+ SETTINGS_KEY_DRAW_SPACES); -+ -+ draw_spaces (activatable); - } - - static void --gedit_drawspaces_view_activatable_activate (GeditViewActivatable *activatable) -+on_show_white_space_changed (GSettings *settings, -+ const gchar *key, -+ GeditDrawspacesViewActivatable *activatable) -+{ -+ GeditDrawspacesViewActivatablePrivate *priv = gedit_drawspaces_view_activatable_get_instance_private (activatable); -+ -+ priv->enable = g_settings_get_boolean (settings, key); -+ -+ draw_spaces (activatable); -+} -+ -+static void -+gedit_drawspaces_view_activatable_window_activate (GeditViewActivatable *activatable) - { - GeditDrawspacesViewActivatablePrivate *priv; -- GtkSourceSpaceDrawer *space_drawer; - - priv = gedit_drawspaces_view_activatable_get_instance_private (GEDIT_DRAWSPACES_VIEW_ACTIVATABLE (activatable)); -+ priv->settings = g_settings_new (DRAWSPACES_SETTINGS_BASE); -+ -+ get_config_options (GEDIT_DRAWSPACES_VIEW_ACTIVATABLE (activatable)); - -- space_drawer = gtk_source_view_get_space_drawer (GTK_SOURCE_VIEW (priv->view)); -- gtk_source_space_drawer_bind_matrix_setting (space_drawer, -- priv->settings, "matrix", -- G_SETTINGS_BIND_GET | -- G_SETTINGS_BIND_NO_SENSITIVITY); -- gtk_source_space_drawer_set_enable_matrix (space_drawer, TRUE); -+ if (priv->enable) -+ { -+ draw_spaces (GEDIT_DRAWSPACES_VIEW_ACTIVATABLE (activatable)); -+ } -+ -+ g_signal_connect (priv->settings, -+ "changed::show-white-space", -+ G_CALLBACK (on_show_white_space_changed), -+ activatable); -+ g_signal_connect (priv->settings, -+ "changed::draw-spaces", -+ G_CALLBACK (on_draw_spaces_changed), -+ activatable); - } - - static void --gedit_drawspaces_view_activatable_deactivate (GeditViewActivatable *activatable) -+gedit_drawspaces_view_activatable_window_deactivate (GeditViewActivatable *activatable) - { - GeditDrawspacesViewActivatablePrivate *priv; -- GtkSourceSpaceDrawer *space_drawer; - - priv = gedit_drawspaces_view_activatable_get_instance_private (GEDIT_DRAWSPACES_VIEW_ACTIVATABLE (activatable)); - -- space_drawer = gtk_source_view_get_space_drawer (GTK_SOURCE_VIEW (priv->view)); -- g_settings_unbind (space_drawer, "matrix"); -- gtk_source_space_drawer_set_enable_matrix (space_drawer, FALSE); -+ priv->enable = FALSE; -+ draw_spaces (GEDIT_DRAWSPACES_VIEW_ACTIVATABLE (activatable)); -+ -+ g_clear_object (&priv->settings); - } - - static void - gedit_view_activatable_iface_init (GeditViewActivatableInterface *iface) - { -- iface->activate = gedit_drawspaces_view_activatable_activate; -- iface->deactivate = gedit_drawspaces_view_activatable_deactivate; -+ iface->activate = gedit_drawspaces_view_activatable_window_activate; -+ iface->deactivate = gedit_drawspaces_view_activatable_window_deactivate; - } - - void -diff --git a/plugins/drawspaces/gedit-drawspaces-view-activatable.h b/plugins/drawspaces/gedit-drawspaces-view-activatable.h -index e4114ce..4968369 100644 ---- a/plugins/drawspaces/gedit-drawspaces-view-activatable.h -+++ b/plugins/drawspaces/gedit-drawspaces-view-activatable.h -@@ -1,6 +1,8 @@ - /* -+ * gedit-drawspaces-view-activatable.h -+ * This file is part of gedit -+ * - * Copyright (C) 2008-2014 Ignacio Casal Quinteiro -- * Copyright (C) 2020 Sébastien Wilmet - * - * gedit is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by -@@ -16,8 +18,8 @@ - * along with gedit. If not, see . - */ - --#ifndef GEDIT_DRAWSPACES_VIEW_ACTIVATABLE_H --#define GEDIT_DRAWSPACES_VIEW_ACTIVATABLE_H -+#ifndef __GEDIT_DRAWSPACES_VIEW_ACTIVATABLE_H__ -+#define __GEDIT_DRAWSPACES_VIEW_ACTIVATABLE_H__ - - #include - -@@ -25,11 +27,16 @@ G_BEGIN_DECLS - - #define GEDIT_TYPE_DRAWSPACES_VIEW_ACTIVATABLE (gedit_drawspaces_view_activatable_get_type ()) - #define GEDIT_DRAWSPACES_VIEW_ACTIVATABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_DRAWSPACES_VIEW_ACTIVATABLE, GeditDrawspacesViewActivatable)) -+#define GEDIT_DRAWSPACES_VIEW_ACTIVATABLE_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEDIT_TYPE_DRAWSPACES_VIEW_ACTIVATABLE, GeditDrawspacesViewActivatable const)) - #define GEDIT_DRAWSPACES_VIEW_ACTIVATABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEDIT_TYPE_DRAWSPACES_VIEW_ACTIVATABLE, GeditDrawspacesViewActivatableClass)) - #define GEDIT_IS_DRAWSPACES_VIEW_ACTIVATABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEDIT_TYPE_DRAWSPACES_VIEW_ACTIVATABLE)) - #define GEDIT_IS_DRAWSPACES_VIEW_ACTIVATABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEDIT_TYPE_DRAWSPACES_VIEW_ACTIVATABLE)) - #define GEDIT_DRAWSPACES_VIEW_ACTIVATABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEDIT_TYPE_DRAWSPACES_VIEW_ACTIVATABLE, GeditDrawspacesViewActivatableClass)) - -+#define DRAWSPACES_SETTINGS_BASE "org.gnome.gedit.plugins.drawspaces" -+#define SETTINGS_KEY_SHOW_WHITE_SPACE "show-white-space" -+#define SETTINGS_KEY_DRAW_SPACES "draw-spaces" -+ - typedef struct _GeditDrawspacesViewActivatable GeditDrawspacesViewActivatable; - typedef struct _GeditDrawspacesViewActivatableClass GeditDrawspacesViewActivatableClass; - -@@ -43,12 +50,12 @@ struct _GeditDrawspacesViewActivatableClass - GObjectClass parent_class; - }; - --GType gedit_drawspaces_view_activatable_get_type (void); -+GType gedit_drawspaces_view_activatable_get_type (void) G_GNUC_CONST; - - void gedit_drawspaces_view_activatable_register (GTypeModule *module); - - G_END_DECLS - --#endif /* GEDIT_DRAWSPACES_VIEW_ACTIVATABLE_H */ -+#endif /* __GEDIT_DRAWSPACES_VIEW_ACTIVATABLE_H__ */ - - /* ex:set ts=8 noet: */ -diff --git a/plugins/drawspaces/gedit-drawspaces.gresource.xml b/plugins/drawspaces/gedit-drawspaces.gresource.xml -new file mode 100644 -index 0000000..1e09e4d ---- /dev/null -+++ b/plugins/drawspaces/gedit-drawspaces.gresource.xml -@@ -0,0 +1,6 @@ -+ -+ -+ -+ gedit-drawspaces-configurable.ui -+ -+ -diff --git a/plugins/drawspaces/meson.build b/plugins/drawspaces/meson.build -index d8d6acb..75610cb 100644 ---- a/plugins/drawspaces/meson.build -+++ b/plugins/drawspaces/meson.build -@@ -7,6 +7,15 @@ libdrawspaces_deps = [ - gedit_dep, - ] - -+libdrawspaces_res = gnome.compile_resources( -+ 'gedit-drawspaces-resources', -+ 'gedit-drawspaces.gresource.xml', -+) -+ -+libdrawspaces_sources += [ -+ libdrawspaces_res.get(0), -+] -+ - libdrawspaces_sha = shared_module( - 'drawspaces', - sources: libdrawspaces_sources, -diff --git a/plugins/drawspaces/org.gnome.gedit.plugins.drawspaces.gschema.xml b/plugins/drawspaces/org.gnome.gedit.plugins.drawspaces.gschema.xml -index 3f288d3..a05f96d 100644 ---- a/plugins/drawspaces/org.gnome.gedit.plugins.drawspaces.gschema.xml -+++ b/plugins/drawspaces/org.gnome.gedit.plugins.drawspaces.gschema.xml -@@ -1,8 +1,24 @@ -- -- -- -- -- [uint32 11, 11, 11] -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ true -+ Show White Space -+ If TRUE drawing will be enabled. -+ -+ -+ ['space', 'tab', 'leading', 'text', 'trailing'] -+ Draw Spaces -+ The type of spaces to be drawn. - - - -diff --git a/po/POTFILES.in b/po/POTFILES.in -index ba022d7..5b19b7b 100644 ---- a/po/POTFILES.in -+++ b/po/POTFILES.in -@@ -24,6 +24,7 @@ plugins/commander/commander.plugin.desktop.in.in - plugins/commander/gedit-commander.metainfo.xml.in - plugins/drawspaces/drawspaces.plugin.desktop.in.in - plugins/drawspaces/gedit-drawspaces-app-activatable.c -+plugins/drawspaces/gedit-drawspaces-configurable.ui - plugins/drawspaces/gedit-drawspaces.metainfo.xml.in - plugins/drawspaces/org.gnome.gedit.plugins.drawspaces.gschema.xml - plugins/findinfiles/dialog.ui --- -2.30.2 - - -From 401f44f0634ef3d06515ae8624acde533a8b4c7f Mon Sep 17 00:00:00 2001 -From: Jordan Petridis -Date: Sat, 10 Apr 2021 03:58:29 +0300 -Subject: [PATCH 2/2] Revert "Use the TeplBuffer::tepl-cursor-moved signal" - -This reverts commit 9fe4fbf445b0004ee2b7cd0e76c2944a33c6ae70. ---- - plugins/synctex/synctex/synctex.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/plugins/synctex/synctex/synctex.py b/plugins/synctex/synctex/synctex.py -index 9186c3c..1badf51 100644 ---- a/plugins/synctex/synctex/synctex.py -+++ b/plugins/synctex/synctex/synctex.py -@@ -201,7 +201,7 @@ class SynctexViewHelper: - - if self.active and self.window_proxy is None: - self._doc_active_handlers = [ -- self._doc.connect('tepl-cursor-moved', self.on_cursor_moved), -+ self._doc.connect('cursor-moved', self.on_cursor_moved), - self._doc.connect('notify::style-scheme', self.on_notify_style_scheme)] - self._view_active_handlers = [ - self._view.connect('key-press-event', self.on_key_press), --- -2.30.2 - diff --git a/sources b/sources index cbb2027..b05ebd6 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (gedit-plugins-40.0.tar.xz) = 660e82dc1a1187262afd921196074dd2808a400b5acbc88ab36f522c50f1b9d221ff1821c2e8c0c066c7556862779e8d277f52a758070c59b17e6b53791ff39d +SHA512 (gedit-plugins-40.1.tar.xz) = 71649d157ac5591e4dd317c44ae167c98fb59e253c45f8c1ff8ef397a9e3f0bb968f0ef2486f9021354269e77defb9e5e305f1538f69818480a250966143c7a3