mirror of https://github.com/buggins/dlangui.git
fix sample XCB code formatting
This commit is contained in:
parent
77ee20c6a9
commit
f3584dd6fc
|
@ -4,7 +4,8 @@ import std.stdio;
|
||||||
import std.c.linux.X11.xcb.xcb;
|
import std.c.linux.X11.xcb.xcb;
|
||||||
import std.c.linux.X11.xcb.xproto;
|
import std.c.linux.X11.xcb.xproto;
|
||||||
import std.c.stdlib;
|
import std.c.stdlib;
|
||||||
int main()
|
|
||||||
|
int main(string[] args)
|
||||||
{
|
{
|
||||||
xcb_connection_t *c;
|
xcb_connection_t *c;
|
||||||
xcb_screen_t *s;
|
xcb_screen_t *s;
|
||||||
|
@ -22,6 +23,7 @@ int main()
|
||||||
writefln("Cannot open display");
|
writefln("Cannot open display");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the first screen */
|
/* get the first screen */
|
||||||
s = xcb_setup_roots_iterator( xcb_get_setup(c) ).data;
|
s = xcb_setup_roots_iterator( xcb_get_setup(c) ).data;
|
||||||
|
|
||||||
|
@ -49,10 +51,11 @@ int main()
|
||||||
xcb_flush(c);
|
xcb_flush(c);
|
||||||
|
|
||||||
/* event loop */
|
/* event loop */
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
|
||||||
e = xcb_wait_for_event(c);
|
e = xcb_wait_for_event(c);
|
||||||
if(!e)break;
|
if (!e)
|
||||||
|
break;
|
||||||
switch (e.response_type & ~0x80) {
|
switch (e.response_type & ~0x80) {
|
||||||
case XCB_EXPOSE: /* draw or redraw the window */
|
case XCB_EXPOSE: /* draw or redraw the window */
|
||||||
xcb_poly_fill_rectangle(c, w, g, 1, &r);
|
xcb_poly_fill_rectangle(c, w, g, 1, &r);
|
||||||
|
|
Loading…
Reference in New Issue