[gimp/wip/Jehan/issue-498-quick-brush-edit: 48/48] app: remove GimpControllerMouse code.
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/wip/Jehan/issue-498-quick-brush-edit: 48/48] app: remove GimpControllerMouse code.
- Date: Tue, 16 Aug 2022 20:19:55 +0000 (UTC)
commit 706c5cea5b34db84a9b78be54648785bfc2291bc
Author: Jehan <jehan girinstud io>
Date: Tue Aug 16 21:49:23 2022 +0200
app: remove GimpControllerMouse code.
The mouse controller had many limitations:
* It was not per-device.
* It was a long hard-coded list of events, which made its evolution
annoying and scrolling the list boring.
* It was starting at button 8, while the first buttons were supposed to
be hardcoded interactions. And it stopped at button 12, while some
device might have more buttons nowadays. See !386.
* The "Grab event" does not seem to work in many cases, according to
feedbacks.
The new GimpModifiersEditor will now handle any button (except the first
button, which is reserved for tools), you can even override or change
default canvas actions (panning, rotation, etc.). It should not be
limited with a max button number either (though I haven't tested with a
device really having a lot of buttons since I don't have any such device
but I did emulate huge button numbers on my stylus with xsetwacom and it
did work well; hopefully I'll get feedbacks). And now it can even run
custom actions.
So basically it should deprecate the mouse controller as the modifiers
editor can do everything the controller could, and more (unless I missed
anything).
app/display/gimpdisplayshell-tool-events.c | 1 -
app/widgets/Makefile.am | 2 -
app/widgets/gimpcontrollerlist.c | 12 --
app/widgets/gimpcontrollermouse.c | 314 -----------------------------
app/widgets/gimpcontrollermouse.h | 57 ------
app/widgets/gimpcontrollers.c | 19 --
app/widgets/gimpcontrollers.h | 1 -
app/widgets/meson.build | 1 -
8 files changed, 407 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-tool-events.c b/app/display/gimpdisplayshell-tool-events.c
index e38259d7a4..7e82ec9395 100644
--- a/app/display/gimpdisplayshell-tool-events.c
+++ b/app/display/gimpdisplayshell-tool-events.c
@@ -41,7 +41,6 @@
#include "widgets/gimpaction.h"
#include "widgets/gimpcontrollers.h"
#include "widgets/gimpcontrollerkeyboard.h"
-#include "widgets/gimpcontrollermouse.h"
#include "widgets/gimpcontrollerwheel.h"
#include "widgets/gimpdeviceinfo.h"
#include "widgets/gimpdeviceinfo-coords.h"
diff --git a/app/widgets/Makefile.am b/app/widgets/Makefile.am
index 35db2541a7..9b7d9a758b 100644
--- a/app/widgets/Makefile.am
+++ b/app/widgets/Makefile.am
@@ -133,8 +133,6 @@ libappwidgets_a_sources = \
gimpcontrollers.h \
gimpcontrollerkeyboard.c \
gimpcontrollerkeyboard.h \
- gimpcontrollermouse.c \
- gimpcontrollermouse.h \
gimpcontrollerwheel.c \
gimpcontrollerwheel.h \
gimpcriticaldialog.c \
diff --git a/app/widgets/gimpcontrollerlist.c b/app/widgets/gimpcontrollerlist.c
index 8dcec7e5fd..c327c4027a 100644
--- a/app/widgets/gimpcontrollerlist.c
+++ b/app/widgets/gimpcontrollerlist.c
@@ -42,7 +42,6 @@
#include "gimpcontrollerlist.h"
#include "gimpcontrollerinfo.h"
#include "gimpcontrollerkeyboard.h"
-#include "gimpcontrollermouse.h"
#include "gimpcontrollerwheel.h"
#include "gimpcontrollers.h"
#include "gimpdialogfactory.h"
@@ -527,17 +526,6 @@ gimp_controller_list_add_clicked (GtkWidget *button,
"your list of active controllers."));
return;
}
- else if (list->src_gtype == GIMP_TYPE_CONTROLLER_MOUSE &&
- gimp_controllers_get_mouse (list->gimp) != NULL)
- {
- gimp_message_literal (list->gimp,
- G_OBJECT (button), GIMP_MESSAGE_WARNING,
- _("There can only be one active mouse "
- "controller.\n\n"
- "You already have a mouse controller in "
- "your list of active controllers."));
- return;
- }
info = gimp_controller_info_new (list->src_gtype);
container = gimp_controllers_get_list (list->gimp);
diff --git a/app/widgets/gimpcontrollers.c b/app/widgets/gimpcontrollers.c
index d7ff9ac7e1..d1c0448120 100644
--- a/app/widgets/gimpcontrollers.c
+++ b/app/widgets/gimpcontrollers.c
@@ -37,7 +37,6 @@
#include "gimpcontrollerinfo.h"
#include "gimpcontrollers.h"
#include "gimpcontrollerkeyboard.h"
-#include "gimpcontrollermouse.h"
#include "gimpcontrollerwheel.h"
#include "gimpenumaction.h"
#include "gimpuimanager.h"
@@ -54,7 +53,6 @@ struct _GimpControllerManager
{
GimpContainer *controllers;
GQuark event_mapped_id;
- GimpController *mouse;
GimpController *wheel;
GimpController *keyboard;
GimpUIManager *ui_manager;
@@ -110,7 +108,6 @@ gimp_controllers_init (Gimp *gimp)
G_CALLBACK (gimp_controllers_event_mapped),
manager);
- g_type_class_ref (GIMP_TYPE_CONTROLLER_MOUSE);
g_type_class_ref (GIMP_TYPE_CONTROLLER_WHEEL);
g_type_class_ref (GIMP_TYPE_CONTROLLER_KEYBOARD);
}
@@ -256,20 +253,6 @@ gimp_controllers_get_ui_manager (Gimp *gimp)
return manager->ui_manager;
}
-GimpController *
-gimp_controllers_get_mouse (Gimp *gimp)
-{
- GimpControllerManager *manager;
-
- g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
-
- manager = gimp_controller_manager_get (gimp);
-
- g_return_val_if_fail (manager != NULL, NULL);
-
- return manager->mouse;
-}
-
GimpController *
gimp_controllers_get_wheel (Gimp *gimp)
{
@@ -328,8 +311,6 @@ gimp_controllers_add (GimpContainer *container,
manager->wheel = info->controller;
else if (GIMP_IS_CONTROLLER_KEYBOARD (info->controller))
manager->keyboard = info->controller;
- else if (GIMP_IS_CONTROLLER_MOUSE (info->controller))
- manager->mouse = info->controller;
}
static void
diff --git a/app/widgets/gimpcontrollers.h b/app/widgets/gimpcontrollers.h
index b4efeebcbb..4327bd83dd 100644
--- a/app/widgets/gimpcontrollers.h
+++ b/app/widgets/gimpcontrollers.h
@@ -31,7 +31,6 @@ void gimp_controllers_save (Gimp *gimp);
GimpContainer * gimp_controllers_get_list (Gimp *gimp);
GimpUIManager * gimp_controllers_get_ui_manager (Gimp *gimp);
-GimpController * gimp_controllers_get_mouse (Gimp *gimp);
GimpController * gimp_controllers_get_wheel (Gimp *gimp);
GimpController * gimp_controllers_get_keyboard (Gimp *gimp);
diff --git a/app/widgets/meson.build b/app/widgets/meson.build
index fcd56450d9..0debd83c91 100644
--- a/app/widgets/meson.build
+++ b/app/widgets/meson.build
@@ -67,7 +67,6 @@ libappwidgets_sources = [
'gimpcontrollerinfo.c',
'gimpcontrollerkeyboard.c',
'gimpcontrollerlist.c',
- 'gimpcontrollermouse.c',
'gimpcontrollers.c',
'gimpcontrollerwheel.c',
'gimpcriticaldialog.c',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]