Merge branch 'better-naming' into 'master'

Stop using loaded terms

See merge request GNOME/gtk!2109
This commit is contained in:
Matthias Clasen 2020-06-19 00:09:03 +00:00
commit 5e6c316603
41 changed files with 698 additions and 692 deletions

View File

@ -84,7 +84,7 @@ static TreeItem may[] =
static TreeItem june[] =
{
{ "June Fathers' Day", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, NULL },
{ "Juneteenth (Liberation of Slaves)", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
{ "Juneteenth (Liberation Day)", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
{ "Flag Day", FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, NULL },
{ NULL }
};

View File

@ -359,7 +359,7 @@ gdk_device_get_product_id
gdk_device_get_source
gdk_device_get_axis_use
gdk_device_get_associated_device
gdk_device_list_slave_devices
gdk_device_list_physical_devices
gdk_device_get_device_type
gdk_device_get_display
gdk_device_get_has_cursor
@ -442,8 +442,8 @@ gdk_seat_get_display
gdk_seat_get_capabilities
gdk_seat_get_pointer
gdk_seat_get_keyboard
gdk_seat_get_slaves
gdk_seat_get_master_pointers
gdk_seat_get_physical_devices
gdk_seat_get_logical_pointers
<SUBSECTION Standard>
GDK_SEAT

View File

@ -5,7 +5,7 @@ in what happens to translate a key press or mouse motion of the users into a
change of a GTK widget, you should read this chapter. This knowledge will also
be useful if you decide to implement your own widgets.
Devices and events
## Devices and events
The most basic input devices that every computer user has interacted with are
keyboards and mice; beyond these, GTK supports touchpads, touchscreens and
@ -13,14 +13,14 @@ more exotic input devices such as graphics tablets. Inside GTK, every such
input device is represented by a #GdkDevice object.
To simplify dealing with the variability between these input devices, GTK
has a concept of master and slave devices. The concrete physical devices that
has a concept of logical and physical devices. The concrete physical devices that
have many different characteristics (mice may have 2 or 3 or 8 buttons,
keyboards have different layouts and may or may not have a separate number
block, etc) are represented as slave devices. Each slave device is
associated with a virtual master device. Master devices always come in
block, etc) are represented as physical devices. Each physical device is
associated with a virtual logical device. Logical devices always come in
pointer/keyboard pairs - you can think of such a pair as a 'seat'.
GTK widgets generally deal with the master devices, and thus can be used
GTK widgets generally deal with the logical devices, and thus can be used
with any pointing device or keyboard.
When a user interacts with an input device (e.g. moves a mouse or presses

View File

@ -157,7 +157,7 @@ _gdk_broadway_surface_grab_check_unmap (GdkSurface *surface,
seat = gdk_display_get_default_seat (display);
devices = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_ALL);
devices = gdk_seat_get_physical_devices (seat, GDK_SEAT_CAPABILITY_ALL);
devices = g_list_prepend (devices, gdk_seat_get_keyboard (seat));
devices = g_list_prepend (devices, gdk_seat_get_pointer (seat));

View File

@ -119,7 +119,7 @@ create_core_pointer (GdkDisplay *display)
{
return g_object_new (GDK_TYPE_BROADWAY_DEVICE,
"name", "Core Pointer",
"type", GDK_DEVICE_TYPE_MASTER,
"type", GDK_DEVICE_TYPE_LOGICAL,
"source", GDK_SOURCE_MOUSE,
"has-cursor", TRUE,
"display", display,
@ -131,7 +131,7 @@ create_core_keyboard (GdkDisplay *display)
{
return g_object_new (GDK_TYPE_BROADWAY_DEVICE,
"name", "Core Keyboard",
"type", GDK_DEVICE_TYPE_MASTER,
"type", GDK_DEVICE_TYPE_LOGICAL,
"source", GDK_SOURCE_KEYBOARD,
"has-cursor", FALSE,
"display", display,
@ -143,7 +143,7 @@ create_pointer (GdkDisplay *display)
{
return g_object_new (GDK_TYPE_BROADWAY_DEVICE,
"name", "Pointer",
"type", GDK_DEVICE_TYPE_SLAVE,
"type", GDK_DEVICE_TYPE_PHYSICAL,
"source", GDK_SOURCE_MOUSE,
"has-cursor", TRUE,
"display", display,
@ -155,7 +155,7 @@ create_keyboard (GdkDisplay *display)
{
return g_object_new (GDK_TYPE_BROADWAY_DEVICE,
"name", "Keyboard",
"type", GDK_DEVICE_TYPE_SLAVE,
"type", GDK_DEVICE_TYPE_PHYSICAL,
"source", GDK_SOURCE_KEYBOARD,
"has-cursor", FALSE,
"display", display,
@ -167,7 +167,7 @@ create_touchscreen (GdkDisplay *display)
{
return g_object_new (GDK_TYPE_BROADWAY_DEVICE,
"name", "Touchscreen",
"type", GDK_DEVICE_TYPE_SLAVE,
"type", GDK_DEVICE_TYPE_PHYSICAL,
"source", GDK_SOURCE_TOUCHSCREEN,
"has-cursor", FALSE,
"display", display,
@ -196,15 +196,15 @@ _gdk_broadway_display_open (const gchar *display_name)
_gdk_device_set_associated_device (broadway_display->pointer, broadway_display->core_pointer);
_gdk_device_set_associated_device (broadway_display->keyboard, broadway_display->core_keyboard);
_gdk_device_set_associated_device (broadway_display->touchscreen, broadway_display->core_pointer);
_gdk_device_add_slave (broadway_display->core_pointer, broadway_display->touchscreen);
_gdk_device_add_physical_device (broadway_display->core_pointer, broadway_display->touchscreen);
seat = gdk_seat_default_new_for_master_pair (broadway_display->core_pointer,
broadway_display->core_keyboard);
seat = gdk_seat_default_new_for_logical_pair (broadway_display->core_pointer,
broadway_display->core_keyboard);
gdk_display_add_seat (display, seat);
gdk_seat_default_add_slave (GDK_SEAT_DEFAULT (seat), broadway_display->pointer);
gdk_seat_default_add_slave (GDK_SEAT_DEFAULT (seat), broadway_display->keyboard);
gdk_seat_default_add_slave (GDK_SEAT_DEFAULT (seat), broadway_display->touchscreen);
gdk_seat_default_add_physical_device (GDK_SEAT_DEFAULT (seat), broadway_display->pointer);
gdk_seat_default_add_physical_device (GDK_SEAT_DEFAULT (seat), broadway_display->keyboard);
gdk_seat_default_add_physical_device (GDK_SEAT_DEFAULT (seat), broadway_display->touchscreen);
g_object_unref (seat);
gdk_event_init (display);

View File

@ -36,7 +36,7 @@
* as a keyboard, a mouse, a touchpad, etc.
*
* See the #GdkSeat documentation for more information
* about the various kinds of master and slave devices, and their
* about the various kinds of logical and physical devices, and their
* relationships.
*/
@ -152,15 +152,16 @@ gdk_device_class_init (GdkDeviceClass *klass)
P_("Device type"),
P_("Device role in the device manager"),
GDK_TYPE_DEVICE_TYPE,
GDK_DEVICE_TYPE_MASTER,
GDK_DEVICE_TYPE_LOGICAL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
/**
* GdkDevice:associated-device:
*
* Associated pointer or keyboard with this device, if any. Devices of type #GDK_DEVICE_TYPE_MASTER
* always come in keyboard/pointer pairs. Other device types will have a %NULL associated device.
* Associated pointer or keyboard with this device, if any. Devices of
* type #GDK_DEVICE_TYPE_LOGICAL always come in keyboard/pointer pairs.
* Other device types will have a %NULL associated device.
*/
device_props[PROP_ASSOCIATED_DEVICE] =
g_param_spec_object ("associated-device",
@ -187,7 +188,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
* GdkDevice:has-cursor:
*
* Whether the device is represented by a cursor on the screen. Devices of type
* %GDK_DEVICE_TYPE_MASTER will have %TRUE here.
* %GDK_DEVICE_TYPE_LOGICAL will have %TRUE here.
*/
device_props[PROP_HAS_CURSOR] =
g_param_spec_boolean ("has-cursor",
@ -333,11 +334,11 @@ gdk_device_class_init (GdkDeviceClass *klass)
*
* The ::changed signal is emitted either when the #GdkDevice
* has changed the number of either axes or keys. For example
* In X this will normally happen when the slave device routing
* events through the master device changes (for example, user
* switches from the USB mouse to a tablet), in that case the
* master device will change to reflect the new slave device
* axes and keys.
* on X11 this will normally happen when the physical device
* routing events through the logical device changes (for
* example, user switches from the USB mouse to a tablet); in
* that case the logical device will change to reflect the axes
* and keys on the new physical device.
*/
signals[CHANGED] =
g_signal_new (g_intern_static_string ("changed"),
@ -394,14 +395,14 @@ gdk_device_dispose (GObject *object)
GdkDevice *device = GDK_DEVICE (object);
GdkDevice *associated = device->associated;
if (associated && device->type == GDK_DEVICE_TYPE_SLAVE)
_gdk_device_remove_slave (associated, device);
if (associated && device->type == GDK_DEVICE_TYPE_PHYSICAL)
_gdk_device_remove_physical_device (associated, device);
if (associated)
{
device->associated = NULL;
if (device->type == GDK_DEVICE_TYPE_MASTER &&
if (device->type == GDK_DEVICE_TYPE_LOGICAL &&
associated->associated == device)
_gdk_device_set_associated_device (associated, NULL);
@ -539,21 +540,23 @@ gdk_device_get_property (GObject *object,
* the axes of @device in, or %NULL.
* @mask: (optional) (out): location to store the modifiers, or %NULL.
*
* Gets the current state of a pointer device relative to @surface. As a slave
* devices coordinates are those of its master pointer, this
* function may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
* unless there is an ongoing grab on them. See gdk_seat_grab().
* Gets the current state of a pointer device relative to @surface. As a
* physical devices coordinates are those of its logical pointer, this
* function may not be called on devices of type %GDK_DEVICE_TYPE_PHYSICAL,
* unless there is an ongoing grab on them.
*
* See also: gdk_seat_grab().
*/
void
gdk_device_get_state (GdkDevice *device,
GdkSurface *surface,
GdkSurface *surface,
gdouble *axes,
GdkModifierType *mask)
{
g_return_if_fail (GDK_IS_DEVICE (device));
g_return_if_fail (device->source != GDK_SOURCE_KEYBOARD);
g_return_if_fail (GDK_IS_SURFACE (surface));
g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE ||
g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_PHYSICAL ||
gdk_display_device_is_grabbed (gdk_device_get_display (device), device));
if (GDK_DEVICE_GET_CLASS (device)->get_state)
@ -575,7 +578,7 @@ gdk_device_get_position (GdkDevice *device,
{
g_return_if_fail (GDK_IS_DEVICE (device));
g_return_if_fail (device->source != GDK_SOURCE_KEYBOARD);
g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE ||
g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_PHYSICAL ||
gdk_display_device_is_grabbed (gdk_device_get_display (device), device));
_gdk_device_query_state (device, NULL, NULL, x, y, NULL);
@ -593,8 +596,8 @@ gdk_device_get_position (GdkDevice *device,
* double precision. Returns %NULL if the surface tree under @device is not known to GDK (for example,
* belongs to another application).
*
* As a slave device coordinates are those of its master pointer, This
* function may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
* As a physical device coordinates are those of its logical pointer, this
* function may not be called on devices of type %GDK_DEVICE_TYPE_PHYSICAL,
* unless there is an ongoing grab on them, see gdk_seat_grab().
*
* Returns: (nullable) (transfer none): the #GdkSurface under the
@ -610,7 +613,7 @@ gdk_device_get_surface_at_position (GdkDevice *device,
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
g_return_val_if_fail (device->source != GDK_SOURCE_KEYBOARD, NULL);
g_return_val_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE ||
g_return_val_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_PHYSICAL ||
gdk_display_device_is_grabbed (gdk_device_get_display (device), device), NULL);
surface = _gdk_device_surface_at_position (device, &tmp_x, &tmp_y, NULL);
@ -717,15 +720,14 @@ gdk_device_get_display (GdkDevice *device)
* gdk_device_get_associated_device:
* @device: a #GdkDevice
*
* Returns the associated device to @device, if @device is of type
* %GDK_DEVICE_TYPE_MASTER, it will return the paired pointer or
* keyboard.
* Returns the #GdkDevice associated to @device:
*
* If @device is of type %GDK_DEVICE_TYPE_SLAVE, it will return
* the master device to which @device is attached to.
*
* If @device is of type %GDK_DEVICE_TYPE_FLOATING, %NULL will be
* returned, as there is no associated device.
* - if @device is of type %GDK_DEVICE_TYPE_LOGICAL, it will return
* the paired pointer or keyboard.
* - if @device is of type %GDK_DEVICE_TYPE_PHYSICAL, it will return
* the logical device to which @device is attached to.
* - if @device is of type %GDK_DEVICE_TYPE_FLOATING, %NULL will be
* returned, as there is no associated device.
*
* Returns: (nullable) (transfer none): The associated device, or
* %NULL
@ -769,63 +771,59 @@ _gdk_device_set_associated_device (GdkDevice *device,
if (associated)
device->associated = g_object_ref (associated);
if (device->type != GDK_DEVICE_TYPE_MASTER)
if (device->type != GDK_DEVICE_TYPE_LOGICAL)
{
if (device->associated)
_gdk_device_set_device_type (device, GDK_DEVICE_TYPE_SLAVE);
_gdk_device_set_device_type (device, GDK_DEVICE_TYPE_PHYSICAL);
else
_gdk_device_set_device_type (device, GDK_DEVICE_TYPE_FLOATING);
}
}
/**
* gdk_device_list_slave_devices:
* @device: a #GdkDevice
* gdk_device_list_physical_devices:
* @device: a logical #GdkDevice
*
* If the device if of type %GDK_DEVICE_TYPE_MASTER, it will return
* the list of slave devices attached to it, otherwise it will return
* %NULL
* Returns the list of physical devices attached to the given logical
* #GdkDevice.
*
* Returns: (nullable) (transfer container) (element-type GdkDevice):
* the list of slave devices, or %NULL. The list must be
* freed with g_list_free(), the contents of the list are
* owned by GTK+ and should not be freed.
**/
* the list of physical devices attached to a logical #GdkDevice
*/
GList *
gdk_device_list_slave_devices (GdkDevice *device)
gdk_device_list_physical_devices (GdkDevice *device)
{
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
g_return_val_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_MASTER, NULL);
g_return_val_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_LOGICAL, NULL);
return g_list_copy (device->slaves);
return g_list_copy (device->physical_devices);
}
void
_gdk_device_add_slave (GdkDevice *device,
GdkDevice *slave)
_gdk_device_add_physical_device (GdkDevice *device,
GdkDevice *physical)
{
g_return_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_MASTER);
g_return_if_fail (gdk_device_get_device_type (slave) != GDK_DEVICE_TYPE_MASTER);
g_return_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_LOGICAL);
g_return_if_fail (gdk_device_get_device_type (physical) != GDK_DEVICE_TYPE_LOGICAL);
if (!g_list_find (device->slaves, slave))
device->slaves = g_list_prepend (device->slaves, slave);
if (!g_list_find (device->physical_devices, physical))
device->physical_devices = g_list_prepend (device->physical_devices, physical);
}
void
_gdk_device_remove_slave (GdkDevice *device,
GdkDevice *slave)
_gdk_device_remove_physical_device (GdkDevice *device,
GdkDevice *physical)
{
GList *elem;
g_return_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_MASTER);
g_return_if_fail (gdk_device_get_device_type (slave) != GDK_DEVICE_TYPE_MASTER);
g_return_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_LOGICAL);
g_return_if_fail (gdk_device_get_device_type (physical) != GDK_DEVICE_TYPE_LOGICAL);
elem = g_list_find (device->slaves, slave);
if (!elem)
elem = g_list_find (device->physical_devices, physical);
if (elem == NULL)
return;
device->slaves = g_list_delete_link (device->slaves, elem);
device->physical_devices = g_list_delete_link (device->physical_devices, elem);
}
/**
@ -839,7 +837,7 @@ _gdk_device_remove_slave (GdkDevice *device,
GdkDeviceType
gdk_device_get_device_type (GdkDevice *device)
{
g_return_val_if_fail (GDK_IS_DEVICE (device), GDK_DEVICE_TYPE_MASTER);
g_return_val_if_fail (GDK_IS_DEVICE (device), GDK_DEVICE_TYPE_LOGICAL);
return device->type;
}
@ -1315,7 +1313,7 @@ gdk_device_get_last_event_surface (GdkDevice *device)
/**
* gdk_device_get_vendor_id:
* @device: a slave #GdkDevice
* @device: a physical #GdkDevice
*
* Returns the vendor ID of this device, or %NULL if this information couldn't
* be obtained. This ID is retrieved from the device, and is thus constant for
@ -1350,14 +1348,14 @@ const gchar *
gdk_device_get_vendor_id (GdkDevice *device)
{
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
g_return_val_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_MASTER, NULL);
g_return_val_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_LOGICAL, NULL);
return device->vendor_id;
}
/**
* gdk_device_get_product_id:
* @device: a slave #GdkDevice
* @device: a physical #GdkDevice
*
* Returns the product ID of this device, or %NULL if this information couldn't
* be obtained. This ID is retrieved from the device, and is thus constant for
@ -1369,7 +1367,7 @@ const gchar *
gdk_device_get_product_id (GdkDevice *device)
{
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
g_return_val_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_MASTER, NULL);
g_return_val_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_LOGICAL, NULL);
return device->product_id;
}
@ -1424,7 +1422,7 @@ gdk_device_update_tool (GdkDevice *device,
GdkDeviceTool *tool)
{
g_return_if_fail (GDK_IS_DEVICE (device));
g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_MASTER);
g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_LOGICAL);
if (g_set_object (&device->last_tool, tool))
{

View File

@ -71,17 +71,17 @@ typedef enum
/**
* GdkDeviceType:
* @GDK_DEVICE_TYPE_MASTER: Device is a master (or virtual) device. There will
* be an associated focus indicator on the screen.
* @GDK_DEVICE_TYPE_SLAVE: Device is a slave (or physical) device.
* @GDK_DEVICE_TYPE_FLOATING: Device is a physical device, currently not attached to
* any seat.
* @GDK_DEVICE_TYPE_LOGICAL: Device is a logical device. There will
* be an associated focus indicator on the screen.
* @GDK_DEVICE_TYPE_PHYSICAL: Device is a physical device.
* @GDK_DEVICE_TYPE_FLOATING: Device is a physical device, currently
* not attached to any seat.
*
* Indicates the device type.
*/
typedef enum {
GDK_DEVICE_TYPE_MASTER,
GDK_DEVICE_TYPE_SLAVE,
GDK_DEVICE_TYPE_LOGICAL,
GDK_DEVICE_TYPE_PHYSICAL,
GDK_DEVICE_TYPE_FLOATING
} GdkDeviceType;
@ -141,7 +141,7 @@ GdkDisplay * gdk_device_get_display (GdkDevice *device);
GDK_AVAILABLE_IN_ALL
GdkDevice * gdk_device_get_associated_device (GdkDevice *device);
GDK_AVAILABLE_IN_ALL
GList * gdk_device_list_slave_devices (GdkDevice *device);
GList * gdk_device_list_physical_devices (GdkDevice *device);
GDK_AVAILABLE_IN_ALL
GdkDeviceType gdk_device_get_device_type (GdkDevice *device);

View File

@ -41,11 +41,11 @@ struct _GdkDevice
gboolean has_cursor;
GdkAxisFlags axis_flags;
GdkDisplay *display;
/* Paired master for master,
* associated master for slaves
/* The paired logical device for logical devices,
* or the associated logical device for physical ones
*/
GdkDevice *associated;
GList *slaves;
GList *physical_devices;
GdkDeviceType type;
GArray *axes;
guint num_touches;
@ -132,10 +132,11 @@ gboolean _gdk_device_translate_axis (GdkDevice *device,
GdkTimeCoord ** _gdk_device_allocate_history (GdkDevice *device,
gint n_events);
void _gdk_device_add_slave (GdkDevice *device,
GdkDevice *slave);
void _gdk_device_remove_slave (GdkDevice *device,
GdkDevice *slave);
void _gdk_device_add_physical_device (GdkDevice *device,
GdkDevice *physical);
void _gdk_device_remove_physical_device (GdkDevice *device,
GdkDevice *physical);
void _gdk_device_query_state (GdkDevice *device,
GdkSurface *surface,
GdkSurface **child_surface,

View File

@ -643,12 +643,12 @@ switch_to_pointer_grab (GdkDisplay *display,
if (grab == NULL /* ungrab */ ||
(!last_grab->owner_events && grab->owner_events) /* switched to owner_events */ )
{
/* Ungrabbed slave devices don't have a position by
* itself, rather depend on its master pointer, so
/* Ungrabbed physical devices don't have a position by
* itself, rather depend on its logical pointer, so
* it doesn't make sense to track any position for
* these after the grab
*/
if (grab || gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE)
if (grab || gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_PHYSICAL)
new_toplevel = get_current_toplevel (display, device, &x, &y, &state);
if (new_toplevel)

View File

@ -66,7 +66,7 @@ typedef struct
gdouble toplevel_x, toplevel_y;
guint32 state;
guint32 button;
GdkDevice *last_slave;
GdkDevice *last_physical_device;
} GdkPointerSurfaceInfo;
struct _GdkDisplay

View File

@ -1205,9 +1205,9 @@ gdk_event_get_device (GdkEvent *event)
* gdk_event_get_source_device:
* @event: a #GdkEvent
*
* This function returns the hardware (slave) #GdkDevice that has
* triggered the event, falling back to the virtual (master) device
* (as in gdk_event_get_device()) if the event wasnt caused by
* This function returns the physical #GdkDevice that has triggered
* the event, falling back to the logical device, as returned by
* gdk_event_get_device(), if the event wasnt caused by
* interaction with a hardware device. This may happen for example
* in synthesized crossing events after a #GdkSurface updates its
* geometry or a grab is acquired/released.

View File

@ -323,35 +323,35 @@ gdk_seat_ungrab (GdkSeat *seat)
}
/**
* gdk_seat_get_slaves:
* gdk_seat_get_physical_devices:
* @seat: a #GdkSeat
* @capabilities: capabilities to get devices for
*
* Returns the slave devices that match the given capabilities.
* Returns the physical devices that match the given capabilities.
*
* Returns: (transfer container) (element-type GdkDevice): A list of #GdkDevices.
* The list must be freed with g_list_free(), the elements are owned
* by GDK and must not be freed.
**/
GList *
gdk_seat_get_slaves (GdkSeat *seat,
GdkSeatCapabilities capabilities)
gdk_seat_get_physical_devices (GdkSeat *seat,
GdkSeatCapabilities capabilities)
{
GdkSeatClass *seat_class;
g_return_val_if_fail (GDK_IS_SEAT (seat), NULL);
seat_class = GDK_SEAT_GET_CLASS (seat);
return seat_class->get_slaves (seat, capabilities);
return seat_class->get_physical_devices (seat, capabilities);
}
/**
* gdk_seat_get_pointer:
* @seat: a #GdkSeat
*
* Returns the master device that routes pointer events.
* Returns the logical device that routes pointer events.
*
* Returns: (transfer none) (nullable): a master #GdkDevice with pointer
* Returns: (transfer none) (nullable): a logical #GdkDevice with pointer
* capabilities. This object is owned by GTK and must not be freed.
**/
GdkDevice *
@ -362,16 +362,16 @@ gdk_seat_get_pointer (GdkSeat *seat)
g_return_val_if_fail (GDK_IS_SEAT (seat), NULL);
seat_class = GDK_SEAT_GET_CLASS (seat);
return seat_class->get_master (seat, GDK_SEAT_CAPABILITY_POINTER);
return seat_class->get_logical_device (seat, GDK_SEAT_CAPABILITY_POINTER);
}
/**
* gdk_seat_get_keyboard:
* @seat: a #GdkSeat
*
* Returns the master device that routes keyboard events.
* Returns the logical device that routes keyboard events.
*
* Returns: (transfer none) (nullable): a master #GdkDevice with keyboard
* Returns: (transfer none) (nullable): a logical #GdkDevice with keyboard
* capabilities. This object is owned by GTK and must not be freed.
**/
GdkDevice *
@ -382,7 +382,7 @@ gdk_seat_get_keyboard (GdkSeat *seat)
g_return_val_if_fail (GDK_IS_SEAT (seat), NULL);
seat_class = GDK_SEAT_GET_CLASS (seat);
return seat_class->get_master (seat, GDK_SEAT_CAPABILITY_KEYBOARD);
return seat_class->get_logical_device (seat, GDK_SEAT_CAPABILITY_KEYBOARD);
}
void
@ -448,25 +448,29 @@ gdk_seat_get_tool (GdkSeat *seat,
}
/**
* gdk_seat_get_master_pointers:
* gdk_seat_get_logical_pointers:
* @seat: The #GdkSeat
* @capabilities: Queried capabilities
*
* Returns all master pointers with the given capabilities driven by this @seat.
* On most backends this function will return a list with a single element (meaning
* that all input devices drive the same onscreen cursor).
* Returns all logical pointers with the given capabilities driven by
* this @seat.
*
* In other backends where there can possibly be multiple foci (eg. wayland),
* this function will return all master #GdkDevices that represent these.
* On most windowing system backends this function will return a list
* with a single element (meaning that all input devices drive the same
* on-screen cursor).
*
* In other windowing systems where there can possibly be multiple
* foci (e.g. Wayland), this function will return all logical #GdkDevices
* that represent these.
*
* Returns: (transfer container) (element-type GdkDevice): A list
* of master pointing devices
* of logical pointing devices
*/
GList *
gdk_seat_get_master_pointers (GdkSeat *seat,
GdkSeatCapabilities capabilities)
gdk_seat_get_logical_pointers (GdkSeat *seat,
GdkSeatCapabilities capabilities)
{
g_return_val_if_fail (GDK_IS_SEAT (seat), NULL);
return GDK_SEAT_GET_CLASS (seat)->get_master_pointers (seat, capabilities);
return GDK_SEAT_GET_CLASS (seat)->get_logical_pointers (seat, capabilities);
}

View File

@ -68,24 +68,24 @@ GDK_AVAILABLE_IN_ALL
GType gdk_seat_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GdkDisplay * gdk_seat_get_display (GdkSeat *seat);
GdkDisplay * gdk_seat_get_display (GdkSeat *seat);
GDK_AVAILABLE_IN_ALL
GdkSeatCapabilities
gdk_seat_get_capabilities (GdkSeat *seat);
gdk_seat_get_capabilities (GdkSeat *seat);
GDK_AVAILABLE_IN_ALL
GList * gdk_seat_get_slaves (GdkSeat *seat,
GdkSeatCapabilities capabilities);
GList * gdk_seat_get_physical_devices (GdkSeat *seat,
GdkSeatCapabilities capabilities);
GDK_AVAILABLE_IN_ALL
GdkDevice * gdk_seat_get_pointer (GdkSeat *seat);
GdkDevice * gdk_seat_get_pointer (GdkSeat *seat);
GDK_AVAILABLE_IN_ALL
GdkDevice * gdk_seat_get_keyboard (GdkSeat *seat);
GdkDevice * gdk_seat_get_keyboard (GdkSeat *seat);
GDK_AVAILABLE_IN_ALL
GList * gdk_seat_get_master_pointers (GdkSeat *seat,
GdkSeatCapabilities capabilities);
GList * gdk_seat_get_logical_pointers (GdkSeat *seat,
GdkSeatCapabilities capabilities);
G_END_DECLS

View File

@ -25,10 +25,10 @@ typedef struct _GdkSeatDefaultPrivate GdkSeatDefaultPrivate;
struct _GdkSeatDefaultPrivate
{
GdkDevice *master_pointer;
GdkDevice *master_keyboard;
GList *slave_pointers;
GList *slave_keyboards;
GdkDevice *logical_pointer;
GdkDevice *logical_keyboard;
GList *physical_pointers;
GList *physical_keyboards;
GdkSeatCapabilities capabilities;
GPtrArray *tools;
@ -55,25 +55,25 @@ gdk_seat_dispose (GObject *object)
GdkSeatDefaultPrivate *priv = gdk_seat_default_get_instance_private (seat);
GList *l;
if (priv->master_pointer)
if (priv->logical_pointer)
{
gdk_seat_device_removed (GDK_SEAT (seat), priv->master_pointer);
g_clear_object (&priv->master_pointer);
gdk_seat_device_removed (GDK_SEAT (seat), priv->logical_pointer);
g_clear_object (&priv->logical_pointer);
}
if (priv->master_keyboard)
if (priv->logical_keyboard)
{
gdk_seat_device_removed (GDK_SEAT (seat), priv->master_keyboard);
g_clear_object (&priv->master_pointer);
gdk_seat_device_removed (GDK_SEAT (seat), priv->logical_keyboard);
g_clear_object (&priv->logical_pointer);
}
for (l = priv->slave_pointers; l; l = l->next)
for (l = priv->physical_pointers; l; l = l->next)
{
gdk_seat_device_removed (GDK_SEAT (seat), l->data);
g_object_unref (l->data);
}
for (l = priv->slave_keyboards; l; l = l->next)
for (l = priv->physical_keyboards; l; l = l->next)
{
gdk_seat_device_removed (GDK_SEAT (seat), l->data);
g_object_unref (l->data);
@ -85,10 +85,10 @@ gdk_seat_dispose (GObject *object)
priv->tools = NULL;
}
g_list_free (priv->slave_pointers);
g_list_free (priv->slave_keyboards);
priv->slave_pointers = NULL;
priv->slave_keyboards = NULL;
g_list_free (priv->physical_pointers);
g_list_free (priv->physical_keyboards);
priv->physical_pointers = NULL;
priv->physical_keyboards = NULL;
G_OBJECT_CLASS (gdk_seat_default_parent_class)->dispose (object);
}
@ -148,7 +148,7 @@ gdk_seat_default_grab (GdkSeat *seat,
if (capabilities & GDK_SEAT_CAPABILITY_TOUCH)
pointer_evmask |= TOUCH_EVENTS;
status = gdk_device_grab (priv->master_pointer, surface,
status = gdk_device_grab (priv->logical_pointer, surface,
GDK_OWNERSHIP_NONE, owner_events,
pointer_evmask, cursor,
evtime);
@ -157,7 +157,7 @@ gdk_seat_default_grab (GdkSeat *seat,
if (status == GDK_GRAB_SUCCESS &&
capabilities & GDK_SEAT_CAPABILITY_KEYBOARD)
{
status = gdk_device_grab (priv->master_keyboard, surface,
status = gdk_device_grab (priv->logical_keyboard, surface,
GDK_OWNERSHIP_NONE, owner_events,
KEYBOARD_EVENTS, cursor,
evtime);
@ -165,7 +165,7 @@ gdk_seat_default_grab (GdkSeat *seat,
if (status != GDK_GRAB_SUCCESS)
{
if (capabilities & ~GDK_SEAT_CAPABILITY_KEYBOARD)
gdk_device_ungrab (priv->master_pointer, evtime);
gdk_device_ungrab (priv->logical_pointer, evtime);
}
}
@ -185,14 +185,14 @@ gdk_seat_default_ungrab (GdkSeat *seat)
priv = gdk_seat_default_get_instance_private (GDK_SEAT_DEFAULT (seat));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gdk_device_ungrab (priv->master_pointer, GDK_CURRENT_TIME);
gdk_device_ungrab (priv->master_keyboard, GDK_CURRENT_TIME);
gdk_device_ungrab (priv->logical_pointer, GDK_CURRENT_TIME);
gdk_device_ungrab (priv->logical_keyboard, GDK_CURRENT_TIME);
G_GNUC_END_IGNORE_DEPRECATIONS;
}
static GdkDevice *
gdk_seat_default_get_master (GdkSeat *seat,
GdkSeatCapabilities capability)
gdk_seat_default_get_logical_device (GdkSeat *seat,
GdkSeatCapabilities capability)
{
GdkSeatDefaultPrivate *priv;
@ -203,9 +203,9 @@ gdk_seat_default_get_master (GdkSeat *seat,
{
case GDK_SEAT_CAPABILITY_POINTER:
case GDK_SEAT_CAPABILITY_TOUCH:
return priv->master_pointer;
return priv->logical_pointer;
case GDK_SEAT_CAPABILITY_KEYBOARD:
return priv->master_keyboard;
return priv->logical_keyboard;
default:
g_warning ("Unhandled capability %x", capability);
break;
@ -264,8 +264,8 @@ append_filtered (GList *list,
}
static GList *
gdk_seat_default_get_slaves (GdkSeat *seat,
GdkSeatCapabilities capabilities)
gdk_seat_default_get_physical_devices (GdkSeat *seat,
GdkSeatCapabilities capabilities)
{
GdkSeatDefaultPrivate *priv;
GList *devices = NULL;
@ -273,10 +273,10 @@ gdk_seat_default_get_slaves (GdkSeat *seat,
priv = gdk_seat_default_get_instance_private (GDK_SEAT_DEFAULT (seat));
if (capabilities & (GDK_SEAT_CAPABILITY_ALL_POINTING))
devices = append_filtered (devices, priv->slave_pointers, capabilities);
devices = append_filtered (devices, priv->physical_pointers, capabilities);
if (capabilities & (GDK_SEAT_CAPABILITY_KEYBOARD | GDK_SEAT_CAPABILITY_TABLET_PAD))
devices = append_filtered (devices, priv->slave_keyboards, capabilities);
devices = append_filtered (devices, priv->physical_keyboards, capabilities);
return devices;
}
@ -307,15 +307,15 @@ gdk_seat_default_get_tool (GdkSeat *seat,
}
static GList *
gdk_seat_default_get_master_pointers (GdkSeat *seat,
gdk_seat_default_get_logical_pointers (GdkSeat *seat,
GdkSeatCapabilities capabilities)
{
GList *masters = NULL;
GList *pointers = NULL;
if (capabilities & GDK_SEAT_CAPABILITY_ALL_POINTING)
masters = g_list_prepend (masters, gdk_seat_get_pointer (seat));
pointers = g_list_prepend (pointers, gdk_seat_get_pointer (seat));
return masters;
return pointers;
}
static void
@ -331,9 +331,9 @@ gdk_seat_default_class_init (GdkSeatDefaultClass *klass)
seat_class->grab = gdk_seat_default_grab;
seat_class->ungrab = gdk_seat_default_ungrab;
seat_class->get_master = gdk_seat_default_get_master;
seat_class->get_slaves = gdk_seat_default_get_slaves;
seat_class->get_master_pointers = gdk_seat_default_get_master_pointers;
seat_class->get_logical_device = gdk_seat_default_get_logical_device;
seat_class->get_physical_devices = gdk_seat_default_get_physical_devices;
seat_class->get_logical_pointers = gdk_seat_default_get_logical_pointers;
seat_class->get_tool = gdk_seat_default_get_tool;
}
@ -344,8 +344,8 @@ gdk_seat_default_init (GdkSeatDefault *seat)
}
GdkSeat *
gdk_seat_default_new_for_master_pair (GdkDevice *pointer,
GdkDevice *keyboard)
gdk_seat_default_new_for_logical_pair (GdkDevice *pointer,
GdkDevice *keyboard)
{
GdkSeatDefaultPrivate *priv;
GdkDisplay *display;
@ -358,18 +358,18 @@ gdk_seat_default_new_for_master_pair (GdkDevice *pointer,
NULL);
priv = gdk_seat_default_get_instance_private (GDK_SEAT_DEFAULT (seat));
priv->master_pointer = g_object_ref (pointer);
priv->master_keyboard = g_object_ref (keyboard);
priv->logical_pointer = g_object_ref (pointer);
priv->logical_keyboard = g_object_ref (keyboard);
gdk_seat_device_added (seat, priv->master_pointer);
gdk_seat_device_added (seat, priv->master_keyboard);
gdk_seat_device_added (seat, priv->logical_pointer);
gdk_seat_device_added (seat, priv->logical_keyboard);
return seat;
}
void
gdk_seat_default_add_slave (GdkSeatDefault *seat,
GdkDevice *device)
gdk_seat_default_add_physical_device (GdkSeatDefault *seat,
GdkDevice *device)
{
GdkSeatDefaultPrivate *priv;
GdkSeatCapabilities capability;
@ -381,9 +381,9 @@ gdk_seat_default_add_slave (GdkSeatDefault *seat,
capability = device_get_capability (device);
if (capability & GDK_SEAT_CAPABILITY_ALL_POINTING)
priv->slave_pointers = g_list_prepend (priv->slave_pointers, g_object_ref (device));
priv->physical_pointers = g_list_prepend (priv->physical_pointers, g_object_ref (device));
else if (capability & (GDK_SEAT_CAPABILITY_KEYBOARD | GDK_SEAT_CAPABILITY_TABLET_PAD))
priv->slave_keyboards = g_list_prepend (priv->slave_keyboards, g_object_ref (device));
priv->physical_keyboards = g_list_prepend (priv->physical_keyboards, g_object_ref (device));
else
{
g_critical ("Unhandled capability %x for device '%s'",
@ -397,8 +397,8 @@ gdk_seat_default_add_slave (GdkSeatDefault *seat,
}
void
gdk_seat_default_remove_slave (GdkSeatDefault *seat,
GdkDevice *device)
gdk_seat_default_remove_physical_device (GdkSeatDefault *seat,
GdkDevice *device)
{
GdkSeatDefaultPrivate *priv;
GList *l;
@ -408,23 +408,23 @@ gdk_seat_default_remove_slave (GdkSeatDefault *seat,
priv = gdk_seat_default_get_instance_private (seat);
if (g_list_find (priv->slave_pointers, device))
if (g_list_find (priv->physical_pointers, device))
{
priv->slave_pointers = g_list_remove (priv->slave_pointers, device);
priv->physical_pointers = g_list_remove (priv->physical_pointers, device);
priv->capabilities &= ~(GDK_SEAT_CAPABILITY_ALL_POINTING);
for (l = priv->slave_pointers; l; l = l->next)
for (l = priv->physical_pointers; l; l = l->next)
priv->capabilities |= device_get_capability (GDK_DEVICE (l->data));
gdk_seat_device_removed (GDK_SEAT (seat), device);
g_object_unref (device);
}
else if (g_list_find (priv->slave_keyboards, device))
else if (g_list_find (priv->physical_keyboards, device))
{
priv->slave_keyboards = g_list_remove (priv->slave_keyboards, device);
priv->physical_keyboards = g_list_remove (priv->physical_keyboards, device);
priv->capabilities &= ~(GDK_SEAT_CAPABILITY_KEYBOARD | GDK_SEAT_CAPABILITY_TABLET_PAD);
for (l = priv->slave_keyboards; l; l = l->next)
for (l = priv->physical_keyboards; l; l = l->next)
priv->capabilities |= device_get_capability (GDK_DEVICE (l->data));
gdk_seat_device_removed (GDK_SEAT (seat), device);

View File

@ -23,6 +23,8 @@
#include "gdkseat.h"
#include "gdkseatprivate.h"
G_BEGIN_DECLS
#define GDK_TYPE_SEAT_DEFAULT (gdk_seat_default_get_type ())
#define GDK_SEAT_DEFAULT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_SEAT_DEFAULT, GdkSeatDefault))
#define GDK_IS_SEAT_DEFAULT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_SEAT_DEFAULT))
@ -45,16 +47,18 @@ struct _GdkSeatDefaultClass
GType gdk_seat_default_get_type (void) G_GNUC_CONST;
GdkSeat * gdk_seat_default_new_for_master_pair (GdkDevice *pointer,
GdkDevice *keyboard);
GdkSeat * gdk_seat_default_new_for_logical_pair (GdkDevice *pointer,
GdkDevice *keyboard);
void gdk_seat_default_add_slave (GdkSeatDefault *seat,
GdkDevice *device);
void gdk_seat_default_remove_slave (GdkSeatDefault *seat,
GdkDevice *device);
void gdk_seat_default_add_tool (GdkSeatDefault *seat,
GdkDeviceTool *tool);
void gdk_seat_default_remove_tool (GdkSeatDefault *seat,
GdkDeviceTool *tool);
void gdk_seat_default_add_physical_device (GdkSeatDefault *seat,
GdkDevice *device);
void gdk_seat_default_remove_physical_device (GdkSeatDefault *seat,
GdkDevice *device);
void gdk_seat_default_add_tool (GdkSeatDefault *seat,
GdkDeviceTool *tool);
void gdk_seat_default_remove_tool (GdkSeatDefault *seat,
GdkDeviceTool *tool);
G_END_DECLS
#endif /* __GDK_SEAT_DEFAULT_PRIVATE_H__ */

View File

@ -52,16 +52,16 @@ struct _GdkSeatClass
gpointer prepare_func_data);
void (* ungrab) (GdkSeat *seat);
GdkDevice * (* get_master) (GdkSeat *seat,
GdkSeatCapabilities capability);
GList * (* get_slaves) (GdkSeat *seat,
GdkSeatCapabilities capabilities);
GdkDevice * (* get_logical_device) (GdkSeat *seat,
GdkSeatCapabilities capability);
GList * (* get_physical_devices) (GdkSeat *seat,
GdkSeatCapabilities capabilities);
GdkDeviceTool * (* get_tool) (GdkSeat *seat,
guint64 serial,
guint64 tool_id);
GList * (* get_master_pointers) (GdkSeat *seat,
GdkSeatCapabilities capabilities);
GList * (* get_logical_pointers) (GdkSeat *seat,
GdkSeatCapabilities capabilities);
};
void gdk_seat_device_added (GdkSeat *seat,

View File

@ -1762,7 +1762,7 @@ gdk_surface_hide (GdkSurface *surface)
seat = gdk_display_get_default_seat (display);
if (seat)
{
devices = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_ALL);
devices = gdk_seat_get_physical_devices (seat, GDK_SEAT_CAPABILITY_ALL);
devices = g_list_prepend (devices, gdk_seat_get_keyboard (seat));
devices = g_list_prepend (devices, gdk_seat_get_pointer (seat));
}
@ -1880,7 +1880,7 @@ gdk_surface_set_cursor (GdkSurface *surface,
device = gdk_seat_get_pointer (s->data);
gdk_surface_set_cursor_internal (surface, device, surface->cursor);
devices = gdk_seat_get_slaves (s->data, GDK_SEAT_CAPABILITY_TABLET_STYLUS);
devices = gdk_seat_get_physical_devices (s->data, GDK_SEAT_CAPABILITY_TABLET_STYLUS);
for (d = devices; d; d = d->next)
{
device = gdk_device_get_associated_device (d->data);
@ -1897,7 +1897,7 @@ gdk_surface_set_cursor (GdkSurface *surface,
/**
* gdk_surface_get_device_cursor:
* @surface: a #GdkSurface.
* @device: a master, pointer #GdkDevice.
* @device: a logical, pointer #GdkDevice.
*
* Retrieves a #GdkCursor pointer for the @device currently set on the
* specified #GdkSurface, or %NULL. If the return value is %NULL then
@ -1916,7 +1916,7 @@ gdk_surface_get_device_cursor (GdkSurface *surface,
g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
g_return_val_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_MASTER, NULL);
g_return_val_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_LOGICAL, NULL);
return g_hash_table_lookup (surface->device_cursor, device);
}
@ -1924,7 +1924,7 @@ gdk_surface_get_device_cursor (GdkSurface *surface,
/**
* gdk_surface_set_device_cursor:
* @surface: a #GdkSurface
* @device: a master, pointer #GdkDevice
* @device: a logical, pointer #GdkDevice
* @cursor: a #GdkCursor
*
* Sets a specific #GdkCursor for a given device when it gets inside @surface.
@ -1942,7 +1942,7 @@ gdk_surface_set_device_cursor (GdkSurface *surface,
g_return_if_fail (GDK_IS_SURFACE (surface));
g_return_if_fail (GDK_IS_DEVICE (device));
g_return_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD);
g_return_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_MASTER);
g_return_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_LOGICAL);
if (!cursor)
g_hash_table_remove (surface->device_cursor, device);
@ -2284,11 +2284,11 @@ _gdk_windowing_got_event (GdkDisplay *display,
{
pointer_info = _gdk_display_get_pointer_info (display, device);
if (source_device != pointer_info->last_slave &&
gdk_device_get_device_type (source_device) == GDK_DEVICE_TYPE_SLAVE)
pointer_info->last_slave = source_device;
else if (pointer_info->last_slave)
source_device = pointer_info->last_slave;
if (source_device != pointer_info->last_physical_device &&
gdk_device_get_device_type (source_device) == GDK_DEVICE_TYPE_PHYSICAL)
pointer_info->last_physical_device = source_device;
else if (pointer_info->last_physical_device)
source_device = pointer_info->last_physical_device;
}
_gdk_display_device_grab_update (display, device, source_device, serial);

View File

@ -54,7 +54,7 @@ create_core_pointer (GdkQuartzDeviceManagerCore *device_manager,
{
return g_object_new (GDK_TYPE_QUARTZ_DEVICE_CORE,
"name", "Core Pointer",
"type", GDK_DEVICE_TYPE_MASTER,
"type", GDK_DEVICE_TYPE_LOGICAL,
"input-source", GDK_SOURCE_MOUSE,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", TRUE,
@ -69,7 +69,7 @@ create_core_keyboard (GdkQuartzDeviceManagerCore *device_manager,
{
return g_object_new (GDK_TYPE_QUARTZ_DEVICE_CORE,
"name", "Core Keyboard",
"type", GDK_DEVICE_TYPE_MASTER,
"type", GDK_DEVICE_TYPE_LOGICAL,
"input-source", GDK_SOURCE_KEYBOARD,
"input-mode", GDK_MODE_SCREEN,
"has-cursor", FALSE,
@ -112,8 +112,8 @@ gdk_quartz_device_manager_core_constructed (GObject *object)
_gdk_device_set_associated_device (device_manager->core_pointer, device_manager->core_keyboard);
_gdk_device_set_associated_device (device_manager->core_keyboard, device_manager->core_pointer);
seat = gdk_seat_default_new_for_master_pair (device_manager->core_pointer,
device_manager->core_keyboard);
seat = gdk_seat_default_new_for_logical_pair (device_manager->core_pointer,
device_manager->core_keyboard);
gdk_display_add_seat (display, seat);
g_object_unref (seat);
}

File diff suppressed because it is too large Load Diff

View File

@ -147,7 +147,7 @@ gdk_device_win32_grab (GdkDevice *device,
GdkCursor *cursor,
guint32 time_)
{
/* No support for grabbing the slave atm */
/* No support for grabbing physical devices atm */
return GDK_GRAB_NOT_VIEWABLE;
}

View File

@ -80,7 +80,7 @@ create_pointer (GdkDeviceManagerWin32 *device_manager,
"name", name,
"type", type,
"source", GDK_SOURCE_MOUSE,
"has-cursor", type == GDK_DEVICE_TYPE_MASTER,
"has-cursor", type == GDK_DEVICE_TYPE_LOGICAL,
"display", _gdk_display,
NULL);
}
@ -565,7 +565,7 @@ wintab_init_check (GdkDeviceManagerWin32 *device_manager)
if (device->sends_core)
{
_gdk_device_set_associated_device (device_manager->system_pointer, GDK_DEVICE (device));
_gdk_device_add_slave (device_manager->core_pointer, GDK_DEVICE (device));
_gdk_device_add_physical_device (device_manager->core_pointer, GDK_DEVICE (device));
}
g_free (csrname_utf8);
@ -693,40 +693,40 @@ gdk_device_manager_win32_constructed (GObject *object)
create_pointer (device_manager,
GDK_TYPE_DEVICE_VIRTUAL,
"Virtual Core Pointer",
GDK_DEVICE_TYPE_MASTER);
GDK_DEVICE_TYPE_LOGICAL);
device_manager->system_pointer =
create_pointer (device_manager,
GDK_TYPE_DEVICE_WIN32,
"System Aggregated Pointer",
GDK_DEVICE_TYPE_SLAVE);
GDK_DEVICE_TYPE_PHYSICAL);
_gdk_device_virtual_set_active (device_manager->core_pointer,
device_manager->system_pointer);
_gdk_device_set_associated_device (device_manager->system_pointer, device_manager->core_pointer);
_gdk_device_add_slave (device_manager->core_pointer, device_manager->system_pointer);
_gdk_device_add_physical_device (device_manager->core_pointer, device_manager->system_pointer);
device_manager->core_keyboard =
create_keyboard (device_manager,
GDK_TYPE_DEVICE_VIRTUAL,
"Virtual Core Keyboard",
GDK_DEVICE_TYPE_MASTER);
GDK_DEVICE_TYPE_LOGICAL);
device_manager->system_keyboard =
create_keyboard (device_manager,
GDK_TYPE_DEVICE_WIN32,
"System Aggregated Keyboard",
GDK_DEVICE_TYPE_SLAVE);
GDK_DEVICE_TYPE_PHYSICAL);
_gdk_device_virtual_set_active (device_manager->core_keyboard,
device_manager->system_keyboard);
_gdk_device_set_associated_device (device_manager->system_keyboard, device_manager->core_keyboard);
_gdk_device_add_slave (device_manager->core_keyboard, device_manager->system_keyboard);
_gdk_device_add_physical_device (device_manager->core_keyboard, device_manager->system_keyboard);
_gdk_device_set_associated_device (device_manager->core_pointer, device_manager->core_keyboard);
_gdk_device_set_associated_device (device_manager->core_keyboard, device_manager->core_pointer);
seat = gdk_seat_default_new_for_master_pair (device_manager->core_pointer,
device_manager->core_keyboard);
seat = gdk_seat_default_new_for_logical_pair (device_manager->core_pointer,
device_manager->core_keyboard);
gdk_display_add_seat (_gdk_display, seat);
gdk_seat_default_add_slave (GDK_SEAT_DEFAULT (seat), device_manager->system_pointer);
gdk_seat_default_add_slave (GDK_SEAT_DEFAULT (seat), device_manager->system_keyboard);
gdk_seat_default_add_physical_device (GDK_SEAT_DEFAULT (seat), device_manager->system_pointer);
gdk_seat_default_add_physical_device (GDK_SEAT_DEFAULT (seat), device_manager->system_keyboard);
g_object_unref (seat);
/* Only call Wintab init stuff after the default display

View File

@ -34,10 +34,10 @@ struct _GdkDeviceManagerWin32
{
GObject parent_object;
GdkDisplay *display;
/* Master Devices */
/* Logical Devices */
GdkDevice *core_pointer;
GdkDevice *core_keyboard;
/* Fake slave devices */
/* Fake physical devices */
GdkDevice *system_pointer;
GdkDevice *system_keyboard;
GList *wintab_devices;

View File

@ -266,8 +266,8 @@ gdk_x11_device_xi2_set_surface_cursor (GdkDevice *device,
{
GdkX11DeviceXI2 *device_xi2 = GDK_X11_DEVICE_XI2 (device);
/* Non-master devices don't have a cursor */
if (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_MASTER)
/* Non-logical devices don't have a cursor */
if (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_LOGICAL)
return;
if (cursor)
@ -312,12 +312,12 @@ gdk_x11_device_xi2_query_state (GdkDevice *device,
scale = GDK_X11_SURFACE (surface)->surface_scale;
}
if (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_SLAVE)
if (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_PHYSICAL)
{
GdkDevice *master = gdk_device_get_associated_device (device);
GdkDevice *logical = gdk_device_get_associated_device (device);
if (master)
_gdk_device_query_state (master, surface, child_surface,
if (logical != NULL)
_gdk_device_query_state (logical, surface, child_surface,
win_x, win_y, mask);
return;
}

View File

@ -518,11 +518,11 @@ create_device (GdkX11DeviceManagerXI2 *device_manager,
{
case XIMasterKeyboard:
case XIMasterPointer:
type = GDK_DEVICE_TYPE_MASTER;
type = GDK_DEVICE_TYPE_LOGICAL;
break;
case XISlaveKeyboard:
case XISlavePointer:
type = GDK_DEVICE_TYPE_SLAVE;
type = GDK_DEVICE_TYPE_PHYSICAL;
break;
case XIFloatingSlave:
default:
@ -532,7 +532,7 @@ create_device (GdkX11DeviceManagerXI2 *device_manager,
GDK_DISPLAY_NOTE (display, INPUT,
({
const gchar *type_names[] = { "master", "slave", "floating" };
const gchar *type_names[] = { "logical", "physical", "floating" };
const gchar *source_names[] = { "mouse", "pen", "eraser", "cursor", "keyboard", "direct touch", "indirect touch", "trackpoint", "pad" };
g_message ("input device:\n\tname: %s\n\ttype: %s\n\tsource: %s\n\thas cursor: %d\n\ttouches: %d",
dev->name,
@ -590,7 +590,7 @@ ensure_seat_for_device_pair (GdkX11DeviceManagerXI2 *device_manager,
keyboard = device2;
}
seat = gdk_seat_default_new_for_master_pair (pointer, keyboard);
seat = gdk_seat_default_new_for_logical_pair (pointer, keyboard);
gdk_display_add_seat (display, seat);
g_object_unref (seat);
}
@ -617,20 +617,20 @@ add_device (GdkX11DeviceManagerXI2 *device_manager,
{
if (dev->use == XISlavePointer || dev->use == XISlaveKeyboard)
{
GdkDevice *master;
GdkDevice *logical;
GdkSeat *seat;
/* The device manager is already constructed, then
* keep the hierarchy coherent for the added device.
*/
master = g_hash_table_lookup (device_manager->id_table,
GINT_TO_POINTER (dev->attachment));
logical = g_hash_table_lookup (device_manager->id_table,
GINT_TO_POINTER (dev->attachment));
_gdk_device_set_associated_device (device, master);
_gdk_device_add_slave (master, device);
_gdk_device_set_associated_device (device, logical);
_gdk_device_add_physical_device (logical, device);
seat = gdk_device_get_seat (master);
gdk_seat_default_add_slave (GDK_SEAT_DEFAULT (seat), device);
seat = gdk_device_get_seat (logical);
gdk_seat_default_add_physical_device (GDK_SEAT_DEFAULT (seat), device);
}
else if (dev->use == XIMasterPointer || dev->use == XIMasterKeyboard)
{
@ -659,10 +659,10 @@ detach_from_seat (GdkDevice *device)
if (!seat)
return;
if (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_MASTER)
if (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_LOGICAL)
gdk_display_remove_seat (gdk_device_get_display (device), seat);
else if (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_SLAVE)
gdk_seat_default_remove_slave (GDK_SEAT_DEFAULT (seat), device);
else if (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_PHYSICAL)
gdk_seat_default_remove_physical_device (GDK_SEAT_DEFAULT (seat), device);
}
static void
@ -688,9 +688,9 @@ remove_device (GdkX11DeviceManagerXI2 *device_manager,
}
static void
relate_masters (gpointer key,
gpointer value,
gpointer user_data)
relate_logical_devices (gpointer key,
gpointer value,
gpointer user_data)
{
GdkX11DeviceManagerXI2 *device_manager;
GdkDevice *device, *relative;
@ -705,23 +705,23 @@ relate_masters (gpointer key,
}
static void
relate_slaves (gpointer key,
gpointer value,
gpointer user_data)
relate_physical_devices (gpointer key,
gpointer value,
gpointer user_data)
{
GdkX11DeviceManagerXI2 *device_manager;
GdkDevice *slave, *master;
GdkDevice *physical, *logical;
GdkSeat *seat;
device_manager = user_data;
slave = g_hash_table_lookup (device_manager->id_table, key);
master = g_hash_table_lookup (device_manager->id_table, value);
physical = g_hash_table_lookup (device_manager->id_table, key);
logical = g_hash_table_lookup (device_manager->id_table, value);
_gdk_device_set_associated_device (slave, master);
_gdk_device_add_slave (master, slave);
_gdk_device_set_associated_device (physical, logical);
_gdk_device_add_physical_device (logical, physical);
seat = gdk_device_get_seat (master);
gdk_seat_default_add_slave (GDK_SEAT_DEFAULT (seat), slave);
seat = gdk_device_get_seat (logical);
gdk_seat_default_add_physical_device (GDK_SEAT_DEFAULT (seat), physical);
}
static void
@ -729,7 +729,7 @@ gdk_x11_device_manager_xi2_constructed (GObject *object)
{
GdkX11DeviceManagerXI2 *device_manager;
GdkDisplay *display;
GHashTable *masters, *slaves;
GHashTable *logical_devices, *physical_devices;
Display *xdisplay;
XIDeviceInfo *info, *dev;
int ndevices, i;
@ -744,8 +744,8 @@ gdk_x11_device_manager_xi2_constructed (GObject *object)
g_assert (device_manager->major == 2);
masters = g_hash_table_new (NULL, NULL);
slaves = g_hash_table_new (NULL, NULL);
logical_devices = g_hash_table_new (NULL, NULL);
physical_devices = g_hash_table_new (NULL, NULL);
info = XIQueryDevice (xdisplay, XIAllDevices, &ndevices);
@ -762,14 +762,14 @@ gdk_x11_device_manager_xi2_constructed (GObject *object)
if (dev->use == XIMasterPointer ||
dev->use == XIMasterKeyboard)
{
g_hash_table_insert (masters,
g_hash_table_insert (logical_devices,
GINT_TO_POINTER (dev->deviceid),
GINT_TO_POINTER (dev->attachment));
}
else if (dev->use == XISlavePointer ||
dev->use == XISlaveKeyboard)
{
g_hash_table_insert (slaves,
g_hash_table_insert (physical_devices,
GINT_TO_POINTER (dev->deviceid),
GINT_TO_POINTER (dev->attachment));
}
@ -778,11 +778,11 @@ gdk_x11_device_manager_xi2_constructed (GObject *object)
XIFreeDeviceInfo (info);
/* Stablish relationships between devices */
g_hash_table_foreach (masters, relate_masters, object);
g_hash_table_destroy (masters);
g_hash_table_foreach (logical_devices, relate_logical_devices, object);
g_hash_table_destroy (logical_devices);
g_hash_table_foreach (slaves, relate_slaves, object);
g_hash_table_destroy (slaves);
g_hash_table_foreach (physical_devices, relate_physical_devices, object);
g_hash_table_destroy (physical_devices);
/* Connect to hierarchy change events */
XISetMask (mask, XI_HierarchyChanged);
@ -917,28 +917,28 @@ handle_hierarchy_changed (GdkX11DeviceManagerXI2 *device_manager,
else if (ev->info[i].flags & XISlaveAttached ||
ev->info[i].flags & XISlaveDetached)
{
GdkDevice *master, *slave;
GdkDevice *logical, *physical;
GdkSeat *seat;
slave = g_hash_table_lookup (device_manager->id_table,
GINT_TO_POINTER (ev->info[i].deviceid));
physical = g_hash_table_lookup (device_manager->id_table,
GINT_TO_POINTER (ev->info[i].deviceid));
if (!slave)
if (!physical)
continue;
/* Remove old master info */
master = gdk_device_get_associated_device (slave);
/* Remove old logical device info */
logical = gdk_device_get_associated_device (physical);
if (master)
if (logical != NULL)
{
_gdk_device_remove_slave (master, slave);
_gdk_device_set_associated_device (slave, NULL);
_gdk_device_remove_physical_device (logical, physical);
_gdk_device_set_associated_device (physical, NULL);
seat = gdk_device_get_seat (master);
gdk_seat_default_remove_slave (GDK_SEAT_DEFAULT (seat), slave);
seat = gdk_device_get_seat (logical);
gdk_seat_default_remove_physical_device (GDK_SEAT_DEFAULT (seat), physical);
}
/* Add new master if it's an attachment event */
/* Add new logical device if it's an attachment event */
if (ev->info[i].flags & XISlaveAttached)
{
gdk_x11_display_error_trap_push (display);
@ -946,18 +946,18 @@ handle_hierarchy_changed (GdkX11DeviceManagerXI2 *device_manager,
gdk_x11_display_error_trap_pop_ignored (display);
if (info)
{
master = g_hash_table_lookup (device_manager->id_table,
GINT_TO_POINTER (info->attachment));
logical = g_hash_table_lookup (device_manager->id_table,
GINT_TO_POINTER (info->attachment));
XIFreeDeviceInfo (info);
}
if (master)
if (logical != NULL)
{
_gdk_device_set_associated_device (slave, master);
_gdk_device_add_slave (master, slave);
_gdk_device_set_associated_device (physical, logical);
_gdk_device_add_physical_device (logical, physical);
seat = gdk_device_get_seat (master);
gdk_seat_default_add_slave (GDK_SEAT_DEFAULT (seat), slave);
seat = gdk_device_get_seat (logical);
gdk_seat_default_add_physical_device (GDK_SEAT_DEFAULT (seat), physical);
}
}
}
@ -1722,13 +1722,14 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
/* When scrolling, X might send events twice here; once with both the
* device and the source device set to the physical device, and once
* with the device set to the master device.
* with the device set to the logical device.
*
* Since we are only interested in the latter, and
* scroll_valuators_changed() updates the valuator cache for the
* source device, we need to explicitly ignore the first event in
* order to get the correct delta for the second.
*/
if (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE &&
if (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_PHYSICAL &&
scroll_valuators_changed (GDK_X11_DEVICE_XI2 (source_device),
&xev->valuators, &delta_x, &delta_y))
{
@ -1894,18 +1895,18 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
xev->detail != XINotifyInferior && xev->mode != XINotifyPassiveUngrab &&
GDK_IS_TOPLEVEL (surface))
{
if (gdk_device_get_device_type (source_device) != GDK_DEVICE_TYPE_MASTER)
if (gdk_device_get_device_type (source_device) != GDK_DEVICE_TYPE_LOGICAL)
_gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (source_device));
else
{
GList *slaves, *l;
GList *physical_devices, *l;
slaves = gdk_device_list_slave_devices (source_device);
physical_devices = gdk_device_list_physical_devices (source_device);
for (l = slaves; l; l = l->next)
for (l = physical_devices; l; l = l->next)
_gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (l->data));
g_list_free (slaves);
g_list_free (physical_devices);
}
}

View File

@ -1765,7 +1765,9 @@ device_grab_update_callback (GdkDisplay *display,
pointer_info = _gdk_display_get_pointer_info (display, device);
_gdk_display_device_grab_update (display, device,
pointer_info->last_slave ? pointer_info->last_slave : device,
pointer_info->last_physical_device != NULL
? pointer_info->last_physical_device
: device,
serial);
}

View File

@ -141,7 +141,7 @@ _gdk_x11_surface_grab_check_unmap (GdkSurface *surface,
seat = gdk_display_get_default_seat (display);
devices = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_ALL);
devices = gdk_seat_get_physical_devices (seat, GDK_SEAT_CAPABILITY_ALL);
devices = g_list_prepend (devices, gdk_seat_get_keyboard (seat));
devices = g_list_prepend (devices, gdk_seat_get_pointer (seat));
@ -169,7 +169,7 @@ _gdk_x11_surface_grab_check_destroy (GdkSurface *surface)
seat = gdk_display_get_default_seat (display);
devices = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_ALL);
devices = gdk_seat_get_physical_devices (seat, GDK_SEAT_CAPABILITY_ALL);
devices = g_list_prepend (devices, gdk_seat_get_keyboard (seat));
devices = g_list_prepend (devices, gdk_seat_get_pointer (seat));

View File

@ -4335,7 +4335,8 @@ _should_perform_ewmh_drag (GdkSurface *surface,
display = gdk_surface_get_display (surface);
info = _gdk_display_get_pointer_info (display, device);
if ((!info->last_slave || gdk_device_get_source (info->last_slave) != GDK_SOURCE_TOUCHSCREEN) &&
if ((info->last_physical_device == NULL ||
gdk_device_get_source (info->last_physical_device) != GDK_SOURCE_TOUCHSCREEN) &&
gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (surface),
g_intern_static_string ("_NET_WM_MOVERESIZE")))
return TRUE;

View File

@ -59,57 +59,50 @@
* # GtkBuilder UI Definitions # {#BUILDER-UI}
*
* GtkBuilder parses textual descriptions of user interfaces which are
* specified in an XML format which can be roughly described by the
* RELAX NG schema below. We refer to these descriptions as GtkBuilder
* specified in XML format. We refer to these descriptions as GtkBuilder
* UI definitions or just UI definitions if the context is clear.
*
* [RELAX NG Compact Syntax](https://gitlab.gnome.org/GNOME/gtk/tree/master/gtk/gtkbuilder.rnc)
*
* The toplevel element is <interface>. It optionally takes a domain
* The toplevel element is `<interface>`. It optionally takes a domain
* attribute, which will make the builder look for translated strings
* using dgettext() in the domain specified. This can also be done by
* using `dgettext()` in the domain specified. This can also be done by
* calling gtk_builder_set_translation_domain() on the builder.
* Objects are described by <object> elements, which can contain
* <property> elements to set properties, <signal> elements which
* connect signals to handlers, and <child> elements, which describe
* Objects are described by `<object>` elements, which can contain
* <property> elements to set properties, `<signal>` elements which
* connect signals to handlers, and `<child>` elements, which describe
* child objects (most often widgets inside a container, but also e.g.
* actions in an action group, or columns in a tree model). A <child>
* element contains an <object> element which describes the child object.
* actions in an action group, or columns in a tree model). A `<child>`
* element contains an `<object>` element which describes the child object.
* The target toolkit version(s) are described by <requires> elements,
* the lib attribute specifies the widget library in question (currently
* the only supported value is gtk+) and the version attribute specifies
* the target version in the form <major>.<minor>. The builder will error
* the target version in the form `<major>`.`<minor>`. The builder will error
* out if the version requirements are not met.
*
* Typically, the specific kind of object represented by an <object>
* Typically, the specific kind of object represented by an `<object>`
* element is specified by the class attribute. If the type has not
* been loaded yet, GTK+ tries to find the get_type() function from the
* been loaded yet, GTK tries to find the `get_type()` function from the
* class name by applying heuristics. This works in most cases, but if
* necessary, it is possible to specify the name of the get_type() function
* explicitly with the "type-func" attribute. As a special case, GtkBuilder
* allows to use an object that has been constructed by a #GtkUIManager in
* another part of the UI definition by specifying the id of the #GtkUIManager
* in the constructor attribute and the name of the object in the id
* attribute.
* necessary, it is possible to specify the name of the `get_type()` function
* explicitly with the "type-func" attribute.
*
* Objects may be given a name with the id attribute, which allows the
* application to retrieve them from the builder with gtk_builder_get_object().
* An id is also necessary to use the object as property value in other
* parts of the UI definition. GTK+ reserves ids starting and ending
* with ___ (3 underscores) for its own purposes.
* parts of the UI definition. GTK reserves ids starting and ending
* with `___` (three consecutive underscores) for its own purposes.
*
* Setting properties of objects is pretty straightforward with the
* <property> element: the name attribute specifies the name of the
* property, and the content of the element specifies the value.
* If the translatable attribute is set to a true value, GTK+ uses
* gettext() (or dgettext() if the builder has a translation domain set)
* If the translatable attribute is set to a true value, GTK uses
* `gettext()` (or `dgettext()` if the builder has a translation domain set)
* to find a translation for the value. This happens before the value
* is parsed, so it can be used for properties of any type, but it is
* probably most useful for string properties. It is also possible to
* specify a context to disambiguate short strings, and comments which
* may help the translators.
*
* GtkBuilder can parse textual representations for the most common
* #GtkBuilder can parse textual representations for the most common
* property types: characters, strings, integers, floating-point numbers,
* booleans (strings like TRUE, t, yes, y, 1 are interpreted
* as %TRUE, strings like FALSE, f, no, n, 0 are interpreted
@ -122,9 +115,9 @@
* and pixbufs can be specified as a filename of an image file to load.
*
* Objects can be referred to by their name and by default refer to
* objects declared in the local xml fragment and objects exposed via
* objects declared in the local XML fragment and objects exposed via
* gtk_builder_expose_object(). In general, GtkBuilder allows forward
* references to objects declared in the local xml; an object doesnt
* references to objects declared in the local XML; an object doesnt
* have to be constructed before it can be referred to. The exception
* to this rule is that an object has to be constructed before it can
* be used as the value of a construct-only property.
@ -134,20 +127,20 @@
* "bind-source" to specify the source object of the binding, and
* optionally, "bind-property" and "bind-flags" to specify the
* source property and source binding flags respectively.
* Internally builder implements this using GBinding objects.
* Internally builder implements this using #GBinding objects.
* For more information see g_object_bind_property()
*
* Sometimes it is necessary to refer to widgets which have implicitly
* been constructed by GTK+ as part of a composite widget, to set
* properties on them or to add further children (e.g. the @vbox of
* a #GtkDialog). This can be achieved by setting the internal-child
* property of the <child> element to a true value. Note that GtkBuilder
* still requires an <object> element for the internal child, even if it
* properties on them or to add further children (e.g. the content area
* of a #GtkDialog). This can be achieved by setting the internal-child
* property of the `<child>` element to a true value. Note that #GtkBuilder
* still requires an `<object>` element for the internal child, even if it
* has already been constructed.
*
* A number of widgets have different places where a child can be added
* (e.g. tabs vs. page content in notebooks). This can be reflected in
* a UI definition by specifying the type attribute on a <child>
* a UI definition by specifying the type attribute on a `<child>`
* The possible values for the type attribute are described in the
* sections describing the widget-specific portions of UI definitions.
*

View File

@ -895,7 +895,7 @@ gtk_gesture_init (GtkGesture *gesture)
* gtk_gesture_get_device:
* @gesture: a #GtkGesture
*
* Returns the master #GdkDevice that is currently operating
* Returns the logical #GdkDevice that is currently operating
* on @gesture, or %NULL if the gesture is not being interacted.
*
* Returns: (nullable) (transfer none): a #GdkDevice, or %NULL

View File

@ -560,7 +560,7 @@ gtk_im_context_filter_key (GtkIMContext *context,
g_return_val_if_fail (GTK_IS_IM_CONTEXT (context), FALSE);
if (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_MASTER)
if (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_LOGICAL)
{
source_device = NULL;
}

View File

@ -36,7 +36,7 @@
typedef struct _GtkIMContextQuartz
{
GtkIMContext parent;
GtkIMContext *slave;
GtkIMContext *helper;
GdkSurface *client_surface;
gchar *preedit_str;
unsigned int cursor_index;
@ -188,7 +188,7 @@ quartz_filter_keypress (GtkIMContext *context,
/* update text input changes by mouse events */
return output_result (context, surface);
else
return gtk_im_context_filter_keypress (qc->slave, event);
return gtk_im_context_filter_keypress (qc->helper, event);
}
if (event->type == GDK_KEY_RELEASE)
@ -341,8 +341,8 @@ imquartz_finalize (GObject *obj)
g_free (qc->cursor_rect);
qc->cursor_rect = NULL;
g_signal_handlers_disconnect_by_func (qc->slave, (gpointer)commit_cb, qc);
g_object_unref (qc->slave);
g_signal_handlers_disconnect_by_func (qc->helper, (gpointer)commit_cb, qc);
g_object_unref (qc->helper);
gtk_im_context_quartz_parent_class->finalize (obj);
}
@ -378,6 +378,6 @@ gtk_im_context_quartz_init (GtkIMContextQuartz *qc)
qc->cursor_rect = g_malloc (sizeof (GdkRectangle));
qc->focused = FALSE;
qc->slave = g_object_new (GTK_TYPE_IM_CONTEXT_SIMPLE, NULL);
g_signal_connect (G_OBJECT (qc->slave), "commit", G_CALLBACK (commit_cb), qc);
qc->helper = g_object_new (GTK_TYPE_IM_CONTEXT_SIMPLE, NULL);
g_signal_connect (G_OBJECT (qc->helper), "commit", G_CALLBACK (commit_cb), qc);
}

View File

@ -38,7 +38,7 @@
struct _GtkIMMulticontextPrivate
{
GtkIMContext *slave;
GtkIMContext *delegate;
GtkWidget *client_widget;
GdkRectangle cursor_location;
@ -55,8 +55,8 @@ static void gtk_im_multicontext_notify (GObject
GParamSpec *pspec);
static void gtk_im_multicontext_finalize (GObject *object);
static void gtk_im_multicontext_set_slave (GtkIMMulticontext *multicontext,
GtkIMContext *slave,
static void gtk_im_multicontext_set_delegate (GtkIMMulticontext *multicontext,
GtkIMContext *delegate,
gboolean finalizing);
static void gtk_im_multicontext_set_client_widget (GtkIMContext *context,
@ -82,18 +82,18 @@ static void gtk_im_multicontext_set_surrounding (GtkIMContext
gint len,
gint cursor_index);
static void gtk_im_multicontext_preedit_start_cb (GtkIMContext *slave,
static void gtk_im_multicontext_preedit_start_cb (GtkIMContext *delegate,
GtkIMMulticontext *multicontext);
static void gtk_im_multicontext_preedit_end_cb (GtkIMContext *slave,
static void gtk_im_multicontext_preedit_end_cb (GtkIMContext *delegate,
GtkIMMulticontext *multicontext);
static void gtk_im_multicontext_preedit_changed_cb (GtkIMContext *slave,
static void gtk_im_multicontext_preedit_changed_cb (GtkIMContext *delegate,
GtkIMMulticontext *multicontext);
static void gtk_im_multicontext_commit_cb (GtkIMContext *slave,
static void gtk_im_multicontext_commit_cb (GtkIMContext *delegate,
const gchar *str,
GtkIMMulticontext *multicontext);
static gboolean gtk_im_multicontext_retrieve_surrounding_cb (GtkIMContext *slave,
static gboolean gtk_im_multicontext_retrieve_surrounding_cb (GtkIMContext *delegate,
GtkIMMulticontext *multicontext);
static gboolean gtk_im_multicontext_delete_surrounding_cb (GtkIMContext *slave,
static gboolean gtk_im_multicontext_delete_surrounding_cb (GtkIMContext *delegate,
gint offset,
gint n_chars,
GtkIMMulticontext *multicontext);
@ -132,7 +132,7 @@ gtk_im_multicontext_init (GtkIMMulticontext *multicontext)
multicontext->priv = gtk_im_multicontext_get_instance_private (multicontext);
priv = multicontext->priv;
priv->slave = NULL;
priv->delegate = NULL;
priv->use_preedit = TRUE;
priv->have_cursor_location = FALSE;
priv->focus_in = FALSE;
@ -157,7 +157,7 @@ gtk_im_multicontext_finalize (GObject *object)
GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (object);
GtkIMMulticontextPrivate *priv = multicontext->priv;
gtk_im_multicontext_set_slave (multicontext, NULL, TRUE);
gtk_im_multicontext_set_delegate (multicontext, NULL, TRUE);
g_free (priv->context_id);
g_free (priv->context_id_aux);
@ -165,79 +165,79 @@ gtk_im_multicontext_finalize (GObject *object)
}
static void
gtk_im_multicontext_set_slave (GtkIMMulticontext *multicontext,
GtkIMContext *slave,
gboolean finalizing)
gtk_im_multicontext_set_delegate (GtkIMMulticontext *multicontext,
GtkIMContext *delegate,
gboolean finalizing)
{
GtkIMMulticontextPrivate *priv = multicontext->priv;
gboolean need_preedit_changed = FALSE;
if (priv->slave)
if (priv->delegate)
{
if (!finalizing)
gtk_im_context_reset (priv->slave);
gtk_im_context_reset (priv->delegate);
g_signal_handlers_disconnect_by_func (priv->slave,
g_signal_handlers_disconnect_by_func (priv->delegate,
gtk_im_multicontext_preedit_start_cb,
multicontext);
g_signal_handlers_disconnect_by_func (priv->slave,
g_signal_handlers_disconnect_by_func (priv->delegate,
gtk_im_multicontext_preedit_end_cb,
multicontext);
g_signal_handlers_disconnect_by_func (priv->slave,
g_signal_handlers_disconnect_by_func (priv->delegate,
gtk_im_multicontext_preedit_changed_cb,
multicontext);
g_signal_handlers_disconnect_by_func (priv->slave,
g_signal_handlers_disconnect_by_func (priv->delegate,
gtk_im_multicontext_commit_cb,
multicontext);
g_signal_handlers_disconnect_by_func (priv->slave,
g_signal_handlers_disconnect_by_func (priv->delegate,
gtk_im_multicontext_retrieve_surrounding_cb,
multicontext);
g_signal_handlers_disconnect_by_func (priv->slave,
g_signal_handlers_disconnect_by_func (priv->delegate,
gtk_im_multicontext_delete_surrounding_cb,
multicontext);
g_object_unref (priv->slave);
priv->slave = NULL;
g_object_unref (priv->delegate);
priv->delegate = NULL;
if (!finalizing)
need_preedit_changed = TRUE;
}
priv->slave = slave;
priv->delegate = delegate;
if (priv->slave)
if (priv->delegate)
{
g_object_ref (priv->slave);
g_object_ref (priv->delegate);
propagate_purpose (multicontext);
g_signal_connect (priv->slave, "preedit-start",
g_signal_connect (priv->delegate, "preedit-start",
G_CALLBACK (gtk_im_multicontext_preedit_start_cb),
multicontext);
g_signal_connect (priv->slave, "preedit-end",
g_signal_connect (priv->delegate, "preedit-end",
G_CALLBACK (gtk_im_multicontext_preedit_end_cb),
multicontext);
g_signal_connect (priv->slave, "preedit-changed",
g_signal_connect (priv->delegate, "preedit-changed",
G_CALLBACK (gtk_im_multicontext_preedit_changed_cb),
multicontext);
g_signal_connect (priv->slave, "commit",
g_signal_connect (priv->delegate, "commit",
G_CALLBACK (gtk_im_multicontext_commit_cb),
multicontext);
g_signal_connect (priv->slave, "retrieve-surrounding",
g_signal_connect (priv->delegate, "retrieve-surrounding",
G_CALLBACK (gtk_im_multicontext_retrieve_surrounding_cb),
multicontext);
g_signal_connect (priv->slave, "delete-surrounding",
g_signal_connect (priv->delegate, "delete-surrounding",
G_CALLBACK (gtk_im_multicontext_delete_surrounding_cb),
multicontext);
if (!priv->use_preedit) /* Default is TRUE */
gtk_im_context_set_use_preedit (slave, FALSE);
gtk_im_context_set_use_preedit (delegate, FALSE);
if (priv->client_widget)
gtk_im_context_set_client_widget (slave, priv->client_widget);
gtk_im_context_set_client_widget (delegate, priv->client_widget);
if (priv->have_cursor_location)
gtk_im_context_set_cursor_location (slave, &priv->cursor_location);
gtk_im_context_set_cursor_location (delegate, &priv->cursor_location);
if (priv->focus_in)
gtk_im_context_focus_in (slave);
gtk_im_context_focus_in (delegate);
}
if (need_preedit_changed)
@ -262,27 +262,27 @@ get_effective_context_id (GtkIMMulticontext *multicontext)
}
static GtkIMContext *
gtk_im_multicontext_get_slave (GtkIMMulticontext *multicontext)
gtk_im_multicontext_get_delegate (GtkIMMulticontext *multicontext)
{
GtkIMMulticontextPrivate *priv = multicontext->priv;
if (!priv->slave)
if (!priv->delegate)
{
GtkIMContext *slave;
GtkIMContext *delegate;
g_free (priv->context_id);
priv->context_id = g_strdup (get_effective_context_id (multicontext));
slave = _gtk_im_module_create (priv->context_id);
if (slave)
delegate = _gtk_im_module_create (priv->context_id);
if (delegate)
{
gtk_im_multicontext_set_slave (multicontext, slave, FALSE);
g_object_unref (slave);
gtk_im_multicontext_set_delegate (multicontext, delegate, FALSE);
g_object_unref (delegate);
}
}
return priv->slave;
return priv->delegate;
}
static void
@ -290,7 +290,7 @@ im_module_setting_changed (GtkSettings *settings,
GParamSpec *pspec,
GtkIMMulticontext *self)
{
gtk_im_multicontext_set_slave (self, NULL, FALSE);
gtk_im_multicontext_set_delegate (self, NULL, FALSE);
}
static void
@ -299,7 +299,7 @@ gtk_im_multicontext_set_client_widget (GtkIMContext *context,
{
GtkIMMulticontext *self = GTK_IM_MULTICONTEXT (context);
GtkIMMulticontextPrivate *priv = self->priv;
GtkIMContext *slave;
GtkIMContext *delegate;
GtkSettings *settings;
if (priv->client_widget != NULL)
@ -322,9 +322,9 @@ gtk_im_multicontext_set_client_widget (GtkIMContext *context,
self);
}
slave = gtk_im_multicontext_get_slave (self);
if (slave)
gtk_im_context_set_client_widget (slave, widget);
delegate = gtk_im_multicontext_get_delegate (self);
if (delegate)
gtk_im_context_set_client_widget (delegate, widget);
}
static void
@ -334,10 +334,10 @@ gtk_im_multicontext_get_preedit_string (GtkIMContext *context,
gint *cursor_pos)
{
GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (context);
GtkIMContext *slave = gtk_im_multicontext_get_slave (multicontext);
GtkIMContext *delegate = gtk_im_multicontext_get_delegate (multicontext);
if (slave)
gtk_im_context_get_preedit_string (slave, str, attrs, cursor_pos);
if (delegate)
gtk_im_context_get_preedit_string (delegate, str, attrs, cursor_pos);
else
{
if (str)
@ -352,12 +352,12 @@ gtk_im_multicontext_filter_keypress (GtkIMContext *context,
GdkEvent *event)
{
GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (context);
GtkIMContext *slave = gtk_im_multicontext_get_slave (multicontext);
GtkIMContext *delegate = gtk_im_multicontext_get_delegate (multicontext);
guint keyval, state;
if (slave)
if (delegate)
{
return gtk_im_context_filter_keypress (slave, event);
return gtk_im_context_filter_keypress (delegate, event);
}
else
{
@ -397,12 +397,12 @@ gtk_im_multicontext_focus_in (GtkIMContext *context)
{
GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (context);
GtkIMMulticontextPrivate *priv = multicontext->priv;
GtkIMContext *slave = gtk_im_multicontext_get_slave (multicontext);
GtkIMContext *delegate = gtk_im_multicontext_get_delegate (multicontext);
priv->focus_in = TRUE;
if (slave)
gtk_im_context_focus_in (slave);
if (delegate)
gtk_im_context_focus_in (delegate);
}
static void
@ -410,22 +410,22 @@ gtk_im_multicontext_focus_out (GtkIMContext *context)
{
GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (context);
GtkIMMulticontextPrivate *priv = multicontext->priv;
GtkIMContext *slave = gtk_im_multicontext_get_slave (multicontext);
GtkIMContext *delegate = gtk_im_multicontext_get_delegate (multicontext);
priv->focus_in = FALSE;
if (slave)
gtk_im_context_focus_out (slave);
if (delegate)
gtk_im_context_focus_out (delegate);
}
static void
gtk_im_multicontext_reset (GtkIMContext *context)
{
GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (context);
GtkIMContext *slave = gtk_im_multicontext_get_slave (multicontext);
GtkIMContext *delegate = gtk_im_multicontext_get_delegate (multicontext);
if (slave)
gtk_im_context_reset (slave);
if (delegate)
gtk_im_context_reset (delegate);
}
static void
@ -434,13 +434,13 @@ gtk_im_multicontext_set_cursor_location (GtkIMContext *context,
{
GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (context);
GtkIMMulticontextPrivate *priv = multicontext->priv;
GtkIMContext *slave = gtk_im_multicontext_get_slave (multicontext);
GtkIMContext *delegate = gtk_im_multicontext_get_delegate (multicontext);
priv->have_cursor_location = TRUE;
priv->cursor_location = *area;
if (slave)
gtk_im_context_set_cursor_location (slave, area);
if (delegate)
gtk_im_context_set_cursor_location (delegate, area);
}
static void
@ -449,14 +449,14 @@ gtk_im_multicontext_set_use_preedit (GtkIMContext *context,
{
GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (context);
GtkIMMulticontextPrivate *priv = multicontext->priv;
GtkIMContext *slave = gtk_im_multicontext_get_slave (multicontext);
GtkIMContext *delegate = gtk_im_multicontext_get_delegate (multicontext);
use_preedit = use_preedit != FALSE;
priv->use_preedit = use_preedit;
if (slave)
gtk_im_context_set_use_preedit (slave, use_preedit);
if (delegate)
gtk_im_context_set_use_preedit (delegate, use_preedit);
}
static gboolean
@ -465,10 +465,10 @@ gtk_im_multicontext_get_surrounding (GtkIMContext *context,
gint *cursor_index)
{
GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (context);
GtkIMContext *slave = gtk_im_multicontext_get_slave (multicontext);
GtkIMContext *delegate = gtk_im_multicontext_get_delegate (multicontext);
if (slave)
return gtk_im_context_get_surrounding (slave, text, cursor_index);
if (delegate)
return gtk_im_context_get_surrounding (delegate, text, cursor_index);
else
{
if (text)
@ -487,35 +487,35 @@ gtk_im_multicontext_set_surrounding (GtkIMContext *context,
gint cursor_index)
{
GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (context);
GtkIMContext *slave = gtk_im_multicontext_get_slave (multicontext);
GtkIMContext *delegate = gtk_im_multicontext_get_delegate (multicontext);
if (slave)
gtk_im_context_set_surrounding (slave, text, len, cursor_index);
if (delegate)
gtk_im_context_set_surrounding (delegate, text, len, cursor_index);
}
static void
gtk_im_multicontext_preedit_start_cb (GtkIMContext *slave,
gtk_im_multicontext_preedit_start_cb (GtkIMContext *delegate,
GtkIMMulticontext *multicontext)
{
g_signal_emit_by_name (multicontext, "preedit-start");
}
static void
gtk_im_multicontext_preedit_end_cb (GtkIMContext *slave,
gtk_im_multicontext_preedit_end_cb (GtkIMContext *delegate,
GtkIMMulticontext *multicontext)
{
g_signal_emit_by_name (multicontext, "preedit-end");
}
static void
gtk_im_multicontext_preedit_changed_cb (GtkIMContext *slave,
gtk_im_multicontext_preedit_changed_cb (GtkIMContext *delegate,
GtkIMMulticontext *multicontext)
{
g_signal_emit_by_name (multicontext, "preedit-changed");
}
static void
gtk_im_multicontext_commit_cb (GtkIMContext *slave,
gtk_im_multicontext_commit_cb (GtkIMContext *delegate,
const gchar *str,
GtkIMMulticontext *multicontext)
{
@ -523,7 +523,7 @@ gtk_im_multicontext_commit_cb (GtkIMContext *slave,
}
static gboolean
gtk_im_multicontext_retrieve_surrounding_cb (GtkIMContext *slave,
gtk_im_multicontext_retrieve_surrounding_cb (GtkIMContext *delegate,
GtkIMMulticontext *multicontext)
{
gboolean result;
@ -534,7 +534,7 @@ gtk_im_multicontext_retrieve_surrounding_cb (GtkIMContext *slave,
}
static gboolean
gtk_im_multicontext_delete_surrounding_cb (GtkIMContext *slave,
gtk_im_multicontext_delete_surrounding_cb (GtkIMContext *delegate,
gint offset,
gint n_chars,
GtkIMMulticontext *multicontext)
@ -551,9 +551,9 @@ gtk_im_multicontext_delete_surrounding_cb (GtkIMContext *slave,
* gtk_im_multicontext_get_context_id:
* @context: a #GtkIMMulticontext
*
* Gets the id of the currently active slave of the @context.
* Gets the id of the currently active delegate of the @context.
*
* Returns: the id of the currently active slave
* Returns: the id of the currently active delegate
*/
const char *
gtk_im_multicontext_get_context_id (GtkIMMulticontext *context)
@ -563,7 +563,7 @@ gtk_im_multicontext_get_context_id (GtkIMMulticontext *context)
g_return_val_if_fail (GTK_IS_IM_MULTICONTEXT (context), NULL);
if (priv->context_id == NULL)
gtk_im_multicontext_get_slave (context);
gtk_im_multicontext_get_delegate (context);
return priv->context_id;
}
@ -575,8 +575,8 @@ gtk_im_multicontext_get_context_id (GtkIMMulticontext *context)
*
* Sets the context id for @context.
*
* This causes the currently active slave of @context to be
* replaced by the slave corresponding to the new context id.
* This causes the currently active delegate of @context to be
* replaced by the delegate corresponding to the new context id.
*/
void
gtk_im_multicontext_set_context_id (GtkIMMulticontext *context,
@ -591,7 +591,7 @@ gtk_im_multicontext_set_context_id (GtkIMMulticontext *context,
gtk_im_context_reset (GTK_IM_CONTEXT (context));
g_free (priv->context_id_aux);
priv->context_id_aux = g_strdup (context_id);
gtk_im_multicontext_set_slave (context, NULL, FALSE);
gtk_im_multicontext_set_delegate (context, NULL, FALSE);
}
static void
@ -600,14 +600,14 @@ propagate_purpose (GtkIMMulticontext *context)
GtkInputPurpose purpose;
GtkInputHints hints;
if (context->priv->slave == NULL)
if (context->priv->delegate == NULL)
return;
g_object_get (context, "input-purpose", &purpose, NULL);
g_object_set (context->priv->slave, "input-purpose", purpose, NULL);
g_object_set (context->priv->delegate, "input-purpose", purpose, NULL);
g_object_get (context, "input-hints", &hints, NULL);
g_object_set (context->priv->slave, "input-hints", hints, NULL);
g_object_set (context->priv->delegate, "input-hints", hints, NULL);
}
static void

View File

@ -727,7 +727,7 @@ gtk_distribute_natural_allocation (gint extra_space,
compare_gap, sizes);
/* Distribute available space.
* This master piece of a loop was conceived by Behdad Esfahbod.
* This masterpiece of a loop was conceived by Behdad Esfahbod.
*/
for (i = n_requested_sizes - 1; extra_space > 0 && i >= 0; --i)
{

View File

@ -4191,7 +4191,7 @@ gtk_text_retrieve_surrounding_cb (GtkIMContext *context,
}
static gboolean
gtk_text_delete_surrounding_cb (GtkIMContext *slave,
gtk_text_delete_surrounding_cb (GtkIMContext *context,
int offset,
int n_chars,
GtkText *self)

View File

@ -7630,7 +7630,7 @@ _gtk_widget_list_devices (GtkWidget *widget,
if (is_my_surface (widget, gdk_device_get_last_event_surface (device)))
g_ptr_array_add (result, device);
devices = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_ALL_POINTING);
devices = gdk_seat_get_physical_devices (seat, GDK_SEAT_CAPABILITY_ALL_POINTING);
for (l = devices; l; l = l->next)
{
device = l->data;

View File

@ -787,7 +787,7 @@ add_seat (GtkInspectorGeneral *gen,
g_free (text);
g_free (caps);
list = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_ALL);
list = gdk_seat_get_physical_devices (seat, GDK_SEAT_CAPABILITY_ALL);
for (l = list; l; l = l->next)
add_device (gen, GDK_DEVICE (l->data));

View File

@ -209,8 +209,9 @@ endforeach
# Disable deprecation checks for all libraries we depend on on stable branches.
# This is so newer versions of those libraries don't cause more warnings with
# a stable GTK version.
# We don't ever want to turn off deprecation warnings for master however, because
# that's where we get rid of deprecated API we use.
#
# We don't ever want to turn off deprecation warnings for development cycles,
# however, because that's where we get rid of deprecated API we use.
if gtk_minor_version.is_even()
cdata.set('GLIB_DISABLE_DEPRECATION_WARNINGS', 1)
endif

View File

@ -4552,7 +4552,7 @@ static const struct {
};
/* keep sorted when changing */
static const char *color_option_whitelist[] = {
static const char *color_option_allow_list[] = {
"BRColorEnhancement",
"BRColorMatching",
"BRColorMatching",
@ -4572,7 +4572,7 @@ static const char *color_option_whitelist[] = {
};
/* keep sorted when changing */
static const char *color_group_whitelist[] = {
static const char *color_group_allow_list[] = {
"ColorPage",
"FPColorWise1",
"FPColorWise2",
@ -4583,7 +4583,7 @@ static const char *color_group_whitelist[] = {
};
/* keep sorted when changing */
static const char *image_quality_option_whitelist[] = {
static const char *image_quality_option_allow_list[] = {
"BRDocument",
"BRHalfTonePattern",
"BRNormalPrt",
@ -4611,7 +4611,7 @@ static const char *image_quality_option_whitelist[] = {
};
/* keep sorted when changing */
static const char *image_quality_group_whitelist[] = {
static const char *image_quality_group_allow_list[] = {
"FPImageQuality1",
"FPImageQuality2",
"FPImageQuality3",
@ -4619,7 +4619,7 @@ static const char *image_quality_group_whitelist[] = {
};
/* keep sorted when changing */
static const char * finishing_option_whitelist[] = {
static const char * finishing_option_allow_list[] = {
"BindColor",
"BindEdge",
"BindType",
@ -4639,7 +4639,7 @@ static const char * finishing_option_whitelist[] = {
};
/* keep sorted when changing */
static const char *finishing_group_whitelist[] = {
static const char *finishing_group_allow_list[] = {
"FPFinishing1",
"FPFinishing2",
"FPFinishing3",
@ -4649,7 +4649,7 @@ static const char *finishing_group_whitelist[] = {
};
/* keep sorted when changing */
static const char *cups_option_blacklist[] = {
static const char *cups_option_ignore_list[] = {
"Collate",
"Copies",
"OutputOrder",
@ -5139,7 +5139,7 @@ handle_option (GtkPrinterOptionSet *set,
char *option_name;
int i;
if (STRING_IN_TABLE (ppd_option->keyword, cups_option_blacklist))
if (STRING_IN_TABLE (ppd_option->keyword, cups_option_ignore_list))
return;
option_name = get_ppd_option_name (ppd_option->keyword);
@ -5159,18 +5159,18 @@ handle_option (GtkPrinterOptionSet *set,
const char *name;
name = ppd_group_name (toplevel_group);
if (STRING_IN_TABLE (name, color_group_whitelist) ||
STRING_IN_TABLE (ppd_option->keyword, color_option_whitelist))
if (STRING_IN_TABLE (name, color_group_allow_list) ||
STRING_IN_TABLE (ppd_option->keyword, color_option_allow_list))
{
option->group = g_strdup ("ColorPage");
}
else if (STRING_IN_TABLE (name, image_quality_group_whitelist) ||
STRING_IN_TABLE (ppd_option->keyword, image_quality_option_whitelist))
else if (STRING_IN_TABLE (name, image_quality_group_allow_list) ||
STRING_IN_TABLE (ppd_option->keyword, image_quality_option_allow_list))
{
option->group = g_strdup ("ImageQualityPage");
}
else if (STRING_IN_TABLE (name, finishing_group_whitelist) ||
STRING_IN_TABLE (ppd_option->keyword, finishing_option_whitelist))
else if (STRING_IN_TABLE (name, finishing_group_allow_list) ||
STRING_IN_TABLE (ppd_option->keyword, finishing_option_allow_list))
{
option->group = g_strdup ("FinishingPage");
}
@ -5724,7 +5724,7 @@ cups_printer_get_options (GtkPrinter *printer,
for (i = 0; i < num_opts; i++)
{
if (STRING_IN_TABLE (opts[i].name, cups_option_blacklist))
if (STRING_IN_TABLE (opts[i].name, cups_option_ignore_list))
continue;
name = get_lpoption_name (opts[i].name);

View File

@ -78,7 +78,7 @@ static TreeStruct may[] =
static TreeStruct june[] =
{
{ "June Fathers' Day", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, NULL },
{ "Juneteenth (Liberation of Slaves)", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
{ "Juneteenth (Liberation Day)", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL },
{ "Flag Day", FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, NULL },
{ NULL }
};

View File

@ -42,7 +42,7 @@ test_default_seat (void)
GdkSeat *seat0;
GdkSeatCapabilities caps;
GdkDevice *pointer0, *keyboard0, *device;
GList *slaves, *l;
GList *physical_devices, *l;
display = gdk_display_get_default ();
seat0 = gdk_display_get_default_seat (display);
@ -60,57 +60,57 @@ test_default_seat (void)
g_assert (caps != GDK_SEAT_CAPABILITY_NONE);
pointer0 = gdk_seat_get_pointer (seat0);
slaves = gdk_seat_get_slaves (seat0, GDK_SEAT_CAPABILITY_POINTER);
physical_devices = gdk_seat_get_physical_devices (seat0, GDK_SEAT_CAPABILITY_POINTER);
if ((caps & GDK_SEAT_CAPABILITY_POINTER) != 0)
{
g_assert_nonnull (pointer0);
g_assert (gdk_device_get_device_type (pointer0) == GDK_DEVICE_TYPE_MASTER);
g_assert (gdk_device_get_device_type (pointer0) == GDK_DEVICE_TYPE_LOGICAL);
g_assert (gdk_device_get_display (pointer0) == display);
g_assert (gdk_device_get_seat (pointer0) == seat0);
g_assert_nonnull (slaves);
for (l = slaves; l; l = l->next)
g_assert_nonnull (physical_devices);
for (l = physical_devices; l; l = l->next)
{
device = l->data;
g_assert (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_SLAVE);
g_assert (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_PHYSICAL);
g_assert (gdk_device_get_display (device) == display);
g_assert (gdk_device_get_seat (device) == seat0);
}
g_list_free (slaves);
g_list_free (physical_devices);
}
else
{
g_assert_null (pointer0);
g_assert_null (slaves);
g_assert_null (physical_devices);
}
keyboard0 = gdk_seat_get_keyboard (seat0);
slaves = gdk_seat_get_slaves (seat0, GDK_SEAT_CAPABILITY_KEYBOARD);
physical_devices = gdk_seat_get_physical_devices (seat0, GDK_SEAT_CAPABILITY_KEYBOARD);
if ((caps & GDK_SEAT_CAPABILITY_KEYBOARD) != 0)
{
g_assert_nonnull (keyboard0);
g_assert (gdk_device_get_device_type (keyboard0) == GDK_DEVICE_TYPE_MASTER);
g_assert (gdk_device_get_device_type (keyboard0) == GDK_DEVICE_TYPE_LOGICAL);
g_assert (gdk_device_get_display (keyboard0) == display);
g_assert (gdk_device_get_seat (keyboard0) == seat0);
g_assert (gdk_device_get_source (keyboard0) == GDK_SOURCE_KEYBOARD);
g_assert_nonnull (slaves);
for (l = slaves; l; l = l->next)
g_assert_nonnull (physical_devices);
for (l = physical_devices; l; l = l->next)
{
device = l->data;
g_assert (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_SLAVE);
g_assert (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_PHYSICAL);
g_assert (gdk_device_get_display (device) == display);
g_assert (gdk_device_get_seat (device) == seat0);
g_assert (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD);
}
g_list_free (slaves);
g_list_free (physical_devices);
}
else
{
g_assert_null (keyboard0);
g_assert_null (slaves);
g_assert_null (physical_devices);
}
}

View File

@ -42,7 +42,7 @@
"random")
#define MATCH_ANY_VALUE ((void*) 0xf1874c23)
/* --- property blacklists --- */
/* --- ignored property names --- */
typedef struct {
const char *type_name;
const char *name;