A Basic Window.
More...
#include <window.hpp>
|
typedef Signal< bool()> | SignalClose |
|
typedef Signal< bool(Event &)> | SignalEvent |
|
typedef Signal< void(int w, int h)> | SignalResize |
|
typedef Signal< void(std::string_view)> | SignalDropFile |
|
◆ Window()
Btk::Window::Window |
( |
std::string_view |
title, |
|
|
int |
w, |
|
|
int |
h |
|
) |
| |
Construct a new Window object.
- Parameters
-
title | The window title |
w | The window width |
h | Thw window height |
◆ add() [1/2]
bool Btk::Window::add |
( |
Widget * |
ptr | ) |
|
Add widget to window.
- Parameters
-
ptr | The widget pointer(It can be nullptr) |
- Returns
- true The ptr is not nullptr
-
false The ptr is nullptr
◆ add() [2/2]
template<class T , class ... Args>
T& Btk::Window::add |
( |
Args &&... |
args | ) |
|
|
inline |
A helper template to add widget.
- Template Parameters
-
T | The widget type |
Args | The args to want to pass to construc it |
- Parameters
-
- Returns
- T& The widget reference
◆ close()
void Btk::Window::close |
( |
| ) |
|
Send a close request.
- Note
- Is is safe to call in multithreading without lock it
◆ container()
◆ done()
void Btk::Window::done |
( |
| ) |
|
Show window and set Widget postions.
◆ draw()
void Btk::Window::draw |
( |
| ) |
|
Redraw the window.
- Note
- Is is safe to call in multithreading without lock it
◆ exists()
bool Btk::Window::exists |
( |
| ) |
const |
Check the window is exist.
- Returns
- true The window is exists
-
false The window is not exists
◆ impl()
Get window impl.
- Returns
- WindowImpl*
◆ lock()
void Btk::Window::lock |
( |
| ) |
|
Lock the window before access it.
◆ mainloop()
bool Btk::Window::mainloop |
( |
| ) |
|
Enter the main event loop.
- Returns
- true The event loop finished normally
-
false Double call
◆ move()
void Btk::Window::move |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
Move the window.
- Parameters
-
◆ pixbuf()
PixBuf Btk::Window::pixbuf |
( |
| ) |
|
Get window's pixbuf.
- Returns
- PixBuf
◆ set_cursor() [1/2]
void Btk::Window::set_cursor |
( |
| ) |
|
Set the cursor to default.
◆ set_cursor() [2/2]
void Btk::Window::set_cursor |
( |
const PixBuf & |
pixbuf, |
|
|
int |
hot_x = 0 , |
|
|
int |
hot_y = 0 |
|
) |
| |
Set the cursor.
- Parameters
-
pixbuf | The image pixelbuf |
hot_x | The cursor's x |
hot_y | The cursor's y |
◆ set_fullscreen()
void Btk::Window::set_fullscreen |
( |
bool |
val = true | ) |
|
Set the fullscreen.
- Parameters
-
◆ set_icon() [1/2]
void Btk::Window::set_icon |
( |
std::string_view |
file | ) |
|
◆ set_icon() [2/2]
void Btk::Window::set_icon |
( |
const PixBuf & |
pixbuf | ) |
|
◆ set_resizeable()
void Btk::Window::set_resizeable |
( |
bool |
val = true | ) |
|
Set the resizeable.
- Parameters
-
◆ set_title()
void Btk::Window::set_title |
( |
std::string_view |
title | ) |
|
Set the title.
- Parameters
-
◆ set_transparent()
void Btk::Window::set_transparent |
( |
float |
value | ) |
|
Set the background transparent.
- Note
- Some platform unsupport it
- Parameters
-
◆ show()
void Btk::Window::show |
( |
| ) |
|
Make the window visiable.
◆ unlock()
void Btk::Window::unlock |
( |
| ) |
|
◆ update()
void Btk::Window::update |
( |
| ) |
|
The documentation for this class was generated from the following files:
- include/Btk/window.hpp
- src/impl/window.cpp
- src/platform/x11/x11.cpp