mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
Code refactoring: replaced macro 'SHAPE' by 'USE_XSHAPE' for consistency
The usual way to define a macro in is to name macro with 'USE_xxx' when they are used to enable a feature 'xxx' Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
0d66173e1f
commit
6184c955e7
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/cursorfont.h>
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
#include <X11/extensions/shape.h>
|
||||
#endif
|
||||
|
||||
@@ -202,7 +202,7 @@ static Window makeDragIcon(WMScreen * scr, WMPixmap * pixmap)
|
||||
window = XCreateWindow(scr->display, scr->rootWin, 0, 0, size.width,
|
||||
size.height, 0, scr->depth, InputOutput, scr->visual, flags, &attribs);
|
||||
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
if (pixmap->mask) {
|
||||
XShapeCombineMask(scr->display, window, ShapeBounding, 0, 0, pixmap->mask, ShapeSet);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "wconfig.h"
|
||||
#include "WINGsP.h"
|
||||
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
#include <X11/extensions/shape.h>
|
||||
#endif
|
||||
|
||||
@@ -438,7 +438,7 @@ static void showText(Balloon * bPtr, int x, int y, int w, int h, const char *tex
|
||||
|
||||
XFreePixmap(dpy, pixmap);
|
||||
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
XShapeCombineMask(dpy, bPtr->view->window, ShapeBounding, 0, 0, mask, ShapeSet);
|
||||
#endif
|
||||
XFreePixmap(dpy, mask);
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
/* BUG There's something fishy with shaped windows */
|
||||
/* Whithout shape extension the magnified image is completely broken -Dan */
|
||||
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
# include <X11/extensions/shape.h>
|
||||
#endif
|
||||
|
||||
@@ -1510,7 +1510,7 @@ static Pixmap magnifyCreatePixmap(WMColorPanel * panel)
|
||||
{
|
||||
W_Screen *scr = WMWidgetScreen(panel->win);
|
||||
int u, v;
|
||||
#ifndef SHAPE
|
||||
#ifndef USE_XSHAPE
|
||||
Pixmap pixmap;
|
||||
#endif
|
||||
unsigned long color;
|
||||
@@ -1547,7 +1547,7 @@ static Pixmap magnifyCreatePixmap(WMColorPanel * panel)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
return panel->magnifyGlass->magPix;
|
||||
#else
|
||||
pixmap = XCreatePixmap(scr->display, W_DRAWABLE(scr), Cursor_mask_width, Cursor_mask_height, scr->depth);
|
||||
@@ -1639,7 +1639,7 @@ static WMPoint magnifyInitialize(W_ColorPanel * panel)
|
||||
panel->magnifyGlass->image = NULL;
|
||||
|
||||
/* Clipmask to make magnified view-contents circular */
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
XShapeCombineMask(scr->display, WMViewXID(panel->magnifyGlass->view),
|
||||
ShapeBounding, 0, 0, clip_mask, ShapeSet);
|
||||
#else
|
||||
@@ -1658,7 +1658,7 @@ static WMPoint magnifyInitialize(W_ColorPanel * panel)
|
||||
XClearWindow(scr->display, WMViewXID(panel->magnifyGlass->view));
|
||||
XFlush(scr->display);
|
||||
|
||||
#ifndef SHAPE
|
||||
#ifndef USE_XSHAPE
|
||||
XFreePixmap(scr->display, pixmap);
|
||||
#endif
|
||||
|
||||
@@ -1778,7 +1778,7 @@ static void magnifyPutCursor(WMWidget * w, void *data)
|
||||
XClearWindow(scr->display, WMViewXID(panel->magnifyGlass->view));
|
||||
/* Synchronize the event queue, so the Expose is handled NOW */
|
||||
XFlush(scr->display);
|
||||
#ifndef SHAPE
|
||||
#ifndef USE_XSHAPE
|
||||
XFreePixmap(scr->display, pixmap);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -488,8 +488,8 @@ dnl ============================
|
||||
AC_ARG_ENABLE(modelock, AS_HELP_STRING([--enable-modelock], [XKB keyboard language status support]),
|
||||
AC_DEFINE(XKB_MODELOCK, 1, [whether XKB language MODELOCK should be enabled]))
|
||||
|
||||
dnl Shape support
|
||||
dnl =============
|
||||
dnl XShape support
|
||||
dnl ==============
|
||||
shape=yes
|
||||
AC_ARG_ENABLE(shape, AS_HELP_STRING([--disable-shape], [disable shaped window extension support]),
|
||||
shape=$enableval, shape=yes)
|
||||
@@ -498,7 +498,7 @@ added_xext=no
|
||||
if test "$shape" = yes; then
|
||||
AC_CHECK_LIB(Xext, XShapeSelectInput, [XLIBS="-lXext $XLIBS"
|
||||
added_xext=yes
|
||||
AC_DEFINE(SHAPE, 1, [define if you want support for shaped windows (set by configure)])],
|
||||
AC_DEFINE(USE_XSHAPE, 1, [define if you want support for shaped windows (set by configure)])],
|
||||
shape=no, $XLFLAGS $XLIBS)
|
||||
fi
|
||||
|
||||
|
||||
@@ -586,7 +586,7 @@ extern struct wmaker_global_variables {
|
||||
|
||||
/* X Extensions */
|
||||
struct {
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
struct {
|
||||
Bool supported;
|
||||
int event_base;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xatom.h>
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
#include <X11/extensions/shape.h>
|
||||
#endif
|
||||
|
||||
@@ -166,7 +166,7 @@ void wClientConfigure(WWindow * wwin, XConfigureRequestEvent * xcre)
|
||||
XConfigureWindow(dpy, xcre->window, xcre->value_mask, &xwc);
|
||||
return;
|
||||
}
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
if (w_global.xext.shape.supported) {
|
||||
int junk;
|
||||
unsigned int ujunk;
|
||||
|
||||
10
src/event.c
10
src/event.c
@@ -35,7 +35,7 @@
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
# include <X11/extensions/shape.h>
|
||||
#endif
|
||||
#ifdef XDND
|
||||
@@ -103,7 +103,7 @@ static void handle_inotify_events(void);
|
||||
static void wdelete_death_handler(WMagicNumber id);
|
||||
|
||||
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
static void handleShapeNotify(XEvent *event);
|
||||
#endif
|
||||
|
||||
@@ -547,7 +547,7 @@ static void handleExtensions(XEvent * event)
|
||||
XkbEvent *xkbevent;
|
||||
xkbevent = (XkbEvent *) event;
|
||||
#endif /*KEEP_XKB_LOCK_STATUS */
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
if (w_global.xext.shape.supported && event->type == (w_global.xext.shape.event_base + ShapeNotify)) {
|
||||
handleShapeNotify(event);
|
||||
}
|
||||
@@ -1147,7 +1147,7 @@ static void handleLeaveNotify(XEvent * event)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
static void handleShapeNotify(XEvent * event)
|
||||
{
|
||||
XShapeEvent *shev = (XShapeEvent *) event;
|
||||
@@ -1183,7 +1183,7 @@ static void handleShapeNotify(XEvent * event)
|
||||
wWindowSetShape(wwin);
|
||||
}
|
||||
}
|
||||
#endif /* SHAPE */
|
||||
#endif /* USE_XSHAPE */
|
||||
|
||||
#ifdef KEEP_XKB_LOCK_STATUS
|
||||
/* please help ]d if you know what to do */
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include <X11/cursorfont.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/keysym.h>
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
#include <X11/extensions/shape.h>
|
||||
#endif
|
||||
#ifdef KEEP_XKB_LOCK_STATUS
|
||||
@@ -587,7 +587,7 @@ void StartUp(Bool defaultScreenOnly)
|
||||
|
||||
XSetErrorHandler((XErrorHandler) catchXError);
|
||||
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
/* ignore j */
|
||||
w_global.xext.shape.supported = XShapeQueryExtension(dpy, &w_global.xext.shape.event_base, &j);
|
||||
#endif
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "xinerama.h"
|
||||
|
||||
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
#include <X11/extensions/shape.h>
|
||||
#endif
|
||||
|
||||
@@ -519,7 +519,7 @@ WSwitchPanel *wInitSwitchPanel(WScreen *scr, WWindow *curwin, Bool class_only)
|
||||
|
||||
XSetWindowBackgroundPixmap(dpy, WMWidgetXID(panel->win), pixmap);
|
||||
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
if (mask && w_global.xext.shape.supported)
|
||||
XShapeCombineMask(dpy, WMWidgetXID(panel->win), ShapeBounding, 0, 0, mask, ShapeSet);
|
||||
#endif
|
||||
|
||||
@@ -363,7 +363,7 @@
|
||||
#endif
|
||||
|
||||
/* some rules */
|
||||
#ifndef SHAPE
|
||||
#ifndef USE_XSHAPE
|
||||
#undef SHAPED_BALLOON
|
||||
#endif
|
||||
|
||||
|
||||
12
src/window.c
12
src/window.c
@@ -23,7 +23,7 @@
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
#include <X11/extensions/shape.h>
|
||||
#endif
|
||||
#ifdef KEEP_XKB_LOCK_STATUS
|
||||
@@ -614,7 +614,7 @@ WWindow *wManageWindow(WScreen *scr, Window window)
|
||||
|
||||
XSaveContext(dpy, window, w_global.context.client_win, (XPointer) & wwin->client_descriptor);
|
||||
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
if (w_global.xext.shape.supported) {
|
||||
int junk;
|
||||
unsigned int ujunk;
|
||||
@@ -2039,7 +2039,7 @@ void wWindowConfigure(WWindow *wwin, int req_x, int req_y, int req_width, int re
|
||||
wwin->client.x += wwin->screen_ptr->frame_border_width;
|
||||
wwin->client.y += wwin->screen_ptr->frame_border_width;
|
||||
}
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
if (w_global.xext.shape.supported && wwin->flags.shaped && resize)
|
||||
wWindowSetShape(wwin);
|
||||
#endif
|
||||
@@ -2263,7 +2263,7 @@ void wWindowConfigureBorders(WWindow *wwin)
|
||||
if (flags != 0)
|
||||
wFrameWindowHideButton(wwin->frame, flags);
|
||||
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
if (w_global.xext.shape.supported && wwin->flags.shaped)
|
||||
wWindowSetShape(wwin);
|
||||
#endif
|
||||
@@ -2338,7 +2338,7 @@ static int getSavedState(Window window, WSavedState ** state)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
void wWindowClearShape(WWindow * wwin)
|
||||
{
|
||||
XShapeCombineMask(dpy, wwin->frame->core->window, ShapeBounding,
|
||||
@@ -2422,7 +2422,7 @@ void wWindowSetShape(WWindow * wwin)
|
||||
ShapeBounding, (count > 0 ? ShapeUnion : ShapeSet));
|
||||
XFlush(dpy);
|
||||
}
|
||||
#endif /* SHAPE */
|
||||
#endif /* USE_XSHAPE */
|
||||
|
||||
/* ====================================================================== */
|
||||
|
||||
|
||||
@@ -256,7 +256,7 @@ typedef struct WWindow {
|
||||
unsigned int semi_focused:1;
|
||||
/* window type flags */
|
||||
unsigned int urgent:1; /* if wm_hints says this is urgent */
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
unsigned int shaped:1;
|
||||
#endif
|
||||
|
||||
@@ -330,7 +330,7 @@ typedef void* WMagicNumber;
|
||||
void wWindowDestroy(WWindow *wwin);
|
||||
WWindow *wWindowCreate(void);
|
||||
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
void wWindowSetShape(WWindow *wwin);
|
||||
void wWindowClearShape(WWindow *wwin);
|
||||
#endif
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
#include <X11/extensions/shape.h>
|
||||
#endif
|
||||
|
||||
@@ -370,7 +370,7 @@ static void showWorkspaceName(WScreen * scr, int workspace)
|
||||
|
||||
WMDrawString(scr->wmscreen, text, scr->white, w_global.workspace.font_for_name, 2, 2, name, len);
|
||||
|
||||
#ifdef SHAPE
|
||||
#ifdef USE_XSHAPE
|
||||
if (w_global.xext.shape.supported)
|
||||
XShapeCombineMask(dpy, scr->workspace_name, ShapeBounding, 0, 0, mask, ShapeSet);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user