Fcitx
Public Member Functions | List of all members
fcitx::EventLoopInterface Class Referenceabstract

Abstract Event Loop. More...

#include <fcitx-utils/eventloopinterface.h>

Inheritance diagram for fcitx::EventLoopInterface:
Inheritance graph
[legend]

Public Member Functions

virtual bool exec ()=0
 Execute event loop. More...
 
virtual void exit ()=0
 Quit event loop. More...
 
virtual const char * implementation () const =0
 Return a static implementation name of event loop. More...
 
virtual void * nativeHandle ()=0
 Return the internal native handle to the event loop. More...
 
FCITX_NODISCARD virtual std::unique_ptr< EventSourceIOaddIOEvent (int fd, IOEventFlags flags, IOCallback callback)=0
 
FCITX_NODISCARD virtual std::unique_ptr< EventSourceTimeaddTimeEvent (clockid_t clock, uint64_t usec, uint64_t accuracy, TimeCallback callback)=0
 
virtual FCITX_NODISCARD std::unique_ptr< EventSourceaddExitEvent (EventCallback callback)=0
 
virtual FCITX_NODISCARD std::unique_ptr< EventSourceaddDeferEvent (EventCallback callback)=0
 
virtual FCITX_NODISCARD std::unique_ptr< EventSourceaddPostEvent (EventCallback callback)=0
 

Detailed Description

Abstract Event Loop.

Since
5.1.12

Definition at line 92 of file eventloopinterface.h.

Member Function Documentation

◆ exec()

virtual bool fcitx::EventLoopInterface::exec ( )
pure virtual

Execute event loop.

Returns
true if event loop is exited successfully.

Implemented in fcitx::EventLoopLibUV, and fcitx::EventLoopSDEvent.

◆ exit()

virtual void fcitx::EventLoopInterface::exit ( )
pure virtual

Quit event loop.

Request event loop to quit, pending event may still be executed before quit. Also execute exit event right before exiting.

See also
EventLoopInterface::addExitEvent

Implemented in fcitx::EventLoopLibUV, and fcitx::EventLoopSDEvent.

◆ implementation()

virtual const char* fcitx::EventLoopInterface::implementation ( ) const
pure virtual

Return a static implementation name of event loop.

Fcitx right now supports sd-event and libuv as implementation. The library being used is decided at build time.

Returns
Name of event loop implementation

Implemented in fcitx::EventLoopLibUV, and fcitx::EventLoopSDEvent.

◆ nativeHandle()

virtual void* fcitx::EventLoopInterface::nativeHandle ( )
pure virtual

Return the internal native handle to the event loop.

This can be useful if you want to use the underlying API against event loop.

For libuv, it will be uv_loop_t*. For sd-event, it will be sd_event*.

Returns
internal implementation
See also
implementation

Implemented in fcitx::EventLoopLibUV, and fcitx::EventLoopSDEvent.


The documentation for this class was generated from the following files: