This header include many useful containers. More...
Namespaces | |
FontUtils | |
Some useful function about font. | |
Platform | |
Platfrom functions. | |
Classes | |
struct | _NoSignal |
A type to tell the async don't emit the signal in main thread. More... | |
class | AbstructButton |
Basic button. More... | |
class | AsyncTask |
The AsyncTask. More... | |
struct | Atomic |
class | BadFunctionCall |
class | BoxLayout |
class | Button |
A simple pushbutton. More... | |
class | Canvas |
struct | Color |
Color structure. More... | |
struct | Connection |
class | Container |
A Container of Widget. More... | |
struct | CountedBackInserter |
A helper class for count the length we inserted. More... | |
class | Cursor |
Mouse's cursor. More... | |
class | DockWidget |
struct | DragEvent |
A event about mouse drag. More... | |
struct | DrawCallback |
The Internal Window Draw Callback. More... | |
class | Event |
A base event of all events. More... | |
struct | ExceptionData |
class | Font |
Font Class. More... | |
struct | FontImpl |
Font Impl. More... | |
class | FontSet |
struct | FPoint |
struct | FRect |
class | FSelectBox |
A Dialog of file selecting. More... | |
struct | FSelectBoxImpl |
class | Function |
class | Function< RetT(Args...)> |
struct | FunctionBase |
class | Gif |
Gif Decoding class. More... | |
class | GridLayout |
class | GroupBox |
struct | HasSlots |
class | HBoxLayout |
class | ImageView |
struct | KeyEvent |
A event about keyboard. More... | |
class | Lable |
Lable widget. More... | |
class | Layout |
class | Line |
struct | LockGuard |
Generic LockGuard. More... | |
struct | LockGuard< Texture > |
Lock Guard for Texture locking. More... | |
class | MemBuffer |
class | MessageBox |
struct | MessageBoxImpl |
class | MixerError |
struct | Module |
struct | MotionEvent |
A event about mouse motion. More... | |
struct | MouseEvent |
A event about mouse click. More... | |
class | PixBuf |
struct | PixelFormat |
Pixels format. More... | |
class | PixFmt |
Pixels format detail. More... | |
struct | Point |
class | PStream |
Pipe stream to or from a process. More... | |
struct | Rect |
a SDL_Rect with methods More... | |
class | RendererError |
class | ResizeEvent |
class | RWops |
class | ScrollBar |
class | SDLError |
struct | SetRectEvent |
A event about set Widget rect. More... | |
struct | Signal |
struct | Signal< RetT(Args...)> |
Btk Signal. More... | |
struct | SignalBase |
struct | Size |
Size of a Widget or Window. More... | |
class | SpinLock |
struct | System |
struct | Task |
class | TextBox |
struct | TextBoxInserter |
class | TextBuffer |
A container of utf16 encoded string for TextEditer. More... | |
struct | TextInputEvent |
A Event of text input. More... | |
class | TextSelection |
class | Texture |
struct | Theme |
class | Thread |
struct | ThreadPool |
class | Timer |
struct | TimerBase |
The Timer Impl. More... | |
struct | TimerInvoker |
class | VBoxLayout |
struct | WheelEvent |
class | Widget |
struct | WidgetAttr |
class | Window |
A Basic Window. More... | |
struct | WindowImpl |
struct | Worker |
class | XError |
Typedefs | |
typedef bool(* | ExceptionHandler) (std::exception *) |
typedef MouseEvent | ClickEvent |
typedef std::runtime_error | RuntimeError |
typedef SDL_Keycode | Keycode |
typedef SDL_Scancode | Scancode |
using | MixerMusic = Mixer::Music |
using | MixerAudio = Mixer::Music |
using | MixerChunk = Mixer::Chunk |
using | MixerChannal = Mixer::Channal |
template<class T > | |
using | lock_guard = LockGuard< T > |
typedef Point | Vec2 |
typedef FPoint | FVec2 |
Enumerations | |
enum | Lauch { Async = 0, Defered = 1 } |
enum | SystemCursor { Arrow, Ibeam, Wait, Crosshair, Hand } |
SystemCursor from SDL_mouse.h. More... | |
enum | ThreadType { AsyncWorker, Renderer, Unknown } |
enum | FontStyle : int { Normal = 0x00, Bold = 0x01, Italic = 0x02, Underline = 0x04, Strikethrough = 0x08 } |
FontStyle from SDL_ttf. More... | |
enum | Keymode : Uint16 { Ctrl = KMOD_CTRL, Shift = KMOD_SHIFT } |
enum | TextureAccess : int { Static, Streaming, Target } |
TextureAccess(same def in SDL_render.h) More... | |
enum | FocusPolicy { None, KeyBoard, Click, Wheel } |
enum | Align : unsigned int { Center, Top, Buttom, Right, Left } |
enum | Orientation : unsigned int { Vertical = 0, Horizontal = 1, V = Vertical, H = Horizontal } |
Functions | |
BTKAPI void | DeferCall (void(*fn)(void *), void *data) |
This function will be called in main EventLoop. More... | |
template<class T , class ... Args> | |
AsyncTask< true, T, Args... > | Async (T &&callable, Args ...args) |
Create a Async Task. More... | |
template<class T , class ... Args> | |
AsyncTask< false, T, Args... > | Async (_NoSignal, T &&callable, Args ...args) |
Create a Async Task(No signal) More... | |
void | AsyncInit () |
void | AsyncQuit () |
BTKAPI ExceptionHandler | SetExceptionHandler (ExceptionHandler) |
BTKAPI void | Exit (int code=EXIT_SUCCESS) |
End the event loop. More... | |
BTKAPI void | Init () |
BTKAPI void | AtExit (void(*fn)(void *), void *data) |
Regitser atexit callback. More... | |
BTKAPI void | AtExit (void(*fn)()) |
template<class Callable , class ... Args> | |
void | AtExit (Callable &&callable, Args ...args) |
BTKAPI void | DeferCall (void(*fn)()) |
template<class Callable , class ... Args> | |
void | DeferCall (Callable &&callable, Args ...args) |
BTKAPI bool | IsMainThread () |
Check is main thread(which call Btk::run) More... | |
BTKAPI bool | CouldBlock () |
Check is not the main thread or Main EventLoop is not running. More... | |
BTKAPI int | run () |
Enter the EventLoop. More... | |
void | PushEvent (Event *event, Window &receiver) |
Push event to queue. More... | |
void | PushEvent (Event *event, Widget &receiver) |
bool | SendEvent (Event &event, Window &receiver) |
Dispatched event right now. More... | |
bool | SendEvent (Event &event, Widget &receiver) |
void | DispatchEvent (const SDL_Event &ev, void *) |
This function was called by System to dispatch our event. More... | |
void BTKAPI | throwRuntimeError (const char *) |
void BTKAPI | throwSDLError (const char *) |
void BTKAPI | throwSDLError () |
void BTKAPI | throwBadFunctionCall () |
void BTKAPI | throwRendererError (const char *msg) |
void BTKAPI | throwRendererError () |
FontStyle | operator| (FontStyle s1, FontStyle s2) noexcept |
FontStyle | operator+ (FontStyle s1, FontStyle s2) noexcept |
FontStyle | operator& (FontStyle s1, FontStyle s2) noexcept |
FontStyle | operator+= (FontStyle s1, FontStyle s2) noexcept |
FontStyle | operator|= (FontStyle s1, FontStyle s2) noexcept |
std::u16string | Utf8ToUtf16 (std::string_view utf8) |
System & | Instance () |
int | CalculateXByAlign (const Rect &rect, int w, Align v_align) |
Calcaute a area's X in a Rect by alignment. More... | |
int | CalculateYByAlign (const Rect &rect, int h, Align h_align) |
Calcaute a area's Y in a Rect by alignment. More... | |
Rect | CalculateRectByAlign (const Rect &rect, int w, int h, Align v_align, Align h_align) |
Calcaute a area in a Rect by alignment. More... | |
MotionEvent | TranslateEvent (const SDL_MouseMotionEvent &event) |
MouseEvent | TranslateEvent (const SDL_MouseButtonEvent &event) |
WheelEvent | TranslateEvent (const SDL_MouseWheelEvent &event) |
KeyEvent | TranslateEvent (const SDL_KeyboardEvent &event) |
TextInputEvent | TranslateEvent (const SDL_TextInputEvent &event) |
Keymode | operator| (Keymode a, Keymode b) |
Keymode | operator& (Keymode a, Keymode b) |
bool | operator== (Keymode a, Uint16 b) |
bool | operator!= (Keymode a, Uint16 b) |
void BTKAPI | throwMixerError (const char *msg) |
void BTKAPI | throwMixerError () |
BTKAPI void | LoadModule (std::string_view module_name) |
BTKAPI bool | HasModule (std::string_view module_name) |
std::string | getcwd () |
Get current working dir. More... | |
std::string | getcwd (size_t bufsize) |
bool | exists (std::string_view fname) |
Check the file exists. More... | |
bool | chdir (std::string_view path) |
Change the current work dir. More... | |
PStream & | operator>> (PStream &stream, std::string &str) |
PStream & | operator<< (PStream &stream, std::string_view data) |
BTKAPI void | CreatePipe (RWops &r, RWops &w) |
Create a two binary pipes. More... | |
void | throwEmptySignal () |
BTKAPI size_t | U16Strlen (const char16_t *str) |
BTKAPI int | U16Strcmp (const char16_t *s1, const char16_t *s2) |
BTKAPI int | U16Strcasecmp (const char16_t *s1, const char16_t *s2) |
BTKAPI size_t | Utf16To8 (std::string &, std::u16string_view) |
Convert u16string to u8string. More... | |
BTKAPI size_t | Utf8To16 (std::u16string &, std::string_view) |
Convert u8string to u16string. More... | |
BTKAPI bool | IsValidUtf8 (std::string_view) |
Check a string is vaid utf8. More... | |
BTKAPI Sint64 | ParseHex (std::string_view txt) |
Parse a hex string. More... | |
BTKAPI Sint64 | ParseInt (std::string_view txt) |
template<class T , auto Alloc = std::malloc> | |
T * | Memdup (const T *ptr, size_t size) |
A helper template for dup memory. More... | |
template<class T , auto Alloc = std::malloc> | |
T * | Memdup (const T *ptr) |
A helper template for dup memory. More... | |
template<class T , auto Alloc = std::malloc> | |
T * | Memdup (const T &ref) |
std::string | Utf16To8 (std::u16string_view utf16) |
Convert utf16 string to utf8 strubg. More... | |
std::u16string | Utf8To16 (std::string_view utf8) |
Convert utf8 string to utf16 strubg. More... | |
template<class T , class U > | |
T | event_cast (U &&u) |
int | vscprintf (const char *fmt, va_list varg) |
std::string | get_typename (const std::type_info &info) |
Get the typename of a type. More... | |
template<class T > | |
std::string | get_typename (const T *ptr) |
std::string | cformat (const char *fmt,...) |
Using c-syle formatting. More... | |
void | cformat (std::string &str, const char *fmt,...) |
Append text to the string. More... | |
SDL_SystemCursor | TranslateCursor (SystemCursor cursor) |
MemBuffer & | GetMemBuffer (SDL_RWops *ctxt) |
std::ostream & | operator<< (std::ostream &str, const MemBuffer &buf) |
Uint32 SDLCALL | TimerRun (Uint32, void *timerbase) |
Variables | |
constexpr _NoSignal | NoSignal {} |
This header include many useful containers.
|
strong |
FontStyle from SDL_ttf.
|
strong |
SystemCursor from SDL_mouse.h.
|
strong |
TextureAccess(same def in SDL_render.h)
AsyncTask<true,T,Args...> Btk::Async | ( | T && | callable, |
Args ... | args | ||
) |
AsyncTask<false,T,Args...> Btk::Async | ( | _NoSignal | , |
T && | callable, | ||
Args ... | args | ||
) |
Create a Async Task(No signal)
T | The callable type |
Args | The args type |
nosignal | A flag of nosignal |
callable | The callable |
args | The args |
void Btk::AtExit | ( | void(*)(void *) | fn, |
void * | data | ||
) |
Regitser atexit callback.
fn | Callback function |
data | User data |
|
inline |
Calcaute a area's X in a Rect by alignment.
rect | The rect |
w | The W |
v_align | V alignment |
|
inline |
Calcaute a area's Y in a Rect by alignment.
rect | The rect |
h | The height |
h_align | H alignment |
|
inline |
Using c-syle formatting.
fmt | The c-style fmt string |
... | The args you want to format |
|
inline |
Append text to the string.
str | The container |
fmt | The c-style fmt string |
... | The args you want to format |
|
inline |
Change the current work dir.
path | The work dir |
bool Btk::CouldBlock | ( | ) |
Check is not the main thread or Main EventLoop is not running.
void Btk::DeferCall | ( | void(*)(void *) | fn, |
void * | data | ||
) |
This function will be called in main EventLoop.
fn | The function you want to call |
data | User data |
void Btk::DispatchEvent | ( | const SDL_Event & | ev, |
void * | |||
) |
This function was called by System to dispatch our event.
ev | SDL_Event structure |
|
inline |
Check the file exists.
fname | The filename |
void Btk::Exit | ( | int | code = EXIT_SUCCESS | ) |
End the event loop.
code | The exit code |
|
inline |
Get the typename of a type.
info | The typeinfo |
|
inline |
Get current working dir.
bool Btk::IsMainThread | ( | ) |
Check is main thread(which call Btk::run)
bool Btk::IsValidUtf8 | ( | std::string_view | input | ) |
Check a string is vaid utf8.
T* Btk::Memdup | ( | const T * | ptr, |
size_t | size | ||
) |
A helper template for dup memory.
T | The memory block type |
Alloc | The Allocator |
ptr | Source Pointer |
size | The memory block size |
T* Btk::Memdup | ( | const T * | ptr | ) |
A helper template for dup memory.
T | The memory block type |
Alloc | The Allocator |
ptr | Source Pointer |
stream | The stream |
str | The string ref |
Sint64 Btk::ParseHex | ( | std::string_view | txt | ) |
Parse a hex string.
txt | The hex text |
Push event to queue.
event | The event pointer we want to send |
receiver | The receiver |
int Btk::run | ( | ) |
Enter the EventLoop.
Dispatched event right now.
receiver |
size_t Btk::Utf16To8 | ( | std::string & | ret, |
std::u16string_view | input | ||
) |
Convert u16string to u8string.
|
inline |
Convert utf16 string to utf8 strubg.
utf16 | Utf16 encoded string |
size_t Btk::Utf8To16 | ( | std::u16string & | ret, |
std::string_view | input | ||
) |
Convert u8string to u16string.
|
inline |
Convert utf8 string to utf16 strubg.
utf8 | Utf8 encoded string |