mutter/src/backends/meta-input-settings-private.h

195 lines
10 KiB
C
Raw Normal View History

/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright 2014 Red Hat, Inc.
*
* 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/>.
*
* Author: Carlos Garnacho <carlosg@gnome.org>
*/
#pragma once
#include <gdesktop-enums.h>
#ifdef HAVE_LIBWACOM
#include <libwacom/libwacom.h>
#endif
#include "backends/meta-backend-types.h"
#include "clutter/clutter.h"
#include "meta/display.h"
#define META_TYPE_INPUT_SETTINGS (meta_input_settings_get_type ())
G_DECLARE_DERIVABLE_TYPE (MetaInputSettings, meta_input_settings,
META, INPUT_SETTINGS, GObject)
/**
* MetaKbdA11ySettings:
*
* The #MetaKbdA11ySettings structure contains keyboard accessibility
* settings
*
*/
typedef struct _MetaKbdA11ySettings
{
MetaKeyboardA11yFlags controls;
int slowkeys_delay;
int debounce_delay;
int timeout_delay;
int mousekeys_init_delay;
int mousekeys_max_speed;
int mousekeys_accel_time;
} MetaKbdA11ySettings;
struct _MetaInputSettingsClass
{
GObjectClass parent_class;
void (* set_send_events) (MetaInputSettings *settings,
ClutterInputDevice *device,
GDesktopDeviceSendEvents mode);
void (* set_matrix) (MetaInputSettings *settings,
ClutterInputDevice *device,
const float matrix[6]);
void (* set_speed) (MetaInputSettings *settings,
ClutterInputDevice *device,
gdouble speed);
void (* set_left_handed) (MetaInputSettings *settings,
ClutterInputDevice *device,
gboolean enabled);
void (* set_tap_enabled) (MetaInputSettings *settings,
ClutterInputDevice *device,
gboolean enabled);
void (* set_tap_button_map) (MetaInputSettings *settings,
ClutterInputDevice *device,
GDesktopTouchpadTapButtonMap mode);
void (* set_tap_and_drag_enabled) (MetaInputSettings *settings,
ClutterInputDevice *device,
gboolean enabled);
void (* set_tap_and_drag_lock_enabled) (MetaInputSettings *settings,
ClutterInputDevice *device,
gboolean enabled);
void (* set_disable_while_typing) (MetaInputSettings *settings,
ClutterInputDevice *device,
gboolean enabled);
void (* set_invert_scroll) (MetaInputSettings *settings,
ClutterInputDevice *device,
gboolean inverted);
void (* set_edge_scroll) (MetaInputSettings *settings,
ClutterInputDevice *device,
gboolean enabled);
void (* set_two_finger_scroll) (MetaInputSettings *settings,
ClutterInputDevice *device,
gboolean enabled);
void (* set_scroll_button) (MetaInputSettings *settings,
ClutterInputDevice *device,
guint button,
gboolean button_lock);
void (* set_click_method) (MetaInputSettings *settings,
ClutterInputDevice *device,
GDesktopTouchpadClickMethod mode);
void (* set_keyboard_repeat) (MetaInputSettings *settings,
gboolean repeat,
guint delay,
guint interval);
void (* set_tablet_mapping) (MetaInputSettings *settings,
ClutterInputDevice *device,
GDesktopTabletMapping mapping);
void (* set_tablet_aspect_ratio) (MetaInputSettings *settings,
ClutterInputDevice *device,
double ratio);
void (* set_tablet_area) (MetaInputSettings *settings,
ClutterInputDevice *device,
gdouble padding_left,
gdouble padding_right,
gdouble padding_top,
gdouble padding_bottom);
void (* set_mouse_accel_profile) (MetaInputSettings *settings,
ClutterInputDevice *device,
GDesktopPointerAccelProfile profile);
void (* set_touchpad_accel_profile) (MetaInputSettings *settings,
ClutterInputDevice *device,
GDesktopPointerAccelProfile profile);
void (* set_trackball_accel_profile) (MetaInputSettings *settings,
ClutterInputDevice *device,
GDesktopPointerAccelProfile profile);
void (* set_pointing_stick_accel_profile) (MetaInputSettings *settings,
ClutterInputDevice *device,
GDesktopPointerAccelProfile profile);
void (* set_pointing_stick_scroll_method) (MetaInputSettings *settings,
ClutterInputDevice *device,
GDesktopPointingStickScrollMethod profile);
void (* set_stylus_pressure) (MetaInputSettings *settings,
ClutterInputDevice *device,
ClutterInputDeviceTool *tool,
const gint32 curve[4]);
void (* set_stylus_button_map) (MetaInputSettings *settings,
ClutterInputDevice *device,
ClutterInputDeviceTool *tool,
GDesktopStylusButtonAction primary,
GDesktopStylusButtonAction secondary,
GDesktopStylusButtonAction tertiary);
void (* set_mouse_middle_click_emulation) (MetaInputSettings *settings,
ClutterInputDevice *device,
gboolean enabled);
void (* set_touchpad_middle_click_emulation) (MetaInputSettings *settings,
ClutterInputDevice *device,
gboolean enabled);
void (* set_trackball_middle_click_emulation) (MetaInputSettings *settings,
ClutterInputDevice *device,
gboolean enabled);
gboolean (* has_two_finger_scroll) (MetaInputSettings *settings,
ClutterInputDevice *device);
gboolean (* is_pointing_stick_device) (MetaInputSettings *settings,
ClutterInputDevice *device);
};
void meta_input_settings_maybe_save_numlock_state (MetaInputSettings *input_settings,
gboolean numlock_state);
gboolean meta_input_settings_maybe_restore_numlock_state (MetaInputSettings *input_settings);
void meta_input_settings_set_device_matrix (MetaInputSettings *input_settings,
ClutterInputDevice *device,
float matrix[6]);
void meta_input_settings_set_device_enabled (MetaInputSettings *input_settings,
ClutterInputDevice *device,
gboolean enabled);
void meta_input_settings_set_device_aspect_ratio (MetaInputSettings *input_settings,
ClutterInputDevice *device,
double aspect_ratio);
void meta_input_settings_get_kbd_a11y_settings (MetaInputSettings *input_settings,
MetaKbdA11ySettings *a11y_settings);
void meta_input_settings_add_device (MetaInputSettings *input_settings,
ClutterInputDevice *device);
void meta_input_settings_remove_device (MetaInputSettings *input_settings,
ClutterInputDevice *device);
void meta_input_settings_notify_tool_change (MetaInputSettings *input_settings,
ClutterInputDevice *device,
ClutterInputDeviceTool *tool);
void meta_input_settings_notify_kbd_a11y_change (MetaInputSettings *input_settings,
MetaKeyboardA11yFlags new_flags,
MetaKeyboardA11yFlags what_changed);
backend: Set up and use ownership chains This means objects have an owner, where the chain eventually always leads to a MetaContext. This also means that all objects can find their way to other object instances via the chain, instead of scattered global singletons. This is a squashed commit originally containing the following: cursor-tracker: Don't get backend from singleton idle-manager: Don't get backend from singleton input-device: Pass pointer to backend during construction The backend is needed during construction to get the wacom database. input-mapper: Pass backend when constructing monitor: Don't get backend from singleton monitor-manager: Get backend directly from monitor manager remote: Get backend from manager class For the remote desktop and screen cast implementations, replace getting the backend from singletons with getting it via the manager classes. launcher: Pass backend during construction device-pool: Pass backend during construction Instead of passing the (maybe null) launcher, pass the backend, and get the launcher from there. That way we always have a way to some known context from the device pool. drm-buffer/gbm: Get backend via device pool cursor-renderer: Get backend directly from renderer input-device: Get backend getter input-settings: Add backend construct property and getter input-settings/x11: Don't get backend from singleton renderer: Get backend from renderer itself seat-impl: Add backend getter seat/native: Get backend from instance struct stage-impl: Get backend from stage impl itself x11/xkb-a11y: Don't get backend from singleton backend/x11/nested: Don't get Wayland compositor from singleton crtc: Add backend property Adding a link to the GPU isn't enough; the virtual CRTCs of virtual monitors doesn't have one. cursor-tracker: Don't get display from singleton remote: Don't get display from singleton seat: Don't get display from singleton backend/x11: Don't get display from singleton Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2718>
2022-05-27 13:35:01 -04:00
MetaBackend * meta_input_settings_get_backend (MetaInputSettings *input_settings);