13#include <boost/function.hpp>
26 auto*
w =
reinterpret_cast<T*
>(
data);
34 std::pair<GSourceFunc, gpointer>
wrap(T
f)
36 return std::make_pair<GSourceFunc, gpointer>(Detail::gtkWrapper<T>,
new T(std::move(
f)));
44 const auto [function,
data] =
wrap(std::move(
f));
45 gdk_threads_add_idle(function,
data);
52 std::packaged_task<
void(
void)>
t(std::move(
f));
53 std::future<void>
const future =
t.get_future();
73 cairo_rectangle_int_t
rect;
85inline bool operator==(cairo_rectangle_int_t
const& left, cairo_rectangle_int_t
const&
right)
87 return left.x ==
right.x && left.y ==
right.y && left.width ==
right.width && left.height ==
right.height;
92std::ostream&
operator<<(std::ostream& os, cairo_rectangle_int_t
const&
r);
93std::ostream&
operator<<(std::ostream& os,
const GdkPoint&
p);
#define require(expr)
Definition assertions.hh:30
uint8_t data
Definition blob-tests.cc:36
PresentationInterfaceStub::Ptr const p
Definition determine-size-test.cc:172
() void(clear(nullptr)+(5 *clear(nullptr)) *5)
bool operator==(cairo_rectangle_int_t const &left, cairo_rectangle_int_t const &right)
Definition gtk-helpers.hh:85
std::ostream & operator<<(std::ostream &os, cairo_rectangle_int_t const &r)
Definition gtk-helpers.cc:29
f
Definition gtkhelper-tests.cc:43
std::pair< GSourceFunc, gpointer > const w
Definition gtkhelper-tests.cc:42
static int gtkWrapper(gpointer data)
Definition gtk-helpers.hh:24
Definition gtk-helpers.hh:20
bool on_ui_thread()
Definition gtk-helpers.cc:15
void async_on_ui_thread_and_wait(T f)
Definition gtk-helpers.hh:49
void sync_on_ui_thread(T f)
Definition gtk-helpers.hh:59
cairo_rectangle_int_t createCairoIntRectangle(int x, int y, int width, int height)
Definition gtk-helpers.hh:71
GtkWindow * get_parent_window(GtkWidget *widget)
Definition gtk-helpers.cc:17
void async_on_ui_thread(T f)
Definition gtk-helpers.hh:42
std::pair< GSourceFunc, gpointer > wrap(T f)
Definition gtk-helpers.hh:34
Segment< int > const right(3, 7)
const auto rect
Definition rectangletests.cc:335