1 #if !defined(_BTK_WINDOW_HPP_) 2 #define _BTK_WINDOW_HPP_ 6 #include "signal/signal.hpp" 41 Window(std::string_view title,
int w,
int h);
66 template<
class T,
class ...Args>
67 T &
add(Args &&...args){
68 T *ptr =
new T(container(),std::forward<Args>(args)...);
98 void move(
int x,
int y);
141 void set_title(std::string_view title);
147 void set_icon(std::string_view file);
153 void set_icon(
const PixBuf &pixbuf);
159 void set_fullscreen(
bool val =
true);
165 void set_resizeable(
bool val =
true);
172 void set_transparent(
float value);
176 return sig_close().connect(std::forward<T>(args)...);
180 return sig_resize().connect(std::forward<T>(args)...);
184 return sig_dropfile().connect(std::forward<T>(args)...);
187 SignalClose& sig_close();
188 SignalEvent& sig_event();
189 SignalResize& sig_resize();
190 SignalDropFile& sig_dropfile();
203 void set_cursor(
const PixBuf &pixbuf,
int hot_x = 0,
int hot_y = 0);
205 int w()
const noexcept;
206 int h()
const noexcept;
219 #endif // _BTK_WINDOW_HPP_
Definition: signal.hpp:89
This header include many useful containers.
Definition: async.hpp:7
A Basic Window.
Definition: window.hpp:20
Font Class.
Definition: font.hpp:26
Definition: pixels.hpp:32
bool exists(std::string_view fname)
Check the file exists.
Definition: fs.hpp:54
Definition: signal.hpp:119
WindowImpl * impl() const noexcept
Get window impl.
Definition: window.hpp:47
Definition: window.hpp:39
A Container of Widget.
Definition: widget.hpp:108
T & add(Args &&...args)
A helper template to add widget.
Definition: window.hpp:67