Compare commits
3 Commits
wip/tablet
...
wip/rtcm/m
Author | SHA1 | Date | |
---|---|---|---|
a24c66137f | |||
44a07fd74b | |||
d148b445e4 |
15
NEWS
15
NEWS
@ -1,18 +1,3 @@
|
||||
3.21.1
|
||||
======
|
||||
* Notify clients of pending modifier state changes [Rui; #748526]
|
||||
* Add get_is_builtin_display_on() method [Florian; #765267]
|
||||
* Fix 2-finger titlebar taps on wayland [Carlos; #764519]
|
||||
* Merge clutter and cogl forks into mutter [Rui; #760439]
|
||||
* Misc. bug fixes [Florian, Victor, Jonas; #765058, #765252, #765062]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Emmanuele Bassi, Olivier Fourdan, Carlos Garnacho, Rui Matos,
|
||||
Florian Müllner, Victor Toso, Rico Tzschichholz
|
||||
|
||||
Translations:
|
||||
GNOME Translation Robot [ja, gd]
|
||||
|
||||
3.20.1
|
||||
======
|
||||
* Constrain window move/resizes on wayland as on X11 [Rui; #748819]
|
||||
|
@ -87,7 +87,6 @@ source_h = \
|
||||
clutter-group.h \
|
||||
clutter-image.h \
|
||||
clutter-input-device.h \
|
||||
clutter-input-device-tool.h \
|
||||
clutter-interval.h \
|
||||
clutter-keyframe-transition.h \
|
||||
clutter-keysyms.h \
|
||||
@ -168,7 +167,6 @@ source_c = \
|
||||
clutter-grid-layout.c \
|
||||
clutter-image.c \
|
||||
clutter-input-device.c \
|
||||
clutter-input-device-tool.c \
|
||||
clutter-interval.c \
|
||||
clutter-keyframe-transition.c \
|
||||
clutter-keysyms-table.c \
|
||||
@ -461,16 +459,13 @@ evdev_c_priv = \
|
||||
evdev/clutter-device-manager-evdev.c \
|
||||
evdev/clutter-input-device-evdev.c \
|
||||
evdev/clutter-event-evdev.c \
|
||||
evdev/clutter-input-device-tool-evdev.c \
|
||||
$(NULL)
|
||||
evdev_h_priv = \
|
||||
evdev/clutter-device-manager-evdev.h \
|
||||
evdev/clutter-input-device-evdev.h \
|
||||
evdev/clutter-input-device-tool-evdev.h \
|
||||
$(NULL)
|
||||
evdev_h = evdev/clutter-evdev.h
|
||||
|
||||
if SUPPORT_WAYLAND
|
||||
backend_source_c_priv += $(evdev_c_priv)
|
||||
backend_source_h_priv += $(evdev_h_priv)
|
||||
backend_source_h += $(evdev_h)
|
||||
@ -506,7 +501,6 @@ backend_source_h_priv += $(egl_source_h_priv)
|
||||
|
||||
clutteregl_includedir = $(clutter_includedir)/egl
|
||||
clutteregl_include_HEADERS = $(egl_source_h)
|
||||
endif # SUPPORT_WAYLAND
|
||||
|
||||
# cally
|
||||
cally_sources_h = \
|
||||
@ -649,7 +643,7 @@ Clutter_@CLUTTER_API_VERSION_AM@_gir_INCLUDES = GL-1.0 GObject-2.0 cairo-1.0 Cog
|
||||
Clutter_@CLUTTER_API_VERSION_AM@_gir_SCANNERFLAGS = \
|
||||
--warn-all \
|
||||
--c-include='clutter/clutter.h' \
|
||||
--pkg-export=mutter-clutter-@CLUTTER_API_VERSION@
|
||||
--pkg-export=clutter-@CLUTTER_API_VERSION@
|
||||
|
||||
INTROSPECTION_GIRS += Clutter-@CLUTTER_API_VERSION@.gir
|
||||
|
||||
@ -663,7 +657,7 @@ Cally_@CLUTTER_API_VERSION_AM@_gir_CFLAGS = $(AM_CPPFLAGS) $(CLUTTER_CFLAGS)
|
||||
Cally_@CLUTTER_API_VERSION_AM@_gir_SCANNERFLAGS = \
|
||||
--warn-all \
|
||||
--c-include='cally/cally.h' \
|
||||
--pkg-export=mutter-cally-@CLUTTER_API_VERSION@ \
|
||||
--pkg-export=cally-@CLUTTER_API_VERSION@ \
|
||||
--include-uninstalled=$(top_builddir)/clutter/Clutter-@CLUTTER_API_VERSION@.gir
|
||||
|
||||
INTROSPECTION_GIRS += Cally-@CLUTTER_API_VERSION@.gir
|
||||
@ -678,7 +672,7 @@ ClutterX11_@CLUTTER_API_VERSION_AM@_gir_CFLAGS = $(AM_CPPFLAGS) $(CLUTTER_CFLAGS
|
||||
ClutterX11_@CLUTTER_API_VERSION_AM@_gir_SCANNERFLAGS = \
|
||||
--warn-all \
|
||||
--c-include='clutter/x11/clutter-x11.h' \
|
||||
--pkg-export=mutter-clutter-x11-@CLUTTER_API_VERSION@ \
|
||||
--pkg-export=clutter-x11-@CLUTTER_API_VERSION@ \
|
||||
--include-uninstalled=$(top_builddir)/clutter/Clutter-@CLUTTER_API_VERSION@.gir
|
||||
|
||||
INTROSPECTION_GIRS += ClutterX11-@CLUTTER_API_VERSION@.gir
|
||||
|
@ -132,8 +132,6 @@ struct _ClutterInputDevice
|
||||
gchar *vendor_id;
|
||||
gchar *product_id;
|
||||
|
||||
GPtrArray *tools;
|
||||
|
||||
guint has_cursor : 1;
|
||||
guint is_enabled : 1;
|
||||
};
|
||||
@ -145,8 +143,6 @@ struct _ClutterInputDeviceClass
|
||||
gboolean (* keycode_to_evdev) (ClutterInputDevice *device,
|
||||
guint hardware_keycode,
|
||||
guint *evdev_keycode);
|
||||
void (* update_from_tool) (ClutterInputDevice *device,
|
||||
ClutterInputDeviceTool *tool);
|
||||
};
|
||||
|
||||
/* Platform-dependent interface */
|
||||
@ -239,15 +235,6 @@ gboolean _clutter_input_device_get_scroll_delta (ClutterInputDev
|
||||
ClutterScrollDirection *direction_p,
|
||||
gdouble *delta_p);
|
||||
|
||||
ClutterInputDeviceTool * clutter_input_device_lookup_tool (ClutterInputDevice *device,
|
||||
guint64 serial,
|
||||
ClutterInputDeviceToolType type);
|
||||
void clutter_input_device_add_tool (ClutterInputDevice *device,
|
||||
ClutterInputDeviceTool *tool);
|
||||
|
||||
void clutter_input_device_update_from_tool (ClutterInputDevice *device,
|
||||
ClutterInputDeviceTool *tool);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_DEVICE_MANAGER_PRIVATE_H__ */
|
||||
|
@ -761,10 +761,6 @@ typedef enum { /*< flags prefix=CLUTTER_EVENT >*/
|
||||
* determined by its phase field; event added in 1.24
|
||||
* @CLUTTER_TOUCHPAD_SWIPE: A swipe gesture event, the current state is
|
||||
* determined by its phase field; event added in 1.24
|
||||
* @CLUTTER_PROXIMITY_IN: A tool entered in proximity to a tablet;
|
||||
* event added in 1.28
|
||||
* @CLUTTER_PROXIMITY_OUT: A tool left from the proximity area of a tablet;
|
||||
* event added in 1.28
|
||||
* @CLUTTER_EVENT_LAST: Marks the end of the #ClutterEventType enumeration;
|
||||
* added in 1.10
|
||||
*
|
||||
@ -792,8 +788,6 @@ typedef enum { /*< prefix=CLUTTER >*/
|
||||
CLUTTER_TOUCH_CANCEL,
|
||||
CLUTTER_TOUCHPAD_PINCH,
|
||||
CLUTTER_TOUCHPAD_SWIPE,
|
||||
CLUTTER_PROXIMITY_IN,
|
||||
CLUTTER_PROXIMITY_OUT,
|
||||
|
||||
CLUTTER_EVENT_LAST /* helper */
|
||||
} ClutterEventType;
|
||||
@ -952,8 +946,6 @@ typedef enum {
|
||||
* @CLUTTER_INPUT_AXIS_YTILT: The tile on the Y axis
|
||||
* @CLUTTER_INPUT_AXIS_WHEEL: A wheel
|
||||
* @CLUTTER_INPUT_AXIS_DISTANCE: Distance (Since 1.12)
|
||||
* @CLUTTER_INPUT_AXIS_ROTATION: Rotation along the z-axis (Since 1.28)
|
||||
* @CLUTTER_INPUT_AXIS_SLIDER: A slider (Since 1.28)
|
||||
* @CLUTTER_INPUT_AXIS_LAST: Last value of the enumeration; this value is
|
||||
* useful when iterating over the enumeration values (Since 1.12)
|
||||
*
|
||||
@ -971,8 +963,6 @@ typedef enum {
|
||||
CLUTTER_INPUT_AXIS_YTILT,
|
||||
CLUTTER_INPUT_AXIS_WHEEL,
|
||||
CLUTTER_INPUT_AXIS_DISTANCE,
|
||||
CLUTTER_INPUT_AXIS_ROTATION,
|
||||
CLUTTER_INPUT_AXIS_SLIDER,
|
||||
|
||||
CLUTTER_INPUT_AXIS_LAST
|
||||
} ClutterInputAxis;
|
||||
@ -1494,32 +1484,6 @@ typedef enum {
|
||||
CLUTTER_SCROLL_FINISHED_VERTICAL = 1 << 1
|
||||
} ClutterScrollFinishFlags;
|
||||
|
||||
/**
|
||||
* ClutterInputDeviceToolType:
|
||||
* @CLUTTER_INPUT_DEVICE_TOOL_NONE: No tool
|
||||
* @CLUTTER_INPUT_DEVICE_TOOL_PEN: The tool is a pen
|
||||
* @CLUTTER_INPUT_DEVICE_TOOL_ERASER: The tool is an eraser
|
||||
* @CLUTTER_INPUT_DEVICE_TOOL_BRUSH: The tool is a brush
|
||||
* @CLUTTER_INPUT_DEVICE_TOOL_PENCIL: The tool is a pencil
|
||||
* @CLUTTER_INPUT_DEVICE_TOOL_AIRBRUSH: The tool is an airbrush
|
||||
* @CLUTTER_INPUT_DEVICE_TOOL_MOUSE: The tool is a mouse
|
||||
* @CLUTTER_INPUT_DEVICE_TOOL_LENS: The tool is a lens
|
||||
*
|
||||
* Defines the type of tool that a #ClutterInputDeviceTool represents.
|
||||
*
|
||||
* Since: 1.28
|
||||
*/
|
||||
typedef enum {
|
||||
CLUTTER_INPUT_DEVICE_TOOL_NONE,
|
||||
CLUTTER_INPUT_DEVICE_TOOL_PEN,
|
||||
CLUTTER_INPUT_DEVICE_TOOL_ERASER,
|
||||
CLUTTER_INPUT_DEVICE_TOOL_BRUSH,
|
||||
CLUTTER_INPUT_DEVICE_TOOL_PENCIL,
|
||||
CLUTTER_INPUT_DEVICE_TOOL_AIRBRUSH,
|
||||
CLUTTER_INPUT_DEVICE_TOOL_MOUSE,
|
||||
CLUTTER_INPUT_DEVICE_TOOL_LENS
|
||||
} ClutterInputDeviceToolType;
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_ENUMS_H__ */
|
||||
|
@ -54,8 +54,6 @@ typedef struct _ClutterEventPrivate {
|
||||
gdouble delta_x;
|
||||
gdouble delta_y;
|
||||
|
||||
ClutterInputDeviceTool *tool;
|
||||
|
||||
gpointer platform_data;
|
||||
|
||||
ClutterModifierType button_state;
|
||||
@ -411,8 +409,6 @@ clutter_event_get_position (const ClutterEvent *event,
|
||||
case CLUTTER_CLIENT_MESSAGE:
|
||||
case CLUTTER_DELETE:
|
||||
case CLUTTER_EVENT_LAST:
|
||||
case CLUTTER_PROXIMITY_IN:
|
||||
case CLUTTER_PROXIMITY_OUT:
|
||||
clutter_point_init (position, 0.f, 0.f);
|
||||
break;
|
||||
|
||||
@ -481,8 +477,6 @@ clutter_event_set_coords (ClutterEvent *event,
|
||||
case CLUTTER_CLIENT_MESSAGE:
|
||||
case CLUTTER_DELETE:
|
||||
case CLUTTER_EVENT_LAST:
|
||||
case CLUTTER_PROXIMITY_IN:
|
||||
case CLUTTER_PROXIMITY_OUT:
|
||||
break;
|
||||
|
||||
case CLUTTER_ENTER:
|
||||
@ -1128,11 +1122,6 @@ clutter_event_set_device (ClutterEvent *event,
|
||||
case CLUTTER_TOUCHPAD_SWIPE:
|
||||
/* Rely on priv data for these */
|
||||
break;
|
||||
|
||||
case CLUTTER_PROXIMITY_IN:
|
||||
case CLUTTER_PROXIMITY_OUT:
|
||||
event->proximity.device = device;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1212,64 +1201,11 @@ clutter_event_get_device (const ClutterEvent *event)
|
||||
case CLUTTER_TOUCHPAD_SWIPE:
|
||||
/* Rely on priv data for these */
|
||||
break;
|
||||
|
||||
case CLUTTER_PROXIMITY_IN:
|
||||
case CLUTTER_PROXIMITY_OUT:
|
||||
device = event->proximity.device;
|
||||
break;
|
||||
}
|
||||
|
||||
return device;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_event_set_device_tool:
|
||||
* @event: a #ClutterEvent
|
||||
* @tool: (nullable): a #ClutterInputDeviceTool
|
||||
*
|
||||
* Sets the tool in use for this event
|
||||
*
|
||||
* Since: 1.28
|
||||
**/
|
||||
void
|
||||
clutter_event_set_device_tool (ClutterEvent *event,
|
||||
ClutterInputDeviceTool *tool)
|
||||
{
|
||||
g_return_if_fail (event != NULL);
|
||||
|
||||
if (is_event_allocated (event))
|
||||
{
|
||||
ClutterEventPrivate *real_event = (ClutterEventPrivate *) event;
|
||||
|
||||
real_event->tool = tool;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_event_get_device_tool:
|
||||
* @event: a #ClutterEvent
|
||||
*
|
||||
* Returns the device tool that originated this event
|
||||
*
|
||||
* Returns: (transfer none): The tool of this event
|
||||
*
|
||||
* Since: 1.28
|
||||
**/
|
||||
ClutterInputDeviceTool *
|
||||
clutter_event_get_device_tool (const ClutterEvent *event)
|
||||
{
|
||||
g_return_val_if_fail (event != NULL, NULL);
|
||||
|
||||
if (is_event_allocated (event))
|
||||
{
|
||||
ClutterEventPrivate *real_event = (ClutterEventPrivate *) event;
|
||||
|
||||
return real_event->tool;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_event_new:
|
||||
* @type: The type of event.
|
||||
@ -1333,7 +1269,6 @@ clutter_event_copy (const ClutterEvent *event)
|
||||
new_real_event->button_state = real_event->button_state;
|
||||
new_real_event->latched_state = real_event->latched_state;
|
||||
new_real_event->locked_state = real_event->locked_state;
|
||||
new_real_event->tool = real_event->tool;
|
||||
}
|
||||
|
||||
device = clutter_event_get_device (event);
|
||||
@ -1682,8 +1617,6 @@ clutter_event_get_axes (const ClutterEvent *event,
|
||||
case CLUTTER_KEY_PRESS:
|
||||
case CLUTTER_KEY_RELEASE:
|
||||
case CLUTTER_EVENT_LAST:
|
||||
case CLUTTER_PROXIMITY_IN:
|
||||
case CLUTTER_PROXIMITY_OUT:
|
||||
break;
|
||||
|
||||
case CLUTTER_SCROLL:
|
||||
|
@ -117,7 +117,6 @@ typedef struct _ClutterCrossingEvent ClutterCrossingEvent;
|
||||
typedef struct _ClutterTouchEvent ClutterTouchEvent;
|
||||
typedef struct _ClutterTouchpadPinchEvent ClutterTouchpadPinchEvent;
|
||||
typedef struct _ClutterTouchpadSwipeEvent ClutterTouchpadSwipeEvent;
|
||||
typedef struct _ClutterProximityEvent ClutterProximityEvent;
|
||||
|
||||
/**
|
||||
* ClutterAnyEvent:
|
||||
@ -214,30 +213,6 @@ struct _ClutterButtonEvent
|
||||
ClutterInputDevice *device;
|
||||
};
|
||||
|
||||
/**
|
||||
* ClutterProximityEvent:
|
||||
* @type: event type
|
||||
* @time: event time
|
||||
* @flags: event flags
|
||||
* @stage: event source stage
|
||||
* @source: event source actor
|
||||
* @device: the device that originated the event. If you want the physical
|
||||
* device the event originated from, use clutter_event_get_source_device()
|
||||
*
|
||||
* Event for tool proximity in tablet devices
|
||||
*
|
||||
* Since: 1.28
|
||||
*/
|
||||
struct _ClutterProximityEvent
|
||||
{
|
||||
ClutterEventType type;
|
||||
guint32 time;
|
||||
ClutterEventFlags flags;
|
||||
ClutterStage *stage;
|
||||
ClutterActor *source;
|
||||
ClutterInputDevice *device;
|
||||
};
|
||||
|
||||
/**
|
||||
* ClutterCrossingEvent:
|
||||
* @type: event type
|
||||
@ -515,7 +490,6 @@ union _ClutterEvent
|
||||
ClutterTouchEvent touch;
|
||||
ClutterTouchpadPinchEvent touchpad_pinch;
|
||||
ClutterTouchpadSwipeEvent touchpad_swipe;
|
||||
ClutterProximityEvent proximity;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -601,13 +575,6 @@ void clutter_event_set_source_device (ClutterEvent
|
||||
|
||||
CLUTTER_AVAILABLE_IN_1_6
|
||||
ClutterInputDevice * clutter_event_get_source_device (const ClutterEvent *event);
|
||||
|
||||
CLUTTER_AVAILABLE_IN_ALL
|
||||
void clutter_event_set_device_tool (ClutterEvent *event,
|
||||
ClutterInputDeviceTool *tool);
|
||||
CLUTTER_AVAILABLE_IN_ALL
|
||||
ClutterInputDeviceTool *clutter_event_get_device_tool (const ClutterEvent *event);
|
||||
|
||||
CLUTTER_AVAILABLE_IN_1_8
|
||||
void clutter_event_set_source (ClutterEvent *event,
|
||||
ClutterActor *actor);
|
||||
|
@ -1,172 +0,0 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Copyright © 2009, 2010, 2011 Intel Corp.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Carlos Garnacho <carlosg@gnome.org>
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "clutter-input-device-tool.h"
|
||||
#include "clutter-private.h"
|
||||
|
||||
typedef struct _ClutterInputDeviceToolPrivate ClutterInputDeviceToolPrivate;
|
||||
|
||||
struct _ClutterInputDeviceToolPrivate
|
||||
{
|
||||
ClutterInputDeviceToolType type;
|
||||
guint64 serial;
|
||||
};
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_TYPE,
|
||||
PROP_SERIAL,
|
||||
PROP_LAST
|
||||
};
|
||||
|
||||
static GParamSpec *props[PROP_LAST] = { NULL, };
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (ClutterInputDeviceTool, clutter_input_device_tool, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
clutter_input_device_tool_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
ClutterInputDeviceTool *tool = CLUTTER_INPUT_DEVICE_TOOL (object);
|
||||
ClutterInputDeviceToolPrivate *priv;
|
||||
|
||||
priv = clutter_input_device_tool_get_instance_private (tool);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_TYPE:
|
||||
priv->type = g_value_get_enum (value);
|
||||
break;
|
||||
case PROP_SERIAL:
|
||||
priv->serial = g_value_get_uint64 (value);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_input_device_tool_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
ClutterInputDeviceTool *tool = CLUTTER_INPUT_DEVICE_TOOL (object);
|
||||
ClutterInputDeviceToolPrivate *priv;
|
||||
|
||||
priv = clutter_input_device_tool_get_instance_private (tool);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_TYPE:
|
||||
g_value_set_enum (value, priv->type);
|
||||
break;
|
||||
case PROP_SERIAL:
|
||||
g_value_set_uint64 (value, priv->serial);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_input_device_tool_class_init (ClutterInputDeviceToolClass *klass)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
gobject_class->set_property = clutter_input_device_tool_set_property;
|
||||
gobject_class->get_property = clutter_input_device_tool_get_property;
|
||||
|
||||
props[PROP_TYPE] =
|
||||
g_param_spec_enum ("type",
|
||||
P_("Tool type"),
|
||||
P_("Tool type"),
|
||||
CLUTTER_TYPE_INPUT_DEVICE_TOOL_TYPE,
|
||||
CLUTTER_INPUT_DEVICE_TOOL_NONE,
|
||||
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
||||
props[PROP_SERIAL] =
|
||||
g_param_spec_uint64 ("serial",
|
||||
P_("Tool serial"),
|
||||
P_("Tool serial"),
|
||||
0, G_MAXUINT64, 0,
|
||||
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
||||
|
||||
g_object_class_install_properties (gobject_class, PROP_LAST, props);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_input_device_tool_init (ClutterInputDeviceTool *tool)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_input_device_tool_get_serial:
|
||||
* @tool: a #ClutterInputDeviceTool
|
||||
*
|
||||
* Gets the serial of this tool, this value can be used to identify a
|
||||
* physical tool (eg. a tablet pen) across program executions.
|
||||
*
|
||||
* Returns: The serial ID for this tool
|
||||
*
|
||||
* Since: 1.28
|
||||
**/
|
||||
guint
|
||||
clutter_input_device_tool_get_serial (ClutterInputDeviceTool *tool)
|
||||
{
|
||||
ClutterInputDeviceToolPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE_TOOL (tool), 0);
|
||||
|
||||
priv = clutter_input_device_tool_get_instance_private (tool);
|
||||
|
||||
return priv->serial;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* clutter_input_device_tool_get_tool_type:
|
||||
* @tool: a #ClutterInputDeviceTool
|
||||
*
|
||||
* Gets the tool type of this tool.
|
||||
*
|
||||
* Returns: The tool type of this tool
|
||||
*
|
||||
* Since: 1.28
|
||||
**/
|
||||
ClutterInputDeviceToolType
|
||||
clutter_input_device_tool_get_tool_type (ClutterInputDeviceTool *tool)
|
||||
{
|
||||
ClutterInputDeviceToolPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE_TOOL (tool), 0);
|
||||
|
||||
priv = clutter_input_device_tool_get_instance_private (tool);
|
||||
|
||||
return priv->type;
|
||||
}
|
@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Copyright © 2009, 2010, 2011 Intel Corp.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Carlos Garnacho <carlosg@gnome.org>
|
||||
*/
|
||||
|
||||
#ifndef __CLUTTER_INPUT_DEVICE_TOOL_H__
|
||||
#define __CLUTTER_INPUT_DEVICE_TOOL_H__
|
||||
|
||||
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
#error "Only <clutter/clutter.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <clutter/clutter-types.h>
|
||||
#include "clutter-enum-types.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define CLUTTER_TYPE_INPUT_DEVICE_TOOL (clutter_input_device_tool_get_type ())
|
||||
#define CLUTTER_INPUT_DEVICE_TOOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_INPUT_DEVICE_TOOL, ClutterInputDeviceTool))
|
||||
#define CLUTTER_IS_INPUT_DEVICE_TOOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_INPUT_DEVICE_TOOL))
|
||||
#define CLUTTER_INPUT_DEVICE_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_INPUT_DEVICE_TOOL, ClutterInputDeviceToolClass))
|
||||
#define CLUTTER_IS_INPUT_DEVICE_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_INPUT_DEVICE_TOOL))
|
||||
#define CLUTTER_INPUT_DEVICE_TOOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_INPUT_DEVICE_TOOL, ClutterInputDeviceToolClass))
|
||||
|
||||
typedef struct _ClutterInputDeviceToolClass ClutterInputDeviceToolClass;
|
||||
|
||||
struct _ClutterInputDeviceTool
|
||||
{
|
||||
GObject parent_instance;
|
||||
};
|
||||
|
||||
struct _ClutterInputDeviceToolClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
CLUTTER_AVAILABLE_IN_ALL
|
||||
GType clutter_input_device_tool_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_AVAILABLE_IN_ALL
|
||||
guint clutter_input_device_tool_get_serial (ClutterInputDeviceTool *tool);
|
||||
|
||||
CLUTTER_AVAILABLE_IN_ALL
|
||||
ClutterInputDeviceToolType clutter_input_device_tool_get_tool_type (ClutterInputDeviceTool *tool);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_INPUT_DEVICE_TOOL_H__ */
|
@ -45,7 +45,6 @@
|
||||
#include "clutter-marshal.h"
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-stage-private.h"
|
||||
#include "clutter-input-device-tool.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
@ -74,11 +73,7 @@ enum
|
||||
};
|
||||
|
||||
static void _clutter_input_device_free_touch_info (gpointer data);
|
||||
static void on_cursor_actor_destroy (ClutterActor *actor,
|
||||
ClutterInputDevice *device);
|
||||
static void on_cursor_actor_reactive_changed (ClutterActor *actor,
|
||||
GParamSpec *pspec,
|
||||
ClutterInputDevice *device);
|
||||
|
||||
|
||||
static GParamSpec *obj_props[PROP_LAST] = { NULL, };
|
||||
|
||||
@ -108,18 +103,6 @@ clutter_input_device_dispose (GObject *gobject)
|
||||
g_clear_pointer (&device->scroll_info, g_array_unref);
|
||||
g_clear_pointer (&device->touch_sequences_info, g_hash_table_unref);
|
||||
|
||||
if (device->cursor_actor)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (device->cursor_actor,
|
||||
G_CALLBACK (on_cursor_actor_destroy),
|
||||
device);
|
||||
g_signal_handlers_disconnect_by_func (device->cursor_actor,
|
||||
G_CALLBACK (on_cursor_actor_reactive_changed),
|
||||
device);
|
||||
_clutter_actor_set_has_pointer (device->cursor_actor, FALSE);
|
||||
device->cursor_actor = NULL;
|
||||
}
|
||||
|
||||
if (device->inv_touch_sequence_actors)
|
||||
{
|
||||
GHashTableIter iter;
|
||||
@ -127,16 +110,7 @@ clutter_input_device_dispose (GObject *gobject)
|
||||
|
||||
g_hash_table_iter_init (&iter, device->inv_touch_sequence_actors);
|
||||
while (g_hash_table_iter_next (&iter, &key, &value))
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (key,
|
||||
G_CALLBACK (on_cursor_actor_destroy),
|
||||
device);
|
||||
g_signal_handlers_disconnect_by_func (device->cursor_actor,
|
||||
G_CALLBACK (on_cursor_actor_reactive_changed),
|
||||
device);
|
||||
_clutter_actor_set_has_pointer (key, FALSE);
|
||||
g_list_free (value);
|
||||
}
|
||||
g_list_free (value);
|
||||
|
||||
g_hash_table_unref (device->inv_touch_sequence_actors);
|
||||
device->inv_touch_sequence_actors = NULL;
|
||||
@ -624,6 +598,12 @@ _clutter_input_device_get_actor (ClutterInputDevice *device,
|
||||
return info->actor;
|
||||
}
|
||||
|
||||
static void on_cursor_actor_destroy (ClutterActor *actor,
|
||||
ClutterInputDevice *device);
|
||||
static void on_cursor_actor_reactive_changed (ClutterActor *actor,
|
||||
GParamSpec *pspec,
|
||||
ClutterInputDevice *device);
|
||||
|
||||
static void
|
||||
_clutter_input_device_associate_actor (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
@ -2012,57 +1992,3 @@ clutter_input_device_get_product_id (ClutterInputDevice *device)
|
||||
|
||||
return device->product_id;
|
||||
}
|
||||
|
||||
void
|
||||
clutter_input_device_add_tool (ClutterInputDevice *device,
|
||||
ClutterInputDeviceTool *tool)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_INPUT_DEVICE (device));
|
||||
g_return_if_fail (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_MASTER);
|
||||
g_return_if_fail (CLUTTER_IS_INPUT_DEVICE_TOOL (tool));
|
||||
|
||||
if (!device->tools)
|
||||
device->tools = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
|
||||
|
||||
g_ptr_array_add (device->tools, tool);
|
||||
}
|
||||
|
||||
ClutterInputDeviceTool *
|
||||
clutter_input_device_lookup_tool (ClutterInputDevice *device,
|
||||
guint64 serial,
|
||||
ClutterInputDeviceToolType type)
|
||||
{
|
||||
ClutterInputDeviceTool *tool;
|
||||
guint i;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), NULL);
|
||||
g_return_val_if_fail (clutter_input_device_get_device_mode (device) != CLUTTER_INPUT_MODE_MASTER, NULL);
|
||||
|
||||
if (!device->tools)
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < device->tools->len; i++)
|
||||
{
|
||||
tool = g_ptr_array_index (device->tools, i);
|
||||
|
||||
if (serial == clutter_input_device_tool_get_serial (tool) &&
|
||||
type == clutter_input_device_tool_get_tool_type (tool))
|
||||
return tool;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
clutter_input_device_update_from_tool (ClutterInputDevice *device,
|
||||
ClutterInputDeviceTool *tool)
|
||||
{
|
||||
ClutterInputDeviceClass *device_class;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_INPUT_DEVICE (device));
|
||||
|
||||
device_class = CLUTTER_INPUT_DEVICE_GET_CLASS (device);
|
||||
|
||||
if (device_class->update_from_tool)
|
||||
device_class->update_from_tool (device, tool);
|
||||
}
|
||||
|
@ -2487,22 +2487,6 @@ _clutter_process_event_details (ClutterActor *stage,
|
||||
break;
|
||||
}
|
||||
|
||||
case CLUTTER_PROXIMITY_IN:
|
||||
case CLUTTER_PROXIMITY_OUT:
|
||||
clutter_input_device_update_from_tool (clutter_event_get_source_device (event),
|
||||
clutter_event_get_device_tool (event));
|
||||
|
||||
if (_clutter_event_process_filters (event))
|
||||
break;
|
||||
|
||||
if (!clutter_actor_event (stage, event, TRUE))
|
||||
{
|
||||
/* and bubbling phase */
|
||||
clutter_actor_event (stage, event, FALSE);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case CLUTTER_STAGE_STATE:
|
||||
/* fullscreen / focus - forward to stage */
|
||||
event->any.source = stage;
|
||||
|
@ -930,9 +930,7 @@ _clutter_stage_queue_event (ClutterStage *stage,
|
||||
* event processing function
|
||||
*/
|
||||
device = clutter_event_get_device (event);
|
||||
if (device != NULL &&
|
||||
event->type != CLUTTER_PROXIMITY_IN &&
|
||||
event->type != CLUTTER_PROXIMITY_OUT)
|
||||
if (device != NULL)
|
||||
{
|
||||
ClutterModifierType event_state = clutter_event_get_state (event);
|
||||
ClutterEventSequence *sequence = clutter_event_get_event_sequence (event);
|
||||
|
@ -92,7 +92,6 @@ typedef struct _ClutterAnimation ClutterAnimation;
|
||||
typedef struct _ClutterAnimator ClutterAnimator;
|
||||
typedef struct _ClutterState ClutterState;
|
||||
|
||||
typedef struct _ClutterInputDeviceTool ClutterInputDeviceTool;
|
||||
typedef struct _ClutterInputDevice ClutterInputDevice;
|
||||
|
||||
typedef CoglMatrix ClutterMatrix;
|
||||
|
@ -71,7 +71,6 @@
|
||||
#include "clutter-group.h"
|
||||
#include "clutter-image.h"
|
||||
#include "clutter-input-device.h"
|
||||
#include "clutter-input-device-tool.h"
|
||||
#include "clutter-interval.h"
|
||||
#include "clutter-keyframe-transition.h"
|
||||
#include "clutter-keysyms.h"
|
||||
|
@ -53,7 +53,6 @@
|
||||
#include "clutter-backend-private.h"
|
||||
#include "clutter-evdev.h"
|
||||
#include "clutter-stage-private.h"
|
||||
#include "clutter-input-device-tool-evdev.h"
|
||||
|
||||
#include "clutter-device-manager-evdev.h"
|
||||
|
||||
@ -431,8 +430,7 @@ static ClutterEvent *
|
||||
new_absolute_motion_event (ClutterInputDevice *input_device,
|
||||
guint64 time_us,
|
||||
gfloat x,
|
||||
gfloat y,
|
||||
gdouble *axes)
|
||||
gfloat y)
|
||||
{
|
||||
gfloat stage_width, stage_height;
|
||||
ClutterDeviceManagerEvdev *manager_evdev;
|
||||
@ -451,8 +449,7 @@ new_absolute_motion_event (ClutterInputDevice *input_device,
|
||||
|
||||
event = clutter_event_new (CLUTTER_MOTION);
|
||||
|
||||
if (manager_evdev->priv->constrain_callback &&
|
||||
clutter_input_device_get_device_type (input_device) != CLUTTER_TABLET_DEVICE)
|
||||
if (manager_evdev->priv->constrain_callback)
|
||||
{
|
||||
manager_evdev->priv->constrain_callback (seat->core_pointer,
|
||||
us2ms (time_us),
|
||||
@ -474,24 +471,13 @@ new_absolute_motion_event (ClutterInputDevice *input_device,
|
||||
_clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
|
||||
event->motion.x = x;
|
||||
event->motion.y = y;
|
||||
event->motion.axes = axes;
|
||||
clutter_event_set_device (event, seat->core_pointer);
|
||||
clutter_event_set_source_device (event, input_device);
|
||||
|
||||
if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE)
|
||||
{
|
||||
clutter_event_set_device_tool (event, device_evdev->last_tool);
|
||||
clutter_event_set_device (event, input_device);
|
||||
}
|
||||
else
|
||||
clutter_event_set_device (event, seat->core_pointer);
|
||||
|
||||
_clutter_input_device_set_stage (seat->core_pointer, stage);
|
||||
|
||||
if (clutter_input_device_get_device_type (input_device) != CLUTTER_TABLET_DEVICE)
|
||||
{
|
||||
seat->pointer_x = x;
|
||||
seat->pointer_y = y;
|
||||
}
|
||||
seat->pointer_x = x;
|
||||
seat->pointer_y = y;
|
||||
|
||||
return event;
|
||||
}
|
||||
@ -499,13 +485,12 @@ new_absolute_motion_event (ClutterInputDevice *input_device,
|
||||
static void
|
||||
notify_absolute_motion (ClutterInputDevice *input_device,
|
||||
guint64 time_us,
|
||||
gfloat x,
|
||||
gfloat y,
|
||||
gdouble *axes)
|
||||
gfloat x,
|
||||
gfloat y)
|
||||
{
|
||||
ClutterEvent *event;
|
||||
|
||||
event = new_absolute_motion_event (input_device, time_us, x, y, axes);
|
||||
event = new_absolute_motion_event (input_device, time_us, x, y);
|
||||
|
||||
queue_event (event);
|
||||
}
|
||||
@ -538,7 +523,7 @@ notify_relative_motion (ClutterInputDevice *input_device,
|
||||
new_y = seat->pointer_y + dy;
|
||||
|
||||
time_us = libinput_event_pointer_get_time_usec (pointer_event);
|
||||
event = new_absolute_motion_event (input_device, time_us, new_x, new_y, NULL);
|
||||
event = new_absolute_motion_event (input_device, time_us, new_x, new_y);
|
||||
|
||||
dx_unaccel = libinput_event_pointer_get_dx_unaccelerated (pointer_event);
|
||||
dy_unaccel = libinput_event_pointer_get_dy_unaccelerated (pointer_event);
|
||||
@ -695,26 +680,20 @@ notify_button (ClutterInputDevice *input_device,
|
||||
switch (button)
|
||||
{
|
||||
case BTN_LEFT:
|
||||
case BTN_TOUCH:
|
||||
button_nr = CLUTTER_BUTTON_PRIMARY;
|
||||
break;
|
||||
|
||||
case BTN_RIGHT:
|
||||
case BTN_STYLUS:
|
||||
button_nr = CLUTTER_BUTTON_SECONDARY;
|
||||
break;
|
||||
|
||||
case BTN_MIDDLE:
|
||||
case BTN_STYLUS2:
|
||||
button_nr = CLUTTER_BUTTON_MIDDLE;
|
||||
break;
|
||||
|
||||
default:
|
||||
/* For compatibility reasons, all additional buttons go after the old 4-7 scroll ones */
|
||||
if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE)
|
||||
button_nr = button - BTN_TOOL_PEN + 4;
|
||||
else
|
||||
button_nr = button - (BTN_LEFT - 1) + 4;
|
||||
button_nr = button - (BTN_LEFT - 1) + 4;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -729,47 +708,25 @@ notify_button (ClutterInputDevice *input_device,
|
||||
else
|
||||
event = clutter_event_new (CLUTTER_BUTTON_RELEASE);
|
||||
|
||||
if (button_nr < G_N_ELEMENTS (maskmap))
|
||||
{
|
||||
/* Update the modifiers */
|
||||
if (state)
|
||||
seat->button_state |= maskmap[button_nr - 1];
|
||||
else
|
||||
seat->button_state &= ~maskmap[button_nr - 1];
|
||||
}
|
||||
/* Update the modifiers */
|
||||
if (state)
|
||||
seat->button_state |= maskmap[button - BTN_LEFT];
|
||||
else
|
||||
seat->button_state &= ~maskmap[button - BTN_LEFT];
|
||||
|
||||
_clutter_evdev_event_set_time_usec (event, time_us);
|
||||
event->button.time = us2ms (time_us);
|
||||
event->button.stage = CLUTTER_STAGE (stage);
|
||||
event->button.device = seat->core_pointer;
|
||||
_clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
|
||||
event->button.button = button_nr;
|
||||
|
||||
if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE)
|
||||
{
|
||||
ClutterPoint point;
|
||||
|
||||
clutter_input_device_get_coords (input_device, NULL, &point);
|
||||
event->button.x = point.x;
|
||||
event->button.y = point.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
event->button.x = seat->pointer_x;
|
||||
event->button.y = seat->pointer_y;
|
||||
}
|
||||
|
||||
event->button.x = seat->pointer_x;
|
||||
event->button.y = seat->pointer_y;
|
||||
clutter_event_set_device (event, seat->core_pointer);
|
||||
clutter_event_set_source_device (event, input_device);
|
||||
|
||||
_clutter_evdev_event_set_event_code (event, button);
|
||||
|
||||
if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE)
|
||||
{
|
||||
clutter_event_set_device_tool (event, device_evdev->last_tool);
|
||||
clutter_event_set_device (event, input_device);
|
||||
}
|
||||
else
|
||||
clutter_event_set_device (event, seat->core_pointer);
|
||||
|
||||
_clutter_input_device_set_stage (seat->core_pointer, stage);
|
||||
|
||||
queue_event (event);
|
||||
@ -911,44 +868,6 @@ notify_swipe_gesture_event (ClutterInputDevice *input_device,
|
||||
queue_event (event);
|
||||
}
|
||||
|
||||
static void
|
||||
notify_proximity (ClutterInputDevice *input_device,
|
||||
guint64 time_us,
|
||||
gboolean in)
|
||||
{
|
||||
ClutterInputDeviceEvdev *device_evdev;
|
||||
ClutterSeatEvdev *seat;
|
||||
ClutterStage *stage;
|
||||
ClutterEvent *event = NULL;
|
||||
|
||||
/* We can drop the event on the floor if no stage has been
|
||||
* associated with the device yet. */
|
||||
stage = _clutter_input_device_get_stage (input_device);
|
||||
if (stage == NULL)
|
||||
return;
|
||||
|
||||
device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (input_device);
|
||||
seat = _clutter_input_device_evdev_get_seat (device_evdev);
|
||||
|
||||
if (in)
|
||||
event = clutter_event_new (CLUTTER_PROXIMITY_IN);
|
||||
else
|
||||
event = clutter_event_new (CLUTTER_PROXIMITY_OUT);
|
||||
|
||||
_clutter_evdev_event_set_time_usec (event, time_us);
|
||||
|
||||
event->proximity.time = us2ms (time_us);
|
||||
event->proximity.stage = CLUTTER_STAGE (stage);
|
||||
event->proximity.device = seat->core_pointer;
|
||||
clutter_event_set_device_tool (event, device_evdev->last_tool);
|
||||
clutter_event_set_device (event, seat->core_pointer);
|
||||
clutter_event_set_source_device (event, input_device);
|
||||
|
||||
_clutter_input_device_set_stage (seat->core_pointer, stage);
|
||||
|
||||
queue_event (event);
|
||||
}
|
||||
|
||||
static void
|
||||
dispatch_libinput (ClutterDeviceManagerEvdev *manager_evdev)
|
||||
{
|
||||
@ -1511,122 +1430,6 @@ translate_scroll_source (enum libinput_pointer_axis_source source)
|
||||
}
|
||||
}
|
||||
|
||||
static ClutterInputDeviceToolType
|
||||
translate_tool_type (struct libinput_tablet_tool *libinput_tool)
|
||||
{
|
||||
enum libinput_tablet_tool_type tool;
|
||||
|
||||
tool = libinput_tablet_tool_get_type (libinput_tool);
|
||||
|
||||
switch (tool)
|
||||
{
|
||||
case LIBINPUT_TABLET_TOOL_TYPE_PEN:
|
||||
return CLUTTER_INPUT_DEVICE_TOOL_PEN;
|
||||
case LIBINPUT_TABLET_TOOL_TYPE_ERASER:
|
||||
return CLUTTER_INPUT_DEVICE_TOOL_ERASER;
|
||||
case LIBINPUT_TABLET_TOOL_TYPE_BRUSH:
|
||||
return CLUTTER_INPUT_DEVICE_TOOL_BRUSH;
|
||||
case LIBINPUT_TABLET_TOOL_TYPE_PENCIL:
|
||||
return CLUTTER_INPUT_DEVICE_TOOL_PENCIL;
|
||||
case LIBINPUT_TABLET_TOOL_TYPE_AIRBRUSH:
|
||||
return CLUTTER_INPUT_DEVICE_TOOL_AIRBRUSH;
|
||||
case LIBINPUT_TABLET_TOOL_TYPE_MOUSE:
|
||||
return CLUTTER_INPUT_DEVICE_TOOL_MOUSE;
|
||||
case LIBINPUT_TABLET_TOOL_TYPE_LENS:
|
||||
return CLUTTER_INPUT_DEVICE_TOOL_LENS;
|
||||
default:
|
||||
return CLUTTER_INPUT_DEVICE_TOOL_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
input_device_update_tool (ClutterInputDevice *input_device,
|
||||
struct libinput_tablet_tool *libinput_tool)
|
||||
{
|
||||
ClutterInputDeviceEvdev *evdev_device = CLUTTER_INPUT_DEVICE_EVDEV (input_device);
|
||||
ClutterInputDeviceTool *tool = NULL;
|
||||
ClutterInputDeviceToolType tool_type;
|
||||
guint64 tool_serial;
|
||||
|
||||
if (libinput_tool)
|
||||
{
|
||||
tool_serial = libinput_tablet_tool_get_serial (libinput_tool);
|
||||
tool_type = translate_tool_type (libinput_tool);
|
||||
tool = clutter_input_device_lookup_tool (input_device,
|
||||
tool_serial, tool_type);
|
||||
|
||||
if (!tool)
|
||||
{
|
||||
tool = clutter_input_device_tool_evdev_new (libinput_tool,
|
||||
tool_serial, tool_type);
|
||||
clutter_input_device_add_tool (input_device, tool);
|
||||
}
|
||||
}
|
||||
|
||||
evdev_device->last_tool = tool;
|
||||
}
|
||||
|
||||
static gdouble *
|
||||
translate_tablet_axes (struct libinput_event_tablet_tool *tablet_event)
|
||||
{
|
||||
GArray *axes = g_array_new (FALSE, FALSE, sizeof (gdouble));
|
||||
struct libinput_tablet_tool *libinput_tool;
|
||||
gdouble value;
|
||||
|
||||
libinput_tool = libinput_event_tablet_tool_get_tool (tablet_event);
|
||||
|
||||
value = libinput_event_tablet_tool_get_x (tablet_event);
|
||||
g_array_append_val (axes, value);
|
||||
value = libinput_event_tablet_tool_get_y (tablet_event);
|
||||
g_array_append_val (axes, value);
|
||||
|
||||
if (libinput_tablet_tool_has_distance (libinput_tool))
|
||||
{
|
||||
value = libinput_event_tablet_tool_get_distance (tablet_event);
|
||||
g_array_append_val (axes, value);
|
||||
}
|
||||
|
||||
if (libinput_tablet_tool_has_pressure (libinput_tool))
|
||||
{
|
||||
value = libinput_event_tablet_tool_get_pressure (tablet_event);
|
||||
g_array_append_val (axes, value);
|
||||
}
|
||||
|
||||
if (libinput_tablet_tool_has_tilt (libinput_tool))
|
||||
{
|
||||
value = libinput_event_tablet_tool_get_tilt_x (tablet_event);
|
||||
g_array_append_val (axes, value);
|
||||
value = libinput_event_tablet_tool_get_tilt_y (tablet_event);
|
||||
g_array_append_val (axes, value);
|
||||
}
|
||||
|
||||
if (libinput_tablet_tool_has_rotation (libinput_tool))
|
||||
{
|
||||
value = libinput_event_tablet_tool_get_rotation (tablet_event);
|
||||
g_array_append_val (axes, value);
|
||||
}
|
||||
|
||||
if (libinput_tablet_tool_has_slider (libinput_tool))
|
||||
{
|
||||
value = libinput_event_tablet_tool_get_slider_position (tablet_event);
|
||||
g_array_append_val (axes, value);
|
||||
}
|
||||
|
||||
if (libinput_tablet_tool_has_wheel (libinput_tool))
|
||||
{
|
||||
value = libinput_event_tablet_tool_get_wheel_delta (tablet_event);
|
||||
g_array_append_val (axes, value);
|
||||
}
|
||||
|
||||
if (axes->len == 0)
|
||||
{
|
||||
g_array_free (axes, TRUE);
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
return (gdouble *) g_array_free (axes, FALSE);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
|
||||
struct libinput_event *event)
|
||||
@ -1697,7 +1500,7 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
|
||||
stage_width);
|
||||
y = libinput_event_pointer_get_absolute_y_transformed (motion_event,
|
||||
stage_height);
|
||||
notify_absolute_motion (device, time_us, x, y, NULL);
|
||||
notify_absolute_motion (device, time_us, x, y);
|
||||
|
||||
break;
|
||||
}
|
||||
@ -2006,84 +1809,6 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
|
||||
time_us, n_fingers, dx, dy);
|
||||
break;
|
||||
}
|
||||
case LIBINPUT_EVENT_TABLET_TOOL_AXIS:
|
||||
{
|
||||
guint64 time;
|
||||
double x, y, *axes;
|
||||
gfloat stage_width, stage_height;
|
||||
ClutterStage *stage;
|
||||
struct libinput_event_tablet_tool *tablet_event =
|
||||
libinput_event_get_tablet_tool_event (event);
|
||||
device = libinput_device_get_user_data (libinput_device);
|
||||
|
||||
stage = _clutter_input_device_get_stage (device);
|
||||
if (!stage)
|
||||
break;
|
||||
|
||||
axes = translate_tablet_axes (tablet_event);
|
||||
if (!axes)
|
||||
break;
|
||||
|
||||
stage_width = clutter_actor_get_width (CLUTTER_ACTOR (stage));
|
||||
stage_height = clutter_actor_get_height (CLUTTER_ACTOR (stage));
|
||||
|
||||
time = libinput_event_tablet_tool_get_time_usec (tablet_event);
|
||||
x = libinput_event_tablet_tool_get_x_transformed (tablet_event, stage_width);
|
||||
y = libinput_event_tablet_tool_get_y_transformed (tablet_event, stage_height);
|
||||
|
||||
notify_absolute_motion (device, time, x, y, axes);
|
||||
break;
|
||||
}
|
||||
case LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY:
|
||||
{
|
||||
guint64 time;
|
||||
struct libinput_event_tablet_tool *tablet_event =
|
||||
libinput_event_get_tablet_tool_event (event);
|
||||
struct libinput_tablet_tool *libinput_tool = NULL;
|
||||
enum libinput_tablet_tool_proximity_state state;
|
||||
|
||||
state = libinput_event_tablet_tool_get_proximity_state (tablet_event);
|
||||
time = libinput_event_tablet_tool_get_time_usec (tablet_event);
|
||||
device = libinput_device_get_user_data (libinput_device);
|
||||
|
||||
libinput_tool = libinput_event_tablet_tool_get_tool (tablet_event);
|
||||
|
||||
input_device_update_tool (device, libinput_tool);
|
||||
notify_proximity (device, time, state == LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_IN);
|
||||
break;
|
||||
}
|
||||
case LIBINPUT_EVENT_TABLET_TOOL_BUTTON:
|
||||
{
|
||||
guint64 time;
|
||||
guint32 button_state;
|
||||
struct libinput_event_tablet_tool *tablet_event =
|
||||
libinput_event_get_tablet_tool_event (event);
|
||||
guint tablet_button;
|
||||
|
||||
device = libinput_device_get_user_data (libinput_device);
|
||||
time = libinput_event_tablet_tool_get_time_usec (tablet_event);
|
||||
tablet_button = libinput_event_tablet_tool_get_button (tablet_event);
|
||||
|
||||
button_state = libinput_event_tablet_tool_get_button_state (tablet_event) ==
|
||||
LIBINPUT_BUTTON_STATE_PRESSED;
|
||||
notify_button (device, time, tablet_button, button_state);
|
||||
break;
|
||||
}
|
||||
case LIBINPUT_EVENT_TABLET_TOOL_TIP:
|
||||
{
|
||||
guint64 time;
|
||||
guint32 button_state;
|
||||
struct libinput_event_tablet_tool *tablet_event =
|
||||
libinput_event_get_tablet_tool_event (event);
|
||||
|
||||
device = libinput_device_get_user_data (libinput_device);
|
||||
time = libinput_event_tablet_tool_get_time_usec (tablet_event);
|
||||
|
||||
button_state = libinput_event_tablet_tool_get_tip_state (tablet_event) ==
|
||||
LIBINPUT_TABLET_TOOL_TIP_DOWN;
|
||||
notify_button (device, time, BTN_TOUCH, button_state);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
handled = FALSE;
|
||||
}
|
||||
@ -2879,5 +2604,5 @@ clutter_evdev_warp_pointer (ClutterInputDevice *pointer_device,
|
||||
int x,
|
||||
int y)
|
||||
{
|
||||
notify_absolute_motion (pointer_device, ms2us(time_), x, y, NULL);
|
||||
notify_absolute_motion (pointer_device, ms2us(time_), x, y);
|
||||
}
|
||||
|
@ -30,7 +30,6 @@
|
||||
#include "clutter/clutter-device-manager-private.h"
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-evdev.h"
|
||||
#include "clutter-input-device-tool-evdev.h"
|
||||
|
||||
#include "clutter-input-device-evdev.h"
|
||||
#include "clutter-device-manager-evdev.h"
|
||||
@ -72,42 +71,6 @@ clutter_input_device_evdev_keycode_to_evdev (ClutterInputDevice *device,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_input_device_evdev_update_from_tool (ClutterInputDevice *device,
|
||||
ClutterInputDeviceTool *tool)
|
||||
{
|
||||
ClutterInputDeviceToolEvdev *evdev_tool;
|
||||
|
||||
evdev_tool = CLUTTER_INPUT_DEVICE_TOOL_EVDEV (tool);
|
||||
|
||||
g_object_freeze_notify (G_OBJECT (device));
|
||||
|
||||
_clutter_input_device_reset_axes (device);
|
||||
|
||||
_clutter_input_device_add_axis (device, CLUTTER_INPUT_AXIS_X, 0, 0, 0);
|
||||
_clutter_input_device_add_axis (device, CLUTTER_INPUT_AXIS_Y, 0, 0, 0);
|
||||
|
||||
if (libinput_tablet_tool_has_distance (evdev_tool->tool))
|
||||
_clutter_input_device_add_axis (device, CLUTTER_INPUT_AXIS_DISTANCE, 0, 1, 0);
|
||||
|
||||
if (libinput_tablet_tool_has_pressure (evdev_tool->tool))
|
||||
_clutter_input_device_add_axis (device, CLUTTER_INPUT_AXIS_PRESSURE, 0, 1, 0);
|
||||
|
||||
if (libinput_tablet_tool_has_tilt (evdev_tool->tool))
|
||||
{
|
||||
_clutter_input_device_add_axis (device, CLUTTER_INPUT_AXIS_XTILT, -90, 90, 0);
|
||||
_clutter_input_device_add_axis (device, CLUTTER_INPUT_AXIS_YTILT, -90, 90, 0);
|
||||
}
|
||||
|
||||
if (libinput_tablet_tool_has_rotation (evdev_tool->tool))
|
||||
_clutter_input_device_add_axis (device, CLUTTER_INPUT_AXIS_ROTATION, 0, 360, 0);
|
||||
|
||||
if (libinput_tablet_tool_has_slider (evdev_tool->tool))
|
||||
_clutter_input_device_add_axis (device, CLUTTER_INPUT_AXIS_SLIDER, -1, 1, 0);
|
||||
|
||||
g_object_thaw_notify (G_OBJECT (device));
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_input_device_evdev_class_init (ClutterInputDeviceEvdevClass *klass)
|
||||
{
|
||||
@ -115,7 +78,6 @@ clutter_input_device_evdev_class_init (ClutterInputDeviceEvdevClass *klass)
|
||||
|
||||
object_class->finalize = clutter_input_device_evdev_finalize;
|
||||
klass->keycode_to_evdev = clutter_input_device_evdev_keycode_to_evdev;
|
||||
klass->update_from_tool = clutter_input_device_evdev_update_from_tool;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -150,7 +112,7 @@ _clutter_input_device_evdev_new (ClutterDeviceManager *manager,
|
||||
device_id = _clutter_device_manager_evdev_acquire_device_id (manager_evdev);
|
||||
device = g_object_new (CLUTTER_TYPE_INPUT_DEVICE_EVDEV,
|
||||
"id", device_id,
|
||||
"name", libinput_device_get_name (libinput_device),
|
||||
"name", libinput_device_get_sysname (libinput_device),
|
||||
"device-manager", manager,
|
||||
"device-type", type,
|
||||
"device-mode", CLUTTER_INPUT_MODE_SLAVE,
|
||||
@ -241,8 +203,6 @@ _clutter_input_device_evdev_determine_type (struct libinput_device *ldev)
|
||||
*/
|
||||
if (libinput_device_config_tap_get_finger_count (ldev) > 0)
|
||||
return CLUTTER_TOUCHPAD_DEVICE;
|
||||
else if (libinput_device_has_capability (ldev, LIBINPUT_DEVICE_CAP_TABLET_TOOL))
|
||||
return CLUTTER_TABLET_DEVICE;
|
||||
else if (libinput_device_has_capability (ldev, LIBINPUT_DEVICE_CAP_POINTER))
|
||||
return CLUTTER_POINTER_DEVICE;
|
||||
else if (libinput_device_has_capability (ldev, LIBINPUT_DEVICE_CAP_TOUCH))
|
||||
|
@ -65,7 +65,6 @@ struct _ClutterInputDeviceEvdev
|
||||
|
||||
struct libinput_device *libinput_device;
|
||||
ClutterSeatEvdev *seat;
|
||||
ClutterInputDeviceTool *last_tool;
|
||||
};
|
||||
|
||||
GType _clutter_input_device_evdev_get_type (void) G_GNUC_CONST;
|
||||
|
@ -1,71 +0,0 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Copyright © 2009, 2010, 2011 Intel Corp.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Carlos Garnacho <carlosg@gnome.org>
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "clutter-input-device-tool-evdev.h"
|
||||
|
||||
G_DEFINE_TYPE (ClutterInputDeviceToolEvdev, clutter_input_device_tool_evdev,
|
||||
CLUTTER_TYPE_INPUT_DEVICE_TOOL)
|
||||
|
||||
static void
|
||||
clutter_input_device_tool_evdev_finalize (GObject *object)
|
||||
{
|
||||
ClutterInputDeviceToolEvdev *tool = CLUTTER_INPUT_DEVICE_TOOL_EVDEV (object);
|
||||
|
||||
libinput_tablet_tool_unref (tool->tool);
|
||||
|
||||
G_OBJECT_CLASS (clutter_input_device_tool_evdev_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_input_device_tool_evdev_class_init (ClutterInputDeviceToolEvdevClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->finalize = clutter_input_device_tool_evdev_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_input_device_tool_evdev_init (ClutterInputDeviceToolEvdev *tool)
|
||||
{
|
||||
}
|
||||
|
||||
ClutterInputDeviceTool *
|
||||
clutter_input_device_tool_evdev_new (struct libinput_tablet_tool *tool,
|
||||
guint64 serial,
|
||||
ClutterInputDeviceToolType type)
|
||||
{
|
||||
ClutterInputDeviceToolEvdev *evdev_tool;
|
||||
|
||||
evdev_tool = g_object_new (CLUTTER_TYPE_INPUT_DEVICE_TOOL_EVDEV,
|
||||
"type", type,
|
||||
"serial", serial,
|
||||
NULL);
|
||||
|
||||
evdev_tool->tool = libinput_tablet_tool_ref (tool);
|
||||
|
||||
return CLUTTER_INPUT_DEVICE_TOOL (evdev_tool);
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Copyright © 2009, 2010, 2011 Intel Corp.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Carlos Garnacho <carlosg@gnome.org>
|
||||
*/
|
||||
|
||||
#ifndef __CLUTTER_INPUT_DEVICE_EVDEV_TOOL_H__
|
||||
#define __CLUTTER_INPUT_DEVICE_EVDEV_TOOL_H__
|
||||
|
||||
#include <libinput.h>
|
||||
|
||||
#include <clutter/clutter-input-device-tool.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define CLUTTER_TYPE_INPUT_DEVICE_TOOL_EVDEV (clutter_input_device_tool_evdev_get_type ())
|
||||
|
||||
#define CLUTTER_INPUT_DEVICE_TOOL_EVDEV(o) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((o), \
|
||||
CLUTTER_TYPE_INPUT_DEVICE_TOOL_EVDEV, ClutterInputDeviceToolEvdev))
|
||||
|
||||
#define CLUTTER_IS_INPUT_DEVICE_TOOL_EVDEV(o) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((o), \
|
||||
CLUTTER_TYPE_INPUT_DEVICE_TOOL_EVDEV))
|
||||
|
||||
#define CLUTTER_INPUT_DEVICE_TOOL_EVDEV_CLASS(c) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((c), \
|
||||
CLUTTER_TYPE_INPUT_DEVICE_TOOL_EVDEV, ClutterInputDeviceToolEvdevClass))
|
||||
|
||||
#define CLUTTER_IS_INPUT_DEVICE_TOOL_EVDEV_CLASS(c) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((c), \
|
||||
CLUTTER_TYPE_INPUT_DEVICE_TOOL_EVDEV))
|
||||
|
||||
#define CLUTTER_INPUT_DEVICE_TOOL_EVDEV_GET_CLASS(o) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((o), \
|
||||
CLUTTER_TYPE_INPUT_DEVICE_TOOL_EVDEV, ClutterInputDeviceToolEvdevClass))
|
||||
|
||||
typedef struct _ClutterInputDeviceToolEvdev ClutterInputDeviceToolEvdev;
|
||||
typedef struct _ClutterInputDeviceToolEvdevClass ClutterInputDeviceToolEvdevClass;
|
||||
|
||||
struct _ClutterInputDeviceToolEvdev
|
||||
{
|
||||
ClutterInputDeviceTool parent_instance;
|
||||
struct libinput_tablet_tool *tool;
|
||||
};
|
||||
|
||||
struct _ClutterInputDeviceToolEvdevClass
|
||||
{
|
||||
ClutterInputDeviceToolClass parent_class;
|
||||
};
|
||||
|
||||
GType clutter_input_device_tool_evdev_get_type (void) G_GNUC_CONST;
|
||||
|
||||
ClutterInputDeviceTool * clutter_input_device_tool_evdev_new (struct libinput_tablet_tool *tool,
|
||||
guint64 serial,
|
||||
ClutterInputDeviceToolType type);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_INPUT_DEVICE_EVDEV_TOOL_H__ */
|
@ -76,7 +76,7 @@ CLUTTER_LT_CURRENT=lt_current
|
||||
CLUTTER_LT_REV=lt_revision
|
||||
CLUTTER_LT_AGE=lt_age
|
||||
CLUTTER_LT_VERSION="$CLUTTER_LT_CURRENT:$CLUTTER_LT_REV:$CLUTTER_LT_AGE"
|
||||
CLUTTER_LT_LDFLAGS="-avoid-version"
|
||||
CLUTTER_LT_LDFLAGS="-version-info $CLUTTER_LT_VERSION"
|
||||
AC_SUBST([CLUTTER_LT_CURRENT], [lt_current])
|
||||
AC_SUBST([CLUTTER_LT_REVISION], [lt_revision])
|
||||
AC_SUBST([CLUTTER_LT_VERSION], [$CLUTTER_LT_VERSION])
|
||||
@ -222,33 +222,19 @@ PKG_CHECK_EXISTS([pangoft2],
|
||||
],
|
||||
[])
|
||||
|
||||
AC_ARG_ENABLE(
|
||||
[wayland-egl-server],
|
||||
[AC_HELP_STRING([--enable-wayland-egl-server=@<:@no/yes@:>@], [Enable server side wayland support @<:@default=no@:>@])],
|
||||
[],
|
||||
enable_wayland_egl_server=yes
|
||||
)
|
||||
CLUTTER_BACKENDS="$CLUTTER_BACKENDS egl"
|
||||
SUPPORT_EGL=1
|
||||
AC_DEFINE([CLUTTER_EGL_BACKEND_GENERIC], [1], [Use Generic EGL backend])
|
||||
|
||||
AS_IF([test "x$enable_wayland_egl_server" = "xyes"],
|
||||
[
|
||||
CLUTTER_BACKENDS="$CLUTTER_BACKENDS egl"
|
||||
SUPPORT_EGL=1
|
||||
AC_DEFINE([CLUTTER_EGL_BACKEND_GENERIC], [1], [Use Generic EGL backend])
|
||||
BACKEND_PC_FILES="$BACKEND_PC_FILES wayland-server"
|
||||
SUPPORT_WAYLAND_COMPOSITOR=1
|
||||
CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
|
||||
#define CLUTTER_HAS_WAYLAND_COMPOSITOR_SUPPORT 1"
|
||||
|
||||
BACKEND_PC_FILES="$BACKEND_PC_FILES wayland-egl wayland-server libdrm gbm"
|
||||
|
||||
SUPPORT_WAYLAND_COMPOSITOR=1
|
||||
CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
|
||||
#define CLUTTER_HAS_WAYLAND_COMPOSITOR_SUPPORT 1"
|
||||
|
||||
CLUTTER_INPUT_BACKENDS="$CLUTTER_INPUT_BACKENDS evdev"
|
||||
|
||||
SUPPORT_EVDEV=1
|
||||
BACKEND_PC_FILES_PRIVATE="$BACKEND_PC_FILES_PRIVATE libudev >= $LIBUDEV_REQ_VERSION libinput >= $LIBINPUT_REQ_VERSION xkbcommon"
|
||||
AC_DEFINE([HAVE_EVDEV], [1], [Have evdev support for input handling])
|
||||
])
|
||||
|
||||
AM_CONDITIONAL(SUPPORT_WAYLAND, [test "x$enable_wayland_egl_server" = "xyes"])
|
||||
CLUTTER_INPUT_BACKENDS="$CLUTTER_INPUT_BACKENDS evdev"
|
||||
BACKEND_PC_FILES_PRIVATE="$BACKEND_PC_FILES_PRIVATE libudev >= $LIBUDEV_REQ_VERSION libinput >= $LIBINPUT_REQ_VERSION xkbcommon"
|
||||
SUPPORT_EVDEV=1
|
||||
AC_DEFINE([HAVE_EVDEV], [1], [Have evdev support for input handling])
|
||||
|
||||
dnl Instead of using AM_CFLAGS to ensure
|
||||
dnl COGL_ENABLE_EXPERIMENTAL_2_0_API is defined while compiling clutter
|
||||
|
@ -9,8 +9,6 @@ AM_CPPFLAGS = \
|
||||
-DPREFIXDIR=\"$(libdir)\" \
|
||||
-DCLUTTER_DISABLE_DEPRECATION_WARNINGS \
|
||||
-DGLIB_DISABLE_DEPRECATION_WARNINGS \
|
||||
-I$(top_srcdir)/../cogl \
|
||||
-I$(top_builddir)/../cogl \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_builddir) \
|
||||
-I$(top_srcdir)/clutter \
|
||||
|
@ -1,14 +1,10 @@
|
||||
installed_test_metadir = $(datadir)/installed-tests/mutter-clutter
|
||||
installed_testdir = $(libexecdir)/installed-tests/mutter-clutter
|
||||
include $(top_srcdir)/build/autotools/glib-tap.mk
|
||||
|
||||
AM_CFLAGS = -g $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
|
||||
LDADD = $(top_builddir)/../cogl/cogl/libmutter-cogl.la $(top_builddir)/clutter/libmutter-clutter-1.0.la $(CLUTTER_LIBS) $(LIBM)
|
||||
LDADD = $(top_builddir)/clutter/libmutter-clutter-1.0.la $(CLUTTER_LIBS) $(LIBM)
|
||||
AM_LDFLAGS = -export-dynamic
|
||||
AM_CPPFLAGS = \
|
||||
-DG_LOG_DOMAIN=\"Clutter-Conform\" \
|
||||
-I$(top_srcdir)/../cogl \
|
||||
-I$(top_builddir)/../cogl \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_builddir) \
|
||||
-DCOGL_DISABLE_DEPRECATION_WARNINGS \
|
||||
|
@ -126,8 +126,6 @@ test_interactive_CPPFLAGS = \
|
||||
-DGLIB_DISABLE_DEPRECATION_WARNINGS \
|
||||
-DCOGL_DISABLE_DEPRECATION_WARNINGS \
|
||||
-DCLUTTER_DISABLE_DEPRECATION_WARNINGS \
|
||||
-I$(top_srcdir)/../cogl \
|
||||
-I$(top_builddir)/../cogl \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_builddir) \
|
||||
-I$(top_srcdir)/clutter \
|
||||
|
@ -15,8 +15,6 @@ AM_CPPFLAGS = \
|
||||
-DCOGL_DISABLE_DEPRECATION_WARNINGS \
|
||||
-DCLUTTER_DISABLE_DEPRECATION_WARNINGS \
|
||||
-DTESTS_DATA_DIR=\""$(top_srcdir)/tests/data/"\" \
|
||||
-I$(top_srcdir)/../cogl \
|
||||
-I$(top_builddir)/../cogl \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_builddir) \
|
||||
-I$(top_srcdir)/clutter \
|
||||
|
@ -19,8 +19,6 @@ AM_CPPFLAGS = \
|
||||
-DCOGL_DISABLE_DEPRECATION_WARNINGS \
|
||||
-DCLUTTER_DISABLE_DEPRECATION_WARNINGS \
|
||||
-DTESTS_DATA_DIR=\""$(top_srcdir)/tests/data/"\" \
|
||||
-I$(top_srcdir)/../cogl \
|
||||
-I$(top_builddir)/../cogl \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_builddir) \
|
||||
-I$(top_srcdir)/clutter \
|
||||
|
@ -15,7 +15,7 @@ libmutter_cogl_gles2_la_SOURCES = cogl-gles2-api.c
|
||||
libmutter_cogl_gles2_la_LDFLAGS = \
|
||||
-no-undefined \
|
||||
-rpath $(mutterlibdir) \
|
||||
-avoid-version \
|
||||
-version-info @COGL_LT_CURRENT@:@COGL_LT_REVISION@:@COGL_LT_AGE@ \
|
||||
-export-dynamic \
|
||||
-export-symbols-regex "^gl*"
|
||||
|
||||
|
@ -34,7 +34,7 @@ libmutter_cogl_pango_la_LDFLAGS = \
|
||||
-rpath $(mutterlibdir) \
|
||||
-export-symbols-regex "^cogl_pango_.*" \
|
||||
-no-undefined \
|
||||
-avoid-version
|
||||
-version-info @COGL_LT_CURRENT@:@COGL_LT_REVISION@:@COGL_LT_AGE@
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-DCOGL_COMPILATION \
|
||||
@ -73,7 +73,7 @@ CoglPango_1_0_gir_LIBS = $(top_builddir)/cogl/libmutter-cogl.la libmutter-cogl-p
|
||||
CoglPango_1_0_gir_FILES = $(source_h) $(source_c)
|
||||
CoglPango_1_0_gir_CFLAGS = $(AM_CPPFLAGS) $(COGL_DEP_CFLAGS) $(COGL_PANGO_DEP_CFLAGS)
|
||||
CoglPango_1_0_gir_INCLUDES = Pango-1.0 PangoCairo-1.0
|
||||
CoglPango_1_0_gir_EXPORT_PACKAGES = mutter-cogl-pango-1.0
|
||||
CoglPango_1_0_gir_EXPORT_PACKAGES = cogl-pango-1.0
|
||||
CoglPango_1_0_gir_SCANNERFLAGS = \
|
||||
--warn-all \
|
||||
--identifier-prefix=CoglPango \
|
||||
@ -89,7 +89,7 @@ CoglPango_2_0_gir_LIBS = $(top_builddir)/cogl/libmutter-cogl.la libmutter-cogl-p
|
||||
CoglPango_2_0_gir_FILES = $(source_h) $(source_c)
|
||||
CoglPango_2_0_gir_CFLAGS = $(AM_CPPFLAGS) $(COGL_DEP_CFLAGS) $(COGL_PANGO_DEP_CFLAGS)
|
||||
CoglPango_2_0_gir_INCLUDES = Pango-1.0 PangoCairo-1.0
|
||||
CoglPango_2_0_gir_EXPORT_PACKAGES = mutter-cogl-pango-2.0-experimental
|
||||
CoglPango_2_0_gir_EXPORT_PACKAGES = cogl-pango-2.0-experimental
|
||||
CoglPango_2_0_gir_SCANNERFLAGS = \
|
||||
--warn-all \
|
||||
--identifier-prefix=CoglPango \
|
||||
|
@ -78,7 +78,7 @@ libmutter_cogl_path_la_LDFLAGS = \
|
||||
-export-dynamic \
|
||||
-export-symbols-regex "^(cogl|cogl2)_(framebuffer|path|is|clip|[sg]et)_.*" \
|
||||
-no-undefined \
|
||||
-avoid-version \
|
||||
-version-info @COGL_LT_CURRENT@:@COGL_LT_REVISION@:@COGL_LT_AGE@ \
|
||||
-rpath $(mutterlibdir)
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
|
@ -471,7 +471,7 @@ endif
|
||||
# for cogl-pango.
|
||||
libmutter_cogl_la_LDFLAGS = \
|
||||
-no-undefined \
|
||||
-avoid-version \
|
||||
-version-info @COGL_LT_CURRENT@:@COGL_LT_REVISION@:@COGL_LT_AGE@ \
|
||||
-export-dynamic \
|
||||
-rpath $(mutterlibdir) \
|
||||
-export-symbols-regex "^(cogl|_cogl_debug_flags|_cogl_atlas_new|_cogl_atlas_add_reorganize_callback|_cogl_atlas_reserve_space|_cogl_callback|_cogl_util_get_eye_planes_for_screen_poly|_cogl_atlas_texture_remove_reorganize_callback|_cogl_atlas_texture_add_reorganize_callback|_cogl_texture_get_format|_cogl_texture_foreach_sub_texture_in_region|_cogl_profile_trace_message|_cogl_context_get_default|_cogl_framebuffer_get_stencil_bits|_cogl_clip_stack_push_rectangle|_cogl_framebuffer_get_modelview_stack|_cogl_object_default_unref|_cogl_pipeline_foreach_layer_internal|_cogl_clip_stack_push_primitive|_cogl_buffer_unmap_for_fill_or_fallback|_cogl_framebuffer_draw_primitive|_cogl_debug_instances|_cogl_framebuffer_get_projection_stack|_cogl_pipeline_layer_get_texture|_cogl_buffer_map_for_fill_or_fallback|_cogl_texture_can_hardware_repeat|_cogl_pipeline_prune_to_n_layers|_cogl_primitive_draw|test_|unit_test_).*"
|
||||
@ -527,12 +527,12 @@ Cogl_2_0_gir_FILES = $(cogl_experimental_h) $(cogl_additional_experimental_h) co
|
||||
|
||||
Cogl_1_0_gir_CFLAGS = $(AM_CPPFLAGS) $(COGL_DEP_CFLAGS) -UCOGL_ENABLE_EXPERIMENTAL_API -UCOGL_ENABLE_EXPERIMENTAL_2_0_API -UCOGL_COMPILATION -D__COGL_H_INSIDE__ -D__COGL_XLIB_H_INSIDE__ -D__COGL_EGL_H_INSIDE__ -D__COGL_GLX_H_INSIDE__ -DCOGL_GIR_SCANNING
|
||||
Cogl_1_0_gir_INCLUDES = GL-1.0 GObject-2.0
|
||||
Cogl_1_0_gir_EXPORT_PACKAGES = mutter-cogl-1.0
|
||||
Cogl_1_0_gir_EXPORT_PACKAGES = cogl-1.0
|
||||
Cogl_1_0_gir_SCANNERFLAGS = --warn-all --c-include='cogl/cogl.h'
|
||||
|
||||
Cogl_2_0_gir_CFLAGS = $(AM_CPPFLAGS) $(COGL_DEP_CFLAGS) -DCOGL_ENABLE_EXPERIMENTAL_API=1 -UCOGL_COMPILATION -D__COGL_H_INSIDE__ -D__COGL_XLIB_H_INSIDE__ -DCOGL_GIR_SCANNING
|
||||
Cogl_2_0_gir_INCLUDES = GL-1.0 GObject-2.0
|
||||
Cogl_2_0_gir_EXPORT_PACKAGES = mutter-cogl-2.0-experimental
|
||||
Cogl_2_0_gir_EXPORT_PACKAGES = cogl-2.0-experimental
|
||||
Cogl_2_0_gir_SCANNERFLAGS = --warn-all --c-include='cogl/cogl.h' --symbol-prefix=cogl --symbol-prefix=cogl2
|
||||
|
||||
INTROSPECTION_GIRS += Cogl-1.0.gir Cogl-2.0.gir
|
||||
|
@ -328,7 +328,6 @@ AS_CASE(
|
||||
|
||||
# strip leading spaces
|
||||
COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS ${MAINTAINER_CFLAGS#* }"
|
||||
COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -Wno-error=sign-compare"
|
||||
|
||||
|
||||
dnl ============================================================
|
||||
|
@ -12,7 +12,7 @@ libtest_fixtures_la_CPPFLAGS += \
|
||||
-DTESTS_DATADIR=\""$(top_srcdir)/tests/data"\" \
|
||||
-DCOGL_COMPILATION
|
||||
|
||||
libtest_fixtures_la_CFLAGS = -g3 -O0 $(COGL_DEP_CFLAGS) $(COGL_EXTRA_CFLAGS) -Wno-error=maybe-uninitialized -Wno-error=nested-externs -Wno-error=missing-prototypes
|
||||
libtest_fixtures_la_CFLAGS = -g3 -O0 $(COGL_DEP_CFLAGS) $(COGL_EXTRA_CFLAGS)
|
||||
|
||||
libtest_fixtures_la_SOURCES = \
|
||||
test-unit.h \
|
||||
|
@ -25,7 +25,7 @@ endif
|
||||
check-local: test
|
||||
|
||||
if ENABLE_INSTALLED_TESTS
|
||||
insttestdir = $(libexecdir)/installed-tests/mutter-cogl
|
||||
insttestdir = $(libexecdir)/installed-tests/$(PACKAGE)
|
||||
insttest_SCRIPTS = run-tests.sh
|
||||
insttest_DATA = config.env
|
||||
endif
|
||||
|
@ -128,7 +128,7 @@ AM_CPPFLAGS += \
|
||||
-DCOGL_DISABLE_DEPRECATION_WARNINGS \
|
||||
-DTESTS_DATADIR=\""$(top_srcdir)/tests/data"\"
|
||||
|
||||
test_conformance_CFLAGS = -g3 -O0 $(COGL_DEP_CFLAGS) $(COGL_EXTRA_CFLAGS) -Wno-error=maybe-uninitialized -Wno-error=nested-externs -Wno-error=missing-prototypes
|
||||
test_conformance_CFLAGS = -g3 -O0 $(COGL_DEP_CFLAGS) $(COGL_EXTRA_CFLAGS)
|
||||
test_conformance_LDADD = \
|
||||
$(COGL_DEP_LIBS) \
|
||||
$(top_builddir)/cogl/libmutter-cogl.la \
|
||||
@ -138,9 +138,8 @@ test_conformance_LDADD += $(top_builddir)/cogl-path/libmutter-cogl-path.la
|
||||
endif
|
||||
test_conformance_LDFLAGS = -export-dynamic
|
||||
|
||||
# XXX: uncomment when tests get fixed
|
||||
#test: wrappers
|
||||
# @$(top_srcdir)/tests/run-tests.sh $(abs_builddir)/../config.env $(abs_builddir)/test-conformance$(EXEEXT)
|
||||
test: wrappers
|
||||
@$(top_srcdir)/tests/run-tests.sh $(abs_builddir)/../config.env $(abs_builddir)/test-conformance$(EXEEXT)
|
||||
|
||||
# XXX: we could prevent the conformance test suite from running
|
||||
# by simply defining this variable conditionally
|
||||
@ -158,18 +157,18 @@ clean-generic: clean-wrappers
|
||||
|
||||
if ENABLE_INSTALLED_TESTS
|
||||
|
||||
insttestdir = $(libexecdir)/installed-tests/mutter-cogl/conform
|
||||
insttestdir = $(libexecdir)/installed-tests/$(PACKAGE)/conform
|
||||
insttest_PROGRAMS = test-conformance
|
||||
insttest_DATA = unit-tests
|
||||
|
||||
testmetadir = $(datadir)/installed-tests/mutter-cogl
|
||||
testmetadir = $(datadir)/installed-tests/$(PACKAGE)
|
||||
testmeta_DATA = conform.test
|
||||
|
||||
conform.test:
|
||||
echo " GEN $@"; \
|
||||
echo "[Test]" > $@.tmp; \
|
||||
echo "Type=session" >> $@.tmp; \
|
||||
echo "Exec=sh -c \"cd $(libexecdir)/installed-tests/mutter-cogl/conform; ../run-tests.sh ../config.env ./test-conformance\"" >> $@.tmp; \
|
||||
echo "Exec=sh -c \"cd $(libexecdir)/installed-tests/$(PACKAGE)/conform; ../run-tests.sh ../config.env ./test-conformance\"" >> $@.tmp; \
|
||||
mv $@.tmp $@
|
||||
|
||||
CLEANFILES = conform.test
|
||||
|
@ -66,9 +66,8 @@ test_unit_LDADD = \
|
||||
$(LIBM)
|
||||
test_unit_LDFLAGS = -export-dynamic
|
||||
|
||||
# XXX: uncomment when tests get fixed
|
||||
#test: wrappers
|
||||
# @$(top_srcdir)/tests/run-tests.sh $(abs_builddir)/../config.env $(abs_builddir)/test-unit$(EXEEXT)
|
||||
test: wrappers
|
||||
@$(top_srcdir)/tests/run-tests.sh $(abs_builddir)/../config.env $(abs_builddir)/test-unit$(EXEEXT)
|
||||
|
||||
# XXX: we could prevent the unit test suite from running
|
||||
# by simply defining this variable conditionally
|
||||
|
@ -1,7 +1,7 @@
|
||||
AC_PREREQ(2.62)
|
||||
|
||||
m4_define([mutter_major_version], [3])
|
||||
m4_define([mutter_minor_version], [21])
|
||||
m4_define([mutter_minor_version], [20])
|
||||
m4_define([mutter_micro_version], [1])
|
||||
|
||||
m4_define([mutter_version],
|
||||
|
@ -31,7 +31,6 @@ fi
|
||||
fr
|
||||
fur
|
||||
ga
|
||||
gd
|
||||
gl
|
||||
gu
|
||||
ha
|
||||
|
@ -1,79 +1,2 @@
|
||||
# List of source files that should NOT be translated.
|
||||
# Please keep this file sorted alphabetically.
|
||||
|
||||
clutter/clutter/clutter-actor-meta.c
|
||||
clutter/clutter/clutter-actor.c
|
||||
clutter/clutter/clutter-align-constraint.c
|
||||
clutter/clutter/clutter-backend.c
|
||||
clutter/clutter/clutter-bin-layout.c
|
||||
clutter/clutter/clutter-bind-constraint.c
|
||||
clutter/clutter/clutter-binding-pool.c
|
||||
clutter/clutter/clutter-box-layout.c
|
||||
clutter/clutter/clutter-brightness-contrast-effect.c
|
||||
clutter/clutter/clutter-canvas.c
|
||||
clutter/clutter/clutter-child-meta.c
|
||||
clutter/clutter/clutter-click-action.c
|
||||
clutter/clutter/clutter-clone.c
|
||||
clutter/clutter/clutter-color.c
|
||||
clutter/clutter/clutter-colorize-effect.c
|
||||
clutter/clutter/clutter-container.c
|
||||
clutter/clutter/clutter-content.c
|
||||
clutter/clutter/clutter-deform-effect.c
|
||||
clutter/clutter/clutter-desaturate-effect.c
|
||||
clutter/clutter/clutter-device-manager.c
|
||||
clutter/clutter/clutter-drag-action.c
|
||||
clutter/clutter/clutter-drop-action.c
|
||||
clutter/clutter/clutter-flow-layout.c
|
||||
clutter/clutter/clutter-gesture-action.c
|
||||
clutter/clutter/clutter-grid-layout.c
|
||||
clutter/clutter/clutter-image.c
|
||||
clutter/clutter/clutter-input-device.c
|
||||
clutter/clutter/clutter-interval.c
|
||||
clutter/clutter/clutter-layout-manager.c
|
||||
clutter/clutter/clutter-layout-meta.c
|
||||
clutter/clutter/clutter-main.c
|
||||
clutter/clutter/clutter-paint-node.c
|
||||
clutter/clutter/clutter-pan-action.c
|
||||
clutter/clutter/clutter-path-constraint.c
|
||||
clutter/clutter/clutter-property-transition.c
|
||||
clutter/clutter/clutter-rotate-action.c
|
||||
clutter/clutter/clutter-script.c
|
||||
clutter/clutter/clutter-scroll-actor.c
|
||||
clutter/clutter/clutter-settings.c
|
||||
clutter/clutter/clutter-shader-effect.c
|
||||
clutter/clutter/clutter-shader-types.c
|
||||
clutter/clutter/clutter-snap-constraint.c
|
||||
clutter/clutter/clutter-stage.c
|
||||
clutter/clutter/clutter-swipe-action.c
|
||||
clutter/clutter/clutter-tap-action.c
|
||||
clutter/clutter/clutter-text-buffer.c
|
||||
clutter/clutter/clutter-text.c
|
||||
clutter/clutter/clutter-timeline.c
|
||||
clutter/clutter/clutter-transition.c
|
||||
clutter/clutter/clutter-units.c
|
||||
clutter/clutter/clutter-zoom-action.c
|
||||
clutter/clutter/deprecated/clutter-alpha.c
|
||||
clutter/clutter/deprecated/clutter-animation.c
|
||||
clutter/clutter/deprecated/clutter-animator.c
|
||||
clutter/clutter/deprecated/clutter-behaviour-depth.c
|
||||
clutter/clutter/deprecated/clutter-behaviour-ellipse.c
|
||||
clutter/clutter/deprecated/clutter-behaviour-opacity.c
|
||||
clutter/clutter/deprecated/clutter-behaviour-path.c
|
||||
clutter/clutter/deprecated/clutter-behaviour-rotate.c
|
||||
clutter/clutter/deprecated/clutter-behaviour-scale.c
|
||||
clutter/clutter/deprecated/clutter-behaviour.c
|
||||
clutter/clutter/deprecated/clutter-box.c
|
||||
clutter/clutter/deprecated/clutter-cairo-texture.c
|
||||
clutter/clutter/deprecated/clutter-fixed.c
|
||||
clutter/clutter/deprecated/clutter-media.c
|
||||
clutter/clutter/deprecated/clutter-rectangle.c
|
||||
clutter/clutter/deprecated/clutter-shader.c
|
||||
clutter/clutter/deprecated/clutter-state.c
|
||||
clutter/clutter/deprecated/clutter-table-layout.c
|
||||
clutter/clutter/deprecated/clutter-texture.c
|
||||
clutter/clutter/wayland/clutter-wayland-surface.c
|
||||
clutter/clutter/x11/clutter-backend-x11.c
|
||||
clutter/clutter/x11/clutter-keymap-x11.c
|
||||
clutter/clutter/x11/clutter-x11-texture-pixmap.c
|
||||
cogl/cogl/cogl-debug-options.h
|
||||
cogl/cogl/cogl-debug.c
|
||||
|
574
po/gd.po
574
po/gd.po
@ -1,574 +0,0 @@
|
||||
# Scottish Gaelic translation for mutter.
|
||||
# Copyright (C) 2016 mutter's COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the mutter package.
|
||||
# GunChleoc <fios@foramnagaidhlig.net>, 2016.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: mutter master\n"
|
||||
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=mutter"
|
||||
"&keywords=I18N+L10N&component=general\n"
|
||||
"POT-Creation-Date: 2016-04-28 14:01+0000\n"
|
||||
"PO-Revision-Date: 2016-04-28 15:57+0100\n"
|
||||
"Last-Translator: GunChleoc <fios@foramnagaidhlig.net>\n"
|
||||
"Language-Team: Fòram na Gàidhlig\n"
|
||||
"Language: gd\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : "
|
||||
"(n > 2 && n < 20) ? 2 : 3;\n"
|
||||
"X-Generator: Virtaal 0.7.1\n"
|
||||
"X-Project-Style: gnome\n"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:1
|
||||
msgid "Navigation"
|
||||
msgstr "Seòladaireachd"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:2
|
||||
msgid "Move window to workspace 1"
|
||||
msgstr "Gluais an uinneag gu rum-obrach 1"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:3
|
||||
msgid "Move window to workspace 2"
|
||||
msgstr "Gluais an uinneag gu rum-obrach 2"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:4
|
||||
msgid "Move window to workspace 3"
|
||||
msgstr "Gluais an uinneag gu rum-obrach 3"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:5
|
||||
msgid "Move window to workspace 4"
|
||||
msgstr "Gluais an uinneag gu rum-obrach 4"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:6
|
||||
msgid "Move window to last workspace"
|
||||
msgstr "Gluais an uinneag gun rum-obrach mu dheireadh"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:7
|
||||
msgid "Move window one workspace to the left"
|
||||
msgstr "Gluais an uinneag gun rum-obrach ris an taobh chlì"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:8
|
||||
msgid "Move window one workspace to the right"
|
||||
msgstr "Gluais an uinneag gun rum-obrach ris an taobh deas"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:9
|
||||
msgid "Move window one workspace up"
|
||||
msgstr "Gluais an uinneag gun rum-obrach os a chionn"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:10
|
||||
msgid "Move window one workspace down"
|
||||
msgstr "Gluais an uinneag gun rum-obrach foidhe"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:11
|
||||
msgid "Move window one monitor to the left"
|
||||
msgstr "Gluais an uinneag gun sgrìn aig an taobh chlì"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:12
|
||||
msgid "Move window one monitor to the right"
|
||||
msgstr "Gluais an uinneag gun sgrìn aig an taobh deas"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:13
|
||||
msgid "Move window one monitor up"
|
||||
msgstr "Gluais an uinneag gun sgrìn os a chionn"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:14
|
||||
msgid "Move window one monitor down"
|
||||
msgstr "Gluais an uinneag gun sgrìn foidhe"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:15
|
||||
msgid "Switch applications"
|
||||
msgstr "Gearr leum gu aplacaid eile"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:16
|
||||
msgid "Switch to previous application"
|
||||
msgstr "Gearr leum gun aplacaid roimhpe"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:17
|
||||
msgid "Switch windows"
|
||||
msgstr "Gearr leum gu uinneag eile"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:18
|
||||
msgid "Switch to previous window"
|
||||
msgstr "Gearr leum gun uinneag roimhpe"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:19
|
||||
msgid "Switch windows of an application"
|
||||
msgstr "Gearr leum gu uinneag eile na h-aplacaid"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:20
|
||||
msgid "Switch to previous window of an application"
|
||||
msgstr "Gearr leum gu uinneag roimhpe na h-aplacaid"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:21
|
||||
msgid "Switch system controls"
|
||||
msgstr "Gearr leum gu inneal-smachd siostaim eile"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:22
|
||||
msgid "Switch to previous system control"
|
||||
msgstr "Gearr leum gun inneal-smachd siostaim roimhe"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:23
|
||||
msgid "Switch windows directly"
|
||||
msgstr "Gearr leum gu uinneag eile sa bhad"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:24
|
||||
msgid "Switch directly to previous window"
|
||||
msgstr "Gearr leum gun uinneag roimhpe sa bhad"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:25
|
||||
msgid "Switch windows of an app directly"
|
||||
msgstr "Gearr leum gu uinneag eile na h-aplacaid sa bhad"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:26
|
||||
msgid "Switch directly to previous window of an app"
|
||||
msgstr "Gearr leum gu uinneag roimphe na h-aplacaid sa bhad"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:27
|
||||
msgid "Switch system controls directly"
|
||||
msgstr "Gearr leum gu inneal-smachd siostaim eile sa bhad"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:28
|
||||
msgid "Switch directly to previous system control"
|
||||
msgstr "Gearr leum gun inneal-smachd siostaim roimhe sa bhad"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:29
|
||||
msgid "Hide all normal windows"
|
||||
msgstr "Cuir gach uinneag àbhaisteach am falach"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:30
|
||||
msgid "Switch to workspace 1"
|
||||
msgstr "Gearr leum gu rum-obrach 1"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:31
|
||||
msgid "Switch to workspace 2"
|
||||
msgstr "Gearr leum gu rum-obrach 2"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:32
|
||||
msgid "Switch to workspace 3"
|
||||
msgstr "Gearr leum gu rum-obrach 3"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:33
|
||||
msgid "Switch to workspace 4"
|
||||
msgstr "Gearr leum gu rum-obrach 4"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:34
|
||||
msgid "Switch to last workspace"
|
||||
msgstr "Gearr leum gun rum-obrach mu dheireadh"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:35
|
||||
msgid "Move to workspace left"
|
||||
msgstr "Gluais dhan rum-obrach air an taobh chlì"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:36
|
||||
msgid "Move to workspace right"
|
||||
msgstr "Gluais dhan rum-obrach air an taobh deas"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:37
|
||||
msgid "Move to workspace above"
|
||||
msgstr "Gluais dhan rum-obrach aig a' bharr"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:38
|
||||
msgid "Move to workspace below"
|
||||
msgstr "Gluais dhan rum-obrach aig a' bhonn"
|
||||
|
||||
#: ../data/50-mutter-system.xml.in.h:1
|
||||
msgid "System"
|
||||
msgstr "An siostam"
|
||||
|
||||
#: ../data/50-mutter-system.xml.in.h:2
|
||||
msgid "Show the run command prompt"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/50-mutter-system.xml.in.h:3
|
||||
msgid "Show the activities overview"
|
||||
msgstr "Foir-shealladh air na gnìomhachdan"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:1
|
||||
msgid "Windows"
|
||||
msgstr "Uinneagan"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:2
|
||||
msgid "Activate the window menu"
|
||||
msgstr "Gnìomhaich clàr-taice na h-uinneige"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:3
|
||||
msgid "Toggle fullscreen mode"
|
||||
msgstr "Toglaich am modh làn-sgrìn"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:4
|
||||
msgid "Toggle maximization state"
|
||||
msgstr "Toglaich staid an làn-mheudachaidh"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:5
|
||||
msgid "Maximize window"
|
||||
msgstr "Làn-mheudaich an uinneag"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:6
|
||||
msgid "Restore window"
|
||||
msgstr "Aisig an uinneag"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:7
|
||||
msgid "Toggle shaded state"
|
||||
msgstr "Toglaich staid an sgàileachaidh"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:8
|
||||
msgid "Close window"
|
||||
msgstr "Dùin an uinneag"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:9
|
||||
msgid "Hide window"
|
||||
msgstr "Cuir an uinneag am falach"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:10
|
||||
msgid "Move window"
|
||||
msgstr "Gluais an uinneag"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:11
|
||||
msgid "Resize window"
|
||||
msgstr "Atharraich meud na h-uinneige"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:12
|
||||
msgid "Toggle window on all workspaces or one"
|
||||
msgstr "Toglaich an uinneag air a h-uile rum-obrach no aonan"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:13
|
||||
msgid "Raise window if covered, otherwise lower it"
|
||||
msgstr "Tog an uinneag nuair a thèid a còmhdachadh air neo ìslich i"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:14
|
||||
msgid "Raise window above other windows"
|
||||
msgstr "Tog an uinneag os cionn càich"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:15
|
||||
msgid "Lower window below other windows"
|
||||
msgstr "Ìslich an uinneag fo na h-uinneagan eile"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:16
|
||||
msgid "Maximize window vertically"
|
||||
msgstr "Làn-mheudaich an uinneag gu h-ingearach"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:17
|
||||
msgid "Maximize window horizontally"
|
||||
msgstr "Làn-mheudaich an uinneag air a' chòmhnard"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:18
|
||||
msgid "View split on left"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:19
|
||||
msgid "View split on right"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/mutter.desktop.in.h:1
|
||||
msgid "Mutter"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:1
|
||||
msgid "Modifier to use for extended window management operations"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:2
|
||||
msgid ""
|
||||
"This key will initiate the \"overlay\", which is a combination window "
|
||||
"overview and application launching system. The default is intended to be the "
|
||||
"\"Windows key\" on PC hardware. It's expected that this binding either the "
|
||||
"default or set to the empty string."
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:3
|
||||
msgid "Attach modal dialogs"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:4
|
||||
msgid ""
|
||||
"When true, instead of having independent titlebars, modal dialogs appear "
|
||||
"attached to the titlebar of the parent window and are moved together with "
|
||||
"the parent window."
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:5
|
||||
msgid "Enable edge tiling when dropping windows on screen edges"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:6
|
||||
msgid ""
|
||||
"If enabled, dropping windows on vertical screen edges maximizes them "
|
||||
"vertically and resizes them horizontally to cover half of the available "
|
||||
"area. Dropping windows on the top screen edge maximizes them completely."
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:7
|
||||
msgid "Workspaces are managed dynamically"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:8
|
||||
msgid ""
|
||||
"Determines whether workspaces are managed dynamically or whether there's a "
|
||||
"static number of workspaces (determined by the num-workspaces key in org."
|
||||
"gnome.desktop.wm.preferences)."
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:9
|
||||
msgid "Workspaces only on primary"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:10
|
||||
msgid ""
|
||||
"Determines whether workspace switching should happen for windows on all "
|
||||
"monitors or only for windows on the primary monitor."
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:11
|
||||
msgid "No tab popup"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:12
|
||||
msgid ""
|
||||
"Determines whether the use of popup and highlight frame should be disabled "
|
||||
"for window cycling."
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:13
|
||||
msgid "Delay focus changes until the pointer stops moving"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:14
|
||||
msgid ""
|
||||
"If set to true, and the focus mode is either \"sloppy\" or \"mouse\" then "
|
||||
"the focus will not be changed immediately when entering a window, but only "
|
||||
"after the pointer stops moving."
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:15
|
||||
msgid "Draggable border width"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:16
|
||||
msgid ""
|
||||
"The amount of total draggable borders. If the theme's visible borders are "
|
||||
"not enough, invisible borders will be added to meet this value."
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:17
|
||||
msgid "Auto maximize nearly monitor sized windows"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:18
|
||||
msgid ""
|
||||
"If enabled, new windows that are initially the size of the monitor "
|
||||
"automatically get maximized."
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:19
|
||||
msgid "Place new windows in the center"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:20
|
||||
msgid ""
|
||||
"When true, the new windows will always be put in the center of the active "
|
||||
"screen of the monitor."
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:21
|
||||
msgid "Select window from tab popup"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:22
|
||||
msgid "Cancel tab popup"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:1
|
||||
msgid "Switch to VT 1"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:2
|
||||
msgid "Switch to VT 2"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:3
|
||||
msgid "Switch to VT 3"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:4
|
||||
msgid "Switch to VT 4"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:5
|
||||
msgid "Switch to VT 5"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:6
|
||||
msgid "Switch to VT 6"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:7
|
||||
msgid "Switch to VT 7"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:8
|
||||
msgid "Switch to VT 8"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:9
|
||||
msgid "Switch to VT 9"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:10
|
||||
msgid "Switch to VT 10"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:11
|
||||
msgid "Switch to VT 11"
|
||||
msgstr ""
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:12
|
||||
msgid "Switch to VT 12"
|
||||
msgstr ""
|
||||
|
||||
#: ../src/backends/meta-monitor-manager.c:515
|
||||
msgid "Built-in display"
|
||||
msgstr ""
|
||||
|
||||
#: ../src/backends/meta-monitor-manager.c:538
|
||||
msgid "Unknown"
|
||||
msgstr ""
|
||||
|
||||
#: ../src/backends/meta-monitor-manager.c:540
|
||||
msgid "Unknown Display"
|
||||
msgstr ""
|
||||
|
||||
#. TRANSLATORS: this is a monitor vendor name, followed by a
|
||||
#. * size in inches, like 'Dell 15"'
|
||||
#.
|
||||
#: ../src/backends/meta-monitor-manager.c:548
|
||||
#, c-format
|
||||
msgid "%s %s"
|
||||
msgstr ""
|
||||
|
||||
#. This probably means that a non-WM compositor like xcompmgr is running;
|
||||
#. * we have no way to get it to exit
|
||||
#: ../src/compositor/compositor.c:456
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Another compositing manager is already running on screen %i on display \"%s"
|
||||
"\"."
|
||||
msgstr ""
|
||||
|
||||
#: ../src/core/bell.c:194
|
||||
msgid "Bell event"
|
||||
msgstr ""
|
||||
|
||||
#: ../src/core/delete.c:127
|
||||
#, c-format
|
||||
msgid "“%s” is not responding."
|
||||
msgstr ""
|
||||
|
||||
#: ../src/core/delete.c:129
|
||||
msgid "Application is not responding."
|
||||
msgstr ""
|
||||
|
||||
#: ../src/core/delete.c:134
|
||||
msgid ""
|
||||
"You may choose to wait a short while for it to continue or force the "
|
||||
"application to quit entirely."
|
||||
msgstr ""
|
||||
|
||||
#: ../src/core/delete.c:141
|
||||
msgid "_Wait"
|
||||
msgstr ""
|
||||
|
||||
#: ../src/core/delete.c:141
|
||||
msgid "_Force Quit"
|
||||
msgstr ""
|
||||
|
||||
#: ../src/core/display.c:555
|
||||
#, c-format
|
||||
msgid "Failed to open X Window System display '%s'\n"
|
||||
msgstr ""
|
||||
|
||||
#: ../src/core/main.c:181
|
||||
msgid "Disable connection to session manager"
|
||||
msgstr ""
|
||||
|
||||
#: ../src/core/main.c:187
|
||||
msgid "Replace the running window manager"
|
||||
msgstr ""
|
||||
|
||||
#: ../src/core/main.c:193
|
||||
msgid "Specify session management ID"
|
||||
msgstr ""
|
||||
|
||||
#: ../src/core/main.c:198
|
||||
msgid "X Display to use"
|
||||
msgstr ""
|
||||
|
||||
#: ../src/core/main.c:204
|
||||
msgid "Initialize session from savefile"
|
||||
msgstr ""
|
||||
|
||||
#: ../src/core/main.c:210
|
||||
msgid "Make X calls synchronous"
|
||||
msgstr ""
|
||||
|
||||
#: ../src/core/main.c:217
|
||||
msgid "Run as a wayland compositor"
|
||||
msgstr ""
|
||||
|
||||
#: ../src/core/main.c:223
|
||||
msgid "Run as a nested compositor"
|
||||
msgstr ""
|
||||
|
||||
#: ../src/core/main.c:231
|
||||
msgid "Run as a full display server, rather than nested"
|
||||
msgstr ""
|
||||
|
||||
#: ../src/core/mutter.c:39
|
||||
#, c-format
|
||||
msgid ""
|
||||
"mutter %s\n"
|
||||
"Copyright (C) 2001-%d Havoc Pennington, Red Hat, Inc., and others\n"
|
||||
"This is free software; see the source for copying conditions.\n"
|
||||
"There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A "
|
||||
"PARTICULAR PURPOSE.\n"
|
||||
msgstr ""
|
||||
|
||||
#: ../src/core/mutter.c:53
|
||||
msgid "Print version"
|
||||
msgstr ""
|
||||
|
||||
#: ../src/core/mutter.c:59
|
||||
msgid "Mutter plugin to use"
|
||||
msgstr ""
|
||||
|
||||
#: ../src/core/prefs.c:1997
|
||||
#, c-format
|
||||
msgid "Workspace %d"
|
||||
msgstr ""
|
||||
|
||||
#: ../src/core/screen.c:521
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Display \"%s\" already has a window manager; try using the --replace option "
|
||||
"to replace the current window manager."
|
||||
msgstr ""
|
||||
|
||||
#: ../src/core/screen.c:603
|
||||
#, c-format
|
||||
msgid "Screen %d on display '%s' is invalid\n"
|
||||
msgstr ""
|
||||
|
||||
#: ../src/core/util.c:121
|
||||
msgid "Mutter was compiled without support for verbose mode\n"
|
||||
msgstr ""
|
||||
|
||||
#: ../src/x11/session.c:1815
|
||||
msgid ""
|
||||
"These windows do not support "save current setup" and will have to "
|
||||
"be restarted manually next time you log in."
|
||||
msgstr ""
|
||||
|
||||
#: ../src/x11/window-props.c:549
|
||||
#, c-format
|
||||
msgid "%s (on %s)"
|
||||
msgstr ""
|
73
po/pt.po
73
po/pt.po
@ -3,22 +3,21 @@
|
||||
# Distributed under the same licence as the metacity package
|
||||
# Duarte Loreto <happyguy_pt@hotmail.com>, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014.
|
||||
# Pedro Albuquerque <palbuquerque73@openmailbox.com>, 2015.
|
||||
# Tiago Santos <tiagofsantos81@sapo.pt>, 2016.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: 3.10\n"
|
||||
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
|
||||
"product=mutter&keywords=I18N+L10N&component=general\n"
|
||||
"POT-Creation-Date: 2016-04-30 13:15+0000\n"
|
||||
"PO-Revision-Date: 2016-04-30 16:12+0100\n"
|
||||
"Last-Translator: Tiago Santos <tiagofsantos81@sapo.pt>\n"
|
||||
"POT-Creation-Date: 2015-06-07 22:51+0000\n"
|
||||
"PO-Revision-Date: 2015-06-25 08:16+0100\n"
|
||||
"Last-Translator: Pedro Albuquerque <palbuquerque73@openmailbox.com>\n"
|
||||
"Language-Team: Português <palbuquerque73@openmailbox.com>\n"
|
||||
"Language: pt\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 1.5.4\n"
|
||||
"X-Generator: Gtranslator 2.91.6\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:1
|
||||
@ -42,6 +41,7 @@ msgid "Move window to workspace 4"
|
||||
msgstr "Mover janela para a área de trabalho 4"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:6
|
||||
#| msgid "Move window to workspace 1"
|
||||
msgid "Move window to last workspace"
|
||||
msgstr "Mover janela para a última área de trabalho"
|
||||
|
||||
@ -82,6 +82,7 @@ msgid "Switch applications"
|
||||
msgstr "Mudar de aplicações"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:16
|
||||
#| msgid "Switch applications"
|
||||
msgid "Switch to previous application"
|
||||
msgstr "Mudar para a aplicação anterior"
|
||||
|
||||
@ -90,6 +91,7 @@ msgid "Switch windows"
|
||||
msgstr "Mudar de janelas"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:18
|
||||
#| msgid "Switch windows"
|
||||
msgid "Switch to previous window"
|
||||
msgstr "Mudar para a janela anterior"
|
||||
|
||||
@ -98,6 +100,7 @@ msgid "Switch windows of an application"
|
||||
msgstr "Alternar entre janelas de uma aplicação"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:20
|
||||
#| msgid "Switch windows of an application"
|
||||
msgid "Switch to previous window of an application"
|
||||
msgstr "Mudar para a janela anterior de uma aplicação"
|
||||
|
||||
@ -106,6 +109,7 @@ msgid "Switch system controls"
|
||||
msgstr "Alternar entre controlos de sistema"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:22
|
||||
#| msgid "Switch system controls"
|
||||
msgid "Switch to previous system control"
|
||||
msgstr "Mudar para o controlo de sistema anterior"
|
||||
|
||||
@ -122,6 +126,7 @@ msgid "Switch windows of an app directly"
|
||||
msgstr "Alternar diretamente entre janelas de uma aplicação"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:26
|
||||
#| msgid "Switch windows of an application"
|
||||
msgid "Switch directly to previous window of an app"
|
||||
msgstr "Mudar diretamente para a janela anterior de uma aplicação"
|
||||
|
||||
@ -130,6 +135,7 @@ msgid "Switch system controls directly"
|
||||
msgstr "Alternar diretamente entre controlos de sistema"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:28
|
||||
#| msgid "Switch system controls"
|
||||
msgid "Switch directly to previous system control"
|
||||
msgstr "Mudar diretamente para o controlo de sistema anterior"
|
||||
|
||||
@ -154,6 +160,7 @@ msgid "Switch to workspace 4"
|
||||
msgstr "Mudar para a área de trabalho 4"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:34
|
||||
#| msgid "Switch to workspace 1"
|
||||
msgid "Switch to last workspace"
|
||||
msgstr "Mudar para a última área de trabalho 1"
|
||||
|
||||
@ -408,69 +415,81 @@ msgid "Cancel tab popup"
|
||||
msgstr "Cancelar o popup de tabulador"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:1
|
||||
#| msgid "Switch to workspace 1"
|
||||
msgid "Switch to VT 1"
|
||||
msgstr "Alternar para a área de trabalho 1"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:2
|
||||
#| msgid "Switch to workspace 2"
|
||||
msgid "Switch to VT 2"
|
||||
msgstr "Alternar para a área de trabalho 2"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:3
|
||||
#| msgid "Switch to workspace 3"
|
||||
msgid "Switch to VT 3"
|
||||
msgstr "Alternar para a área de trabalho 3"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:4
|
||||
#| msgid "Switch to workspace 4"
|
||||
msgid "Switch to VT 4"
|
||||
msgstr "Alternar para a área de trabalho 4"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:5
|
||||
#| msgid "Switch to workspace 5"
|
||||
msgid "Switch to VT 5"
|
||||
msgstr "Mover para a área de trabalho 5"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:6
|
||||
#| msgid "Switch to workspace 6"
|
||||
msgid "Switch to VT 6"
|
||||
msgstr "Mover para a área de trabalho 6"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:7
|
||||
#| msgid "Switch to workspace 7"
|
||||
msgid "Switch to VT 7"
|
||||
msgstr "Mover para a área de trabalho 7"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:8
|
||||
#| msgid "Switch to workspace 8"
|
||||
msgid "Switch to VT 8"
|
||||
msgstr "Mover para a área de trabalho 8"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:9
|
||||
#| msgid "Switch to workspace 9"
|
||||
msgid "Switch to VT 9"
|
||||
msgstr "Mover para a área de trabalho 9"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:10
|
||||
#| msgid "Switch to workspace 10"
|
||||
msgid "Switch to VT 10"
|
||||
msgstr "Mover para a área de trabalho 10"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:11
|
||||
#| msgid "Switch to workspace 11"
|
||||
msgid "Switch to VT 11"
|
||||
msgstr "Mover para a área de trabalho 11"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:12
|
||||
#| msgid "Switch to workspace 12"
|
||||
msgid "Switch to VT 12"
|
||||
msgstr "Mover para a área de trabalho 12"
|
||||
|
||||
#: ../src/backends/meta-monitor-manager.c:515
|
||||
#: ../src/backends/meta-monitor-manager.c:496
|
||||
msgid "Built-in display"
|
||||
msgstr "Ecrã embutido"
|
||||
|
||||
#: ../src/backends/meta-monitor-manager.c:538
|
||||
#: ../src/backends/meta-monitor-manager.c:522
|
||||
msgid "Unknown"
|
||||
msgstr "Desconhecido"
|
||||
|
||||
#: ../src/backends/meta-monitor-manager.c:540
|
||||
#: ../src/backends/meta-monitor-manager.c:524
|
||||
msgid "Unknown Display"
|
||||
msgstr "Ecrã desconhecido"
|
||||
|
||||
#. TRANSLATORS: this is a monitor vendor name, followed by a
|
||||
#. * size in inches, like 'Dell 15"'
|
||||
#.
|
||||
#: ../src/backends/meta-monitor-manager.c:548
|
||||
#: ../src/backends/meta-monitor-manager.c:532
|
||||
#, c-format
|
||||
msgid "%s %s"
|
||||
msgstr "%s %s"
|
||||
@ -486,7 +505,7 @@ msgstr ""
|
||||
"Já se encontra em execução outro gestor de janelas no ecrã %i do monitor \"%s"
|
||||
"\"."
|
||||
|
||||
#: ../src/core/bell.c:194
|
||||
#: ../src/core/bell.c:185
|
||||
msgid "Bell event"
|
||||
msgstr "Evento de campainha"
|
||||
|
||||
@ -515,45 +534,40 @@ msgstr "_Aguardar"
|
||||
msgid "_Force Quit"
|
||||
msgstr "_Forçar terminar"
|
||||
|
||||
#: ../src/core/display.c:555
|
||||
#: ../src/core/display.c:563
|
||||
#, c-format
|
||||
msgid "Failed to open X Window System display '%s'\n"
|
||||
msgstr "Falha ao abrir ecrã \"%s\" do sistema Janelas X\n"
|
||||
|
||||
#: ../src/core/main.c:181
|
||||
#: ../src/core/main.c:176
|
||||
msgid "Disable connection to session manager"
|
||||
msgstr "Desativar a ligação ao gestor de sessão"
|
||||
|
||||
#: ../src/core/main.c:187
|
||||
#: ../src/core/main.c:182
|
||||
msgid "Replace the running window manager"
|
||||
msgstr "Substituir o gestor de janelas em execução"
|
||||
|
||||
#: ../src/core/main.c:193
|
||||
#: ../src/core/main.c:188
|
||||
msgid "Specify session management ID"
|
||||
msgstr "Especificar a ID de gestão de sessão"
|
||||
|
||||
#: ../src/core/main.c:198
|
||||
#: ../src/core/main.c:193
|
||||
msgid "X Display to use"
|
||||
msgstr "Ecrã X a utilizar"
|
||||
|
||||
#: ../src/core/main.c:204
|
||||
#: ../src/core/main.c:199
|
||||
msgid "Initialize session from savefile"
|
||||
msgstr "Inicializar a sessão a partir de um ficheiro de gravação de sessão"
|
||||
|
||||
#: ../src/core/main.c:210
|
||||
#: ../src/core/main.c:205
|
||||
msgid "Make X calls synchronous"
|
||||
msgstr "Fazer as chamadas X sincronamente"
|
||||
|
||||
#: ../src/core/main.c:217
|
||||
#: ../src/core/main.c:212
|
||||
msgid "Run as a wayland compositor"
|
||||
msgstr "Executar como compositor wayland"
|
||||
|
||||
#: ../src/core/main.c:223
|
||||
#| msgid "Run as a wayland compositor"
|
||||
msgid "Run as a nested compositor"
|
||||
msgstr "Executar como compositor aninhado"
|
||||
|
||||
#: ../src/core/main.c:231
|
||||
#: ../src/core/main.c:220
|
||||
msgid "Run as a full display server, rather than nested"
|
||||
msgstr "Executar como servidor de ecrã completo, em vez de aninhado"
|
||||
|
||||
@ -581,13 +595,16 @@ msgstr "Imprimir a versão"
|
||||
msgid "Mutter plugin to use"
|
||||
msgstr "Extensão Mutter a utilizar"
|
||||
|
||||
#: ../src/core/prefs.c:1997
|
||||
#: ../src/core/prefs.c:2004
|
||||
#, c-format
|
||||
msgid "Workspace %d"
|
||||
msgstr "Área de trabalho %d"
|
||||
|
||||
#: ../src/core/screen.c:521
|
||||
#: ../src/core/screen.c:525
|
||||
#, c-format
|
||||
#| msgid ""
|
||||
#| "Screen %d on display \"%s\" already has a window manager; try using the --"
|
||||
#| "replace option to replace the current window manager.\n"
|
||||
msgid ""
|
||||
"Display \"%s\" already has a window manager; try using the --replace option "
|
||||
"to replace the current window manager."
|
||||
@ -595,12 +612,12 @@ msgstr ""
|
||||
"O ecrã \"%s\" já tem um gestor de janelas; tente utilizar a opção --replace "
|
||||
"para substituir o gestor de janelas atual."
|
||||
|
||||
#: ../src/core/screen.c:603
|
||||
#: ../src/core/screen.c:607
|
||||
#, c-format
|
||||
msgid "Screen %d on display '%s' is invalid\n"
|
||||
msgstr "Ecrã %d no monitor \"%s\" é inválido\n"
|
||||
|
||||
#: ../src/core/util.c:121
|
||||
#: ../src/core/util.c:118
|
||||
msgid "Mutter was compiled without support for verbose mode\n"
|
||||
msgstr "O Mutter foi compilado sem suporte para modo verboso\n"
|
||||
|
||||
|
@ -62,8 +62,6 @@ mutter_built_sources += \
|
||||
relative-pointer-unstable-v1-server-protocol.h \
|
||||
pointer-constraints-unstable-v1-protocol.c \
|
||||
pointer-constraints-unstable-v1-server-protocol.h \
|
||||
tablet-unstable-v1-protocol.c \
|
||||
tablet-unstable-v1-server-protocol.h \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
@ -294,20 +292,10 @@ libmutter_la_SOURCES += \
|
||||
wayland/meta-wayland-popup.h \
|
||||
wayland/meta-wayland-seat.c \
|
||||
wayland/meta-wayland-seat.h \
|
||||
wayland/meta-wayland-tablet.c \
|
||||
wayland/meta-wayland-tablet.h \
|
||||
wayland/meta-wayland-tablet-manager.c \
|
||||
wayland/meta-wayland-tablet-manager.h \
|
||||
wayland/meta-wayland-tablet-seat.c \
|
||||
wayland/meta-wayland-tablet-seat.h \
|
||||
wayland/meta-wayland-tablet-tool.c \
|
||||
wayland/meta-wayland-tablet-tool.h \
|
||||
wayland/meta-wayland-touch.c \
|
||||
wayland/meta-wayland-touch.h \
|
||||
wayland/meta-wayland-surface.c \
|
||||
wayland/meta-wayland-surface.h \
|
||||
wayland/meta-wayland-surface-role-cursor.c \
|
||||
wayland/meta-wayland-surface-role-cursor.h \
|
||||
wayland/meta-wayland-types.h \
|
||||
wayland/meta-wayland-versions.h \
|
||||
wayland/meta-wayland-outputs.c \
|
||||
|
@ -40,7 +40,6 @@ struct _MetaCursorRendererPrivate
|
||||
int current_x, current_y;
|
||||
|
||||
MetaCursorSprite *displayed_cursor;
|
||||
MetaOverlay *stage_overlay;
|
||||
gboolean handled_by_backend;
|
||||
};
|
||||
typedef struct _MetaCursorRendererPrivate MetaCursorRendererPrivate;
|
||||
@ -64,48 +63,24 @@ queue_redraw (MetaCursorRenderer *renderer,
|
||||
if (!stage)
|
||||
return;
|
||||
|
||||
if (!priv->stage_overlay)
|
||||
priv->stage_overlay = meta_stage_create_cursor_overlay (META_STAGE (stage));
|
||||
|
||||
if (cursor_sprite && !priv->handled_by_backend)
|
||||
texture = meta_cursor_sprite_get_cogl_texture (cursor_sprite);
|
||||
else
|
||||
texture = NULL;
|
||||
|
||||
meta_stage_update_cursor_overlay (META_STAGE (stage), priv->stage_overlay,
|
||||
texture, &rect);
|
||||
meta_stage_set_cursor (META_STAGE (stage), texture, &rect);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_cursor_renderer_real_update_cursor (MetaCursorRenderer *renderer,
|
||||
MetaCursorSprite *cursor_sprite)
|
||||
{
|
||||
if (cursor_sprite)
|
||||
meta_cursor_sprite_realize_texture (cursor_sprite);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_cursor_renderer_finalize (GObject *object)
|
||||
{
|
||||
MetaCursorRenderer *renderer = META_CURSOR_RENDERER (object);
|
||||
MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (renderer);
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
ClutterActor *stage = meta_backend_get_stage (backend);
|
||||
|
||||
if (priv->stage_overlay)
|
||||
meta_stage_remove_cursor_overlay (META_STAGE (stage), priv->stage_overlay);
|
||||
|
||||
G_OBJECT_CLASS (meta_cursor_renderer_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_cursor_renderer_class_init (MetaCursorRendererClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->finalize = meta_cursor_renderer_finalize;
|
||||
klass->update_cursor = meta_cursor_renderer_real_update_cursor;
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include <meta/meta-backend.h>
|
||||
#include <meta/util.h>
|
||||
|
||||
struct _MetaOverlay {
|
||||
typedef struct {
|
||||
gboolean enabled;
|
||||
|
||||
CoglPipeline *pipeline;
|
||||
@ -36,26 +36,22 @@ struct _MetaOverlay {
|
||||
MetaRectangle current_rect;
|
||||
MetaRectangle previous_rect;
|
||||
gboolean previous_is_valid;
|
||||
};
|
||||
} MetaOverlay;
|
||||
|
||||
struct _MetaStagePrivate {
|
||||
GList *overlays;
|
||||
MetaOverlay cursor_overlay;
|
||||
gboolean is_active;
|
||||
};
|
||||
typedef struct _MetaStagePrivate MetaStagePrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (MetaStage, meta_stage, CLUTTER_TYPE_STAGE);
|
||||
|
||||
static MetaOverlay *
|
||||
meta_overlay_new ()
|
||||
static void
|
||||
meta_overlay_init (MetaOverlay *overlay)
|
||||
{
|
||||
MetaOverlay *overlay;
|
||||
CoglContext *ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
||||
|
||||
overlay = g_slice_new0 (MetaOverlay);
|
||||
overlay->pipeline = cogl_pipeline_new (ctx);
|
||||
|
||||
return overlay;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -63,8 +59,6 @@ meta_overlay_free (MetaOverlay *overlay)
|
||||
{
|
||||
if (overlay->pipeline)
|
||||
cogl_object_unref (overlay->pipeline);
|
||||
|
||||
g_slice_free (MetaOverlay, overlay);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -117,15 +111,8 @@ meta_stage_finalize (GObject *object)
|
||||
{
|
||||
MetaStage *stage = META_STAGE (object);
|
||||
MetaStagePrivate *priv = meta_stage_get_instance_private (stage);
|
||||
GList *l = priv->overlays;
|
||||
|
||||
while (l)
|
||||
{
|
||||
meta_overlay_free (l->data);
|
||||
l = g_list_delete_link (l, l);
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (meta_stage_parent_class)->finalize (object);
|
||||
meta_overlay_free (&priv->cursor_overlay);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -133,12 +120,10 @@ meta_stage_paint (ClutterActor *actor)
|
||||
{
|
||||
MetaStage *stage = META_STAGE (actor);
|
||||
MetaStagePrivate *priv = meta_stage_get_instance_private (stage);
|
||||
GList *l;
|
||||
|
||||
CLUTTER_ACTOR_CLASS (meta_stage_parent_class)->paint (actor);
|
||||
|
||||
for (l = priv->overlays; l; l = l->next)
|
||||
meta_overlay_paint (l->data);
|
||||
meta_overlay_paint (&priv->cursor_overlay);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -181,6 +166,10 @@ meta_stage_class_init (MetaStageClass *klass)
|
||||
static void
|
||||
meta_stage_init (MetaStage *stage)
|
||||
{
|
||||
MetaStagePrivate *priv = meta_stage_get_instance_private (stage);
|
||||
|
||||
meta_overlay_init (&priv->cursor_overlay);
|
||||
|
||||
clutter_stage_set_user_resizable (CLUTTER_STAGE (stage), FALSE);
|
||||
}
|
||||
|
||||
@ -220,43 +209,17 @@ queue_redraw_for_overlay (MetaStage *stage,
|
||||
}
|
||||
}
|
||||
|
||||
MetaOverlay *
|
||||
meta_stage_create_cursor_overlay (MetaStage *stage)
|
||||
void
|
||||
meta_stage_set_cursor (MetaStage *stage,
|
||||
CoglTexture *texture,
|
||||
MetaRectangle *rect)
|
||||
{
|
||||
MetaStagePrivate *priv = meta_stage_get_instance_private (stage);
|
||||
MetaOverlay *overlay;
|
||||
|
||||
overlay = meta_overlay_new ();
|
||||
priv->overlays = g_list_prepend (priv->overlays, overlay);
|
||||
|
||||
return overlay;
|
||||
}
|
||||
|
||||
void
|
||||
meta_stage_remove_cursor_overlay (MetaStage *stage,
|
||||
MetaOverlay *overlay)
|
||||
{
|
||||
MetaStagePrivate *priv = meta_stage_get_instance_private (stage);
|
||||
GList *link;
|
||||
|
||||
link = g_list_find (priv->overlays, overlay);
|
||||
if (!link)
|
||||
return;
|
||||
|
||||
priv->overlays = g_list_delete_link (priv->overlays, link);
|
||||
meta_overlay_free (overlay);
|
||||
}
|
||||
|
||||
void
|
||||
meta_stage_update_cursor_overlay (MetaStage *stage,
|
||||
MetaOverlay *overlay,
|
||||
CoglTexture *texture,
|
||||
MetaRectangle *rect)
|
||||
{
|
||||
g_assert (meta_is_wayland_compositor () || texture == NULL);
|
||||
|
||||
meta_overlay_set (overlay, texture, rect);
|
||||
queue_redraw_for_overlay (stage, overlay);
|
||||
meta_overlay_set (&priv->cursor_overlay, texture, rect);
|
||||
queue_redraw_for_overlay (stage, &priv->cursor_overlay);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -36,7 +36,6 @@ G_BEGIN_DECLS
|
||||
|
||||
typedef struct _MetaStage MetaStage;
|
||||
typedef struct _MetaStageClass MetaStageClass;
|
||||
typedef struct _MetaOverlay MetaOverlay;
|
||||
|
||||
struct _MetaStageClass
|
||||
{
|
||||
@ -52,14 +51,9 @@ GType meta_stage_get_type (void) G_GNUC_CONST;
|
||||
|
||||
ClutterActor *meta_stage_new (void);
|
||||
|
||||
MetaOverlay *meta_stage_create_cursor_overlay (MetaStage *stage);
|
||||
void meta_stage_remove_cursor_overlay (MetaStage *stage,
|
||||
MetaOverlay *overlay);
|
||||
|
||||
void meta_stage_update_cursor_overlay (MetaStage *stage,
|
||||
MetaOverlay *overlay,
|
||||
CoglTexture *texture,
|
||||
MetaRectangle *rect);
|
||||
void meta_stage_set_cursor (MetaStage *stage,
|
||||
CoglTexture *texture,
|
||||
MetaRectangle *rect);
|
||||
|
||||
void meta_stage_set_active (MetaStage *stage,
|
||||
gboolean is_active);
|
||||
|
@ -221,20 +221,8 @@ meta_display_handle_event (MetaDisplay *display,
|
||||
|
||||
if (meta_is_wayland_compositor () && event->type == CLUTTER_MOTION)
|
||||
{
|
||||
MetaWaylandCompositor *compositor;
|
||||
|
||||
compositor = meta_wayland_compositor_get_default ();
|
||||
|
||||
if (meta_wayland_tablet_manager_consumes_event (compositor->tablet_manager, event))
|
||||
{
|
||||
meta_wayland_tablet_manager_update_cursor_position (compositor->tablet_manager, event);
|
||||
}
|
||||
else
|
||||
{
|
||||
MetaCursorTracker *tracker = meta_cursor_tracker_get_for_screen (NULL);
|
||||
meta_cursor_tracker_update_position (tracker, event->motion.x, event->motion.y);
|
||||
}
|
||||
|
||||
meta_cursor_tracker_update_position (meta_cursor_tracker_get_for_screen (NULL),
|
||||
event->motion.x, event->motion.y);
|
||||
display->monitor_cache_invalidated = TRUE;
|
||||
}
|
||||
|
||||
|
@ -1424,10 +1424,9 @@ meta_wayland_drag_dest_focus_out (MetaWaylandDataDevice *data_device,
|
||||
{
|
||||
MetaWaylandDragGrab *grab = data_device->current_grab;
|
||||
|
||||
if (!grab->drag_focus_data_device)
|
||||
return;
|
||||
if (grab->drag_focus_data_device)
|
||||
wl_data_device_send_leave (grab->drag_focus_data_device);
|
||||
|
||||
wl_data_device_send_leave (grab->drag_focus_data_device);
|
||||
wl_list_remove (&grab->drag_focus_listener.link);
|
||||
grab->drag_focus_data_device = NULL;
|
||||
}
|
||||
@ -1440,9 +1439,6 @@ meta_wayland_drag_dest_motion (MetaWaylandDataDevice *data_device,
|
||||
MetaWaylandDragGrab *grab = data_device->current_grab;
|
||||
wl_fixed_t sx, sy;
|
||||
|
||||
if (!grab->drag_focus_data_device)
|
||||
return;
|
||||
|
||||
meta_wayland_pointer_get_relative_coordinates (grab->generic.pointer,
|
||||
grab->drag_focus,
|
||||
&sx, &sy);
|
||||
@ -1457,9 +1453,6 @@ meta_wayland_drag_dest_drop (MetaWaylandDataDevice *data_device,
|
||||
{
|
||||
MetaWaylandDragGrab *grab = data_device->current_grab;
|
||||
|
||||
if (!grab->drag_focus_data_device)
|
||||
return;
|
||||
|
||||
wl_data_device_send_drop (grab->drag_focus_data_device);
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,6 @@
|
||||
#include "meta-wayland-private.h"
|
||||
#include "meta-wayland-surface.h"
|
||||
#include "meta-wayland-buffer.h"
|
||||
#include "meta-wayland-surface-role-cursor.h"
|
||||
#include "meta-xwayland.h"
|
||||
#include "meta-cursor.h"
|
||||
#include "meta-cursor-tracker-private.h"
|
||||
@ -74,6 +73,24 @@
|
||||
|
||||
#define DEFAULT_AXIS_STEP_DISTANCE wl_fixed_from_int (10)
|
||||
|
||||
struct _MetaWaylandSurfaceRoleCursor
|
||||
{
|
||||
MetaWaylandSurfaceRole parent;
|
||||
|
||||
int hot_x;
|
||||
int hot_y;
|
||||
MetaCursorSprite *cursor_sprite;
|
||||
|
||||
MetaWaylandBuffer *buffer;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (MetaWaylandSurfaceRoleCursor,
|
||||
meta_wayland_surface_role_cursor,
|
||||
META_TYPE_WAYLAND_SURFACE_ROLE);
|
||||
|
||||
static void
|
||||
meta_wayland_pointer_update_cursor_surface (MetaWaylandPointer *pointer);
|
||||
|
||||
static MetaWaylandPointerClient *
|
||||
meta_wayland_pointer_client_new (void)
|
||||
{
|
||||
@ -484,12 +501,6 @@ meta_wayland_pointer_release (MetaWaylandPointer *pointer)
|
||||
(gpointer) meta_wayland_pointer_on_cursor_changed,
|
||||
pointer);
|
||||
|
||||
if (pointer->cursor_surface && pointer->cursor_surface_destroy_id)
|
||||
{
|
||||
g_signal_handler_disconnect (pointer->cursor_surface,
|
||||
pointer->cursor_surface_destroy_id);
|
||||
}
|
||||
|
||||
meta_wayland_pointer_set_focus (pointer, NULL);
|
||||
|
||||
g_clear_pointer (&pointer->pointer_clients, g_hash_table_unref);
|
||||
@ -923,7 +934,7 @@ meta_wayland_pointer_get_relative_coordinates (MetaWaylandPointer *pointer,
|
||||
*sy = wl_fixed_from_double (yf);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
meta_wayland_pointer_update_cursor_surface (MetaWaylandPointer *pointer)
|
||||
{
|
||||
MetaCursorTracker *cursor_tracker = meta_cursor_tracker_get_for_screen (NULL);
|
||||
@ -937,7 +948,7 @@ meta_wayland_pointer_update_cursor_surface (MetaWaylandPointer *pointer)
|
||||
MetaWaylandSurfaceRoleCursor *cursor_role =
|
||||
META_WAYLAND_SURFACE_ROLE_CURSOR (pointer->cursor_surface->role);
|
||||
|
||||
cursor_sprite = meta_wayland_surface_role_cursor_get_sprite (cursor_role);
|
||||
cursor_sprite = cursor_role->cursor_sprite;
|
||||
}
|
||||
|
||||
meta_cursor_tracker_set_window_cursor (cursor_tracker, cursor_sprite);
|
||||
@ -949,14 +960,68 @@ meta_wayland_pointer_update_cursor_surface (MetaWaylandPointer *pointer)
|
||||
}
|
||||
|
||||
static void
|
||||
ensure_update_cursor_surface (MetaWaylandPointer *pointer,
|
||||
MetaWaylandSurface *surface)
|
||||
update_cursor_sprite_texture (MetaWaylandSurface *surface)
|
||||
{
|
||||
if (pointer->cursor_surface != surface)
|
||||
return;
|
||||
MetaCursorRenderer *cursor_renderer =
|
||||
meta_backend_get_cursor_renderer (meta_get_backend ());
|
||||
MetaCursorTracker *cursor_tracker = meta_cursor_tracker_get_for_screen (NULL);
|
||||
MetaWaylandSurfaceRoleCursor *cursor_role =
|
||||
META_WAYLAND_SURFACE_ROLE_CURSOR (surface->role);
|
||||
MetaCursorSprite *cursor_sprite = cursor_role->cursor_sprite;
|
||||
MetaWaylandBuffer *buffer = meta_wayland_surface_get_buffer (surface);
|
||||
|
||||
pointer->cursor_surface = NULL;
|
||||
meta_wayland_pointer_update_cursor_surface (pointer);
|
||||
g_return_if_fail (!buffer || buffer->texture);
|
||||
|
||||
if (buffer)
|
||||
{
|
||||
meta_cursor_sprite_set_texture (cursor_sprite,
|
||||
buffer->texture,
|
||||
cursor_role->hot_x * surface->scale,
|
||||
cursor_role->hot_y * surface->scale);
|
||||
|
||||
if (cursor_role->buffer)
|
||||
{
|
||||
struct wl_resource *buffer_resource;
|
||||
|
||||
g_assert (cursor_role->buffer == buffer);
|
||||
buffer_resource = buffer->resource;
|
||||
meta_cursor_renderer_realize_cursor_from_wl_buffer (cursor_renderer,
|
||||
cursor_sprite,
|
||||
buffer_resource);
|
||||
|
||||
meta_wayland_surface_unref_buffer_use_count (surface);
|
||||
g_clear_object (&cursor_role->buffer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
meta_cursor_sprite_set_texture (cursor_sprite, NULL, 0, 0);
|
||||
}
|
||||
|
||||
if (cursor_sprite == meta_cursor_tracker_get_displayed_cursor (cursor_tracker))
|
||||
meta_cursor_renderer_force_update (cursor_renderer);
|
||||
}
|
||||
|
||||
static void
|
||||
cursor_sprite_prepare_at (MetaCursorSprite *cursor_sprite,
|
||||
int x,
|
||||
int y,
|
||||
MetaWaylandSurfaceRoleCursor *cursor_role)
|
||||
{
|
||||
MetaWaylandSurfaceRole *role = META_WAYLAND_SURFACE_ROLE (cursor_role);
|
||||
MetaWaylandSurface *surface = meta_wayland_surface_role_get_surface (role);
|
||||
MetaDisplay *display = meta_get_display ();
|
||||
MetaScreen *screen = display->screen;
|
||||
const MetaMonitorInfo *monitor;
|
||||
|
||||
if (!meta_xwayland_is_xwayland_surface (surface))
|
||||
{
|
||||
monitor = meta_screen_get_monitor_for_point (screen, x, y);
|
||||
if (monitor)
|
||||
meta_cursor_sprite_set_texture_scale (cursor_sprite,
|
||||
(float)monitor->scale / surface->scale);
|
||||
}
|
||||
meta_wayland_surface_update_outputs (surface);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -966,28 +1031,14 @@ meta_wayland_pointer_set_cursor_surface (MetaWaylandPointer *pointer,
|
||||
MetaWaylandSurface *prev_cursor_surface;
|
||||
|
||||
prev_cursor_surface = pointer->cursor_surface;
|
||||
|
||||
if (prev_cursor_surface == cursor_surface)
|
||||
return;
|
||||
|
||||
pointer->cursor_surface = cursor_surface;
|
||||
|
||||
if (prev_cursor_surface)
|
||||
if (prev_cursor_surface != cursor_surface)
|
||||
{
|
||||
meta_wayland_surface_update_outputs (prev_cursor_surface);
|
||||
g_signal_handler_disconnect (prev_cursor_surface,
|
||||
pointer->cursor_surface_destroy_id);
|
||||
if (prev_cursor_surface)
|
||||
meta_wayland_surface_update_outputs (prev_cursor_surface);
|
||||
meta_wayland_pointer_update_cursor_surface (pointer);
|
||||
}
|
||||
|
||||
if (cursor_surface)
|
||||
{
|
||||
pointer->cursor_surface_destroy_id =
|
||||
g_signal_connect_swapped (cursor_surface, "destroy",
|
||||
G_CALLBACK (ensure_update_cursor_surface),
|
||||
pointer);
|
||||
}
|
||||
|
||||
meta_wayland_pointer_update_cursor_surface (pointer);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1021,15 +1072,23 @@ pointer_set_cursor (struct wl_client *client,
|
||||
|
||||
if (surface)
|
||||
{
|
||||
MetaCursorRenderer *cursor_renderer =
|
||||
meta_backend_get_cursor_renderer (meta_get_backend ());
|
||||
MetaWaylandSurfaceRoleCursor *cursor_role;
|
||||
|
||||
cursor_role = META_WAYLAND_SURFACE_ROLE_CURSOR (surface->role);
|
||||
meta_wayland_surface_role_cursor_set_renderer (cursor_role,
|
||||
cursor_renderer);
|
||||
meta_wayland_surface_role_cursor_set_hotspot (cursor_role,
|
||||
hot_x, hot_y);
|
||||
if (!cursor_role->cursor_sprite)
|
||||
{
|
||||
cursor_role->cursor_sprite = meta_cursor_sprite_new ();
|
||||
g_signal_connect_object (cursor_role->cursor_sprite,
|
||||
"prepare-at",
|
||||
G_CALLBACK (cursor_sprite_prepare_at),
|
||||
cursor_role,
|
||||
0);
|
||||
}
|
||||
|
||||
cursor_role->hot_x = hot_x;
|
||||
cursor_role->hot_y = hot_y;
|
||||
|
||||
update_cursor_sprite_texture (surface);
|
||||
}
|
||||
|
||||
meta_wayland_pointer_set_cursor_surface (pointer, surface);
|
||||
@ -1079,7 +1138,8 @@ meta_wayland_pointer_can_grab_surface (MetaWaylandPointer *pointer,
|
||||
MetaWaylandSurface *surface,
|
||||
uint32_t serial)
|
||||
{
|
||||
return (pointer->grab_serial == serial &&
|
||||
return (pointer->button_count > 0 &&
|
||||
pointer->grab_serial == serial &&
|
||||
pointer->focus_surface == surface);
|
||||
}
|
||||
|
||||
@ -1202,3 +1262,136 @@ meta_wayland_pointer_get_seat (MetaWaylandPointer *pointer)
|
||||
MetaWaylandSeat *seat = wl_container_of (pointer, seat, pointer);
|
||||
return seat;
|
||||
}
|
||||
|
||||
static void
|
||||
cursor_surface_role_assigned (MetaWaylandSurfaceRole *surface_role)
|
||||
{
|
||||
MetaWaylandSurfaceRoleCursor *cursor_role =
|
||||
META_WAYLAND_SURFACE_ROLE_CURSOR (surface_role);
|
||||
MetaWaylandSurface *surface =
|
||||
meta_wayland_surface_role_get_surface (surface_role);
|
||||
MetaWaylandBuffer *buffer = meta_wayland_surface_get_buffer (surface);
|
||||
|
||||
if (buffer)
|
||||
{
|
||||
g_set_object (&cursor_role->buffer, buffer);
|
||||
meta_wayland_surface_ref_buffer_use_count (surface);
|
||||
}
|
||||
|
||||
meta_wayland_surface_queue_pending_frame_callbacks (surface);
|
||||
}
|
||||
|
||||
static void
|
||||
cursor_surface_role_pre_commit (MetaWaylandSurfaceRole *surface_role,
|
||||
MetaWaylandPendingState *pending)
|
||||
{
|
||||
MetaWaylandSurfaceRoleCursor *cursor_role =
|
||||
META_WAYLAND_SURFACE_ROLE_CURSOR (surface_role);
|
||||
MetaWaylandSurface *surface =
|
||||
meta_wayland_surface_role_get_surface (surface_role);
|
||||
|
||||
if (pending->newly_attached && cursor_role->buffer)
|
||||
{
|
||||
meta_wayland_surface_unref_buffer_use_count (surface);
|
||||
g_clear_object (&cursor_role->buffer);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
cursor_surface_role_commit (MetaWaylandSurfaceRole *surface_role,
|
||||
MetaWaylandPendingState *pending)
|
||||
{
|
||||
MetaWaylandSurfaceRoleCursor *cursor_role =
|
||||
META_WAYLAND_SURFACE_ROLE_CURSOR (surface_role);
|
||||
MetaWaylandSurface *surface =
|
||||
meta_wayland_surface_role_get_surface (surface_role);
|
||||
MetaWaylandBuffer *buffer = meta_wayland_surface_get_buffer (surface);
|
||||
|
||||
if (pending->newly_attached)
|
||||
{
|
||||
g_set_object (&cursor_role->buffer, buffer);
|
||||
if (cursor_role->buffer)
|
||||
meta_wayland_surface_ref_buffer_use_count (surface);
|
||||
}
|
||||
|
||||
meta_wayland_surface_queue_pending_state_frame_callbacks (surface, pending);
|
||||
|
||||
if (pending->newly_attached)
|
||||
update_cursor_sprite_texture (surface);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
cursor_surface_role_is_on_output (MetaWaylandSurfaceRole *role,
|
||||
MetaMonitorInfo *monitor)
|
||||
{
|
||||
MetaWaylandSurface *surface =
|
||||
meta_wayland_surface_role_get_surface (role);
|
||||
MetaWaylandPointer *pointer = &surface->compositor->seat->pointer;
|
||||
MetaCursorTracker *cursor_tracker = meta_cursor_tracker_get_for_screen (NULL);
|
||||
MetaCursorRenderer *cursor_renderer =
|
||||
meta_backend_get_cursor_renderer (meta_get_backend ());
|
||||
MetaWaylandSurfaceRoleCursor *cursor_role =
|
||||
META_WAYLAND_SURFACE_ROLE_CURSOR (surface->role);
|
||||
MetaCursorSprite *displayed_cursor_sprite;
|
||||
MetaRectangle rect;
|
||||
|
||||
if (surface != pointer->cursor_surface)
|
||||
return FALSE;
|
||||
|
||||
displayed_cursor_sprite =
|
||||
meta_cursor_tracker_get_displayed_cursor (cursor_tracker);
|
||||
if (!displayed_cursor_sprite)
|
||||
return FALSE;
|
||||
|
||||
if (cursor_role->cursor_sprite != displayed_cursor_sprite)
|
||||
return FALSE;
|
||||
|
||||
rect = meta_cursor_renderer_calculate_rect (cursor_renderer,
|
||||
cursor_role->cursor_sprite);
|
||||
return meta_rectangle_overlap (&rect, &monitor->rect);
|
||||
}
|
||||
|
||||
static void
|
||||
cursor_surface_role_dispose (GObject *object)
|
||||
{
|
||||
MetaWaylandSurfaceRoleCursor *cursor_role =
|
||||
META_WAYLAND_SURFACE_ROLE_CURSOR (object);
|
||||
MetaWaylandSurface *surface =
|
||||
meta_wayland_surface_role_get_surface (META_WAYLAND_SURFACE_ROLE (object));
|
||||
MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default ();
|
||||
MetaWaylandPointer *pointer = &compositor->seat->pointer;
|
||||
|
||||
if (pointer->cursor_surface == surface)
|
||||
pointer->cursor_surface = NULL;
|
||||
meta_wayland_pointer_update_cursor_surface (pointer);
|
||||
|
||||
g_clear_object (&cursor_role->cursor_sprite);
|
||||
|
||||
if (cursor_role->buffer)
|
||||
{
|
||||
meta_wayland_surface_unref_buffer_use_count (surface);
|
||||
g_clear_object (&cursor_role->buffer);
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (meta_wayland_surface_role_cursor_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_surface_role_cursor_init (MetaWaylandSurfaceRoleCursor *role)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_surface_role_cursor_class_init (MetaWaylandSurfaceRoleCursorClass *klass)
|
||||
{
|
||||
MetaWaylandSurfaceRoleClass *surface_role_class =
|
||||
META_WAYLAND_SURFACE_ROLE_CLASS (klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
surface_role_class->assigned = cursor_surface_role_assigned;
|
||||
surface_role_class->pre_commit = cursor_surface_role_pre_commit;
|
||||
surface_role_class->commit = cursor_surface_role_commit;
|
||||
surface_role_class->is_on_output = cursor_surface_role_is_on_output;
|
||||
|
||||
object_class->dispose = cursor_surface_role_dispose;
|
||||
}
|
||||
|
@ -32,6 +32,12 @@
|
||||
|
||||
#include <meta/meta-cursor-tracker.h>
|
||||
|
||||
#define META_TYPE_WAYLAND_SURFACE_ROLE_CURSOR (meta_wayland_surface_role_cursor_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (MetaWaylandSurfaceRoleCursor,
|
||||
meta_wayland_surface_role_cursor,
|
||||
META, WAYLAND_SURFACE_ROLE_CURSOR,
|
||||
MetaWaylandSurfaceRole);
|
||||
|
||||
struct _MetaWaylandPointerGrabInterface
|
||||
{
|
||||
void (*focus) (MetaWaylandPointerGrab *grab,
|
||||
@ -69,7 +75,6 @@ struct _MetaWaylandPointer
|
||||
guint32 click_serial;
|
||||
|
||||
MetaWaylandSurface *cursor_surface;
|
||||
guint cursor_surface_destroy_id;
|
||||
|
||||
MetaWaylandPointerGrab *grab;
|
||||
MetaWaylandPointerGrab default_grab;
|
||||
@ -146,8 +151,4 @@ void meta_wayland_relative_pointer_init (MetaWaylandCompositor *compositor);
|
||||
|
||||
MetaWaylandSeat *meta_wayland_pointer_get_seat (MetaWaylandPointer *pointer);
|
||||
|
||||
void meta_wayland_surface_cursor_update (MetaWaylandSurface *cursor_surface);
|
||||
|
||||
void meta_wayland_pointer_update_cursor_surface (MetaWaylandPointer *pointer);
|
||||
|
||||
#endif /* META_WAYLAND_POINTER_H */
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include "meta-wayland-surface.h"
|
||||
#include "meta-wayland-seat.h"
|
||||
#include "meta-wayland-pointer-gestures.h"
|
||||
#include "meta-wayland-tablet-manager.h"
|
||||
|
||||
typedef struct _MetaXWaylandSelection MetaXWaylandSelection;
|
||||
|
||||
@ -70,7 +69,6 @@ struct _MetaWaylandCompositor
|
||||
MetaXWaylandManager xwayland_manager;
|
||||
|
||||
MetaWaylandSeat *seat;
|
||||
MetaWaylandTabletManager *tablet_manager;
|
||||
};
|
||||
|
||||
#endif /* META_WAYLAND_PRIVATE_H */
|
||||
|
@ -205,8 +205,7 @@ meta_wayland_seat_devices_updated (ClutterDeviceManager *device_manager,
|
||||
}
|
||||
|
||||
static MetaWaylandSeat *
|
||||
meta_wayland_seat_new (MetaWaylandCompositor *compositor,
|
||||
struct wl_display *display)
|
||||
meta_wayland_seat_new (struct wl_display *display)
|
||||
{
|
||||
MetaWaylandSeat *seat = g_new0 (MetaWaylandSeat, 1);
|
||||
ClutterDeviceManager *device_manager;
|
||||
@ -225,16 +224,13 @@ meta_wayland_seat_new (MetaWaylandCompositor *compositor,
|
||||
|
||||
wl_global_create (display, &wl_seat_interface, META_WL_SEAT_VERSION, seat, bind_seat);
|
||||
|
||||
meta_wayland_tablet_manager_ensure_seat (compositor->tablet_manager, seat);
|
||||
|
||||
return seat;
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_seat_init (MetaWaylandCompositor *compositor)
|
||||
{
|
||||
compositor->seat = meta_wayland_seat_new (compositor,
|
||||
compositor->wayland_display);
|
||||
compositor->seat = meta_wayland_seat_new (compositor->wayland_display);
|
||||
}
|
||||
|
||||
void
|
||||
@ -378,11 +374,10 @@ meta_wayland_seat_set_input_focus (MetaWaylandSeat *seat,
|
||||
|
||||
gboolean
|
||||
meta_wayland_seat_get_grab_info (MetaWaylandSeat *seat,
|
||||
MetaWaylandSurface *surface,
|
||||
uint32_t serial,
|
||||
gboolean require_pressed,
|
||||
gfloat *x,
|
||||
gfloat *y)
|
||||
MetaWaylandSurface *surface,
|
||||
uint32_t serial,
|
||||
gfloat *x,
|
||||
gfloat *y)
|
||||
{
|
||||
ClutterEventSequence *sequence = NULL;
|
||||
gboolean can_grab_surface = FALSE;
|
||||
@ -396,8 +391,7 @@ meta_wayland_seat_get_grab_info (MetaWaylandSeat *seat,
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((seat->capabilities & WL_SEAT_CAPABILITY_POINTER) != 0 &&
|
||||
(!require_pressed || seat->pointer.button_count > 0))
|
||||
if ((seat->capabilities & WL_SEAT_CAPABILITY_POINTER) != 0)
|
||||
can_grab_surface = meta_wayland_pointer_can_grab_surface (&seat->pointer, surface, serial);
|
||||
|
||||
if (can_grab_surface)
|
||||
|
@ -60,11 +60,10 @@ void meta_wayland_seat_set_input_focus (MetaWaylandSeat *seat,
|
||||
void meta_wayland_seat_repick (MetaWaylandSeat *seat);
|
||||
|
||||
gboolean meta_wayland_seat_get_grab_info (MetaWaylandSeat *seat,
|
||||
MetaWaylandSurface *surface,
|
||||
uint32_t serial,
|
||||
gboolean require_pressed,
|
||||
gfloat *x,
|
||||
gfloat *y);
|
||||
MetaWaylandSurface *surface,
|
||||
uint32_t serial,
|
||||
gfloat *x,
|
||||
gfloat *y);
|
||||
gboolean meta_wayland_seat_can_popup (MetaWaylandSeat *seat,
|
||||
uint32_t serial);
|
||||
|
||||
|
@ -1,281 +0,0 @@
|
||||
/*
|
||||
* Wayland Support
|
||||
*
|
||||
* Copyright (C) 2015 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.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <cogl/cogl.h>
|
||||
#include <cogl/cogl-wayland-server.h>
|
||||
#include "meta-wayland-surface-role-cursor.h"
|
||||
#include "meta-wayland-buffer.h"
|
||||
#include "meta-xwayland.h"
|
||||
#include "screen-private.h"
|
||||
|
||||
struct _MetaWaylandSurfaceRoleCursor
|
||||
{
|
||||
MetaWaylandSurfaceRole parent;
|
||||
|
||||
int hot_x;
|
||||
int hot_y;
|
||||
MetaCursorSprite *cursor_sprite;
|
||||
MetaCursorRenderer *cursor_renderer;
|
||||
MetaWaylandBuffer *buffer;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (MetaWaylandSurfaceRoleCursor,
|
||||
meta_wayland_surface_role_cursor,
|
||||
META_TYPE_WAYLAND_SURFACE_ROLE)
|
||||
|
||||
static void
|
||||
update_cursor_sprite_texture (MetaWaylandSurfaceRoleCursor *cursor_role)
|
||||
{
|
||||
MetaWaylandSurface *surface = meta_wayland_surface_role_get_surface (META_WAYLAND_SURFACE_ROLE (cursor_role));
|
||||
MetaWaylandBuffer *buffer = meta_wayland_surface_get_buffer (surface);
|
||||
MetaCursorSprite *cursor_sprite = cursor_role->cursor_sprite;
|
||||
|
||||
g_return_if_fail (!buffer || buffer->texture);
|
||||
|
||||
if (!cursor_role->cursor_renderer || !cursor_sprite)
|
||||
return;
|
||||
|
||||
if (buffer)
|
||||
{
|
||||
meta_cursor_sprite_set_texture (cursor_sprite,
|
||||
buffer->texture,
|
||||
cursor_role->hot_x * surface->scale,
|
||||
cursor_role->hot_y * surface->scale);
|
||||
|
||||
if (cursor_role->buffer)
|
||||
{
|
||||
struct wl_resource *buffer_resource;
|
||||
|
||||
g_assert (cursor_role->buffer == buffer);
|
||||
buffer_resource = buffer->resource;
|
||||
meta_cursor_renderer_realize_cursor_from_wl_buffer (cursor_role->cursor_renderer,
|
||||
cursor_sprite,
|
||||
buffer_resource);
|
||||
|
||||
meta_wayland_surface_unref_buffer_use_count (surface);
|
||||
g_clear_object (&cursor_role->buffer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
meta_cursor_sprite_set_texture (cursor_sprite, NULL, 0, 0);
|
||||
}
|
||||
|
||||
meta_cursor_renderer_force_update (cursor_role->cursor_renderer);
|
||||
}
|
||||
|
||||
static void
|
||||
cursor_sprite_prepare_at (MetaCursorSprite *cursor_sprite,
|
||||
int x,
|
||||
int y,
|
||||
MetaWaylandSurfaceRoleCursor *cursor_role)
|
||||
{
|
||||
MetaWaylandSurfaceRole *role = META_WAYLAND_SURFACE_ROLE (cursor_role);
|
||||
MetaWaylandSurface *surface = meta_wayland_surface_role_get_surface (role);
|
||||
MetaDisplay *display = meta_get_display ();
|
||||
MetaScreen *screen = display->screen;
|
||||
const MetaMonitorInfo *monitor;
|
||||
|
||||
if (!meta_xwayland_is_xwayland_surface (surface))
|
||||
{
|
||||
monitor = meta_screen_get_monitor_for_point (screen, x, y);
|
||||
if (monitor)
|
||||
meta_cursor_sprite_set_texture_scale (cursor_sprite,
|
||||
(float) monitor->scale / surface->scale);
|
||||
}
|
||||
meta_wayland_surface_update_outputs (surface);
|
||||
}
|
||||
|
||||
static void
|
||||
cursor_surface_role_assigned (MetaWaylandSurfaceRole *surface_role)
|
||||
{
|
||||
MetaWaylandSurfaceRoleCursor *cursor_role =
|
||||
META_WAYLAND_SURFACE_ROLE_CURSOR (surface_role);
|
||||
MetaWaylandSurface *surface =
|
||||
meta_wayland_surface_role_get_surface (surface_role);
|
||||
MetaWaylandBuffer *buffer = meta_wayland_surface_get_buffer (surface);
|
||||
|
||||
if (buffer)
|
||||
{
|
||||
g_set_object (&cursor_role->buffer, buffer);
|
||||
meta_wayland_surface_ref_buffer_use_count (surface);
|
||||
}
|
||||
|
||||
meta_wayland_surface_queue_pending_frame_callbacks (surface);
|
||||
}
|
||||
|
||||
static void
|
||||
cursor_surface_role_pre_commit (MetaWaylandSurfaceRole *surface_role,
|
||||
MetaWaylandPendingState *pending)
|
||||
{
|
||||
MetaWaylandSurfaceRoleCursor *cursor_role =
|
||||
META_WAYLAND_SURFACE_ROLE_CURSOR (surface_role);
|
||||
MetaWaylandSurface *surface =
|
||||
meta_wayland_surface_role_get_surface (surface_role);
|
||||
|
||||
if (pending->newly_attached && cursor_role->buffer)
|
||||
{
|
||||
meta_wayland_surface_unref_buffer_use_count (surface);
|
||||
g_clear_object (&cursor_role->buffer);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
cursor_surface_role_commit (MetaWaylandSurfaceRole *surface_role,
|
||||
MetaWaylandPendingState *pending)
|
||||
{
|
||||
MetaWaylandSurfaceRoleCursor *cursor_role =
|
||||
META_WAYLAND_SURFACE_ROLE_CURSOR (surface_role);
|
||||
MetaWaylandSurface *surface =
|
||||
meta_wayland_surface_role_get_surface (surface_role);
|
||||
MetaWaylandBuffer *buffer = meta_wayland_surface_get_buffer (surface);
|
||||
|
||||
if (pending->newly_attached)
|
||||
{
|
||||
g_set_object (&cursor_role->buffer, buffer);
|
||||
if (cursor_role->buffer)
|
||||
meta_wayland_surface_ref_buffer_use_count (surface);
|
||||
}
|
||||
|
||||
meta_wayland_surface_queue_pending_state_frame_callbacks (surface, pending);
|
||||
|
||||
if (pending->newly_attached)
|
||||
update_cursor_sprite_texture (META_WAYLAND_SURFACE_ROLE_CURSOR (surface_role));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
cursor_surface_role_is_on_output (MetaWaylandSurfaceRole *role,
|
||||
MetaMonitorInfo *monitor)
|
||||
{
|
||||
MetaWaylandSurface *surface =
|
||||
meta_wayland_surface_role_get_surface (role);
|
||||
MetaWaylandSurfaceRoleCursor *cursor_role =
|
||||
META_WAYLAND_SURFACE_ROLE_CURSOR (surface->role);
|
||||
MetaRectangle rect;
|
||||
|
||||
rect = meta_cursor_renderer_calculate_rect (cursor_role->cursor_renderer,
|
||||
cursor_role->cursor_sprite);
|
||||
return meta_rectangle_overlap (&rect, &monitor->rect);
|
||||
}
|
||||
|
||||
static void
|
||||
cursor_surface_role_dispose (GObject *object)
|
||||
{
|
||||
MetaWaylandSurfaceRoleCursor *cursor_role =
|
||||
META_WAYLAND_SURFACE_ROLE_CURSOR (object);
|
||||
MetaWaylandSurface *surface =
|
||||
meta_wayland_surface_role_get_surface (META_WAYLAND_SURFACE_ROLE (object));
|
||||
|
||||
g_signal_handlers_disconnect_by_func (cursor_role->cursor_sprite,
|
||||
cursor_sprite_prepare_at, cursor_role);
|
||||
|
||||
g_clear_object (&cursor_role->cursor_renderer);
|
||||
g_clear_object (&cursor_role->cursor_sprite);
|
||||
|
||||
if (cursor_role->buffer)
|
||||
{
|
||||
meta_wayland_surface_unref_buffer_use_count (surface);
|
||||
g_clear_object (&cursor_role->buffer);
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (meta_wayland_surface_role_cursor_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_surface_role_cursor_init (MetaWaylandSurfaceRoleCursor *role)
|
||||
{
|
||||
role->cursor_sprite = meta_cursor_sprite_new ();
|
||||
g_signal_connect_object (role->cursor_sprite,
|
||||
"prepare-at",
|
||||
G_CALLBACK (cursor_sprite_prepare_at),
|
||||
role,
|
||||
0);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_surface_role_cursor_class_init (MetaWaylandSurfaceRoleCursorClass *klass)
|
||||
{
|
||||
MetaWaylandSurfaceRoleClass *surface_role_class =
|
||||
META_WAYLAND_SURFACE_ROLE_CLASS (klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
surface_role_class->assigned = cursor_surface_role_assigned;
|
||||
surface_role_class->pre_commit = cursor_surface_role_pre_commit;
|
||||
surface_role_class->commit = cursor_surface_role_commit;
|
||||
surface_role_class->is_on_output = cursor_surface_role_is_on_output;
|
||||
|
||||
object_class->dispose = cursor_surface_role_dispose;
|
||||
}
|
||||
|
||||
MetaCursorSprite *
|
||||
meta_wayland_surface_role_cursor_get_sprite (MetaWaylandSurfaceRoleCursor *cursor_role)
|
||||
{
|
||||
return cursor_role->cursor_sprite;
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_surface_role_cursor_set_hotspot (MetaWaylandSurfaceRoleCursor *cursor_role,
|
||||
gint hotspot_x,
|
||||
gint hotspot_y)
|
||||
{
|
||||
if (cursor_role->hot_x == hotspot_x &&
|
||||
cursor_role->hot_y == hotspot_y)
|
||||
return;
|
||||
|
||||
cursor_role->hot_x = hotspot_x;
|
||||
cursor_role->hot_y = hotspot_y;
|
||||
update_cursor_sprite_texture (cursor_role);
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_surface_role_cursor_get_hotspot (MetaWaylandSurfaceRoleCursor *cursor_role,
|
||||
gint *hotspot_x,
|
||||
gint *hotspot_y)
|
||||
{
|
||||
if (hotspot_x)
|
||||
*hotspot_x = cursor_role->hot_x;
|
||||
if (hotspot_y)
|
||||
*hotspot_y = cursor_role->hot_y;
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_surface_role_cursor_set_renderer (MetaWaylandSurfaceRoleCursor *cursor_role,
|
||||
MetaCursorRenderer *renderer)
|
||||
{
|
||||
if (cursor_role->cursor_renderer == renderer)
|
||||
return;
|
||||
|
||||
if (renderer)
|
||||
g_object_ref (renderer);
|
||||
if (cursor_role->cursor_renderer)
|
||||
g_object_unref (cursor_role->cursor_renderer);
|
||||
|
||||
cursor_role->cursor_renderer = renderer;
|
||||
update_cursor_sprite_texture (cursor_role);
|
||||
}
|
||||
|
||||
MetaCursorRenderer *
|
||||
meta_wayland_surface_role_cursor_get_renderer (MetaWaylandSurfaceRoleCursor *cursor_role)
|
||||
{
|
||||
return cursor_role->cursor_renderer;
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Wayland Support
|
||||
*
|
||||
* Copyright (C) 2015 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.
|
||||
*/
|
||||
|
||||
#ifndef META_WAYLAND_SURFACE_ROLE_CURSOR_H
|
||||
#define META_WAYLAND_SURFACE_ROLE_CURSOR_H
|
||||
|
||||
#include "meta-wayland-surface.h"
|
||||
#include "backends/meta-cursor-renderer.h"
|
||||
|
||||
#define META_TYPE_WAYLAND_SURFACE_ROLE_CURSOR (meta_wayland_surface_role_cursor_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (MetaWaylandSurfaceRoleCursor,
|
||||
meta_wayland_surface_role_cursor,
|
||||
META, WAYLAND_SURFACE_ROLE_CURSOR,
|
||||
MetaWaylandSurfaceRole);
|
||||
|
||||
MetaCursorSprite * meta_wayland_surface_role_cursor_get_sprite (MetaWaylandSurfaceRoleCursor *cursor_role);
|
||||
|
||||
void meta_wayland_surface_role_cursor_set_hotspot (MetaWaylandSurfaceRoleCursor *cursor_role,
|
||||
gint hotspot_x,
|
||||
gint hotspot_y);
|
||||
void meta_wayland_surface_role_cursor_get_hotspot (MetaWaylandSurfaceRoleCursor *cursor_role,
|
||||
gint *hotspot_x,
|
||||
gint *hotspot_y);
|
||||
void meta_wayland_surface_role_cursor_set_renderer (MetaWaylandSurfaceRoleCursor *cursor_role,
|
||||
MetaCursorRenderer *renderer);
|
||||
MetaCursorRenderer * meta_wayland_surface_role_cursor_get_renderer (MetaWaylandSurfaceRoleCursor *cursor_role);
|
||||
|
||||
|
||||
#endif /* META_WAYLAND_SURFACE_ROLE_CURSOR_H */
|
@ -137,13 +137,6 @@ G_DEFINE_TYPE (MetaWaylandSurfaceRoleDND,
|
||||
meta_wayland_surface_role_dnd,
|
||||
META_TYPE_WAYLAND_SURFACE_ROLE);
|
||||
|
||||
enum {
|
||||
SURFACE_DESTROY,
|
||||
N_SURFACE_SIGNALS
|
||||
};
|
||||
|
||||
guint surface_signals[N_SURFACE_SIGNALS] = { 0 };
|
||||
|
||||
static void
|
||||
meta_wayland_surface_role_assigned (MetaWaylandSurfaceRole *surface_role);
|
||||
|
||||
@ -1369,7 +1362,7 @@ xdg_surface_show_window_menu (struct wl_client *client,
|
||||
MetaWaylandSeat *seat = wl_resource_get_user_data (seat_resource);
|
||||
MetaWaylandSurface *surface = wl_resource_get_user_data (resource);
|
||||
|
||||
if (!meta_wayland_seat_get_grab_info (seat, surface, serial, FALSE, NULL, NULL))
|
||||
if (!meta_wayland_seat_get_grab_info (seat, surface, serial, NULL, NULL))
|
||||
return;
|
||||
|
||||
meta_window_show_menu (surface->window, META_WINDOW_MENU_WM,
|
||||
@ -1414,7 +1407,7 @@ xdg_surface_move (struct wl_client *client,
|
||||
MetaWaylandSurface *surface = wl_resource_get_user_data (resource);
|
||||
gfloat x, y;
|
||||
|
||||
if (!meta_wayland_seat_get_grab_info (seat, surface, serial, TRUE, &x, &y))
|
||||
if (!meta_wayland_seat_get_grab_info (seat, surface, serial, &x, &y))
|
||||
return;
|
||||
|
||||
begin_grab_op_on_surface (surface, seat, META_GRAB_OP_MOVING, x, y);
|
||||
@ -1454,7 +1447,7 @@ xdg_surface_resize (struct wl_client *client,
|
||||
MetaWaylandSurface *surface = wl_resource_get_user_data (resource);
|
||||
gfloat x, y;
|
||||
|
||||
if (!meta_wayland_seat_get_grab_info (seat, surface, serial, TRUE, &x, &y))
|
||||
if (!meta_wayland_seat_get_grab_info (seat, surface, serial, &x, &y))
|
||||
return;
|
||||
|
||||
begin_grab_op_on_surface (surface, seat, grab_op_for_xdg_surface_resize_edge (edges), x, y);
|
||||
@ -1797,7 +1790,7 @@ wl_shell_surface_move (struct wl_client *client,
|
||||
MetaWaylandSurface *surface = wl_resource_get_user_data (resource);
|
||||
gfloat x, y;
|
||||
|
||||
if (!meta_wayland_seat_get_grab_info (seat, surface, serial, TRUE, &x, &y))
|
||||
if (!meta_wayland_seat_get_grab_info (seat, surface, serial, &x, &y))
|
||||
return;
|
||||
|
||||
begin_grab_op_on_surface (surface, seat, META_GRAB_OP_MOVING, x, y);
|
||||
@ -1837,7 +1830,7 @@ wl_shell_surface_resize (struct wl_client *client,
|
||||
MetaWaylandSurface *surface = wl_resource_get_user_data (resource);
|
||||
gfloat x, y;
|
||||
|
||||
if (!meta_wayland_seat_get_grab_info (seat, surface, serial, TRUE, &x, &y))
|
||||
if (!meta_wayland_seat_get_grab_info (seat, surface, serial, &x, &y))
|
||||
return;
|
||||
|
||||
begin_grab_op_on_surface (surface, seat, grab_op_for_wl_shell_surface_resize_edge (edges), x, y);
|
||||
@ -2677,20 +2670,6 @@ meta_wayland_surface_get_absolute_coordinates (MetaWaylandSurface *surface,
|
||||
*y = v.y;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_surface_dispose (GObject *object)
|
||||
{
|
||||
MetaWaylandSurface *surface = META_WAYLAND_SURFACE (object);
|
||||
|
||||
if (!surface->destroying)
|
||||
{
|
||||
g_signal_emit (object, surface_signals[SURFACE_DESTROY], 0);
|
||||
surface->destroying = TRUE;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (meta_wayland_surface_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_surface_init (MetaWaylandSurface *surface)
|
||||
{
|
||||
@ -2700,17 +2679,6 @@ meta_wayland_surface_init (MetaWaylandSurface *surface)
|
||||
static void
|
||||
meta_wayland_surface_class_init (MetaWaylandSurfaceClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->dispose = meta_wayland_surface_dispose;
|
||||
|
||||
surface_signals[SURFACE_DESTROY] =
|
||||
g_signal_new ("destroy",
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -198,7 +198,6 @@ struct _MetaWaylandSurface
|
||||
MetaWaylandSerial acked_configure_serial;
|
||||
gboolean has_set_geometry;
|
||||
gboolean is_modal;
|
||||
gboolean destroying;
|
||||
|
||||
/* xdg_popup */
|
||||
struct {
|
||||
|
@ -1,267 +0,0 @@
|
||||
/*
|
||||
* Wayland Support
|
||||
*
|
||||
* Copyright (C) 2015 Red Hat
|
||||
*
|
||||
* 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: Carlos Garnacho <carlosg@gnome.org>
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include <wayland-server.h>
|
||||
#include "tablet-unstable-v1-server-protocol.h"
|
||||
|
||||
#include "meta-wayland-private.h"
|
||||
#include "meta-wayland-tablet-manager.h"
|
||||
#include "meta-wayland-tablet-seat.h"
|
||||
#include "meta-wayland-tablet-tool.h"
|
||||
|
||||
static void
|
||||
unbind_resource (struct wl_resource *resource)
|
||||
{
|
||||
wl_list_remove (wl_resource_get_link (resource));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_tablet_device (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterInputDeviceType device_type;
|
||||
|
||||
if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_MASTER)
|
||||
return FALSE;
|
||||
|
||||
device_type = clutter_input_device_get_device_type (device);
|
||||
|
||||
return (device_type == CLUTTER_TABLET_DEVICE ||
|
||||
device_type == CLUTTER_PEN_DEVICE ||
|
||||
device_type == CLUTTER_ERASER_DEVICE ||
|
||||
device_type == CLUTTER_CURSOR_DEVICE);
|
||||
}
|
||||
|
||||
static void
|
||||
tablet_manager_get_tablet_seat (struct wl_client *client,
|
||||
struct wl_resource *resource,
|
||||
guint32 id,
|
||||
struct wl_resource *seat_resource)
|
||||
{
|
||||
MetaWaylandTabletManager *tablet_manager = wl_resource_get_user_data (resource);
|
||||
MetaWaylandSeat *seat = wl_resource_get_user_data (seat_resource);
|
||||
MetaWaylandTabletSeat *tablet_seat;
|
||||
|
||||
tablet_seat = meta_wayland_tablet_manager_ensure_seat (tablet_manager, seat);
|
||||
meta_wayland_tablet_seat_create_new_resource (tablet_seat, client,
|
||||
resource, id);
|
||||
}
|
||||
|
||||
static void
|
||||
tablet_manager_destroy (struct wl_client *client,
|
||||
struct wl_resource *resource)
|
||||
{
|
||||
wl_resource_destroy (resource);
|
||||
}
|
||||
|
||||
static const struct zwp_tablet_manager_v1_interface tablet_manager_interface = {
|
||||
tablet_manager_get_tablet_seat,
|
||||
tablet_manager_destroy
|
||||
};
|
||||
|
||||
static void
|
||||
bind_tablet_manager (struct wl_client *client,
|
||||
void *data,
|
||||
uint32_t version,
|
||||
uint32_t id)
|
||||
{
|
||||
MetaWaylandCompositor *compositor = data;
|
||||
MetaWaylandTabletManager *tablet_manager = compositor->tablet_manager;
|
||||
struct wl_resource *resource;
|
||||
|
||||
resource = wl_resource_create (client, &zwp_tablet_manager_v1_interface,
|
||||
MIN (version, 1), id);
|
||||
wl_resource_set_implementation (resource, &tablet_manager_interface,
|
||||
tablet_manager, unbind_resource);
|
||||
wl_resource_set_user_data (resource, tablet_manager);
|
||||
wl_list_insert (&tablet_manager->resource_list,
|
||||
wl_resource_get_link (resource));
|
||||
}
|
||||
|
||||
static MetaWaylandTabletManager *
|
||||
meta_wayland_tablet_manager_new (MetaWaylandCompositor *compositor)
|
||||
{
|
||||
MetaWaylandTabletManager *tablet_manager;
|
||||
|
||||
tablet_manager = g_slice_new0 (MetaWaylandTabletManager);
|
||||
tablet_manager->compositor = compositor;
|
||||
tablet_manager->wl_display = compositor->wayland_display;
|
||||
tablet_manager->seats = g_hash_table_new_full (NULL, NULL, NULL,
|
||||
(GDestroyNotify) meta_wayland_tablet_seat_free);
|
||||
wl_list_init (&tablet_manager->resource_list);
|
||||
|
||||
wl_global_create (tablet_manager->wl_display,
|
||||
&zwp_tablet_manager_v1_interface, 1,
|
||||
compositor, bind_tablet_manager);
|
||||
|
||||
return tablet_manager;
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_tablet_manager_init (MetaWaylandCompositor *compositor)
|
||||
{
|
||||
compositor->tablet_manager = meta_wayland_tablet_manager_new (compositor);
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_tablet_manager_free (MetaWaylandTabletManager *tablet_manager)
|
||||
{
|
||||
ClutterDeviceManager *device_manager;
|
||||
|
||||
device_manager = clutter_device_manager_get_default ();
|
||||
g_signal_handlers_disconnect_by_data (device_manager, tablet_manager);
|
||||
|
||||
g_hash_table_destroy (tablet_manager->seats);
|
||||
g_slice_free (MetaWaylandTabletManager, tablet_manager);
|
||||
}
|
||||
|
||||
static MetaWaylandTabletSeat *
|
||||
meta_wayland_tablet_manager_lookup_seat (MetaWaylandTabletManager *manager,
|
||||
ClutterInputDevice *device)
|
||||
{
|
||||
MetaWaylandTabletSeat *tablet_seat;
|
||||
MetaWaylandSeat *seat;
|
||||
GHashTableIter iter;
|
||||
|
||||
if (!is_tablet_device (device))
|
||||
return NULL;
|
||||
|
||||
g_hash_table_iter_init (&iter, manager->seats);
|
||||
|
||||
while (g_hash_table_iter_next (&iter, (gpointer*) &seat, (gpointer*) &tablet_seat))
|
||||
{
|
||||
if (meta_wayland_tablet_seat_lookup_tablet (tablet_seat, device))
|
||||
return tablet_seat;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_wayland_tablet_manager_consumes_event (MetaWaylandTabletManager *manager,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
ClutterInputDevice *device = clutter_event_get_source_device (event);
|
||||
|
||||
return meta_wayland_tablet_manager_lookup_seat (manager, device) != NULL;
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_tablet_manager_update (MetaWaylandTabletManager *manager,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
ClutterInputDevice *device = clutter_event_get_source_device (event);
|
||||
MetaWaylandTabletSeat *tablet_seat;
|
||||
|
||||
tablet_seat = meta_wayland_tablet_manager_lookup_seat (manager, device);
|
||||
|
||||
if (!tablet_seat)
|
||||
return;
|
||||
|
||||
switch (event->type)
|
||||
{
|
||||
case CLUTTER_PROXIMITY_IN:
|
||||
case CLUTTER_PROXIMITY_OUT:
|
||||
case CLUTTER_BUTTON_PRESS:
|
||||
case CLUTTER_BUTTON_RELEASE:
|
||||
case CLUTTER_MOTION:
|
||||
meta_wayland_tablet_seat_update (tablet_seat, event);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_wayland_tablet_manager_handle_event (MetaWaylandTabletManager *manager,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
ClutterInputDevice *device = clutter_event_get_source_device (event);
|
||||
MetaWaylandTabletSeat *tablet_seat;
|
||||
|
||||
tablet_seat = meta_wayland_tablet_manager_lookup_seat (manager, device);
|
||||
|
||||
if (!tablet_seat)
|
||||
return CLUTTER_EVENT_PROPAGATE;
|
||||
|
||||
switch (event->type)
|
||||
{
|
||||
case CLUTTER_PROXIMITY_IN:
|
||||
case CLUTTER_PROXIMITY_OUT:
|
||||
case CLUTTER_BUTTON_PRESS:
|
||||
case CLUTTER_BUTTON_RELEASE:
|
||||
case CLUTTER_MOTION:
|
||||
return meta_wayland_tablet_seat_handle_event (tablet_seat, event);
|
||||
default:
|
||||
return CLUTTER_EVENT_PROPAGATE;
|
||||
}
|
||||
}
|
||||
|
||||
MetaWaylandTabletSeat *
|
||||
meta_wayland_tablet_manager_ensure_seat (MetaWaylandTabletManager *manager,
|
||||
MetaWaylandSeat *seat)
|
||||
{
|
||||
MetaWaylandTabletSeat *tablet_seat;
|
||||
|
||||
tablet_seat = g_hash_table_lookup (manager->seats, seat);
|
||||
|
||||
if (!tablet_seat)
|
||||
{
|
||||
tablet_seat = meta_wayland_tablet_seat_new (manager);
|
||||
g_hash_table_insert (manager->seats, seat, tablet_seat);
|
||||
}
|
||||
|
||||
return tablet_seat;
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_tablet_manager_update_cursor_position (MetaWaylandTabletManager *manager,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
MetaWaylandTabletSeat *tablet_seat = NULL;
|
||||
MetaWaylandTabletTool *tool = NULL;
|
||||
ClutterInputDeviceTool *device_tool;
|
||||
ClutterInputDevice *device;
|
||||
|
||||
device = clutter_event_get_source_device (event);
|
||||
device_tool = clutter_event_get_device_tool (event);
|
||||
|
||||
if (device)
|
||||
tablet_seat = meta_wayland_tablet_manager_lookup_seat (manager, device);
|
||||
|
||||
if (tablet_seat && device_tool)
|
||||
tool = meta_wayland_tablet_seat_lookup_tool (tablet_seat, device_tool);
|
||||
|
||||
if (tool)
|
||||
{
|
||||
gfloat new_x, new_y;
|
||||
|
||||
clutter_event_get_coords (event, &new_x, &new_y);
|
||||
meta_wayland_tablet_tool_set_cursor_position (tool, new_x, new_y);
|
||||
}
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
/*
|
||||
* Wayland Support
|
||||
*
|
||||
* Copyright (C) 2015 Red Hat
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Carlos Garnacho <carlosg@gnome.org>
|
||||
*/
|
||||
|
||||
#ifndef META_WAYLAND_TABLET_MANAGER_H
|
||||
#define META_WAYLAND_TABLET_MANAGER_H
|
||||
|
||||
#include <wayland-server.h>
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include "meta-wayland-types.h"
|
||||
|
||||
struct _MetaWaylandTabletManager
|
||||
{
|
||||
MetaWaylandCompositor *compositor;
|
||||
struct wl_display *wl_display;
|
||||
struct wl_list resource_list;
|
||||
|
||||
GHashTable *seats;
|
||||
};
|
||||
|
||||
void meta_wayland_tablet_manager_init (MetaWaylandCompositor *compositor);
|
||||
void meta_wayland_tablet_manager_free (MetaWaylandTabletManager *tablet_manager);
|
||||
|
||||
gboolean meta_wayland_tablet_manager_consumes_event (MetaWaylandTabletManager *manager,
|
||||
const ClutterEvent *event);
|
||||
void meta_wayland_tablet_manager_update (MetaWaylandTabletManager *manager,
|
||||
const ClutterEvent *event);
|
||||
gboolean meta_wayland_tablet_manager_handle_event (MetaWaylandTabletManager *manager,
|
||||
const ClutterEvent *event);
|
||||
|
||||
MetaWaylandTabletSeat *
|
||||
meta_wayland_tablet_manager_ensure_seat (MetaWaylandTabletManager *manager,
|
||||
MetaWaylandSeat *seat);
|
||||
|
||||
void meta_wayland_tablet_manager_update_cursor_position (MetaWaylandTabletManager *manager,
|
||||
const ClutterEvent *event);
|
||||
|
||||
#endif /* META_WAYLAND_TABLET_MANAGER_H */
|
@ -1,334 +0,0 @@
|
||||
/*
|
||||
* Wayland Support
|
||||
*
|
||||
* Copyright (C) 2015 Red Hat
|
||||
*
|
||||
* 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: Carlos Garnacho <carlosg@gnome.org>
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include <wayland-server.h>
|
||||
#include "tablet-unstable-v1-server-protocol.h"
|
||||
|
||||
#include "meta-wayland-private.h"
|
||||
#include "meta-wayland-tablet-seat.h"
|
||||
#include "meta-wayland-tablet.h"
|
||||
#include "meta-wayland-tablet-tool.h"
|
||||
|
||||
static void
|
||||
unbind_resource (struct wl_resource *resource)
|
||||
{
|
||||
wl_list_remove (wl_resource_get_link (resource));
|
||||
}
|
||||
|
||||
static void
|
||||
notify_tool_added (MetaWaylandTabletSeat *tablet_seat,
|
||||
struct wl_resource *client_resource,
|
||||
MetaWaylandTabletTool *tool)
|
||||
{
|
||||
struct wl_resource *tool_resource;
|
||||
struct wl_client *client;
|
||||
|
||||
client = wl_resource_get_client (client_resource);
|
||||
tool_resource = meta_wayland_tablet_tool_lookup_resource (tool, client);
|
||||
|
||||
if (!tool_resource)
|
||||
return;
|
||||
|
||||
zwp_tablet_seat_v1_send_tool_added (client_resource, tool_resource);
|
||||
}
|
||||
|
||||
static void
|
||||
notify_tablet_added (MetaWaylandTabletSeat *tablet_seat,
|
||||
struct wl_resource *client_resource,
|
||||
ClutterInputDevice *device)
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
MetaWaylandTablet *tablet;
|
||||
struct wl_client *client;
|
||||
|
||||
tablet = g_hash_table_lookup (tablet_seat->tablets, device);
|
||||
|
||||
if (!tablet)
|
||||
return;
|
||||
|
||||
client = wl_resource_get_client (client_resource);
|
||||
|
||||
if (meta_wayland_tablet_lookup_resource (tablet, client))
|
||||
return;
|
||||
|
||||
resource = meta_wayland_tablet_create_new_resource (tablet, client,
|
||||
client_resource, 0);
|
||||
if (!resource)
|
||||
return;
|
||||
|
||||
zwp_tablet_seat_v1_send_tablet_added (client_resource, resource);
|
||||
meta_wayland_tablet_notify (tablet, resource);
|
||||
}
|
||||
|
||||
static void
|
||||
broadcast_tablet_added (MetaWaylandTabletSeat *tablet_seat,
|
||||
ClutterInputDevice *device)
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
|
||||
wl_resource_for_each (resource, &tablet_seat->resource_list)
|
||||
{
|
||||
notify_tablet_added (tablet_seat, resource, device);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
notify_tablets (MetaWaylandTabletSeat *tablet_seat,
|
||||
struct wl_resource *client_resource)
|
||||
{
|
||||
ClutterInputDevice *device;
|
||||
GHashTableIter iter;
|
||||
|
||||
g_hash_table_iter_init (&iter, tablet_seat->tablets);
|
||||
|
||||
while (g_hash_table_iter_next (&iter, (gpointer *) &device, NULL))
|
||||
notify_tablet_added (tablet_seat, client_resource, device);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_tablet_device (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterInputDeviceType device_type;
|
||||
|
||||
if (clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_MASTER)
|
||||
return FALSE;
|
||||
|
||||
device_type = clutter_input_device_get_device_type (device);
|
||||
|
||||
return (device_type == CLUTTER_TABLET_DEVICE ||
|
||||
device_type == CLUTTER_PEN_DEVICE ||
|
||||
device_type == CLUTTER_ERASER_DEVICE ||
|
||||
device_type == CLUTTER_CURSOR_DEVICE);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_tablet_seat_device_added (MetaWaylandTabletSeat *tablet_seat,
|
||||
ClutterInputDevice *device)
|
||||
{
|
||||
MetaWaylandTablet *tablet;
|
||||
|
||||
if (!is_tablet_device (device))
|
||||
return;
|
||||
|
||||
tablet = meta_wayland_tablet_new (device, tablet_seat);
|
||||
g_hash_table_insert (tablet_seat->tablets, device, tablet);
|
||||
broadcast_tablet_added (tablet_seat, device);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_tablet_seat_device_removed (MetaWaylandTabletSeat *tablet_seat,
|
||||
ClutterInputDevice *device)
|
||||
{
|
||||
g_hash_table_remove (tablet_seat->tablets, device);
|
||||
}
|
||||
|
||||
static void
|
||||
tablet_seat_destroy (struct wl_client *client,
|
||||
struct wl_resource *resource)
|
||||
{
|
||||
wl_resource_destroy (resource);
|
||||
}
|
||||
|
||||
static const struct zwp_tablet_seat_v1_interface tablet_seat_interface = {
|
||||
tablet_seat_destroy
|
||||
};
|
||||
|
||||
MetaWaylandTabletSeat *
|
||||
meta_wayland_tablet_seat_new (MetaWaylandTabletManager *manager)
|
||||
{
|
||||
MetaWaylandTabletSeat *tablet_seat;
|
||||
const GSList *devices, *l;
|
||||
|
||||
tablet_seat = g_slice_new0 (MetaWaylandTabletSeat);
|
||||
tablet_seat->manager = manager;
|
||||
tablet_seat->device_manager = clutter_device_manager_get_default ();
|
||||
tablet_seat->tablets = g_hash_table_new_full (NULL, NULL, NULL,
|
||||
(GDestroyNotify) meta_wayland_tablet_free);
|
||||
tablet_seat->tools = g_hash_table_new_full (NULL, NULL, NULL,
|
||||
(GDestroyNotify) meta_wayland_tablet_tool_free);
|
||||
wl_list_init (&tablet_seat->resource_list);
|
||||
|
||||
g_signal_connect_swapped (tablet_seat->device_manager, "device-added",
|
||||
G_CALLBACK (meta_wayland_tablet_seat_device_added),
|
||||
tablet_seat);
|
||||
g_signal_connect_swapped (tablet_seat->device_manager, "device-removed",
|
||||
G_CALLBACK (meta_wayland_tablet_seat_device_removed),
|
||||
tablet_seat);
|
||||
|
||||
devices = clutter_device_manager_peek_devices (tablet_seat->device_manager);
|
||||
|
||||
for (l = devices; l; l = l->next)
|
||||
meta_wayland_tablet_seat_device_added (tablet_seat, l->data);
|
||||
|
||||
return tablet_seat;
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_tablet_seat_free (MetaWaylandTabletSeat *tablet_seat)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_data (tablet_seat->device_manager,
|
||||
tablet_seat);
|
||||
g_hash_table_destroy (tablet_seat->tablets);
|
||||
g_hash_table_destroy (tablet_seat->tools);
|
||||
g_slice_free (MetaWaylandTabletSeat, tablet_seat);
|
||||
}
|
||||
|
||||
struct wl_resource *
|
||||
meta_wayland_tablet_seat_create_new_resource (MetaWaylandTabletSeat *tablet_seat,
|
||||
struct wl_client *client,
|
||||
struct wl_resource *manager_resource,
|
||||
uint32_t id)
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
|
||||
resource = wl_resource_create (client, &zwp_tablet_seat_v1_interface,
|
||||
wl_resource_get_version (manager_resource),
|
||||
id);
|
||||
wl_resource_set_implementation (resource, &tablet_seat_interface,
|
||||
tablet_seat, unbind_resource);
|
||||
wl_resource_set_user_data (resource, tablet_seat);
|
||||
wl_list_insert (&tablet_seat->resource_list, wl_resource_get_link (resource));
|
||||
|
||||
/* Notify client of all available tablets */
|
||||
notify_tablets (tablet_seat, resource);
|
||||
|
||||
return resource;
|
||||
}
|
||||
|
||||
struct wl_resource *
|
||||
meta_wayland_tablet_seat_lookup_resource (MetaWaylandTabletSeat *tablet_seat,
|
||||
struct wl_client *client)
|
||||
{
|
||||
return wl_resource_find_for_client (&tablet_seat->resource_list, client);
|
||||
}
|
||||
|
||||
MetaWaylandTablet *
|
||||
meta_wayland_tablet_seat_lookup_tablet (MetaWaylandTabletSeat *tablet_seat,
|
||||
ClutterInputDevice *device)
|
||||
{
|
||||
return g_hash_table_lookup (tablet_seat->tablets, device);
|
||||
}
|
||||
|
||||
MetaWaylandTabletTool *
|
||||
meta_wayland_tablet_seat_lookup_tool (MetaWaylandTabletSeat *tablet_seat,
|
||||
ClutterInputDeviceTool *tool)
|
||||
{
|
||||
return g_hash_table_lookup (tablet_seat->tools, tool);
|
||||
}
|
||||
|
||||
static MetaWaylandTabletTool *
|
||||
meta_wayland_tablet_seat_ensure_tool (MetaWaylandTabletSeat *tablet_seat,
|
||||
ClutterInputDevice *device,
|
||||
ClutterInputDeviceTool *device_tool)
|
||||
{
|
||||
MetaWaylandTabletTool *tool;
|
||||
|
||||
tool = g_hash_table_lookup (tablet_seat->tools, device_tool);
|
||||
|
||||
if (!tool)
|
||||
{
|
||||
tool = meta_wayland_tablet_tool_new (tablet_seat, device, device_tool);
|
||||
g_hash_table_insert (tablet_seat->tools, device_tool, tool);
|
||||
}
|
||||
|
||||
return tool;
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_tablet_seat_update (MetaWaylandTabletSeat *tablet_seat,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
ClutterInputDevice *device;
|
||||
ClutterInputDeviceTool *device_tool;
|
||||
MetaWaylandTabletTool *tool = NULL;
|
||||
|
||||
device = clutter_event_get_source_device (event);
|
||||
device_tool = clutter_event_get_device_tool (event);
|
||||
|
||||
if (device && device_tool)
|
||||
tool = meta_wayland_tablet_seat_ensure_tool (tablet_seat, device, device_tool);
|
||||
|
||||
if (!tool)
|
||||
return;
|
||||
|
||||
switch (event->type)
|
||||
{
|
||||
case CLUTTER_PROXIMITY_IN:
|
||||
case CLUTTER_PROXIMITY_OUT:
|
||||
case CLUTTER_BUTTON_PRESS:
|
||||
case CLUTTER_BUTTON_RELEASE:
|
||||
case CLUTTER_MOTION:
|
||||
meta_wayland_tablet_tool_update (tool, event);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_wayland_tablet_seat_handle_event (MetaWaylandTabletSeat *tablet_seat,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
ClutterInputDeviceTool *device_tool;
|
||||
MetaWaylandTabletTool *tool = NULL;
|
||||
|
||||
device_tool = clutter_event_get_device_tool (event);
|
||||
|
||||
if (device_tool)
|
||||
tool = g_hash_table_lookup (tablet_seat->tools, device_tool);
|
||||
|
||||
if (!tool)
|
||||
return CLUTTER_EVENT_PROPAGATE;
|
||||
|
||||
switch (event->type)
|
||||
{
|
||||
case CLUTTER_PROXIMITY_IN:
|
||||
case CLUTTER_PROXIMITY_OUT:
|
||||
case CLUTTER_BUTTON_PRESS:
|
||||
case CLUTTER_BUTTON_RELEASE:
|
||||
case CLUTTER_MOTION:
|
||||
meta_wayland_tablet_tool_handle_event (tool, event);
|
||||
return CLUTTER_EVENT_PROPAGATE;
|
||||
default:
|
||||
return CLUTTER_EVENT_STOP;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_tablet_seat_notify_tool (MetaWaylandTabletSeat *tablet_seat,
|
||||
MetaWaylandTabletTool *tool,
|
||||
struct wl_client *client)
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
|
||||
resource = wl_resource_find_for_client (&tablet_seat->resource_list, client);
|
||||
|
||||
if (resource)
|
||||
notify_tool_added (tablet_seat, resource, tool);
|
||||
}
|
@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Wayland Support
|
||||
*
|
||||
* Copyright (C) 2015 Red Hat
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Carlos Garnacho <carlosg@gnome.org>
|
||||
*/
|
||||
|
||||
#ifndef META_WAYLAND_TABLET_SEAT_H
|
||||
#define META_WAYLAND_TABLET_SEAT_H
|
||||
|
||||
#include <wayland-server.h>
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include "meta-wayland-types.h"
|
||||
|
||||
struct _MetaWaylandTabletSeat
|
||||
{
|
||||
MetaWaylandTabletManager *manager;
|
||||
ClutterDeviceManager *device_manager;
|
||||
struct wl_list resource_list;
|
||||
|
||||
GHashTable *tablets;
|
||||
GHashTable *tools;
|
||||
};
|
||||
|
||||
MetaWaylandTabletSeat *meta_wayland_tablet_seat_new (MetaWaylandTabletManager *tablet_manager);
|
||||
void meta_wayland_tablet_seat_free (MetaWaylandTabletSeat *tablet_seat);
|
||||
|
||||
struct wl_resource *meta_wayland_tablet_seat_create_new_resource (MetaWaylandTabletSeat *tablet_seat,
|
||||
struct wl_client *client,
|
||||
struct wl_resource *seat_resource,
|
||||
uint32_t id);
|
||||
struct wl_resource *meta_wayland_tablet_seat_lookup_resource (MetaWaylandTabletSeat *tablet_seat,
|
||||
struct wl_client *client);
|
||||
|
||||
MetaWaylandTablet *meta_wayland_tablet_seat_lookup_tablet (MetaWaylandTabletSeat *tablet_seat,
|
||||
ClutterInputDevice *device);
|
||||
|
||||
MetaWaylandTabletTool *meta_wayland_tablet_seat_lookup_tool (MetaWaylandTabletSeat *tablet_seat,
|
||||
ClutterInputDeviceTool *tool);
|
||||
|
||||
void meta_wayland_tablet_seat_update (MetaWaylandTabletSeat *tablet_seat,
|
||||
const ClutterEvent *event);
|
||||
gboolean meta_wayland_tablet_seat_handle_event (MetaWaylandTabletSeat *tablet_seat,
|
||||
const ClutterEvent *event);
|
||||
|
||||
void meta_wayland_tablet_seat_notify_tool (MetaWaylandTabletSeat *tablet_seat,
|
||||
MetaWaylandTabletTool *tool,
|
||||
struct wl_client *client);
|
||||
|
||||
#endif /* META_WAYLAND_TABLET_SEAT_H */
|
@ -1,890 +0,0 @@
|
||||
/*
|
||||
* Wayland Support
|
||||
*
|
||||
* Copyright (C) 2015 Red Hat
|
||||
*
|
||||
* 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: Carlos Garnacho <carlosg@gnome.org>
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <clutter/evdev/clutter-evdev.h>
|
||||
|
||||
#include <wayland-server.h>
|
||||
#include "tablet-unstable-v1-server-protocol.h"
|
||||
#include "meta-wayland-private.h"
|
||||
#include "meta-wayland-surface-role-cursor.h"
|
||||
#include "meta-surface-actor-wayland.h"
|
||||
#include "meta-wayland-tablet.h"
|
||||
#include "meta-wayland-tablet-seat.h"
|
||||
#include "meta-wayland-tablet-tool.h"
|
||||
|
||||
#ifdef HAVE_NATIVE_BACKEND
|
||||
#include "backends/native/meta-backend-native.h"
|
||||
#endif
|
||||
|
||||
#define TABLET_AXIS_MAX 65535
|
||||
#define DEGREES_PRECISION 100 /* wl_tablet_tool.tilt and .rotation define
|
||||
* angles in hundreths of a degree
|
||||
*/
|
||||
|
||||
static void
|
||||
unbind_resource (struct wl_resource *resource)
|
||||
{
|
||||
wl_list_remove (wl_resource_get_link (resource));
|
||||
}
|
||||
|
||||
static void
|
||||
move_resources (struct wl_list *destination,
|
||||
struct wl_list *source)
|
||||
{
|
||||
wl_list_insert_list (destination, source);
|
||||
wl_list_init (source);
|
||||
}
|
||||
|
||||
static void
|
||||
move_resources_for_client (struct wl_list *destination,
|
||||
struct wl_list *source,
|
||||
struct wl_client *client)
|
||||
{
|
||||
struct wl_resource *resource, *tmp;
|
||||
|
||||
wl_resource_for_each_safe (resource, tmp, source)
|
||||
{
|
||||
if (wl_resource_get_client (resource) == client)
|
||||
{
|
||||
wl_list_remove (wl_resource_get_link (resource));
|
||||
wl_list_insert (destination, wl_resource_get_link (resource));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_tablet_tool_update_cursor_surface (MetaWaylandTabletTool *tool)
|
||||
{
|
||||
MetaCursorSprite *cursor = NULL;
|
||||
|
||||
if (tool->cursor_renderer == NULL)
|
||||
return;
|
||||
|
||||
if (tool->current && tool->current_tablet)
|
||||
{
|
||||
if (tool->cursor_surface &&
|
||||
meta_wayland_surface_get_buffer (tool->cursor_surface))
|
||||
{
|
||||
MetaWaylandSurfaceRoleCursor *cursor_role =
|
||||
META_WAYLAND_SURFACE_ROLE_CURSOR (tool->cursor_surface->role);
|
||||
|
||||
cursor = meta_wayland_surface_role_cursor_get_sprite (cursor_role);
|
||||
}
|
||||
else
|
||||
cursor = NULL;
|
||||
}
|
||||
else if (tool->current_tablet)
|
||||
cursor = meta_cursor_sprite_from_theme (META_CURSOR_CROSSHAIR);
|
||||
else
|
||||
cursor = NULL;
|
||||
|
||||
meta_cursor_renderer_set_cursor (tool->cursor_renderer, cursor);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_tablet_tool_set_cursor_surface (MetaWaylandTabletTool *tool,
|
||||
MetaWaylandSurface *surface)
|
||||
{
|
||||
if (tool->cursor_surface == surface)
|
||||
return;
|
||||
|
||||
if (tool->cursor_surface)
|
||||
wl_list_remove (&tool->cursor_surface_destroy_listener.link);
|
||||
|
||||
tool->cursor_surface = surface;
|
||||
|
||||
if (tool->cursor_surface)
|
||||
wl_resource_add_destroy_listener (tool->cursor_surface->resource,
|
||||
&tool->cursor_surface_destroy_listener);
|
||||
|
||||
meta_wayland_tablet_tool_update_cursor_surface (tool);
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
input_device_get_capabilities (ClutterInputDevice *device)
|
||||
{
|
||||
ClutterInputAxis axis;
|
||||
guint32 capabilities = 0, i;
|
||||
|
||||
for (i = 0; i < clutter_input_device_get_n_axes (device); i++)
|
||||
{
|
||||
axis = clutter_input_device_get_axis (device, i);
|
||||
|
||||
switch (axis)
|
||||
{
|
||||
case CLUTTER_INPUT_AXIS_PRESSURE:
|
||||
capabilities |= 1 << ZWP_TABLET_TOOL_V1_CAPABILITY_PRESSURE;
|
||||
break;
|
||||
case CLUTTER_INPUT_AXIS_DISTANCE:
|
||||
capabilities |= 1 << ZWP_TABLET_TOOL_V1_CAPABILITY_DISTANCE;
|
||||
break;
|
||||
case CLUTTER_INPUT_AXIS_XTILT:
|
||||
case CLUTTER_INPUT_AXIS_YTILT:
|
||||
capabilities |= 1 << ZWP_TABLET_TOOL_V1_CAPABILITY_TILT;
|
||||
break;
|
||||
case CLUTTER_INPUT_AXIS_ROTATION:
|
||||
capabilities |= 1 << ZWP_TABLET_TOOL_V1_CAPABILITY_ROTATION;
|
||||
break;
|
||||
case CLUTTER_INPUT_AXIS_WHEEL:
|
||||
capabilities |= 1 << ZWP_TABLET_TOOL_V1_CAPABILITY_WHEEL;
|
||||
break;
|
||||
case CLUTTER_INPUT_AXIS_SLIDER:
|
||||
capabilities |= 1 << ZWP_TABLET_TOOL_V1_CAPABILITY_SLIDER;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return capabilities;
|
||||
}
|
||||
|
||||
static enum zwp_tablet_tool_v1_type
|
||||
input_device_tool_get_type (ClutterInputDeviceTool *device_tool)
|
||||
{
|
||||
ClutterInputDeviceToolType tool_type;
|
||||
|
||||
tool_type = clutter_input_device_tool_get_tool_type (device_tool);
|
||||
|
||||
switch (tool_type)
|
||||
{
|
||||
case CLUTTER_INPUT_DEVICE_TOOL_NONE:
|
||||
case CLUTTER_INPUT_DEVICE_TOOL_PEN:
|
||||
return ZWP_TABLET_TOOL_V1_TYPE_PEN;
|
||||
case CLUTTER_INPUT_DEVICE_TOOL_ERASER:
|
||||
return ZWP_TABLET_TOOL_V1_TYPE_ERASER;
|
||||
case CLUTTER_INPUT_DEVICE_TOOL_BRUSH:
|
||||
return ZWP_TABLET_TOOL_V1_TYPE_BRUSH;
|
||||
case CLUTTER_INPUT_DEVICE_TOOL_PENCIL:
|
||||
return ZWP_TABLET_TOOL_V1_TYPE_PENCIL;
|
||||
case CLUTTER_INPUT_DEVICE_TOOL_AIRBRUSH:
|
||||
return ZWP_TABLET_TOOL_V1_TYPE_AIRBRUSH;
|
||||
case CLUTTER_INPUT_DEVICE_TOOL_MOUSE:
|
||||
return ZWP_TABLET_TOOL_V1_TYPE_MOUSE;
|
||||
case CLUTTER_INPUT_DEVICE_TOOL_LENS:
|
||||
return ZWP_TABLET_TOOL_V1_TYPE_LENS;
|
||||
}
|
||||
|
||||
g_assert_not_reached ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_tablet_tool_notify_capabilities (MetaWaylandTabletTool *tool,
|
||||
struct wl_resource *resource)
|
||||
{
|
||||
uint32_t capabilities;
|
||||
|
||||
capabilities = input_device_get_capabilities (tool->device);
|
||||
|
||||
if (capabilities & (1 << ZWP_TABLET_TOOL_V1_CAPABILITY_PRESSURE))
|
||||
zwp_tablet_tool_v1_send_capability (resource,
|
||||
ZWP_TABLET_TOOL_V1_CAPABILITY_PRESSURE);
|
||||
if (capabilities & (1 << ZWP_TABLET_TOOL_V1_CAPABILITY_DISTANCE))
|
||||
zwp_tablet_tool_v1_send_capability (resource,
|
||||
ZWP_TABLET_TOOL_V1_CAPABILITY_DISTANCE);
|
||||
if (capabilities & (1 << ZWP_TABLET_TOOL_V1_CAPABILITY_TILT))
|
||||
zwp_tablet_tool_v1_send_capability (resource,
|
||||
ZWP_TABLET_TOOL_V1_CAPABILITY_TILT);
|
||||
if (capabilities & (1 << ZWP_TABLET_TOOL_V1_CAPABILITY_ROTATION))
|
||||
zwp_tablet_tool_v1_send_capability (resource,
|
||||
ZWP_TABLET_TOOL_V1_CAPABILITY_ROTATION);
|
||||
if (capabilities & (1 << ZWP_TABLET_TOOL_V1_CAPABILITY_SLIDER))
|
||||
zwp_tablet_tool_v1_send_capability (resource,
|
||||
ZWP_TABLET_TOOL_V1_CAPABILITY_SLIDER);
|
||||
if (capabilities & (1 << ZWP_TABLET_TOOL_V1_CAPABILITY_WHEEL))
|
||||
zwp_tablet_tool_v1_send_capability (resource,
|
||||
ZWP_TABLET_TOOL_V1_CAPABILITY_WHEEL);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_tablet_tool_notify_details (MetaWaylandTabletTool *tool,
|
||||
struct wl_resource *resource)
|
||||
{
|
||||
guint64 serial;
|
||||
|
||||
zwp_tablet_tool_v1_send_type (resource,
|
||||
input_device_tool_get_type (tool->device_tool));
|
||||
|
||||
serial = (guint64) clutter_input_device_tool_get_serial (tool->device_tool);
|
||||
zwp_tablet_tool_v1_send_hardware_serial (resource, (uint32_t) (serial >> 32),
|
||||
(uint32_t) (serial & G_MAXUINT32));
|
||||
|
||||
meta_wayland_tablet_tool_notify_capabilities (tool, resource);
|
||||
|
||||
/* FIXME: zwp_tablet_tool_v1.hardware_id_wacom missing */
|
||||
|
||||
zwp_tablet_tool_v1_send_done (resource);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_tablet_tool_ensure_resource (MetaWaylandTabletTool *tool,
|
||||
struct wl_client *client)
|
||||
{
|
||||
struct wl_resource *seat_resource, *tool_resource;
|
||||
|
||||
seat_resource = meta_wayland_tablet_seat_lookup_resource (tool->seat, client);
|
||||
|
||||
if (seat_resource &&
|
||||
!meta_wayland_tablet_tool_lookup_resource (tool, client))
|
||||
{
|
||||
tool_resource = meta_wayland_tablet_tool_create_new_resource (tool, client,
|
||||
seat_resource,
|
||||
0);
|
||||
|
||||
meta_wayland_tablet_seat_notify_tool (tool->seat, tool, client);
|
||||
meta_wayland_tablet_tool_notify_details (tool, tool_resource);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
broadcast_proximity_in (MetaWaylandTabletTool *tool)
|
||||
{
|
||||
struct wl_resource *resource, *tablet_resource;
|
||||
struct wl_client *client;
|
||||
|
||||
client = wl_resource_get_client (tool->focus_surface->resource);
|
||||
tablet_resource = meta_wayland_tablet_lookup_resource (tool->current_tablet,
|
||||
client);
|
||||
|
||||
wl_resource_for_each (resource, &tool->focus_resource_list)
|
||||
{
|
||||
zwp_tablet_tool_v1_send_proximity_in (resource, tool->proximity_serial,
|
||||
tablet_resource,
|
||||
tool->focus_surface->resource);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
broadcast_proximity_out (MetaWaylandTabletTool *tool)
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
|
||||
wl_resource_for_each (resource, &tool->focus_resource_list)
|
||||
{
|
||||
zwp_tablet_tool_v1_send_proximity_out (resource);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
broadcast_frame (MetaWaylandTabletTool *tool,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
guint32 _time = event ? clutter_event_get_time (event) : CLUTTER_CURRENT_TIME;
|
||||
|
||||
wl_resource_for_each (resource, &tool->focus_resource_list)
|
||||
{
|
||||
zwp_tablet_tool_v1_send_frame (resource, _time);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_tablet_tool_set_focus (MetaWaylandTabletTool *tool,
|
||||
MetaWaylandSurface *surface,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
if (tool->focus_surface == surface)
|
||||
return;
|
||||
|
||||
if (tool->focus_surface != NULL)
|
||||
{
|
||||
struct wl_list *l;
|
||||
|
||||
l = &tool->focus_resource_list;
|
||||
if (!wl_list_empty (l))
|
||||
{
|
||||
broadcast_proximity_out (tool);
|
||||
broadcast_frame (tool, event);
|
||||
move_resources (&tool->resource_list, &tool->focus_resource_list);
|
||||
}
|
||||
|
||||
wl_list_remove (&tool->focus_surface_destroy_listener.link);
|
||||
tool->focus_surface = NULL;
|
||||
}
|
||||
|
||||
if (surface != NULL && tool->current_tablet)
|
||||
{
|
||||
struct wl_client *client;
|
||||
struct wl_list *l;
|
||||
|
||||
tool->focus_surface = surface;
|
||||
client = wl_resource_get_client (tool->focus_surface->resource);
|
||||
wl_resource_add_destroy_listener (tool->focus_surface->resource,
|
||||
&tool->focus_surface_destroy_listener);
|
||||
|
||||
move_resources_for_client (&tool->focus_resource_list,
|
||||
&tool->resource_list, client);
|
||||
meta_wayland_tablet_tool_ensure_resource (tool, client);
|
||||
|
||||
l = &tool->focus_resource_list;
|
||||
|
||||
if (!wl_list_empty (l))
|
||||
{
|
||||
struct wl_client *client = wl_resource_get_client (tool->focus_surface->resource);
|
||||
struct wl_display *display = wl_client_get_display (client);
|
||||
|
||||
tool->proximity_serial = wl_display_next_serial (display);
|
||||
|
||||
broadcast_proximity_in (tool);
|
||||
broadcast_frame (tool, event);
|
||||
}
|
||||
}
|
||||
|
||||
meta_wayland_tablet_tool_update_cursor_surface (tool);
|
||||
}
|
||||
|
||||
static void
|
||||
tablet_tool_handle_focus_surface_destroy (struct wl_listener *listener,
|
||||
void *data)
|
||||
{
|
||||
MetaWaylandTabletTool *tool;
|
||||
|
||||
tool = wl_container_of (listener, tool, focus_surface_destroy_listener);
|
||||
meta_wayland_tablet_tool_set_focus (tool, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
tablet_tool_handle_cursor_surface_destroy (struct wl_listener *listener,
|
||||
void *data)
|
||||
{
|
||||
MetaWaylandTabletTool *tool;
|
||||
|
||||
tool = wl_container_of (listener, tool, cursor_surface_destroy_listener);
|
||||
meta_wayland_tablet_tool_set_cursor_surface (tool, NULL);
|
||||
}
|
||||
|
||||
MetaWaylandTabletTool *
|
||||
meta_wayland_tablet_tool_new (MetaWaylandTabletSeat *seat,
|
||||
ClutterInputDevice *device,
|
||||
ClutterInputDeviceTool *device_tool)
|
||||
{
|
||||
MetaWaylandTabletTool *tool;
|
||||
|
||||
tool = g_slice_new0 (MetaWaylandTabletTool);
|
||||
tool->seat = seat;
|
||||
tool->device = device;
|
||||
tool->device_tool = device_tool;
|
||||
wl_list_init (&tool->resource_list);
|
||||
wl_list_init (&tool->focus_resource_list);
|
||||
|
||||
tool->focus_surface_destroy_listener.notify = tablet_tool_handle_focus_surface_destroy;
|
||||
tool->cursor_surface_destroy_listener.notify = tablet_tool_handle_cursor_surface_destroy;
|
||||
|
||||
return tool;
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_tablet_tool_free (MetaWaylandTabletTool *tool)
|
||||
{
|
||||
struct wl_resource *resource, *next;
|
||||
|
||||
meta_wayland_tablet_tool_set_focus (tool, NULL, NULL);
|
||||
meta_wayland_tablet_tool_set_cursor_surface (tool, NULL);
|
||||
g_clear_object (&tool->cursor_renderer);
|
||||
|
||||
wl_resource_for_each_safe (resource, next, &tool->resource_list)
|
||||
{
|
||||
zwp_tablet_tool_v1_send_removed (resource);
|
||||
}
|
||||
|
||||
g_slice_free (MetaWaylandTabletTool, tool);
|
||||
}
|
||||
|
||||
static void
|
||||
tool_set_cursor (struct wl_client *client,
|
||||
struct wl_resource *resource,
|
||||
uint32_t serial,
|
||||
struct wl_resource *surface_resource,
|
||||
int32_t hotspot_x,
|
||||
int32_t hotspot_y)
|
||||
{
|
||||
MetaWaylandTabletTool *tool = wl_resource_get_user_data (resource);
|
||||
MetaWaylandSurface *surface;
|
||||
|
||||
surface = (surface_resource ? wl_resource_get_user_data (surface_resource) : NULL);
|
||||
|
||||
if (tool->focus_surface == NULL)
|
||||
return;
|
||||
if (tool->cursor_renderer == NULL)
|
||||
return;
|
||||
if (wl_resource_get_client (tool->focus_surface->resource) != client)
|
||||
return;
|
||||
if (tool->proximity_serial - serial > G_MAXUINT32 / 2)
|
||||
return;
|
||||
|
||||
if (surface &&
|
||||
!meta_wayland_surface_assign_role (surface,
|
||||
META_TYPE_WAYLAND_SURFACE_ROLE_CURSOR))
|
||||
{
|
||||
wl_resource_post_error (resource, WL_POINTER_ERROR_ROLE,
|
||||
"wl_surface@%d already has a different role",
|
||||
wl_resource_get_id (surface_resource));
|
||||
return;
|
||||
}
|
||||
|
||||
if (surface)
|
||||
{
|
||||
MetaWaylandSurfaceRoleCursor *cursor_role;
|
||||
|
||||
cursor_role = META_WAYLAND_SURFACE_ROLE_CURSOR (surface->role);
|
||||
meta_wayland_surface_role_cursor_set_renderer (cursor_role,
|
||||
tool->cursor_renderer);
|
||||
meta_wayland_surface_role_cursor_set_hotspot (cursor_role,
|
||||
hotspot_x, hotspot_y);
|
||||
}
|
||||
|
||||
meta_wayland_tablet_tool_set_cursor_surface (tool, surface);
|
||||
}
|
||||
|
||||
static void
|
||||
tool_destroy (struct wl_client *client,
|
||||
struct wl_resource *resource)
|
||||
{
|
||||
wl_resource_destroy (resource);
|
||||
}
|
||||
|
||||
static const struct zwp_tablet_tool_v1_interface tool_interface = {
|
||||
tool_set_cursor,
|
||||
tool_destroy
|
||||
};
|
||||
|
||||
static void
|
||||
emit_proximity_in (MetaWaylandTabletTool *tool,
|
||||
struct wl_resource *resource)
|
||||
{
|
||||
struct wl_resource *tablet_resource;
|
||||
struct wl_client *client;
|
||||
|
||||
if (!tool->focus_surface)
|
||||
return;
|
||||
|
||||
client = wl_resource_get_client (resource);
|
||||
tablet_resource = meta_wayland_tablet_lookup_resource (tool->current_tablet,
|
||||
client);
|
||||
|
||||
zwp_tablet_tool_v1_send_proximity_in (resource, tool->proximity_serial,
|
||||
tablet_resource, tool->focus_surface->resource);
|
||||
}
|
||||
|
||||
struct wl_resource *
|
||||
meta_wayland_tablet_tool_create_new_resource (MetaWaylandTabletTool *tool,
|
||||
struct wl_client *client,
|
||||
struct wl_resource *seat_resource,
|
||||
uint32_t id)
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
|
||||
resource = wl_resource_create (client, &zwp_tablet_tool_v1_interface,
|
||||
wl_resource_get_version (seat_resource), id);
|
||||
wl_resource_set_implementation (resource, &tool_interface,
|
||||
tool, unbind_resource);
|
||||
wl_resource_set_user_data (resource, tool);
|
||||
|
||||
if (tool->focus_surface &&
|
||||
wl_resource_get_client (tool->focus_surface->resource) == client)
|
||||
{
|
||||
wl_list_insert (&tool->focus_resource_list, wl_resource_get_link (resource));
|
||||
emit_proximity_in (tool, resource);
|
||||
}
|
||||
else
|
||||
{
|
||||
wl_list_insert (&tool->resource_list, wl_resource_get_link (resource));
|
||||
}
|
||||
|
||||
return resource;
|
||||
}
|
||||
|
||||
struct wl_resource *
|
||||
meta_wayland_tablet_tool_lookup_resource (MetaWaylandTabletTool *tool,
|
||||
struct wl_client *client)
|
||||
{
|
||||
struct wl_resource *resource = NULL;
|
||||
|
||||
if (!wl_list_empty (&tool->resource_list))
|
||||
resource = wl_resource_find_for_client (&tool->resource_list, client);
|
||||
|
||||
if (!wl_list_empty (&tool->focus_resource_list))
|
||||
resource = wl_resource_find_for_client (&tool->focus_resource_list, client);
|
||||
|
||||
return resource;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_tablet_tool_account_button (MetaWaylandTabletTool *tool,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
if (event->type == CLUTTER_BUTTON_PRESS)
|
||||
tool->pressed_buttons |= 1 << (event->button.button - 1);
|
||||
else if (event->type == CLUTTER_BUTTON_RELEASE)
|
||||
tool->pressed_buttons &= ~(1 << (event->button.button - 1));
|
||||
}
|
||||
|
||||
static void
|
||||
sync_focus_surface (MetaWaylandTabletTool *tool,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
MetaDisplay *display = meta_get_display ();
|
||||
|
||||
switch (display->event_route)
|
||||
{
|
||||
case META_EVENT_ROUTE_WINDOW_OP:
|
||||
case META_EVENT_ROUTE_COMPOSITOR_GRAB:
|
||||
case META_EVENT_ROUTE_FRAME_BUTTON:
|
||||
/* The compositor has a grab, so remove our focus */
|
||||
meta_wayland_tablet_tool_set_focus (tool, NULL, event);
|
||||
break;
|
||||
|
||||
case META_EVENT_ROUTE_NORMAL:
|
||||
case META_EVENT_ROUTE_WAYLAND_POPUP:
|
||||
meta_wayland_tablet_tool_set_focus (tool, tool->current, event);
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
repick_for_event (MetaWaylandTabletTool *tool,
|
||||
const ClutterEvent *for_event)
|
||||
{
|
||||
ClutterActor *actor = NULL;
|
||||
|
||||
actor = clutter_event_get_source (for_event);
|
||||
|
||||
if (META_IS_SURFACE_ACTOR_WAYLAND (actor))
|
||||
tool->current = meta_surface_actor_wayland_get_surface (META_SURFACE_ACTOR_WAYLAND (actor));
|
||||
else
|
||||
tool->current = NULL;
|
||||
|
||||
sync_focus_surface (tool, for_event);
|
||||
meta_wayland_tablet_tool_update_cursor_surface (tool);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_tablet_tool_get_relative_coordinates (MetaWaylandTabletTool *tool,
|
||||
ClutterInputDevice *device,
|
||||
MetaWaylandSurface *surface,
|
||||
wl_fixed_t *sx,
|
||||
wl_fixed_t *sy)
|
||||
{
|
||||
float xf = 0.0f, yf = 0.0f;
|
||||
ClutterPoint pos;
|
||||
|
||||
clutter_input_device_get_coords (device, NULL, &pos);
|
||||
clutter_actor_transform_stage_point (CLUTTER_ACTOR (meta_surface_actor_get_texture (surface->surface_actor)),
|
||||
pos.x, pos.y, &xf, &yf);
|
||||
|
||||
*sx = wl_fixed_from_double (xf) / surface->scale;
|
||||
*sy = wl_fixed_from_double (yf) / surface->scale;
|
||||
}
|
||||
|
||||
static void
|
||||
broadcast_motion (MetaWaylandTabletTool *tool,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
ClutterInputDevice *device;
|
||||
wl_fixed_t sx, sy;
|
||||
|
||||
device = clutter_event_get_source_device (event);
|
||||
meta_wayland_tablet_tool_get_relative_coordinates (tool, device,
|
||||
tool->focus_surface,
|
||||
&sx, &sy);
|
||||
|
||||
wl_resource_for_each (resource, &tool->focus_resource_list)
|
||||
{
|
||||
zwp_tablet_tool_v1_send_motion (resource, sx, sy);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
broadcast_down (MetaWaylandTabletTool *tool,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
|
||||
tool->down_serial = wl_display_next_serial (tool->seat->manager->wl_display);
|
||||
|
||||
wl_resource_for_each (resource, &tool->focus_resource_list)
|
||||
{
|
||||
zwp_tablet_tool_v1_send_down (resource, tool->down_serial);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
broadcast_up (MetaWaylandTabletTool *tool,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
|
||||
wl_resource_for_each (resource, &tool->focus_resource_list)
|
||||
{
|
||||
zwp_tablet_tool_v1_send_up (resource);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
broadcast_button (MetaWaylandTabletTool *tool,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
guint32 button;
|
||||
|
||||
tool->button_serial = wl_display_next_serial (tool->seat->manager->wl_display);
|
||||
|
||||
#ifdef HAVE_NATIVE_BACKEND
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
if (META_IS_BACKEND_NATIVE (backend))
|
||||
button = clutter_evdev_event_get_event_code (event);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/* We can't do much better here, there's several
|
||||
* different BTN_ ranges to cover.
|
||||
*/
|
||||
button = event->button.button;
|
||||
}
|
||||
|
||||
|
||||
wl_resource_for_each (resource, &tool->focus_resource_list)
|
||||
{
|
||||
zwp_tablet_tool_v1_send_button (resource, tool->button_serial, button,
|
||||
event->type == CLUTTER_BUTTON_PRESS ?
|
||||
ZWP_TABLET_TOOL_V1_BUTTON_STATE_PRESSED :
|
||||
ZWP_TABLET_TOOL_V1_BUTTON_STATE_RELEASED);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
broadcast_axis (MetaWaylandTabletTool *tool,
|
||||
const ClutterEvent *event,
|
||||
ClutterInputAxis axis)
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
ClutterInputDevice *source;
|
||||
uint32_t value;
|
||||
gdouble val;
|
||||
|
||||
source = clutter_event_get_source_device (event);
|
||||
|
||||
if (!clutter_input_device_get_axis_value (source, event->motion.axes, axis, &val))
|
||||
return;
|
||||
|
||||
value = val * TABLET_AXIS_MAX;
|
||||
|
||||
wl_resource_for_each (resource, &tool->focus_resource_list)
|
||||
{
|
||||
switch (axis)
|
||||
{
|
||||
case CLUTTER_INPUT_AXIS_PRESSURE:
|
||||
zwp_tablet_tool_v1_send_pressure (resource, value);
|
||||
break;
|
||||
case CLUTTER_INPUT_AXIS_DISTANCE:
|
||||
zwp_tablet_tool_v1_send_distance (resource, value);
|
||||
break;
|
||||
case CLUTTER_INPUT_AXIS_SLIDER:
|
||||
zwp_tablet_tool_v1_send_slider (resource, value);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
broadcast_tilt (MetaWaylandTabletTool *tool,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
ClutterInputDevice *source;
|
||||
gdouble xtilt, ytilt;
|
||||
|
||||
source = clutter_event_get_source_device (event);
|
||||
|
||||
if (!clutter_input_device_get_axis_value (source, event->motion.axes,
|
||||
CLUTTER_INPUT_AXIS_XTILT, &xtilt) ||
|
||||
!clutter_input_device_get_axis_value (source, event->motion.axes,
|
||||
CLUTTER_INPUT_AXIS_YTILT, &ytilt))
|
||||
return;
|
||||
|
||||
wl_resource_for_each (resource, &tool->focus_resource_list)
|
||||
{
|
||||
zwp_tablet_tool_v1_send_tilt (resource,
|
||||
(int32_t) (xtilt * DEGREES_PRECISION),
|
||||
(int32_t) (ytilt * DEGREES_PRECISION));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
broadcast_rotation (MetaWaylandTabletTool *tool,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
ClutterInputDevice *source;
|
||||
gdouble rotation;
|
||||
|
||||
source = clutter_event_get_source_device (event);
|
||||
|
||||
if (!clutter_input_device_get_axis_value (source, event->motion.axes,
|
||||
CLUTTER_INPUT_AXIS_ROTATION,
|
||||
&rotation))
|
||||
return;
|
||||
|
||||
wl_resource_for_each (resource, &tool->focus_resource_list)
|
||||
{
|
||||
zwp_tablet_tool_v1_send_rotation (resource,
|
||||
(int32_t) rotation * DEGREES_PRECISION);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
broadcast_axes (MetaWaylandTabletTool *tool,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
ClutterInputDevice *device;
|
||||
guint32 capabilities;
|
||||
|
||||
if (!event->motion.axes)
|
||||
return;
|
||||
|
||||
device = clutter_event_get_source_device (event);
|
||||
capabilities = input_device_get_capabilities (device);
|
||||
|
||||
if (capabilities & (1 << ZWP_TABLET_TOOL_V1_CAPABILITY_PRESSURE))
|
||||
broadcast_axis (tool, event, CLUTTER_INPUT_AXIS_PRESSURE);
|
||||
if (capabilities & (1 << ZWP_TABLET_TOOL_V1_CAPABILITY_DISTANCE))
|
||||
broadcast_axis (tool, event, CLUTTER_INPUT_AXIS_DISTANCE);
|
||||
if (capabilities & (1 << ZWP_TABLET_TOOL_V1_CAPABILITY_TILT))
|
||||
broadcast_tilt (tool, event);
|
||||
if (capabilities & (1 << ZWP_TABLET_TOOL_V1_CAPABILITY_ROTATION))
|
||||
broadcast_rotation (tool, event);
|
||||
if (capabilities & (1 << ZWP_TABLET_TOOL_V1_CAPABILITY_SLIDER))
|
||||
broadcast_axis (tool, event, CLUTTER_INPUT_AXIS_SLIDER);
|
||||
|
||||
/* FIXME: Missing wp_tablet_tool.wheel */
|
||||
}
|
||||
|
||||
static void
|
||||
handle_motion_event (MetaWaylandTabletTool *tool,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
if (!tool->focus_surface)
|
||||
return;
|
||||
|
||||
broadcast_motion (tool, event);
|
||||
broadcast_axes (tool, event);
|
||||
broadcast_frame (tool, event);
|
||||
}
|
||||
|
||||
static void
|
||||
handle_button_event (MetaWaylandTabletTool *tool,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
if (!tool->focus_surface)
|
||||
return;
|
||||
|
||||
if (event->type == CLUTTER_BUTTON_PRESS && event->button.button == 1)
|
||||
broadcast_down (tool, event);
|
||||
else if (event->type == CLUTTER_BUTTON_RELEASE && event->button.button == 1)
|
||||
broadcast_up (tool, event);
|
||||
else
|
||||
broadcast_button (tool, event);
|
||||
|
||||
broadcast_frame (tool, event);
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_tablet_tool_update (MetaWaylandTabletTool *tool,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
switch (event->type)
|
||||
{
|
||||
case CLUTTER_BUTTON_PRESS:
|
||||
case CLUTTER_BUTTON_RELEASE:
|
||||
meta_wayland_tablet_tool_account_button (tool, event);
|
||||
break;
|
||||
case CLUTTER_MOTION:
|
||||
if (!tool->pressed_buttons)
|
||||
repick_for_event (tool, event);
|
||||
break;
|
||||
case CLUTTER_PROXIMITY_IN:
|
||||
if (!tool->cursor_renderer)
|
||||
tool->cursor_renderer = meta_cursor_renderer_new ();
|
||||
tool->current_tablet =
|
||||
meta_wayland_tablet_seat_lookup_tablet (tool->seat,
|
||||
clutter_event_get_source_device (event));
|
||||
break;
|
||||
case CLUTTER_PROXIMITY_OUT:
|
||||
tool->current_tablet = NULL;
|
||||
meta_wayland_tablet_tool_update_cursor_surface (tool);
|
||||
g_clear_object (&tool->cursor_renderer);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_wayland_tablet_tool_handle_event (MetaWaylandTabletTool *tool,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
switch (event->type)
|
||||
{
|
||||
case CLUTTER_PROXIMITY_IN:
|
||||
/* We don't have much info here to make anything useful out of it,
|
||||
* wait until the first motion event so we have both coordinates
|
||||
* and tool.
|
||||
*/
|
||||
break;
|
||||
case CLUTTER_PROXIMITY_OUT:
|
||||
meta_wayland_tablet_tool_set_focus (tool, NULL, event);
|
||||
break;
|
||||
case CLUTTER_MOTION:
|
||||
handle_motion_event (tool, event);
|
||||
break;
|
||||
case CLUTTER_BUTTON_PRESS:
|
||||
case CLUTTER_BUTTON_RELEASE:
|
||||
handle_button_event (tool, event);
|
||||
break;
|
||||
default:
|
||||
return CLUTTER_EVENT_PROPAGATE;
|
||||
}
|
||||
|
||||
return CLUTTER_EVENT_STOP;
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_tablet_tool_set_cursor_position (MetaWaylandTabletTool *tool,
|
||||
int new_x,
|
||||
int new_y)
|
||||
{
|
||||
if (tool->cursor_renderer)
|
||||
meta_cursor_renderer_set_position (tool->cursor_renderer, new_x, new_y);
|
||||
}
|
@ -1,81 +0,0 @@
|
||||
/*
|
||||
* Wayland Support
|
||||
*
|
||||
* Copyright (C) 2015 Red Hat
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Carlos Garnacho <carlosg@gnome.org>
|
||||
*/
|
||||
|
||||
#ifndef META_WAYLAND_TABLET_TOOL_H
|
||||
#define META_WAYLAND_TABLET_TOOL_H
|
||||
|
||||
#include <wayland-server.h>
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include "meta-wayland-types.h"
|
||||
#include "meta-cursor-renderer.h"
|
||||
|
||||
struct _MetaWaylandTabletTool
|
||||
{
|
||||
MetaWaylandTabletSeat *seat;
|
||||
ClutterInputDevice *device;
|
||||
ClutterInputDeviceTool *device_tool;
|
||||
struct wl_list resource_list;
|
||||
struct wl_list focus_resource_list;
|
||||
|
||||
MetaWaylandSurface *focus_surface;
|
||||
struct wl_listener focus_surface_destroy_listener;
|
||||
|
||||
MetaWaylandSurface *cursor_surface;
|
||||
struct wl_listener cursor_surface_destroy_listener;
|
||||
MetaCursorRenderer *cursor_renderer;
|
||||
|
||||
MetaWaylandSurface *current;
|
||||
guint32 pressed_buttons;
|
||||
|
||||
guint32 proximity_serial;
|
||||
guint32 down_serial;
|
||||
guint32 button_serial;
|
||||
|
||||
MetaWaylandTablet *current_tablet;
|
||||
};
|
||||
|
||||
MetaWaylandTabletTool * meta_wayland_tablet_tool_new (MetaWaylandTabletSeat *seat,
|
||||
ClutterInputDevice *device,
|
||||
ClutterInputDeviceTool *device_tool);
|
||||
void meta_wayland_tablet_tool_free (MetaWaylandTabletTool *tool);
|
||||
|
||||
struct wl_resource *
|
||||
meta_wayland_tablet_tool_create_new_resource (MetaWaylandTabletTool *tool,
|
||||
struct wl_client *client,
|
||||
struct wl_resource *seat_resource,
|
||||
uint32_t id);
|
||||
struct wl_resource *
|
||||
meta_wayland_tablet_tool_lookup_resource (MetaWaylandTabletTool *tool,
|
||||
struct wl_client *client);
|
||||
|
||||
void meta_wayland_tablet_tool_update (MetaWaylandTabletTool *tool,
|
||||
const ClutterEvent *event);
|
||||
gboolean meta_wayland_tablet_tool_handle_event (MetaWaylandTabletTool *tool,
|
||||
const ClutterEvent *event);
|
||||
|
||||
void meta_wayland_tablet_tool_set_cursor_position (MetaWaylandTabletTool *tool,
|
||||
int new_x,
|
||||
int new_y);
|
||||
|
||||
|
||||
#endif /* META_WAYLAND_TABLET_TOOL_H */
|
@ -1,130 +0,0 @@
|
||||
/*
|
||||
* Wayland Support
|
||||
*
|
||||
* Copyright (C) 2015 Red Hat
|
||||
*
|
||||
* 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: Carlos Garnacho <carlosg@gnome.org>
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include <wayland-server.h>
|
||||
#include "tablet-unstable-v1-server-protocol.h"
|
||||
|
||||
#include "meta-surface-actor-wayland.h"
|
||||
#include "meta-wayland-private.h"
|
||||
#include "meta-wayland-tablet.h"
|
||||
|
||||
static void
|
||||
unbind_resource (struct wl_resource *resource)
|
||||
{
|
||||
wl_list_remove (wl_resource_get_link (resource));
|
||||
}
|
||||
|
||||
MetaWaylandTablet *
|
||||
meta_wayland_tablet_new (ClutterInputDevice *device,
|
||||
MetaWaylandTabletSeat *tablet_seat)
|
||||
{
|
||||
MetaWaylandTablet *tablet;
|
||||
|
||||
tablet = g_slice_new0 (MetaWaylandTablet);
|
||||
wl_list_init (&tablet->resource_list);
|
||||
wl_list_init (&tablet->focus_resource_list);
|
||||
tablet->device = device;
|
||||
tablet->tablet_seat = tablet_seat;
|
||||
|
||||
return tablet;
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_tablet_free (MetaWaylandTablet *tablet)
|
||||
{
|
||||
struct wl_resource *resource, *next;
|
||||
|
||||
wl_resource_for_each_safe (resource, next, &tablet->resource_list)
|
||||
{
|
||||
zwp_tablet_v1_send_removed (resource);
|
||||
}
|
||||
|
||||
g_slice_free (MetaWaylandTablet, tablet);
|
||||
}
|
||||
|
||||
static void
|
||||
tablet_destroy (struct wl_client *client,
|
||||
struct wl_resource *resource)
|
||||
{
|
||||
wl_resource_destroy (resource);
|
||||
}
|
||||
|
||||
static const struct zwp_tablet_v1_interface tablet_interface = {
|
||||
tablet_destroy
|
||||
};
|
||||
|
||||
void
|
||||
meta_wayland_tablet_notify (MetaWaylandTablet *tablet,
|
||||
struct wl_resource *resource)
|
||||
{
|
||||
ClutterInputDevice *device = tablet->device;
|
||||
guint vid, pid;
|
||||
|
||||
zwp_tablet_v1_send_name (resource, clutter_input_device_get_device_name (device));
|
||||
|
||||
if (sscanf (clutter_input_device_get_vendor_id (device), "%x", &vid) == 1 &&
|
||||
sscanf (clutter_input_device_get_product_id (device), "%x", &pid) == 1)
|
||||
zwp_tablet_v1_send_id (resource, vid, pid);
|
||||
|
||||
/* FIXME: zwp_tablet_v1.path missing */
|
||||
|
||||
zwp_tablet_v1_send_done (resource);
|
||||
}
|
||||
|
||||
struct wl_resource *
|
||||
meta_wayland_tablet_create_new_resource (MetaWaylandTablet *tablet,
|
||||
struct wl_client *client,
|
||||
struct wl_resource *seat_resource,
|
||||
uint32_t id)
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
|
||||
resource = wl_resource_create (client, &zwp_tablet_v1_interface,
|
||||
wl_resource_get_version (seat_resource), id);
|
||||
wl_resource_set_implementation (resource, &tablet_interface,
|
||||
tablet, unbind_resource);
|
||||
wl_resource_set_user_data (resource, tablet);
|
||||
wl_list_insert (&tablet->resource_list, wl_resource_get_link (resource));
|
||||
|
||||
return resource;
|
||||
}
|
||||
|
||||
struct wl_resource *
|
||||
meta_wayland_tablet_lookup_resource (MetaWaylandTablet *tablet,
|
||||
struct wl_client *client)
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
|
||||
resource = wl_resource_find_for_client (&tablet->resource_list, client);
|
||||
|
||||
if (!resource)
|
||||
resource = wl_resource_find_for_client (&tablet->focus_resource_list, client);
|
||||
|
||||
return resource;
|
||||
}
|
@ -1,59 +0,0 @@
|
||||
/*
|
||||
* Wayland Support
|
||||
*
|
||||
* Copyright (C) 2015 Red Hat
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Carlos Garnacho <carlosg@gnome.org>
|
||||
*/
|
||||
|
||||
#ifndef META_WAYLAND_TABLET_H
|
||||
#define META_WAYLAND_TABLET_H
|
||||
|
||||
#include <wayland-server.h>
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include "meta-wayland-types.h"
|
||||
#include "meta-cursor-renderer.h"
|
||||
|
||||
struct _MetaWaylandTablet
|
||||
{
|
||||
MetaWaylandTabletSeat *tablet_seat;
|
||||
ClutterInputDevice *device;
|
||||
|
||||
struct wl_list resource_list;
|
||||
struct wl_list focus_resource_list;
|
||||
|
||||
MetaWaylandSurface *current;
|
||||
};
|
||||
|
||||
MetaWaylandTablet * meta_wayland_tablet_new (ClutterInputDevice *device,
|
||||
MetaWaylandTabletSeat *tablet_seat);
|
||||
void meta_wayland_tablet_free (MetaWaylandTablet *tablet);
|
||||
|
||||
struct wl_resource *
|
||||
meta_wayland_tablet_create_new_resource (MetaWaylandTablet *tablet,
|
||||
struct wl_client *client,
|
||||
struct wl_resource *seat_resource,
|
||||
uint32_t id);
|
||||
struct wl_resource *
|
||||
meta_wayland_tablet_lookup_resource (MetaWaylandTablet *tablet,
|
||||
struct wl_client *client);
|
||||
|
||||
void meta_wayland_tablet_notify (MetaWaylandTablet *tablet,
|
||||
struct wl_resource *resource);
|
||||
|
||||
#endif /* META_WAYLAND_TABLET_H */
|
@ -36,11 +36,6 @@ typedef struct _MetaWaylandDragDestFuncs MetaWaylandDragDestFuncs;
|
||||
typedef struct _MetaWaylandDataOffer MetaWaylandDataOffer;
|
||||
typedef struct _MetaWaylandDataDevice MetaWaylandDataDevice;
|
||||
|
||||
typedef struct _MetaWaylandTabletManager MetaWaylandTabletManager;
|
||||
typedef struct _MetaWaylandTabletSeat MetaWaylandTabletSeat;
|
||||
typedef struct _MetaWaylandTabletTool MetaWaylandTabletTool;
|
||||
typedef struct _MetaWaylandTablet MetaWaylandTablet;
|
||||
|
||||
typedef struct _MetaWaylandBuffer MetaWaylandBuffer;
|
||||
typedef struct _MetaWaylandRegion MetaWaylandRegion;
|
||||
|
||||
|
@ -39,7 +39,6 @@
|
||||
#include "meta-wayland-seat.h"
|
||||
#include "meta-wayland-outputs.h"
|
||||
#include "meta-wayland-data-device.h"
|
||||
#include "meta-wayland-tablet-manager.h"
|
||||
|
||||
static MetaWaylandCompositor _meta_wayland_compositor;
|
||||
|
||||
@ -168,10 +167,7 @@ void
|
||||
meta_wayland_compositor_update (MetaWaylandCompositor *compositor,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
if (meta_wayland_tablet_manager_consumes_event (compositor->tablet_manager, event))
|
||||
meta_wayland_tablet_manager_update (compositor->tablet_manager, event);
|
||||
else
|
||||
meta_wayland_seat_update (compositor->seat, event);
|
||||
meta_wayland_seat_update (compositor->seat, event);
|
||||
}
|
||||
|
||||
void
|
||||
@ -200,10 +196,6 @@ gboolean
|
||||
meta_wayland_compositor_handle_event (MetaWaylandCompositor *compositor,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
if (meta_wayland_tablet_manager_handle_event (compositor->tablet_manager,
|
||||
event))
|
||||
return TRUE;
|
||||
|
||||
return meta_wayland_seat_handle_event (compositor->seat, event);
|
||||
}
|
||||
|
||||
@ -335,7 +327,6 @@ meta_wayland_init (void)
|
||||
meta_wayland_data_device_manager_init (compositor);
|
||||
meta_wayland_shell_init (compositor);
|
||||
meta_wayland_pointer_gestures_init (compositor);
|
||||
meta_wayland_tablet_manager_init (compositor);
|
||||
meta_wayland_seat_init (compositor);
|
||||
meta_wayland_relative_pointer_init (compositor);
|
||||
meta_wayland_pointer_constraints_init (compositor);
|
||||
|
Reference in New Issue
Block a user