s/lid_switch/switch_device

Rename lid_switch to switch_device to disambiguate lid and tablet mode switches.
This commit is contained in:
Ryan Walklin 2019-03-20 09:41:20 +11:00 committed by Brian Ashworth
parent 6b7f5e4010
commit 4453757fc9
10 changed files with 45 additions and 45 deletions

View file

@ -42,7 +42,7 @@ void wlr_input_device_destroy(struct wlr_input_device *dev) {
wlr_pointer_destroy(dev->pointer);
break;
case WLR_INPUT_DEVICE_SWITCH:
wlr_switch_destroy(dev->lid_switch);
wlr_switch_destroy(dev->switch_device);
break;
case WLR_INPUT_DEVICE_TOUCH:
wlr_touch_destroy(dev->touch);

View file

@ -4,19 +4,19 @@
#include <wlr/interfaces/wlr_switch.h>
#include <wlr/types/wlr_switch.h>
void wlr_switch_init(struct wlr_switch *lid_switch,
void wlr_switch_init(struct wlr_switch *switch_device,
struct wlr_switch_impl *impl) {
lid_switch->impl = impl;
wl_signal_init(&lid_switch->events.toggle);
switch_device->impl = impl;
wl_signal_init(&switch_device->events.toggle);
}
void wlr_switch_destroy(struct wlr_switch *lid_switch) {
if (!lid_switch) {
void wlr_switch_destroy(struct wlr_switch *switch_device) {
if (!switch_device) {
return;
}
if (lid_switch->impl && lid_switch->impl->destroy) {
lid_switch->impl->destroy(lid_switch);
if (switch_device->impl && switch_device->impl->destroy) {
switch_device->impl->destroy(switch_device);
} else {
free(lid_switch);
free(switch_device);
}
}