scrcpy/app/src/events.h
Romain Vimont a3405ab62e Extract sc_push_event()
Expose a convenience function to push an event without args to the main
thread.
2024-09-06 23:08:08 +02:00

28 lines
597 B
C

#ifndef SC_EVENTS
#define SC_EVENTS
#include "common.h"
#include <stdbool.h>
#include <stdint.h>
#include <SDL_events.h>
enum {
SC_EVENT_NEW_FRAME = SDL_USEREVENT,
SC_EVENT_DEVICE_DISCONNECTED,
SC_EVENT_SERVER_CONNECTION_FAILED,
SC_EVENT_SERVER_CONNECTED,
SC_EVENT_USB_DEVICE_DISCONNECTED,
SC_EVENT_DEMUXER_ERROR,
SC_EVENT_RECORDER_ERROR,
SC_EVENT_SCREEN_INIT_SIZE,
SC_EVENT_TIME_LIMIT_REACHED,
SC_EVENT_CONTROLLER_ERROR,
};
bool
sc_push_event_impl(uint32_t type, const char *name);
#define sc_push_event(TYPE) sc_push_event_impl(TYPE, # TYPE)
#endif