summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@herrb.eu>2016-09-04 18:29:49 +0100
committerMatthieu Herrb <matthieu@herrb.eu>2016-09-04 18:29:49 +0100
commit93199a5240a48f6eb79cb91bd89a7bbc289f2b56 (patch)
tree2540fdb5e7bd7a5d18e6cd99d605e3780f02b830
parent7579656ff165620048b28829ad8aa10ba04d5ef9 (diff)
Unifdef XPM
-rw-r--r--configure.ac19
-rw-r--r--greeter/Login.c34
-rw-r--r--greeter/Login.h14
-rw-r--r--greeter/LoginP.h2
4 files changed, 14 insertions, 55 deletions
diff --git a/configure.ac b/configure.ac
index 737cd8f..b7b6ecd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -69,9 +69,6 @@ CHOOSER_CFLAGS="$CHOOSER_CFLAGS"
# Find needed libraries for TCP sockets (pre-pended in $LIBS)
XTRANS_CONNECTION_FLAGS
-
-
-
# FIXME: Find better test for which OS'es use su -m - for now, just try to
# mirror the Imakefile setting of:
# if defined(OpenBSDArchitecture) || defined(NetBSDArchitecture) || defined(FreeBSDArchitecture) || defined(DarwinArchitecture)
@@ -238,19 +235,9 @@ if test "x$USE_XFT" = "xyes" ; then
fi
# XPM logos for the greeter screen
-AC_ARG_ENABLE(xpm-logos,
- AS_HELP_STRING([--enable-xpm-logos],
- [Display xpm logos in greeter (default is YES)]),
- [USE_XPM="$enableval"],
- PKG_CHECK_EXISTS(xpm, [USE_XPM="yes"], [USE_XPM="no"]))
-if test "x$USE_XPM" = "xyes" ; then
- PKG_CHECK_MODULES(XPM, xpm)
- GREETER_CFLAGS="$GREETER_CFLAGS $XPM_CFLAGS"
- GREETER_LIBS="$GREETER_LIBS $XPM_LIBS"
- AC_DEFINE([XPM], 1,
- [Define to 1 to display XPM logos on greeter screen])
-fi
-AM_CONDITIONAL(USE_XPM, test "x$USE_XPM" = "xyes")
+PKG_CHECK_MODULES(XPM, xpm)
+GREETER_CFLAGS="$GREETER_CFLAGS $XPM_CFLAGS"
+GREETER_LIBS="$GREETER_LIBS $XPM_LIBS"
AC_ARG_WITH(color-pixmap,
AS_HELP_STRING([--with-color-pixmap=<filename>],
diff --git a/greeter/Login.c b/greeter/Login.c
index 400395f..f1aa4e7 100644
--- a/greeter/Login.c
+++ b/greeter/Login.c
@@ -72,13 +72,11 @@ from The Open Group.
#include "greet.h"
#include "LoginP.h"
-#ifdef XPM
-# include <sys/stat.h>
-# include <unistd.h>
-# include <X11/Xlib.h>
-# include <X11/xpm.h>
-# include <X11/extensions/shape.h>
-#endif /* XPM */
+#include <sys/stat.h>
+#include <unistd.h>
+#include <X11/Xlib.h>
+#include <X11/xpm.h>
+#include <X11/extensions/shape.h>
#include <X11/cursorfont.h>
@@ -140,7 +138,6 @@ static XtResource resources[] = {
/* end (caolan) */
#endif /* DANCING */
-#ifdef XPM
/* added by Ivan Griffin (ivan.griffin@ul.ie) */
{XtNlogoFileName, XtCLogoFileName, XtRString, sizeof(char*),
offset(logoFileName), XtRImmediate, (XtPointer)0},
@@ -149,7 +146,6 @@ static XtResource resources[] = {
{XtNlogoPadding, XtCLogoPadding, XtRInt, sizeof(int),
offset(logoPadding), XtRImmediate, (XtPointer) 5},
/* end (ivan) */
-#endif /* XPM */
/* added by Amit Margalit */
{XtNhiColor, XtCForeground, XtRPixel, sizeof (Pixel),
@@ -299,11 +295,7 @@ XmuXftTextWidth(Display *dpy, XftFont *font, FcChar8 *string, int len);
#define STRING_WIDTH(f, s) TEXT_WIDTH (f, s, strlen(s))
/* Padded width of logo image, if compiled with XPM support */
-#ifdef XPM
# define LOGO_W(w) ((w)->login.logoWidth + ((w)->login.logoPadding * 2))
-#else
-# define LOGO_W(w) 0
-#endif
#define TEXT_PROMPT_W(w, m) (STRING_WIDTH(prompt, m) + w->login.inframeswidth)
@@ -722,10 +714,8 @@ draw_it (LoginWidget w)
gr_line_y = GREET_Y(w) + GREET_Y_INC(w);
gr_line_w = w->core.width - 2*(w->login.outframewidth);
-#ifdef XPM
gr_line_x += w->login.logoPadding;
gr_line_w -= w->login.logoWidth + (3 * (w->login.logoPadding));
-#endif /* XPM */
for(i=1;i<=(w->login.sepwidth);i++)
{
@@ -788,9 +778,7 @@ draw_it (LoginWidget w)
if (GREETING(w)[0]) {
int gx = GREET_X(w);
-#ifdef XPM
gx -= ((w->login.logoWidth/2) + w->login.logoPadding);
-#endif
DRAW_STRING (greet, gx, GREET_Y(w), GREETING(w), strlen (GREETING(w)));
}
for (p = 0; p < NUM_PROMPTS ; p++) {
@@ -1751,7 +1739,6 @@ static void Initialize (
w->login.failGC = XtGetGC (gnew, xvaluemask, &myXGCV);
#endif /* USE_XFT */
-#ifdef XPM
w->login.logoValid = False;
if (NULL != w->login.logoFileName)
@@ -1806,7 +1793,6 @@ static void Initialize (
SkipXpmLoad:
-#endif /* XPM */
w->login.data.name[0] = '\0';
w->login.data.passwd[0] = '\0';
w->login.state = INITIALIZING;
@@ -1836,15 +1822,9 @@ SkipXpmLoad:
int fy = FAIL_Y(w);
int pady = PAD_Y(w);
-#ifndef XPM
- w->core.height = fy + pady; /* for stupid compilers */
-#else
-/* w->core.height = fy + pady; * for stupid compilers */
-
w->core.height = max(fy + pady,
(w->login.logoHeight + (2*w->login.logoPadding)) + pady);
-#endif /* XPM */
}
#ifdef USE_XINERAMA
if (
@@ -1897,7 +1877,6 @@ static void Realize (
cursor = XCreateFontCursor(XtDisplay(gw), XC_left_ptr);
XDefineCursor(XtDisplay(gw), DefaultRootWindow(XtDisplay(gw)), cursor);
-#ifdef XPM
/*
* Check if Pixmap was valid
*/
@@ -1941,7 +1920,6 @@ static void Realize (
w->login.logoPixmap);
XMapWindow(XtDisplay(w), w->login.logoWindow);
}
-#endif /* XPM */
}
static void Destroy (Widget gw)
@@ -1974,7 +1952,6 @@ static void Destroy (Widget gw)
XtReleaseGC(gw, w->login.shdGC);
XtReleaseGC(gw, w->login.inpGC);
-#ifdef XPM
if (True == w->login.logoValid)
{
if (w->login.logoPixmap != 0)
@@ -1983,7 +1960,6 @@ static void Destroy (Widget gw)
if (w->login.logoMask != 0)
XFreePixmap(XtDisplay(w), w->login.logoMask);
}
-#endif /* XPM */
}
/* ARGSUSED */
diff --git a/greeter/Login.h b/greeter/Login.h
index 6af3369..dc61955 100644
--- a/greeter/Login.h
+++ b/greeter/Login.h
@@ -124,14 +124,12 @@ from The Open Group.
/* caolan end */
# endif /* DANCING */
-# ifdef XPM
-# define XtNuseShape "useShape"
-# define XtCUseShape "UseShape"
-# define XtNlogoFileName "logoFileName"
-# define XtCLogoFileName "LogoFileName"
-# define XtNlogoPadding "logoPadding"
-# define XtCLogoPadding "LogoPadding"
-# endif /* XPM */
+# define XtNuseShape "useShape"
+# define XtCUseShape "UseShape"
+# define XtNlogoFileName "logoFileName"
+# define XtCLogoFileName "LogoFileName"
+# define XtNlogoPadding "logoPadding"
+# define XtCLogoPadding "LogoPadding"
# define XtCGreeting "Greeting"
# define XtCNamePrompt "NamePrompt"
diff --git a/greeter/LoginP.h b/greeter/LoginP.h
index 57ed182..ccd0edf 100644
--- a/greeter/LoginP.h
+++ b/greeter/LoginP.h
@@ -150,14 +150,12 @@ typedef struct {
int inframeswidth; /* inner frames thickness */
int sepwidth; /* width of separator line */
-# ifdef XPM
char *logoFileName;
unsigned int logoWidth, logoHeight, logoPadding, logoBorderWidth;
int logoX, logoY;
Window logoWindow;
Boolean useShape, logoValid;
Pixmap logoPixmap, logoMask;
-# endif /* XPM */
# ifdef USE_XFT
XftDraw *draw;
XftFont *textFace; /* font for text */