19 Steinberg::IPtr<Steinberg::Linux::IEventHandler>
handler;
34 Steinberg::IPtr<Steinberg::Linux::ITimerHandler>
handler;
46gboolean RunLoop::OnEvent(GIOChannel *source, GIOCondition condition, gpointer data)
48 auto handler =
static_cast<Steinberg::Linux::IEventHandler*
>(data);
49 handler->onFDIsSet(g_io_channel_unix_get_fd(source));
50 return G_SOURCE_REMOVE;
55 auto handler =
static_cast<Steinberg::Linux::ITimerHandler*
>(data);
57 return G_SOURCE_CONTINUE;
72 Steinberg::Linux::IEventHandler*
handler,
73 Steinberg::Linux::FileDescriptor fd)
78 return kInvalidArgument;
80 if(XConnectionNumber(
mDisplay) == fd)
83 auto eventHandler = std::make_unique<EventHandler>();
84 eventHandler->handler =
handler;
86 if(
auto channel = g_io_channel_unix_new(fd))
88 eventHandler->channel = channel;
89 eventHandler->id = g_io_add_watch(
91 (GIOCondition)(G_IO_IN | G_IO_OUT | G_IO_ERR | G_IO_HUP),
102 Steinberg::Linux::IEventHandler*
handler)
108 if((*it)->handler.get() ==
handler)
118 Steinberg::Linux::TimerInterval milliseconds)
122 if(!
handler || milliseconds == 0)
123 return kInvalidArgument;
125 auto timerHandler = std::make_unique<TimerHandler>();
126 timerHandler->handler =
handler;
131 return Steinberg::kResultOk;
140 if((*it)->handler.get() ==
handler)
IMPLEMENT_FUNKNOWN_METHODS(RunLoop, Steinberg::Linux::IRunLoop, Steinberg::Linux::IRunLoop::iid)
Steinberg::tresult PLUGIN_API registerEventHandler(Steinberg::Linux::IEventHandler *handler, Steinberg::Linux::FileDescriptor fd) override
Steinberg::tresult PLUGIN_API unregisterEventHandler(Steinberg::Linux::IEventHandler *handler) override
RunLoop(::Display *display)
std::vector< std::unique_ptr< EventHandler > > mEventHandlers
static gboolean OnEvent(GIOChannel *source, GIOCondition condition, gpointer data)
std::vector< std::unique_ptr< TimerHandler > > mTimerHandlers
Steinberg::tresult PLUGIN_API registerTimer(Steinberg::Linux::ITimerHandler *handler, Steinberg::Linux::TimerInterval milliseconds) override
Steinberg::tresult PLUGIN_API unregisterTimer(Steinberg::Linux::ITimerHandler *handler) override
static gboolean OnTimer(gpointer data)
AuthorizationHandler handler
const char * end(const char *str) noexcept
Steinberg::IPtr< Steinberg::Linux::IEventHandler > handler
Steinberg::IPtr< Steinberg::Linux::ITimerHandler > handler