diff --git a/src/brei-shared.c b/src/brei-shared.c index c21c39a..6522069 100644 --- a/src/brei-shared.c +++ b/src/brei-shared.c @@ -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); diff --git a/src/brei-shared.h b/src/brei-shared.h index e5fa4ca..e873c14 100644 --- a/src/brei-shared.h +++ b/src/brei-shared.h @@ -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); /** diff --git a/src/libei-callback.c b/src/libei-callback.c index 679f468..6acec2f 100644 --- a/src/libei-callback.c +++ b/src/libei-callback.c @@ -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); diff --git a/src/libei-callback.h b/src/libei-callback.h index de836f3..e2744f4 100644 --- a/src/libei-callback.h +++ b/src/libei-callback.h @@ -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); diff --git a/src/libei-connection.c b/src/libei-connection.c index 45024c5..f342089 100644 --- a/src/libei-connection.c +++ b/src/libei-connection.c @@ -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); diff --git a/src/libei-connection.h b/src/libei-connection.h index 56ab294..b06cd7a 100644 --- a/src/libei-connection.h +++ b/src/libei-connection.h @@ -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 diff --git a/src/libei-device.c b/src/libei-device.c index dba90e2..ecb7453 100644 --- a/src/libei-device.c +++ b/src/libei-device.c @@ -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); diff --git a/src/libei-device.h b/src/libei-device.h index 9d7424c..3697211 100644 --- a/src/libei-device.h +++ b/src/libei-device.h @@ -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); diff --git a/src/libei-handshake.c b/src/libei-handshake.c index 833d7d1..507a86d 100644 --- a/src/libei-handshake.c +++ b/src/libei-handshake.c @@ -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); diff --git a/src/libei-handshake.h b/src/libei-handshake.h index a050297..e2dfb91 100644 --- a/src/libei-handshake.h +++ b/src/libei-handshake.h @@ -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*); diff --git a/src/libei-keyboard.c b/src/libei-keyboard.c index 073f4a3..25e0496 100644 --- a/src/libei-keyboard.c +++ b/src/libei-keyboard.c @@ -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); diff --git a/src/libei-keyboard.h b/src/libei-keyboard.h index fda0996..21e7d4e 100644 --- a/src/libei-keyboard.h +++ b/src/libei-keyboard.h @@ -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); diff --git a/src/libei-pingpong.c b/src/libei-pingpong.c index 2b22e99..3f929f0 100644 --- a/src/libei-pingpong.c +++ b/src/libei-pingpong.c @@ -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); diff --git a/src/libei-pingpong.h b/src/libei-pingpong.h index 388c91d..526f9cc 100644 --- a/src/libei-pingpong.h +++ b/src/libei-pingpong.h @@ -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); diff --git a/src/libei-pointer.c b/src/libei-pointer.c index 5080a25..503299d 100644 --- a/src/libei-pointer.c +++ b/src/libei-pointer.c @@ -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); diff --git a/src/libei-pointer.h b/src/libei-pointer.h index 4ea0fe0..e16d8c8 100644 --- a/src/libei-pointer.h +++ b/src/libei-pointer.h @@ -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); diff --git a/src/libei-private.h b/src/libei-private.h index 5014ee6..3aec616 100644 --- a/src/libei-private.h +++ b/src/libei-private.h @@ -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 diff --git a/src/libei-seat.c b/src/libei-seat.c index 9cc51c4..5c9cff0 100644 --- a/src/libei-seat.c +++ b/src/libei-seat.c @@ -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); diff --git a/src/libei-seat.h b/src/libei-seat.h index 6ba5398..64625a3 100644 --- a/src/libei-seat.h +++ b/src/libei-seat.h @@ -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); diff --git a/src/libei-touchscreen.c b/src/libei-touchscreen.c index ffbd047..e24917b 100644 --- a/src/libei-touchscreen.c +++ b/src/libei-touchscreen.c @@ -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); diff --git a/src/libei-touchscreen.h b/src/libei-touchscreen.h index 5fdc56c..1cb32f2 100644 --- a/src/libei-touchscreen.h +++ b/src/libei-touchscreen.h @@ -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); diff --git a/src/libei.c b/src/libei.c index 4c8f9cd..2fd96be 100644 --- a/src/libei.c +++ b/src/libei.c @@ -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; diff --git a/src/libeis-callback.c b/src/libeis-callback.c index a7c5549..dd71204 100644 --- a/src/libeis-callback.c +++ b/src/libeis-callback.c @@ -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; diff --git a/src/libeis-callback.h b/src/libeis-callback.h index 75d1403..8819d04 100644 --- a/src/libeis-callback.h +++ b/src/libeis-callback.h @@ -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 *); diff --git a/src/libeis-client.c b/src/libeis-client.c index 9819641..40e3a76 100644 --- a/src/libeis-client.c +++ b/src/libeis-client.c @@ -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; diff --git a/src/libeis-client.h b/src/libeis-client.h index a06aed7..29809a3 100644 --- a/src/libeis-client.h +++ b/src/libeis-client.h @@ -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 diff --git a/src/libeis-connection.c b/src/libeis-connection.c index c734e35..167701c 100644 --- a/src/libeis-connection.c +++ b/src/libeis-connection.c @@ -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; diff --git a/src/libeis-connection.h b/src/libeis-connection.h index 684ccdb..f47ad5b 100644 --- a/src/libeis-connection.h +++ b/src/libeis-connection.h @@ -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 *); diff --git a/src/libeis-device.c b/src/libeis-device.c index 4f6e081..928e8b7 100644 --- a/src/libeis-device.c +++ b/src/libeis-device.c @@ -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; diff --git a/src/libeis-device.h b/src/libeis-device.h index b456097..f6a52e8 100644 --- a/src/libeis-device.h +++ b/src/libeis-device.h @@ -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 *); diff --git a/src/libeis-handshake.c b/src/libeis-handshake.c index d6ee91a..b6b7a9e 100644 --- a/src/libeis-handshake.c +++ b/src/libeis-handshake.c @@ -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; diff --git a/src/libeis-handshake.h b/src/libeis-handshake.h index 92d5d8a..c2f5930 100644 --- a/src/libeis-handshake.h +++ b/src/libeis-handshake.h @@ -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 *); diff --git a/src/libeis-keyboard.c b/src/libeis-keyboard.c index 45ddcae..93285f5 100644 --- a/src/libeis-keyboard.c +++ b/src/libeis-keyboard.c @@ -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; diff --git a/src/libeis-keyboard.h b/src/libeis-keyboard.h index 43bbfa3..2d79c73 100644 --- a/src/libeis-keyboard.h +++ b/src/libeis-keyboard.h @@ -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 *); diff --git a/src/libeis-pingpong.c b/src/libeis-pingpong.c index 45665d6..3c02fb9 100644 --- a/src/libeis-pingpong.c +++ b/src/libeis-pingpong.c @@ -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; diff --git a/src/libeis-pingpong.h b/src/libeis-pingpong.h index 3b4d3f3..551296a 100644 --- a/src/libeis-pingpong.h +++ b/src/libeis-pingpong.h @@ -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 *); diff --git a/src/libeis-pointer.c b/src/libeis-pointer.c index 71c5432..26ad745 100644 --- a/src/libeis-pointer.c +++ b/src/libeis-pointer.c @@ -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; diff --git a/src/libeis-pointer.h b/src/libeis-pointer.h index f57b3b4..7cbaec0 100644 --- a/src/libeis-pointer.h +++ b/src/libeis-pointer.h @@ -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 *); diff --git a/src/libeis-seat.c b/src/libeis-seat.c index d827c0e..d14e94d 100644 --- a/src/libeis-seat.c +++ b/src/libeis-seat.c @@ -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; } diff --git a/src/libeis-seat.h b/src/libeis-seat.h index d4cb3ad..a08d520 100644 --- a/src/libeis-seat.h +++ b/src/libeis-seat.h @@ -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 *); diff --git a/src/libeis-touchscreen.c b/src/libeis-touchscreen.c index e1feb72..a728b4a 100644 --- a/src/libeis-touchscreen.c +++ b/src/libeis-touchscreen.c @@ -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; diff --git a/src/libeis-touchscreen.h b/src/libeis-touchscreen.h index 8e33dbb..b68228f 100644 --- a/src/libeis-touchscreen.h +++ b/src/libeis-touchscreen.h @@ -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 *);