Remove code for shaded, semi-solid, and translucent move/resize modes.

Disabled (by default) at compile time as of 1.0.3.

SVN revision: 81865
This commit is contained in:
Kim Woelders 2012-12-29 12:06:46 +00:00
parent 0c16916258
commit 80a3b2149e
5 changed files with 2 additions and 267 deletions

View File

@ -410,13 +410,6 @@ if test "x$enable_dialogs" = "xyes"; then
AC_DEFINE(ENABLE_DIALOGS, 1, [Configuration dialog support])
fi
AC_ARG_ENABLE(oldmovres,
[ --enable-oldmovres enable support for old move/resize modes @<:@default=no@:>@],,
enable_oldmovres=no)
if test "x$enable_oldmovres" = "xyes"; then
AC_DEFINE(ENABLE_OLDMOVRES, 1, [Support old move/resize modes (shaded, semi-solid, translucent)])
fi
AM_MISSING_PROG(XMLTO, xmlto)
AC_ARG_ENABLE(mans,
[ --enable-mans install man page @<:@default=yes@:>@],,

View File

@ -500,9 +500,11 @@ void DialogOKstr(const char *title, const char *txt);
#define MR_OPAQUE 0
#define MR_TECHNICAL 1
#define MR_BOX 2
#if 0 /* Obsolete */
#define MR_SHADED 3
#define MR_SEMI_SOLID 4
#define MR_TRANSLUCENT 5
#endif
#define MR_TECH_OPAQUE 6
int MoveResizeModeValidateMove(int md);

View File

@ -25,39 +25,10 @@
#include "desktops.h"
#include "eobj.h"
#include "ewins.h"
#include "piximg.h"
#include "xwin.h"
#if ENABLE_OLDMOVRES
#define MR_ENABLE_STIPPLED 1 /* Enable shaded/semi-solid modes */
#define MR_ENABLE_TRANSLUCENT 1 /* Enable translucent mode */
#define MR_MODES_MOVE 0x7f /* MR_OPAQUE through MR_TECH_OPAQUE */
#define MR_MODES_RESIZE 0x5f /* MR_OPAQUE through MR_SEMI_SOLID and MR_TECH_OPAQUE */
#else
#define MR_MODES_MOVE 0x47 /* MR_OPAQUE through MR_BOX and MR_TECH_OPAQUE */
#define MR_MODES_RESIZE 0x47 /* MR_OPAQUE through MR_BOX and MR_TECH_OPAQUE */
#endif
#if MR_ENABLE_STIPPLED
#if 0
#include <X11/bitmaps/gray>
#include <X11/bitmaps/gray3>
#else
/* Include contents of X11/bitmaps/gray+gray3.
* (avoid build failure if x11 bitmap package isn't installed) */
#define gray_width 2
#define gray_height 2
static const char gray_bits[] = { 0x01, 0x02 };
#define gray3_width 4
#define gray3_height 4
static const char gray3_bits[] = { 0x01, 0x00, 0x04, 0x00 };
#endif
static Pixmap b2 = None; /* Used in modes 3,4 */
static Pixmap b3 = None; /* Used in mode 3 */
#endif /* MR_ENABLE_STIPPLED */
static Font font = None; /* Used in mode 1 (technical) */
@ -143,48 +114,12 @@ do_draw_boxy(Drawable dr, GC gc,
XDrawRectangle(disp, dr, gc, a + bl + 1, b + bt + 1, c - 3, d - 3);
}
#if MR_ENABLE_STIPPLED
static void
do_draw_shaded(Drawable dr, GC gc,
int a, int b, int c, int d, int bl, int br, int bt, int bb)
{
XSetFillStyle(disp, gc, FillStippled);
XSetStipple(disp, gc, b2);
if ((c + bl + br > 0) && (bt > 0))
XFillRectangle(disp, dr, gc, a, b, c + bl + br, bt);
if ((c + bl + br > 0) && (bb > 0))
XFillRectangle(disp, dr, gc, a, b + d + bt, c + bl + br, bb);
if ((d > 0) && (bl > 0))
XFillRectangle(disp, dr, gc, a, b + bt, bl, d);
if ((d > 0) && (br > 0))
XFillRectangle(disp, dr, gc, a + c + bl, b + bt, br, d);
XSetStipple(disp, gc, b3);
if ((c > 0) && (d > 0))
XFillRectangle(disp, dr, gc, a + bl + 1, b + bt + 1, c - 3, d - 3);
}
static void
do_draw_semi_solid(Drawable dr, GC gc,
int a, int b, int c, int d, int bl, int br, int bt, int bb)
{
XSetFillStyle(disp, gc, FillStippled);
XSetStipple(disp, gc, b2);
XFillRectangle(disp, dr, gc, a, b, c + bl + br, d + bt + bb);
}
#endif /* MR_ENABLE_STIPPLED */
typedef struct {
Window root;
GC gc;
int xo, yo, wo, ho;
int bl, br, bt, bb;
ShapeWin *shwin;
#if MR_ENABLE_TRANSLUCENT
PixImg *root_pi;
PixImg *ewin_pi;
PixImg *draw_pi;
#endif
} ShapeData;
static void
@ -216,11 +151,7 @@ typedef void (DrawFunc) (Drawable dr, GC gc, int a, int b, int c, int d,
static DrawFunc *const draw_functions[] = {
do_draw_technical, do_draw_boxy,
#if MR_ENABLE_STIPPLED
do_draw_shaded, do_draw_semi_solid,
#else
NULL, NULL,
#endif /* MR_ENABLE_STIPPLED */
NULL, do_draw_technical,
};
@ -242,17 +173,6 @@ _ShapeDrawNontranslucent(EWin * ewin, int md, int firstlast,
gcv.subwindow_mode = IncludeInferiors;
psd->gc = EXCreateGC(psd->root,
GCFunction | GCForeground | GCSubwindowMode, &gcv);
#if MR_ENABLE_STIPPLED
if (md == MR_SHADED || md == MR_SEMI_SOLID)
{
if (!b2)
b2 = XCreateBitmapFromData(disp, psd->root, gray_bits,
gray_width, gray_height);
if (!b3)
b3 = XCreateBitmapFromData(disp, psd->root, gray3_bits,
gray3_width, gray3_height);
}
#endif /* MR_ENABLE_STIPPLED */
}
drf = draw_functions[md - 1];
@ -274,127 +194,6 @@ _ShapeDrawNontranslucent(EWin * ewin, int md, int firstlast,
}
}
#if MR_ENABLE_TRANSLUCENT
static void
_ShapeDrawTranslucent(EWin * ewin, int md __UNUSED__, int firstlast,
int xn, int yn, int wn, int hn)
{
ShapeData *psd = (ShapeData *) ewin->shape_data;
XGCValues gcv;
int dx, dy, adx, ady;
int xo, yo;
xo = psd->xo;
yo = psd->yo;
/* Using frame window size here */
wn = EoGetW(ewin);
hn = EoGetH(ewin);
switch (firstlast)
{
default:
break;
case 0:
gcv.subwindow_mode = IncludeInferiors;
psd->gc = EXCreateGC(psd->root, GCSubwindowMode, &gcv);
psd->root_pi =
PixImgCreate(NULL, psd->gc, WinGetW(VROOT), WinGetH(VROOT));
psd->ewin_pi = PixImgCreate(NULL, psd->gc, wn, hn);
psd->draw_pi = PixImgCreate(VROOT, psd->gc, wn, hn);
if ((!psd->root_pi) || (!psd->ewin_pi) || (!psd->draw_pi))
{
/* Trouble - Fall back to opaque mode */
Conf.movres.mode_move = MR_OPAQUE;
goto do_cleanup;
}
if (EoGetWin(ewin)->num_rect > 0)
{
Pixmap mask;
mask = EWindowGetShapePixmapInverted(EoGetWin(ewin));
PixImgSetMask(psd->draw_pi, mask, 0, 0);
}
PixImgFill(psd->root_pi, psd->root, 0, 0);
PixImgFill(psd->ewin_pi, psd->root, xn, yn);
PixImgBlend(psd->root_pi, psd->ewin_pi, psd->draw_pi, psd->root,
xn, yn, wn, hn);
break;
case 1:
dx = xn - xo;
dy = yn - yo;
if (dx < 0)
adx = -dx;
else
adx = dx;
if (dy < 0)
ady = -dy;
else
ady = dy;
if ((adx <= wn) && (ady <= hn))
{
PixImgBlend(psd->root_pi, psd->ewin_pi, psd->draw_pi, psd->root,
xn, yn, wn, hn);
if (dx > 0)
PixImgPaste11(psd->root_pi, psd->draw_pi, xo, yo, dx, hn);
else if (dx < 0)
PixImgPaste11(psd->root_pi, psd->draw_pi, xo + wn + dx,
yo, -dx, hn);
if (dy > 0)
PixImgPaste11(psd->root_pi, psd->draw_pi, xo, yo, wn, dy);
else if (dy < 0)
PixImgPaste11(psd->root_pi, psd->draw_pi, xo,
yo + hn + dy, wn, -dy);
}
else
{
PixImgPaste11(psd->root_pi, psd->draw_pi, xo, yo, wn, hn);
PixImgBlend(psd->root_pi, psd->ewin_pi, psd->draw_pi, psd->root,
xn, yn, wn, hn);
}
if (EoGetWin(ewin)->num_rect > 0)
{
PixImgSetMask(psd->draw_pi, 1, xn, yn);
PixImgPaste11(psd->root_pi, psd->draw_pi, xn, yn, wn, hn);
PixImgSetMask(psd->draw_pi, 0, 0, 0);
}
break;
case 2:
PixImgPaste11(psd->root_pi, psd->draw_pi, xo, yo, wn, hn);
do_cleanup:
PixImgDestroy(psd->root_pi);
PixImgDestroy(psd->ewin_pi);
PixImgDestroy(psd->draw_pi);
psd->root_pi = NULL;
psd->ewin_pi = NULL;
psd->draw_pi = NULL;
EXFreeGC(psd->gc);
psd->gc = NULL;
break;
case 3:
PixImgPaste11(psd->root_pi, psd->draw_pi, xo, yo, wn, hn);
PixImgDestroy(psd->root_pi);
psd->root_pi = NULL;
break;
case 4:
psd->root_pi =
PixImgCreate(NULL, psd->gc, WinGetW(VROOT), WinGetH(VROOT));
PixImgFill(psd->root_pi, psd->root, 0, 0);
PixImgBlend(psd->root_pi, psd->ewin_pi, psd->draw_pi, psd->root,
xn, yn, wn, hn);
break;
}
}
#endif /* MR_ENABLE_TRANSLUCENT */
void
DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h,
int firstlast, int seqno)
@ -462,18 +261,8 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h,
case MR_TECHNICAL:
case MR_TECH_OPAQUE:
case MR_BOX:
#if MR_ENABLE_STIPPLED
case MR_SHADED:
case MR_SEMI_SOLID:
#endif
_ShapeDrawNontranslucent(ewin, md, firstlast, x, y, w, h);
break;
#if MR_ENABLE_TRANSLUCENT
case MR_TRANSLUCENT:
_ShapeDrawTranslucent(ewin, md, firstlast, x, y, w, h);
CoordsShow(ewin);
break;
#endif
default:
/* Fall back to opaque mode */
Conf.movres.mode_move = MR_OPAQUE;

View File

@ -107,10 +107,6 @@ MoveResizeMoveStart(EWin * ewin, int kbd, int constrained, int nogroup)
Conf.movres.mode_move = MoveResizeModeValidateMove(Conf.movres.mode_move);
Mode_mr.mode = Conf.movres.mode_move;
#if ENABLE_OLDMOVRES
if (num > 1 && Conf.movres.mode_move == MR_TRANSLUCENT)
Mode_mr.mode = MR_OPAQUE;
#endif
Mode_mr.grab_server = DrawEwinShapeNeedsGrab(Mode_mr.mode);
for (i = 0; i < num; i++)
@ -247,11 +243,7 @@ _MoveResizeMoveResume(void)
GrabPointerSet(Mode_mr.events, ECSR_ACT_MOVE, 1);
#if ENABLE_OLDMOVRES
fl = (Mode_mr.mode == MR_TRANSLUCENT) ? 4 : 0;
#else
fl = 0;
#endif
if (Mode.mode == MODE_MOVE_PENDING)
{
Mode.mode = MODE_MOVE;

View File

@ -137,35 +137,6 @@ _DlgFillMoveResize(Dialog * d __UNUSED__, DItem * table, void *data __UNUSED__)
DialogItemRadioButtonSetFirst(di, radio2);
DialogItemRadioButtonGroupSetVal(di, MR_BOX);
#if ENABLE_OLDMOVRES
di = DialogAddItem(table, DITEM_RADIOBUTTON);
DialogItemSetText(di, _("Shaded"));
DialogItemRadioButtonSetFirst(di, radio1);
DialogItemRadioButtonGroupSetVal(di, MR_SHADED);
di = DialogAddItem(table, DITEM_RADIOBUTTON);
DialogItemSetText(di, _("Shaded"));
DialogItemRadioButtonSetFirst(di, radio2);
DialogItemRadioButtonGroupSetVal(di, MR_SHADED);
di = DialogAddItem(table, DITEM_RADIOBUTTON);
DialogItemSetText(di, _("Semi-Solid"));
DialogItemRadioButtonSetFirst(di, radio1);
DialogItemRadioButtonGroupSetVal(di, MR_SEMI_SOLID);
di = DialogAddItem(table, DITEM_RADIOBUTTON);
DialogItemSetText(di, _("Semi-Solid"));
DialogItemRadioButtonSetFirst(di, radio2);
DialogItemRadioButtonGroupSetVal(di, MR_SEMI_SOLID);
di = DialogAddItem(table, DITEM_RADIOBUTTON);
DialogItemSetText(di, _("Translucent"));
DialogItemRadioButtonSetFirst(di, radio1);
DialogItemRadioButtonGroupSetVal(di, MR_TRANSLUCENT);
DialogAddItem(table, DITEM_NONE);
#endif /* ENABLE_OLDMOVRES */
DialogItemRadioButtonGroupSetValPtr(radio1, &dd->move);
DialogItemRadioButtonGroupSetValPtr(radio2, &dd->resize);
@ -438,18 +409,6 @@ _DlgFillPlacement(Dialog * d __UNUSED__, DItem * table, void *data __UNUSED__)
DialogItemRadioButtonSetFirst(di, radio);
DialogItemRadioButtonGroupSetVal(di, MR_BOX);
#if ENABLE_OLDMOVRES
di = DialogAddItem(table, DITEM_RADIOBUTTON);
DialogItemSetText(di, _("Shaded"));
DialogItemRadioButtonSetFirst(di, radio);
DialogItemRadioButtonGroupSetVal(di, MR_SHADED);
di = DialogAddItem(table, DITEM_RADIOBUTTON);
DialogItemSetText(di, _("Semi-Solid"));
DialogItemRadioButtonSetFirst(di, radio);
DialogItemRadioButtonGroupSetVal(di, MR_SEMI_SOLID);
#endif /* ENABLE_OLDMOVRES */
DialogItemRadioButtonGroupSetValPtr(radio, &dd->slide_mode);
di = DialogAddItem(table, DITEM_TEXT);