From deeca53e3348d4764d1daf2636b6bd8e25bd4a21 Mon Sep 17 00:00:00 2001 From: emersion Date: Sun, 8 Jul 2018 19:21:31 +0100 Subject: [PATCH] Rename wl_resources to resource, wl_global to global --- CONTRIBUTING.md | 4 ++-- include/wlr/types/wlr_compositor.h | 8 +++---- include/wlr/types/wlr_data_device.h | 2 +- include/wlr/types/wlr_gamma_control.h | 2 +- include/wlr/types/wlr_idle.h | 2 +- include/wlr/types/wlr_idle_inhibit_v1.h | 2 +- include/wlr/types/wlr_input_inhibitor.h | 2 +- include/wlr/types/wlr_layer_shell.h | 2 +- include/wlr/types/wlr_linux_dmabuf.h | 4 ++-- include/wlr/types/wlr_output.h | 4 ++-- include/wlr/types/wlr_screenshooter.h | 2 +- include/wlr/types/wlr_seat.h | 4 ++-- include/wlr/types/wlr_server_decoration.h | 4 ++-- include/wlr/types/wlr_wl_shell.h | 4 ++-- include/wlr/types/wlr_xdg_shell.h | 2 +- include/wlr/types/wlr_xdg_shell_v6.h | 2 +- types/data_device/wlr_data_device.c | 6 +++--- types/seat/wlr_seat.c | 20 ++++++++--------- types/wlr_compositor.c | 24 ++++++++++----------- types/wlr_gamma_control.c | 8 +++---- types/wlr_idle.c | 6 +++--- types/wlr_idle_inhibit_v1.c | 6 +++--- types/wlr_input_inhibitor.c | 6 +++--- types/wlr_layer_shell.c | 8 +++---- types/wlr_linux_dmabuf.c | 12 +++++------ types/wlr_output.c | 26 +++++++++++------------ types/wlr_primary_selection.c | 2 +- types/wlr_screenshooter.c | 6 +++--- types/wlr_server_decoration.c | 14 ++++++------ types/wlr_surface.c | 4 ++-- types/wlr_wl_shell.c | 14 ++++++------ types/xdg_shell/wlr_xdg_shell.c | 8 +++---- types/xdg_shell_v6/wlr_xdg_shell_v6.c | 8 +++---- 33 files changed, 114 insertions(+), 114 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c6110522..9085f454 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -248,8 +248,8 @@ listener. Example: ```c struct wlr_compositor { - struct wl_global *wl_global; - struct wl_list wl_resources; + struct wl_global *global; + struct wl_list resources; … struct wl_listener display_destroy; diff --git a/include/wlr/types/wlr_compositor.h b/include/wlr/types/wlr_compositor.h index 51702884..0d79b0bb 100644 --- a/include/wlr/types/wlr_compositor.h +++ b/include/wlr/types/wlr_compositor.h @@ -7,14 +7,14 @@ struct wlr_surface; struct wlr_subcompositor { - struct wl_global *wl_global; - struct wl_list wl_resources; + struct wl_global *global; + struct wl_list resources; struct wl_list subsurface_resources; }; struct wlr_compositor { - struct wl_global *wl_global; - struct wl_list wl_resources; + struct wl_global *global; + struct wl_list resources; struct wlr_renderer *renderer; struct wl_list surface_resources; struct wl_list region_resources; diff --git a/include/wlr/types/wlr_data_device.h b/include/wlr/types/wlr_data_device.h index 4de4d610..8b7b374c 100644 --- a/include/wlr/types/wlr_data_device.h +++ b/include/wlr/types/wlr_data_device.h @@ -15,7 +15,7 @@ wlr_touch_grab_interface wlr_data_device_touch_drag_interface; struct wlr_data_device_manager { struct wl_global *global; - struct wl_list wl_resources; + struct wl_list resources; struct wl_list data_sources; struct wl_listener display_destroy; diff --git a/include/wlr/types/wlr_gamma_control.h b/include/wlr/types/wlr_gamma_control.h index d3f4b8e5..f195c8ef 100644 --- a/include/wlr/types/wlr_gamma_control.h +++ b/include/wlr/types/wlr_gamma_control.h @@ -4,7 +4,7 @@ #include struct wlr_gamma_control_manager { - struct wl_global *wl_global; + struct wl_global *global; struct wl_list controls; // wlr_gamma_control::link struct wl_listener display_destroy; diff --git a/include/wlr/types/wlr_idle.h b/include/wlr/types/wlr_idle.h index aca9146c..53fc6b98 100644 --- a/include/wlr/types/wlr_idle.h +++ b/include/wlr/types/wlr_idle.h @@ -14,7 +14,7 @@ struct wlr_idle { - struct wl_global *wl_global; + struct wl_global *global; struct wl_list idle_timers; // wlr_idle_timeout::link struct wl_event_loop *event_loop; bool enabled; diff --git a/include/wlr/types/wlr_idle_inhibit_v1.h b/include/wlr/types/wlr_idle_inhibit_v1.h index 8c20d2c8..011abbe5 100644 --- a/include/wlr/types/wlr_idle_inhibit_v1.h +++ b/include/wlr/types/wlr_idle_inhibit_v1.h @@ -16,7 +16,7 @@ */ struct wlr_idle_inhibit_manager_v1 { - struct wl_list wl_resources; // wl_resource_get_link + struct wl_list resources; // wl_resource_get_link struct wl_list inhibitors; // wlr_idle_inhibit_inhibitor_v1::link struct wl_global *global; diff --git a/include/wlr/types/wlr_input_inhibitor.h b/include/wlr/types/wlr_input_inhibitor.h index 4416c18f..2f333f3b 100644 --- a/include/wlr/types/wlr_input_inhibitor.h +++ b/include/wlr/types/wlr_input_inhibitor.h @@ -3,7 +3,7 @@ #include struct wlr_input_inhibit_manager { - struct wl_global *wl_global; + struct wl_global *global; struct wl_client *active_client; struct wl_resource *active_inhibitor; diff --git a/include/wlr/types/wlr_layer_shell.h b/include/wlr/types/wlr_layer_shell.h index 1477989d..7cc6a5b8 100644 --- a/include/wlr/types/wlr_layer_shell.h +++ b/include/wlr/types/wlr_layer_shell.h @@ -20,7 +20,7 @@ * the compositor should begin rendering the surface. */ struct wlr_layer_shell { - struct wl_global *wl_global; + struct wl_global *global; struct wl_list client_resources; // wl_resource struct wl_list surfaces; // wl_layer_surface diff --git a/include/wlr/types/wlr_linux_dmabuf.h b/include/wlr/types/wlr_linux_dmabuf.h index ea219020..4a03170c 100644 --- a/include/wlr/types/wlr_linux_dmabuf.h +++ b/include/wlr/types/wlr_linux_dmabuf.h @@ -35,9 +35,9 @@ struct wlr_dmabuf_buffer *wlr_dmabuf_buffer_from_params_resource( /* the protocol interface */ struct wlr_linux_dmabuf { - struct wl_global *wl_global; + struct wl_global *global; struct wlr_renderer *renderer; - struct wl_list wl_resources; + struct wl_list resources; struct { struct wl_signal destroy; diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h index 158d174e..5084eb5a 100644 --- a/include/wlr/types/wlr_output.h +++ b/include/wlr/types/wlr_output.h @@ -53,8 +53,8 @@ struct wlr_output { struct wlr_backend *backend; struct wl_display *display; - struct wl_global *wl_global; - struct wl_list wl_resources; + struct wl_global *global; + struct wl_list resources; char name[24]; char make[48]; diff --git a/include/wlr/types/wlr_screenshooter.h b/include/wlr/types/wlr_screenshooter.h index 680d86f0..916c8942 100644 --- a/include/wlr/types/wlr_screenshooter.h +++ b/include/wlr/types/wlr_screenshooter.h @@ -4,7 +4,7 @@ #include struct wlr_screenshooter { - struct wl_global *wl_global; + struct wl_global *global; struct wl_list screenshots; // wlr_screenshot::link struct wl_listener display_destroy; diff --git a/include/wlr/types/wlr_seat.h b/include/wlr/types/wlr_seat.h index 5e04003d..92d0a233 100644 --- a/include/wlr/types/wlr_seat.h +++ b/include/wlr/types/wlr_seat.h @@ -17,7 +17,7 @@ struct wlr_seat_client { struct wlr_seat *seat; // lists of wl_resource - struct wl_list wl_resources; + struct wl_list resources; struct wl_list pointers; struct wl_list keyboards; struct wl_list touches; @@ -170,7 +170,7 @@ struct wlr_seat_touch_state { }; struct wlr_seat { - struct wl_global *wl_global; + struct wl_global *global; struct wl_display *display; struct wl_list clients; struct wl_list drag_icons; // wlr_drag_icon::link diff --git a/include/wlr/types/wlr_server_decoration.h b/include/wlr/types/wlr_server_decoration.h index e457a0aa..23387968 100644 --- a/include/wlr/types/wlr_server_decoration.h +++ b/include/wlr/types/wlr_server_decoration.h @@ -27,8 +27,8 @@ enum wlr_server_decoration_manager_mode { }; struct wlr_server_decoration_manager { - struct wl_global *wl_global; - struct wl_list wl_resources; + struct wl_global *global; + struct wl_list resources; struct wl_list decorations; // wlr_server_decoration::link uint32_t default_mode; // enum wlr_server_decoration_manager_mode diff --git a/include/wlr/types/wlr_wl_shell.h b/include/wlr/types/wlr_wl_shell.h index b60a0ddd..e2d4b5bb 100644 --- a/include/wlr/types/wlr_wl_shell.h +++ b/include/wlr/types/wlr_wl_shell.h @@ -6,8 +6,8 @@ #include struct wlr_wl_shell { - struct wl_global *wl_global; - struct wl_list wl_resources; + struct wl_global *global; + struct wl_list resources; struct wl_list surfaces; struct wl_list popup_grabs; uint32_t ping_timeout; diff --git a/include/wlr/types/wlr_xdg_shell.h b/include/wlr/types/wlr_xdg_shell.h index d2dfaacb..79e029d4 100644 --- a/include/wlr/types/wlr_xdg_shell.h +++ b/include/wlr/types/wlr_xdg_shell.h @@ -6,7 +6,7 @@ #include "xdg-shell-protocol.h" struct wlr_xdg_shell { - struct wl_global *wl_global; + struct wl_global *global; struct wl_list clients; struct wl_list popup_grabs; uint32_t ping_timeout; diff --git a/include/wlr/types/wlr_xdg_shell_v6.h b/include/wlr/types/wlr_xdg_shell_v6.h index 38f85635..fdfb23c5 100644 --- a/include/wlr/types/wlr_xdg_shell_v6.h +++ b/include/wlr/types/wlr_xdg_shell_v6.h @@ -7,7 +7,7 @@ #include "xdg-shell-unstable-v6-protocol.h" struct wlr_xdg_shell_v6 { - struct wl_global *wl_global; + struct wl_global *global; struct wl_list clients; struct wl_list popup_grabs; uint32_t ping_timeout; diff --git a/types/data_device/wlr_data_device.c b/types/data_device/wlr_data_device.c index 70ba3bfa..1f84fc8d 100644 --- a/types/data_device/wlr_data_device.c +++ b/types/data_device/wlr_data_device.c @@ -227,7 +227,7 @@ static void data_device_manager_bind(struct wl_client *client, wl_resource_set_implementation(resource, &data_device_manager_impl, manager, data_device_manager_handle_resource_destroy); - wl_list_insert(&manager->wl_resources, wl_resource_get_link(resource)); + wl_list_insert(&manager->resources, wl_resource_get_link(resource)); } void wlr_data_device_manager_destroy(struct wlr_data_device_manager *manager) { @@ -238,7 +238,7 @@ void wlr_data_device_manager_destroy(struct wlr_data_device_manager *manager) { wl_list_remove(&manager->display_destroy.link); wl_global_destroy(manager->global); struct wl_resource *resource, *tmp; - wl_resource_for_each_safe(resource, tmp, &manager->wl_resources) { + wl_resource_for_each_safe(resource, tmp, &manager->resources) { wl_resource_destroy(resource); } wl_resource_for_each_safe(resource, tmp, &manager->data_sources) { @@ -262,7 +262,7 @@ struct wlr_data_device_manager *wlr_data_device_manager_create( return NULL; } - wl_list_init(&manager->wl_resources); + wl_list_init(&manager->resources); wl_list_init(&manager->data_sources); wl_signal_init(&manager->events.destroy); diff --git a/types/seat/wlr_seat.c b/types/seat/wlr_seat.c index 3c415483..05c4b822 100644 --- a/types/seat/wlr_seat.c +++ b/types/seat/wlr_seat.c @@ -62,7 +62,7 @@ static void seat_client_handle_resource_destroy( wlr_seat_client_from_resource(seat_resource); wl_list_remove(wl_resource_get_link(seat_resource)); - if (!wl_list_empty(&client->wl_resources)) { + if (!wl_list_empty(&client->resources)) { return; } @@ -133,7 +133,7 @@ static void seat_handle_bind(struct wl_client *client, void *_wlr_seat, seat_client->client = client; seat_client->seat = wlr_seat; - wl_list_init(&seat_client->wl_resources); + wl_list_init(&seat_client->resources); wl_list_init(&seat_client->pointers); wl_list_init(&seat_client->keyboards); wl_list_init(&seat_client->touches); @@ -146,7 +146,7 @@ static void seat_handle_bind(struct wl_client *client, void *_wlr_seat, wl_resource_set_implementation(wl_resource, &seat_impl, seat_client, seat_client_handle_resource_destroy); - wl_list_insert(&seat_client->wl_resources, wl_resource_get_link(wl_resource)); + wl_list_insert(&seat_client->resources, wl_resource_get_link(wl_resource)); if (version >= WL_SEAT_NAME_SINCE_VERSION) { wl_seat_send_name(wl_resource, wlr_seat->name); } @@ -181,16 +181,16 @@ void wlr_seat_destroy(struct wlr_seat *seat) { * 'next' update that usually is harmless here. * Work around this by breaking one step ahead */ - wl_resource_for_each_safe(resource, next, &client->wl_resources) { + wl_resource_for_each_safe(resource, next, &client->resources) { // will destroy other resources as well wl_resource_destroy(resource); - if (wl_resource_get_link(next) == &client->wl_resources) { + if (wl_resource_get_link(next) == &client->resources) { break; } } } - wl_global_destroy(seat->wl_global); + wl_global_destroy(seat->global); free(seat->pointer_state.default_grab); free(seat->keyboard_state.default_grab); free(seat->touch_state.default_grab); @@ -258,9 +258,9 @@ struct wlr_seat *wlr_seat_create(struct wl_display *display, const char *name) { seat->touch_state.seat = seat; wl_list_init(&seat->touch_state.touch_points); - seat->wl_global = wl_global_create(display, &wl_seat_interface, + seat->global = wl_global_create(display, &wl_seat_interface, SEAT_VERSION, seat, seat_handle_bind); - if (seat->wl_global == NULL) { + if (seat->global == NULL) { free(touch_grab); free(pointer_grab); free(keyboard_grab); @@ -335,7 +335,7 @@ void wlr_seat_set_capabilities(struct wlr_seat *wlr_seat, } struct wl_resource *resource; - wl_resource_for_each(resource, &client->wl_resources) { + wl_resource_for_each(resource, &client->resources) { wl_seat_send_capabilities(resource, capabilities); } } @@ -347,7 +347,7 @@ void wlr_seat_set_name(struct wlr_seat *wlr_seat, const char *name) { struct wlr_seat_client *client; wl_list_for_each(client, &wlr_seat->clients, link) { struct wl_resource *resource; - wl_resource_for_each(resource, &client->wl_resources) { + wl_resource_for_each(resource, &client->resources) { wl_seat_send_name(resource, name); } } diff --git a/types/wlr_compositor.c b/types/wlr_compositor.c index d2f7dbd7..436de892 100644 --- a/types/wlr_compositor.c +++ b/types/wlr_compositor.c @@ -102,30 +102,30 @@ static void subcompositor_bind(struct wl_client *client, void *data, } wl_resource_set_implementation(resource, &subcompositor_impl, subcompositor, subcompositor_resource_destroy); - wl_list_insert(&subcompositor->wl_resources, wl_resource_get_link(resource)); + wl_list_insert(&subcompositor->resources, wl_resource_get_link(resource)); } static void subcompositor_init(struct wlr_subcompositor *subcompositor, struct wl_display *display) { - subcompositor->wl_global = wl_global_create(display, + subcompositor->global = wl_global_create(display, &wl_subcompositor_interface, SUBCOMPOSITOR_VERSION, subcompositor, subcompositor_bind); - if (subcompositor->wl_global == NULL) { + if (subcompositor->global == NULL) { wlr_log_errno(L_ERROR, "Could not allocate subcompositor global"); return; } - wl_list_init(&subcompositor->wl_resources); + wl_list_init(&subcompositor->resources); wl_list_init(&subcompositor->subsurface_resources); } static void subcompositor_finish(struct wlr_subcompositor *subcompositor) { - wl_global_destroy(subcompositor->wl_global); + wl_global_destroy(subcompositor->global); struct wl_resource *resource, *tmp; wl_resource_for_each_safe(resource, tmp, &subcompositor->subsurface_resources) { wl_resource_destroy(resource); } - wl_resource_for_each_safe(resource, tmp, &subcompositor->wl_resources) { + wl_resource_for_each_safe(resource, tmp, &subcompositor->resources) { wl_resource_destroy(resource); } } @@ -183,7 +183,7 @@ static void compositor_bind(struct wl_client *wl_client, void *data, } wl_resource_set_implementation(resource, &compositor_impl, compositor, compositor_resource_destroy); - wl_list_insert(&compositor->wl_resources, wl_resource_get_link(resource)); + wl_list_insert(&compositor->resources, wl_resource_get_link(resource)); } void wlr_compositor_destroy(struct wlr_compositor *compositor) { @@ -193,7 +193,7 @@ void wlr_compositor_destroy(struct wlr_compositor *compositor) { wlr_signal_emit_safe(&compositor->events.destroy, compositor); subcompositor_finish(&compositor->subcompositor); wl_list_remove(&compositor->display_destroy.link); - wl_global_destroy(compositor->wl_global); + wl_global_destroy(compositor->global); struct wl_resource *resource, *tmp; wl_resource_for_each_safe(resource, tmp, &compositor->surface_resources) { wl_resource_destroy(resource); @@ -201,7 +201,7 @@ void wlr_compositor_destroy(struct wlr_compositor *compositor) { wl_resource_for_each_safe(resource, tmp, &compositor->region_resources) { wl_resource_destroy(resource); } - wl_resource_for_each_safe(resource, tmp, &compositor->wl_resources) { + wl_resource_for_each_safe(resource, tmp, &compositor->resources) { wl_resource_destroy(resource); } free(compositor); @@ -222,16 +222,16 @@ struct wlr_compositor *wlr_compositor_create(struct wl_display *display, return NULL; } - compositor->wl_global = wl_global_create(display, &wl_compositor_interface, + compositor->global = wl_global_create(display, &wl_compositor_interface, COMPOSITOR_VERSION, compositor, compositor_bind); - if (!compositor->wl_global) { + if (!compositor->global) { free(compositor); wlr_log_errno(L_ERROR, "Could not allocate compositor global"); return NULL; } compositor->renderer = renderer; - wl_list_init(&compositor->wl_resources); + wl_list_init(&compositor->resources); wl_list_init(&compositor->surface_resources); wl_list_init(&compositor->region_resources); wl_signal_init(&compositor->events.new_surface); diff --git a/types/wlr_gamma_control.c b/types/wlr_gamma_control.c index 0f74e59a..07c2410f 100644 --- a/types/wlr_gamma_control.c +++ b/types/wlr_gamma_control.c @@ -160,7 +160,7 @@ void wlr_gamma_control_manager_destroy( wl_list_for_each_safe(gamma_control, tmp, &manager->controls, link) { gamma_control_destroy(gamma_control); } - wl_global_destroy(manager->wl_global); + wl_global_destroy(manager->global); free(manager); } @@ -177,14 +177,14 @@ struct wlr_gamma_control_manager *wlr_gamma_control_manager_create( if (!manager) { return NULL; } - struct wl_global *wl_global = wl_global_create(display, + struct wl_global *global = wl_global_create(display, &gamma_control_manager_interface, 1, manager, gamma_control_manager_bind); - if (!wl_global) { + if (!global) { free(manager); return NULL; } - manager->wl_global = wl_global; + manager->global = global; wl_list_init(&manager->controls); diff --git a/types/wlr_idle.c b/types/wlr_idle.c index fffb8d55..7f348eb3 100644 --- a/types/wlr_idle.c +++ b/types/wlr_idle.c @@ -192,7 +192,7 @@ void wlr_idle_destroy(struct wlr_idle *idle) { wl_list_for_each_safe(timer, tmp, &idle->idle_timers, link) { idle_timeout_destroy(timer); } - wl_global_destroy(idle->wl_global); + wl_global_destroy(idle->global); free(idle); } @@ -219,9 +219,9 @@ struct wlr_idle *wlr_idle_create(struct wl_display *display) { idle->display_destroy.notify = handle_display_destroy; wl_display_add_destroy_listener(display, &idle->display_destroy); - idle->wl_global = wl_global_create(display, &org_kde_kwin_idle_interface, + idle->global = wl_global_create(display, &org_kde_kwin_idle_interface, 1, idle, idle_bind); - if (idle->wl_global == NULL){ + if (idle->global == NULL){ wl_list_remove(&idle->display_destroy.link); free(idle); return NULL; diff --git a/types/wlr_idle_inhibit_v1.c b/types/wlr_idle_inhibit_v1.c index cfadb4a3..fd190534 100644 --- a/types/wlr_idle_inhibit_v1.c +++ b/types/wlr_idle_inhibit_v1.c @@ -132,7 +132,7 @@ static void idle_inhibit_bind(struct wl_client *wl_client, void *data, return; } - wl_list_insert(&idle_inhibit->wl_resources, wl_resource_get_link(wl_resource)); + wl_list_insert(&idle_inhibit->resources, wl_resource_get_link(wl_resource)); wl_resource_set_implementation(wl_resource, &idle_inhibit_impl, idle_inhibit, idle_inhibit_manager_v1_handle_resource_destroy); @@ -154,7 +154,7 @@ void wlr_idle_inhibit_v1_destroy(struct wlr_idle_inhibit_manager_v1 *idle_inhibi struct wl_resource *resource; struct wl_resource *tmp_resource; - wl_resource_for_each_safe(resource, tmp_resource, &idle_inhibit->wl_resources) { + wl_resource_for_each_safe(resource, tmp_resource, &idle_inhibit->resources) { wl_resource_destroy(resource); } @@ -170,7 +170,7 @@ struct wlr_idle_inhibit_manager_v1 *wlr_idle_inhibit_v1_create(struct wl_display return NULL; } - wl_list_init(&idle_inhibit->wl_resources); + wl_list_init(&idle_inhibit->resources); wl_list_init(&idle_inhibit->inhibitors); idle_inhibit->display_destroy.notify = handle_display_destroy; wl_display_add_destroy_listener(display, &idle_inhibit->display_destroy); diff --git a/types/wlr_input_inhibitor.c b/types/wlr_input_inhibitor.c index 532ea5f4..dc5175f8 100644 --- a/types/wlr_input_inhibitor.c +++ b/types/wlr_input_inhibitor.c @@ -113,7 +113,7 @@ void wlr_input_inhibit_manager_destroy( manager->active_inhibitor); } wl_list_remove(&manager->display_destroy.link); - wl_global_destroy(manager->wl_global); + wl_global_destroy(manager->global); free(manager); } @@ -132,10 +132,10 @@ struct wlr_input_inhibit_manager *wlr_input_inhibit_manager_create( return NULL; } - manager->wl_global = wl_global_create(display, + manager->global = wl_global_create(display, &zwlr_input_inhibit_manager_v1_interface, 1, manager, inhibit_manager_bind); - if (manager->wl_global == NULL){ + if (manager->global == NULL){ wl_list_remove(&manager->display_destroy.link); free(manager); return NULL; diff --git a/types/wlr_layer_shell.c b/types/wlr_layer_shell.c index 76d6d721..2a8a1cc6 100644 --- a/types/wlr_layer_shell.c +++ b/types/wlr_layer_shell.c @@ -434,13 +434,13 @@ struct wlr_layer_shell *wlr_layer_shell_create(struct wl_display *display) { wl_list_init(&layer_shell->client_resources); wl_list_init(&layer_shell->surfaces); - struct wl_global *wl_global = wl_global_create(display, + struct wl_global *global = wl_global_create(display, &zwlr_layer_shell_v1_interface, 1, layer_shell, layer_shell_bind); - if (!wl_global) { + if (!global) { free(layer_shell); return NULL; } - layer_shell->wl_global = wl_global; + layer_shell->global = global; wl_signal_init(&layer_shell->events.new_surface); @@ -459,7 +459,7 @@ void wlr_layer_shell_destroy(struct wlr_layer_shell *layer_shell) { wl_resource_destroy(client); } wl_list_remove(&layer_shell->display_destroy.link); - wl_global_destroy(layer_shell->wl_global); + wl_global_destroy(layer_shell->global); free(layer_shell); } diff --git a/types/wlr_linux_dmabuf.c b/types/wlr_linux_dmabuf.c index 08f44243..8050d794 100644 --- a/types/wlr_linux_dmabuf.c +++ b/types/wlr_linux_dmabuf.c @@ -438,7 +438,7 @@ static void linux_dmabuf_bind(struct wl_client *client, void *data, } wl_resource_set_implementation(resource, &linux_dmabuf_impl, linux_dmabuf, linux_dmabuf_resource_destroy); - wl_list_insert(&linux_dmabuf->wl_resources, wl_resource_get_link(resource)); + wl_list_insert(&linux_dmabuf->resources, wl_resource_get_link(resource)); if (version >= ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION) { linux_dmabuf_send_modifiers(linux_dmabuf, resource); @@ -456,11 +456,11 @@ void wlr_linux_dmabuf_destroy(struct wlr_linux_dmabuf *linux_dmabuf) { wl_list_remove(&linux_dmabuf->renderer_destroy.link); struct wl_resource *resource, *tmp; - wl_resource_for_each_safe(resource, tmp, &linux_dmabuf->wl_resources) { + wl_resource_for_each_safe(resource, tmp, &linux_dmabuf->resources) { wl_resource_destroy(resource); } - wl_global_destroy(linux_dmabuf->wl_global); + wl_global_destroy(linux_dmabuf->global); free(linux_dmabuf); } @@ -486,13 +486,13 @@ struct wlr_linux_dmabuf *wlr_linux_dmabuf_create(struct wl_display *display, } linux_dmabuf->renderer = renderer; - wl_list_init(&linux_dmabuf->wl_resources); + wl_list_init(&linux_dmabuf->resources); wl_signal_init(&linux_dmabuf->events.destroy); - linux_dmabuf->wl_global = + linux_dmabuf->global = wl_global_create(display, &zwp_linux_dmabuf_v1_interface, LINUX_DMABUF_VERSION, linux_dmabuf, linux_dmabuf_bind); - if (!linux_dmabuf->wl_global) { + if (!linux_dmabuf->global) { wlr_log(L_ERROR, "could not create linux dmabuf v1 wl global"); free(linux_dmabuf); return NULL; diff --git a/types/wlr_output.c b/types/wlr_output.c index ccdc1978..d87a374a 100644 --- a/types/wlr_output.c +++ b/types/wlr_output.c @@ -97,34 +97,34 @@ static void output_bind(struct wl_client *wl_client, void *data, } wl_resource_set_implementation(resource, &output_impl, output, output_handle_resource_destroy); - wl_list_insert(&output->wl_resources, wl_resource_get_link(resource)); + wl_list_insert(&output->resources, wl_resource_get_link(resource)); output_send_to_resource(resource); } void wlr_output_create_global(struct wlr_output *output) { - if (output->wl_global != NULL) { + if (output->global != NULL) { return; } - output->wl_global = wl_global_create(output->display, + output->global = wl_global_create(output->display, &wl_output_interface, OUTPUT_VERSION, output, output_bind); - if (output->wl_global == NULL) { + if (output->global == NULL) { wlr_log(L_ERROR, "Failed to allocate wl_output global"); } } void wlr_output_destroy_global(struct wlr_output *output) { - if (output->wl_global == NULL) { + if (output->global == NULL) { return; } // Make all output resources inert struct wl_resource *resource, *tmp; - wl_resource_for_each_safe(resource, tmp, &output->wl_resources) { + wl_resource_for_each_safe(resource, tmp, &output->resources) { wl_resource_set_user_data(resource, NULL); wl_list_remove(wl_resource_get_link(resource)); wl_list_init(wl_resource_get_link(resource)); } - wl_global_destroy(output->wl_global); - output->wl_global = NULL; + wl_global_destroy(output->global); + output->global = NULL; } void wlr_output_update_enabled(struct wlr_output *output, bool enabled) { @@ -188,7 +188,7 @@ void wlr_output_update_custom_mode(struct wlr_output *output, int32_t width, output->refresh = refresh; struct wl_resource *resource; - wl_resource_for_each(resource, &output->wl_resources) { + wl_resource_for_each(resource, &output->resources) { output_send_current_mode_to_resource(resource); } @@ -202,7 +202,7 @@ void wlr_output_set_transform(struct wlr_output *output, // TODO: only send geometry and done struct wl_resource *resource; - wl_resource_for_each(resource, &output->wl_resources) { + wl_resource_for_each(resource, &output->resources) { output_send_to_resource(resource); } @@ -220,7 +220,7 @@ void wlr_output_set_position(struct wlr_output *output, int32_t lx, // TODO: only send geometry and done struct wl_resource *resource; - wl_resource_for_each(resource, &output->wl_resources) { + wl_resource_for_each(resource, &output->resources) { output_send_to_resource(resource); } } @@ -234,7 +234,7 @@ void wlr_output_set_scale(struct wlr_output *output, float scale) { // TODO: only send mode and done struct wl_resource *resource; - wl_resource_for_each(resource, &output->wl_resources) { + wl_resource_for_each(resource, &output->resources) { output_send_to_resource(resource); } @@ -260,7 +260,7 @@ void wlr_output_init(struct wlr_output *output, struct wlr_backend *backend, output->transform = WL_OUTPUT_TRANSFORM_NORMAL; output->scale = 1; wl_list_init(&output->cursors); - wl_list_init(&output->wl_resources); + wl_list_init(&output->resources); wl_signal_init(&output->events.frame); wl_signal_init(&output->events.needs_swap); wl_signal_init(&output->events.swap_buffers); diff --git a/types/wlr_primary_selection.c b/types/wlr_primary_selection.c index 15452071..750f9ab4 100644 --- a/types/wlr_primary_selection.c +++ b/types/wlr_primary_selection.c @@ -420,7 +420,7 @@ void wlr_primary_selection_device_manager_destroy( return; } wl_list_remove(&manager->display_destroy.link); - // TODO: free wl_resources + // TODO: free resources wl_global_destroy(manager->global); free(manager); } diff --git a/types/wlr_screenshooter.c b/types/wlr_screenshooter.c index 5d9e9de3..30d2a5cb 100644 --- a/types/wlr_screenshooter.c +++ b/types/wlr_screenshooter.c @@ -177,7 +177,7 @@ void wlr_screenshooter_destroy(struct wlr_screenshooter *screenshooter) { wl_list_for_each_safe(screenshot, tmp, &screenshooter->screenshots, link) { screenshot_destroy(screenshot); } - wl_global_destroy(screenshooter->wl_global); + wl_global_destroy(screenshooter->global); free(screenshooter); } @@ -199,9 +199,9 @@ struct wlr_screenshooter *wlr_screenshooter_create(struct wl_display *display) { screenshooter->display_destroy.notify = handle_display_destroy; wl_display_add_destroy_listener(display, &screenshooter->display_destroy); - screenshooter->wl_global = wl_global_create(display, + screenshooter->global = wl_global_create(display, &orbital_screenshooter_interface, 1, screenshooter, screenshooter_bind); - if (screenshooter->wl_global == NULL) { + if (screenshooter->global == NULL) { free(screenshooter); return NULL; } diff --git a/types/wlr_server_decoration.c b/types/wlr_server_decoration.c index 6d332033..1bd9f5c5 100644 --- a/types/wlr_server_decoration.c +++ b/types/wlr_server_decoration.c @@ -132,7 +132,7 @@ void wlr_server_decoration_manager_set_default_mode( manager->default_mode = default_mode; struct wl_resource *resource; - wl_resource_for_each(resource, &manager->wl_resources) { + wl_resource_for_each(resource, &manager->resources) { org_kde_kwin_server_decoration_manager_send_default_mode(resource, manager->default_mode); } @@ -156,7 +156,7 @@ static void server_decoration_manager_bind(struct wl_client *client, void *data, wl_resource_set_implementation(resource, &server_decoration_manager_impl, manager, server_decoration_manager_destroy_resource); - wl_list_insert(&manager->wl_resources, wl_resource_get_link(resource)); + wl_list_insert(&manager->resources, wl_resource_get_link(resource)); org_kde_kwin_server_decoration_manager_send_default_mode(resource, manager->default_mode); @@ -174,10 +174,10 @@ void wlr_server_decoration_manager_destroy( server_decoration_destroy(decoration); } struct wl_resource *resource, *tmp_resource; - wl_resource_for_each_safe(resource, tmp_resource, &manager->wl_resources) { + wl_resource_for_each_safe(resource, tmp_resource, &manager->resources) { server_decoration_manager_destroy_resource(resource); } - wl_global_destroy(manager->wl_global); + wl_global_destroy(manager->global); free(manager); } @@ -194,15 +194,15 @@ struct wlr_server_decoration_manager *wlr_server_decoration_manager_create( if (manager == NULL) { return NULL; } - manager->wl_global = wl_global_create(display, + manager->global = wl_global_create(display, &org_kde_kwin_server_decoration_manager_interface, 1, manager, server_decoration_manager_bind); - if (manager->wl_global == NULL) { + if (manager->global == NULL) { free(manager); return NULL; } manager->default_mode = ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_NONE; - wl_list_init(&manager->wl_resources); + wl_list_init(&manager->resources); wl_list_init(&manager->decorations); wl_signal_init(&manager->events.new_decoration); diff --git a/types/wlr_surface.c b/types/wlr_surface.c index 973686ef..01e45e4f 100644 --- a/types/wlr_surface.c +++ b/types/wlr_surface.c @@ -932,7 +932,7 @@ void wlr_surface_send_enter(struct wlr_surface *surface, struct wlr_output *output) { struct wl_client *client = wl_resource_get_client(surface->resource); struct wl_resource *resource; - wl_resource_for_each(resource, &output->wl_resources) { + wl_resource_for_each(resource, &output->resources) { if (client == wl_resource_get_client(resource)) { wl_surface_send_enter(surface->resource, resource); } @@ -943,7 +943,7 @@ void wlr_surface_send_leave(struct wlr_surface *surface, struct wlr_output *output) { struct wl_client *client = wl_resource_get_client(surface->resource); struct wl_resource *resource; - wl_resource_for_each(resource, &output->wl_resources) { + wl_resource_for_each(resource, &output->resources) { if (client == wl_resource_get_client(resource)) { wl_surface_send_leave(surface->resource, resource); } diff --git a/types/wlr_wl_shell.c b/types/wlr_wl_shell.c index 05f9f19c..a295a837 100644 --- a/types/wlr_wl_shell.c +++ b/types/wlr_wl_shell.c @@ -596,7 +596,7 @@ static void shell_bind(struct wl_client *wl_client, void *data, } wl_resource_set_implementation(wl_resource, &shell_impl, wl_shell, shell_destroy); - wl_list_insert(&wl_shell->wl_resources, wl_resource_get_link(wl_resource)); + wl_list_insert(&wl_shell->resources, wl_resource_get_link(wl_resource)); } static void handle_display_destroy(struct wl_listener *listener, void *data) { @@ -611,14 +611,14 @@ struct wlr_wl_shell *wlr_wl_shell_create(struct wl_display *display) { return NULL; } wl_shell->ping_timeout = 10000; - struct wl_global *wl_global = wl_global_create(display, &wl_shell_interface, + struct wl_global *global = wl_global_create(display, &wl_shell_interface, 1, wl_shell, shell_bind); - if (!wl_global) { + if (!global) { free(wl_shell); return NULL; } - wl_shell->wl_global = wl_global; - wl_list_init(&wl_shell->wl_resources); + wl_shell->global = global; + wl_list_init(&wl_shell->resources); wl_list_init(&wl_shell->surfaces); wl_list_init(&wl_shell->popup_grabs); wl_signal_init(&wl_shell->events.new_surface); @@ -635,12 +635,12 @@ void wlr_wl_shell_destroy(struct wlr_wl_shell *wlr_wl_shell) { } wl_list_remove(&wlr_wl_shell->display_destroy.link); struct wl_resource *resource = NULL, *temp = NULL; - wl_resource_for_each_safe(resource, temp, &wlr_wl_shell->wl_resources) { + wl_resource_for_each_safe(resource, temp, &wlr_wl_shell->resources) { // shell_destroy will remove the resource from the list wl_resource_destroy(resource); } // TODO: destroy surfaces - wl_global_destroy(wlr_wl_shell->wl_global); + wl_global_destroy(wlr_wl_shell->global); free(wlr_wl_shell); } diff --git a/types/xdg_shell/wlr_xdg_shell.c b/types/xdg_shell/wlr_xdg_shell.c index 43b28ff0..601e728c 100644 --- a/types/xdg_shell/wlr_xdg_shell.c +++ b/types/xdg_shell/wlr_xdg_shell.c @@ -146,13 +146,13 @@ struct wlr_xdg_shell *wlr_xdg_shell_create(struct wl_display *display) { wl_list_init(&xdg_shell->clients); wl_list_init(&xdg_shell->popup_grabs); - struct wl_global *wl_global = wl_global_create(display, + struct wl_global *global = wl_global_create(display, &xdg_wm_base_interface, WM_BASE_VERSION, xdg_shell, xdg_shell_bind); - if (!wl_global) { + if (!global) { free(xdg_shell); return NULL; } - xdg_shell->wl_global = wl_global; + xdg_shell->global = global; wl_signal_init(&xdg_shell->events.new_surface); @@ -167,6 +167,6 @@ void wlr_xdg_shell_destroy(struct wlr_xdg_shell *xdg_shell) { return; } wl_list_remove(&xdg_shell->display_destroy.link); - wl_global_destroy(xdg_shell->wl_global); + wl_global_destroy(xdg_shell->global); free(xdg_shell); } diff --git a/types/xdg_shell_v6/wlr_xdg_shell_v6.c b/types/xdg_shell_v6/wlr_xdg_shell_v6.c index 3fbe28b2..d61b5dc2 100644 --- a/types/xdg_shell_v6/wlr_xdg_shell_v6.c +++ b/types/xdg_shell_v6/wlr_xdg_shell_v6.c @@ -147,13 +147,13 @@ struct wlr_xdg_shell_v6 *wlr_xdg_shell_v6_create(struct wl_display *display) { wl_list_init(&xdg_shell->clients); wl_list_init(&xdg_shell->popup_grabs); - struct wl_global *wl_global = wl_global_create(display, + struct wl_global *global = wl_global_create(display, &zxdg_shell_v6_interface, SHELL_VERSION, xdg_shell, xdg_shell_bind); - if (!wl_global) { + if (!global) { free(xdg_shell); return NULL; } - xdg_shell->wl_global = wl_global; + xdg_shell->global = global; wl_signal_init(&xdg_shell->events.new_surface); @@ -168,6 +168,6 @@ void wlr_xdg_shell_v6_destroy(struct wlr_xdg_shell_v6 *xdg_shell) { return; } wl_list_remove(&xdg_shell->display_destroy.link); - wl_global_destroy(xdg_shell->wl_global); + wl_global_destroy(xdg_shell->global); free(xdg_shell); }