Cleanups.

SVN revision: 13565
This commit is contained in:
Kim Woelders 2005-03-02 20:09:45 +00:00
parent a32d4e1e9d
commit 6dea672961
4 changed files with 30 additions and 21 deletions

14
src/E.h
View File

@ -1086,22 +1086,30 @@ Qentry;
#define DIALOG_BUTTON_APPLY 3
#define DIALOG_BUTTON_CLOSE 4
/* Disable, but Keep around a bit longer */
#define USE_DQ_ICLASS 0
#define USE_DQ_TCLASS 0
typedef struct _drawqueue
{
void (*func) (struct _drawqueue *);
Window win;
int x, y, w, h;
#if USE_DQ_ICLASS
ImageClass *iclass;
int w, h, active, sticky, state, expose;
int image_type;
int active, sticky, state, expose;
#endif
#if USE_DQ_TCLASS
TextClass *tclass;
char *text;
#endif
char shape_propagate;
Pager *pager;
Pager *redraw_pager;
char newbg;
Dialog *d;
DItem *di;
int x, y;
int image_type;
}
DrawQueue;

View File

@ -71,6 +71,7 @@ HandleDrawQueue()
}
}
}
#if USE_DQ_TCLASS
else if (dq->text)
{
for (i = 0; i < num; i++)
@ -82,6 +83,8 @@ HandleDrawQueue()
}
}
}
#endif
#if USE_DQ_ICLASS
else if (dq->iclass)
{
for (i = 0; i < num; i++)
@ -94,6 +97,7 @@ HandleDrawQueue()
}
}
}
#endif
else if (dq->pager)
{
for (i = 0; i < num; i++)
@ -176,12 +180,16 @@ HandleDrawQueue()
{
if (dq)
{
#if USE_DQ_ICLASS
if (dq->iclass)
dq->iclass->ref_count--;
#endif
#if USE_DQ_TCLASS
if (dq->tclass)
dq->tclass->ref_count--;
if (dq->text)
Efree(dq->text);
#endif
Efree(dq);
}
}
@ -204,6 +212,7 @@ HandleDrawQueue()
if (WinExists(dq->win))
PropagateShapes(dq->win);
}
#if USE_DQ_TCLASS
else if (dq->text)
{
/* printf("T %x\n", dq->win); */
@ -213,6 +222,8 @@ HandleDrawQueue()
dq->expose, dq->tclass, dq->text);
Efree(dq->text);
}
#endif
#if USE_DQ_ICLASS
else if (dq->iclass)
{
/* printf("I %x\n", dq->win); */
@ -221,6 +232,7 @@ HandleDrawQueue()
dq->active, dq->sticky, dq->state, 0,
dq->image_type);
}
#endif
else if (dq->pager)
{
/* printf("P %x\n", dq->win); */
@ -245,10 +257,14 @@ HandleDrawQueue()
LIST_TYPE_PAGER))
dq->func(dq);
}
#if USE_DQ_ICLASS
if (dq->iclass)
dq->iclass->ref_count--;
#endif
#if USE_DQ_TCLASS
if (dq->tclass)
dq->tclass->ref_count--;
#endif
Efree(dq);
}
Efree(lst);
@ -1788,24 +1804,9 @@ PropagateShapes(Window win)
{
DrawQueue *dq;
dq = Emalloc(sizeof(DrawQueue));
dq = Ecalloc(1, sizeof(DrawQueue));
dq->win = win;
dq->iclass = NULL;
dq->w = 0;
dq->h = 0;
dq->active = 0;
dq->sticky = 0;
dq->state = 0;
dq->expose = 0;
dq->tclass = NULL;
dq->text = NULL;
dq->shape_propagate = 1;
dq->pager = NULL;
dq->redraw_pager = NULL;
dq->d = NULL;
dq->di = NULL;
dq->x = 0;
dq->y = 0;
AddItem(dq, "DRAW", dq->win, LIST_TYPE_DRAW);
return;
}

View File

@ -985,7 +985,7 @@ ITApply(Window win, ImageClass * ic, ImageState * is, int w, int h, int state,
if (w <= 0 || h <= 0)
return;
#if 0 /* Try not using the draw queue here. */
#if USE_DQ_ICLASS /* Try not using the draw queue here. */
if (Mode.queue_up)
{
DrawQueue *dq;

View File

@ -438,7 +438,7 @@ TextclassApply(ImageClass * iclass, Window win, int w, int h, int active,
if ((!iclass) || (!tclass) || (!text) || (!win) || (w < 1) || (h < 1))
return;
#if 0 /* Try not using the draw queue here. */
#if USE_DQ_TCLASS /* Try not using the draw queue here. */
if (Mode.queue_up)
{
DrawQueue *dq;