1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-22 22:28:02 +01:00

Code refactoring: replaced macro 'XINERAMA' by 'USE_XINERAMA' 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-17 18:51:15 +01:00
committed by Carlos R. Mafra
parent 1292b5a0cc
commit e106d88a42
5 changed files with 19 additions and 19 deletions

View File

@@ -611,7 +611,7 @@ if test "$xinerama" = yes; then
fi fi
if test "$xine" = 1; then if test "$xine" = 1; then
AC_DEFINE(XINERAMA, 1, AC_DEFINE(USE_XINERAMA, 1,
[define if you want support for the XINERAMA extension (set by configure)]) [define if you want support for the XINERAMA extension (set by configure)])
fi fi
fi fi

View File

@@ -1304,7 +1304,7 @@ void wShowInfoPanel(WScreen *scr)
strbuf = wstrappend(strbuf, ", MWM"); strbuf = wstrappend(strbuf, ", MWM");
#endif #endif
#ifdef XINERAMA #ifdef USE_XINERAMA
strbuf = wstrappend(strbuf, _("\n")); strbuf = wstrappend(strbuf, _("\n"));
#ifdef SOLARIS_XINERAMA #ifdef SOLARIS_XINERAMA
strbuf = wstrappend(strbuf, _("Solaris ")); strbuf = wstrappend(strbuf, _("Solaris "));

View File

@@ -258,7 +258,7 @@ static void showWorkspaceName(WScreen * scr, int workspace)
char *name = w_global.workspace.array[workspace]->name; char *name = w_global.workspace.array[workspace]->name;
int len = strlen(name); int len = strlen(name);
int x, y; int x, y;
#ifdef XINERAMA #ifdef USE_XINERAMA
int head; int head;
WMRect rect; WMRect rect;
int xx, yy; int xx, yy;
@@ -286,7 +286,7 @@ static void showWorkspaceName(WScreen * scr, int workspace)
w = WMWidthOfString(w_global.workspace.font_for_name, name, len); w = WMWidthOfString(w_global.workspace.font_for_name, name, len);
h = WMFontHeight(w_global.workspace.font_for_name); h = WMFontHeight(w_global.workspace.font_for_name);
#ifdef XINERAMA #ifdef USE_XINERAMA
head = wGetHeadForPointerLocation(scr); head = wGetHeadForPointerLocation(scr);
rect = wGetRectForHead(scr, head); rect = wGetRectForHead(scr, head);
if (scr->xine_info.count) { if (scr->xine_info.count) {
@@ -301,7 +301,7 @@ static void showWorkspaceName(WScreen * scr, int workspace)
switch (wPreferences.workspace_name_display_position) { switch (wPreferences.workspace_name_display_position) {
case WD_TOP: case WD_TOP:
#ifdef XINERAMA #ifdef USE_XINERAMA
px = xx; px = xx;
#else #else
px = (scr->scr_width - (w + 4)) / 2; px = (scr->scr_width - (w + 4)) / 2;
@@ -309,7 +309,7 @@ static void showWorkspaceName(WScreen * scr, int workspace)
py = WORKSPACE_NAME_DISPLAY_PADDING; py = WORKSPACE_NAME_DISPLAY_PADDING;
break; break;
case WD_BOTTOM: case WD_BOTTOM:
#ifdef XINERAMA #ifdef USE_XINERAMA
px = xx; px = xx;
#else #else
px = (scr->scr_width - (w + 4)) / 2; px = (scr->scr_width - (w + 4)) / 2;
@@ -334,7 +334,7 @@ static void showWorkspaceName(WScreen * scr, int workspace)
break; break;
case WD_CENTER: case WD_CENTER:
default: default:
#ifdef XINERAMA #ifdef USE_XINERAMA
px = xx; px = xx;
py = yy; py = yy;
#else #else

View File

@@ -27,7 +27,7 @@
#include "framewin.h" #include "framewin.h"
#include "placement.h" #include "placement.h"
#ifdef XINERAMA #ifdef USE_XINERAMA
# ifdef SOLARIS_XINERAMA /* sucks */ # ifdef SOLARIS_XINERAMA /* sucks */
# include <X11/extensions/xinerama.h> # include <X11/extensions/xinerama.h>
# else # else
@@ -40,7 +40,7 @@ void wInitXinerama(WScreen * scr)
scr->xine_info.primary_head = 0; scr->xine_info.primary_head = 0;
scr->xine_info.screens = NULL; scr->xine_info.screens = NULL;
scr->xine_info.count = 0; scr->xine_info.count = 0;
#ifdef XINERAMA #ifdef USE_XINERAMA
# ifdef SOLARIS_XINERAMA # ifdef SOLARIS_XINERAMA
if (XineramaGetState(dpy, scr->screen)) { if (XineramaGetState(dpy, scr->screen)) {
WXineramaInfo *info = &scr->xine_info; WXineramaInfo *info = &scr->xine_info;
@@ -79,7 +79,7 @@ void wInitXinerama(WScreen * scr)
XFree(xine_screens); XFree(xine_screens);
} }
# endif /* !SOLARIS_XINERAMA */ # endif /* !SOLARIS_XINERAMA */
#endif /* XINERAMA */ #endif /* USE_XINERAMA */
} }
int wGetRectPlacementInfo(WScreen * scr, WMRect rect, int *flags) int wGetRectPlacementInfo(WScreen * scr, WMRect rect, int *flags)

View File

@@ -39,7 +39,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <ctype.h> #include <ctype.h>
#ifdef XINERAMA #ifdef USE_XINERAMA
# ifdef SOLARIS_XINERAMA /* sucks */ # ifdef SOLARIS_XINERAMA /* sucks */
# include <X11/extensions/xinerama.h> # include <X11/extensions/xinerama.h>
# else # else
@@ -78,7 +78,7 @@ int scrX, scrY;
WXineramaInfo xineInfo; WXineramaInfo xineInfo;
Bool smooth = False; Bool smooth = False;
#ifdef XINERAMA #ifdef USE_XINERAMA
Bool xineStretch = False; Bool xineStretch = False;
#endif #endif
@@ -104,7 +104,7 @@ static void initXinerama(void)
{ {
xineInfo.screens = NULL; xineInfo.screens = NULL;
xineInfo.count = 0; xineInfo.count = 0;
#ifdef XINERAMA #ifdef USE_XINERAMA
# ifdef SOLARIS_XINERAMA # ifdef SOLARIS_XINERAMA
if (XineramaGetState(dpy, scr)) { if (XineramaGetState(dpy, scr)) {
XRectangle head[MAXFRAMEBUFFERS]; XRectangle head[MAXFRAMEBUFFERS];
@@ -141,7 +141,7 @@ static void initXinerama(void)
XFree(xine_screens); XFree(xine_screens);
} }
# endif /* !SOLARIS_XINERAMA */ # endif /* !SOLARIS_XINERAMA */
#endif /* XINERAMA */ #endif /* USE_XINERAMA */
} }
static RImage *loadImage(RContext * rc, const char *file) static RImage *loadImage(RContext * rc, const char *file)
@@ -552,7 +552,7 @@ static BackgroundTexture *parseTexture(RContext * rc, char *text)
texture->width = scrWidth; texture->width = scrWidth;
texture->height = scrHeight; texture->height = scrHeight;
#ifdef XINERAMA #ifdef USE_XINERAMA
if (xineInfo.count && ! xineStretch) { if (xineInfo.count && ! xineStretch) {
int i; int i;
for (i = 0; i < xineInfo.count; ++i) { for (i = 0; i < xineInfo.count; ++i) {
@@ -564,9 +564,9 @@ static BackgroundTexture *parseTexture(RContext * rc, char *text)
} else { } else {
applyImage(rc, texture, image, type[0], 0, 0, scrWidth, scrHeight); applyImage(rc, texture, image, type[0], 0, 0, scrWidth, scrHeight);
} }
#else /* !XINERAMA */ #else /* !USE_XINERAMA */
applyImage(rc, texture, image, type[0], 0, 0, scrWidth, scrHeight); applyImage(rc, texture, image, type[0], 0, 0, scrWidth, scrHeight);
#endif /* !XINERAMA */ #endif /* !USE_XINERAMA */
RReleaseImage(image); RReleaseImage(image);
} }
break; break;
@@ -1139,7 +1139,7 @@ static void print_help(void)
puts(" -d, --dither dither image"); puts(" -d, --dither dither image");
puts(" -m, --match match colors"); puts(" -m, --match match colors");
puts(" -S, --smooth smooth scaled image"); puts(" -S, --smooth smooth scaled image");
#ifdef XINERAMA #ifdef USE_XINERAMA
puts(" -X, --xinerama stretch image across Xinerama heads"); puts(" -X, --xinerama stretch image across Xinerama heads");
#endif #endif
puts(" -b, --back-color <color> background color"); puts(" -b, --back-color <color> background color");
@@ -1249,7 +1249,7 @@ int main(int argc, char **argv)
obey_user++; obey_user++;
} else if (strcmp(argv[i], "-S") == 0 || strcmp(argv[i], "--smooth") == 0) { } else if (strcmp(argv[i], "-S") == 0 || strcmp(argv[i], "--smooth") == 0) {
smooth = True; smooth = True;
#ifdef XINERAMA #ifdef USE_XINERAMA
} else if (strcmp(argv[i], "-X") == 0 || strcmp(argv[i], "--xinerama") == 0) { } else if (strcmp(argv[i], "-X") == 0 || strcmp(argv[i], "--xinerama") == 0) {
xineStretch = True; xineStretch = True;
#endif #endif