Sat Sep 4 00:35:38 PDT 1999

(Raster)

draw queue for handling expoes on dialogs.. more efficient drawing for dialogs
AND now no drawing bugs in non opaque move and resize modes :)


SVN revision: 175
This commit is contained in:
Carsten Haitzler 1999-09-04 07:10:13 +00:00
parent 86f55c10db
commit 04642ec16c
13 changed files with 158 additions and 52 deletions

View File

@ -1252,3 +1252,11 @@ Fri Sep 3 16:33:31 PDT 1999
(Raster)
ok - i forgot if i edited something....
-------------------------------------------------------------------------------
Sat Sep 4 00:35:38 PDT 1999
(Raster)
draw queue for handling expoes on dialogs.. more efficient drawing for dialogs
AND now no drawing bugs in non opaque move and resize modes :)

32
src/E.h
View File

@ -1171,20 +1171,6 @@ typedef struct _IPCstruct
}
IPCStruct;
typedef struct _drawqueue
{
Window win;
ImageClass *iclass;
int w, h, active, sticky, state, expose;
TextClass *tclass;
char *text;
char shape_propagate;
Pager *pager;
Pager *redraw_pager;
char newbg;
}
DrawQueue;
typedef struct _tooltip
{
char *name;
@ -1597,6 +1583,23 @@ struct _pager
EWin *hi_ewin;
};
typedef struct _drawqueue
{
Window win;
ImageClass *iclass;
int w, h, active, sticky, state, expose;
TextClass *tclass;
char *text;
char shape_propagate;
Pager *pager;
Pager *redraw_pager;
char newbg;
Dialog *d;
DItem *di;
int x, y;
}
DrawQueue;
void Efont_extents(Efont * f, char *text,
int *font_ascent_return,
int *font_descent_return, int *width_return,
@ -1989,6 +1992,7 @@ int initFunctionArray(void);
void GrabActionKey(Action * a);
void UnGrabActionKey(Action * a);
void GrabTheButtons(Window win);
int GrabConfineThePointer(Window win);
int GrabThePointer(Window win);
void UnGrabTheButtons(void);

View File

@ -1,11 +1,12 @@
BUGS:
raster: handling exposes during move and resize modes > 0 (dont do it)
raster: group properties are not remembered :(
raster: in E-docs interactive.sh gets hosed on make clean
raster: must update dox docs fully
mark: grab cursor and confine to root window when moving windows / resizing.
mark: focus swtiching in multihead between the heads gets confused... :)
raster: dialog redrawing of widgets has to be queued.... :)
FEATURES:
raster: add dnd to iconbox
raster: iconify animation suport

View File

@ -820,27 +820,21 @@ doResize(void *params)
}
queue_up = 0;
AUDIO_PLAY("SOUND_RESIZE_START");
UnGrabTheButtons();
GrabConfineThePointer(root.win);
mode.mode = MODE_RESIZE;
x = mode.x - ewin->x;
y = mode.y - ewin->y;
w = ewin->w >> 1;
h = ewin->h >> 1;
if ((x < w) && (y < h))
{
mode.resize_detail = 0;
}
mode.resize_detail = 0;
if ((x >= w) && (y < h))
{
mode.resize_detail = 1;
}
mode.resize_detail = 1;
if ((x < w) && (y >= h))
{
mode.resize_detail = 2;
}
mode.resize_detail = 2;
if ((x >= w) && (y >= h))
{
mode.resize_detail = 3;
}
mode.resize_detail = 3;
mode.start_x = mode.x;
mode.start_y = mode.y;
mode.win_x = ewin->x;
@ -879,17 +873,15 @@ doResizeH(void *params)
}
queue_up = 0;
AUDIO_PLAY("SOUND_RESIZE_START");
UnGrabTheButtons();
GrabConfineThePointer(root.win);
mode.mode = MODE_RESIZE_H;
x = mode.x - ewin->x;
w = ewin->w >> 1;
if (x < w)
{
mode.resize_detail = 0;
}
mode.resize_detail = 0;
else
{
mode.resize_detail = 1;
}
mode.resize_detail = 1;
mode.start_x = mode.x;
mode.start_y = mode.y;
mode.win_x = ewin->x;
@ -928,17 +920,15 @@ doResizeV(void *params)
}
queue_up = 0;
AUDIO_PLAY("SOUND_RESIZE_START");
UnGrabTheButtons();
GrabConfineThePointer(root.win);
mode.mode = MODE_RESIZE_V;
y = mode.y - ewin->y;
h = ewin->h >> 1;
if (y < h)
{
mode.resize_detail = 0;
}
mode.resize_detail = 0;
else
{
mode.resize_detail = 1;
}
mode.resize_detail = 1;
mode.start_x = mode.x;
mode.start_y = mode.y;
mode.win_x = ewin->x;
@ -961,6 +951,7 @@ doResizeEnd(void *params)
EDBUG(0, "doResizeEnd");
ewin = GetFocusEwin();
UnGrabTheButtons();
AUDIO_PLAY("SOUND_RESIZE_STOP");
if (!ewin)
{
@ -1026,7 +1017,8 @@ doMoveImpl(void *params, char constrained)
FX_Pause();
GrabX();
}
/* GrabThePointer(root.win); */
UnGrabTheButtons();
GrabConfineThePointer(root.win);
AUDIO_PLAY("SOUND_MOVE_START");
mode.mode = MODE_MOVE;
mode.constrained = constrained;

View File

@ -870,7 +870,7 @@ SyncBorderToEwin(EWin * ewin)
EDBUG(4, "SyncBorderToEwin");
b = ewin->border;
ICCCM_GetShapeInfo(ewin);
/* SetEwinBorder(ewin);*/
/* SetEwinBorder(ewin); */
SetEwinToBorder(ewin, ewin->border);
if (b != ewin->border)
{
@ -1236,7 +1236,7 @@ Adopt(Window win)
b = ewin->border;
ewin->border = NULL;
ewin->border_new = 1;
SetEwinToBorder(ewin, b);
ICCCM_MatchSize(ewin);
ICCCM_Adopt(ewin, win);
@ -1265,16 +1265,16 @@ AdoptInternal(Window win, Border * border)
ICCCM_GetInfo(ewin, 0);
ICCCM_GetShapeInfo(ewin);
ICCCM_GetGeoms(ewin, 0);
MatchEwinToSnapInfo(ewin);
if (!ewin->border)
ewin->border = border;
b = ewin->border;
ewin->border = NULL;
ewin->border_new = 1;
SetEwinToBorder(ewin, b);
ICCCM_MatchSize(ewin);
ICCCM_Adopt(ewin, win);
UngrabX();

View File

@ -1454,6 +1454,31 @@ DialogDrawItems(Dialog * d, DItem * di, int x, int y, int w, int h)
{
int state;
if (queue_up)
{
DrawQueue *dq;
dq = Emalloc(sizeof(DrawQueue));
dq->win = 0;
dq->iclass = NULL;
dq->w = w;
dq->h = h;
dq->active = 0;
dq->sticky = 0;
dq->state = 0;
dq->expose = 0;
dq->tclass = NULL;
dq->text = NULL;
dq->shape_propagate = 0;
dq->pager = NULL;
dq->redraw_pager = NULL;
dq->d = d;
dq->di = di;
dq->x = x;
dq->y = y;
AddItem(dq, "DRAW", 0, LIST_TYPE_DRAW);
EDBUG_RETURN_;
}
if (di->type == DITEM_TABLE)
{
int i;

View File

@ -72,6 +72,34 @@ HandleDrawQueue()
}
}
}
else if (dq->d)
{
for (i = 0; i < num; i++)
{
if ((lst[i]->d == dq->d) && (dq->d->item) &&
(dq->d->item == dq->di))
{
if (dq->x < lst[i]->x)
{
lst[i]->w += (lst[i]->x - dq->x);
lst[i]->x = dq->x;
}
if ((lst[i]->x + lst[i]->w) < (dq->x + dq->w))
lst[i]->w += (dq->x + dq->w) -
(lst[i]->x + lst[i]->w);
if (dq->y < lst[i]->y)
{
lst[i]->h += (lst[i]->y - dq->y);
lst[i]->y = dq->y;
}
if ((lst[i]->y + lst[i]->h) < (dq->y + dq->h))
lst[i]->h += (dq->y + dq->h) -
(lst[i]->y + lst[i]->h);
already = 1;
i = num;
}
}
}
else if (dq->redraw_pager)
{
for (i = 0; i < num; i++)
@ -160,6 +188,14 @@ HandleDrawQueue()
PagerForceUpdate(lst[i]->pager);
/* printf("P %x\n", lst[i]->win); */
}
else if (lst[i]->d)
{
if (FindItem((char *)(lst[i]->d), 0,
LIST_FINDBY_POINTER, LIST_TYPE_DIALOG))
DialogDrawItems(lst[i]->d, lst[i]->di, lst[i]->x,
lst[i]->y, lst[i]->w, lst[i]->h);
/* printf("D %x\n", lst[i]->d->ewin->client.win); */
}
else if (lst[i]->redraw_pager)
{
if (FindItem((char *)(lst[i]->redraw_pager), 0,
@ -688,7 +724,7 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
static Pixmap b1 = 0, b2 = 0, b3 = 0;
static Font font = 0;
int bpp;
char str[32];
char str[32], pq;
EDBUG(4, "DrawEwinShape");
if ((mode.mode == MODE_RESIZE) ||
@ -730,6 +766,8 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
}
pw = w;
ph = h;
pq = queue_up;
queue_up = 0;
switch (md)
{
case 0:
@ -1106,6 +1144,7 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
default:
break;
}
queue_up = pq;
EDBUG_RETURN_;
}
@ -1169,6 +1208,10 @@ PropagateShapes(Window win)
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);
EDBUG_RETURN_;
}

View File

@ -81,6 +81,23 @@ GrabThePointer(Window win)
EDBUG_RETURN(ret);
}
int
GrabConfineThePointer(Window win)
{
int ret;
EDBUG(4, "GrabThePointer");
if (mode.click_focus_grabbed)
EDBUG_RETURN(1);
ret = XGrabPointer(disp, win, True, ButtonPressMask | ButtonReleaseMask |
PointerMotionMask | ButtonMotionMask |
EnterWindowMask | LeaveWindowMask, GrabModeAsync,
GrabModeAsync, win, None, CurrentTime);
grab_window = win;
mode.click_focus_grabbed = 1;
EDBUG_RETURN(ret);
}
void
UnGrabTheButtons()
{

View File

@ -1137,7 +1137,7 @@ ICCCM_SetEInfo(EWin * ewin)
XChangeProperty(disp, ewin->client.win, a, XA_CARDINAL, 32, PropModeReplace,
(unsigned char *)c, 9);
XChangeProperty(disp, ewin->client.win, aa, XA_STRING, 8, PropModeReplace,
(unsigned char *)ewin->border->name,
(unsigned char *)ewin->border->name,
strlen(ewin->border->name) + 1);
EDBUG_RETURN_;
}
@ -1244,13 +1244,13 @@ ICCCM_GetEInfo(EWin * ewin)
ewin->client.h = c[7];
}
XGetWindowProperty(disp, ewin->client.win, aa, 0, 0xffff, True, XA_STRING,
&a2, &dummy, &lnum, &ldummy, (unsigned char **)&str);
&a2, &dummy, &lnum, &ldummy, (unsigned char **)&str);
num = (int)lnum;
if ((num > 0) && (str))
{
Border *b = NULL;
b = (Border *) FindItem(str, 0,
LIST_FINDBY_NAME,
LIST_TYPE_BORDER);

View File

@ -518,6 +518,10 @@ IclassApply(ImageClass * iclass, Window win, int w, int h,
dq->shape_propagate = 0;
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);
EDBUG_RETURN_;
}

View File

@ -871,6 +871,10 @@ PagerRedraw(Pager * p, char newbg)
dq->pager = NULL;
dq->redraw_pager = p;
dq->newbg = newbg;
dq->d = NULL;
dq->di = NULL;
dq->x = 0;
dq->y = 0;
AddItem(dq, "DRAW", dq->win, LIST_TYPE_DRAW);
return;
}
@ -1018,6 +1022,10 @@ PagerForceUpdate(Pager * p)
dq->shape_propagate = 0;
dq->pager = p;
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

@ -947,7 +947,7 @@ SettingsArea(void)
DialogItemSetFill(di, 1, 0);
DialogItemSetColSpan(di, 3);
DialogItemTextSetText(di, "Resistance at edge of screen:\n");
di = slider = DialogAddItem(table, DITEM_SLIDER);
DialogItemSliderSetMinLength(di, 10);
DialogItemSetColSpan(di, 3);
@ -3392,7 +3392,7 @@ CB_ConfigureGroup(int val, void *data)
tmp_group->set_border = tmp_group_set_border;
tmp_group->stick = tmp_group_stick;
tmp_group->shade = tmp_group_shade;
tmp_group->mirror = tmp_group_mirror;
tmp_group->mirror = tmp_group_mirror;
}
}
autosave();

View File

@ -214,6 +214,10 @@ TclassApply(ImageClass * iclass, Window win, int w, int h, int active,
dq->shape_propagate = 0;
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);
EDBUG_RETURN_;
}