Change move/resize mode open coded values to defined values.
Partially based on patch by Daniel Manjarres. SVN revision: 59991
This commit is contained in:
parent
16ec138a49
commit
6c56718b7c
12
src/E.h
12
src/E.h
|
@ -481,6 +481,18 @@ void DialogOKstr(const char *title, const char *txt);
|
|||
#define DialogOKstr(title, fmt) do {} while(0)
|
||||
#endif /* ENABLE_DIALOGS */
|
||||
|
||||
/* draw.c (move to moveresize.h?) */
|
||||
/* Move/resize modes */
|
||||
#define MR_OPAQUE 0
|
||||
#define MR_TECHNICAL 1
|
||||
#define MR_BOX 2
|
||||
#define MR_SHADED 3
|
||||
#define MR_SEMI_SOLID 4
|
||||
#define MR_TRANSLUCENT 5
|
||||
|
||||
int MoveResizeModeValidateMove(int md);
|
||||
int MoveResizeModeValidateResize(int md);
|
||||
|
||||
/* econfig.c */
|
||||
void ConfigurationLoad(void);
|
||||
void ConfigurationSave(void);
|
||||
|
|
|
@ -1694,7 +1694,7 @@ DeskCurrentGotoArea(int ax, int ay)
|
|||
if (EoGetDesk(ewin) != DesksGetCurrent() && !EoIsFloating(ewin))
|
||||
continue;
|
||||
|
||||
if (EoIsFloating(ewin) && Conf.movres.mode_move == 0)
|
||||
if (EoIsFloating(ewin) && Conf.movres.mode_move == MR_OPAQUE)
|
||||
continue;
|
||||
|
||||
wnum++;
|
||||
|
@ -1722,7 +1722,7 @@ DeskCurrentGotoArea(int ax, int ay)
|
|||
continue;
|
||||
|
||||
if (EoIsSticky(ewin) ||
|
||||
(EoIsFloating(ewin) && Conf.movres.mode_move == 0) ||
|
||||
(EoIsFloating(ewin) && Conf.movres.mode_move == MR_OPAQUE) ||
|
||||
(!ewin->state.iconified && Conf.desks.slidein))
|
||||
EwinMove(ewin, EoGetX(ewin), EoGetY(ewin));
|
||||
else
|
||||
|
|
119
src/draw.c
119
src/draw.c
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
|
||||
* Copyright (C) 2007-2010 Kim Woelders
|
||||
* Copyright (C) 2007-2011 Kim Woelders
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
|
@ -29,11 +29,16 @@
|
|||
#include "xwin.h"
|
||||
|
||||
#if ENABLE_OLDMOVRES
|
||||
#define ENABLE_MODE_34 1 /* Enable shaded/semi-solid modes */
|
||||
#define ENABLE_MODE_5 1 /* Enable translucent mode */
|
||||
#define MR_ENABLE_STIPPLED 1 /* Enable shaded/semi-solid modes */
|
||||
#define MR_ENABLE_TRANSLUCENT 1 /* Enable translucent mode */
|
||||
#define MR_MODES_MOVE 0x3f /* MR_OPAQUE through MR_TRANSLUCENT */
|
||||
#define MR_MODES_RESIZE 0x1f /* MR_OPAQUE through MR_SEMI_SOLID */
|
||||
#else
|
||||
#define MR_MODES_MOVE 0x07 /* MR_OPAQUE through MR_BOX */
|
||||
#define MR_MODES_RESIZE 0x07 /* MR_OPAQUE through MR_BOX */
|
||||
#endif
|
||||
|
||||
#if ENABLE_MODE_34
|
||||
#if MR_ENABLE_STIPPLED
|
||||
#if 0
|
||||
#include <X11/bitmaps/gray>
|
||||
#include <X11/bitmaps/gray3>
|
||||
|
@ -52,7 +57,7 @@ static const char gray3_bits[] = { 0x01, 0x00, 0x04, 0x00 };
|
|||
|
||||
static Pixmap b2 = None; /* Used in modes 3,4 */
|
||||
static Pixmap b3 = None; /* Used in mode 3 */
|
||||
#endif /* ENABLE_MODE_34 */
|
||||
#endif /* MR_ENABLE_STIPPLED */
|
||||
|
||||
static Font font = None; /* Used in mode 1 (technical) */
|
||||
|
||||
|
@ -97,8 +102,8 @@ draw_v_arrow(Drawable dr, GC gc, int y1, int y2, int x1)
|
|||
}
|
||||
|
||||
void
|
||||
do_draw_mode_1(Drawable dr, GC gc,
|
||||
int a, int b, int c, int d, int bl, int br, int bt, int bb)
|
||||
do_draw_technical(Drawable dr, GC gc,
|
||||
int a, int b, int c, int d, int bl, int br, int bt, int bb)
|
||||
{
|
||||
if (!font)
|
||||
font = XLoadFont(disp, "-*-helvetica-medium-r-*-*-10-*-*-*-*-*-*-*");
|
||||
|
@ -127,8 +132,8 @@ do_draw_mode_1(Drawable dr, GC gc,
|
|||
}
|
||||
|
||||
static void
|
||||
do_draw_mode_2(Drawable dr, GC gc,
|
||||
int a, int b, int c, int d, int bl, int br, int bt, int bb)
|
||||
do_draw_boxy(Drawable dr, GC gc,
|
||||
int a, int b, int c, int d, int bl, int br, int bt, int bb)
|
||||
{
|
||||
if (c < 3)
|
||||
c = 3;
|
||||
|
@ -138,9 +143,9 @@ do_draw_mode_2(Drawable dr, GC gc,
|
|||
XDrawRectangle(disp, dr, gc, a + bl + 1, b + bt + 1, c - 3, d - 3);
|
||||
}
|
||||
|
||||
#if ENABLE_MODE_34
|
||||
#if MR_ENABLE_STIPPLED
|
||||
static void
|
||||
do_draw_mode_3(Drawable dr, GC gc,
|
||||
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);
|
||||
|
@ -160,14 +165,14 @@ do_draw_mode_3(Drawable dr, GC gc,
|
|||
}
|
||||
|
||||
static void
|
||||
do_draw_mode_4(Drawable dr, GC gc,
|
||||
int a, int b, int c, int d, int bl, int br, int bt, int bb)
|
||||
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 /* ENABLE_MODE_34 */
|
||||
#endif /* MR_ENABLE_STIPPLED */
|
||||
|
||||
typedef struct {
|
||||
EWin *ewin;
|
||||
|
@ -175,7 +180,7 @@ typedef struct {
|
|||
GC gc;
|
||||
int xo, yo, wo, ho;
|
||||
int bl, br, bt, bb;
|
||||
#if ENABLE_MODE_5
|
||||
#if MR_ENABLE_TRANSLUCENT
|
||||
PixImg *root_pi;
|
||||
PixImg *ewin_pi;
|
||||
PixImg *draw_pi;
|
||||
|
@ -183,8 +188,8 @@ typedef struct {
|
|||
} ShapeData;
|
||||
|
||||
static void
|
||||
_ShapeDrawNograb1_2(ShapeData * psd, int md, int firstlast,
|
||||
int xn, int yn, int wn, int hn, int seqno)
|
||||
_ShapeDrawNograb_tech_box(ShapeData * psd, int md, int firstlast,
|
||||
int xn, int yn, int wn, int hn, int seqno)
|
||||
{
|
||||
static ShapeWin *shape_win = NULL;
|
||||
|
||||
|
@ -209,16 +214,16 @@ _ShapeDrawNograb1_2(ShapeData * psd, int md, int firstlast,
|
|||
typedef void (DrawFunc) (Drawable dr, GC gc, int a, int b, int c, int d,
|
||||
int bl, int br, int bt, int bb);
|
||||
|
||||
static DrawFunc *const drf1_4[] = {
|
||||
do_draw_mode_1, do_draw_mode_2,
|
||||
#if ENABLE_MODE_34
|
||||
do_draw_mode_3, do_draw_mode_4
|
||||
#endif /* ENABLE_MODE_34 */
|
||||
static DrawFunc *const draw_functions[] = {
|
||||
do_draw_technical, do_draw_boxy,
|
||||
#if MR_ENABLE_STIPPLED
|
||||
do_draw_shaded, do_draw_semi_solid
|
||||
#endif /* MR_ENABLE_STIPPLED */
|
||||
};
|
||||
|
||||
static void
|
||||
_ShapeDraw1_4(ShapeData * psd, int md, int firstlast,
|
||||
int xn, int yn, int wn, int hn)
|
||||
_ShapeDrawNontranslucent(ShapeData * psd, int md, int firstlast,
|
||||
int xn, int yn, int wn, int hn)
|
||||
{
|
||||
DrawFunc *drf;
|
||||
|
||||
|
@ -233,8 +238,8 @@ _ShapeDraw1_4(ShapeData * psd, int md, int firstlast,
|
|||
gcv.subwindow_mode = IncludeInferiors;
|
||||
psd->gc = EXCreateGC(psd->root,
|
||||
GCFunction | GCForeground | GCSubwindowMode, &gcv);
|
||||
#if ENABLE_MODE_34
|
||||
if (md == 3 || md == 4)
|
||||
#if MR_ENABLE_STIPPLED
|
||||
if (md == MR_SHADED || md == MR_SEMI_SOLID)
|
||||
{
|
||||
if (!b2)
|
||||
b2 = XCreateBitmapFromData(disp, psd->root, gray_bits,
|
||||
|
@ -243,10 +248,10 @@ _ShapeDraw1_4(ShapeData * psd, int md, int firstlast,
|
|||
b3 = XCreateBitmapFromData(disp, psd->root, gray3_bits,
|
||||
gray3_width, gray3_height);
|
||||
}
|
||||
#endif /* ENABLE_MODE_34 */
|
||||
#endif /* MR_ENABLE_STIPPLED */
|
||||
}
|
||||
|
||||
drf = drf1_4[md - 1];
|
||||
drf = draw_functions[md - 1];
|
||||
|
||||
if (firstlast > 0)
|
||||
drf(psd->root, psd->gc, psd->xo, psd->yo, psd->wo, psd->ho,
|
||||
|
@ -265,10 +270,10 @@ _ShapeDraw1_4(ShapeData * psd, int md, int firstlast,
|
|||
}
|
||||
}
|
||||
|
||||
#if ENABLE_MODE_5
|
||||
#if MR_ENABLE_TRANSLUCENT
|
||||
static void
|
||||
_ShapeDraw5(ShapeData * psd, int md __UNUSED__, int firstlast,
|
||||
int xn, int yn, int wn, int hn)
|
||||
_ShapeDrawTranslucent(ShapeData * psd, int md __UNUSED__, int firstlast,
|
||||
int xn, int yn, int wn, int hn)
|
||||
{
|
||||
XGCValues gcv;
|
||||
int dx, dy, adx, ady;
|
||||
|
@ -296,7 +301,7 @@ _ShapeDraw5(ShapeData * psd, int md __UNUSED__, int firstlast,
|
|||
if ((!psd->root_pi) || (!psd->ewin_pi) || (!psd->draw_pi))
|
||||
{
|
||||
/* Trouble - Fall back to opaque mode */
|
||||
Conf.movres.mode_move = 0;
|
||||
Conf.movres.mode_move = MR_OPAQUE;
|
||||
goto do_cleanup;
|
||||
}
|
||||
|
||||
|
@ -383,7 +388,7 @@ _ShapeDraw5(ShapeData * psd, int md __UNUSED__, int firstlast,
|
|||
break;
|
||||
}
|
||||
}
|
||||
#endif /* ENABLE_MODE_5 */
|
||||
#endif /* MR_ENABLE_TRANSLUCENT */
|
||||
|
||||
void
|
||||
DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h,
|
||||
|
@ -399,7 +404,7 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h,
|
|||
(ewin->state.shaded || (w == ewin->shape_w && h == ewin->shape_h))))
|
||||
return;
|
||||
|
||||
if (md == 0)
|
||||
if (md == MR_OPAQUE)
|
||||
{
|
||||
EwinOpMoveResize(ewin, OPSRC_USER, x, y, w, h);
|
||||
EwinShapeSet(ewin);
|
||||
|
@ -435,31 +440,31 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h,
|
|||
|
||||
EwinBorderGetSize(ewin, &psd->bl, &psd->br, &psd->bt, &psd->bb);
|
||||
|
||||
if (md <= 2 && Conf.movres.avoid_server_grab)
|
||||
if (md <= MR_BOX && Conf.movres.avoid_server_grab)
|
||||
{
|
||||
_ShapeDrawNograb1_2(psd, md, firstlast, x, y, w, h, seqno);
|
||||
_ShapeDrawNograb_tech_box(psd, md, firstlast, x, y, w, h, seqno);
|
||||
goto done;
|
||||
}
|
||||
|
||||
switch (md)
|
||||
{
|
||||
case 1:
|
||||
case 2:
|
||||
#if ENABLE_MODE_34
|
||||
case 3:
|
||||
case 4:
|
||||
case MR_TECHNICAL:
|
||||
case MR_BOX:
|
||||
#if MR_ENABLE_STIPPLED
|
||||
case MR_SHADED:
|
||||
case MR_SEMI_SOLID:
|
||||
#endif
|
||||
_ShapeDraw1_4(psd, md, firstlast, x, y, w, h);
|
||||
_ShapeDrawNontranslucent(psd, md, firstlast, x, y, w, h);
|
||||
break;
|
||||
#if ENABLE_MODE_5
|
||||
case 5:
|
||||
_ShapeDraw5(psd, md, firstlast, x, y, w, h);
|
||||
#if MR_ENABLE_TRANSLUCENT
|
||||
case MR_TRANSLUCENT:
|
||||
_ShapeDrawTranslucent(psd, md, firstlast, x, y, w, h);
|
||||
CoordsShow(ewin);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
/* Fall back to opaque mode */
|
||||
Conf.movres.mode_move = 0;
|
||||
Conf.movres.mode_move = MR_OPAQUE;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -477,3 +482,25 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h,
|
|||
CoordsHide();
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
_MoveResizeModeValidate(unsigned int valid, int md)
|
||||
{
|
||||
if (md & ~0x1f)
|
||||
return MR_OPAQUE;
|
||||
if (valid & (1U << md))
|
||||
return md;
|
||||
return MR_OPAQUE;
|
||||
}
|
||||
|
||||
int
|
||||
MoveResizeModeValidateMove(int md)
|
||||
{
|
||||
return _MoveResizeModeValidate(MR_MODES_MOVE, md);
|
||||
}
|
||||
|
||||
int
|
||||
MoveResizeModeValidateResize(int md)
|
||||
{
|
||||
return _MoveResizeModeValidate(MR_MODES_RESIZE, md);
|
||||
}
|
||||
|
|
|
@ -494,8 +494,8 @@ void ShapewinShapeSet(ShapeWin * sw, int md, int x, int y, int w,
|
|||
int h, int bl, int br, int bt, int bb,
|
||||
int seqno);
|
||||
|
||||
void do_draw_mode_1(Drawable dr, GC gc,
|
||||
int a, int b, int c, int d, int bl, int br,
|
||||
int bt, int bb);
|
||||
void do_draw_technical(Drawable dr, GC gc,
|
||||
int a, int b, int c, int d, int bl,
|
||||
int br, int bt, int bb);
|
||||
|
||||
#endif /* _EWIN_H_ */
|
||||
|
|
|
@ -240,8 +240,8 @@ IPC_MoveResize(const char *params)
|
|||
{
|
||||
if (param2[0] == '\n' || param2[0] == '?')
|
||||
{
|
||||
if (Conf.movres.mode_move < 0 || Conf.movres.mode_move > 5)
|
||||
Conf.movres.mode_move = 0;
|
||||
Conf.movres.mode_move =
|
||||
MoveResizeModeValidateMove(Conf.movres.mode_move);
|
||||
IpcPrintf("Move mode: %s\n",
|
||||
MovResCfgMoveModes[Conf.movres.mode_move]);
|
||||
return;
|
||||
|
@ -262,8 +262,8 @@ IPC_MoveResize(const char *params)
|
|||
{
|
||||
if (param2[0] == '\n' || param2[0] == '?')
|
||||
{
|
||||
if (Conf.movres.mode_resize < 0 || Conf.movres.mode_resize > 4)
|
||||
Conf.movres.mode_resize = 0;
|
||||
Conf.movres.mode_resize =
|
||||
MoveResizeModeValidateResize(Conf.movres.mode_resize);
|
||||
IpcPrintf("Resize mode: %s\n",
|
||||
MovResCfgResizeModes[Conf.movres.mode_resize]);
|
||||
return;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2003-2009 Kim Woelders
|
||||
* Copyright (C) 2003-2011 Kim Woelders
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
|
@ -150,8 +150,8 @@ static const CfgItem MiscCfgItems[] = {
|
|||
|
||||
CFG_ITEM_BOOL(Conf, hints.set_xroot_info_on_root_window, 0),
|
||||
|
||||
CFG_ITEM_INT(Conf, movres.mode_move, 0),
|
||||
CFG_ITEM_INT(Conf, movres.mode_resize, 2),
|
||||
CFG_ITEM_INT(Conf, movres.mode_move, MR_OPAQUE),
|
||||
CFG_ITEM_INT(Conf, movres.mode_resize, MR_BOX),
|
||||
CFG_ITEM_INT(Conf, movres.mode_info, 1),
|
||||
CFG_ITEM_INT(Conf, movres.mode_maximize_default, 1),
|
||||
CFG_ITEM_HEX(Conf, movres.color, 0x00ff0000),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
|
||||
* Copyright (C) 2004-2010 Kim Woelders
|
||||
* Copyright (C) 2004-2011 Kim Woelders
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
|
@ -35,14 +35,6 @@
|
|||
#include "xwin.h"
|
||||
#include <X11/keysym.h>
|
||||
|
||||
#if ENABLE_OLDMOVRES
|
||||
#define MODE_MOVE_MAX 5
|
||||
#define MOVE_SIZE_MAX 4
|
||||
#else
|
||||
#define MODE_MOVE_MAX 2
|
||||
#define MOVE_SIZE_MAX 2
|
||||
#endif
|
||||
|
||||
static struct {
|
||||
Win events;
|
||||
EWin *ewin;
|
||||
|
@ -62,9 +54,9 @@ static void _MoveResizeInit(void);
|
|||
static int
|
||||
_NeedServerGrab(int mode)
|
||||
{
|
||||
if (mode == 0)
|
||||
if (mode == MR_OPAQUE)
|
||||
return 0;
|
||||
if (mode <= 2)
|
||||
if (mode <= MR_BOX)
|
||||
return !Conf.movres.avoid_server_grab;
|
||||
return 1;
|
||||
}
|
||||
|
@ -123,12 +115,11 @@ MoveResizeMoveStart(EWin * ewin, int kbd, int constrained, int nogroup)
|
|||
gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE, nogroup
|
||||
|| Mode.move.swap, &num);
|
||||
|
||||
if (Conf.movres.mode_move < 0 || Conf.movres.mode_move > MODE_MOVE_MAX)
|
||||
Conf.movres.mode_move = 0;
|
||||
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 == 5)
|
||||
Mode_mr.mode = 0;
|
||||
if (num > 1 && Conf.movres.mode_move == MR_TRANSLUCENT)
|
||||
Mode_mr.mode = MR_OPAQUE;
|
||||
#endif
|
||||
Mode_mr.grab_server = _NeedServerGrab(Mode_mr.mode);
|
||||
|
||||
|
@ -136,7 +127,7 @@ MoveResizeMoveStart(EWin * ewin, int kbd, int constrained, int nogroup)
|
|||
{
|
||||
EwinShapeSet(gwins[i]);
|
||||
EwinOpFloatAt(gwins[i], OPSRC_USER, EoGetX(gwins[i]), EoGetY(gwins[i]));
|
||||
if (Mode_mr.mode == 0)
|
||||
if (Mode_mr.mode == MR_OPAQUE)
|
||||
{
|
||||
ewin->state.moving = 1;
|
||||
EwinUpdateOpacity(gwins[i]);
|
||||
|
@ -198,7 +189,7 @@ _MoveResizeMoveEnd(EWin * ewin)
|
|||
EwinOpUnfloatAt(ewin, OPSRC_USER, d2,
|
||||
ewin->shape_x - (EoGetX(d2) - EoGetX(d1)),
|
||||
ewin->shape_y - (EoGetY(d2) - EoGetY(d1)));
|
||||
if (Mode_mr.mode == 0)
|
||||
if (Mode_mr.mode == MR_OPAQUE)
|
||||
{
|
||||
ewin->state.moving = 0;
|
||||
EwinUpdateOpacity(ewin);
|
||||
|
@ -267,7 +258,7 @@ _MoveResizeMoveResume(void)
|
|||
GrabPointerSet(Mode_mr.events, ECSR_ACT_MOVE, 1);
|
||||
|
||||
#if ENABLE_OLDMOVRES
|
||||
fl = (Mode_mr.mode == 5) ? 4 : 0;
|
||||
fl = (Mode_mr.mode == MR_TRANSLUCENT) ? 4 : 0;
|
||||
#else
|
||||
fl = 0;
|
||||
#endif
|
||||
|
@ -325,8 +316,8 @@ MoveResizeResizeStart(EWin * ewin, int kbd, int hv)
|
|||
|
||||
SoundPlay(SOUND_RESIZE_START);
|
||||
|
||||
if (Conf.movres.mode_resize < 0 || Conf.movres.mode_resize > MOVE_SIZE_MAX)
|
||||
Conf.movres.mode_resize = 0;
|
||||
Conf.movres.mode_resize =
|
||||
MoveResizeModeValidateResize(Conf.movres.mode_resize);
|
||||
Mode_mr.mode = Conf.movres.mode_resize;
|
||||
Mode_mr.using_kbd = kbd;
|
||||
Mode_mr.grab_server = _NeedServerGrab(Mode_mr.mode);
|
||||
|
@ -337,7 +328,7 @@ MoveResizeResizeStart(EWin * ewin, int kbd, int hv)
|
|||
/* Run idlers (stacking, border updates, ...) before drawing lines */
|
||||
IdlersRun();
|
||||
}
|
||||
if (Mode_mr.mode == 0)
|
||||
if (Mode_mr.mode == MR_OPAQUE)
|
||||
{
|
||||
ewin->state.resizing = 1;
|
||||
EwinUpdateOpacity(ewin);
|
||||
|
@ -474,7 +465,7 @@ _MoveResizeResizeEnd(EWin * ewin)
|
|||
DrawEwinShape(ewin, Conf.movres.mode_resize, ewin->shape_x, ewin->shape_y,
|
||||
ewin->shape_w, ewin->shape_h, 2, 0);
|
||||
|
||||
if (Mode_mr.mode == 0)
|
||||
if (Mode_mr.mode == MR_OPAQUE)
|
||||
{
|
||||
ewin->state.resizing = 0;
|
||||
EwinUpdateOpacity(ewin);
|
||||
|
@ -529,7 +520,7 @@ _MoveResizeMoveHandleMotion(void)
|
|||
ModulesSignal(ESIGNAL_ANIMATION_SUSPEND, NULL);
|
||||
}
|
||||
|
||||
if (Mode_mr.mode == 0 || num == 1)
|
||||
if (Mode_mr.mode == MR_OPAQUE || num == 1)
|
||||
ewin->state.show_coords = 1;
|
||||
|
||||
for (i = 0; i < num; i++)
|
||||
|
@ -537,8 +528,8 @@ _MoveResizeMoveHandleMotion(void)
|
|||
ewin1 = gwins[i];
|
||||
DrawEwinShape(ewin1, Mode_mr.mode, EoGetX(ewin1), EoGetY(ewin1),
|
||||
ewin1->client.w, ewin1->client.h, 0, i);
|
||||
if (Conf.movres.mode_move == 0)
|
||||
Mode_mr.mode = 0;
|
||||
if (Conf.movres.mode_move == MR_OPAQUE)
|
||||
Mode_mr.mode = MR_OPAQUE;
|
||||
}
|
||||
dx = Mode.events.mx - Mode_mr.start_x;
|
||||
dy = Mode.events.my - Mode_mr.start_y;
|
||||
|
@ -654,7 +645,7 @@ _MoveResizeMoveHandleMotion(void)
|
|||
|
||||
/* if its opaque move mode check to see if we have to float */
|
||||
/* the window above all desktops (reparent to root) */
|
||||
if (Mode_mr.mode == 0)
|
||||
if (Mode_mr.mode == MR_OPAQUE)
|
||||
{
|
||||
Desk *dsk;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
|
||||
* Copyright (C) 2004-2010 Kim Woelders
|
||||
* Copyright (C) 2004-2011 Kim Woelders
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
|
@ -91,58 +91,58 @@ _DlgFillMoveResize(Dialog * d __UNUSED__, DItem * table, void *data __UNUSED__)
|
|||
radio1 = di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemSetText(di, _("Opaque"));
|
||||
DialogItemRadioButtonSetFirst(di, radio1);
|
||||
DialogItemRadioButtonGroupSetVal(di, 0);
|
||||
DialogItemRadioButtonGroupSetVal(di, MR_OPAQUE);
|
||||
|
||||
radio2 = di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemSetText(di, _("Opaque"));
|
||||
DialogItemRadioButtonSetFirst(di, radio2);
|
||||
DialogItemRadioButtonGroupSetVal(di, 0);
|
||||
DialogItemRadioButtonGroupSetVal(di, MR_OPAQUE);
|
||||
|
||||
di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemSetText(di, _("Technical"));
|
||||
DialogItemRadioButtonSetFirst(di, radio1);
|
||||
DialogItemRadioButtonGroupSetVal(di, 1);
|
||||
DialogItemRadioButtonGroupSetVal(di, MR_TECHNICAL);
|
||||
|
||||
di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemSetText(di, _("Technical"));
|
||||
DialogItemRadioButtonSetFirst(di, radio2);
|
||||
DialogItemRadioButtonGroupSetVal(di, 1);
|
||||
DialogItemRadioButtonGroupSetVal(di, MR_TECHNICAL);
|
||||
|
||||
di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemSetText(di, _("Box"));
|
||||
DialogItemRadioButtonSetFirst(di, radio1);
|
||||
DialogItemRadioButtonGroupSetVal(di, 2);
|
||||
DialogItemRadioButtonGroupSetVal(di, MR_BOX);
|
||||
|
||||
di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemSetText(di, _("Box"));
|
||||
DialogItemRadioButtonSetFirst(di, radio2);
|
||||
DialogItemRadioButtonGroupSetVal(di, 2);
|
||||
DialogItemRadioButtonGroupSetVal(di, MR_BOX);
|
||||
|
||||
#if ENABLE_OLDMOVRES
|
||||
di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemSetText(di, _("Shaded"));
|
||||
DialogItemRadioButtonSetFirst(di, radio1);
|
||||
DialogItemRadioButtonGroupSetVal(di, 3);
|
||||
DialogItemRadioButtonGroupSetVal(di, MR_SHADED);
|
||||
|
||||
di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemSetText(di, _("Shaded"));
|
||||
DialogItemRadioButtonSetFirst(di, radio2);
|
||||
DialogItemRadioButtonGroupSetVal(di, 3);
|
||||
DialogItemRadioButtonGroupSetVal(di, MR_SHADED);
|
||||
|
||||
di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemSetText(di, _("Semi-Solid"));
|
||||
DialogItemRadioButtonSetFirst(di, radio1);
|
||||
DialogItemRadioButtonGroupSetVal(di, 4);
|
||||
DialogItemRadioButtonGroupSetVal(di, MR_SEMI_SOLID);
|
||||
|
||||
di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemSetText(di, _("Semi-Solid"));
|
||||
DialogItemRadioButtonSetFirst(di, radio2);
|
||||
DialogItemRadioButtonGroupSetVal(di, 4);
|
||||
DialogItemRadioButtonGroupSetVal(di, MR_SEMI_SOLID);
|
||||
|
||||
di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemSetText(di, _("Translucent"));
|
||||
DialogItemRadioButtonSetFirst(di, radio1);
|
||||
DialogItemRadioButtonGroupSetVal(di, 5);
|
||||
DialogItemRadioButtonGroupSetVal(di, MR_TRANSLUCENT);
|
||||
|
||||
DialogAddItem(table, DITEM_NONE);
|
||||
#endif /* ENABLE_OLDMOVRES */
|
||||
|
@ -381,28 +381,30 @@ _DlgFillPlacement(Dialog * d __UNUSED__, DItem * table, void *data __UNUSED__)
|
|||
radio = di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemSetText(di, _("Opaque"));
|
||||
DialogItemRadioButtonSetFirst(di, radio);
|
||||
DialogItemRadioButtonGroupSetVal(di, 0);
|
||||
DialogItemRadioButtonGroupSetVal(di, MR_OPAQUE);
|
||||
|
||||
di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemSetText(di, _("Technical"));
|
||||
DialogItemRadioButtonSetFirst(di, radio);
|
||||
DialogItemRadioButtonGroupSetVal(di, 1);
|
||||
DialogItemRadioButtonGroupSetVal(di, MR_TECHNICAL);
|
||||
|
||||
di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemSetText(di, _("Box"));
|
||||
DialogItemRadioButtonSetFirst(di, radio);
|
||||
DialogItemRadioButtonGroupSetVal(di, 2);
|
||||
DialogItemRadioButtonGroupSetVal(di, MR_BOX);
|
||||
|
||||
#if ENABLE_OLDMOVRES
|
||||
di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemSetText(di, _("Shaded"));
|
||||
DialogItemRadioButtonSetFirst(di, radio);
|
||||
DialogItemRadioButtonGroupSetVal(di, 3);
|
||||
DialogItemRadioButtonGroupSetVal(di, MR_SHADED);
|
||||
|
||||
di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemSetText(di, _("Semi-Solid"));
|
||||
DialogItemRadioButtonSetFirst(di, radio);
|
||||
DialogItemRadioButtonGroupSetVal(di, 4);
|
||||
DialogItemRadioButtonGroupSetVal(di, MR_SEMI_SOLID);
|
||||
DialogItemRadioButtonGroupSetValPtr(radio, &dd->slide_mode);
|
||||
#endif /* ENABLE_OLDMOVRES */
|
||||
|
||||
DialogAddItem(table, DITEM_NONE);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2007-2010 Kim Woelders
|
||||
* Copyright (C) 2007-2011 Kim Woelders
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
|
@ -86,7 +86,7 @@ ShapewinCreate(int md)
|
|||
ShapeInput, 0, 0, NULL, 0, ShapeSet, Unsorted);
|
||||
#endif
|
||||
|
||||
if (md == 1)
|
||||
if (md == MR_TECHNICAL)
|
||||
{
|
||||
sw->mask =
|
||||
ECreatePixmap(EoGetWin(sw), WinGetW(VROOT), WinGetH(VROOT), 1);
|
||||
|
@ -111,13 +111,13 @@ ShapewinShapeSet(ShapeWin * sw, int md, int x, int y, int w, int h,
|
|||
w2 = w + bl + br;
|
||||
h2 = h + bt + bb;
|
||||
|
||||
if (md == 1)
|
||||
if (md == MR_TECHNICAL)
|
||||
{
|
||||
XSetForeground(disp, sw->gc, 0);
|
||||
XFillRectangle(disp, sw->mask, sw->gc,
|
||||
0, 0, WinGetW(VROOT), WinGetH(VROOT));
|
||||
XSetForeground(disp, sw->gc, 1);
|
||||
do_draw_mode_1(sw->mask, sw->gc, x, y, w, h, bl, br, bt, bb);
|
||||
do_draw_technical(sw->mask, sw->gc, x, y, w, h, bl, br, bt, bb);
|
||||
if (seqno == 0)
|
||||
EShapeSetMask(EoGetWin(sw), 0, 0, sw->mask);
|
||||
else
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
|
||||
* Copyright (C) 2004-2010 Kim Woelders
|
||||
* Copyright (C) 2004-2011 Kim Woelders
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
|
@ -49,7 +49,7 @@ static void
|
|||
WarpShapeDraw(EWin * ewin)
|
||||
{
|
||||
static ShapeWin *shape_win = NULL;
|
||||
int md = 2, bl, br, bt, bb;
|
||||
int bl, br, bt, bb;
|
||||
|
||||
if (!ewin)
|
||||
{
|
||||
|
@ -59,12 +59,12 @@ WarpShapeDraw(EWin * ewin)
|
|||
}
|
||||
|
||||
if (!shape_win)
|
||||
shape_win = ShapewinCreate(md);
|
||||
shape_win = ShapewinCreate(MR_BOX);
|
||||
if (!shape_win)
|
||||
return;
|
||||
|
||||
EwinBorderGetSize(ewin, &bl, &br, &bt, &bb);
|
||||
ShapewinShapeSet(shape_win, md, EoGetX(ewin), EoGetY(ewin),
|
||||
ShapewinShapeSet(shape_win, MR_BOX, EoGetX(ewin), EoGetY(ewin),
|
||||
ewin->client.w, ewin->client.h, bl, br, bt, bb, 0);
|
||||
EoMap(shape_win, 0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue