diff --git a/lib/Constants.vala b/lib/Constants.vala index 362252640..71e216811 100644 --- a/lib/Constants.vala +++ b/lib/Constants.vala @@ -35,17 +35,6 @@ namespace Gala { NUDGE = 360, } - public enum GestureAction { - NONE, - SWITCH_WORKSPACE, - SWITCH_WINDOWS, - MULTITASKING_VIEW, - DOCK, - ZOOM, - CLOSE_WINDOW, - N_ACTIONS - } - /** * Used as a key for Object.set_data on Meta.Windows that should be * treated as notifications. Has to be set before the window is mapped. diff --git a/src/Gestures/ActorTarget.vala b/lib/Gestures/ActorTarget.vala similarity index 100% rename from src/Gestures/ActorTarget.vala rename to lib/Gestures/ActorTarget.vala diff --git a/src/Gestures/Gesture.vala b/lib/Gestures/Gesture.vala similarity index 88% rename from src/Gestures/Gesture.vala rename to lib/Gestures/Gesture.vala index 5ffd2831d..066d4244b 100644 --- a/src/Gestures/Gesture.vala +++ b/lib/Gestures/Gesture.vala @@ -20,7 +20,7 @@ namespace Gala { /** * Physical direction of the gesture. This direction doesn't follow natural scroll preferences. */ - public enum GestureDirection { + private enum GestureDirection { UNKNOWN = 0, // GestureType.SWIPE and GestureType.SCROLL @@ -34,7 +34,18 @@ namespace Gala { OUT = 6, } - public class Gesture { + public enum GestureAction { + NONE, + SWITCH_WORKSPACE, + SWITCH_WINDOWS, + MULTITASKING_VIEW, + DOCK, + ZOOM, + CLOSE_WINDOW, + N_ACTIONS + } + + private class Gesture { public const float INVALID_COORD = float.MAX; public Clutter.EventType type; diff --git a/src/Gestures/GestureBackend.vala b/lib/Gestures/GestureBackend.vala similarity index 94% rename from src/Gestures/GestureBackend.vala rename to lib/Gestures/GestureBackend.vala index 1b24cac81..0b3192837 100644 --- a/src/Gestures/GestureBackend.vala +++ b/lib/Gestures/GestureBackend.vala @@ -5,7 +5,7 @@ * Authored by: Leonhard Kargl */ -public interface Gala.GestureBackend : Object { +private interface Gala.GestureBackend : Object { public signal bool on_gesture_detected (Gesture gesture, uint32 timestamp); public signal void on_begin (double delta, uint64 time); public signal void on_update (double delta, uint64 time); diff --git a/src/Gestures/GestureController.vala b/lib/Gestures/GestureController.vala similarity index 99% rename from src/Gestures/GestureController.vala rename to lib/Gestures/GestureController.vala index 47fbadf45..32ebc2f34 100644 --- a/src/Gestures/GestureController.vala +++ b/lib/Gestures/GestureController.vala @@ -13,7 +13,7 @@ * You shouldn't connect a notify to the progress directly though, but rather use a * {@link GestureTarget} implementation. * The {@link progress} can be seen as representing the state that the UI the gesture affects - * is currently in (e.g. 0 for multitasking view closed, 1 for it opend, or 0 for first workspace, + * is currently in (e.g. 0 for multitasking view closed, 1 for it opened, or 0 for first workspace, * -1 for second, -2 for third, etc.). Therefore the progress often needs boundaries which can be * set with {@link overshoot_lower_clamp} and {@link overshoot_upper_clamp}. If the values are integers * it will be a hard boundary, if they are fractional it will slow the gesture progress when over the diff --git a/src/Gestures/GestureSettings.vala b/lib/Gestures/GestureSettings.vala similarity index 99% rename from src/Gestures/GestureSettings.vala rename to lib/Gestures/GestureSettings.vala index a5e701a81..129524a97 100644 --- a/src/Gestures/GestureSettings.vala +++ b/lib/Gestures/GestureSettings.vala @@ -19,7 +19,7 @@ /** * Utility class to access the gesture settings. Easily accessible through GestureTracker.settings. */ -public class Gala.GestureSettings : Object { +private class Gala.GestureSettings : Object { private static GLib.Settings gala_settings; private static GLib.Settings touchpad_settings; diff --git a/src/Gestures/GestureTarget.vala b/lib/Gestures/GestureTarget.vala similarity index 100% rename from src/Gestures/GestureTarget.vala rename to lib/Gestures/GestureTarget.vala diff --git a/src/Gestures/PropertyTarget.vala b/lib/Gestures/PropertyTarget.vala similarity index 100% rename from src/Gestures/PropertyTarget.vala rename to lib/Gestures/PropertyTarget.vala diff --git a/src/Gestures/RootTarget.vala b/lib/Gestures/RootTarget.vala similarity index 100% rename from src/Gestures/RootTarget.vala rename to lib/Gestures/RootTarget.vala diff --git a/src/Gestures/ScrollBackend.vala b/lib/Gestures/ScrollBackend.vala similarity index 99% rename from src/Gestures/ScrollBackend.vala rename to lib/Gestures/ScrollBackend.vala index 3ce99e10b..1cf079293 100644 --- a/src/Gestures/ScrollBackend.vala +++ b/lib/Gestures/ScrollBackend.vala @@ -19,7 +19,7 @@ /** * This gesture backend transforms the touchpad scroll events received by an actor into gestures. */ -public class Gala.ScrollBackend : Object, GestureBackend { +private class Gala.ScrollBackend : Object, GestureBackend { // Mutter does not expose the size of the touchpad, so we use the same values as GTK apps. // From GNOME Shell, TOUCHPAD_BASE_[WIDTH|HEIGHT] / SCROLL_MULTIPLIER // https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/master/js/ui/swipeTracker.js diff --git a/src/Gestures/SpringTimeline.vala b/lib/Gestures/SpringTimeline.vala similarity index 100% rename from src/Gestures/SpringTimeline.vala rename to lib/Gestures/SpringTimeline.vala diff --git a/src/Gestures/ToucheggBackend.vala b/lib/Gestures/ToucheggBackend.vala similarity index 99% rename from src/Gestures/ToucheggBackend.vala rename to lib/Gestures/ToucheggBackend.vala index 4ebb29bc6..46e2d4f1f 100644 --- a/src/Gestures/ToucheggBackend.vala +++ b/lib/Gestures/ToucheggBackend.vala @@ -20,7 +20,7 @@ * Singleton class to manage the connection with Touchégg daemon and receive touch events. * See: [[https://github.com/JoseExposito/touchegg]] */ -public class Gala.ToucheggBackend : Object, GestureBackend { +private class Gala.ToucheggBackend : Object, GestureBackend { /** * Gesture type as returned by the daemon. */ diff --git a/lib/meson.build b/lib/meson.build index d94c825c1..8fddfe9dd 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -20,6 +20,17 @@ gala_lib_sources = files( 'Utils.vala', 'WindowIcon.vala', 'WindowManager.vala', + 'Gestures/ActorTarget.vala', + 'Gestures/Gesture.vala', + 'Gestures/GestureBackend.vala', + 'Gestures/GestureController.vala', + 'Gestures/GestureSettings.vala', + 'Gestures/GestureTarget.vala', + 'Gestures/PropertyTarget.vala', + 'Gestures/RootTarget.vala', + 'Gestures/ScrollBackend.vala', + 'Gestures/SpringTimeline.vala', + 'Gestures/ToucheggBackend.vala' ) gala_resources = gnome.compile_resources( diff --git a/src/meson.build b/src/meson.build index d86a8f5a8..cee0ff163 100644 --- a/src/meson.build +++ b/src/meson.build @@ -36,17 +36,6 @@ gala_bin_sources = files( 'Dialogs/AccessDialog.vala', 'Dialogs/CloseDialog.vala', 'Dialogs/InhibitShortcutsDialog.vala', - 'Gestures/ActorTarget.vala', - 'Gestures/Gesture.vala', - 'Gestures/GestureBackend.vala', - 'Gestures/GestureController.vala', - 'Gestures/GestureSettings.vala', - 'Gestures/GestureTarget.vala', - 'Gestures/PropertyTarget.vala', - 'Gestures/RootTarget.vala', - 'Gestures/ScrollBackend.vala', - 'Gestures/SpringTimeline.vala', - 'Gestures/ToucheggBackend.vala', 'HotCorners/Barrier.vala', 'HotCorners/HotCorner.vala', 'HotCorners/HotCornerManager.vala',