2015-01-19 18:55:51 +01:00
|
|
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
|
|
|
|
*
|
|
|
|
* Copyright (C) 2014 Carlos Garnacho <carlosg@gnome.org>
|
|
|
|
*
|
|
|
|
* 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, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2018-06-01 12:15:08 +12:00
|
|
|
#pragma once
|
2015-01-19 18:55:51 +01:00
|
|
|
|
2016-06-06 14:06:57 +02:00
|
|
|
#include <gdk/gdk.h>
|
2015-01-19 18:55:51 +01:00
|
|
|
#include <glib-object.h>
|
|
|
|
#include <gio/gio.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2018-06-01 12:13:10 +12:00
|
|
|
#define GSD_TYPE_DEVICE (gsd_device_get_type ())
|
|
|
|
G_DECLARE_DERIVABLE_TYPE (GsdDevice, gsd_device, GSD, DEVICE, GObject)
|
|
|
|
|
|
|
|
#define GSD_TYPE_DEVICE_MANAGER (gsd_device_manager_get_type ())
|
|
|
|
G_DECLARE_DERIVABLE_TYPE (GsdDeviceManager, gsd_device_manager, GSD, DEVICE_MANAGER, GObject)
|
2015-01-19 18:55:51 +01:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
GSD_DEVICE_TYPE_MOUSE = 1 << 0,
|
|
|
|
GSD_DEVICE_TYPE_KEYBOARD = 1 << 1,
|
|
|
|
GSD_DEVICE_TYPE_TOUCHPAD = 1 << 2,
|
|
|
|
GSD_DEVICE_TYPE_TABLET = 1 << 3,
|
2016-06-06 14:30:11 +02:00
|
|
|
GSD_DEVICE_TYPE_TOUCHSCREEN = 1 << 4,
|
|
|
|
GSD_DEVICE_TYPE_PAD = 1 << 5
|
2015-01-19 18:55:51 +01:00
|
|
|
} GsdDeviceType;
|
|
|
|
|
|
|
|
struct _GsdDeviceClass {
|
|
|
|
GObjectClass parent_class;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _GsdDeviceManagerClass
|
|
|
|
{
|
|
|
|
GObjectClass parent_class;
|
|
|
|
|
|
|
|
GList * (* list_devices) (GsdDeviceManager *manager,
|
|
|
|
GsdDeviceType type);
|
|
|
|
|
|
|
|
void (* device_added) (GsdDeviceManager *manager,
|
|
|
|
GsdDevice *device);
|
|
|
|
void (* device_removed) (GsdDeviceManager *manager,
|
|
|
|
GsdDevice *device);
|
2015-12-17 15:41:46 +01:00
|
|
|
void (* device_changed) (GsdDeviceManager *manager,
|
|
|
|
GsdDevice *device);
|
2016-06-06 14:06:57 +02:00
|
|
|
|
|
|
|
GsdDevice * (* lookup_device) (GsdDeviceManager *manager,
|
|
|
|
GdkDevice *gdk_device);
|
2015-01-19 18:55:51 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
GsdDeviceManager * gsd_device_manager_get (void);
|
|
|
|
GList * gsd_device_manager_list_devices (GsdDeviceManager *manager,
|
|
|
|
GsdDeviceType type);
|
|
|
|
|
|
|
|
const gchar * gsd_device_get_name (GsdDevice *device);
|
|
|
|
GsdDeviceType gsd_device_get_device_type (GsdDevice *device);
|
|
|
|
void gsd_device_get_device_ids (GsdDevice *device,
|
|
|
|
const gchar **vendor,
|
|
|
|
const gchar **product);
|
|
|
|
GSettings * gsd_device_get_settings (GsdDevice *device);
|
|
|
|
|
|
|
|
const gchar * gsd_device_get_device_file (GsdDevice *device);
|
|
|
|
gboolean gsd_device_get_dimensions (GsdDevice *device,
|
|
|
|
guint *width,
|
|
|
|
guint *height);
|
|
|
|
|
|
|
|
GsdDevice * gsd_device_manager_lookup_gdk_device (GsdDeviceManager *manager,
|
|
|
|
GdkDevice *gdk_device);
|
2019-12-05 15:52:32 +01:00
|
|
|
gboolean gsd_device_shares_group (GsdDevice *device1,
|
|
|
|
GsdDevice *device2);
|
2015-01-19 18:55:51 +01:00
|
|
|
|
|
|
|
G_END_DECLS
|