Skip to content

Commit 574b0eb

Browse files
authored
Move gestures code into the library
1 parent ac0c775 commit 574b0eb

14 files changed

+29
-29
lines changed

lib/Constants.vala

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,6 @@ namespace Gala {
3535
NUDGE = 360,
3636
}
3737

38-
public enum GestureAction {
39-
NONE,
40-
SWITCH_WORKSPACE,
41-
SWITCH_WINDOWS,
42-
MULTITASKING_VIEW,
43-
DOCK,
44-
ZOOM,
45-
CLOSE_WINDOW,
46-
N_ACTIONS
47-
}
48-
4938
/**
5039
* Used as a key for Object.set_data<bool> on Meta.Windows that should be
5140
* treated as notifications. Has to be set before the window is mapped.
File renamed without changes.

src/Gestures/Gesture.vala renamed to lib/Gestures/Gesture.vala

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace Gala {
2020
/**
2121
* Physical direction of the gesture. This direction doesn't follow natural scroll preferences.
2222
*/
23-
public enum GestureDirection {
23+
private enum GestureDirection {
2424
UNKNOWN = 0,
2525

2626
// GestureType.SWIPE and GestureType.SCROLL
@@ -34,7 +34,18 @@ namespace Gala {
3434
OUT = 6,
3535
}
3636

37-
public class Gesture {
37+
public enum GestureAction {
38+
NONE,
39+
SWITCH_WORKSPACE,
40+
SWITCH_WINDOWS,
41+
MULTITASKING_VIEW,
42+
DOCK,
43+
ZOOM,
44+
CLOSE_WINDOW,
45+
N_ACTIONS
46+
}
47+
48+
private class Gesture {
3849
public const float INVALID_COORD = float.MAX;
3950

4051
public Clutter.EventType type;

src/Gestures/GestureBackend.vala renamed to lib/Gestures/GestureBackend.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Authored by: Leonhard Kargl <[email protected]>
66
*/
77

8-
public interface Gala.GestureBackend : Object {
8+
private interface Gala.GestureBackend : Object {
99
public signal bool on_gesture_detected (Gesture gesture, uint32 timestamp);
1010
public signal void on_begin (double delta, uint64 time);
1111
public signal void on_update (double delta, uint64 time);

src/Gestures/GestureController.vala renamed to lib/Gestures/GestureController.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* You shouldn't connect a notify to the progress directly though, but rather use a
1414
* {@link GestureTarget} implementation.
1515
* The {@link progress} can be seen as representing the state that the UI the gesture affects
16-
* is currently in (e.g. 0 for multitasking view closed, 1 for it opend, or 0 for first workspace,
16+
* is currently in (e.g. 0 for multitasking view closed, 1 for it opened, or 0 for first workspace,
1717
* -1 for second, -2 for third, etc.). Therefore the progress often needs boundaries which can be
1818
* set with {@link overshoot_lower_clamp} and {@link overshoot_upper_clamp}. If the values are integers
1919
* it will be a hard boundary, if they are fractional it will slow the gesture progress when over the

src/Gestures/GestureSettings.vala renamed to lib/Gestures/GestureSettings.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/**
2020
* Utility class to access the gesture settings. Easily accessible through GestureTracker.settings.
2121
*/
22-
public class Gala.GestureSettings : Object {
22+
private class Gala.GestureSettings : Object {
2323
private static GLib.Settings gala_settings;
2424
private static GLib.Settings touchpad_settings;
2525

File renamed without changes.
File renamed without changes.
File renamed without changes.

src/Gestures/ScrollBackend.vala renamed to lib/Gestures/ScrollBackend.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/**
2020
* This gesture backend transforms the touchpad scroll events received by an actor into gestures.
2121
*/
22-
public class Gala.ScrollBackend : Object, GestureBackend {
22+
private class Gala.ScrollBackend : Object, GestureBackend {
2323
// Mutter does not expose the size of the touchpad, so we use the same values as GTK apps.
2424
// From GNOME Shell, TOUCHPAD_BASE_[WIDTH|HEIGHT] / SCROLL_MULTIPLIER
2525
// https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/master/js/ui/swipeTracker.js

0 commit comments

Comments
 (0)