v05i052: Xrooms -- A Rooms implementation for X, Part02/14
Kent Landfield
kent at ssbell.IMD.Sterling.COM
Mon Jan 15 17:06:08 AEST 1990
Submitted-by: wsl.dec.com!mikey (Mike Yang)
Posting-number: Volume 5, Issue 52
Archive-name: xrooms/part02
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of archive 2 (of 14)."
# Contents: ./lib/apps.h ./lib/appstatestr.h ./lib/namesstr.h
# ./lib/profile.h ./lib/profparser.h ./lib/rooms.h ./lib/roomstr.h
# ./utils/hash.h ./utils/list.h ./utils/machdep.h ./utils/storage.h
# ./utils/storagestr.h ./wallpaper/wallpaper.c ./xrooms/xrApp.h
# ./xrooms/xrGen.c ./xrooms/xrProtoIter.h ./xrooms/xrXawUI.h
# Wrapped by kent at ssbell on Sun Jan 14 21:57:31 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f './lib/apps.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./lib/apps.h'\"
else
echo shar: Extracting \"'./lib/apps.h'\" \(2893 characters\)
sed "s/^X//" >'./lib/apps.h' <<'END_OF_FILE'
X#ifndef APPS_H
X#define APPS_H 1
X
X /*\
X * $Header: apps.h,v 5.0 90/01/10 06:53:05 erik Exp $
X *
X * COPYRIGHT 1990
X * DIGITAL EQUIPMENT CORPORATION
X * MAYNARD, MASSACHUSETTS
X * ALL RIGHTS RESERVED.
X *
X * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
X * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
X * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE
X * FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED
X * WARRANTY.
X *
X * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
X * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
X * ADDITION TO THAT SET FORTH ABOVE.
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted, provided
X * that the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of Digital Equipment Corporation not be
X * used in advertising or publicity pertaining to distribution of the
X * software without specific, written prior permission.
X \*/
X
X /*\
X
X \*/
X /*\
X * Operations on a group of Apps (that live in a group of Rooms).
X * This package implements a group of Apps and their interactions
X * with rooms. There is a fair amount of interdepency between
X * this package and rooms.c.
X *
X * This package handles name collisions between Apps, App lifetimes
X * (i.e. automatically destroying transient Apps when they exit, and
X * matching up permanent Apps with new windows), and figures out
X * which Room local state (if any) to change in response to an
X * external change on a window. It makes sure that all of the
X * active Apps (and none of the inactive Apps) are realized in all
X * rooms.
X \*/
X
X#include "app.h"
X
Xtypedef Boolean (*AppsIterFunc)(/* arg, pApp */);
X
Xextern unsigned int appsDebug;
X
Xextern AppPtr LookupApp(/* name */);
Xextern AppPtr LookupActiveApp(/* name */);
X
Xextern AppPtr GetApp(/*name,onlyInactive*/);
Xextern Boolean AppActivated(/* pApp, pRealState */);
Xextern Boolean AppDeactivated(/*pApp*/);
Xextern Boolean AppStateChanged(/* pApp, pNewState */);
X
Xextern Boolean SetAppRoomState(/* pApp, pRoom, pNewState */);
Xextern Boolean SetAppPermanence(/* pApp, permanent */);
X
Xextern void AppsIterate(/* func, arg */);
Xextern void ActiveAppsIterate(/* func, arg */);
X
Xextern Boolean _AppsInitIter(/* pState */);
Xextern Boolean _AppsIterNext(/* pState, ppApp */);
Xextern void AppsEndIterator(/* state */);
X
X#define ActiveApps ((unsigned)1)
X#define AllApps ((unsigned)2)
X
X#define AppsIterator(w,pa,s) \
X if (_AppsInitIter((w),&(s))) \
X while (_AppsIterNext((s),&(pa)))
X#endif /* APPS_H */
END_OF_FILE
if test 2893 -ne `wc -c <'./lib/apps.h'`; then
echo shar: \"'./lib/apps.h'\" unpacked with wrong size!
fi
# end of './lib/apps.h'
fi
if test -f './lib/appstatestr.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./lib/appstatestr.h'\"
else
echo shar: Extracting \"'./lib/appstatestr.h'\" \(3084 characters\)
sed "s/^X//" >'./lib/appstatestr.h' <<'END_OF_FILE'
X#ifndef APPSTATESTR_H
X#define APPSTATESTR_H
X
X /*\
X * $Header: appstatestr.h,v 5.0 90/01/10 06:53:17 erik Exp $
X *
X * COPYRIGHT 1990
X * DIGITAL EQUIPMENT CORPORATION
X * MAYNARD, MASSACHUSETTS
X * ALL RIGHTS RESERVED.
X *
X * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
X * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
X * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE
X * FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED
X * WARRANTY.
X *
X * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
X * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
X * ADDITION TO THAT SET FORTH ABOVE.
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted, provided
X * that the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of Digital Equipment Corporation not be
X * used in advertising or publicity pertaining to distribution of the
X * software without specific, written prior permission.
X \*/
X
X#include "appstate.h"
X
Xtypedef struct _AppStateRec {
X unsigned flags;
X unsigned bolts;
X unsigned looseBolts;
X WinState winState;
X int x,y;
X unsigned width,height;
X} AppStateRec;
X
X#define AS_DFLT_SCREEN_WIDTH 1024
X#define AS_DFLT_SCREEN_HEIGHT 864
X
X#define ASHasX(s) ((s)&&((s)->flags&asXValue))
X#define ASHasY(s) ((s)&&((s)->flags&asYValue))
X#define ASHasWidth(s) ((s)&&((s)->flags&asWidthValue))
X#define ASHasHeight(s) ((s)&&((s)->flags&asHeightValue))
X#define ASHasWinState(s) ((s)&&((s)->flags&asWinStateValue))
X#define ASHasAny(s) ((s)&&(((s)->flags&asAllValues)!=asNoValue))
X#define ASHasAll(s) ((s)&&(((s)->flags&asAllValues)==asAllValues))
X#define ASHasWholeGeom(s) ((s)&&(((s)->flags&asGeomValues)==asGeomValues))
X#define ASHasAnyGeom(s) ((s)&&(((s)->flags&asGeomValues)!=asNoValue))
X#define ASHasNegativeX(s) ((s)&&((s)->flags&asXNegative))
X#define ASHasNegativeY(s) ((s)&&((s)->flags&asYNegative))
X
X#define ASLegalRealState(s) (((s)!=NullAppState)&&ASHasAll(s)&&\
X (!ASHasNegativeX(s))&&(!ASHasNegativeY(s))&&\
X ((s)->bolts==asNoValue)&&\
X ((s)->looseBolts==asNoValue))
X#define ASLegalProfileState(s) (((s)==NullAppState)||(!ASHasWinState(s))||\
X (((s)->winState!=asInactive)&&\
X ((s)->winState!=asWithdrawn)))
X#define ASDontCareState(s) (((s)==NullAppState)||(!ASHasAny(s)))
X
X#define ASWinStateBolted(s) ((s)&&((s)->bolts&asWinStateValue))
X#define ASXBolted(s) ((s)&&((s)->bolts&asXValue))
X#define ASYBolted(s) ((s)&&((s)->bolts&asYValue))
X#define ASWidthBolted(s) ((s)&&((s)->bolts&asWidthValue))
X#define ASHeightBolted(s) ((s)&&((s)->bolts&asHeightValue))
X#define ASAnyBolted(s) ((s)&&(((s)->bolts&asAllValues)!=asNoValue))
X#define ASAnyGeomBolted(s) ((s)&&(((s)->bolts&asGeomValues)!=asNoValue))
X
X#endif /* APPSTATESTR_H */
END_OF_FILE
if test 3084 -ne `wc -c <'./lib/appstatestr.h'`; then
echo shar: \"'./lib/appstatestr.h'\" unpacked with wrong size!
fi
# end of './lib/appstatestr.h'
fi
if test -f './lib/namesstr.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./lib/namesstr.h'\"
else
echo shar: Extracting \"'./lib/namesstr.h'\" \(3595 characters\)
sed "s/^X//" >'./lib/namesstr.h' <<'END_OF_FILE'
X#ifndef NAMESSTR_H
X#define NAMESSTR_H 1
X
X /*\
X * $Header: namesstr.h,v 5.0 90/01/10 06:53:45 erik Exp $
X *
X * COPYRIGHT 1990
X * DIGITAL EQUIPMENT CORPORATION
X * MAYNARD, MASSACHUSETTS
X * ALL RIGHTS RESERVED.
X *
X * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
X * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
X * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE
X * FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED
X * WARRANTY.
X *
X * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
X * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
X * ADDITION TO THAT SET FORTH ABOVE.
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted, provided
X * that the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of Digital Equipment Corporation not be
X * used in advertising or publicity pertaining to distribution of the
X * software without specific, written prior permission.
X \*/
X
X#include "regex.h"
X#include "names.h"
X
Xtypedef struct _NPStateRec {
X Boolean done;
X char *resultName;
X char *resultClass;
X char *lastMatchString;
X RXMatchesRec lastMatchSubStrings;
X NameResolveFunc ResolveFunc;
X ChangeNamedFunc ChangeFunc;
X Opaque OSPrivate;
X} NPStateRec;
X
Xtypedef struct _NPQuestionExprRec {
X NPBoolExprPtr pCondition;
X NPStringExprPtr pTrue;
X NPStringExprPtr pFalse;
X} NPQuestionExprRec, *NPQuestionExprPtr;
X
Xtypedef struct _NPConcatExprRec {
X NPStringExprPtr pLeft;
X NPStringExprPtr pRight;
X} NPConcatExprRec, *NPConcatExprPtr;
X
Xtypedef struct _NPStringExprRec {
X unsigned type;
X union {
X char *constant;
X NPConcatExprRec concat;
X NPQuestionExprRec conditional;
X } u;
X} NPStringExprRec;
X
Xtypedef struct _NPBoolExprRec {
X Boolean invert;
X NPStringExprPtr left;
X NPStringExprPtr right;
X} NPBoolExprRec;
X
Xtypedef struct _NPIfStatementRec {
X NPBoolExprPtr condition;
X NPStatementPtr thenClause;
X NPStatementPtr elseClause;
X} NPIfStatementRec,*NPIfStatementPtr;
X#define NullNPIfStatement ((NPIfStatementPtr)NULL)
X
Xtypedef struct _NPCaseRec {
X NPStringExprPtr pattern;
X NPStatementPtr statement;
X struct _NPCaseRec *pNext;
X} NPCaseRec;
X
Xtypedef struct _NPSwitchStatementRec {
X NPStringExprPtr string;
X NPStatementPtr dfltCase;
X NPCasePtr cases;
X} NPSwitchStatementRec, *NPSwitchStatementPtr;
X#define NullNPSwitchStatement ((NPSwitchStatementPtr)NULL)
X
Xtypedef struct _NPAssignStatementRec {
X Boolean append;
X NPStringExprPtr pLHS; /* identifier or property only! */
X NPStringExprPtr pValue;
X} NPAssignStatementRec, *NPAssignStatementPtr;
X#define NullNPAssignStatementRec ((NPAssignStatementPtr)NULL)
X
Xtypedef struct _NPStatementRec {
X unsigned what;
X union {
X NPIfStatementRec ifS;
X NPSwitchStatementRec switchS;
X NPStringExprPtr pUseExpr;
X NPStringExprPtr pClassExpr;
X NPAssignStatementRec assignS;
X char *comment;
X } u;
X struct _NPStatementRec *pNext;
X} NPStatementRec;
X
X#define NPIfStatement ((unsigned)(1<<0))
X#define NPSwitchStatement ((unsigned)(1<<1))
X#define NPUseStatement ((unsigned)(1<<2))
X#define NPClassStatement ((unsigned)(1<<3))
X#define NPIgnoreStatement ((unsigned)(1<<4))
X#define NPAssignStatement ((unsigned)(1<<5))
X#define NPComment ((unsigned)(1<<9))
X
X#endif /* NAMESSTR_H */
END_OF_FILE
if test 3595 -ne `wc -c <'./lib/namesstr.h'`; then
echo shar: \"'./lib/namesstr.h'\" unpacked with wrong size!
fi
# end of './lib/namesstr.h'
fi
if test -f './lib/profile.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./lib/profile.h'\"
else
echo shar: Extracting \"'./lib/profile.h'\" \(2186 characters\)
sed "s/^X//" >'./lib/profile.h' <<'END_OF_FILE'
X#ifndef PROFILE_H
X#define PROFILE_H 1
X
X /*\
X * $Header: profile.h,v 5.0 90/01/10 06:53:54 erik Exp $
X *
X * COPYRIGHT 1990
X * DIGITAL EQUIPMENT CORPORATION
X * MAYNARD, MASSACHUSETTS
X * ALL RIGHTS RESERVED.
X *
X * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
X * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
X * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE
X * FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED
X * WARRANTY.
X *
X * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
X * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
X * ADDITION TO THAT SET FORTH ABOVE.
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted, provided
X * that the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of Digital Equipment Corporation not be
X * used in advertising or publicity pertaining to distribution of the
X * software without specific, written prior permission.
X \*/
X
Xextern unsigned profileDebug;
X
Xtypedef struct _CommentRec {
X char *text;
X struct _CommentRec *pNext;
X} CommentRec,*CommentPtr;
X#define NullComment ((CommentPtr)NULL)
X
Xextern void profileSetResolve(/* pFunc */);
Xextern void profileSetChange(/* pFunc */);
X
Xextern Boolean profileForNames(/* name, pNames */);
Xextern Boolean profileGetName(/* osPriv, ppName, ppClass */);
X
Xextern Boolean profileForRoom(/* pRoom */);
Xextern Boolean profileForApp(/* pApp */);
Xextern Boolean profileAddComment(/* comment */);
Xextern CommentPtr profileGetComments();
X
Xextern Boolean profileRead(/*pScan*/);
Xextern Boolean profileWrite(/*pFile, writeRooms*/);
X
Xextern void profileForNamesDestroy(/* name */);
Xextern void profileForAppDestroy(/* appName */);
Xextern void profileForRoomDestroy(/* roomName */);
X
X#define PROFILE_NAME_COL 13
X#define PROFILE_STATE_COL 40
X
X#endif /* PROFILE_H */
END_OF_FILE
if test 2186 -ne `wc -c <'./lib/profile.h'`; then
echo shar: \"'./lib/profile.h'\" unpacked with wrong size!
fi
# end of './lib/profile.h'
fi
if test -f './lib/profparser.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./lib/profparser.h'\"
else
echo shar: Extracting \"'./lib/profparser.h'\" \(2420 characters\)
sed "s/^X//" >'./lib/profparser.h' <<'END_OF_FILE'
X#ifndef PROFPARSER_H
X#define PROFPARSER_H 1
X
X /*\
X * $Header: profparser.h,v 5.0 90/01/10 06:54:00 erik Exp $
X *
X * COPYRIGHT 1990
X * DIGITAL EQUIPMENT CORPORATION
X * MAYNARD, MASSACHUSETTS
X * ALL RIGHTS RESERVED.
X *
X * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
X * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
X * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE
X * FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED
X * WARRANTY.
X *
X * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
X * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
X * ADDITION TO THAT SET FORTH ABOVE.
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted, provided
X * that the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of Digital Equipment Corporation not be
X * used in advertising or publicity pertaining to distribution of the
X * software without specific, written prior permission.
X \*/
X
X#include "strtbl.h"
X#include "appstate.h"
X#include "rooms.h"
X#include "apps.h"
X#include "profile.h"
X#include "profscan.h"
X#include "names.h"
X
Xtypedef struct _ParserWinStateRec {
X WinState winState;
X Boolean bolted;
X} ParserWinStateRec, *ParserWinStatePtr;
X
Xtypedef struct _ParserNamedStateRec {
X StringToken name;
X AppStatePtr pState;
X} ParserNamedStateRec,*ParserNamedStatePtr;
X
Xtypedef struct _ParserStateRec {
X union {
X ParserWinStateRec ws;
X AppStatePtr pGeomState;
X ParserNamedStateRec state;
X } u;
X struct _ParserStateRec *pNext;
X} ParserStateRec,*ParserStatePtr;
X#define NullParserState ((ParserStatePtr)NULL)
X
Xextern RoomPtr parserCreateRoom(/* nameStr, pStates */);
Xextern AppPtr parserCreateApp(/* nameStr, pDflt, pStates */);
X
Xextern AppStatePtr parserCreateState(/* pPWinState, pPGeom */);
Xextern ParserStatePtr parserAppendState(/* pState1, pState2 */);
Xextern ParserStatePtr parserCreateNamedState(/* nameStr, pState */);
Xextern ParserStatePtr parserCreateWinState(/* winState, bolted */);
Xextern ParserStatePtr parserCreateGeom(/* pGeom, bolted */);
X#endif /* PROFPARSER_H */
END_OF_FILE
if test 2420 -ne `wc -c <'./lib/profparser.h'`; then
echo shar: \"'./lib/profparser.h'\" unpacked with wrong size!
fi
# end of './lib/profparser.h'
fi
if test -f './lib/rooms.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./lib/rooms.h'\"
else
echo shar: Extracting \"'./lib/rooms.h'\" \(2283 characters\)
sed "s/^X//" >'./lib/rooms.h' <<'END_OF_FILE'
X#ifndef ROOMS_H
X#define ROOMS_H 1
X
X /*\
X * $Header: rooms.h,v 5.0 90/01/10 06:54:28 erik Exp $
X *
X * COPYRIGHT 1990
X * DIGITAL EQUIPMENT CORPORATION
X * MAYNARD, MASSACHUSETTS
X * ALL RIGHTS RESERVED.
X *
X * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
X * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
X * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE
X * FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED
X * WARRANTY.
X *
X * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
X * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
X * ADDITION TO THAT SET FORTH ABOVE.
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted, provided
X * that the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of Digital Equipment Corporation not be
X * used in advertising or publicity pertaining to distribution of the
X * software without specific, written prior permission.
X \*/
X
X /*\
X * Operations on rooms
X \*/
X
X#include "room.h"
X
Xtypedef Boolean (*RoomsIterFunc)(/* pRoom, arg */);
Xtypedef RoomPtr (*RoomFinderFunc)();
X
Xextern unsigned int roomsDebug;
X
Xextern int NumberOfRooms();
X
Xextern RoomPtr LookupRoom(/* name */);
Xextern RoomPtr CreateRoom(/* name */);
Xextern Boolean DestroyRoom(/* pRoom */);
Xextern void RoomsIterate(/* func, arg */);
X
Xextern Boolean SwitchToRoom(/* pRoom */);
Xextern RoomPtr GetCurrentRoom();
X
Xextern void SetDefaultRoomFinder(/* pFinder */);
Xextern void SetDefaultRoomFeedback(/* pFunc */);
X
Xextern Boolean _RoomsInitIter(/* pState */);
Xextern Boolean _RoomsIterNext(/* pState, ppRoom */);
Xextern Boolean _RoomsIterNextVisible(/* pState, ppRoom */);
Xextern void RoomsEndIterator(/* state */);
X
X#define RoomsIterator(pa,s) \
X if (_RoomsInitIter(&(s))) \
X while (_RoomsIterNext((s),&(pa)))
X
X#define VisibleRoomsIterator(pa,s) \
X if (_RoomsInitIter(&(s))) \
X while (_RoomsIterNext((s),&(pa)))
X
X#endif /* ROOMS_H */
END_OF_FILE
if test 2283 -ne `wc -c <'./lib/rooms.h'`; then
echo shar: \"'./lib/rooms.h'\" unpacked with wrong size!
fi
# end of './lib/rooms.h'
fi
if test -f './lib/roomstr.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./lib/roomstr.h'\"
else
echo shar: Extracting \"'./lib/roomstr.h'\" \(3304 characters\)
sed "s/^X//" >'./lib/roomstr.h' <<'END_OF_FILE'
X#ifndef ROOMSTR_H
X#define ROOMSTR_H 1
X
X /*\
X * $Header: roomstr.h,v 5.0 90/01/10 06:54:31 erik Exp $
X *
X * COPYRIGHT 1990
X * DIGITAL EQUIPMENT CORPORATION
X * MAYNARD, MASSACHUSETTS
X * ALL RIGHTS RESERVED.
X *
X * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
X * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
X * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE
X * FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED
X * WARRANTY.
X *
X * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
X * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
X * ADDITION TO THAT SET FORTH ABOVE.
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted, provided
X * that the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of Digital Equipment Corporation not be
X * used in advertising or publicity pertaining to distribution of the
X * software without specific, written prior permission.
X \*/
X
X#include "list.h"
X#include "room.h"
X
Xtypedef struct _RoomRec {
X StringToken name;
X Boolean active;
X unsigned visibility;
X int numApps;
X int numLocalApps;
X ListPtr contents;
X Opaque priv;
X RoomFeedbackFunc feedback;
X} RoomRec;
X
Xtypedef struct _RoomAppInfoRec {
X AppPtr pApp;
X AppStatePtr pDefault;
X AppStatePtr pReal;
X AppStatePtr pLocal;
X} RoomAppInfoRec,*RoomAppInfoPtr;
X#define NullRoomAppInfo ((RoomAppInfoPtr)NULL)
X
X /* macros to make room.c more readable */
X#define _HasLocalState(r,ri) ((ri)->pLocal!=NullAppState)
X#define _GetVisibleState(r,ri) ((ri)->pLocal!=NullAppState?\
X (ri)->pLocal:\
X ((ri)->pDefault))
X
X#define _HasLocalApps(r) ((r)->numLocalApps>0)
X#define _NoLocalApps(r) ((r)->numLocalApps<1)
X
X#define _Feedback(r,w,a) if ((r)->feedback!=(RoomFeedbackFunc)NULL) {\
X ((*(r)->feedback)(r,w,a));\
X }
X
X#define _IsActive(r) ((r)->active)
X#define _IsInactive(r) (!(r)->active)
X
X#define _IsVisible(r) ((r)->visibility&roomVisible)
X#define _IsHidden(r) (!_IsVisible(r))
X#define _WhenActive(r) ((r)->visibility&roomWhenActive)
X#define _WhenNonEmpty(r) ((r)->visibility&roomWhenNonEmpty)
X#define _Always(r) ((r)->visibility&roomAlways)
X
X#define _SetVisible(r) ((r)->visibility|=roomVisible)
X#define _SetHidden(r) ((r)->visibility&=(~roomVisible))
X
X#define _RealStateIsWrong(r,ri,v) \
X (_IsActive(r)&&(!asRealMatchesProfile((ri)->pReal,(v))))
X#define _CheckRealState(r,ri) {\
X AppStatePtr vis= _GetVisibleState(r,ri);\
X if (_RealStateIsWrong(r,ri,vis)) {\
X appSetCurrent((ri)->pApp,vis,False);\
X }}
X
X#define _LocalAppGone(pr) {\
X (pr)->numLocalApps--;\
X if ((!_Always(pr))&&_IsVisible(pr)&&\
X _WhenNonEmpty(pr)&&_NoLocalApps(pr)) {\
X if ((!_WhenActive(pr))||(_IsInactive(pr))) {\
X _SetHidden(pr);\
X _Feedback(pr,roomFBHidden,NullApp);\
X }\
X }}
X
X#define _LocalAppAdded(pr) {\
X (pr)->numLocalApps++;\
X if (_WhenNonEmpty(pr)&&_IsHidden(pr)) {\
X _SetVisible(pr);\
X _Feedback(pr,roomFBVisible,NullApp);\
X }}
X
X#endif /* ROOMSTR_H */
END_OF_FILE
if test 3304 -ne `wc -c <'./lib/roomstr.h'`; then
echo shar: \"'./lib/roomstr.h'\" unpacked with wrong size!
fi
# end of './lib/roomstr.h'
fi
if test -f './utils/hash.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./utils/hash.h'\"
else
echo shar: Extracting \"'./utils/hash.h'\" \(2370 characters\)
sed "s/^X//" >'./utils/hash.h' <<'END_OF_FILE'
X#ifndef HASH_H
X#define HASH_H 1
X
X /*\
X * $Header: hash.h,v 5.0 90/01/10 06:50:48 erik Exp $
X *
X * COPYRIGHT 1990
X * DIGITAL EQUIPMENT CORPORATION
X * MAYNARD, MASSACHUSETTS
X * ALL RIGHTS RESERVED.
X *
X * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
X * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
X * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE
X * FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED
X * WARRANTY.
X *
X * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
X * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
X * ADDITION TO THAT SET FORTH ABOVE.
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted, provided
X * that the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of Digital Equipment Corporation not be
X * used in advertising or publicity pertaining to distribution of the
X * software without specific, written prior permission.
X \*/
X
X#include "storage.h"
X
Xtypedef struct _HashTableRec *HashTablePtr;
X#define NullHashTable ((HashTablePtr)NULL)
X
Xtypedef Boolean (*HashIterFunc)(/* row, key, pData, arg */);
X
Xextern HashTablePtr htCreate(/* size, keyType, dataType */);
Xextern void htDestroy(/* table */);
X
Xextern GenData htAdd(/* table, key, data */);
Xextern GenData htLookup(/* table, key */);
Xextern GenData htRemove(/* table, key */);
X
Xextern int htSize(/* table */);
Xextern int htNumStored(/* table */);
X
Xextern Boolean htResize(/* table, newSize */);
Xextern Boolean htConvertKeys(/* table, cvtFunc, keyDesc */);
Xextern Boolean htConvertData(/* table, cvtFunc, dataDesc */);
Xextern Boolean htChangeHashFunc(/* table, newFunc */);
X
Xextern void htIterate(/* table, pFunc, arg */);
X
Xextern Boolean _htInitIter(/* table, ppData */);
Xextern Boolean _htIterNext(/* table, pState, ppData */);
Xextern void htEndIterator(/* table, state */);
X
X#define htIterator(t,k,d,s) \
X if (_htInitIter((t),&(s))) \
X while (_htIterNext((t),(Opaque)(s),(GenKey *)&(k),(GenData *)&(d)))
X
X#endif /* HASH_H */
END_OF_FILE
if test 2370 -ne `wc -c <'./utils/hash.h'`; then
echo shar: \"'./utils/hash.h'\" unpacked with wrong size!
fi
# end of './utils/hash.h'
fi
if test -f './utils/list.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./utils/list.h'\"
else
echo shar: Extracting \"'./utils/list.h'\" \(2236 characters\)
sed "s/^X//" >'./utils/list.h' <<'END_OF_FILE'
X#ifndef LIST_H
X#define LIST_H 1
X
X /*\
X * $Header: list.h,v 5.0 90/01/10 06:50:58 erik Exp $
X *
X * COPYRIGHT 1990
X * DIGITAL EQUIPMENT CORPORATION
X * MAYNARD, MASSACHUSETTS
X * ALL RIGHTS RESERVED.
X *
X * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
X * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
X * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE
X * FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED
X * WARRANTY.
X *
X * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
X * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
X * ADDITION TO THAT SET FORTH ABOVE.
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted, provided
X * that the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of Digital Equipment Corporation not be
X * used in advertising or publicity pertaining to distribution of the
X * software without specific, written prior permission.
X \*/
X
X#include "storage.h"
X
Xtypedef struct _ListRec *ListPtr;
Xtypedef Comparison (*ListSortFunc)(/* key1, key2 */);
X#define NullList ((ListPtr)NULL)
X#define NullListSortFunc ((ListSortFunc)NULL)
X
Xextern unsigned listDebug;
X
Xextern ListPtr lCreate(/* size, sortFunc, keyType, dataType */);
Xextern void lDestroy(/* pList */);
X
Xextern int lNItems(/* pList */);
X
Xextern Boolean lAdd(/* pList, key, data */);
Xextern Boolean lStore(/* pList, key, data */);
Xextern Boolean lRemove(/* pList, key */);
Xextern Boolean lRemoveAll(/* pList */);
Xextern Boolean lLookup(/* pList, key, pNItems, ppData */);
X
Xextern void lIterate(/* pList, pFunc, arg */);
X
Xextern Boolean _lInitIter(/* pList, ppData */);
Xextern Boolean _lIterNext(/* pList, pState, ppData */);
Xextern void lEndIterator(/* pList, state */);
X
X#define lIterator(l,k,d,s) \
X if (_lInitIter((l),&s)) \
X while (_lIterNext((l),&(s),(GenKey *)&(k),(GenData *)&(d)))
X
X#endif /* LIST_H */
END_OF_FILE
if test 2236 -ne `wc -c <'./utils/list.h'`; then
echo shar: \"'./utils/list.h'\" unpacked with wrong size!
fi
# end of './utils/list.h'
fi
if test -f './utils/machdep.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./utils/machdep.h'\"
else
echo shar: Extracting \"'./utils/machdep.h'\" \(2466 characters\)
sed "s/^X//" >'./utils/machdep.h' <<'END_OF_FILE'
X#ifndef MACHDEP_H
X#define MACHDEP_H 1
X
X /*\
X * $Header: machdep.h,v 5.1 90/01/11 17:32:57 erik Exp $
X *
X * COPYRIGHT 1990
X * DIGITAL EQUIPMENT CORPORATION
X * MAYNARD, MASSACHUSETTS
X * ALL RIGHTS RESERVED.
X *
X * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
X * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
X * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE
X * FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED
X * WARRANTY.
X *
X * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
X * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
X * ADDITION TO THAT SET FORTH ABOVE.
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted, provided
X * that the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of Digital Equipment Corporation not be
X * used in advertising or publicity pertaining to distribution of the
X * software without specific, written prior permission.
X \*/
X
X /*\
X * This has only been tested (recently) for VAXen and MIPSEL.
X * Any other definitions in this file are a best-shot, and provided
X * as a convenience. We'd appreciate it if you could send us mail
X * to give us correct values for any of these.
X \*/
X
X#define mdLSBFirst 0
X#define mdMSBFirst 1
X
X#if (defined vax)||(defined i386)
X
X#define mdByteOrder mdLSBFirst
X#define mdBitOrder mdLSBFirst
X#define mdIntSize 32
X#define mdHasAlloca 1
X
X#define MACHINE_KNOWN
X#endif
X
X#if (defined MIPSEL)||(defined sun)||(defined ibm032)||(defined apollo)
X
X#define mdByteOrder mdLSBFirst
X#define mdBitOrder mdLSBFirst
X#define mdIntSize 32
X#define mdHasAlloca 1
X
X#define MACHINE_KNOWN
X#endif
X
X#ifndef MACHINE_KNOWN
XERROR -- define your machine!!
X#endif /* MACHINE_KNOWN */
X
Xtypedef char mdINT8;
Xtypedef unsigned char mdCARD8;
X
X#if mdIntSize == 32
Xtypedef short mdINT16;
Xtypedef unsigned short mdCARD16;
Xtypedef int mdINT32;
Xtypedef unsigned int mdCARD32;
X#elif mdIntSize == 16
Xtypedef int mdINT16;
Xtypedef unsigned int mdCARD16;
Xtypedef long mdINT32;
Xtypedef unsigned long mdCARD32;
X#else
XERROR -- weird integer size
X#endif /* mdIntSize */
X
X#endif /* MACHDEP_H */
END_OF_FILE
if test 2466 -ne `wc -c <'./utils/machdep.h'`; then
echo shar: \"'./utils/machdep.h'\" unpacked with wrong size!
fi
# end of './utils/machdep.h'
fi
if test -f './utils/storage.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./utils/storage.h'\"
else
echo shar: Extracting \"'./utils/storage.h'\" \(2439 characters\)
sed "s/^X//" >'./utils/storage.h' <<'END_OF_FILE'
X#ifndef STORAGE_H
X#define STORAGE_H 1
X
X /*\
X * $Header: storage.h,v 5.0 90/01/10 06:51:17 erik Exp $
X *
X * COPYRIGHT 1990
X * DIGITAL EQUIPMENT CORPORATION
X * MAYNARD, MASSACHUSETTS
X * ALL RIGHTS RESERVED.
X *
X * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
X * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
X * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE
X * FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED
X * WARRANTY.
X *
X * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
X * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
X * ADDITION TO THAT SET FORTH ABOVE.
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted, provided
X * that the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of Digital Equipment Corporation not be
X * used in advertising or publicity pertaining to distribution of the
X * software without specific, written prior permission.
X \*/
X
X /*\
X * Declarations for generic storage structure keys and
X * data.
X \*/
X
Xtypedef unsigned long GenKey;
Xtypedef unsigned long GenData;
X
Xtypedef int (*HashFunc)(/* key */);
Xtypedef GenKey (*KeyConvertFunc)(/* oldKey */);
Xtypedef GenData (*DataConvertFunc)(/* oldData */);
Xtypedef Boolean (*GenIterFunc)(/* key, data, arg */);
X
Xtypedef struct _GenKeyDescRec *GenKeyDescPtr;
Xtypedef struct _GenDataDescRec *GenDataDescPtr;
X
X#define NullGenKeyDesc ((GenKeyDescPtr)NULL)
X#define NullGenDataDesc ((GenDataDescPtr)NULL)
X
Xextern int genHashString(/* key */);
Xextern GenKey genReplaceStringData(/* oldData */);
Xextern GenData genDupStringData(/* data */);
Xextern Comparison genCompareStringKey(/* key1, key2 */);
X
Xextern GenKeyDescPtr genStringKeyType;
Xextern GenKeyDescPtr genFreedStringKeyType;
Xextern GenKeyDescPtr genIntegerKeyType;
Xextern GenKeyDescPtr genDefaultKeyType;
X
Xextern GenDataDescPtr genFreedStringDataType;
Xextern GenDataDescPtr genPointerDataType;
Xextern GenDataDescPtr genFreedPointerDataType;
Xextern GenDataDescPtr genIntegerDataType;
Xextern GenDataDescPtr genDefaultDataType;
X
X#endif /* ifndef STORAGE_H */
END_OF_FILE
if test 2439 -ne `wc -c <'./utils/storage.h'`; then
echo shar: \"'./utils/storage.h'\" unpacked with wrong size!
fi
# end of './utils/storage.h'
fi
if test -f './utils/storagestr.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./utils/storagestr.h'\"
else
echo shar: Extracting \"'./utils/storagestr.h'\" \(2607 characters\)
sed "s/^X//" >'./utils/storagestr.h' <<'END_OF_FILE'
X#ifndef STORAGESTR_H
X#define STORAGESTR_H 1
X
X /*\
X * $Header: storagestr.h,v 5.0 90/01/10 06:51:20 erik Exp $
X *
X * COPYRIGHT 1990
X * DIGITAL EQUIPMENT CORPORATION
X * MAYNARD, MASSACHUSETTS
X * ALL RIGHTS RESERVED.
X *
X * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
X * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
X * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE
X * FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED
X * WARRANTY.
X *
X * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
X * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
X * ADDITION TO THAT SET FORTH ABOVE.
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted, provided
X * that the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of Digital Equipment Corporation not be
X * used in advertising or publicity pertaining to distribution of the
X * software without specific, written prior permission.
X \*/
X
X#include "storage.h"
X
Xtypedef Comparison (*CompareKeyFunc)(/* key1, key2 */);
Xtypedef GenKey (*StoreKeyFunc)(/* key */);
Xtypedef void (*RemoveKeyFunc)(/* key */);
Xtypedef GenData (*StoreDataFunc)(/* data */);
Xtypedef GenData (*ReplaceDataFunc)(/* newData, oldData */);
Xtypedef GenData (*RemoveDataFunc)(/* data */);
Xtypedef Boolean (*StorageIterateFunc)(/* key, pData, arg */);
X
Xtypedef struct _GenKeyDescRec {
X HashFunc dfltHash;
X CompareKeyFunc compare;
X StoreKeyFunc store;
X RemoveKeyFunc remove;
X GenKey null;
X} GenKeyDescRec;
X
Xtypedef struct _GenDataDescRec {
X StoreDataFunc store;
X ReplaceDataFunc replace;
X RemoveDataFunc remove;
X GenData null;
X} GenDataDescRec;
X
X#define _genCompareKey(pkt,k1,k2) \
X ((pkt)->compare?(*(pkt)->compare)((k1),(k2)):\
X ((k1)>(k2)?Greater:((k1)<(k2)?Less:Equal)))
X#define _genStoreKey(pkt,k) ((pkt)->store?(*(pkt)->store)(k):(k))
X#define _genRemoveKey(pkt,k) { if ((pkt)->remove) (*(pkt)->remove)(k); }
X#define _genNullKey(pkt) ((pkt)->null)
X
X#define _genStoreData(pdt,d) ((pdt)->store?(*(pdt)->store)(d):(d))
X#define _genReplaceData(pdt,nd,pod) \
X ((pdt)->replace?(*(pdt)->replace)((nd),(pod)):\
X (nd))
X#define _genRemoveData(pdt,d) ((pdt)->remove?(*(pdt)->remove)((d)):(d))
X#define _genNullData(pdt) ((pdt)->null)
X
X#endif
END_OF_FILE
if test 2607 -ne `wc -c <'./utils/storagestr.h'`; then
echo shar: \"'./utils/storagestr.h'\" unpacked with wrong size!
fi
# end of './utils/storagestr.h'
fi
if test -f './wallpaper/wallpaper.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./wallpaper/wallpaper.c'\"
else
echo shar: Extracting \"'./wallpaper/wallpaper.c'\" \(4061 characters\)
sed "s/^X//" >'./wallpaper/wallpaper.c' <<'END_OF_FILE'
X#define MAXROOMS 100
X
X /*\
X * $Header: wallpaper.c,v 5.0 90/01/10 07:05:05 erik Exp $
X *
X * COPYRIGHT 1990
X * DIGITAL EQUIPMENT CORPORATION
X * MAYNARD, MASSACHUSETTS
X * ALL RIGHTS RESERVED.
X *
X * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
X * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
X * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE
X * FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED
X * WARRANTY.
X *
X * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
X * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
X * ADDITION TO THAT SET FORTH ABOVE.
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted, provided
X * that the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of Digital Equipment Corporation not be
X * used in advertising or publicity pertaining to distribution of the
X * software without specific, written prior permission.
X \*/
X
X#include <stdio.h>
X#include <strings.h>
X#include <malloc.h>
X#include <X11/Xlib.h>
X
Xtypedef struct _RoomInfoRec {
X char *name;
X Atom atom;
X char *cmd;
X} RoomInfoRec, *RoomInfo;
X
XDisplay *dpy;
XRoomInfoRec rooms[MAXROOMS];
Xint numrooms = 0;
XAtom ROOMS_CURRENT;
X
XPunt(str)
X char *str;
X{
X fprintf(stderr, "%s\n", str);
X exit(1);
X}
X
Xchar *MallocACopy(str)
X char *str;
X{
X return strcpy(malloc((unsigned) strlen(str)+1),str);
X}
X
Xmain(argc, argv)
X int argc;
X char **argv;
X{
X char homeDir[512], buf[1024], *ptr, *ptr2;
X char *displayname = NULL;
X XEvent event;
X int i;
X FILE *fid;
X Atom oldroom, curroom;
X Atom actualtype;
X unsigned long actualformat, nitems, bytesafter;
X char *propreturn = NULL;
X
X
X for (i=1 ; i<argc ; i++) {
X if (argv[i][0] == '-' && argv[i][1] == 'd' && i < argc - 1) {
X displayname = argv[++i];
X } else {
X Punt("Usage: wallpaper [-display displayname]\n");
X }
X }
X
X strcpy(homeDir, getenv("HOME"));
X (void) sprintf(buf, "%s/.wallpaperrc", homeDir);
X fid = fopen(buf, "r");
X if (!fid)
X Punt(".wallpaperrc not found!\n");
X
X dpy = XOpenDisplay(displayname);
X if (!dpy)
X Punt("Can't open display!");
X displayname = DisplayString(dpy);
X
X while (fgets(buf, 1024, fid)) {
X ptr = index(buf, '\n');
X if (ptr) *ptr = 0;
X for (ptr = buf ; *ptr ; ptr++) {
X if (*ptr == ' ' || *ptr == '\t') break;
X }
X if (*ptr == 0) continue;
X *ptr++ = 0;
X rooms[numrooms].name = MallocACopy(buf);
X while (*ptr == ' ' || *ptr == '\t') ptr++;
X if (*ptr == 0) continue;
X if (!index(ptr, '$')) {
X rooms[numrooms].cmd = MallocACopy(ptr);
X } else {
X rooms[numrooms].cmd =
X malloc(strlen(ptr) + 5 * strlen(displayname));
X rooms[numrooms].cmd[0] = 0;
X ptr2 = index(ptr, '$');
X while (ptr2) {
X *ptr2++ = 0;
X strcat(rooms[numrooms].cmd, ptr);
X if (strncmp(ptr2, "DISPLAY", 7) == 0) {
X strcat(rooms[numrooms].cmd, displayname);
X ptr2 += 7;
X }
X ptr = ptr2;
X ptr2 = index(ptr, '$');
X }
X strcat(rooms[numrooms].cmd, ptr);
X }
X rooms[numrooms].atom = XInternAtom(dpy, rooms[numrooms].name, False);
X numrooms++;
X }
X (void) fclose(fid);
X
X XSelectInput(dpy, DefaultRootWindow(dpy), PropertyChangeMask);
X
X ROOMS_CURRENT = XInternAtom(dpy, "_XROOMS_CURRENT", False);
X
X oldroom = 0;
X for (;;) {
X if (XGetWindowProperty(dpy, DefaultRootWindow(dpy), ROOMS_CURRENT, 0,
X 1, False, AnyPropertyType, &actualtype,
X &actualformat, &nitems, &bytesafter,
X &propreturn) == Success) {
X curroom = *((Atom *) propreturn);
X if (curroom != oldroom) {
X for (i=0 ; i<numrooms ; i++) {
X if (rooms[i].atom == curroom) {
X system(rooms[i].cmd);
X break;
X }
X }
X oldroom = curroom;
X }
X }
X XNextEvent(dpy, &event);
X }
X}
END_OF_FILE
if test 4061 -ne `wc -c <'./wallpaper/wallpaper.c'`; then
echo shar: \"'./wallpaper/wallpaper.c'\" unpacked with wrong size!
fi
# end of './wallpaper/wallpaper.c'
fi
if test -f './xrooms/xrApp.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./xrooms/xrApp.h'\"
else
echo shar: Extracting \"'./xrooms/xrApp.h'\" \(3948 characters\)
sed "s/^X//" >'./xrooms/xrApp.h' <<'END_OF_FILE'
X#ifndef XRAPP_H
X#define XRAPP_H 1
X
X /*\
X * $Header: xrApp.h,v 5.1 90/01/11 14:09:55 erik Exp $
X *
X * COPYRIGHT 1990
X * DIGITAL EQUIPMENT CORPORATION
X * MAYNARD, MASSACHUSETTS
X * ALL RIGHTS RESERVED.
X *
X * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
X * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
X * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE
X * FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED
X * WARRANTY.
X *
X * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
X * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
X * ADDITION TO THAT SET FORTH ABOVE.
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted, provided
X * that the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of Digital Equipment Corporation not be
X * used in advertising or publicity pertaining to distribution of the
X * software without specific, written prior permission.
X \*/
X
X#include "app.h"
X
Xtypedef struct _XAppInfoRec {
X Window parent,client;
X AppStatePtr pRealState;
X struct {
X unsigned flags;
X WinState state;
X int x,y;
X unsigned w,h;
X } wants;
X} XAppInfoRec, *XAppInfoPtr;
X#define NullXAppInfo ((XAppInfoPtr)NULL)
X
X#define StateFlag (1<<0)
X#define XFlag (1<<1)
X#define YFlag (1<<2)
X#define WidthFlag (1<<3)
X#define HeightFlag (1<<4)
X#define PositionFlags (XFlag|YFlag)
X#define SizeFlags (WidthFlag|HeightFlag)
X#define GeomFlags (PositionFlags|SizeFlags)
X#define AllFlags (StateFlag|GeomFlags)
X
X#define SetOn(ai,f) ((ai)->wants.flags|=(f))
X#define SetOff(ai,f) ((ai)->wants.flags&=(~(f)))
X#define On(ai,f) ((ai)->wants.flags&(f))
X
X#define WantsState(ai,s) (On(ai,StateFlag)&&((ai)->wants.state==(s)))
X#define WantsX(ai,xv) (On(ai,XFlag)&&((ai)->wants.x==(xv)))
X#define WantsY(ai,yv) (On(ai,YFlag)&&((ai)->wants.y==(yv)))
X#define WantsWidth(ai,wv) (On(ai,WidthFlag)&&((ai)->wants.w==(wv)))
X#define WantsHeight(ai,hv) (On(ai,HeightFlag)&&((ai)->wants.h==(hv)))
X#define WantsAny(ai) ((ai)->wants.flags&AllFlags!=0)
X
X#define SetWantsState(ai,s) (SetOn(ai,StateFlag),(ai)->wants.state=(s))
X#define SetWantsX(ai,xv) (SetOn(ai,XFlag),(ai)->wants.x=(xv))
X#define SetWantsY(ai,yv) (SetOn(ai,YFlag),(ai)->wants.y=(yv))
X#define SetWantsWidth(ai,wv) (SetOn(ai,WidthFlag),(ai)->wants.w=(wv))
X#define SetWantsHeight(ai,hv) (SetOn(ai,HeightFlag),(ai)->wants.h=(hv))
X#define SetWantsNone(ai) ((ai)->wants.flags= 0)
X#define SetWantsPos(ai,xv,yv) (SetOn(ai,PositionFlags),(ai)->wants.x=(xv),\
X (ai)->wants.y=(yv))
X#define SetWantsSize(ai,wv,hv) (SetOn(ai,SizeFlags),(ai)->wants.w=(wv),\
X (ai)->wants.h=(hv))
X
X#define GotState(ai) (SetOff(ai,StateFlag))
X#define GotX(ai) (SetOff(ai,XFlag))
X#define GotY(ai) (SetOff(ai,YFlag))
X#define GotWidth(ai) (SetOff(ai,WidthFlag))
X#define GotHeight(ai) (SetOff(ai,HeightFlag))
X
Xextern unsigned xrAppDebug;
Xextern void xraDebugPrint();
X
Xextern Boolean xraNonICCCM;
Xextern Boolean xraDfltAppsIconic;
Xextern Boolean xraDfltAppsTransient;
Xextern Boolean xraUseGeometries;
Xextern Boolean xraReopenForGeom;
Xextern Boolean xraUnmapForGeom,xraUnmapForState;
Xextern Boolean xraManageTransients;
Xextern Boolean xraManageWithdrawn;
X
Xextern AppPtr xraLookupWindowApp(/*win*/);
X
Xextern Boolean xraNonICCCMAppUpdate(/*pApp,pNewState,priv*/);
Xextern Boolean xraAppUpdate(/*pApp,pNewState,priv*/);
X
Xextern void xraAddApp(/*window*/);
X
Xextern void xraClientResized(/*client,newW,newH*/);
Xextern void xraClientMoved(/*client,newX,newY*/);
Xextern void xraClientDestroyed(/*client*/);
Xextern void xraStateChanged(/*client*/);
Xextern void xraInit();
X#endif /* XRAPP_H */
END_OF_FILE
if test 3948 -ne `wc -c <'./xrooms/xrApp.h'`; then
echo shar: \"'./xrooms/xrApp.h'\" unpacked with wrong size!
fi
# end of './xrooms/xrApp.h'
fi
if test -f './xrooms/xrGen.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./xrooms/xrGen.c'\"
else
echo shar: Extracting \"'./xrooms/xrGen.c'\" \(2310 characters\)
sed "s/^X//" >'./xrooms/xrGen.c' <<'END_OF_FILE'
X
X /*\
X * $Header: xrGen.c,v 5.0 90/01/10 07:00:50 erik Exp $
X *
X * COPYRIGHT 1990
X * DIGITAL EQUIPMENT CORPORATION
X * MAYNARD, MASSACHUSETTS
X * ALL RIGHTS RESERVED.
X *
X * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
X * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
X * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE
X * FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED
X * WARRANTY.
X *
X * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
X * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
X * ADDITION TO THAT SET FORTH ABOVE.
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted, provided
X * that the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of Digital Equipment Corporation not be
X * used in advertising or publicity pertaining to distribution of the
X * software without specific, written prior permission.
X \*/
X
X#define DEBUG_VAR xrgenDebug
X#include "utils.h"
X
X#undef True
X#undef False
X#include "xrGen.h"
X
XAtom ROOMS_CURRENT, ROOMS_ALL;
XAtom ROOMS_REQUEST, ROOMS_ARGUMENT, ROOMS_RETURN;
X
X/***====================================================================***/
X
Xvoid
XxrgenInit(dpy)
XDisplay *dpy;
X{
X uENTRY1("xrgenInit(0x%x)\n",dpy);
X ROOMS_ALL= XInternAtom(dpy, "_XROOMS_ALL", False );
X ROOMS_CURRENT= XInternAtom(dpy, "_XROOMS_CURRENT", False );
X ROOMS_REQUEST= XInternAtom(dpy, "_XROOMS_REQUESTS", False );
X ROOMS_ARGUMENT= XInternAtom(dpy, "_XROOMS_ARGUMENT", False );
X ROOMS_RETURN= XInternAtom(dpy, "_XROOMS_RETURN", False );
X uVOIDRETURN;
X}
X
X/***====================================================================***/
X
Xvoid
XxrgenCleanUp(dpy,root)
XDisplay *dpy;
XWindow root;
X{
X uENTRY2("xrgenCleanUp(0x%x,0x%x)\n",dpy,root);
X XDeleteProperty(dpy,root,ROOMS_ALL);
X XDeleteProperty(dpy,root,ROOMS_CURRENT);
X XDeleteProperty(dpy,root,ROOMS_REQUEST);
X XDeleteProperty(dpy,root,ROOMS_ARGUMENT);
X uVOIDRETURN;
X}
END_OF_FILE
if test 2310 -ne `wc -c <'./xrooms/xrGen.c'`; then
echo shar: \"'./xrooms/xrGen.c'\" unpacked with wrong size!
fi
# end of './xrooms/xrGen.c'
fi
if test -f './xrooms/xrProtoIter.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./xrooms/xrProtoIter.h'\"
else
echo shar: Extracting \"'./xrooms/xrProtoIter.h'\" \(2290 characters\)
sed "s/^X//" >'./xrooms/xrProtoIter.h' <<'END_OF_FILE'
X#ifndef XRPROTOITER_H
X#define XRPROTOITER_H 1
X
X /*\
X * $Header: xrProtoIter.h,v 5.0 90/01/10 07:01:29 erik Exp $
X *
X * COPYRIGHT 1990
X * DIGITAL EQUIPMENT CORPORATION
X * MAYNARD, MASSACHUSETTS
X * ALL RIGHTS RESERVED.
X *
X * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
X * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
X * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE
X * FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED
X * WARRANTY.
X *
X * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
X * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
X * ADDITION TO THAT SET FORTH ABOVE.
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted, provided
X * that the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of Digital Equipment Corporation not be
X * used in advertising or publicity pertaining to distribution of the
X * software without specific, written prior permission.
X \*/
X
Xextern Boolean _xrpiInitAppStatesIter(/* pApp, pRoom, whichStates, pIState */);
Xextern Boolean _xrpiAppStatesIterNext(/* pIState, pApp, ppState */);
Xextern void xrpiEndAppStatesIterator(/* pApp, pIState */);
X#define xrpiAppStatesIterator(pa,pr,ws,ps,is) \
X if (_xrpiInitAppStatesIter(pa,pr,ws,&is)) \
X while (_xrpiAppStatesIterNext(is,pa,&(ps)))
X
Xextern Boolean _xrpiInitAppsIter(/* whichApps, pIState, nameOrId */);
Xextern Boolean _xrpiAppsIterNext(/* pIState, ppApp */);
Xextern void xrpiEndAppsIterator(/* pIState */);
X#define xrpiAppsIterator(ws,pa,NorId,is) \
X if (_xrpiInitAppsIter(ws,NorId,&is)) \
X while (_xrpiAppsIterNext(is,&(pa)))
X
Xextern Boolean _xrpiInitRoomsIter(/* whichRooms, pIState, name */);
Xextern Boolean _xrpiRoomsIterNext(/* pIState, ppRoom */);
Xextern void xrpiEndRoomsIterator(/* pIState */);
X#define xrpiRoomsIterator(ws,pr,nm,is) \
X if (_xrpiInitRoomsIter(ws,nm,&is)) \
X while (_xrpiRoomsIterNext(is,&(pr)))
X
X#endif /* XRPROTOITER_H */
END_OF_FILE
if test 2290 -ne `wc -c <'./xrooms/xrProtoIter.h'`; then
echo shar: \"'./xrooms/xrProtoIter.h'\" unpacked with wrong size!
fi
# end of './xrooms/xrProtoIter.h'
fi
if test -f './xrooms/xrXawUI.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./xrooms/xrXawUI.h'\"
else
echo shar: Extracting \"'./xrooms/xrXawUI.h'\" \(2099 characters\)
sed "s/^X//" >'./xrooms/xrXawUI.h' <<'END_OF_FILE'
X#ifndef XRXAWUI_H
X#define XRXAWUI_H 1
X
X /*\
X * $Header: xrXawUI.h,v 5.0 90/01/10 07:01:56 erik Exp $
X *
X * COPYRIGHT 1990
X * DIGITAL EQUIPMENT CORPORATION
X * MAYNARD, MASSACHUSETTS
X * ALL RIGHTS RESERVED.
X *
X * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
X * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
X * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE
X * FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED
X * WARRANTY.
X *
X * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
X * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
X * ADDITION TO THAT SET FORTH ABOVE.
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted, provided
X * that the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of Digital Equipment Corporation not be
X * used in advertising or publicity pertaining to distribution of the
X * software without specific, written prior permission.
X \*/
X
Xextern Widget xruiTopLevel,xruiPopup,xruiMenu,xruiWinMenu;
Xextern Widget xruiPromptWidget;
Xextern Widget xruiPromptText;
X
Xextern Widget xruiScrollW;
X
Xextern unsigned xawButtonWidth;
Xextern unsigned xawButtonCols;
X
X#define UI_ARGS \
X {"-btnwidth", "buttonWidth", XrmoptionSepArg, (caddr_t)0 },\
X {"-btncols", "buttonCols", XrmoptionSepArg, (caddr_t)0 },
X
X#define UI_FIELDS \
X unsigned xawButtonWidth,xawButtonCols;
X
X#define UI_RESOURCES(t) \
X { "buttonWidth", "Width", XtRInt, sizeof(int),\
X XtOffset(t,xawButtonWidth), XtRImmediate, (caddr_t)0 },\
X { "buttonCols", "ButtonCols", XtRInt, sizeof(int),\
X XtOffset(t,xawButtonCols), XtRImmediate, (caddr_t)4 },
X
X#define UI_SETTINGS(s) \
X xawButtonWidth= (s)->xawButtonWidth;\
X xawButtonCols= (s)->xawButtonCols;
X
X#endif /* XRXAWUI_H */
END_OF_FILE
if test 2099 -ne `wc -c <'./xrooms/xrXawUI.h'`; then
echo shar: \"'./xrooms/xrXawUI.h'\" unpacked with wrong size!
fi
# end of './xrooms/xrXawUI.h'
fi
echo shar: End of archive 2 \(of 14\).
cp /dev/null ark2isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked all 14 archives.
rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
echo You still need to unpack the following archives:
echo " " ${MISSING}
fi
## End of shell archive.
exit 0
More information about the Comp.sources.x
mailing list