int uw, uh; /* usable dimensions for drawing text and images */
} XWindow;
-/* Drawing Context linked list*/
-struct DC{
- XFontStruct *font;
- GC gc;
- struct DC *next;
-};
-
typedef union {
int i;
unsigned int ui;
static void pngdraw(struct image *img);
static void getfontsize(char *str, unsigned int *width, unsigned int *height);
-static void cleanup(struct DC *cur);
+static void cleanup();
static void eprintf(const char *, ...);
static void die(const char *, ...);
static void load(FILE *fp);
static int idx = 0;
static int slidecount = 0;
static XWindow xw;
-static struct DC dc;
static Drw *d = NULL;
static Scm *sc;
static Fnt *fonts[NUMFONTSCALES];
*width += d->fonts->h;
}
-void cleanup(struct DC *cur)
+void cleanup()
{
-// XFreeFont(xw.dpy, cur->font);
-// XFreeGC(xw.dpy, cur->gc);
-
- if (cur->next) {
- cleanup(cur->next);
- cur->next = NULL;
- }
-
- if (cur != &dc) {
- free(cur);
- return;
- }
-
drw_scm_free(sc);
drw_free(d);
xinit();
run();
- cleanup(&dc);
+ cleanup();
return EXIT_SUCCESS;
}