diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/dmabuf-capture.c | 4 | ||||
-rw-r--r-- | examples/idle.c | 8 | ||||
-rw-r--r-- | examples/multi-pointer.c | 34 | ||||
-rw-r--r-- | examples/output-layout.c | 12 | ||||
-rw-r--r-- | examples/pointer.c | 12 | ||||
-rw-r--r-- | examples/rotation.c | 10 | ||||
-rw-r--r-- | examples/simple.c | 12 | ||||
-rw-r--r-- | examples/tablet.c | 10 | ||||
-rw-r--r-- | examples/touch.c | 10 |
9 files changed, 46 insertions, 66 deletions
diff --git a/examples/dmabuf-capture.c b/examples/dmabuf-capture.c index cbe50e7d..bad8ccac 100644 --- a/examples/dmabuf-capture.c +++ b/examples/dmabuf-capture.c @@ -461,7 +461,7 @@ static void register_cb(struct capture_context *ctx) { &frame_listener, ctx); } -void *vid_encode_thread(void *arg) { +static void *vid_encode_thread(void *arg) { int err = 0; struct capture_context *ctx = arg; @@ -686,7 +686,7 @@ static int init_encoding(struct capture_context *ctx) { struct capture_context *q_ctx = NULL; -void on_quit_signal(int signo) { +static void on_quit_signal(int signo) { printf("\r"); av_log(q_ctx, AV_LOG_WARNING, "Quitting!\n"); q_ctx->quit = true; diff --git a/examples/idle.c b/examples/idle.c index 0641d4fd..0f3a7f80 100644 --- a/examples/idle.c +++ b/examples/idle.c @@ -52,7 +52,7 @@ static const struct org_kde_kwin_idle_timeout_listener idle_timer_listener = { .resumed = handle_resume, }; -int parse_args(int argc, char *argv[]) { +static int parse_args(int argc, char *argv[]) { int c; while ((c = getopt(argc, argv, "c:hs:t:")) != -1) { switch(c) @@ -81,7 +81,7 @@ int parse_args(int argc, char *argv[]) { return 0; } -void *simulate_activity(void *data) { +static void *simulate_activity(void *data) { sleep(simulate_activity_timeout); fprintf(stdout, "simulate user activity\n"); struct thread_args *arg = data; @@ -90,7 +90,7 @@ void *simulate_activity(void *data) { return NULL; } -void *close_program(void *data) { +static void *close_program(void *data) { sleep(close_timeout); struct thread_args *arg = data; org_kde_kwin_idle_timeout_release(arg->timer); @@ -100,7 +100,7 @@ void *close_program(void *data) { return NULL; } -void *main_loop(void *data) { +static void *main_loop(void *data) { struct wl_display *display = data; while (wl_display_dispatch(display) != -1) { ; diff --git a/examples/multi-pointer.c b/examples/multi-pointer.c index 691bc49d..28f6eca8 100644 --- a/examples/multi-pointer.c +++ b/examples/multi-pointer.c @@ -68,7 +68,7 @@ struct sample_keyboard { struct wl_listener destroy; }; -void configure_cursor(struct wlr_cursor *cursor, struct wlr_input_device *device, +static void configure_cursor(struct wlr_cursor *cursor, struct wlr_input_device *device, struct sample_state *sample) { struct sample_output *output; wlr_log(WLR_ERROR, "Configuring cursor %p for device %p", cursor, device); @@ -88,7 +88,7 @@ void configure_cursor(struct wlr_cursor *cursor, struct wlr_input_device *device } } -void output_frame_notify(struct wl_listener *listener, void *data) { +static void output_frame_notify(struct wl_listener *listener, void *data) { struct sample_output *output = wl_container_of(listener, output, frame); struct sample_state *sample = output->sample; struct wlr_output *wlr_output = output->output; @@ -127,27 +127,7 @@ static void cursor_destroy(struct sample_cursor *cursor) { free(cursor); } -void input_remove_notify(struct wl_listener *listener, void *data) { - struct wlr_input_device *device = data; - struct sample_cursor *sample_cursor = wl_container_of(listener, sample_cursor, destroy); - struct sample_state *sample = sample_cursor->sample; - struct sample_cursor *cursor; - wl_list_for_each(cursor, &sample->cursors, link) { - if (cursor->device == device) { - cursor_destroy(cursor); - break; - } - } - struct sample_pointer *pointer; - wl_list_for_each(pointer, &sample->pointers, link) { - if (pointer->device == device) { - free(pointer); - break; - } - } -} - -void output_remove_notify(struct wl_listener *listener, void *data) { +static void output_remove_notify(struct wl_listener *listener, void *data) { struct sample_output *sample_output = wl_container_of(listener, sample_output, destroy); struct sample_state *sample = sample_output->sample; wl_list_remove(&sample_output->frame.link); @@ -161,7 +141,7 @@ void output_remove_notify(struct wl_listener *listener, void *data) { } } -void new_output_notify(struct wl_listener *listener, void *data) { +static void new_output_notify(struct wl_listener *listener, void *data) { struct wlr_output *output = data; struct sample_state *sample = wl_container_of(listener, sample, new_output); struct sample_output *sample_output = calloc(1, sizeof(struct sample_output)); @@ -193,7 +173,7 @@ void new_output_notify(struct wl_listener *listener, void *data) { wl_list_insert(&sample->outputs, &sample_output->link); } -void keyboard_key_notify(struct wl_listener *listener, void *data) { +static void keyboard_key_notify(struct wl_listener *listener, void *data) { struct sample_keyboard *keyboard = wl_container_of(listener, keyboard, key); struct sample_state *sample = keyboard->sample; struct wlr_event_keyboard_key *event = data; @@ -209,14 +189,14 @@ void keyboard_key_notify(struct wl_listener *listener, void *data) { } } -void keyboard_destroy_notify(struct wl_listener *listener, void *data) { +static void keyboard_destroy_notify(struct wl_listener *listener, void *data) { struct sample_keyboard *keyboard = wl_container_of(listener, keyboard, destroy); wl_list_remove(&keyboard->destroy.link); wl_list_remove(&keyboard->key.link); free(keyboard); } -void new_input_notify(struct wl_listener *listener, void *data) { +static void new_input_notify(struct wl_listener *listener, void *data) { struct wlr_input_device *device = data; struct sample_state *sample = wl_container_of(listener, sample, new_input); switch (device->type) { diff --git a/examples/output-layout.c b/examples/output-layout.c index d18a83af..2a1cc320 100644 --- a/examples/output-layout.c +++ b/examples/output-layout.c @@ -106,7 +106,7 @@ static void animate_cat(struct sample_state *sample, sample->ts_last = ts; } -void output_frame_notify(struct wl_listener *listener, void *data) { +static void output_frame_notify(struct wl_listener *listener, void *data) { struct sample_output *output = wl_container_of(listener, output, frame); struct sample_state *sample = output->sample; struct timespec ts; @@ -145,7 +145,7 @@ static void update_velocities(struct sample_state *sample, sample->y_vel += y_diff; } -void output_remove_notify(struct wl_listener *listener, void *data) { +static void output_remove_notify(struct wl_listener *listener, void *data) { struct sample_output *sample_output = wl_container_of(listener, sample_output, destroy); struct sample_state *sample = sample_output->sample; wlr_output_layout_remove(sample->layout, sample_output->output); @@ -154,7 +154,7 @@ void output_remove_notify(struct wl_listener *listener, void *data) { free(sample_output); } -void new_output_notify(struct wl_listener *listener, void *data) { +static void new_output_notify(struct wl_listener *listener, void *data) { struct wlr_output *output = data; struct sample_state *sample = wl_container_of(listener, sample, new_output); struct sample_output *sample_output = calloc(1, sizeof(struct sample_output)); @@ -171,7 +171,7 @@ void new_output_notify(struct wl_listener *listener, void *data) { sample_output->destroy.notify = output_remove_notify; } -void keyboard_key_notify(struct wl_listener *listener, void *data) { +static void keyboard_key_notify(struct wl_listener *listener, void *data) { struct sample_keyboard *keyboard = wl_container_of(listener, keyboard, key); struct sample_state *sample = keyboard->sample; struct wlr_event_keyboard_key *event = data; @@ -207,14 +207,14 @@ void keyboard_key_notify(struct wl_listener *listener, void *data) { } } -void keyboard_destroy_notify(struct wl_listener *listener, void *data) { +static void keyboard_destroy_notify(struct wl_listener *listener, void *data) { struct sample_keyboard *keyboard = wl_container_of(listener, keyboard, destroy); wl_list_remove(&keyboard->destroy.link); wl_list_remove(&keyboard->key.link); free(keyboard); } -void new_input_notify(struct wl_listener *listener, void *data) { +static void new_input_notify(struct wl_listener *listener, void *data) { struct wlr_input_device *device = data; struct sample_state *sample = wl_container_of(listener, sample, new_input); switch (device->type) { diff --git a/examples/pointer.c b/examples/pointer.c index 4b0e6f46..5e137a1a 100644 --- a/examples/pointer.c +++ b/examples/pointer.c @@ -90,7 +90,7 @@ static void warp_to_touch(struct sample_state *state, wlr_cursor_warp_absolute(state->cursor, dev, x, y); } -void output_frame_notify(struct wl_listener *listener, void *data) { +static void output_frame_notify(struct wl_listener *listener, void *data) { struct sample_output *sample_output = wl_container_of(listener, sample_output, frame); struct sample_state *state = sample_output->state; struct wlr_output *wlr_output = sample_output->output; @@ -221,7 +221,7 @@ static void handle_tablet_tool_axis(struct wl_listener *listener, void *data) { } } -void keyboard_key_notify(struct wl_listener *listener, void *data) { +static void keyboard_key_notify(struct wl_listener *listener, void *data) { struct sample_keyboard *keyboard = wl_container_of(listener, keyboard, key); struct sample_state *sample = keyboard->state; struct wlr_event_keyboard_key *event = data; @@ -237,7 +237,7 @@ void keyboard_key_notify(struct wl_listener *listener, void *data) { } } -void output_remove_notify(struct wl_listener *listener, void *data) { +static void output_remove_notify(struct wl_listener *listener, void *data) { struct sample_output *sample_output = wl_container_of(listener, sample_output, destroy); struct sample_state *sample = sample_output->state; wlr_output_layout_remove(sample->layout, sample_output->output); @@ -246,7 +246,7 @@ void output_remove_notify(struct wl_listener *listener, void *data) { free(sample_output); } -void new_output_notify(struct wl_listener *listener, void *data) { +static void new_output_notify(struct wl_listener *listener, void *data) { struct wlr_output *output = data; struct sample_state *sample = wl_container_of(listener, sample, new_output); struct sample_output *sample_output = calloc(1, sizeof(struct sample_output)); @@ -268,14 +268,14 @@ void new_output_notify(struct wl_listener *listener, void *data) { } -void keyboard_destroy_notify(struct wl_listener *listener, void *data) { +static void keyboard_destroy_notify(struct wl_listener *listener, void *data) { struct sample_keyboard *keyboard = wl_container_of(listener, keyboard, destroy); wl_list_remove(&keyboard->destroy.link); wl_list_remove(&keyboard->key.link); free(keyboard); } -void new_input_notify(struct wl_listener *listener, void *data) { +static void new_input_notify(struct wl_listener *listener, void *data) { struct wlr_input_device *device = data; struct sample_state *state = wl_container_of(listener, state, new_input); switch (device->type) { diff --git a/examples/rotation.c b/examples/rotation.c index 6e10721d..3700351a 100644 --- a/examples/rotation.c +++ b/examples/rotation.c @@ -97,14 +97,14 @@ static void update_velocities(struct sample_state *sample, } } -void output_remove_notify(struct wl_listener *listener, void *data) { +static void output_remove_notify(struct wl_listener *listener, void *data) { struct sample_output *sample_output = wl_container_of(listener, sample_output, destroy); wl_list_remove(&sample_output->frame.link); wl_list_remove(&sample_output->destroy.link); free(sample_output); } -void new_output_notify(struct wl_listener *listener, void *data) { +static void new_output_notify(struct wl_listener *listener, void *data) { struct wlr_output *output = data; struct sample_state *sample = wl_container_of(listener, sample, new_output); struct sample_output *sample_output = calloc(1, sizeof(struct sample_output)); @@ -125,7 +125,7 @@ void new_output_notify(struct wl_listener *listener, void *data) { wl_list_insert(&sample->outputs, &sample_output->link); } -void keyboard_key_notify(struct wl_listener *listener, void *data) { +static void keyboard_key_notify(struct wl_listener *listener, void *data) { struct sample_keyboard *keyboard = wl_container_of(listener, keyboard, key); struct sample_state *sample = keyboard->sample; struct wlr_event_keyboard_key *event = data; @@ -157,14 +157,14 @@ void keyboard_key_notify(struct wl_listener *listener, void *data) { } } -void keyboard_destroy_notify(struct wl_listener *listener, void *data) { +static void keyboard_destroy_notify(struct wl_listener *listener, void *data) { struct sample_keyboard *keyboard = wl_container_of(listener, keyboard, destroy); wl_list_remove(&keyboard->destroy.link); wl_list_remove(&keyboard->key.link); free(keyboard); } -void new_input_notify(struct wl_listener *listener, void *data) { +static void new_input_notify(struct wl_listener *listener, void *data) { struct wlr_input_device *device = data; struct sample_state *sample = wl_container_of(listener, sample, new_input); switch (device->type) { diff --git a/examples/simple.c b/examples/simple.c index 96f33610..bf2411c8 100644 --- a/examples/simple.c +++ b/examples/simple.c @@ -36,7 +36,7 @@ struct sample_keyboard { struct wl_listener destroy; }; -void output_frame_notify(struct wl_listener *listener, void *data) { +static void output_frame_notify(struct wl_listener *listener, void *data) { struct sample_output *sample_output = wl_container_of(listener, sample_output, frame); struct sample_state *sample = sample_output->sample; @@ -65,7 +65,7 @@ void output_frame_notify(struct wl_listener *listener, void *data) { sample->last_frame = now; } -void output_remove_notify(struct wl_listener *listener, void *data) { +static void output_remove_notify(struct wl_listener *listener, void *data) { struct sample_output *sample_output = wl_container_of(listener, sample_output, destroy); wlr_log(WLR_DEBUG, "Output removed"); @@ -74,7 +74,7 @@ void output_remove_notify(struct wl_listener *listener, void *data) { free(sample_output); } -void new_output_notify(struct wl_listener *listener, void *data) { +static void new_output_notify(struct wl_listener *listener, void *data) { struct wlr_output *output = data; struct sample_state *sample = wl_container_of(listener, sample, new_output); @@ -93,7 +93,7 @@ void new_output_notify(struct wl_listener *listener, void *data) { sample_output->destroy.notify = output_remove_notify; } -void keyboard_key_notify(struct wl_listener *listener, void *data) { +static void keyboard_key_notify(struct wl_listener *listener, void *data) { struct sample_keyboard *keyboard = wl_container_of(listener, keyboard, key); struct sample_state *sample = keyboard->sample; struct wlr_event_keyboard_key *event = data; @@ -109,7 +109,7 @@ void keyboard_key_notify(struct wl_listener *listener, void *data) { } } -void keyboard_destroy_notify(struct wl_listener *listener, void *data) { +static void keyboard_destroy_notify(struct wl_listener *listener, void *data) { struct sample_keyboard *keyboard = wl_container_of(listener, keyboard, destroy); wl_list_remove(&keyboard->destroy.link); @@ -117,7 +117,7 @@ void keyboard_destroy_notify(struct wl_listener *listener, void *data) { free(keyboard); } -void new_input_notify(struct wl_listener *listener, void *data) { +static void new_input_notify(struct wl_listener *listener, void *data) { struct wlr_input_device *device = data; struct sample_state *sample = wl_container_of(listener, sample, new_input); switch (device->type) { diff --git a/examples/tablet.c b/examples/tablet.c index d437ff17..d33fb224 100644 --- a/examples/tablet.c +++ b/examples/tablet.c @@ -227,14 +227,14 @@ static void tablet_pad_destroy_notify(struct wl_listener *listener, void *data) free(pstate); } -void output_remove_notify(struct wl_listener *listener, void *data) { +static void output_remove_notify(struct wl_listener *listener, void *data) { struct sample_output *sample_output = wl_container_of(listener, sample_output, destroy); wl_list_remove(&sample_output->frame.link); wl_list_remove(&sample_output->destroy.link); free(sample_output); } -void new_output_notify(struct wl_listener *listener, void *data) { +static void new_output_notify(struct wl_listener *listener, void *data) { struct wlr_output *output = data; struct sample_state *sample = wl_container_of(listener, sample, new_output); struct sample_output *sample_output = calloc(1, sizeof(struct sample_output)); @@ -250,7 +250,7 @@ void new_output_notify(struct wl_listener *listener, void *data) { sample_output->destroy.notify = output_remove_notify; } -void keyboard_key_notify(struct wl_listener *listener, void *data) { +static void keyboard_key_notify(struct wl_listener *listener, void *data) { struct sample_keyboard *keyboard = wl_container_of(listener, keyboard, key); struct sample_state *sample = keyboard->sample; struct wlr_event_keyboard_key *event = data; @@ -266,14 +266,14 @@ void keyboard_key_notify(struct wl_listener *listener, void *data) { } } -void keyboard_destroy_notify(struct wl_listener *listener, void *data) { +static void keyboard_destroy_notify(struct wl_listener *listener, void *data) { struct sample_keyboard *keyboard = wl_container_of(listener, keyboard, destroy); wl_list_remove(&keyboard->destroy.link); wl_list_remove(&keyboard->key.link); free(keyboard); } -void new_input_notify(struct wl_listener *listener, void *data) { +static void new_input_notify(struct wl_listener *listener, void *data) { struct wlr_input_device *device = data; struct sample_state *sample = wl_container_of(listener, sample, new_input); switch (device->type) { diff --git a/examples/touch.c b/examples/touch.c index c306ba69..07d44563 100644 --- a/examples/touch.c +++ b/examples/touch.c @@ -140,14 +140,14 @@ static void touch_destroy_notify(struct wl_listener *listener, void *data) { free(tstate); } -void output_remove_notify(struct wl_listener *listener, void *data) { +static void output_remove_notify(struct wl_listener *listener, void *data) { struct sample_output *sample_output = wl_container_of(listener, sample_output, destroy); wl_list_remove(&sample_output->frame.link); wl_list_remove(&sample_output->destroy.link); free(sample_output); } -void new_output_notify(struct wl_listener *listener, void *data) { +static void new_output_notify(struct wl_listener *listener, void *data) { struct wlr_output *output = data; struct sample_state *sample = wl_container_of(listener, sample, new_output); struct sample_output *sample_output = calloc(1, sizeof(struct sample_output)); @@ -163,7 +163,7 @@ void new_output_notify(struct wl_listener *listener, void *data) { sample_output->destroy.notify = output_remove_notify; } -void keyboard_key_notify(struct wl_listener *listener, void *data) { +static void keyboard_key_notify(struct wl_listener *listener, void *data) { struct sample_keyboard *keyboard = wl_container_of(listener, keyboard, key); struct sample_state *sample = keyboard->sample; struct wlr_event_keyboard_key *event = data; @@ -179,14 +179,14 @@ void keyboard_key_notify(struct wl_listener *listener, void *data) { } } -void keyboard_destroy_notify(struct wl_listener *listener, void *data) { +static void keyboard_destroy_notify(struct wl_listener *listener, void *data) { struct sample_keyboard *keyboard = wl_container_of(listener, keyboard, destroy); wl_list_remove(&keyboard->destroy.link); wl_list_remove(&keyboard->key.link); free(keyboard); } -void new_input_notify(struct wl_listener *listener, void *data) { +static void new_input_notify(struct wl_listener *listener, void *data) { struct wlr_input_device *device = data; struct sample_state *sample = wl_container_of(listener, sample, new_input); switch (device->type) { |