1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +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:
Christophe CURIS
2013-11-18 00:51:57 +01:00
committed by Carlos R. Mafra
parent 0d66173e1f
commit 6184c955e7
13 changed files with 36 additions and 36 deletions

View File

@@ -4,7 +4,7 @@
#include <X11/Xatom.h> #include <X11/Xatom.h>
#include <X11/cursorfont.h> #include <X11/cursorfont.h>
#ifdef SHAPE #ifdef USE_XSHAPE
#include <X11/extensions/shape.h> #include <X11/extensions/shape.h>
#endif #endif
@@ -202,7 +202,7 @@ static Window makeDragIcon(WMScreen * scr, WMPixmap * pixmap)
window = XCreateWindow(scr->display, scr->rootWin, 0, 0, size.width, window = XCreateWindow(scr->display, scr->rootWin, 0, 0, size.width,
size.height, 0, scr->depth, InputOutput, scr->visual, flags, &attribs); size.height, 0, scr->depth, InputOutput, scr->visual, flags, &attribs);
#ifdef SHAPE #ifdef USE_XSHAPE
if (pixmap->mask) { if (pixmap->mask) {
XShapeCombineMask(scr->display, window, ShapeBounding, 0, 0, pixmap->mask, ShapeSet); XShapeCombineMask(scr->display, window, ShapeBounding, 0, 0, pixmap->mask, ShapeSet);
} }

View File

@@ -2,7 +2,7 @@
#include "wconfig.h" #include "wconfig.h"
#include "WINGsP.h" #include "WINGsP.h"
#ifdef SHAPE #ifdef USE_XSHAPE
#include <X11/extensions/shape.h> #include <X11/extensions/shape.h>
#endif #endif
@@ -438,7 +438,7 @@ static void showText(Balloon * bPtr, int x, int y, int w, int h, const char *tex
XFreePixmap(dpy, pixmap); XFreePixmap(dpy, pixmap);
#ifdef SHAPE #ifdef USE_XSHAPE
XShapeCombineMask(dpy, bPtr->view->window, ShapeBounding, 0, 0, mask, ShapeSet); XShapeCombineMask(dpy, bPtr->view->window, ShapeBounding, 0, 0, mask, ShapeSet);
#endif #endif
XFreePixmap(dpy, mask); XFreePixmap(dpy, mask);

View File

@@ -43,7 +43,7 @@
/* BUG There's something fishy with shaped windows */ /* BUG There's something fishy with shaped windows */
/* Whithout shape extension the magnified image is completely broken -Dan */ /* Whithout shape extension the magnified image is completely broken -Dan */
#ifdef SHAPE #ifdef USE_XSHAPE
# include <X11/extensions/shape.h> # include <X11/extensions/shape.h>
#endif #endif
@@ -1510,7 +1510,7 @@ static Pixmap magnifyCreatePixmap(WMColorPanel * panel)
{ {
W_Screen *scr = WMWidgetScreen(panel->win); W_Screen *scr = WMWidgetScreen(panel->win);
int u, v; int u, v;
#ifndef SHAPE #ifndef USE_XSHAPE
Pixmap pixmap; Pixmap pixmap;
#endif #endif
unsigned long color; unsigned long color;
@@ -1547,7 +1547,7 @@ static Pixmap magnifyCreatePixmap(WMColorPanel * panel)
} }
} }
#ifdef SHAPE #ifdef USE_XSHAPE
return panel->magnifyGlass->magPix; return panel->magnifyGlass->magPix;
#else #else
pixmap = XCreatePixmap(scr->display, W_DRAWABLE(scr), Cursor_mask_width, Cursor_mask_height, scr->depth); 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; panel->magnifyGlass->image = NULL;
/* Clipmask to make magnified view-contents circular */ /* Clipmask to make magnified view-contents circular */
#ifdef SHAPE #ifdef USE_XSHAPE
XShapeCombineMask(scr->display, WMViewXID(panel->magnifyGlass->view), XShapeCombineMask(scr->display, WMViewXID(panel->magnifyGlass->view),
ShapeBounding, 0, 0, clip_mask, ShapeSet); ShapeBounding, 0, 0, clip_mask, ShapeSet);
#else #else
@@ -1658,7 +1658,7 @@ static WMPoint magnifyInitialize(W_ColorPanel * panel)
XClearWindow(scr->display, WMViewXID(panel->magnifyGlass->view)); XClearWindow(scr->display, WMViewXID(panel->magnifyGlass->view));
XFlush(scr->display); XFlush(scr->display);
#ifndef SHAPE #ifndef USE_XSHAPE
XFreePixmap(scr->display, pixmap); XFreePixmap(scr->display, pixmap);
#endif #endif
@@ -1778,7 +1778,7 @@ static void magnifyPutCursor(WMWidget * w, void *data)
XClearWindow(scr->display, WMViewXID(panel->magnifyGlass->view)); XClearWindow(scr->display, WMViewXID(panel->magnifyGlass->view));
/* Synchronize the event queue, so the Expose is handled NOW */ /* Synchronize the event queue, so the Expose is handled NOW */
XFlush(scr->display); XFlush(scr->display);
#ifndef SHAPE #ifndef USE_XSHAPE
XFreePixmap(scr->display, pixmap); XFreePixmap(scr->display, pixmap);
#endif #endif
} }

View File

@@ -488,8 +488,8 @@ dnl ============================
AC_ARG_ENABLE(modelock, AS_HELP_STRING([--enable-modelock], [XKB keyboard language status support]), 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])) AC_DEFINE(XKB_MODELOCK, 1, [whether XKB language MODELOCK should be enabled]))
dnl Shape support dnl XShape support
dnl ============= dnl ==============
shape=yes shape=yes
AC_ARG_ENABLE(shape, AS_HELP_STRING([--disable-shape], [disable shaped window extension support]), AC_ARG_ENABLE(shape, AS_HELP_STRING([--disable-shape], [disable shaped window extension support]),
shape=$enableval, shape=yes) shape=$enableval, shape=yes)
@@ -498,7 +498,7 @@ added_xext=no
if test "$shape" = yes; then if test "$shape" = yes; then
AC_CHECK_LIB(Xext, XShapeSelectInput, [XLIBS="-lXext $XLIBS" AC_CHECK_LIB(Xext, XShapeSelectInput, [XLIBS="-lXext $XLIBS"
added_xext=yes 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) shape=no, $XLFLAGS $XLIBS)
fi fi

View File

@@ -586,7 +586,7 @@ extern struct wmaker_global_variables {
/* X Extensions */ /* X Extensions */
struct { struct {
#ifdef SHAPE #ifdef USE_XSHAPE
struct { struct {
Bool supported; Bool supported;
int event_base; int event_base;

View File

@@ -22,7 +22,7 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/Xatom.h> #include <X11/Xatom.h>
#ifdef SHAPE #ifdef USE_XSHAPE
#include <X11/extensions/shape.h> #include <X11/extensions/shape.h>
#endif #endif
@@ -166,7 +166,7 @@ void wClientConfigure(WWindow * wwin, XConfigureRequestEvent * xcre)
XConfigureWindow(dpy, xcre->window, xcre->value_mask, &xwc); XConfigureWindow(dpy, xcre->window, xcre->value_mask, &xwc);
return; return;
} }
#ifdef SHAPE #ifdef USE_XSHAPE
if (w_global.xext.shape.supported) { if (w_global.xext.shape.supported) {
int junk; int junk;
unsigned int ujunk; unsigned int ujunk;

View File

@@ -35,7 +35,7 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#ifdef SHAPE #ifdef USE_XSHAPE
# include <X11/extensions/shape.h> # include <X11/extensions/shape.h>
#endif #endif
#ifdef XDND #ifdef XDND
@@ -103,7 +103,7 @@ static void handle_inotify_events(void);
static void wdelete_death_handler(WMagicNumber id); static void wdelete_death_handler(WMagicNumber id);
#ifdef SHAPE #ifdef USE_XSHAPE
static void handleShapeNotify(XEvent *event); static void handleShapeNotify(XEvent *event);
#endif #endif
@@ -547,7 +547,7 @@ static void handleExtensions(XEvent * event)
XkbEvent *xkbevent; XkbEvent *xkbevent;
xkbevent = (XkbEvent *) event; xkbevent = (XkbEvent *) event;
#endif /*KEEP_XKB_LOCK_STATUS */ #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)) { if (w_global.xext.shape.supported && event->type == (w_global.xext.shape.event_base + ShapeNotify)) {
handleShapeNotify(event); handleShapeNotify(event);
} }
@@ -1147,7 +1147,7 @@ static void handleLeaveNotify(XEvent * event)
} }
} }
#ifdef SHAPE #ifdef USE_XSHAPE
static void handleShapeNotify(XEvent * event) static void handleShapeNotify(XEvent * event)
{ {
XShapeEvent *shev = (XShapeEvent *) event; XShapeEvent *shev = (XShapeEvent *) event;
@@ -1183,7 +1183,7 @@ static void handleShapeNotify(XEvent * event)
wWindowSetShape(wwin); wWindowSetShape(wwin);
} }
} }
#endif /* SHAPE */ #endif /* USE_XSHAPE */
#ifdef KEEP_XKB_LOCK_STATUS #ifdef KEEP_XKB_LOCK_STATUS
/* please help ]d if you know what to do */ /* please help ]d if you know what to do */

View File

@@ -38,7 +38,7 @@
#include <X11/cursorfont.h> #include <X11/cursorfont.h>
#include <X11/Xproto.h> #include <X11/Xproto.h>
#include <X11/keysym.h> #include <X11/keysym.h>
#ifdef SHAPE #ifdef USE_XSHAPE
#include <X11/extensions/shape.h> #include <X11/extensions/shape.h>
#endif #endif
#ifdef KEEP_XKB_LOCK_STATUS #ifdef KEEP_XKB_LOCK_STATUS
@@ -587,7 +587,7 @@ void StartUp(Bool defaultScreenOnly)
XSetErrorHandler((XErrorHandler) catchXError); XSetErrorHandler((XErrorHandler) catchXError);
#ifdef SHAPE #ifdef USE_XSHAPE
/* ignore j */ /* ignore j */
w_global.xext.shape.supported = XShapeQueryExtension(dpy, &w_global.xext.shape.event_base, &j); w_global.xext.shape.supported = XShapeQueryExtension(dpy, &w_global.xext.shape.event_base, &j);
#endif #endif

View File

@@ -36,7 +36,7 @@
#include "xinerama.h" #include "xinerama.h"
#ifdef SHAPE #ifdef USE_XSHAPE
#include <X11/extensions/shape.h> #include <X11/extensions/shape.h>
#endif #endif
@@ -519,7 +519,7 @@ WSwitchPanel *wInitSwitchPanel(WScreen *scr, WWindow *curwin, Bool class_only)
XSetWindowBackgroundPixmap(dpy, WMWidgetXID(panel->win), pixmap); XSetWindowBackgroundPixmap(dpy, WMWidgetXID(panel->win), pixmap);
#ifdef SHAPE #ifdef USE_XSHAPE
if (mask && w_global.xext.shape.supported) if (mask && w_global.xext.shape.supported)
XShapeCombineMask(dpy, WMWidgetXID(panel->win), ShapeBounding, 0, 0, mask, ShapeSet); XShapeCombineMask(dpy, WMWidgetXID(panel->win), ShapeBounding, 0, 0, mask, ShapeSet);
#endif #endif

View File

@@ -363,7 +363,7 @@
#endif #endif
/* some rules */ /* some rules */
#ifndef SHAPE #ifndef USE_XSHAPE
#undef SHAPED_BALLOON #undef SHAPED_BALLOON
#endif #endif

View File

@@ -23,7 +23,7 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#ifdef SHAPE #ifdef USE_XSHAPE
#include <X11/extensions/shape.h> #include <X11/extensions/shape.h>
#endif #endif
#ifdef KEEP_XKB_LOCK_STATUS #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); XSaveContext(dpy, window, w_global.context.client_win, (XPointer) & wwin->client_descriptor);
#ifdef SHAPE #ifdef USE_XSHAPE
if (w_global.xext.shape.supported) { if (w_global.xext.shape.supported) {
int junk; int junk;
unsigned int ujunk; 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.x += wwin->screen_ptr->frame_border_width;
wwin->client.y += 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) if (w_global.xext.shape.supported && wwin->flags.shaped && resize)
wWindowSetShape(wwin); wWindowSetShape(wwin);
#endif #endif
@@ -2263,7 +2263,7 @@ void wWindowConfigureBorders(WWindow *wwin)
if (flags != 0) if (flags != 0)
wFrameWindowHideButton(wwin->frame, flags); wFrameWindowHideButton(wwin->frame, flags);
#ifdef SHAPE #ifdef USE_XSHAPE
if (w_global.xext.shape.supported && wwin->flags.shaped) if (w_global.xext.shape.supported && wwin->flags.shaped)
wWindowSetShape(wwin); wWindowSetShape(wwin);
#endif #endif
@@ -2338,7 +2338,7 @@ static int getSavedState(Window window, WSavedState ** state)
return 0; return 0;
} }
#ifdef SHAPE #ifdef USE_XSHAPE
void wWindowClearShape(WWindow * wwin) void wWindowClearShape(WWindow * wwin)
{ {
XShapeCombineMask(dpy, wwin->frame->core->window, ShapeBounding, XShapeCombineMask(dpy, wwin->frame->core->window, ShapeBounding,
@@ -2422,7 +2422,7 @@ void wWindowSetShape(WWindow * wwin)
ShapeBounding, (count > 0 ? ShapeUnion : ShapeSet)); ShapeBounding, (count > 0 ? ShapeUnion : ShapeSet));
XFlush(dpy); XFlush(dpy);
} }
#endif /* SHAPE */ #endif /* USE_XSHAPE */
/* ====================================================================== */ /* ====================================================================== */

View File

@@ -256,7 +256,7 @@ typedef struct WWindow {
unsigned int semi_focused:1; unsigned int semi_focused:1;
/* window type flags */ /* window type flags */
unsigned int urgent:1; /* if wm_hints says this is urgent */ unsigned int urgent:1; /* if wm_hints says this is urgent */
#ifdef SHAPE #ifdef USE_XSHAPE
unsigned int shaped:1; unsigned int shaped:1;
#endif #endif
@@ -330,7 +330,7 @@ typedef void* WMagicNumber;
void wWindowDestroy(WWindow *wwin); void wWindowDestroy(WWindow *wwin);
WWindow *wWindowCreate(void); WWindow *wWindowCreate(void);
#ifdef SHAPE #ifdef USE_XSHAPE
void wWindowSetShape(WWindow *wwin); void wWindowSetShape(WWindow *wwin);
void wWindowClearShape(WWindow *wwin); void wWindowClearShape(WWindow *wwin);
#endif #endif

View File

@@ -22,7 +22,7 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#ifdef SHAPE #ifdef USE_XSHAPE
#include <X11/extensions/shape.h> #include <X11/extensions/shape.h>
#endif #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); 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) if (w_global.xext.shape.supported)
XShapeCombineMask(dpy, scr->workspace_name, ShapeBounding, 0, 0, mask, ShapeSet); XShapeCombineMask(dpy, scr->workspace_name, ShapeBounding, 0, 0, mask, ShapeSet);
#endif #endif