|
| EventLoop (std::unique_ptr< EventLoopInterface > impl) |
|
bool | exec () |
|
void | exit () |
|
const char * | implementation () const |
| Return the name of implementation of event loop. More...
|
|
void * | nativeHandle () |
|
FCITX_NODISCARD std::unique_ptr< EventSourceIO > | addIOEvent (int fd, IOEventFlags flags, IOCallback callback) |
|
FCITX_NODISCARD std::unique_ptr< EventSourceTime > | addTimeEvent (clockid_t clock, uint64_t usec, uint64_t accuracy, TimeCallback callback) |
|
FCITX_NODISCARD std::unique_ptr< EventSource > | addExitEvent (EventCallback callback) |
|
FCITX_NODISCARD std::unique_ptr< EventSource > | addDeferEvent (EventCallback callback) |
|
FCITX_NODISCARD std::unique_ptr< EventSource > | addPostEvent (EventCallback callback) |
|
FCITX_NODISCARD std::unique_ptr< EventSourceAsync > | addAsyncEvent (EventCallback callback) |
| Add an async event that is safe to be triggered from another thread. More...
|
|
|
static FCITXUTILS_DEPRECATED const char * | impl () |
| Return the default implementation name. More...
|
|
static void | setEventLoopFactory (EventLoopFactory factory) |
| Set an external event loop implementation. More...
|
|
Definition at line 23 of file event.h.
◆ addAsyncEvent()
std::unique_ptr< EventSourceAsync > fcitx::EventLoop::addAsyncEvent |
( |
EventCallback |
callback | ) |
|
Add an async event that is safe to be triggered from another thread.
To ensure safe usage of this event:
- Do not change event to disable, if there may be pending call to send()
- Due to (1), if it is oneshot, ensure you only call send() once.
- Join all the possible pending thread that may call send(), before destructing the event.
- Like other event, the event should be only created/destructed on the event loop thread.
EventDispatcher uses this event internally and provides an easier and safer interface to use.
- See also
- EventDispatcher
- Parameters
-
callback | callback function |
- Returns
- async event source
- Since
- 5.1.13
Definition at line 104 of file event.cpp.
◆ impl()
const char * fcitx::EventLoop::impl |
( |
| ) |
|
|
static |
Return the default implementation name.
This will only return the default implementation name. Do not rely on this value.
- See also
- EventLoop::implementation
Definition at line 53 of file event.cpp.
◆ implementation()
const char * fcitx::EventLoop::implementation |
( |
| ) |
const |
Return the name of implementation of event loop.
- Since
- 5.1.12
Definition at line 55 of file event.cpp.
◆ setEventLoopFactory()
void fcitx::EventLoop::setEventLoopFactory |
( |
EventLoopFactory |
factory | ) |
|
|
static |
Set an external event loop implementation.
This is useful if you need to integrate fcitx with another event loop.
- Since
- 5.1.12
Definition at line 38 of file event.cpp.
The documentation for this class was generated from the following files: