2011-11-24 15:49:49 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2011 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, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* Author: Bastien Nocera <hadess@hadess.net>
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GSD_WACOM_DEVICE_MANAGER_H
|
|
|
|
#define __GSD_WACOM_DEVICE_MANAGER_H
|
|
|
|
|
|
|
|
#include <glib-object.h>
|
2012-07-03 11:49:36 +02:00
|
|
|
#include "gsd-enums.h"
|
2011-11-24 15:49:49 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2012-02-07 15:16:23 +00:00
|
|
|
#define NUM_ELEMS_MATRIX 9
|
|
|
|
|
2011-11-24 15:49:49 +00:00
|
|
|
#define GSD_TYPE_WACOM_DEVICE (gsd_wacom_device_get_type ())
|
|
|
|
#define GSD_WACOM_DEVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_WACOM_DEVICE, GsdWacomDevice))
|
|
|
|
#define GSD_WACOM_DEVICE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GSD_TYPE_WACOM_DEVICE, GsdWacomDeviceClass))
|
|
|
|
#define GSD_IS_WACOM_DEVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_WACOM_DEVICE))
|
|
|
|
#define GSD_IS_WACOM_DEVICE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_WACOM_DEVICE))
|
|
|
|
#define GSD_WACOM_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_WACOM_DEVICE, GsdWacomDeviceClass))
|
|
|
|
|
|
|
|
typedef struct GsdWacomDevicePrivate GsdWacomDevicePrivate;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
GObject parent;
|
|
|
|
GsdWacomDevicePrivate *priv;
|
|
|
|
} GsdWacomDevice;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
GObjectClass parent_class;
|
|
|
|
} GsdWacomDeviceClass;
|
|
|
|
|
|
|
|
#define GSD_TYPE_WACOM_STYLUS (gsd_wacom_stylus_get_type ())
|
|
|
|
#define GSD_WACOM_STYLUS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_WACOM_STYLUS, GsdWacomStylus))
|
|
|
|
#define GSD_WACOM_STYLUS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GSD_TYPE_WACOM_STYLUS, GsdWacomStylusClass))
|
|
|
|
#define GSD_IS_WACOM_STYLUS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_WACOM_STYLUS))
|
|
|
|
#define GSD_IS_WACOM_STYLUS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_WACOM_STYLUS))
|
|
|
|
#define GSD_WACOM_STYLUS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_WACOM_STYLUS, GsdWacomStylusClass))
|
|
|
|
|
|
|
|
typedef struct GsdWacomStylusPrivate GsdWacomStylusPrivate;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
GObject parent;
|
|
|
|
GsdWacomStylusPrivate *priv;
|
|
|
|
} GsdWacomStylus;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
GObjectClass parent_class;
|
|
|
|
} GsdWacomStylusClass;
|
|
|
|
|
2012-01-16 16:07:08 +00:00
|
|
|
typedef enum {
|
|
|
|
WACOM_STYLUS_TYPE_UNKNOWN,
|
|
|
|
WACOM_STYLUS_TYPE_GENERAL,
|
|
|
|
WACOM_STYLUS_TYPE_INKING,
|
|
|
|
WACOM_STYLUS_TYPE_AIRBRUSH,
|
|
|
|
WACOM_STYLUS_TYPE_CLASSIC,
|
|
|
|
WACOM_STYLUS_TYPE_MARKER,
|
2012-01-31 14:10:48 +00:00
|
|
|
WACOM_STYLUS_TYPE_STROKE,
|
|
|
|
WACOM_STYLUS_TYPE_PUCK
|
2012-01-16 16:07:08 +00:00
|
|
|
} GsdWacomStylusType;
|
|
|
|
|
|
|
|
GType gsd_wacom_stylus_get_type (void);
|
|
|
|
GSettings * gsd_wacom_stylus_get_settings (GsdWacomStylus *stylus);
|
|
|
|
const char * gsd_wacom_stylus_get_name (GsdWacomStylus *stylus);
|
|
|
|
const char * gsd_wacom_stylus_get_icon_name (GsdWacomStylus *stylus);
|
|
|
|
GsdWacomDevice * gsd_wacom_stylus_get_device (GsdWacomStylus *stylus);
|
|
|
|
gboolean gsd_wacom_stylus_get_has_eraser (GsdWacomStylus *stylus);
|
2012-02-07 15:16:23 +00:00
|
|
|
guint gsd_wacom_stylus_get_num_buttons(GsdWacomStylus *stylus);
|
2012-01-25 19:12:13 +00:00
|
|
|
int gsd_wacom_stylus_get_id (GsdWacomStylus *stylus);
|
2012-01-16 16:07:08 +00:00
|
|
|
GsdWacomStylusType gsd_wacom_stylus_get_stylus_type (GsdWacomStylus *stylus);
|
2011-11-24 15:49:49 +00:00
|
|
|
|
2012-02-07 15:16:23 +00:00
|
|
|
/* Tablet Buttons */
|
|
|
|
typedef enum {
|
|
|
|
WACOM_TABLET_BUTTON_TYPE_NORMAL,
|
|
|
|
WACOM_TABLET_BUTTON_TYPE_ELEVATOR,
|
|
|
|
WACOM_TABLET_BUTTON_TYPE_HARDCODED
|
|
|
|
} GsdWacomTabletButtonType;
|
|
|
|
|
2012-02-14 18:46:29 +00:00
|
|
|
#define MAX_GROUP_ID 4
|
|
|
|
|
2012-02-07 15:16:23 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
char *name;
|
|
|
|
char *id;
|
2012-02-08 17:04:38 +00:00
|
|
|
GSettings *settings;
|
2012-02-07 15:16:23 +00:00
|
|
|
GsdWacomTabletButtonType type;
|
2012-02-27 16:48:26 +00:00
|
|
|
int group_id, idx;
|
2012-02-07 15:16:23 +00:00
|
|
|
} GsdWacomTabletButton;
|
|
|
|
|
|
|
|
void gsd_wacom_tablet_button_free (GsdWacomTabletButton *button);
|
|
|
|
GsdWacomTabletButton *gsd_wacom_tablet_button_copy (GsdWacomTabletButton *button);
|
|
|
|
|
2011-11-24 15:49:49 +00:00
|
|
|
/* Device types to apply a setting to */
|
|
|
|
typedef enum {
|
|
|
|
WACOM_TYPE_INVALID = 0,
|
|
|
|
WACOM_TYPE_STYLUS = (1 << 1),
|
|
|
|
WACOM_TYPE_ERASER = (1 << 2),
|
|
|
|
WACOM_TYPE_CURSOR = (1 << 3),
|
|
|
|
WACOM_TYPE_PAD = (1 << 4),
|
2012-02-07 15:16:23 +00:00
|
|
|
WACOM_TYPE_TOUCH = (1 << 5),
|
|
|
|
WACOM_TYPE_ALL = WACOM_TYPE_STYLUS | WACOM_TYPE_ERASER | WACOM_TYPE_CURSOR | WACOM_TYPE_PAD | WACOM_TYPE_TOUCH
|
2011-11-24 15:49:49 +00:00
|
|
|
} GsdWacomDeviceType;
|
|
|
|
|
2012-08-21 17:59:36 +02:00
|
|
|
/* We use -1 for entire screen when setting/getting monitor value */
|
|
|
|
#define GSD_WACOM_SET_ALL_MONITORS -1
|
|
|
|
|
2011-11-24 15:49:49 +00:00
|
|
|
GType gsd_wacom_device_get_type (void);
|
|
|
|
|
2012-02-14 18:46:29 +00:00
|
|
|
void gsd_wacom_device_set_display (GsdWacomDevice *device,
|
|
|
|
int monitor);
|
2012-01-17 15:25:25 -08:00
|
|
|
gint gsd_wacom_device_get_display_monitor (GsdWacomDevice *device);
|
|
|
|
gboolean gsd_wacom_device_get_display_matrix (GsdWacomDevice *device,
|
|
|
|
float matrix[NUM_ELEMS_MATRIX]);
|
2012-07-03 11:49:36 +02:00
|
|
|
GsdWacomRotation gsd_wacom_device_get_display_rotation (GsdWacomDevice *device);
|
2012-01-17 15:25:25 -08:00
|
|
|
|
2011-11-24 15:49:49 +00:00
|
|
|
GsdWacomDevice * gsd_wacom_device_new (GdkDevice *device);
|
|
|
|
GList * gsd_wacom_device_list_styli (GsdWacomDevice *device);
|
|
|
|
const char * gsd_wacom_device_get_name (GsdWacomDevice *device);
|
2012-03-05 18:32:52 +00:00
|
|
|
const char * gsd_wacom_device_get_path (GsdWacomDevice *device);
|
2011-11-25 14:06:34 +00:00
|
|
|
const char * gsd_wacom_device_get_icon_name (GsdWacomDevice *device);
|
2011-11-24 15:49:49 +00:00
|
|
|
const char * gsd_wacom_device_get_tool_name (GsdWacomDevice *device);
|
|
|
|
gboolean gsd_wacom_device_reversible (GsdWacomDevice *device);
|
|
|
|
gboolean gsd_wacom_device_is_screen_tablet (GsdWacomDevice *device);
|
2012-06-19 15:42:45 +02:00
|
|
|
gboolean gsd_wacom_device_is_fallback (GsdWacomDevice *device);
|
2011-11-24 15:49:49 +00:00
|
|
|
GSettings * gsd_wacom_device_get_settings (GsdWacomDevice *device);
|
2011-12-14 18:55:43 +00:00
|
|
|
void gsd_wacom_device_set_current_stylus (GsdWacomDevice *device,
|
|
|
|
int stylus_id);
|
2012-01-16 16:07:08 +00:00
|
|
|
GsdWacomStylus * gsd_wacom_device_get_stylus_for_type (GsdWacomDevice *device,
|
|
|
|
GsdWacomStylusType type);
|
2011-11-24 15:49:49 +00:00
|
|
|
|
|
|
|
GsdWacomDeviceType gsd_wacom_device_get_device_type (GsdWacomDevice *device);
|
2012-01-10 19:54:23 +00:00
|
|
|
gint * gsd_wacom_device_get_area (GsdWacomDevice *device);
|
|
|
|
const char * gsd_wacom_device_type_to_string (GsdWacomDeviceType type);
|
2012-02-07 15:16:23 +00:00
|
|
|
GList * gsd_wacom_device_get_buttons (GsdWacomDevice *device);
|
2012-02-14 18:46:29 +00:00
|
|
|
GsdWacomTabletButton *gsd_wacom_device_get_button (GsdWacomDevice *device,
|
|
|
|
int button,
|
|
|
|
GtkDirectionType *dir);
|
2012-02-27 16:48:26 +00:00
|
|
|
int gsd_wacom_device_set_next_mode (GsdWacomDevice *device,
|
|
|
|
int group_id);
|
2012-07-03 11:49:36 +02:00
|
|
|
GsdWacomRotation gsd_wacom_device_rotation_name_to_type (const char *rotation);
|
|
|
|
const char * gsd_wacom_device_rotation_type_to_name (GsdWacomRotation type);
|
|
|
|
|
2011-11-24 15:49:49 +00:00
|
|
|
|
2011-11-25 16:09:13 +00:00
|
|
|
/* Helper and debug functions */
|
|
|
|
GsdWacomDevice * gsd_wacom_device_create_fake (GsdWacomDeviceType type,
|
|
|
|
const char *name,
|
2011-12-12 18:18:39 +00:00
|
|
|
const char *tool_name);
|
2011-11-25 16:09:13 +00:00
|
|
|
|
|
|
|
GList * gsd_wacom_device_create_fake_cintiq (void);
|
2011-11-25 16:30:30 +00:00
|
|
|
GList * gsd_wacom_device_create_fake_bt (void);
|
2011-11-25 16:35:31 +00:00
|
|
|
GList * gsd_wacom_device_create_fake_x201 (void);
|
2012-01-13 17:45:21 +00:00
|
|
|
GList * gsd_wacom_device_create_fake_intuos4 (void);
|
2011-11-25 16:09:13 +00:00
|
|
|
|
2011-11-24 15:49:49 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GSD_WACOM_DEVICE_MANAGER_H */
|