Where'd YOU come from?
This commit is contained in:
parent
2dbe70a550
commit
0d6ecbfef3
1 changed files with 13 additions and 7 deletions
|
@ -141,7 +141,11 @@ static void draw_mfd(cairo_t *cr,
|
|||
cairo_stroke(cr);
|
||||
}
|
||||
|
||||
static void redraw(cairo_t *cr) {
|
||||
static void draw_gauge_cluster(cairo_t *cr,
|
||||
double x,
|
||||
double y,
|
||||
double width,
|
||||
double height) {
|
||||
/*
|
||||
* Paint canvas black
|
||||
*/
|
||||
|
@ -161,7 +165,9 @@ int main(int argc, char **argv) {
|
|||
Pixmap buf;
|
||||
GC gc;
|
||||
|
||||
int screen, x = 1024, y = 480;
|
||||
int screen,
|
||||
width = 1024,
|
||||
height = 480;
|
||||
|
||||
XGCValues values = {
|
||||
.foreground = 0x000000,
|
||||
|
@ -178,19 +184,19 @@ int main(int argc, char **argv) {
|
|||
exit(1);
|
||||
|
||||
screen = DefaultScreen(display);
|
||||
win = XCreateSimpleWindow(display, DefaultRootWindow(display), 0, 0, x, y, 0, 0, 0);
|
||||
win = XCreateSimpleWindow(display, DefaultRootWindow(display), 0, 0, width, height, 0, 0, 0);
|
||||
gc = XCreateGC(display, win, GCForeground | GCBackground | GCGraphicsExposures, &values);
|
||||
buf = XCreatePixmap(display, win, x, y, 24);
|
||||
buf = XCreatePixmap(display, win, width, height, 24);
|
||||
|
||||
XSelectInput(display, win, ExposureMask | ButtonPressMask | KeyPressMask);
|
||||
XMapWindow(display, win);
|
||||
|
||||
sfc = cairo_xlib_surface_create(display, buf, DefaultVisual(display, screen), x, y);
|
||||
cairo_xlib_surface_set_size(sfc, x, y);
|
||||
sfc = cairo_xlib_surface_create(display, buf, DefaultVisual(display, screen), width, height);
|
||||
cairo_xlib_surface_set_size(sfc, width, height);
|
||||
|
||||
cr = cairo_create(sfc);
|
||||
|
||||
redraw(cr);
|
||||
draw_gauge_cluster(cr, 0, 0, width, height);
|
||||
|
||||
while (1) {
|
||||
XExposeEvent *expose;
|
||||
|
|
Loading…
Add table
Reference in a new issue