dtwm: Remove define MOTIF_ONE_DOT_ONE, backwards compatibility for motif 1.1, CDE as a whole requires 2.1

This commit is contained in:
Peter Howkins
2018-06-20 01:11:17 +01:00
parent 9a551dd8a6
commit d5273f121b
12 changed files with 1 additions and 213 deletions

View File

@@ -70,12 +70,7 @@
#include <stdlib.h>
#endif
#ifdef MOTIF_ONE_DOT_ONE
#include <stdio.h>
#include <pwd.h>
#else
#include <Xm/XmP.h> /* for XmeGetHomeDirName */
#endif
#include <signal.h>
/* maximum string lengths */
@@ -108,9 +103,6 @@
#include "WmImage.h"
#include "WmXSMP.h"
#ifdef MOTIF_ONE_DOT_ONE
extern char *getenv ();
#endif
# include <errno.h>
# ifdef X_NOT_STDC_ENV
extern int errno;
@@ -198,9 +190,6 @@ typedef struct _CCIFuncArg {
} CCIFuncArg;
#endif /* defined(MWM_QATS_PROTOCOL) */
#ifdef MOTIF_ONE_DOT_ONE
void GetHomeDirName(String fileName);
#endif
static String GetNetworkFileName (char *pchFile);
#if (defined(MWM_QATS_PROTOCOL))
static MenuItem *MakeSeparatorTemplate (int);
@@ -1627,62 +1616,6 @@ unsigned int PeekAhead(unsigned char *currentChar,
} /* END OF FUNCTION PeekAhead */
#ifdef MOTIF_ONE_DOT_ONE
/*************************************<->*************************************
*
* GetHomeDirName (fileName)
*
* Description:
* -----------
* This function finds the "HOME" directory
*
*
* Inputs:
* ------
* fileName
*
* Outputs:
* -------
* fileName
*
* Comments:
* --------
*
*************************************<->***********************************/
void GetHomeDirName(String fileName)
{
int uid;
struct passwd *pw;
char *ptr = NULL;
if((ptr = getenv("HOME")) == NULL)
{
if((ptr = getenv("USER")) != NULL)
{
pw = getpwnam(ptr);
}
else
{
uid = getuid();
pw = getpwuid(uid);
}
if (pw)
{
ptr = pw->pw_dir;
}
else
{
ptr = "";
}
}
strcpy(fileName, ptr);
}
#endif
/*************************************<->*************************************
*
* SyncModifierStrings (fileName)
@@ -1986,9 +1919,7 @@ FILE *FopenConfigFile (void)
char *LANG, *LANGp;
FILE *fileP;
#ifndef MOTIF_ONE_DOT_ONE
char *homeDir = XmeGetHomeDirName();
#endif
Boolean stackPushed;
/*
@@ -2040,11 +1971,7 @@ FILE *FopenConfigFile (void)
if ((wmGD.configFile[0] == '~') && (wmGD.configFile[1] == '/'))
/* handle "~/..." */
{
#ifdef MOTIF_ONE_DOT_ONE
GetHomeDirName(cfileName);
#else
strcpy (cfileName, homeDir);
#endif
if (LANG != NULL)
{
strncat(cfileName, "/", MAXWMPATH-strlen(cfileName));
@@ -2063,11 +1990,7 @@ FILE *FopenConfigFile (void)
/*
* Just try $HOME/.mwmrc
*/
#ifdef MOTIF_ONE_DOT_ONE
GetHomeDirName(cfileName);
#else
strcpy (cfileName, homeDir);
#endif
strncat(cfileName, &(wmGD.configFile[1]),
MAXWMPATH-strlen(cfileName));
if ((fileP = fopen (cfileName, "r")) != NULL)
@@ -2123,11 +2046,7 @@ FILE *FopenConfigFile (void)
#define HOME_MWMRC "/.mwmrc"
#define SLASH_MWMRC "/system.mwmrc"
#ifdef MOTIF_ONE_DOT_ONE
GetHomeDirName(cfileName);
#else
strcpy (cfileName, homeDir);
#endif
if (MwmBehavior)
{
@@ -2176,11 +2095,7 @@ FILE *FopenConfigFile (void)
/*
* Just try $HOME/.mwmrc
*/
#ifdef MOTIF_ONE_DOT_ONE
GetHomeDirName(cfileName);
#else
strcpy (cfileName, homeDir);
#endif
strcpy (cfileName, homeDir);
if (MwmBehavior)
{
/*
@@ -6342,62 +6257,16 @@ void ProcessMotifBindings (void)
{
char fileName[MAXWMPATH+1];
char *bindings = NULL;
#ifndef MOTIF_ONE_DOT_ONE
char *homeDir = XmeGetHomeDirName();
#else
FILE *fileP;
#endif
/*
* Look in the user's home directory for .motifbind
*/
#ifdef MOTIF_ONE_DOT_ONE
GetHomeDirName(fileName);
#else
strcpy (fileName, homeDir);
#endif
strncat(fileName, "/", MAXWMPATH-strlen(fileName));
strncat(fileName, MOTIF_BINDINGS_FILE, MAXWMPATH-strlen(fileName));
#ifdef MOTIF_ONE_DOT_ONE
if ((fileP = fopen (fileName, "r")) != NULL)
{
unsigned char buffer[MBBSIZ];
int count;
Boolean first = True;
int mode = PropModeReplace;
Window propWindow;
/*
* Get the atom for the property.
*/
wmGD.xa_MOTIF_BINDINGS =
XInternAtom (DISPLAY, _XA_MOTIF_BINDINGS, False);
/*
* The property goes on the root window of screen zero
*/
propWindow = RootWindow(DISPLAY, 0);
/*
* Copy file contents to property on root window of screen 0.
*/
while ( (count=fread((char *) &buffer[0], 1, MBBSIZ, fileP)) > 0)
{
XChangeProperty (DISPLAY, propWindow, wmGD.xa_MOTIF_BINDINGS,
XA_STRING, 8, mode,
&buffer[0], count);
if (first)
{
first = False;
mode = PropModeAppend;
}
}
}
#else
XDeleteProperty (DISPLAY, RootWindow (DISPLAY, 0),
XInternAtom (DISPLAY, "_MOTIF_BINDINGS", False));
XDeleteProperty (DISPLAY, RootWindow (DISPLAY, 0),
@@ -6413,7 +6282,6 @@ void ProcessMotifBindings (void)
_XmVirtKeysLoadFallbackBindings (DISPLAY, &bindings);
}
XtFree (bindings);
#endif
} /* END OF FUNCTION ProcessMotifBindings */