|
libxputty
0.1
A damn tiny abstraction Layer to create X11 window/widgets with cairo surfaces
|
|
Go to the documentation of this file.
25 main->
dpy = XOpenDisplay(0);
42 Atom WM_DELETE_WINDOW;
43 WM_DELETE_WINDOW = XInternAtom(wid->
app->
dpy,
"WM_DELETE_WINDOW", True);
44 XSetWMProtocols(wid->
app->
dpy, wid->
widget, &WM_DELETE_WINDOW, 1);
49 while (main->
run && (XNextEvent(main->
dpy, &xev)>=0)) {
50 if (XFilterEvent(&xev, None))
continue;
65 if (xev.xbutton.window == w->
widget) {
70 if (xev.xbutton.window == view_port->
widget) is_item = True;
72 XUngrabPointer(main->
dpy,CurrentTime);
80 if (xev.xclient.data.l[0] == (
long int)WM_DELETE_WINDOW &&
81 xev.xclient.window == wid->
widget) {
100 while (XPending(main->
dpy) > 0) {
101 XNextEvent(main->
dpy, &xev);
111 bool is_item = False;
115 if (xev.xbutton.window == w->
widget) {
120 if (xev.xbutton.window == view_port->
widget) is_item = True;
122 XUngrabPointer(main->
dpy,CurrentTime);
130 if (xev.xclient.data.l[0] == (
long int)XInternAtom(main->
dpy,
"WM_DELETE_WINDOW", True) ) {
151 XCloseDisplay(main->
dpy);
Xputty - the main struct. It should be declared before any other call to a Xputty function....
void set_dark_theme(Xputty *main)
set_dark_theme - init the XColor_t struct to the default dark theme
void childlist_init(Childlist_t *childlist)
childlist_init - internal use to allocate the array to min size You usually didn't need to call thi...
void main_quit(Xputty *main)
main_quit - destroy all remaining Widget_t's from the main->childlist. Free all resources which may...
void run_embedded(Xputty *main)
run_embedded - the main event loop to run embedded UI's. It should be start after your Widget_t's b...
void main_init(Xputty *main)
main_init - open the Display and init the main->childlist. Set the bool run to true....
void main_run(Xputty *main)
main_run - start the main event loop. It should be start after your Widget_t's been created....
XColor_t - the Widget_t Color struct XColor_t could be used for theming you Widget_t set.
#define debug_print(...)
debug_print - print out state messages when compiled with the -DDEBUG flag
Childlist_t - struct to hold a Widget_t child list Xputty main holds a list of any Widget_t created...
void childlist_destroy(Childlist_t *childlist)
childlist_destroy - internal use to free the Childlist_t You usually didn't need to call this
int childlist_find_widget(Childlist_t *childlist, Window child_window)
childlist_find_widget - find a child Widget_t in a the childlist by given the Window id