changed signatures, next step is replacing all old liblitz stuff with new interface

This commit is contained in:
Anselm R. Garbe 2006-06-12 13:13:27 +02:00
parent e02e4d4a30
commit 5fd06b376c
3 changed files with 11 additions and 20 deletions

View File

@ -3,24 +3,18 @@
* See LICENSE file for license details. * See LICENSE file for license details.
*/ */
#include <stdlib.h>
#include <cext.h>
#include "blitz.h" #include "blitz.h"
/* blitz.c */ /* blitz.c */
Blitz * void
init_blitz(Display *dpy) blitz_init(Blitz *blitz, Display *dpy)
{ {
Blitz *b = cext_emallocz(sizeof(Blitz)); blitz->display = dpy;
b->display = dpy; blitz->screen = DefaultScreen(dpy);
b->screen = DefaultScreen(dpy); blitz->root = DefaultRootWindow(dpy);
b->root = DefaultRootWindow(dpy);
return b;
} }
void void
deinit_blitz(Blitz *blitz) blitz_deinit(Blitz *blitz)
{ {
free(blitz);
} }

View File

@ -79,11 +79,11 @@ typedef struct {
} BlitzWindow; } BlitzWindow;
/* blitz.c */ /* blitz.c */
Blitz *blitz_init(Display *dpy); void blitz_init(Blitz *blitz, Display *dpy);
void blitz_deinit(Blitz *blitz); void blitz_deinit(Blitz *blitz);
/* window.c */ /* window.c */
BlitzWindow *blitz_create_win(Blitz *blitz, unsigned long mask, void blitz_create_win(Blitz *blitz, BlitzWindow *win, unsigned long mask,
int x, int y, int w, int h); int x, int y, int w, int h);
void blitz_resize_win(Blitz *blitz, BlitzWindow *win, void blitz_resize_win(Blitz *blitz, BlitzWindow *win,
int x, int y, int w, int h); int x, int y, int w, int h);

View File

@ -8,12 +8,11 @@
#include "blitz.h" #include "blitz.h"
BlitzWindow * void
blitz_create_win(Blitz *blitz, unsigned long mask, int x, int y, int w, int h) blitz_create_win(Blitz *blitz, BlitzWindow *win, unsigned long mask,
int x, int y, int w, int h)
{ {
BlitzWindow *win = cext_emallocz(sizeof(BlitzWindow));
XSetWindowAttributes wa; XSetWindowAttributes wa;
wa.override_redirect = 1; wa.override_redirect = 1;
wa.background_pixmap = ParentRelative; wa.background_pixmap = ParentRelative;
wa.event_mask = mask; wa.event_mask = mask;
@ -27,8 +26,6 @@ blitz_create_win(Blitz *blitz, unsigned long mask, int x, int y, int w, int h)
win->rect.y = y; win->rect.y = y;
win->rect.width = w; win->rect.width = w;
win->rect.height = h; win->rect.height = h;
return win;
} }
void void