mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-01-08 04:40:13 +01:00
Switch object ids to use the object_id_t typedef
This commit is contained in:
parent
2e1babbb84
commit
b309798bf1
42 changed files with 78 additions and 76 deletions
|
|
@ -308,7 +308,7 @@ brei_marshal(struct brei_context *brei, struct iobuf *buf, const char *signature
|
|||
|
||||
struct brei_result *
|
||||
brei_marshal_message(struct brei_context *brei,
|
||||
uint32_t id,
|
||||
object_id_t id,
|
||||
uint32_t opcode,
|
||||
const char *signature,
|
||||
size_t nargs,
|
||||
|
|
@ -331,7 +331,7 @@ brei_marshal_message(struct brei_context *brei,
|
|||
struct brei_result *
|
||||
brei_dispatch(struct brei_context *brei,
|
||||
int fd,
|
||||
int (*lookup_object)(uint32_t object_id, struct brei_object **object, void *user_data),
|
||||
int (*lookup_object)(object_id_t object_id, struct brei_object **object, void *user_data),
|
||||
void *user_data)
|
||||
{
|
||||
_unref_(brei_result) *result = NULL;
|
||||
|
|
@ -356,7 +356,7 @@ brei_dispatch(struct brei_context *brei,
|
|||
if (len < headersize)
|
||||
break;
|
||||
|
||||
uint32_t object_id = data[0]; /* 4 bytes for object id */
|
||||
object_id_t object_id = data[0]; /* 4 bytes for object id */
|
||||
size_t msglen = data[1] >> 16; /* 2 bytes message length */
|
||||
uint32_t opcode = data[1] & 0xFFFF; /* 2 bytes for opcode */
|
||||
if (len < msglen)
|
||||
|
|
@ -495,7 +495,7 @@ MUNIT_TEST(test_brei_marshal_bad_sig)
|
|||
static int
|
||||
brei_send_message(struct brei_context *brei,
|
||||
int fd,
|
||||
uint32_t id,
|
||||
object_id_t id,
|
||||
uint32_t opcode,
|
||||
const char *signature,
|
||||
size_t nargs,
|
||||
|
|
@ -512,7 +512,7 @@ brei_send_message(struct brei_context *brei,
|
|||
}
|
||||
|
||||
static int
|
||||
brei_send_message_va(int fd, uint32_t id, uint32_t opcode,
|
||||
brei_send_message_va(int fd, object_id_t id, uint32_t opcode,
|
||||
const char *signature, size_t nargs, ...)
|
||||
{
|
||||
_unref_(brei_context) *brei = brei_context_new(NULL);
|
||||
|
|
@ -534,7 +534,7 @@ MUNIT_TEST(test_brei_send_message)
|
|||
|
||||
{
|
||||
const int msglen = 16; /* 8 header + 2 * 4 bytes */
|
||||
uint32_t id = 1;
|
||||
object_id_t id = 1;
|
||||
uint32_t opcode = 2;
|
||||
const char *signature = "uu";
|
||||
int rc = brei_send_message_va(sock_write, id, opcode, signature, 2, 0xff, 0xdddd);
|
||||
|
|
@ -550,7 +550,7 @@ MUNIT_TEST(test_brei_send_message)
|
|||
}
|
||||
{
|
||||
const int msglen = 16; /* 8 header + 2 * 4 bytes */
|
||||
uint32_t id = 1;
|
||||
object_id_t id = 1;
|
||||
uint32_t opcode = 2;
|
||||
const char *signature = "fi";
|
||||
int rc = brei_send_message_va(sock_write, id, opcode, signature, 2, 1.234, -12);
|
||||
|
|
@ -576,7 +576,7 @@ MUNIT_TEST(test_brei_send_message)
|
|||
munit_assert_int(slen, ==, sizeof(string));
|
||||
|
||||
const int msglen = 24 + slen; /* 8 header + 3 * 4 bytes + 4 bytes slen + string length */
|
||||
uint32_t id = 2;
|
||||
object_id_t id = 2;
|
||||
uint32_t opcode = 3;
|
||||
const char *signature = "ison";
|
||||
int rc = brei_send_message_va(sock_write, id, opcode, signature, 4,
|
||||
|
|
@ -602,7 +602,7 @@ MUNIT_TEST(test_brei_send_message)
|
|||
const char string2[8] = "barba"; /* tests padding too */
|
||||
|
||||
const int msglen = 16 + sizeof(string1) + sizeof(string2); /* 8 header + 2 * 4 bytes slen + string lengths */
|
||||
uint32_t id = 2;
|
||||
object_id_t id = 2;
|
||||
uint32_t opcode = 3;
|
||||
const char *signature = "ss";
|
||||
int rc = brei_send_message_va(sock_write, id, opcode, signature, 2, string1, string2);
|
||||
|
|
@ -630,7 +630,7 @@ MUNIT_TEST(test_brei_send_message)
|
|||
char data[] = "some data\n";
|
||||
|
||||
const int msglen = 16; /* 8 header, 2 unsigned, fd is not in data */
|
||||
uint32_t id = 2;
|
||||
object_id_t id = 2;
|
||||
uint32_t opcode = 3;
|
||||
const char *signature = "uhu";
|
||||
rc = brei_send_message_va(sock_write, id, opcode, signature, 3, 0xab, right, 0xcd);
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@
|
|||
#include "util-list.h"
|
||||
#include "util-object.h"
|
||||
|
||||
typedef uint32_t object_id_t;
|
||||
|
||||
struct brei_interface;
|
||||
struct brei_message;
|
||||
struct brei_object;
|
||||
|
|
@ -87,8 +89,8 @@ union brei_arg {
|
|||
float f;
|
||||
int h;
|
||||
const char *s;
|
||||
uint32_t o;
|
||||
uint32_t n;
|
||||
object_id_t o;
|
||||
object_id_t n;
|
||||
uint64_t t;
|
||||
int64_t x;
|
||||
};
|
||||
|
|
@ -119,7 +121,7 @@ struct brei_interface {
|
|||
struct brei_object {
|
||||
const struct brei_interface *interface;
|
||||
void *implementation; /* pointer to the actual object */
|
||||
uint32_t id; /* protocol object id */
|
||||
object_id_t id; /* protocol object id */
|
||||
uint32_t version; /* protocol object interface version */
|
||||
struct list link; /* in the ei/eis object list */
|
||||
};
|
||||
|
|
@ -131,7 +133,7 @@ struct brei_object {
|
|||
*/
|
||||
struct brei_result *
|
||||
brei_marshal_message(struct brei_context *brei,
|
||||
uint32_t id,
|
||||
object_id_t id,
|
||||
uint32_t opcode,
|
||||
const char *signature,
|
||||
size_t nargs,
|
||||
|
|
@ -150,7 +152,7 @@ brei_marshal_message(struct brei_context *brei,
|
|||
struct brei_result *
|
||||
brei_dispatch(struct brei_context *brei,
|
||||
int fd,
|
||||
int (*lookup_object)(uint32_t object_id, struct brei_object **object, void *user_data),
|
||||
int (*lookup_object)(object_id_t object_id, struct brei_object **object, void *user_data),
|
||||
void *user_data);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ ei_callback_get_context(struct ei_callback *callback)
|
|||
return ei_callback_parent(callback);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
object_id_t
|
||||
ei_callback_get_id(struct ei_callback *callback)
|
||||
{
|
||||
return callback->proto_object.id;
|
||||
|
|
@ -103,7 +103,7 @@ ei_callback_new(struct ei *ei, ei_callback_func func, void *callback_data)
|
|||
}
|
||||
|
||||
struct ei_callback *
|
||||
ei_callback_new_for_id(struct ei *ei, uint32_t id, uint32_t version)
|
||||
ei_callback_new_for_id(struct ei *ei, object_id_t id, uint32_t version)
|
||||
{
|
||||
struct ei_callback *callback = ei_callback_create(&ei->object);
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ struct ei_callback {
|
|||
|
||||
OBJECT_DECLARE_GETTER(ei_callback, context, struct ei*);
|
||||
OBJECT_DECLARE_GETTER(ei_callback, proto_object, const struct brei_object *);
|
||||
OBJECT_DECLARE_GETTER(ei_callback, id, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(ei_callback, id, object_id_t);
|
||||
OBJECT_DECLARE_GETTER(ei_callback, interface, const struct ei_callback_interface *);
|
||||
OBJECT_DECLARE_GETTER(ei_callback, user_data, void *);
|
||||
OBJECT_DECLARE_SETTER(ei_callback, user_data, void *);
|
||||
|
|
@ -59,4 +59,4 @@ struct ei_callback *
|
|||
ei_callback_new(struct ei *ei, ei_callback_func func, void *callback_data);
|
||||
|
||||
struct ei_callback *
|
||||
ei_callback_new_for_id(struct ei *ei, uint32_t id, uint32_t version);
|
||||
ei_callback_new_for_id(struct ei *ei, object_id_t id, uint32_t version);
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ ei_connection_get_version(struct ei_connection *connection)
|
|||
return connection->proto_object.version;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
object_id_t
|
||||
ei_connection_get_id(struct ei_connection *connection)
|
||||
{
|
||||
return connection->proto_object.id;
|
||||
|
|
@ -86,7 +86,7 @@ ei_connection_get_interface(struct ei_connection *connection) {
|
|||
}
|
||||
|
||||
struct ei_connection *
|
||||
ei_connection_new(struct ei *ei, uint32_t id, uint32_t version)
|
||||
ei_connection_new(struct ei *ei, object_id_t id, uint32_t version)
|
||||
{
|
||||
struct ei_connection *connection = ei_connection_create(&ei->object);
|
||||
|
||||
|
|
|
|||
|
|
@ -42,14 +42,14 @@ struct ei_connection {
|
|||
|
||||
OBJECT_DECLARE_GETTER(ei_connection, context, struct ei*);
|
||||
OBJECT_DECLARE_GETTER(ei_connection, version, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(ei_connection, id, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(ei_connection, id, object_id_t);
|
||||
OBJECT_DECLARE_GETTER(ei_connection, proto_object, const struct brei_object*);
|
||||
OBJECT_DECLARE_GETTER(ei_connection, interface, const struct ei_connection_interface *);
|
||||
OBJECT_DECLARE_REF(ei_connection);
|
||||
OBJECT_DECLARE_UNREF(ei_connection);
|
||||
|
||||
struct ei_connection *
|
||||
ei_connection_new(struct ei *ei, uint32_t id, uint32_t version);
|
||||
ei_connection_new(struct ei *ei, object_id_t id, uint32_t version);
|
||||
|
||||
/**
|
||||
* Called when the ei_callback.done event is received after
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ _public_
|
|||
OBJECT_IMPLEMENT_SETTER(ei_device, user_data, void *);
|
||||
OBJECT_IMPLEMENT_GETTER(ei_device, width, uint32_t);
|
||||
OBJECT_IMPLEMENT_GETTER(ei_device, height, uint32_t);
|
||||
OBJECT_IMPLEMENT_GETTER(ei_device, id, uint32_t);
|
||||
OBJECT_IMPLEMENT_GETTER(ei_device, id, object_id_t);
|
||||
OBJECT_IMPLEMENT_GETTER_AS_REF(ei_device, proto_object, const struct brei_object *);
|
||||
|
||||
_public_ struct ei_seat *
|
||||
|
|
@ -375,7 +375,7 @@ handle_msg_frame(struct ei_device *device, uint32_t serial, uint64_t time)
|
|||
}
|
||||
|
||||
static struct brei_result *
|
||||
handle_msg_pointer(struct ei_device *device, uint32_t id, uint32_t version)
|
||||
handle_msg_pointer(struct ei_device *device, object_id_t id, uint32_t version)
|
||||
{
|
||||
if (device->pointer)
|
||||
return brei_result_new(EI_CONNECTION_DISCONNECT_REASON_PROTOCOL,
|
||||
|
|
@ -387,7 +387,7 @@ handle_msg_pointer(struct ei_device *device, uint32_t id, uint32_t version)
|
|||
}
|
||||
|
||||
static struct brei_result *
|
||||
handle_msg_keyboard(struct ei_device *device, uint32_t id, uint32_t version)
|
||||
handle_msg_keyboard(struct ei_device *device, object_id_t id, uint32_t version)
|
||||
{
|
||||
if (device->keyboard)
|
||||
return brei_result_new(EI_CONNECTION_DISCONNECT_REASON_PROTOCOL,
|
||||
|
|
@ -399,7 +399,7 @@ handle_msg_keyboard(struct ei_device *device, uint32_t id, uint32_t version)
|
|||
}
|
||||
|
||||
static struct brei_result *
|
||||
handle_msg_touchscreen(struct ei_device *device, uint32_t id, uint32_t version)
|
||||
handle_msg_touchscreen(struct ei_device *device, object_id_t id, uint32_t version)
|
||||
{
|
||||
if (device->touchscreen)
|
||||
return brei_result_new(EI_CONNECTION_DISCONNECT_REASON_PROTOCOL,
|
||||
|
|
@ -764,7 +764,7 @@ ei_device_get_touchscreen_interface(struct ei_device *device)
|
|||
}
|
||||
|
||||
struct ei_device *
|
||||
ei_device_new(struct ei_seat *seat, uint32_t deviceid, uint32_t version)
|
||||
ei_device_new(struct ei_seat *seat, object_id_t deviceid, uint32_t version)
|
||||
{
|
||||
struct ei_device *device = ei_device_create(&seat->object);
|
||||
struct ei *ei = ei_seat_get_context(seat);
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ struct ei_touch {
|
|||
double x, y;
|
||||
};
|
||||
|
||||
OBJECT_DECLARE_GETTER(ei_device, id, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(ei_device, id, object_id_t);
|
||||
OBJECT_DECLARE_GETTER(ei_device, proto_object, const struct brei_object *);
|
||||
OBJECT_DECLARE_GETTER(ei_device, interface, const struct ei_device_interface *);
|
||||
OBJECT_DECLARE_GETTER(ei_device, pointer_interface, const struct ei_pointer_interface *);
|
||||
|
|
@ -122,7 +122,7 @@ OBJECT_DECLARE_SETTER(ei_device, seat, const char*);
|
|||
OBJECT_DECLARE_SETTER(ei_device, capabilities, uint32_t);
|
||||
|
||||
struct ei_device *
|
||||
ei_device_new(struct ei_seat *seat, uint32_t deviceid, uint32_t version);
|
||||
ei_device_new(struct ei_seat *seat, object_id_t deviceid, uint32_t version);
|
||||
|
||||
void
|
||||
ei_device_add_region(struct ei_device *device, struct ei_region *r);
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ connected(struct ei_connection *connection, void *user_data)
|
|||
}
|
||||
|
||||
static struct brei_result *
|
||||
handle_msg_connection(struct ei_handshake *setup, uint32_t serial, uint32_t id, uint32_t version)
|
||||
handle_msg_connection(struct ei_handshake *setup, uint32_t serial, object_id_t id, uint32_t version)
|
||||
{
|
||||
struct ei *ei = ei_handshake_get_context(setup);
|
||||
assert(setup == ei->handshake);
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ struct ei_handshake {
|
|||
|
||||
OBJECT_DECLARE_GETTER(ei_handshake, context, struct ei*);
|
||||
OBJECT_DECLARE_GETTER(ei_handshake, proto_object, const struct brei_object *);
|
||||
OBJECT_DECLARE_GETTER(ei_handshake, id, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(ei_handshake, id, object_id_t);
|
||||
OBJECT_DECLARE_GETTER(ei_handshake, version, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(ei_handshake, interface, const struct ei_handshake_interface *);
|
||||
OBJECT_DECLARE_GETTER(ei_handshake, user_data, void*);
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ ei_keyboard_get_interface(struct ei_keyboard *keyboard) {
|
|||
}
|
||||
|
||||
struct ei_keyboard *
|
||||
ei_keyboard_new(struct ei_device *device, uint32_t id, uint32_t version)
|
||||
ei_keyboard_new(struct ei_device *device, object_id_t id, uint32_t version)
|
||||
{
|
||||
struct ei_keyboard *keyboard = ei_keyboard_create(&device->object);
|
||||
struct ei *ei = ei_device_get_context(device);
|
||||
|
|
|
|||
|
|
@ -46,4 +46,4 @@ OBJECT_DECLARE_REF(ei_keyboard);
|
|||
OBJECT_DECLARE_UNREF(ei_keyboard);
|
||||
|
||||
struct ei_keyboard *
|
||||
ei_keyboard_new(struct ei_device *device, uint32_t id, uint32_t version);
|
||||
ei_keyboard_new(struct ei_device *device, object_id_t id, uint32_t version);
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ ei_pingpong_get_context(struct ei_pingpong *pingpong)
|
|||
return ei_pingpong_parent(pingpong);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
object_id_t
|
||||
ei_pingpong_get_id(struct ei_pingpong *pingpong)
|
||||
{
|
||||
return pingpong->proto_object.id;
|
||||
|
|
@ -95,7 +95,7 @@ ei_pingpong_new(struct ei *ei, ei_pingpong_func func, void *pingpong_data)
|
|||
}
|
||||
|
||||
struct ei_pingpong *
|
||||
ei_pingpong_new_for_id(struct ei *ei, uint32_t id, uint32_t version)
|
||||
ei_pingpong_new_for_id(struct ei *ei, object_id_t id, uint32_t version)
|
||||
{
|
||||
struct ei_pingpong *pingpong = ei_pingpong_create(&ei->object);
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ struct ei_pingpong {
|
|||
|
||||
OBJECT_DECLARE_GETTER(ei_pingpong, context, struct ei*);
|
||||
OBJECT_DECLARE_GETTER(ei_pingpong, proto_object, const struct brei_object *);
|
||||
OBJECT_DECLARE_GETTER(ei_pingpong, id, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(ei_pingpong, id, object_id_t);
|
||||
OBJECT_DECLARE_GETTER(ei_pingpong, interface, const struct ei_pingpong_interface *);
|
||||
OBJECT_DECLARE_GETTER(ei_pingpong, user_data, void *);
|
||||
OBJECT_DECLARE_SETTER(ei_pingpong, user_data, void *);
|
||||
|
|
@ -59,4 +59,4 @@ struct ei_pingpong *
|
|||
ei_pingpong_new(struct ei *ei, ei_pingpong_func func, void *pingpong_data);
|
||||
|
||||
struct ei_pingpong *
|
||||
ei_pingpong_new_for_id(struct ei *ei, uint32_t id, uint32_t version);
|
||||
ei_pingpong_new_for_id(struct ei *ei, object_id_t id, uint32_t version);
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ ei_pointer_get_interface(struct ei_pointer *pointer) {
|
|||
}
|
||||
|
||||
struct ei_pointer *
|
||||
ei_pointer_new(struct ei_device *device, uint32_t id, uint32_t version)
|
||||
ei_pointer_new(struct ei_device *device, object_id_t id, uint32_t version)
|
||||
{
|
||||
struct ei_pointer *pointer = ei_pointer_create(&device->object);
|
||||
struct ei *ei = ei_device_get_context(device);
|
||||
|
|
|
|||
|
|
@ -46,4 +46,4 @@ OBJECT_DECLARE_REF(ei_pointer);
|
|||
OBJECT_DECLARE_UNREF(ei_pointer);
|
||||
|
||||
struct ei_pointer *
|
||||
ei_pointer_new(struct ei_device *device, uint32_t id, uint32_t version);
|
||||
ei_pointer_new(struct ei_device *device, object_id_t id, uint32_t version);
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ struct ei {
|
|||
struct ei_handshake *handshake;
|
||||
struct ei_interface_versions interface_versions;
|
||||
struct list proto_objects; /* brei_object list */
|
||||
uint32_t next_object_id;
|
||||
object_id_t next_object_id;
|
||||
|
||||
uint32_t serial;
|
||||
|
||||
|
|
@ -117,7 +117,7 @@ ei_get_context(struct ei *ei);
|
|||
struct ei_connection *
|
||||
ei_get_connection(struct ei *ei);
|
||||
|
||||
uint32_t
|
||||
object_id_t
|
||||
ei_get_new_id(struct ei *ei);
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ ei_seat_get_context(struct ei_seat *seat)
|
|||
return ei_seat_parent(seat);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
object_id_t
|
||||
ei_seat_get_id(struct ei_seat *seat) {
|
||||
return seat->proto_object.id;
|
||||
}
|
||||
|
|
@ -119,7 +119,7 @@ handle_msg_done(struct ei_seat *seat)
|
|||
}
|
||||
|
||||
static struct brei_result *
|
||||
handle_msg_device(struct ei_seat *seat, uint32_t id, uint32_t version)
|
||||
handle_msg_device(struct ei_seat *seat, object_id_t id, uint32_t version)
|
||||
{
|
||||
struct ei *ei = ei_seat_get_context(seat);
|
||||
|
||||
|
|
@ -146,7 +146,7 @@ ei_seat_get_interface(struct ei_seat *seat) {
|
|||
}
|
||||
|
||||
struct ei_seat *
|
||||
ei_seat_new(struct ei *ei, uint32_t id, uint32_t version)
|
||||
ei_seat_new(struct ei *ei, object_id_t id, uint32_t version)
|
||||
{
|
||||
struct ei_seat *seat = ei_seat_create(&ei->object);
|
||||
|
||||
|
|
|
|||
|
|
@ -52,12 +52,12 @@ struct ei_seat {
|
|||
char *name;
|
||||
};
|
||||
|
||||
OBJECT_DECLARE_GETTER(ei_seat, id, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(ei_seat, id, object_id_t);
|
||||
OBJECT_DECLARE_GETTER(ei_seat, proto_object, const struct brei_object *);
|
||||
OBJECT_DECLARE_GETTER(ei_seat, interface, const struct ei_seat_interface *);
|
||||
|
||||
struct ei_seat *
|
||||
ei_seat_new(struct ei *ei, uint32_t id, uint32_t version);
|
||||
ei_seat_new(struct ei *ei, object_id_t id, uint32_t version);
|
||||
|
||||
struct ei_device *
|
||||
ei_seat_find_device(struct ei_seat *seat, uint32_t deviceid);
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ ei_touchscreen_get_interface(struct ei_touchscreen *touchscreen) {
|
|||
}
|
||||
|
||||
struct ei_touchscreen *
|
||||
ei_touchscreen_new(struct ei_device *device, uint32_t id, uint32_t version)
|
||||
ei_touchscreen_new(struct ei_device *device, object_id_t id, uint32_t version)
|
||||
{
|
||||
struct ei_touchscreen *touchscreen = ei_touchscreen_create(&device->object);
|
||||
struct ei *ei = ei_device_get_context(device);
|
||||
|
|
|
|||
|
|
@ -46,4 +46,4 @@ OBJECT_DECLARE_REF(ei_touchscreen);
|
|||
OBJECT_DECLARE_UNREF(ei_touchscreen);
|
||||
|
||||
struct ei_touchscreen *
|
||||
ei_touchscreen_new(struct ei_device *device, uint32_t id, uint32_t version);
|
||||
ei_touchscreen_new(struct ei_device *device, object_id_t id, uint32_t version);
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ ei_create_context(bool is_sender, void *user_data)
|
|||
return steal(&ei);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
object_id_t
|
||||
ei_get_new_id(struct ei *ei)
|
||||
{
|
||||
static const int server_range = 0xff000000;
|
||||
|
|
@ -597,7 +597,7 @@ ei_disconnect(struct ei *ei)
|
|||
}
|
||||
|
||||
static struct brei_result *
|
||||
handle_msg_seat(struct ei_connection *connection, uint32_t seat_id, uint32_t version)
|
||||
handle_msg_seat(struct ei_connection *connection, object_id_t seat_id, uint32_t version)
|
||||
{
|
||||
struct ei *ei = ei_connection_get_context(connection);
|
||||
struct ei_seat *seat = ei_seat_new(ei, seat_id, version);
|
||||
|
|
@ -690,7 +690,7 @@ handle_msg_invalid_object(struct ei_connection *connection, uint32_t last_serial
|
|||
}
|
||||
|
||||
static struct brei_result *
|
||||
handle_msg_ping(struct ei_connection *connection, uint32_t id, uint32_t version)
|
||||
handle_msg_ping(struct ei_connection *connection, object_id_t id, uint32_t version)
|
||||
{
|
||||
struct ei *ei = ei_connection_get_context(connection);
|
||||
_unref_(ei_pingpong) *pingpong = ei_pingpong_new_for_id(ei, id, version);
|
||||
|
|
@ -714,7 +714,7 @@ ei_get_interface(struct ei *ei)
|
|||
}
|
||||
|
||||
static int
|
||||
lookup_object(uint32_t object_id, struct brei_object **object, void *userdata)
|
||||
lookup_object(object_id_t object_id, struct brei_object **object, void *userdata)
|
||||
{
|
||||
struct ei *ei = userdata;
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ eis_callback_get_context(struct eis_callback *callback)
|
|||
return eis_client_get_context(client);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
object_id_t
|
||||
eis_callback_get_id(struct eis_callback *callback)
|
||||
{
|
||||
return callback->proto_object.id;
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ struct eis_callback {
|
|||
|
||||
OBJECT_DECLARE_GETTER(eis_callback, context, struct eis *);
|
||||
OBJECT_DECLARE_GETTER(eis_callback, client, struct eis_client *);
|
||||
OBJECT_DECLARE_GETTER(eis_callback, id, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(eis_callback, id, object_id_t);
|
||||
OBJECT_DECLARE_GETTER(eis_callback, version, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(eis_callback, proto_object, const struct brei_object *);
|
||||
OBJECT_DECLARE_GETTER(eis_callback, interface, const struct eis_callback_interface *);
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ eis_client_get_proto_object(struct eis_client *client)
|
|||
return &client->connection->proto_object;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
object_id_t
|
||||
eis_client_get_new_id(struct eis_client *client)
|
||||
{
|
||||
static const int offset = 0xff000000;
|
||||
|
|
@ -296,7 +296,7 @@ client_msg_disconnect(struct eis_connection *connection)
|
|||
}
|
||||
|
||||
static struct brei_result *
|
||||
client_msg_sync(struct eis_connection *connection, uint32_t new_id)
|
||||
client_msg_sync(struct eis_connection *connection, object_id_t new_id)
|
||||
{
|
||||
if (new_id == 0) {
|
||||
return brei_result_new(EIS_CONNECTION_DISCONNECT_REASON_VALUE,
|
||||
|
|
@ -342,7 +342,7 @@ eis_client_get_interface(struct eis_client *client)
|
|||
}
|
||||
|
||||
static int
|
||||
lookup_object(uint32_t object_id, struct brei_object **object, void *userdata)
|
||||
lookup_object(object_id_t object_id, struct brei_object **object, void *userdata)
|
||||
{
|
||||
struct eis_client *client = userdata;
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ struct eis_client {
|
|||
struct eis_connection *connection;
|
||||
|
||||
struct list proto_objects; /* struct brei_objects list */
|
||||
uint32_t next_object_id;
|
||||
object_id_t next_object_id;
|
||||
|
||||
uint32_t serial;
|
||||
uint32_t last_client_serial;
|
||||
|
|
@ -96,7 +96,7 @@ eis_client_get_next_serial(struct eis_client *client);
|
|||
void
|
||||
eis_client_update_client_serial(struct eis_client *client, uint32_t serial);
|
||||
|
||||
uint32_t
|
||||
object_id_t
|
||||
eis_client_get_new_id(struct eis_client *client);
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ eis_connection_get_version(struct eis_connection *connection)
|
|||
return connection->proto_object.version;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
object_id_t
|
||||
eis_connection_get_id(struct eis_connection *connection)
|
||||
{
|
||||
return connection->proto_object.id;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ struct eis_connection {
|
|||
};
|
||||
|
||||
OBJECT_DECLARE_GETTER(eis_connection, context, struct eis *);
|
||||
OBJECT_DECLARE_GETTER(eis_connection, id, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(eis_connection, id, object_id_t);
|
||||
OBJECT_DECLARE_GETTER(eis_connection, version, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(eis_connection, client, struct eis_client *);
|
||||
OBJECT_DECLARE_GETTER(eis_connection, proto_object, const struct brei_object *);
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ _public_
|
|||
OBJECT_IMPLEMENT_GETTER(eis_device, height, uint32_t);
|
||||
OBJECT_IMPLEMENT_GETTER_AS_REF(eis_device, proto_object, const struct brei_object *);
|
||||
|
||||
uint32_t
|
||||
object_id_t
|
||||
eis_device_get_id(struct eis_device *device)
|
||||
{
|
||||
return device->proto_object.id;
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ struct eis_xkb_modifiers {
|
|||
uint32_t group;
|
||||
};
|
||||
|
||||
OBJECT_DECLARE_GETTER(eis_device, id, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(eis_device, id, object_id_t);
|
||||
OBJECT_DECLARE_GETTER(eis_device, context, struct eis *);
|
||||
OBJECT_DECLARE_GETTER(eis_device, proto_object, const struct brei_object *);
|
||||
OBJECT_DECLARE_GETTER(eis_device, interface, const struct eis_device_interface *);
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ eis_handshake_get_context(struct eis_handshake *setup)
|
|||
return eis_client_get_context(client);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
object_id_t
|
||||
eis_handshake_get_id(struct eis_handshake *setup)
|
||||
{
|
||||
return setup->proto_object.id;
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ struct eis_handshake {
|
|||
|
||||
OBJECT_DECLARE_GETTER(eis_handshake, context, struct eis *);
|
||||
OBJECT_DECLARE_GETTER(eis_handshake, client, struct eis_client *);
|
||||
OBJECT_DECLARE_GETTER(eis_handshake, id, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(eis_handshake, id, object_id_t);
|
||||
OBJECT_DECLARE_GETTER(eis_handshake, version, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(eis_handshake, proto_object, const struct brei_object *);
|
||||
OBJECT_DECLARE_GETTER(eis_handshake, interface, const struct eis_handshake_interface *);
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ eis_keyboard_get_version(struct eis_keyboard *keyboard)
|
|||
return keyboard->proto_object.version;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
object_id_t
|
||||
eis_keyboard_get_id(struct eis_keyboard *keyboard)
|
||||
{
|
||||
return keyboard->proto_object.id;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ struct eis_keyboard {
|
|||
OBJECT_DECLARE_GETTER(eis_keyboard, context, struct eis *);
|
||||
OBJECT_DECLARE_GETTER(eis_keyboard, device, struct eis_device *);
|
||||
OBJECT_DECLARE_GETTER(eis_keyboard, client, struct eis_client *);
|
||||
OBJECT_DECLARE_GETTER(eis_keyboard, id, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(eis_keyboard, id, object_id_t);
|
||||
OBJECT_DECLARE_GETTER(eis_keyboard, version, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(eis_keyboard, proto_object, const struct brei_object *);
|
||||
OBJECT_DECLARE_GETTER(eis_keyboard, interface, const struct eis_keyboard_interface *);
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ eis_pingpong_get_context(struct eis_pingpong *pingpong)
|
|||
return eis_client_get_context(client);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
object_id_t
|
||||
eis_pingpong_get_id(struct eis_pingpong *pingpong)
|
||||
{
|
||||
return pingpong->proto_object.id;
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ struct eis_pingpong {
|
|||
|
||||
OBJECT_DECLARE_GETTER(eis_pingpong, context, struct eis *);
|
||||
OBJECT_DECLARE_GETTER(eis_pingpong, client, struct eis_client *);
|
||||
OBJECT_DECLARE_GETTER(eis_pingpong, id, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(eis_pingpong, id, object_id_t);
|
||||
OBJECT_DECLARE_GETTER(eis_pingpong, version, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(eis_pingpong, proto_object, const struct brei_object *);
|
||||
OBJECT_DECLARE_GETTER(eis_pingpong, interface, const struct eis_pingpong_interface *);
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ eis_pointer_get_version(struct eis_pointer *pointer)
|
|||
return pointer->proto_object.version;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
object_id_t
|
||||
eis_pointer_get_id(struct eis_pointer *pointer)
|
||||
{
|
||||
return pointer->proto_object.id;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ struct eis_pointer {
|
|||
OBJECT_DECLARE_GETTER(eis_pointer, context, struct eis *);
|
||||
OBJECT_DECLARE_GETTER(eis_pointer, device, struct eis_device *);
|
||||
OBJECT_DECLARE_GETTER(eis_pointer, client, struct eis_client *);
|
||||
OBJECT_DECLARE_GETTER(eis_pointer, id, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(eis_pointer, id, object_id_t);
|
||||
OBJECT_DECLARE_GETTER(eis_pointer, version, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(eis_pointer, proto_object, const struct brei_object *);
|
||||
OBJECT_DECLARE_GETTER(eis_pointer, interface, const struct eis_pointer_interface *);
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ _public_
|
|||
OBJECT_IMPLEMENT_GETTER(eis_seat, name, const char *);
|
||||
OBJECT_IMPLEMENT_GETTER_AS_REF(eis_seat, proto_object, const struct brei_object *);
|
||||
|
||||
uint32_t
|
||||
object_id_t
|
||||
eis_seat_get_id(struct eis_seat *seat) {
|
||||
return seat->proto_object.id;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ struct eis_seat {
|
|||
struct list devices;
|
||||
};
|
||||
|
||||
OBJECT_DECLARE_GETTER(eis_seat, id, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(eis_seat, id, object_id_t);
|
||||
OBJECT_DECLARE_GETTER(eis_seat, version, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(eis_seat, proto_object, const struct brei_object *);
|
||||
OBJECT_DECLARE_GETTER(eis_seat, interface, const struct eis_seat_interface *);
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ eis_touchscreen_get_version(struct eis_touchscreen *touchscreen)
|
|||
return touchscreen->proto_object.version;
|
||||
}
|
||||
|
||||
uint32_t
|
||||
object_id_t
|
||||
eis_touchscreen_get_id(struct eis_touchscreen *touchscreen)
|
||||
{
|
||||
return touchscreen->proto_object.id;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ struct eis_touchscreen {
|
|||
OBJECT_DECLARE_GETTER(eis_touchscreen, context, struct eis *);
|
||||
OBJECT_DECLARE_GETTER(eis_touchscreen, device, struct eis_device *);
|
||||
OBJECT_DECLARE_GETTER(eis_touchscreen, client, struct eis_client *);
|
||||
OBJECT_DECLARE_GETTER(eis_touchscreen, id, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(eis_touchscreen, id, object_id_t);
|
||||
OBJECT_DECLARE_GETTER(eis_touchscreen, version, uint32_t);
|
||||
OBJECT_DECLARE_GETTER(eis_touchscreen, proto_object, const struct brei_object *);
|
||||
OBJECT_DECLARE_GETTER(eis_touchscreen, interface, const struct eis_touchscreen_interface *);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue