diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | data/gnome-settings-daemon.convert | 1 | ||||
-rw-r--r-- | data/org.gnome.settings-daemon.peripherals.gschema.xml.in | 4 | ||||
-rw-r--r-- | plugins/mouse/gsd-locate-pointer.c | 512 | ||||
-rw-r--r-- | plugins/mouse/gsd-locate-pointer.h | 24 | ||||
-rw-r--r-- | plugins/mouse/gsd-mouse-manager.c | 40 | ||||
-rw-r--r-- | plugins/mouse/gsd-timeline.c | 841 | ||||
-rw-r--r-- | plugins/mouse/gsd-timeline.h | 110 | ||||
-rw-r--r-- | plugins/mouse/meson.build | 15 |
9 files changed, 0 insertions, 1548 deletions
@@ -87,7 +87,6 @@ plugins/smartcard/org.gnome.ScreenSaver.c plugins/smartcard/org.gnome.ScreenSaver.h plugins/smartcard/org.gnome.SessionManager.c plugins/smartcard/org.gnome.SessionManager.h -plugins/mouse/gsd-locate-pointer plugins/mouse/gsd-test-mouse plugins/power/gsd-backlight-helper plugins/power/gsd-power-enums-update diff --git a/data/gnome-settings-daemon.convert b/data/gnome-settings-daemon.convert index 8ca4630e..f04d24c1 100644 --- a/data/gnome-settings-daemon.convert +++ b/data/gnome-settings-daemon.convert @@ -30,7 +30,6 @@ volume-up = /apps/gnome_settings_daemon/keybindings/volume_up www = /apps/gnome_settings_daemon/keybindings/www [org.gnome.settings-daemon.peripherals.mouse] -locate-pointer = /desktop/gnome/peripherals/mouse/locate_pointer double-click = /desktop/gnome/peripherals/mouse/double_click drag-threshold = /desktop/gnome/peripherals/mouse/drag_threshold diff --git a/data/org.gnome.settings-daemon.peripherals.gschema.xml.in b/data/org.gnome.settings-daemon.peripherals.gschema.xml.in index f1785ed5..def30967 100644 --- a/data/org.gnome.settings-daemon.peripherals.gschema.xml.in +++ b/data/org.gnome.settings-daemon.peripherals.gschema.xml.in @@ -47,10 +47,6 @@ </key> </schema> <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.settings-daemon.peripherals.mouse" path="/org/gnome/settings-daemon/peripherals/mouse/"> - <key name="locate-pointer" type="b"> - <default>false</default> - <summary>Highlights the current location of the pointer when the Control key is pressed and released.</summary> - </key> <key name="double-click" type="i"> <default>400</default> <summary>Double click time</summary> diff --git a/plugins/mouse/gsd-locate-pointer.c b/plugins/mouse/gsd-locate-pointer.c deleted file mode 100644 index 7f8cd339..00000000 --- a/plugins/mouse/gsd-locate-pointer.c +++ /dev/null @@ -1,512 +0,0 @@ -/* gsd-locate-pointer.c - * - * Copyright (C) 2008 Carlos Garnacho <carlos@imendio.com> - * - * 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. - * - * 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 <http://www.gnu.org/licenses/>. - */ - -#include <gtk/gtk.h> -#include "gsd-timeline.h" -#include "gsd-locate-pointer.h" - -#include <gdk/gdkkeysyms.h> -#include <gdk/gdkx.h> -#include <X11/keysym.h> - -#define ANIMATION_LENGTH 750 -#define WINDOW_SIZE 101 -#define N_CIRCLES 4 - -/* All circles are supposed to be moving when progress - * reaches 0.5, and each of them are supposed to long - * for half of the progress, hence the need of 0.5 to - * get the circles interval, and the multiplication - * by 2 to know a circle progress */ -#define CIRCLES_PROGRESS_INTERVAL (0.5 / N_CIRCLES) -#define CIRCLE_PROGRESS(p) (MIN (1., ((gdouble) (p) * 2.))) - -typedef struct GsdLocatePointerData GsdLocatePointerData; - -struct GsdLocatePointerData -{ - GsdTimeline *timeline; - GtkWidget *widget; - GdkWindow *window; - - gdouble progress; -}; - -static GsdLocatePointerData *data = NULL; - -static void -locate_pointer_paint (GsdLocatePointerData *data, - cairo_t *cr, - gboolean composite) -{ - GdkRGBA color; - gdouble progress, circle_progress; - gint width, height, i; - GtkStyleContext *context; - - progress = data->progress; - - width = gdk_window_get_width (data->window); - height = gdk_window_get_height (data->window); - context = gtk_widget_get_style_context (data->widget); - gtk_style_context_get_background_color (context, GTK_STATE_FLAG_SELECTED, &color); - - cairo_set_source_rgba (cr, 1., 1., 1., 0.); - cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); - cairo_paint (cr); - - for (i = 0; i <= N_CIRCLES; i++) - { - if (progress < 0.) - break; - - circle_progress = MIN (1., (progress * 2)); - progress -= CIRCLES_PROGRESS_INTERVAL; - - if (circle_progress >= 1.) - continue; - - if (composite) - { - cairo_set_source_rgba (cr, - color.red, - color.green, - color.blue, - 1 - circle_progress); - cairo_arc (cr, - width / 2, - height / 2, - circle_progress * width / 2, - 0, 2 * G_PI); - - cairo_fill (cr); - } - else - { - cairo_set_source_rgb (cr, 0., 0., 0.); - cairo_set_line_width (cr, 3.); - cairo_arc (cr, - width / 2, - height / 2, - circle_progress * width / 2, - 0, 2 * G_PI); - cairo_stroke (cr); - - cairo_set_source_rgb (cr, 1., 1., 1.); - cairo_set_line_width (cr, 1.); - cairo_arc (cr, - width / 2, - height / 2, - circle_progress * width / 2, - 0, 2 * G_PI); - cairo_stroke (cr); - } - } -} - -static gboolean -locate_pointer_draw (GtkWidget *widget, - cairo_t *cr, - gpointer user_data) -{ - GsdLocatePointerData *data = (GsdLocatePointerData *) user_data; - - if (gtk_cairo_should_draw_window (cr, data->window)) - locate_pointer_paint (data, cr, gtk_widget_is_composited (data->widget)); - - return TRUE; -} - -static void -update_shape (GsdLocatePointerData *data) -{ - cairo_t *cr; - cairo_region_t *region; - cairo_surface_t *mask; - - mask = cairo_image_surface_create (CAIRO_FORMAT_A1, WINDOW_SIZE, WINDOW_SIZE); - cr = cairo_create (mask); - - locate_pointer_paint (data, cr, FALSE); - - region = gdk_cairo_region_create_from_surface (mask); - gdk_window_shape_combine_region (data->window, region, 0, 0); - - cairo_region_destroy (region); - cairo_destroy (cr); - cairo_surface_destroy (mask); -} - -static void -timeline_frame_cb (GsdTimeline *timeline, - gdouble progress, - gpointer user_data) -{ - GsdLocatePointerData *data = (GsdLocatePointerData *) user_data; - GdkScreen *screen; - GdkDeviceManager *device_manager; - gint cursor_x, cursor_y; - - if (gtk_widget_is_composited (data->widget)) - { - gdk_window_invalidate_rect (data->window, NULL, FALSE); - data->progress = progress; - } - else if (progress >= data->progress + CIRCLES_PROGRESS_INTERVAL) - { - /* only invalidate window each circle interval */ - update_shape (data); - gdk_window_invalidate_rect (data->window, NULL, FALSE); - data->progress += CIRCLES_PROGRESS_INTERVAL; - } - - screen = gdk_window_get_screen (data->window); - device_manager = gdk_display_get_device_manager (gdk_window_get_display (data->window)); - gdk_window_get_device_position (gdk_screen_get_root_window (screen), - gdk_device_manager_get_client_pointer (device_manager), - &cursor_x, &cursor_y, NULL); - gdk_window_move (data->window, - cursor_x - WINDOW_SIZE / 2, - cursor_y - WINDOW_SIZE / 2); -} - -static void -set_transparent_shape (GdkWindow *window) -{ - cairo_region_t *region; - - region = cairo_region_create (); - gdk_window_shape_combine_region (data->window, region, 0, 0); - cairo_region_destroy (region); -} - -static void -unset_transparent_shape (GdkWindow *window) -{ - gdk_window_shape_combine_region (data->window, NULL, 0, 0); -} - -static void -composited_changed (GtkWidget *widget, - GsdLocatePointerData *data) -{ - if (!gtk_widget_is_composited (widget)) - set_transparent_shape (data->window); - else - unset_transparent_shape (data->window); -} - -static void -timeline_finished_cb (GsdTimeline *timeline, - gpointer user_data) -{ - GsdLocatePointerData *data = (GsdLocatePointerData *) user_data; - - /* set transparent shape and hide window */ - if (!gtk_widget_is_composited (data->widget)) - set_transparent_shape (data->window); - - gtk_widget_hide (data->widget); - gdk_window_hide (data->window); -} - -static void -create_window (GsdLocatePointerData *data, - GdkScreen *screen) -{ - GdkVisual *visual; - GdkWindowAttr attributes; - gint attributes_mask; - - visual = gdk_screen_get_rgba_visual (screen); - - if (visual == NULL) - visual = gdk_screen_get_system_visual (screen); - - attributes_mask = GDK_WA_X | GDK_WA_Y; - - if (visual != NULL) - attributes_mask = attributes_mask | GDK_WA_VISUAL; - - attributes.window_type = GDK_WINDOW_TEMP; - attributes.wclass = GDK_INPUT_OUTPUT; - attributes.visual = visual; - attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK; - attributes.width = 1; - attributes.height = 1; - - data->window = gdk_window_new (gdk_screen_get_root_window (screen), - &attributes, - attributes_mask); - - gdk_window_set_user_data (data->window, data->widget); -} - -static GsdLocatePointerData * -gsd_locate_pointer_data_new (GdkScreen *screen) -{ - GsdLocatePointerData *data; - - data = g_new0 (GsdLocatePointerData, 1); - - /* this widget will never be shown, it's - * mainly used to get signals/events from - */ - data->widget = gtk_invisible_new (); - gtk_widget_realize (data->widget); - - g_signal_connect (G_OBJECT (data->widget), "draw", - G_CALLBACK (locate_pointer_draw), - data); - - data->timeline = gsd_timeline_new (ANIMATION_LENGTH); - g_signal_connect (data->timeline, "frame", - G_CALLBACK (timeline_frame_cb), data); - g_signal_connect (data->timeline, "finished", - G_CALLBACK (timeline_finished_cb), data); - - create_window (data, screen); - - return data; -} - -static void -move_locate_pointer_window (GsdLocatePointerData *data, - GdkScreen *screen) -{ - GdkDeviceManager *device_manager; - cairo_region_t *region; - gint cursor_x, cursor_y; - - device_manager = gdk_display_get_device_manager (gdk_window_get_display (data->window)); - gdk_window_get_device_position (gdk_screen_get_root_window (screen), - gdk_device_manager_get_client_pointer (device_manager), - &cursor_x, &cursor_y, NULL); - - gdk_window_move_resize (data->window, - cursor_x - WINDOW_SIZE / 2, - cursor_y - WINDOW_SIZE / 2, - WINDOW_SIZE, WINDOW_SIZE); - - /* allow events to happen through the window */ - region = cairo_region_create (); - gdk_window_input_shape_combine_region (data->window, region, 0, 0); - cairo_region_destroy (region); -} - -void -gsd_locate_pointer (GdkScreen *screen) -{ - if (!data) - data = gsd_locate_pointer_data_new (screen); - - gsd_timeline_pause (data->timeline); - gsd_timeline_rewind (data->timeline); - - /* Create again the window if it is not for the current screen */ - if (gdk_screen_get_number (screen) != gdk_screen_get_number (gdk_window_get_screen (data->window))) - { - gdk_window_set_user_data (data->window, NULL); - gdk_window_destroy (data->window); - - create_window (data, screen); - } - - data->progress = 0.; - - g_signal_connect (data->widget, "composited-changed", - G_CALLBACK (composited_changed), data); - - move_locate_pointer_window (data, screen); - composited_changed (data->widget, data); - gdk_window_show (data->window); - gtk_widget_show (data->widget); - - gsd_timeline_start (data->timeline); -} - - -#define KEYBOARD_GROUP_SHIFT 13 -#define KEYBOARD_GROUP_MASK ((1 << 13) | (1 << 14)) - -/* Owen magic */ -static GdkFilterReturn -filter (GdkXEvent *xevent, - GdkEvent *event, - gpointer data) -{ - XEvent *xev = (XEvent *) xevent; - guint keyval; - gint group; - - GdkScreen *screen = (GdkScreen *)data; - - if (xev->type == ButtonPress) - { - XAllowEvents (xev->xbutton.display, - ReplayPointer, - xev->xbutton.time); - XUngrabButton (xev->xbutton.display, - AnyButton, - AnyModifier, - xev->xbutton.window); - XUngrabKeyboard (xev->xbutton.display, - xev->xbutton.time); - } - - if (xev->type == KeyPress || xev->type == KeyRelease) - { - /* get the keysym */ - group = (xev->xkey.state & KEYBOARD_GROUP_MASK) >> KEYBOARD_GROUP_SHIFT; - gdk_keymap_translate_keyboard_state (gdk_keymap_get_default (), - xev->xkey.keycode, - xev->xkey.state, - group, - &keyval, - NULL, NULL, NULL); - if (keyval == GDK_KEY_Control_L || keyval == GDK_KEY_Control_R) - { - if (xev->type == KeyPress) - { - XAllowEvents (xev->xkey.display, - SyncKeyboard, - xev->xkey.time); - XGrabButton (xev->xkey.display, - AnyButton, - AnyModifier, - xev->xkey.window, - False, - ButtonPressMask, - GrabModeSync, - GrabModeAsync, - None, - None); - } - else - { - XUngrabButton (xev->xkey.display, - AnyButton, - AnyModifier, - xev->xkey.window); - XAllowEvents (xev->xkey.display, - AsyncKeyboard, - xev->xkey.time); - gsd_locate_pointer (screen); - } - } - else - { - XAllowEvents (xev->xkey.display, - ReplayKeyboard, - xev->xkey.time); - XUngrabButton (xev->xkey.display, - AnyButton, - AnyModifier, - xev->xkey.window); - XUngrabKeyboard (xev->xkey.display, - xev->xkey.time); - } - } - - return GDK_FILTER_CONTINUE; -} - -static void -set_locate_pointer (void) -{ - GdkKeymapKey *keys; - GdkDisplay *display; - GdkScreen *screen; - Window xroot; - int n_keys; - gboolean has_entries; - static const guint keyvals[] = { GDK_KEY_Control_L, GDK_KEY_Control_R }; - unsigned i, j; - - display = gdk_display_get_default (); - screen = gdk_screen_get_default (); - xroot = gdk_x11_window_get_xid (gdk_screen_get_root_window (screen)); - - for (j = 0 ; j < G_N_ELEMENTS (keyvals) ; j++) - { - has_entries = gdk_keymap_get_entries_for_keyval (gdk_keymap_get_default (), - keyvals[j], - &keys, - &n_keys); - if (has_entries) - { - for (i = 0; i < n_keys; i++) - { - gdk_x11_display_error_trap_push (display); - - XGrabKey (GDK_DISPLAY_XDISPLAY (display), - keys[i].keycode, - 0, - xroot, - False, - GrabModeAsync, - GrabModeSync); - XGrabKey (GDK_DISPLAY_XDISPLAY (display), - keys[i].keycode, - LockMask, - xroot, - False, - GrabModeAsync, - GrabModeSync); - XGrabKey (GDK_DISPLAY_XDISPLAY (display), - keys[i].keycode, - Mod2Mask, - xroot, - False, - GrabModeAsync, - GrabModeSync); - XGrabKey (GDK_DISPLAY_XDISPLAY (display), - keys[i].keycode, - Mod4Mask, - xroot, - False, - GrabModeAsync, - GrabModeSync); - - gdk_x11_display_error_trap_pop_ignored (display); - } - - g_free (keys); - - gdk_window_add_filter (gdk_screen_get_root_window (screen), - filter, - screen); - } - } -} - - -int -main (int argc, char *argv[]) -{ - gdk_disable_multidevice (); - - gtk_init (&argc, &argv); - - set_locate_pointer (); - - gtk_main (); - - return 0; -} - diff --git a/plugins/mouse/gsd-locate-pointer.h b/plugins/mouse/gsd-locate-pointer.h deleted file mode 100644 index 3b261a53..00000000 --- a/plugins/mouse/gsd-locate-pointer.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright © 2001 Jonathan Blandford <jrb@gnome.org> - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Red Hat not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. Red Hat makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * Authors: Jonathan Blandford - */ - -#ifndef LOCATE_POINTER_H -#define LOCATE_POINTER_H - -#include <gdk/gdk.h> - -void gsd_locate_pointer (GdkScreen *screen); - -#endif diff --git a/plugins/mouse/gsd-mouse-manager.c b/plugins/mouse/gsd-mouse-manager.c index 701f4af5..1148fa95 100644 --- a/plugins/mouse/gsd-mouse-manager.c +++ b/plugins/mouse/gsd-mouse-manager.c @@ -38,7 +38,6 @@ #define GSETTINGS_TOUCHPAD_SCHEMA "org.gnome.desktop.peripherals.touchpad" /* Mouse settings */ -#define KEY_LOCATE_POINTER "locate-pointer" #define KEY_DWELL_CLICK_ENABLED "dwell-click-enabled" #define KEY_SECONDARY_CLICK_ENABLED "secondary-click-enabled" @@ -52,8 +51,6 @@ struct _GsdMouseManager GSettings *mouse_settings; GSettings *gsd_mouse_settings; gboolean mousetweaks_daemon_running; - gboolean locate_pointer_spawned; - GPid locate_pointer_pid; }; static void gsd_mouse_manager_class_init (GsdMouseManagerClass *klass); @@ -75,38 +72,6 @@ gsd_mouse_manager_class_init (GsdMouseManagerClass *klass) } static void -set_locate_pointer (GsdMouseManager *manager, - gboolean state) -{ - if (state) { - GError *error = NULL; - char *args[2]; - - if (manager->locate_pointer_spawned) - return; - - args[0] = LIBEXECDIR "/gsd-locate-pointer"; - args[1] = NULL; - - g_spawn_async (NULL, args, NULL, - 0, NULL, NULL, - &manager->locate_pointer_pid, &error); - - manager->locate_pointer_spawned = (error == NULL); - - if (error) { - g_settings_set_boolean (manager->gsd_mouse_settings, KEY_LOCATE_POINTER, FALSE); - g_error_free (error); - } - - } else if (manager->locate_pointer_spawned) { - kill (manager->locate_pointer_pid, SIGHUP); - g_spawn_close_pid (manager->locate_pointer_pid); - manager->locate_pointer_spawned = FALSE; - } -} - -static void set_mousetweaks_daemon (GsdMouseManager *manager, gboolean dwell_click_enabled, gboolean secondary_click_enabled) @@ -151,8 +116,6 @@ mouse_callback (GSettings *settings, set_mousetweaks_daemon (manager, g_settings_get_boolean (settings, KEY_DWELL_CLICK_ENABLED), g_settings_get_boolean (settings, KEY_SECONDARY_CLICK_ENABLED)); - } else if (g_str_equal (key, KEY_LOCATE_POINTER)) { - set_locate_pointer (manager, g_settings_get_boolean (settings, KEY_LOCATE_POINTER)); } } @@ -179,7 +142,6 @@ gsd_mouse_manager_idle_cb (GsdMouseManager *manager) G_CALLBACK (mouse_callback), manager); #endif - set_locate_pointer (manager, g_settings_get_boolean (manager->gsd_mouse_settings, KEY_LOCATE_POINTER)); set_mousetweaks_daemon (manager, g_settings_get_boolean (manager->mouse_a11y_settings, KEY_DWELL_CLICK_ENABLED), g_settings_get_boolean (manager->mouse_a11y_settings, KEY_SECONDARY_CLICK_ENABLED)); @@ -224,8 +186,6 @@ gsd_mouse_manager_stop (GsdMouseManager *manager) g_clear_object (&manager->mouse_settings); g_clear_object (&manager->touchpad_settings); g_clear_object (&manager->gsd_mouse_settings); - - set_locate_pointer (manager, FALSE); } static void diff --git a/plugins/mouse/gsd-timeline.c b/plugins/mouse/gsd-timeline.c deleted file mode 100644 index adfb38aa..00000000 --- a/plugins/mouse/gsd-timeline.c +++ /dev/null @@ -1,841 +0,0 @@ -/* gsd-timeline.c - * - * Copyright (C) 2008 Carlos Garnacho <carlos@imendio.com> - * - * 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. - * - * 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 <http://www.gnu.org/licenses/>. - */ - -#include <glib.h> -#include <gtk/gtk.h> -#include <math.h> -#include "gsd-timeline.h" - -#define MSECS_PER_SEC 1000 -#define FRAME_INTERVAL(nframes) (MSECS_PER_SEC / nframes) -#define DEFAULT_FPS 30 - -typedef struct -{ - guint duration; - guint fps; - guint source_id; - - GTimer *timer; - - GdkScreen *screen; - GsdTimelineProgressType progress_type; - GsdTimelineProgressFunc progress_func; - - guint loop : 1; - guint direction : 1; -} GsdTimelinePrivate; - -enum { - PROP_0, - PROP_FPS, - PROP_DURATION, - PROP_LOOP, - PROP_DIRECTION, - PROP_SCREEN, - PROP_PROGRESS_TYPE, -}; - -enum { - STARTED, - PAUSED, - FINISHED, - FRAME, - LAST_SIGNAL -}; - -static guint signals [LAST_SIGNAL] = { 0, }; - - -static void gsd_timeline_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec); -static void gsd_timeline_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec); -static void gsd_timeline_finalize (GObject *object); - - -G_DEFINE_TYPE_WITH_PRIVATE (GsdTimeline, gsd_timeline, G_TYPE_OBJECT) -#define GSD_TIMELINE_GET_PRIVATE(obj) (gsd_timeline_get_instance_private (obj)) - - -GType -gsd_timeline_direction_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) - { - static const GEnumValue values[] = { - { GSD_TIMELINE_DIRECTION_FORWARD, "GSD_TIMELINE_DIRECTION_FORWARD", "forward" }, - { GSD_TIMELINE_DIRECTION_BACKWARD, "GSD_TIMELINE_DIRECTION_BACKWARD", "backward" }, - { 0, NULL, NULL } - }; - - type = g_enum_register_static (g_intern_static_string ("GsdTimelineDirection"), values); - } - - return type; -} - -GType -gsd_timeline_progress_type_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) - { - static const GEnumValue values[] = { - { GSD_TIMELINE_PROGRESS_LINEAR, "GSD_TIMELINE_PROGRESS_LINEAR", "linear" }, - { GSD_TIMELINE_PROGRESS_SINUSOIDAL, "GSD_TIMELINE_PROGRESS_SINUSOIDAL", "sinusoidal" }, - { GSD_TIMELINE_PROGRESS_EXPONENTIAL, "GSD_TIMELINE_PROGRESS_EXPONENTIAL", "exponential" }, - { 0, NULL, NULL } - }; - - type = g_enum_register_static (g_intern_static_string ("GsdTimelineProgressType"), values); - } - - return type; -} - -static void -gsd_timeline_class_init (GsdTimelineClass *class) -{ - GObjectClass *object_class = G_OBJECT_CLASS (class); - - object_class->set_property = gsd_timeline_set_property; - object_class->get_property = gsd_timeline_get_property; - object_class->finalize = gsd_timeline_finalize; - - g_object_class_install_property (object_class, - PROP_FPS, - g_param_spec_uint ("fps", - "FPS", - "Frames per second for the timeline", - 1, - G_MAXUINT, - DEFAULT_FPS, - G_PARAM_READWRITE)); - g_object_class_install_property (object_class, - PROP_DURATION, - g_param_spec_uint ("duration", - "Animation Duration", - "Animation Duration", - 0, - G_MAXUINT, - 0, - G_PARAM_READWRITE)); - g_object_class_install_property (object_class, - PROP_LOOP, - g_param_spec_boolean ("loop", - "Loop", - "Whether the timeline loops or not", - FALSE, - G_PARAM_READWRITE)); - g_object_class_install_property (object_class, - PROP_DIRECTION, - g_param_spec_enum ("direction", - "Direction", - "Whether the timeline moves forward or backward in time", - GSD_TYPE_TIMELINE_DIRECTION, - GSD_TIMELINE_DIRECTION_FORWARD, - G_PARAM_READWRITE)); - g_object_class_install_property (object_class, - PROP_DIRECTION, - g_param_spec_enum ("progress-type", - "Progress type", - "Type of progress through the timeline", - GSD_TYPE_TIMELINE_PROGRESS_TYPE, - GSD_TIMELINE_PROGRESS_LINEAR, - G_PARAM_READWRITE)); - g_object_class_install_property (object_class, - PROP_SCREEN, - g_param_spec_object ("screen", - "Screen", - "Screen to get the settings from", - GDK_TYPE_SCREEN, - G_PARAM_READWRITE)); - - signals[STARTED] = - g_signal_new ("started", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdTimelineClass, started), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[PAUSED] = - g_signal_new ("paused", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdTimelineClass, paused), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[FINISHED] = - g_signal_new ("finished", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdTimelineClass, finished), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[FRAME] = - g_signal_new ("frame", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GsdTimelineClass, frame), - NULL, NULL, - g_cclosure_marshal_VOID__DOUBLE, - G_TYPE_NONE, 1, - G_TYPE_DOUBLE); -} - -static void -gsd_timeline_init (GsdTimeline *timeline) -{ - GsdTimelinePrivate *priv; - - priv = GSD_TIMELINE_GET_PRIVATE (timeline); - - priv->fps = DEFAULT_FPS; - priv->duration = 0; - priv->direction = GSD_TIMELINE_DIRECTION_FORWARD; - priv->screen = gdk_screen_get_default (); -} - -static void -gsd_timeline_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - GsdTimeline *timeline; - - timeline = GSD_TIMELINE (object); - - switch (prop_id) - { - case PROP_FPS: - gsd_timeline_set_fps (timeline, g_value_get_uint (value)); - break; - case PROP_DURATION: - gsd_timeline_set_duration (timeline, g_value_get_uint (value)); - break; - case PROP_LOOP: - gsd_timeline_set_loop (timeline, g_value_get_boolean (value)); - break; - case PROP_DIRECTION: - gsd_timeline_set_direction (timeline, g_value_get_enum (value)); - break; - case PROP_SCREEN: - gsd_timeline_set_screen (timeline, - GDK_SCREEN (g_value_get_object (value))); - break; - case PROP_PROGRESS_TYPE: - gsd_timeline_set_progress_type (timeline, g_value_get_enum (value)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - } -} - -static void -gsd_timeline_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - GsdTimeline *timeline; - GsdTimelinePrivate *priv; - - timeline = GSD_TIMELINE (object); - priv = GSD_TIMELINE_GET_PRIVATE (timeline); - - switch (prop_id) - { - case PROP_FPS: - g_value_set_uint (value, priv->fps); - break; - case PROP_DURATION: - g_value_set_uint (value, priv->duration); - break; - case PROP_LOOP: - g_value_set_boolean (value, priv->loop); - break; - case PROP_DIRECTION: - g_value_set_enum (value, priv->direction); - break; - case PROP_SCREEN: - g_value_set_object (value, priv->screen); - break; - case PROP_PROGRESS_TYPE: - g_value_set_enum (value, priv->progress_type); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - } -} - -static void -gsd_timeline_finalize (GObject *object) -{ - GsdTimelinePrivate *priv; - - priv = GSD_TIMELINE_GET_PRIVATE (GSD_TIMELINE (object)); - - if (priv->source_id) - { - g_source_remove (priv->source_id); - priv->source_id = 0; - } - - if (priv->timer) - g_timer_destroy (priv->timer); - - G_OBJECT_CLASS (gsd_timeline_parent_class)->finalize (object); -} - -/* Sinusoidal progress */ -static gdouble -sinusoidal_progress (gdouble progress) -{ - return (sinf ((progress * G_PI) / 2)); -} - -static gdouble -exponential_progress (gdouble progress) -{ - return progress * progress; -} - -static GsdTimelineProgressFunc -progress_type_to_func (GsdTimelineProgressType type) -{ - if (type == GSD_TIMELINE_PROGRESS_SINUSOIDAL) - return sinusoidal_progress; - else if (type == GSD_TIMELINE_PROGRESS_EXPONENTIAL) - return exponential_progress; - - return NULL; -} - -static gboolean -gsd_timeline_run_frame (GsdTimeline *timeline, - gboolean enable_animations) -{ - GsdTimelinePrivate *priv; - gdouble linear_progress, progress; - guint elapsed_time; - GsdTimelineProgressFunc progress_func = NULL; - - priv = GSD_TIMELINE_GET_PRIVATE (timeline); - - if (enable_animations) - { - elapsed_time = (guint) (g_timer_elapsed (priv->timer, NULL) * 1000); - - linear_progress = (gdouble) elapsed_time / priv->duration; - - if (priv->direction == GSD_TIMELINE_DIRECTION_BACKWARD) - linear_progress = 1 - linear_progress; - - linear_progress = CLAMP (linear_progress, 0., 1.); - - if (priv->progress_func) - progress_func = priv->progress_func; - else if (priv->progress_type) - progress_func = progress_type_to_func (priv->progress_type); - - if (progress_func) - progress = (progress_func) (linear_progress); - else - progress = linear_progress; - } - else - progress = (priv->direction == GSD_TIMELINE_DIRECTION_FORWARD) ? 1.0 : 0.0; - - g_signal_emit (timeline, signals [FRAME], 0, - CLAMP (progress, 0.0, 1.0)); - - if ((priv->direction == GSD_TIMELINE_DIRECTION_FORWARD && progress >= 1.0) || - (priv->direction == GSD_TIMELINE_DIRECTION_BACKWARD && progress <= 0.0)) - { - if (!priv->loop) - { - if (priv->source_id) - { - g_source_remove (priv->source_id); - priv->source_id = 0; - } - - g_signal_emit (timeline, signals [FINISHED], 0); - return FALSE; - } - else - gsd_timeline_rewind (timeline); - } - - return TRUE; -} - -static gboolean -gsd_timeline_frame_idle_func (GsdTimeline *timeline) -{ - return gsd_timeline_run_frame (timeline, TRUE); -} - -/** - * gsd_timeline_new: - * @duration: duration in milliseconds for the timeline - * - * Creates a new #GsdTimeline with the specified number of frames. - * - * Return Value: the newly created #GsdTimeline - **/ -GsdTimeline * -gsd_timeline_new (guint duration) -{ - return g_object_new (GSD_TYPE_TIMELINE, - "duration", duration, - NULL); -} - -GsdTimeline * -gsd_timeline_new_for_screen (guint duration, - GdkScreen *screen) -{ - return g_object_new (GSD_TYPE_TIMELINE, - "duration", duration, - "screen", screen, - NULL); -} - -/** - * gsd_timeline_start: - * @timeline: A #GsdTimeline - * - * Runs the timeline from the current frame. - **/ -void -gsd_timeline_start (GsdTimeline *timeline) -{ - GsdTimelinePrivate *priv; - GtkSettings *settings; - gboolean enable_animations = FALSE; - - g_return_if_fail (GSD_IS_TIMELINE (timeline)); - - priv = GSD_TIMELINE_GET_PRIVATE (timeline); - - if (priv->screen) - { - settings = gtk_settings_get_for_screen (priv->screen); - g_object_get (settings, "gtk-enable-animations", &enable_animations, NULL); - } - - if (enable_animations) - { - if (!priv->source_id) - { - if (priv->timer) - g_timer_continue (priv->timer); - else - priv->timer = g_timer_new (); - - /* sanity check */ - g_assert (priv->fps > 0); - - g_signal_emit (timeline, signals [STARTED], 0); - - priv->source_id = gdk_threads_add_timeout (FRAME_INTERVAL (priv->fps), - (GSourceFunc) gsd_timeline_frame_idle_func, - timeline); - } - } - else - { - /* If animations are not enabled, only run the last frame, - * it take us instantaneously to the last state of the animation. - * The only potential flaw happens when people use the ::finished - * signal to trigger another animation, or even worse, finally - * loop into this animation again. - */ - g_signal_emit (timeline, signals [STARTED], 0); - gsd_timeline_run_frame (timeline, FALSE); - } -} - -/** - * gsd_timeline_pause: - * @timeline: A #GsdTimeline - * - * Pauses the timeline. - **/ -void -gsd_timeline_pause (GsdTimeline *timeline) -{ - GsdTimelinePrivate *priv; - - g_return_if_fail (GSD_IS_TIMELINE (timeline)); - - priv = GSD_TIMELINE_GET_PRIVATE (timeline); - - if (priv->source_id) - { - g_source_remove (priv->source_id); - priv->source_id = 0; - g_timer_stop (priv->timer); - g_signal_emit (timeline, signals [PAUSED], 0); - } -} - -/** - * gsd_timeline_rewind: - * @timeline: A #GsdTimeline - * - * Rewinds the timeline. - **/ -void -gsd_timeline_rewind (GsdTimeline *timeline) -{ - GsdTimelinePrivate *priv; - - g_return_if_fail (GSD_IS_TIMELINE (timeline)); - - priv = GSD_TIMELINE_GET_PRIVATE (timeline); - - /* destroy and re-create timer if neccesary */ - if (priv->timer) - { - g_timer_destroy (priv->timer); - - if (gsd_timeline_is_running (timeline)) - priv->timer = g_timer_new (); - else - priv->timer = NULL; - } -} - -/** - * gsd_timeline_is_running: - * @timeline: A #GsdTimeline - * - * Returns whether the timeline is running or not. - * - * Return Value: %TRUE if the timeline is running - **/ -gboolean -gsd_timeline_is_running (GsdTimeline *timeline) -{ - GsdTimelinePrivate *priv; - - g_return_val_if_fail (GSD_IS_TIMELINE (timeline), FALSE); - - priv = GSD_TIMELINE_GET_PRIVATE (timeline); - - return (priv->source_id != 0); -} - -/** - * gsd_timeline_get_fps: - * @timeline: A #GsdTimeline - * - * Returns the number of frames per second. - * - * Return Value: frames per second - **/ -guint -gsd_timeline_get_fps (GsdTimeline *timeline) -{ - GsdTimelinePrivate *priv; - - g_return_val_if_fail (GSD_IS_TIMELINE (timeline), 1); - - priv = GSD_TIMELINE_GET_PRIVATE (timeline); - return priv->fps; -} - -/** - * gsd_timeline_set_fps: - * @timeline: A #GsdTimeline - * @fps: frames per second - * - * Sets the number of frames per second that - * the timeline will play. - **/ -void -gsd_timeline_set_fps (GsdTimeline *timeline, - guint fps) -{ - GsdTimelinePrivate *priv; - - g_return_if_fail (GSD_IS_TIMELINE (timeline)); - g_return_if_fail (fps > 0); - - priv = GSD_TIMELINE_GET_PRIVATE (timeline); - - priv->fps = fps; - - if (gsd_timeline_is_running (timeline)) - { - g_source_remove (priv->source_id); - priv->source_id = gdk_threads_add_timeout (FRAME_INTERVAL (priv->fps), - (GSourceFunc) gsd_timeline_run_frame, - timeline); - } - - g_object_notify (G_OBJECT (timeline), "fps"); -} - -/** - * gsd_timeline_get_loop: - * @timeline: A #GsdTimeline - * - * Returns whether the timeline loops to the - * beginning when it has reached the end. - * - * Return Value: %TRUE if the timeline loops - **/ -gboolean -gsd_timeline_get_loop (GsdTimeline *timeline) -{ - GsdTimelinePrivate *priv; - - g_return_val_if_fail (GSD_IS_TIMELINE (timeline), FALSE); - - priv = GSD_TIMELINE_GET_PRIVATE (timeline); - return priv->loop; -} - -/** - * gsd_timeline_set_loop: - * @timeline: A #GsdTimeline - * @loop: %TRUE to make the timeline loop - * - * Sets whether the timeline loops to the beginning - * when it has reached the end. - **/ -void -gsd_timeline_set_loop (GsdTimeline *timeline, - gboolean loop) -{ - GsdTimelinePrivate *priv; - - g_return_if_fail (GSD_IS_TIMELINE (timeline)); - - priv = GSD_TIMELINE_GET_PRIVATE (timeline); - priv->loop = loop; - - g_object_notify (G_OBJECT (timeline), "loop"); -} - -void -gsd_timeline_set_duration (GsdTimeline *timeline, - guint duration) -{ - GsdTimelinePrivate *priv; - - g_return_if_fail (GSD_IS_TIMELINE (timeline)); - - priv = GSD_TIMELINE_GET_PRIVATE (timeline); - - priv->duration = duration; - - g_object_notify (G_OBJECT (timeline), "duration"); -} - -guint -gsd_timeline_get_duration (GsdTimeline *timeline) -{ - GsdTimelinePrivate *priv; - - g_return_val_if_fail (GSD_IS_TIMELINE (timeline), 0); - - priv = GSD_TIMELINE_GET_PRIVATE (timeline); - - return priv->duration; -} - -/** - * gsd_timeline_get_direction: - * @timeline: A #GsdTimeline - * - * Returns the direction of the timeline. - * - * Return Value: direction - **/ -GsdTimelineDirection -gsd_timeline_get_direction (GsdTimeline *timeline) -{ - GsdTimelinePrivate *priv; - - g_return_val_if_fail (GSD_IS_TIMELINE (timeline), GSD_TIMELINE_DIRECTION_FORWARD); - - priv = GSD_TIMELINE_GET_PRIVATE (timeline); - return priv->direction; -} - -/** - * gsd_timeline_set_direction: - * @timeline: A #GsdTimeline - * @direction: direction - * - * Sets the direction of the timeline. - **/ -void -gsd_timeline_set_direction (GsdTimeline *timeline, - GsdTimelineDirection direction) -{ - GsdTimelinePrivate *priv; - - g_return_if_fail (GSD_IS_TIMELINE (timeline)); - - priv = GSD_TIMELINE_GET_PRIVATE (timeline); - priv->direction = direction; - - g_object_notify (G_OBJECT (timeline), "direction"); -} - -GdkScreen * -gsd_timeline_get_screen (GsdTimeline *timeline) -{ - GsdTimelinePrivate *priv; - - g_return_val_if_fail (GSD_IS_TIMELINE (timeline), NULL); - - priv = GSD_TIMELINE_GET_PRIVATE (timeline); - return priv->screen; -} - -void -gsd_timeline_set_screen (GsdTimeline *timeline, - GdkScreen *screen) -{ - GsdTimelinePrivate *priv; - - g_return_if_fail (GSD_IS_TIMELINE (timeline)); - g_return_if_fail (GDK_IS_SCREEN (screen)); - - priv = GSD_TIMELINE_GET_PRIVATE (timeline); - - if (priv->screen) - g_object_unref (priv->screen); - - priv->screen = g_object_ref (screen); - - g_object_notify (G_OBJECT (timeline), "screen"); -} - -void -gsd_timeline_set_progress_type (GsdTimeline *timeline, - GsdTimelineProgressType type) -{ - GsdTimelinePrivate *priv; - - g_return_if_fail (GSD_IS_TIMELINE (timeline)); - - priv = GSD_TIMELINE_GET_PRIVATE (timeline); - - priv->progress_type = type; - - g_object_notify (G_OBJECT (timeline), "progress-type"); -} - -GsdTimelineProgressType -gsd_timeline_get_progress_type (GsdTimeline *timeline) -{ - GsdTimelinePrivate *priv; - - g_return_val_if_fail (GSD_IS_TIMELINE (timeline), GSD_TIMELINE_PROGRESS_LINEAR); - - priv = GSD_TIMELINE_GET_PRIVATE (timeline); - - if (priv->progress_func) - return GSD_TIMELINE_PROGRESS_LINEAR; - - return priv->progress_type; -} - -/** - * gsd_timeline_set_progress_func: - * @timeline: A #GsdTimeline - * @progress_func: progress function - * - * Sets the progress function. This function will be used to calculate - * a different progress to pass to the ::frame signal based on the - * linear progress through the timeline. Setting progress_func - * to %NULL will make the timeline use the default function, - * which is just a linear progress. - * - * All progresses are in the [0.0, 1.0] range. - **/ -void -gsd_timeline_set_progress_func (GsdTimeline *timeline, - GsdTimelineProgressFunc progress_func) -{ - GsdTimelinePrivate *priv; - - g_return_if_fail (GSD_IS_TIMELINE (timeline)); - - priv = GSD_TIMELINE_GET_PRIVATE (timeline); - priv->progress_func = progress_func; -} - -gdouble -gsd_timeline_get_progress (GsdTimeline *timeline) -{ - GsdTimelinePrivate *priv; - GsdTimelineProgressFunc progress_func = NULL; - gdouble linear_progress, progress; - guint elapsed_time; - - g_return_val_if_fail (GSD_IS_TIMELINE (timeline), 0.0); - - priv = GSD_TIMELINE_GET_PRIVATE (timeline); - - if (!priv->timer) - return 0.; - - elapsed_time = (guint) (g_timer_elapsed (priv->timer, NULL) * 1000); - - linear_progress = (gdouble) elapsed_time / priv->duration; - - if (priv->direction == GSD_TIMELINE_DIRECTION_BACKWARD) - linear_progress = 1 - linear_progress; - - linear_progress = CLAMP (linear_progress, 0., 1.); - - if (priv->progress_func) - progress_func = priv->progress_func; - else if (priv->progress_type) - progress_func = progress_type_to_func (priv->progress_type); - - if (progress_func) - progress = (progress_func) (linear_progress); - else - progress = linear_progress; - - return CLAMP (progress, 0., 1.); -} diff --git a/plugins/mouse/gsd-timeline.h b/plugins/mouse/gsd-timeline.h deleted file mode 100644 index 4dbc2e75..00000000 --- a/plugins/mouse/gsd-timeline.h +++ /dev/null @@ -1,110 +0,0 @@ -/* gsdtimeline.c - * - * Copyright (C) 2008 Carlos Garnacho <carlos@imendio.com> - * - * 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. - * - * 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 <http://www.gnu.org/licenses/>. - */ - -#ifndef __GSD_TIMELINE_H__ -#define __GSD_TIMELINE_H__ - -#include <glib-object.h> -#include <gdk/gdk.h> - -G_BEGIN_DECLS - -#define GSD_TYPE_TIMELINE_DIRECTION (gsd_timeline_direction_get_type ()) -#define GSD_TYPE_TIMELINE_PROGRESS_TYPE (gsd_timeline_progress_type_get_type ()) -#define GSD_TYPE_TIMELINE (gsd_timeline_get_type ()) - -typedef enum { - GSD_TIMELINE_DIRECTION_FORWARD, - GSD_TIMELINE_DIRECTION_BACKWARD -} GsdTimelineDirection; - -typedef enum { - GSD_TIMELINE_PROGRESS_LINEAR, - GSD_TIMELINE_PROGRESS_SINUSOIDAL, - GSD_TIMELINE_PROGRESS_EXPONENTIAL -} GsdTimelineProgressType; - -G_DECLARE_DERIVABLE_TYPE (GsdTimeline, gsd_timeline, GSD, TIMELINE, GObject) - -struct _GsdTimelineClass -{ - GObjectClass parent_class; - - void (* started) (GsdTimeline *timeline); - void (* finished) (GsdTimeline *timeline); - void (* paused) (GsdTimeline *timeline); - - void (* frame) (GsdTimeline *timeline, - gdouble progress); - - void (* __gsd_reserved1) (void); - void (* __gsd_reserved2) (void); - void (* __gsd_reserved3) (void); - void (* __gsd_reserved4) (void); -}; - -typedef gdouble (*GsdTimelineProgressFunc) (gdouble progress); - - -GType gsd_timeline_direction_get_type (void) G_GNUC_CONST; -GType gsd_timeline_progress_type_get_type (void) G_GNUC_CONST; - -GsdTimeline *gsd_timeline_new (guint duration); -GsdTimeline *gsd_timeline_new_for_screen (guint duration, - GdkScreen *screen); - -void gsd_timeline_start (GsdTimeline *timeline); -void gsd_timeline_pause (GsdTimeline *timeline); -void gsd_timeline_rewind (GsdTimeline *timeline); - -gboolean gsd_timeline_is_running (GsdTimeline *timeline); - -guint gsd_timeline_get_fps (GsdTimeline *timeline); -void gsd_timeline_set_fps (GsdTimeline *timeline, - guint fps); - -gboolean gsd_timeline_get_loop (GsdTimeline *timeline); -void gsd_timeline_set_loop (GsdTimeline *timeline, - gboolean loop); - -guint gsd_timeline_get_duration (GsdTimeline *timeline); -void gsd_timeline_set_duration (GsdTimeline *timeline, - guint duration); - -GdkScreen *gsd_timeline_get_screen (GsdTimeline *timeline); -void gsd_timeline_set_screen (GsdTimeline *timeline, - GdkScreen *screen); - -GsdTimelineDirection gsd_timeline_get_direction (GsdTimeline *timeline); -void gsd_timeline_set_direction (GsdTimeline *timeline, - GsdTimelineDirection direction); - -GsdTimelineProgressType gsd_timeline_get_progress_type (GsdTimeline *timeline); -void gsd_timeline_set_progress_type (GsdTimeline *timeline, - GsdTimelineProgressType type); -void gsd_timeline_get_progress_func (GsdTimeline *timeline); - -void gsd_timeline_set_progress_func (GsdTimeline *timeline, - GsdTimelineProgressFunc progress_func); - -gdouble gsd_timeline_get_progress (GsdTimeline *timeline); - - -G_END_DECLS - -#endif /* __GSD_TIMELINE_H__ */ diff --git a/plugins/mouse/meson.build b/plugins/mouse/meson.build index 9de6a1a8..92623d56 100644 --- a/plugins/mouse/meson.build +++ b/plugins/mouse/meson.build @@ -23,23 +23,8 @@ executable( install_dir: gsd_libexecdir ) -sources = files( - 'gsd-locate-pointer.c', - 'gsd-timeline.c' -) - deps = [ gtk_dep, m_dep, x11_dep ] - -executable( - 'gsd-locate-pointer', - sources, - include_directories: top_inc, - dependencies: deps, - install: true, - install_rpath: gsd_pkglibdir, - install_dir: gsd_libexecdir -) |