sdo@soliado.East.Sun.COM (Scott Oaks - Sun Consulting NYC) (04/29/91)
Submitted-by: sdo@soliado.East.Sun.COM (Scott Oaks - Sun Consulting NYC) Posting-number: Volume 12, Issue 57 Archive-name: olvwm/part01 Moderator's note: This is olvwm -- the open look virtual window manager. The author modeled this after Tom's [LaStrange] virtual window manager, altho it doesn't have any of its code and does not do some of its functionality. However, its design is "admirable" because it doesn't replace the root window, it actually "moves" windows around on the original root. This is really convenient for those of us who don't want that root window messed with. Despite this implementation, you really get the feeling of a virtual root window. [I like it.] The drawbacks are that you must have libolgx.a, the open look graphics library, in order to get the program to compile. Thus, you may have to go elsewhere to get it. Folks who are already using the open windows desktop from sun already have this, so compiling won't be a headache. Otherwise, you're on your own (don't mail me for it :-). The "Makefile" that comes with it works, but you'll have to add resources1.[co] to the SRCS and OBJS lists or you won't be able to link. Also, the XVDESTDIR setting at the top will have to be changed for your local site. Of course, the Imakefile should take care of much of this, but this should give you a head start if you have problems. #! /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 1 (of 16)." # Contents: Debug.c Imakefile Makefile.sunpro PROGRAMMERS_NOTES README # WinInfo.c atom.c defaults.h events.h globals.h group.h # iconbitmap.h list.c list.h mem.c mem.h menu.h notice.h olcursor.h # olwm.h patchlevel.h resources.h slots.h st.h usleep.c vdm.icon # Wrapped by sdo@piccolo on Fri Apr 26 17:31:01 1991 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'Debug.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Debug.c'\" else echo shar: Extracting \"'Debug.c'\" \(1572 characters\) sed "s/^X//" >'Debug.c' <<'END_OF_FILE' X/* X * (c) Copyright 1989 Sun Microsystems, Inc. Sun design patents X * pending in the U.S. and foreign countries. See LEGAL_NOTICE X * file for terms of the license. X * X * Written for Sun Microsystems by Crucible, Santa Cruz, CA. X */ X static char sccsid[] = "@(#) Debug.c 25.2 90/05/21 Crucible"; X#include <errno.h> X#include <stdio.h> X#include <X11/Xos.h> X#include <X11/Xlib.h> X#include <X11/Xutil.h> X X#include "olwm.h" X#include "win.h" X char *eventNames[] = { X "<EventZero>", X "<EventOne>", X "KeyPress", X "KeyRelease", X "ButtonPress", X "ButtonRelease", X "MotionNotify", X "EnterNotify", X "LeaveNotify", X "FocusIn", X "FocusOut", X "KeymapNotify", X "Expose", X "GraphicsExpose", X "NoExpose", X "VisibilityNotify", X "CreateNotify", X "DestroyNotify", X "UnmapNotify", X "MapNotify", X "MapRequest", X "ReparentNotify", X "ConfigureNotify", X "ConfigureRequest", X "GravityNotify", X "ResizeRequest", X "CirculateNotify", X "CirculateRequest", X "PropertyNotify", X "SelectionClear", X "SelectionRequest", X "SelectionNotify", X "ColormapNotify", X "ClientMessage", X "MappingNotify", X}; X DebugEvent(ep, str) X XEvent *ep; X char *str; X{ X fprintf(stderr, "%s:%s - ", str, eventNames[ep->type]); X fflush(stderr); X} X static char *typeNames[] = { X "Frame", X "Icon", X "Resize", X "Pushpin", X "Button", X "Pane", X "IconPane", X "Colormap", X "Menu", X "NoFocus", X "Root", X "Busy", X}; X DebugWindow(win) WinGeneric *win; X{ X if (win == NULL) X fprintf(stderr, "other window - "); X else X fprintf(stderr, "win %x (self %d) %s - ",win,win->core.self, X typeNames[win->core.kind]); X fflush(stderr); X} END_OF_FILE if test 1572 -ne `wc -c <'Debug.c'`; then echo shar: \"'Debug.c'\" unpacked with wrong size! fi # end of 'Debug.c' fi if test -f 'Imakefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Imakefile'\" else echo shar: Extracting \"'Imakefile'\" \(1647 characters\) sed "s/^X//" >'Imakefile' <<'END_OF_FILE' X#include <XView.tmpl> X X/**/######################################################################### X/**/# @(#)Imakefile 25.3 90/07/17 SMI X/**/# Imakefile for olwm release 2.0. X DEFINES = INCLUDES = -I$(HEADER_DEST) -I$(TOP) SYS_LIBRARIES = -lm DEPLIBS = LOCAL_LIBRARIES = $(OLGXLIB) $(XLIB) X HEADERS = \ X defaults.h events.h globals.h group.h list.h mem.h menu.h notice.h \ X olcursor.h olwm.h resources.h slots.h st.h win.h X INFOFILES = MANPAGES = olvwm.man BITMAPS = iconbitmap.h vdm.icon SCRIPTS = MISC = openwin-menu X SRCS = \ X Debug.c Notice.c Error.c \ X InitGraphics.c RubberWin.c Select.c WinInfo.c \ X atom.c client.c defaults.c events.c group.c list.c \ X mem.c menu.c olwm.c resources.c services.c slots.c st.c states.c \ X usermenu.c usleep.c win.c winbusy.c winbutton.c wincolor.c \ X winframe.c wingframe.c winicon.c winipane.c winmenu.c \ X winnofoc.c winpane.c winpush.c winresize.c winroot.c \ X virtual.c resources1.c X OBJS = \ X Debug.o Notice.o Error.o \ X InitGraphics.o RubberWin.o Select.o WinInfo.o \ X atom.o client.o defaults.o events.o group.o list.o \ X mem.o menu.o olwm.o resources.o services.o slots.o st.o states.o \ X usermenu.o usleep.o win.o winbusy.o winbutton.o wincolor.o \ X winframe.o wingframe.o winicon.o winipane.o winmenu.o \ X winnofoc.o winpane.o winpush.o winresize.o winroot.o \ X virtual.o X ALLFILES = \ X ${HEADERS} ${BITMAPS} ${SRCS} \ X ${MISC} ${INFOFILES} ${MANPAGES} ${SCRIPTS} X ComplexProgramTarget(olvwm) X InstallNonExecList($(MISC),$(LIBRARY_DEST)) X InstallManPage($(MANPAGES),$(MANDIR)) X X#include <XView.prog> END_OF_FILE if test 1647 -ne `wc -c <'Imakefile'`; then echo shar: \"'Imakefile'\" unpacked with wrong size! fi # end of 'Imakefile' fi if test -f 'Makefile.sunpro' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Makefile.sunpro'\" else echo shar: Extracting \"'Makefile.sunpro'\" \(625 characters\) sed "s/^X//" >'Makefile.sunpro' <<'END_OF_FILE' X.KEEP_STATE: X DEBUG = -O CFLAGS = ${DEBUG} -I${OPENWINHOME}/include LDFLAGS = -L${OPENWINHOME}/lib ${DEBUG} LIBS = -lolgx -lX11 -lm X SOURCES = Debug.c Error.c InitGraphics.c Notice.c RubberWin.c Select.c \ X WinInfo.c atom.c client.c defaults.c events.c group.c \ X list.c mem.c menu.c olwm.c resources.c services.c slots.c st.c \ X states.c usermenu.c usleep.c virtual.c win.c winbusy.c winbutton.c \ X wincolor.c winframe.c wingframe.c winicon.c winipane.c winmenu.c \ X winnofoc.c winpane.c winpush.c winresize.c winroot.c resources1.c X OBJECTS = $(SOURCES:.c=.o) X olvwm : $(OBJECTS) X cc -o olvwm $(LDFLAGS) $(OBJECTS) $(LIBS) END_OF_FILE if test 625 -ne `wc -c <'Makefile.sunpro'`; then echo shar: \"'Makefile.sunpro'\" unpacked with wrong size! fi # end of 'Makefile.sunpro' fi if test -f 'PROGRAMMERS_NOTES' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'PROGRAMMERS_NOTES'\" else echo shar: Extracting \"'PROGRAMMERS_NOTES'\" \(1373 characters\) sed "s/^X//" >'PROGRAMMERS_NOTES' <<'END_OF_FILE' This takes the concepts from tvtwm, but a lot of the programming is pretty different. In particular, the two programs have a very different idea of what the virtual desktop window is. X In order to fix problems with the filemanager and other applications that need to get to the root window, there is no virtual window which is the parent of the window frames like in tvtwm. Instead, everything is still just a child of the root window. Scrolling the desktop means telling the server to move all the windows. [This isn't as bad as it sounds -- it means the server has to do some more work to update its internal data structures. But there is still only one message to the server, and no matter which way the virtual desktop is implemented, every client has to get a configure message anyway, so the net result doesn't seem to be any different.] X Most everything having to do with the virtual desktop can be found in virtual.c; there are some references throughout the rest of the code to some of the globals there (like the VDM window, which shows up a lot) but I tried to keep these to a minimum. Someday I'll sit down and actually design this, now that I understand how it works, to structure that a little better. X Please send changes and bug fixes to scott.oaks@east.sun.com so that he can maintain everyone's additions/fixes. X I have not tested the X11 makefile. END_OF_FILE if test 1373 -ne `wc -c <'PROGRAMMERS_NOTES'`; then echo shar: \"'PROGRAMMERS_NOTES'\" unpacked with wrong size! fi # end of 'PROGRAMMERS_NOTES' fi if test -f 'README' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'README'\" else echo shar: Extracting \"'README'\" \(1635 characters\) sed "s/^X//" >'README' <<'END_OF_FILE' This is an OPENLOOK virtual window manager, modeled after tvtwm but one which implements the same look and feel as olwm. X To run this window manager, simply install it somewhere in your path and change your .xinitrc file to execute olvwm instead of olwm. The default values for all the olvwm resources are good enough to get you started, but you can read the enclosed man page for more information about how to change the desktop size, etc. X I wrote this because I really like the look and feel of OPENLOOK, and I was continually frustrated by XView/OPENLOOK applications which expected certain things from the window manager. If you are a big fan of tvtwm (especially all the configurability of tvtwm, most of which is missing here), you should probably stick with tvtwm. X This software is not supported by Sun Microsystems through any means whatsoever. However, its author would appreciate hearing any comments via e-mail to scott.oaks@east.sun.com. If you make additions to or corrections of this code, please send the new code (or diffs) to me and I will try to include them in later versions. X olvwm is compatible with and X11R4 server (though it's only been tested on Sun OPENWINDOWS 2.0 and the Sun X11R4 MIT server). It should run on Sun's OPENWINDOWS 3.0-beta (if you're lucky enough to be a beta site) but it does not manage NeWS windows in any OPENWINDOWS release. X Please read the LEGAL_NOTICE for information about distributing this code. X To compile this code, either use imake to generate a Makefile (requires an installation of the XView code from contrib) or use the Makefile.sunpro X(ie make -f Makefile.sunpro). END_OF_FILE if test 1635 -ne `wc -c <'README'`; then echo shar: \"'README'\" unpacked with wrong size! fi # end of 'README' fi if test -f 'WinInfo.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'WinInfo.c'\" else echo shar: Extracting \"'WinInfo.c'\" \(2031 characters\) sed "s/^X//" >'WinInfo.c' <<'END_OF_FILE' X/* X * (c) Copyright 1989 Sun Microsystems, Inc. Sun design patents X * pending in the U.S. and foreign countries. See LEGAL_NOTICE X * file for terms of the license. X * X * Written for Sun Microsystems by Crucible, Santa Cruz, CA. X */ X static char sccsid[] = "@(#) WinInfo.c 25.3 90/05/20 Crucible"; X#include <errno.h> X#include <stdio.h> X#include <memory.h> X#include <X11/Xos.h> X#include <X11/Xlib.h> X#include <X11/Xutil.h> X#include <X11/Xatom.h> X X#include "olwm.h" X#include "win.h" X#include "st.h" X#include "mem.h" X st_table *wiHashTable; X static int wiCompare( w1, w2 ) register char *w1, *w2; X{ X return ((Window)w1) - ((Window)w2); X} X static int wiHash( w1, modulus ) X register char *w1; X register int modulus; X{ X return ((Window)w1) % modulus; X} X X/* X * initialize the hash tables X * returns: True - success X * False - failure X */ X/*ARGSUSED*/ /* dpy arg will be used when multiple Displays supported */ WIInit( dpy ) Display *dpy; X{ X wiHashTable = st_init_table(wiCompare, wiHash); X} X X/* X * Save window information with the associated window, for later dispatch X */ void WIInstallInfo(info) WinGeneric *info; X{ X if (WIGetInfo(info->core.self) != NULL) X { X ErrorGeneral("Tried to duplicate-register a window -- bailing"); X } X st_insert(wiHashTable, (int)info->core.self, (char *)info); X} X X/* X * delete storage for window information X * returns: True - window entry deleted X * False - window entry not found X */ Bool WIUninstallInfo(win) Window win; X{ X WinGeneric *oldInfo; X Window tmpWin = win; X Window *tmpWinPtr = &tmpWin; X X return (st_delete(wiHashTable, (char *)tmpWinPtr, (char *)&oldInfo)); X} X X/* X * retrieve information associated with a window X * returns: Pointer to WinGeneric struct if window is found X * NULL if not found X */ WinGeneric * WIGetInfo(win) Window win; X{ X WinGeneric *winInfo = NULL; X X st_lookup(wiHashTable, win, &winInfo); X return winInfo; X} X X/* X * apply a function to all windows X */ void WIApply(f,c) enum st_retval (*f)(); void *c; X{ X st_foreach(wiHashTable, f, c); X} END_OF_FILE if test 2031 -ne `wc -c <'WinInfo.c'`; then echo shar: \"'WinInfo.c'\" unpacked with wrong size! fi # end of 'WinInfo.c' fi if test -f 'atom.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'atom.c'\" else echo shar: Extracting \"'atom.c'\" \(2087 characters\) sed "s/^X//" >'atom.c' <<'END_OF_FILE' X/* X * (c) Copyright 1990 Sun Microsystems, Inc. Sun design patents X * pending in the U.S. and foreign countries. See LEGAL_NOTICE X * file for terms of the license. X * X * Written for Sun Microsystems by Crucible, Santa Cruz, CA. X */ X static char sccsid[] = "@(#) atom.c 25.4 90/05/23 Crucible"; X X#include <X11/Xlib.h> X#include <X11/Xatom.h> X#include <X11/Xresource.h> X Atom AtomChangeState; Atom AtomColorMapWindows; Atom AtomDecorAdd; Atom AtomDecorClose; Atom AtomDecorDelete; Atom AtomDecorFooter; Atom AtomDecorHeader; Atom AtomDecorPin; Atom AtomDecorResize; Atom AtomDeleteWindow; Atom AtomLeftFooter; Atom AtomLength; Atom AtomListLength; Atom AtomMenuFull; Atom AtomMenuLimited; Atom AtomMultiple; Atom AtomNone; Atom AtomOlwmTimestamp; Atom AtomPinIn; Atom AtomPinOut; Atom AtomProtocols; Atom AtomPushpinState; Atom AtomRightFooter; Atom AtomSaveYourself; Atom AtomShowProperties; Atom AtomTakeFocus; Atom AtomTargets; Atom AtomTimestamp; Atom AtomWMApplyProperties; Atom AtomWMResetProperties; Atom AtomWMState; Atom AtomWTBase; Atom AtomWTCmd; Atom AtomWTHelp; Atom AtomWTNotice; Atom AtomWTOther; Atom AtomWTProp; Atom AtomWinAttr; Atom AtomWindowBusy; Atom AtomDfltBtn; Atom AtomClass; X X/*************************************************************************** X* Global functions X***************************************************************************/ X void * GetWindowProperty(dpy, w, property, long_offset, long_length, req_type, X req_fmt, nitems, bytes_after) Display *dpy; Window w; Atom property; long long_offset, long_length; Atom req_type; int req_fmt; unsigned long *nitems; unsigned long *bytes_after; X{ X int status; X void *prop; X Atom act_type; X int act_format; X X status = XGetWindowProperty(dpy, w, property, long_offset, long_length, X False, req_type, &act_type, &act_format, nitems, X bytes_after, &prop); X if ((status != Success) || (act_type != req_type)) X { X *nitems = 0; X return NULL; X } X if ((req_fmt != 0) && (act_format != req_fmt)) X { X XFree(prop); X *nitems = 0; X return NULL; X } X return prop; X} END_OF_FILE if test 2087 -ne `wc -c <'atom.c'`; then echo shar: \"'atom.c'\" unpacked with wrong size! fi # end of 'atom.c' fi if test -f 'defaults.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'defaults.h'\" else echo shar: Extracting \"'defaults.h'\" \(467 characters\) sed "s/^X//" >'defaults.h' <<'END_OF_FILE' X/* X * (c) Copyright 1990 Sun Microsystems, Inc. Sun design patents X * pending in the U.S. and foreign countries. See LEGAL_NOTICE X * file for terms of the license. X * X * Written for Sun Microsystems by Crucible, Santa Cruz, CA. X */ X X/* @(#) defaults.h 25.1 90/04/10 Crucible */ X X/* default constants */ X#define DEFAULTCOLOR "#40A0C0" X#define CMAP DefaultColormap(dpy,DefaultScreen(dpy)) X#define DEFAULTFONT "9x15" X void SetAllDBValues(); END_OF_FILE if test 467 -ne `wc -c <'defaults.h'`; then echo shar: \"'defaults.h'\" unpacked with wrong size! fi # end of 'defaults.h' fi if test -f 'events.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'events.h'\" else echo shar: Extracting \"'events.h'\" \(728 characters\) sed "s/^X//" >'events.h' <<'END_OF_FILE' X/* X * (c) Copyright 1989 Sun Microsystems, Inc. Sun design patents X * pending in the U.S. and foreign countries. See LEGAL_NOTICE X * file for terms of the license. X * X * Written for Sun Microsystems by Crucible, Santa Cruz, CA. X */ X X/* @(#)events.h 25.5 90/05/23 */ X extern void EventLoop(); extern void InstallInterposer(); extern void UninstallInterposer(); X X/* event dispositions returned by interposer functions */ X#define DISPOSE_DISPATCH 0 X#define DISPOSE_USED 1 X#define DISPOSE_DEFER 2 X typedef void (*TimeoutFunc)(); extern void TimeoutRequest(); /* int time, TimeoutFunc f, void *closure */ extern void TimeoutCancel(); /* no params */ X extern int PropagateEventToParent(); X extern Time LastEventTime; END_OF_FILE if test 728 -ne `wc -c <'events.h'`; then echo shar: \"'events.h'\" unpacked with wrong size! fi # end of 'events.h' fi if test -f 'globals.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'globals.h'\" else echo shar: Extracting \"'globals.h'\" \(2856 characters\) sed "s/^X//" >'globals.h' <<'END_OF_FILE' X/* X * (c) Copyright 1990 Sun Microsystems, Inc. Sun design patents X * pending in the U.S. and foreign countries. See LEGAL_NOTICE X * file for terms of the license. X * X * Written for Sun Microsystems by Crucible, Santa Cruz, CA. X */ X X/* @(#)globals.h 1.4 olvwm version 4/17/91 */ X X/* Based on @(#) globals.h 1.13 90/05/31 Crucible */ X X#include "list.h" X typedef struct { X unsigned int modmask; X KeyCode keycode; X} KeySpec; X typedef enum { BeepAlways, BeepNever, BeepNotices } BeepStatus; X typedef struct _globalResourceVariables { X char *DisplayName; X char *NameTag; X char *WorkspaceColor; X Bool F3dUsed; X Bool F3dFrames; X unsigned long Fg1Color; X unsigned long Bg1Color; X unsigned long Bg2Color; X unsigned long Bg3Color; X unsigned long Bg0Color; X unsigned long BorderColor; X unsigned long CursorColor; X XFontStruct *TitleFontInfo; X XFontStruct *TextFontInfo; X XFontStruct *ButtonFontInfo; X XFontStruct *IconFontInfo; X XFontStruct *GlyphFontInfo; X Cursor BasicPointer; X Cursor MovePointer; X Cursor BusyPointer; X Cursor IconPointer; X Cursor ResizePointer; X Cursor MenuPointer; X Cursor QuestionPointer; X Cursor TargetPointer; X Cursor PanPointer; X Bool FocusFollowsMouse; X Bool ReparentFlag; X char *DefaultWinName; /* DEFAULTWINNAME */ X int SaveWorkspaceTimeout; X int FlashTime; X Bool FShowMenuButtons; X Bool FShowPinnedMenuButtons; X IconPreference IconPlacement; X Bool FSnapToGrid; X Bool FocusLenience; X Bool DragWindow; X Bool AutoRaise; X Bool PopupJumpCursor; X Bool ColorFocusLocked; X Bool PPositionCompat; X Bool RefreshRecursively; X BeepStatus Beep; X int EdgeThreshold; X int DragRightDistance; X int MoveThreshold; X int ClickMoveThreshold; X int DoubleClickTime; X int RubberBandThickness; X KeySpec FrontKey; X KeySpec HelpKey; X KeySpec OpenKey; X KeySpec ConfirmKey; X KeySpec CancelKey; X KeySpec ColorLockKey; X KeySpec ColorUnlockKey; X List *Minimals; X/* Following are three entries are strictly for debugging purposes and X * are not mentioned in the usage message or doc. X * Orphaned events are events that are associated with a window or frame X * has no entry in the frame hash table, or events that are not handled by the X * various event handlers. X * 'PrintAll' is useful for when verification of an events existance is needed. X */ X Bool PrintOrphans; X Bool PrintAll; X Bool Synchronize; X char VirtualDesktop[20]; X Bool AllowMoveIntoDesktop; X int VDMScale; X char VirtualGeometry[20]; X XFontStruct *VirtualFont; X Bool ArrowInRoot; X unsigned long VirtualBackgroundColor; X char *VirtualBackgroundMap; X char VirtualIconGeometry[20]; X unsigned long VirtualForegroundColor; X unsigned long VirtualFontColor; X Bool AutoShowRootMenu; X int AutoRootMenuX; X int AutoRootMenuY; X Bool VirtualIconic; X List *StickyList; X} GlobalResourceVariables; X extern GlobalResourceVariables GRV; X END_OF_FILE if test 2856 -ne `wc -c <'globals.h'`; then echo shar: \"'globals.h'\" unpacked with wrong size! fi # end of 'globals.h' fi if test -f 'group.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'group.h'\" else echo shar: Extracting \"'group.h'\" \(1848 characters\) sed "s/^X//" >'group.h' <<'END_OF_FILE' X/* X * (c) Copyright 1990 Sun Microsystems, Inc. Sun design patents X * pending in the U.S. and foreign countries. See LEGAL_NOTICE X * file for terms of the license. X * X * Written for Sun Microsystems by Crucible, Santa Cruz, CA. X */ X X/* @(#) group.h 1.1 90/04/10 Crucible */ X X#ifndef _OLWMGROUPH_ X#define _OLWMGROUPH_ X typedef Window GroupID; typedef void *(*GroupFunc)(/* Client *, void * */); X typedef struct _group { X GroupID groupid; X Client *leader; X List *dependents; /* List of Client * */ X List *independents; /* List of Client * */ X } Group; X X#define GROUP_LEADER 0x01 X#define GROUP_DEPENDENT 0x02 X#define GROUP_INDEPENDENT 0x04 X extern void GroupInit(); X /* initialises the Group package; should be called only once X * at startup. X */ X extern void *GroupApply(); /* GroupID, GroupFunc, void *, mask */ X /* applies a function to each part of the group identified in the X * mask; as with any apply function, when the function returns X * a non-NULL value application stops and that value is returned. X */ X extern Group *GroupLookup(); /* GroupID */ X /* given a GroupID, returns the associated group structure, or NULL X * if there is none. X */ X extern Bool GroupAdd(); /* GroupID, Client *, mask */ X /* adds a client to the named group, creating the group if need be. X * The kind of client is specified in the mask field. Returns True X * if the client was successfully added. X */ X extern Bool GroupRemove(); /* GroupID, Client * */ X /* removes a client from the group. If the group becomes empty X * it is deleted. Returns True if the client was successfully deleted. X */ X extern Bool GroupIsLeader(); /* GroupID, Client * */ X /* returns whether a particular client is the leader of X * a group X */ X extern Client *GroupLeader(); /* GroupID */ X /* returns the leader of a group */ X X#endif /* _OLWMGROUPH_ */ END_OF_FILE if test 1848 -ne `wc -c <'group.h'`; then echo shar: \"'group.h'\" unpacked with wrong size! fi # end of 'group.h' fi if test -f 'iconbitmap.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'iconbitmap.h'\" else echo shar: Extracting \"'iconbitmap.h'\" \(1017 characters\) sed "s/^X//" >'iconbitmap.h' <<'END_OF_FILE' X/* @(#)iconbitmap.h 25.1 90/04/10 */ X/* default bitmap for icons (screwdriver, hammer, wrench) */ X#define icon_width 32 X#define icon_height 32 X#define icon_x_hot -1 X#define icon_y_hot -1 static char icon_bits[] = { X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, X 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, 0x1f, 0x00, 0x00, 0xf7, 0x7f, 0x00, X 0x00, 0xf7, 0xff, 0x01, 0x00, 0xf7, 0xff, 0x03, 0x00, 0xf7, 0xff, 0x07, X 0x00, 0xc7, 0xff, 0x0f, 0x00, 0xc0, 0x07, 0x0c, 0x70, 0x00, 0x00, 0x18, X 0x70, 0xc0, 0x07, 0x10, 0x70, 0xc0, 0x07, 0x00, 0xf8, 0xc0, 0x87, 0x31, X 0xf8, 0x80, 0xc3, 0x71, 0xf8, 0x80, 0xc3, 0x71, 0xf8, 0x80, 0xc3, 0x71, X 0xf8, 0x80, 0xc3, 0x7f, 0xf8, 0x80, 0xc3, 0x7f, 0xf8, 0x80, 0x83, 0x3f, X 0x70, 0xc0, 0x07, 0x1f, 0x70, 0xc0, 0x07, 0x15, 0x70, 0xc0, 0x07, 0x15, X 0x70, 0xc0, 0x07, 0x15, 0x70, 0xc0, 0x07, 0x1f, 0x70, 0xc0, 0x07, 0x1f, X 0x70, 0xc0, 0x07, 0x1f, 0x70, 0xc0, 0x07, 0x1f, 0x70, 0xc0, 0x07, 0x1f, X 0x70, 0xc0, 0x07, 0x1f, 0x70, 0xc0, 0x07, 0x1f}; END_OF_FILE if test 1017 -ne `wc -c <'iconbitmap.h'`; then echo shar: \"'iconbitmap.h'\" unpacked with wrong size! fi # end of 'iconbitmap.h' fi if test -f 'list.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'list.c'\" else echo shar: Extracting \"'list.c'\" \(4229 characters\) sed "s/^X//" >'list.c' <<'END_OF_FILE' X/* X * (c) Copyright 1989 Sun Microsystems, Inc. Sun design patents X * pending in the U.S. and foreign countries. See LEGAL_NOTICE X * file for terms of the license. X * X * Written for Sun Microsystems by Crucible, Santa Cruz, CA. X */ X X/* @(#) list.c 25.1 90/04/10 Crucible */ X X#include <stdio.h> X#include <X11/Xos.h> X#include <X11/Xlib.h> X#include <X11/Xutil.h> X#include "mem.h" X#include "list.h" X X/*************************************************************************** X* Local data X***************************************************************************/ X X#define NUMCELLS 511 X typedef struct _cellBlock { X struct _cellBlock *next; X int n; X List cells[NUMCELLS]; X } cellBlock, *pcellBlock; X static pcellBlock cellList = NULL; static List *freeList = NULL; X X/*************************************************************************** X* Local functions X***************************************************************************/ X X/* local function X * X * pcellBlock mkCellBlock() X * returns a new, minimally initialised cell block. The block is not linked X * into the list of cell blocks. The cells are not initialised. X */ static pcellBlock mkCellBlock() X{ X pcellBlock pcb; X pcb = MemNew(cellBlock); X pcb->n = NUMCELLS; X pcb->next = NULL; X return pcb; X} X X X/* local function X * X * void initCellBlock() X * puts all the cells in the new cell block onto the free list X */ static void initCellBlock(pcb) pcellBlock pcb; X{ X int i; X X for (i=0; i<pcb->n; i++) X { X pcb->cells[i].next = freeList; X pcb->cells[i].value = NULL; X freeList = &(pcb->cells[i]); X } X} X X/* local function X * X * List *allocCell() X * allocates a cell from the free list; if none are available, allocates X * a new cell block. X */ static List * allocCell() X{ X pcellBlock pcb; X List *cell; X X if (freeList == NULL) X { X pcb = mkCellBlock(); X initCellBlock(pcb); X pcb->next = cellList; X cellList = pcb; X } X cell = freeList; X freeList = freeList->next; X cell->next = NULL; X return cell; X} X X/* local function X * X * void freeCell() X * returns a cell from the free list X */ static void freeCell(cell) List *cell; X{ X cell->next = freeList; X cell->value = NULL; X freeList = cell; X} X X/*************************************************************************** X* Global functions X***************************************************************************/ X X/* global function X * X * void ListInit() X * no parameters. X * X * Initialises the List package: allocates a block of cells. X */ void ListInit() X{ X cellList = mkCellBlock(); X initCellBlock(cellList); X} X X/* global function X * X * void ListCons(void *val, List *next) X * X * Prepends a value to the head of a list. X */ List * ListCons(val,next) void *val; List *next; X{ X List *cell; X X cell = allocCell(); X cell->value = val; X cell->next = next; X return cell; X} X X/* global function X * X * int ListCount(List *l) X * X * Returns the number of items in a list. X */ int ListCount(l) List *l; X{ X int len = 0; X X while (l != NULL) X { X len++; X l = l->next; X } X} X X X/* global function X * void ListDestroy(List *l) X * X * destroys all the cells in a list. Leaves the values unaffected. X */ void ListDestroy(l) List *l; X{ X List *last; X X while (l != NULL) X { X last = l; X l = l->next; X freeCell(last); X } X} X X X/* global function X * void ListDestroyCell(List **l) X * X * deletes one cell from a list; modifies the List* passed by X * reference to point to the next cell. X */ void ListDestroyCell(l) List **l; X{ X List *cell; X X if ((cell = *l) != NULL) X { X *l = cell->next; X freeCell(cell); X } X} X X/* global function X * void ListApply(List *l,void *(*f)(),void*c) X * X * iteratively calls the function f with list values and the X * closure c, until f returns a non-NULL value X */ void * ListApply(l,f,c) List *l; void *(*f)(); void *c; X{ X List *cell; X void *res; X X for (cell = l; cell != NULL; cell = cell->next) X { X res = (*f)(cell->value,c); X if (res != NULL) X return res; X } X return NULL; X} X X/* global function X * void * ListEnum(List **l) X * X * returns the value of the cell pointed to by l; modifies l to point X * to the next cell in the list. X */ void * ListEnum(l) List **l; X{ X void *val; X X if (*l != NULL) X { X val = (*l)->value; X *l = (*l)->next; X return val; X } X else X return NULL; X} END_OF_FILE if test 4229 -ne `wc -c <'list.c'`; then echo shar: \"'list.c'\" unpacked with wrong size! fi # end of 'list.c' fi if test -f 'list.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'list.h'\" else echo shar: Extracting \"'list.h'\" \(1412 characters\) sed "s/^X//" >'list.h' <<'END_OF_FILE' X/* X * (c) Copyright 1989 Sun Microsystems, Inc. Sun design patents X * pending in the U.S. and foreign countries. See LEGAL_NOTICE X * file for terms of the license. X * X * Written for Sun Microsystems by Crucible, Santa Cruz, CA. X */ X X/* @(#) list.h 25.1 90/04/10 Crucible */ X X#ifndef _OLWMLISTH_ X#define _OLWMLISTH_ X typedef struct _List { X void *value; X struct _List *next; X } List; X X#define NULL_LIST ((List *)0) X extern void ListInit(); X /* initialises the List package; should be called only once X * at startup. X */ X extern List *ListCons(); /* void *val, List *next */ X extern int ListCount(); /* List *l */ X /* returns number of items in a list X */ X extern void ListDestroy(); /* List *l */ X /* destroys all list cells in a list; does not affect list values X */ X extern void ListDestroyCell(); /* List **l */ X /* deletes one cell from a list; modifies the List* passed by X * reference to point to the next cell. X */ X extern void *ListApply(); /* List *l, (void *)(*f)(), void *c */ X /* iteratively calls the function f with list values and the X * closure, until it returns a non-NULL value. Returns this non-Null X * value, or NULL if hte end of the list is reached. X */ X extern void *ListEnum(); /* List **l */ X /* used for enumerating a list in a loop. Returns the value of the X * cell, and modifies the cell pointer to point to the next cell. X */ X X#endif /* _OLWMLISTH_ */ END_OF_FILE if test 1412 -ne `wc -c <'list.h'`; then echo shar: \"'list.h'\" unpacked with wrong size! fi # end of 'list.h' fi if test -f 'mem.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mem.c'\" else echo shar: Extracting \"'mem.c'\" \(1021 characters\) sed "s/^X//" >'mem.c' <<'END_OF_FILE' X/* X * (c) Copyright 1989 Sun Microsystems, Inc. Sun design patents X * pending in the U.S. and foreign countries. See LEGAL_NOTICE X * file for terms of the license. X * X * Written for Sun Microsystems by Crucible, Santa Cruz, CA. X */ X static char sccsid[] = "@(#) mem.c 25.3 90/05/01 Crucible"; X X/* X * Safe memory allocation/free routines - front-ends the C library functions X * X */ X X#include <malloc.h> X#include <memory.h> X#include <stdio.h> X#include <sys/types.h> X void * MemAlloc(sz) unsigned int sz; X{ X#ifdef __STDC__ X void *p; X#else X char *p; X#endif X X if ((p = malloc(sz)) == NULL) X ErrorGeneral("Memory allocation failure."); X memset((char *)p, 0, (int)sz); X return p; X} X void * MemCalloc(num,sz) unsigned int num; unsigned int sz; X{ X#ifdef __STDC__ X void *p; X#else X char *p; X char *calloc(); X#endif X X if ((p = calloc(num,sz)) == NULL) X ErrorGeneral("Memory array allocation failure."); X memset((char *)p, 0, (int)sz*(int)num); X return p; X} X void MemFree(p) void *p; X{ X if (p != NULL) X free(p); X} X X END_OF_FILE if test 1021 -ne `wc -c <'mem.c'`; then echo shar: \"'mem.c'\" unpacked with wrong size! fi # end of 'mem.c' fi if test -f 'mem.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'mem.h'\" else echo shar: Extracting \"'mem.h'\" \(546 characters\) sed "s/^X//" >'mem.h' <<'END_OF_FILE' X/* X * (c) Copyright 1989 Sun Microsystems, Inc. Sun design patents X * pending in the U.S. and foreign countries. See LEGAL_NOTICE X * file for terms of the license. X * X * Written for Sun Microsystems by Crucible, Santa Cruz, CA. X */ X X/* @(#) mem.h 25.1 90/04/10 Crucible */ X extern void *MemAlloc(); /* malloc frontend */ extern void *MemCalloc(); /* calloc frontend */ extern void MemFree(); /* free frontend */ X X#define MemNew(t) ((t *)MemAlloc((unsigned int)sizeof(t))) X#define MemNewString(s) (strcpy(MemAlloc(strlen(s)+1),s)) END_OF_FILE if test 546 -ne `wc -c <'mem.h'`; then echo shar: \"'mem.h'\" unpacked with wrong size! fi # end of 'mem.h' fi if test -f 'menu.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'menu.h'\" else echo shar: Extracting \"'menu.h'\" \(2643 characters\) sed "s/^X//" >'menu.h' <<'END_OF_FILE' X/* X * (c) Copyright 1989 Sun Microsystems, Inc. Sun design patents X * pending in the U.S. and foreign countries. See LEGAL_NOTICE X * file for terms of the license. X * X * Written for Sun Microsystems by Crucible, Santa Cruz, CA. X */ X X/* @(#) menu.h 25.1 90/04/10 Crucible */ X X/* a handy typedef for pointers to functions returning int */ typedef int (*FuncPtr)(); X X/* Button stacks (menus) are implemented as lists of buttons. X * Each button in a stack may in turn be stacked, this is indicated by X * the stacked flag of the button. If this flag is True then the buttonAction X * is a pointer to a new stack. Otherwise it is the function to be called X * after the menu has been dispatched. X */ typedef struct { X FuncPtr callback; /* if not stacked; call this */ X struct _menu *submenu; /* actually a Menu pointer, but */ X /* Menu hasn't been defined yet */ X} ButtonAction; X X/* possible button states */ typedef enum {Disabled, Enabled} ButtonState; X typedef struct _button { X char *label; /* displayed text */ X Bool stacked; /* True if this is a button stack */ X ButtonState state; /* Enabled/Disabled */ X ButtonAction action; X X /* following are filled in when menu is created */ X int activeX, activeY, activeW, activeH; X} Button; X typedef struct _menu { X char *title; X Button *buttons; X int buttonCount; X int buttonDefault; X Bool hasPushPin; X FuncPtr pinAction; X X /* filled in when menu is created */ X Window window; X Window shadow; X int titleHeight, titleWidth, titleX, titleY; X int pushPinX, pushPinY; X int x, y; X int width, height; X X Bool currentlyDisplayed; /* If this is true we gray out X * the pushpin when we display X * the menu. */ X struct _menu *originalMenu; /* if this menu is pinned, this X * points to the original menu X * template */ X} Menu; X X/* X * The MenuInfo structure contains information about currently active X * menus. There is one MenuInfo for each active pop-up menu (not pinned X * menu). MenuInfo structures are destroyed when the pop-up menu goes down. X */ typedef struct { X Menu *menu; X struct _wingeneric *winInfo; X Bool childActive; X Menu *childMenu; X Bool pinIn; /* current pinState */ X int litButton; /* highlighted button */ X Bool ignoreNextExpose; X} MenuInfo; X X/* external functions */ extern void InitMenus(/* dpy */); extern void MenuCreate(/* dpy, menu */); extern void MenuShow(/* dpy, WinGeneric, menu, event */); extern void SetButton(/* dpy, menu, bindex, Bool */); extern void ExecButtonAction(/* dpy, winInfo, menu, btn, Bool */); extern void DrawMenu(/* dpy, menu */); extern int PointInRect(/* x, y, rx, ry, rw, rh */); END_OF_FILE if test 2643 -ne `wc -c <'menu.h'`; then echo shar: \"'menu.h'\" unpacked with wrong size! fi # end of 'menu.h' fi if test -f 'notice.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'notice.h'\" else echo shar: Extracting \"'notice.h'\" \(767 characters\) sed "s/^X//" >'notice.h' <<'END_OF_FILE' X/* X * (c) Copyright 1990 Sun Microsystems, Inc. Sun design patents X * pending in the U.S. and foreign countries. See LEGAL_NOTICE X * file for terms of the license. X * X * Written for Sun Microsystems by Crucible, Santa Cruz, CA. X */ X X/* @(#) notice.h 25.1 90/04/10 Crucible */ X typedef struct _noticeBox { X int numButtons; /* number of buttons */ X int defaultButton; /* index into buttonText array */ X char **buttonText; /* array of strings for button text */ X int numStrings; /* number of descriptive strings */ X char **stringText; /* array of strings for description */ X int boxX; /* box origin (-1 =use default/centered) */ X int boxY; /* box origin (-1 =use default/centered) */ X} NoticeBox; X X/* function declarations */ extern int UseNoticeBox(); END_OF_FILE if test 767 -ne `wc -c <'notice.h'`; then echo shar: \"'notice.h'\" unpacked with wrong size! fi # end of 'notice.h' fi if test -f 'olcursor.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'olcursor.h'\" else echo shar: Extracting \"'olcursor.h'\" \(503 characters\) sed "s/^X//" >'olcursor.h' <<'END_OF_FILE' X/* X * (c) Copyright 1990 Sun Microsystems, Inc. Sun design patents X * pending in the U.S. and foreign countries. See LEGAL_NOTICE X * file for terms of the license. X * X * @(#)olcursor.h 1.2 90/04/23 X */ X X#define OLC_basic 0 X#define OLC_move 2 X#define OLC_copy 4 X#define OLC_busy 6 X#define OLC_stop 8 X#define OLC_panning 10 X#define OLC_target 12 X#define OLC_nouse 14 X#define OLC_ptr 16 X#define OLC_beye 18 X#define OLC_rtarr 20 X#define OLC_xhair 22 X#define OLC_xcurs 24 X#define OLC_hourg 26 END_OF_FILE if test 503 -ne `wc -c <'olcursor.h'`; then echo shar: \"'olcursor.h'\" unpacked with wrong size! fi # end of 'olcursor.h' fi if test -f 'olwm.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'olwm.h'\" else echo shar: Extracting \"'olwm.h'\" \(4765 characters\) sed "s/^X//" >'olwm.h' <<'END_OF_FILE' X/* X * (c) Copyright 1989, 1990 Sun Microsystems, Inc. Sun design patents X * pending in the U.S. and foreign countries. See LEGAL_NOTICE X * file for terms of the license. X * X * Written for Sun Microsystems by Crucible, Santa Cruz, CA. X */ X X/* @(#) olwm.h 25.11 90/05/20 Crucible */ X X#ifndef ABS X#define ABS(a) (((a) < 0) ? -(a) : (a)) X#endif X X#ifndef MAX X#define MAX(a,b) (((a) > (b)) ? (a) : (b)) X#endif X X#ifndef MIN X#define MIN(a,b) ((a) < (b) ? (a) : (b)) X#endif X X/* Determine the size of an object type in 32bit multiples. X * Rounds up to make sure the result is large enough to hold the object. */ X#define LONG_LENGTH(a) ((long)(( sizeof(a) + 3 ) / 4)) X X#define MAX_CHILDREN 10 /* size of child window array */ X X#define FOOTLEN 50L X X/* protocols bits */ X#define TAKE_FOCUS (1<<0) X#define SAVE_YOURSELF (1<<1) X#define DELETE_WINDOW (1<<2) X X/* Icon positioning modes */ typedef enum { AlongTop, AlongBottom, AlongRight, AlongLeft, X AlongTopRL, AlongBottomRL, AlongRightBT, AlongLeftBT X } IconPreference; X X/* size of icon window */ X#define ICON_WIN_WIDTH 60 X#define ICON_WIN_HEIGHT 60 X#define ICON_GRID_WIDTH 13 X#define ICON_GRID_HEIGHT 13 X X/* types of button presses */ X#define CLICK 0 X#define DOUBLECLICK 1 X#define DRAG 2 X X/* Sizes of various graphics bits. I don't know what will happen X * if these are not even numbers. */ X/* minimum window size */ X#define MINSIZE 5 X X/* offsets within title bar of adornments */ X#define SHINEOFF 11 /* 15 */ X#define PUSHOFF 2 /* 5 */ X#define OKOFF 50 X X/* mouse button definitions */ X#define MB_MENU 1 X#define MB_ADJUST 2 X#define MB_SELECT 3 X X/* adornment pixmaps */ extern Pixmap pixIcon; extern Pixmap pixmapGray; extern Pixmap pixGray; X X/* various client stuff */ extern struct _List *ActiveClientList; X X/* miscellaneous functions */ extern int ExitOLWM(); extern void *GetWindowProperty(); X X/* state functions */ extern struct _client *StateNew(); extern void ReparentTree(); extern void StateNormIcon(); extern void StateIconNorm(); extern void StateWithdrawn(); X X/* root window functions */ extern struct _wingeneric *MakeRoot(); X X/* no-focus window functions */ extern struct _wingeneric *MakeNoFocus(); extern void NoFocusTakeFocus(); extern void NoFocusInit(); extern int NoFocusEventBeep(); X X/* client functions */ extern struct _client *ClientCreate(); extern Window ClientPane(); typedef struct _clientinboxclose { X Display *dpy; X int (*func)(); X short bx, by, bw, bh; X Time timestamp; X} clientInBoxClosure; extern void *ClientInBox(); extern void ClientSetFocus(); X X/* frame functions */ extern struct _winpaneframe *MakeFrame(); extern void FrameSetPosFromPane(); extern void FrameFullSize(); extern void FrameNormSize(); extern void FrameNewFooter(); extern void FrameNewHeader(); extern void FrameSetBusy(); extern void FrameWarpPointer(); extern void FrameUnwarpPointer(); X X/* generic frame functions */ extern int GFrameFocus(); extern int GFrameSelect(); extern int GFrameSetConfigFunc(); extern void GFrameSetStack(); extern void GFrameSetConfig(); extern int GFrameEventButtonPress(); extern int GFrameEventMotionNotify(); extern int GFrameEventButtonRelease(); X X/* icon functions */ extern void IconInit(); extern struct _winiconframe *MakeIcon(); extern void IconChangeName(); extern void DrawIconToWindowLines(); extern void IconShow(); extern void IconHide(); extern void IconSetPos(); X X/* icon pane functions */ extern struct _winiconpane *MakeIconPane(); X X/* pane functions */ extern struct _winpane *MakePane(); X X/* pinned menu functions */ extern struct _winmenu *MakeMenu(); X X/* colormap functions */ extern struct _wingeneric *MakeColormap(); extern void TrackSubwindows(); extern void UnTrackSubwindows(); extern void InstallColormap(); extern void InstallPointerColormap(); extern void UnlockColormap(); extern void ColorWindowCrossing(); extern struct _wingeneric *ColormapUnhook(); extern void ColormapTransmogrify(); X X/* selection functions */ extern Bool IsSelected(); extern struct _client *EnumSelections(); extern Time TimeFresh(); extern int AddSelection(); extern Bool RemoveSelection(); extern Bool ToggleSelection(); extern void ClearSelections(); extern void SelectionResponse(); X X/* decoration window functions */ extern struct _winpushpin *MakePushPin(); extern struct _winbutton *MakeButton(); X X/* general window functions */ extern void WinCallFocus(); extern void WinRedrawAllWindows(); X X/* general window event functions */ extern int WinEventExpose(); extern int WinNewPosFunc(); extern int WinNewConfigFunc(); extern int WinSetConfigFunc(); X X/* rubber-banding functions */ extern void UserMoveWindows(); extern void UserResizeWin(); extern Bool TraceBoundingBox(); X X/* busy windows */ extern struct _winbusy *MakeBusy(); END_OF_FILE if test 4765 -ne `wc -c <'olwm.h'`; then echo shar: \"'olwm.h'\" unpacked with wrong size! fi # end of 'olwm.h' fi if test -f 'patchlevel.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'patchlevel.h'\" else echo shar: Extracting \"'patchlevel.h'\" \(21 characters\) sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE' X#define PATCHLEVEL 0 END_OF_FILE if test 21 -ne `wc -c <'patchlevel.h'`; then echo shar: \"'patchlevel.h'\" unpacked with wrong size! fi # end of 'patchlevel.h' fi if test -f 'resources.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'resources.h'\" else echo shar: Extracting \"'resources.h'\" \(4766 characters\) sed "s/^X//" >'resources.h' <<'END_OF_FILE' X/* X * (c) Copyright 1990 Sun Microsystems, Inc. Sun design patents X * pending in the U.S. and foreign countries. See LEGAL_NOTICE X * file for terms of the license. X * X * Written for Sun Microsystems by Crucible, Santa Cruz, CA. X */ X X/* @(#)resources.h 1.4 olvwm version 4/17/91 */ X X/* based on @(#) resources.h 25.14 90/05/31 Crucible */ X X/* useful macros */ X#define MakeRMName( buf, idx ) ( strcpy( buf, GRV.NameTag ), \ X strcat( buf, RMTable[idx].instance ) ) X#define MakeRMClass( buf, idx ) ( strcpy( buf, CLASSTAG ), \ X strcat( buf, RMTable[idx].class ) ) X#define RMFunc( d, idx, b ) ( RMTable[idx].setFunction( d, idx, b ) ) X X/* maximum length of fully-specified instance/class name */ X#define MAX_NAME 100 X#define MAX_CLASS 100 X X#define CLASSTAG "OpenWindows" /* value for initial class */ X X#define BASICPTR 0 X#define MOVEPTR 1 X#define BUSYPTR 2 X#define ICONPTR 3 X#define RESIZEPTR 4 X#define MENUPTR 5 X#define QUESTIONPTR 6 X#define TARGETPTR 7 X#define PANPTR 8 X#define NUM_CURSORS 9 /* number of pointers supported */ X X typedef Bool (*BFuncPtr)(); X typedef struct _resourceInfo { X char *instance; /* without NameTag prefix */ X char *class; /* without CLASSTAG prefix */ X char *defaultVal; /* string representation */ X void *varAddr; /* address of global var in GRV struct */ X BFuncPtr setFunc; /* takes dpy, RMTable index, bool as args */ X BFuncPtr updFunc; /* takes dpy, RMTable index, bool as args */ X} ResourceInfo; X extern ResourceInfo RMTable[]; X X/* resource names as indices into RMTable */ X#define RM_DISPLAY 0 X#define RM_PREFIX 1 X#define RM_WORKSPACECOLOR 2 X#define RM_USE3D 3 X#define RM_BACKGROUND 4 X#define RM_FOREGROUND 5 X#define RM_BORDERCOLOR 6 X#define RM_CURSORCOLOR 7 X#define RM_TITLE_FONT 8 X#define RM_TEXT_FONT 9 X#define RM_BUTTON_FONT 10 X#define RM_ICON_FONT 11 X#define RM_GLYPHFONT 12 /* not in Font class */ X#define RM_CURSORFONT 13 /* not in Font class */ X#define RM_INPUTFOCUS 14 X#define RM_REPARENTOK 15 X#define RM_DEFAULTTITLE 16 X#define RM_FLASHTIME 17 X#define RM_POPBOUTLINE 18 /* popup menu button outline */ X#define RM_PINBOUTLINE 19 /* pinned menu button outline */ X#define RM_ICONLOCATION 20 X#define RM_FOCUSLENIENCE 21 X#define RM_WINDOWDRAG 22 X#define RM_AUTORAISE 23 X#define RM_DRAGRIGHT 24 X#define RM_MMOVETHRESH 25 /* mouse move threshold */ X#define RM_CMOVETHRESH 26 /* multi-click move threshold */ X#define RM_CLICKTIME 27 X#define RM_FRONTKEY 28 X#define RM_HELPKEY 29 X#define RM_OPENKEY 30 X#define RM_CONFIRMKEY 31 X#define RM_ORPHANS 32 X#define RM_PRINTALL 33 X#define RM_SYNCH 34 X#define RM_SNAPTOGRID 35 X#define RM_SAVEWORKSPACETIMEOUT 36 X#define RM_POPUPJUMPCURSOR 37 X#define RM_CANCELKEY 38 X#define RM_COLORLOCKKEY 39 X#define RM_COLORUNLOCKKEY 40 X#define RM_COLORFOCUSLOCKED 41 X#define RM_EDGEEFFECTDIST 42 X#define RM_RUBBERBANDTHICKNESS 43 X#define RM_BEEPSETTING 44 X#define RM_PPOSITIONCOMPAT 45 X#define RM_MINIMALDECORS 46 X#define RM_USE3DFRAMES 47 X#define RM_REFRESHRECURSIVELY 48 X#define RM_VIRTUALDESKTOP 49 X#define RM_ALLOWMOVEINTODESKTOP 50 X#define RM_PANNERSCALE 51 X#define RM_VIRTUALGEOMETRY 52 X#define RM_VIRTUALFONT 53 X#define RM_ALLOWARROWINROOT 54 X#define RM_VIRTUALBGCOLOR 55 X#define RM_VIRTUALMAP 56 X#define RM_VIRTUALICONGEOMETRY 57 X#define RM_VIRTUALFGCOLOR 58 X#define RM_VIRTUALFONTCOLOR 59 X#define RM_AUTOSHOWROOTMENU 60 X#define RM_AUTOROOTMENUX 61 X#define RM_AUTOROOTMENUY 62 X#define RM_VIRTUALICONIC 63 X#define RM_STICKYWINDOWS 64 X#define RM_ENTRYEND 65 /* number of entries in table */ X X/* resource set functions */ static Bool setBoolResource(); static Bool setFontResource(); static Bool setGlyphFont(); static Bool setCursors(); static Bool setCharResource(); static Bool setFloatResource(); static Bool setIntResource(); static Bool setClickTimeout(); static Bool setFg1Color(); static Bool setBg1Color(); static Bool setBg2Color(); static Bool setBg3Color(); static Bool setBg0Color(); static Bool setBg0Percent(); X Bool setColor(); X Bool VirtualSetColor(); static Bool setInputFocusStyle(); static Bool setIconLocation(); static Bool setKey(); static Bool setDimension(); static Bool setStringResource(); Bool SetNameTag(); X X/* resource update functions */ void UpdateDBValues(); Bool UpdWorkspace(); Bool UpdSync(); Bool UpdTitleFont(); Bool UpdTextFont(); Bool UpdButtonFont(); Bool UpdIconFont(); Bool UpdGlyphFont(); Bool UpdFg1Color(); Bool UpdBg0Percent(); Bool UpdBg0Color(); Bool UpdBg1Color(); Bool UpdBg2Color(); Bool UpdBg3Color(); Bool UpdCursorColor(); X Bool UpdVirtualDesktop(); Bool UpdVirtualFont(); Bool UpdVDMScale(); Bool UpdVirtualGeometry(); Bool UpdVirtualIconGeometry(); Bool UpdVirtualBgColor(); Bool UpdVirtualMap(); Bool UpdVirtualFgColor(); Bool UpdVirtualFontColor(); END_OF_FILE if test 4766 -ne `wc -c <'resources.h'`; then echo shar: \"'resources.h'\" unpacked with wrong size! fi # end of 'resources.h' fi if test -f 'slots.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'slots.h'\" else echo shar: Extracting \"'slots.h'\" \(1799 characters\) sed "s/^X//" >'slots.h' <<'END_OF_FILE' X/* X * (c) Copyright 1990 Sun Microsystems, Inc. Sun design patents X * pending in the U.S. and foreign countries. See LEGAL_NOTICE X * file for terms of the license. X * X * Written for Sun Microsystems by Crucible, Santa Cruz, CA. X */ X X/* @(#) slots.h 1.2 90/05/01 Crucible */ X X#ifndef _OLWMSLOTH X#define _OLWMSLOTH X typedef enum {SOTopToBottom, SOBottomToTop, SOLeftToRight, SORightToLeft} SlotOrder; X typedef struct _iconSlot { X int ma, mi, maw, miw; X Bool positioned; X} IconSlot; X extern void SlotInit(); /* Display *dpy */ X /* initialises the Slots package; should be called only once X * at startup. X */ X extern struct _iconSlot *SlotAlloc(); /* WinIcon *, Bool, Bool */ X /* given a sized and possibly positioned icon window, allocate X * the appropriate slots for it. If the window is positioned, X * True should be passed for the second parameter, and the x,y X * position will be honoured. If the window is not positioned, it X * will be positioned by this function to the appropriate slots(s). X * If the icon is being manually positioned and should be positioned X * according to the icon grid, True should be passed for the third X * parameter; False should be passed otherwise. X */ X extern Bool SlotFree(); /* WinIcon * */ X /* An icon is going away, so its references to slots should also go X * away. X */ X extern Bool SlotSetLocations(); /* Display *dpy */ X /* sets the order in which slots are allocated for icons which are X * not explicitly positioned. The new order is obtained from the X * global resource vector. X * For example, the AlongBottom order is expressed as X * major BottomToTop, minor LeftToRight. Any icons which were X * automatically positioned are repositioned to equivalent positions X * in the new order. X */ X X#endif /* _OLWMSLOTH */ END_OF_FILE if test 1799 -ne `wc -c <'slots.h'`; then echo shar: \"'slots.h'\" unpacked with wrong size! fi # end of 'slots.h' fi if test -f 'st.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'st.h'\" else echo shar: Extracting \"'st.h'\" \(1246 characters\) sed "s/^X//" >'st.h' <<'END_OF_FILE' X/* This is a general purpose hash table package written by Peter Moore @ UCB. */ X X/* @(#) st.h 25.1 90/04/10 */ X X#ifndef ST_INCLUDED X X#define ST_INCLUDED X typedef struct st_table_entry st_table_entry; X struct st_table_entry { X char *key; X char *record; X st_table_entry *next; X}; X typedef struct st_table st_table; X struct st_table { X int (*compare)(); X int (*hash)(); X int num_bins; X int num_entries; X int max_density; X int reorder_flag; X double grow_factor; X st_table_entry **bins; X}; X X#define st_is_member(table,key) st_lookup(table,key,(char **) 0) X enum st_retval {ST_CONTINUE, ST_STOP, ST_DELETE}; X int st_delete(), st_insert(), st_foreach(), st_free_table(); int st_lookup(), st_find_or_add(), st_add_direct(); st_table *st_init_table(), *st_init_table_with_params(); X X#define ST_NUMCMP ((int (*)()) 0) X#define ST_NUMHASH ((int (*)()) -2) X X#define ST_PTRCMP ((int (*)()) 0) X#define ST_PTRHASH ((int (*)()) -1) X X#define st_numcmp ST_NUMCMP X#define st_numhash ST_NUMHASH X#define st_ptrcmp ST_PTRCMP X#define st_ptrhash ST_PTRHASH X X#define ST_DEFAULT_MAX_DENSITY 5 X#define ST_DEFAULT_INIT_TABLE_SIZE 11 X#define ST_DEFAULT_GROW_FACTOR 2.0 X#define ST_DEFAULT_REORDER_FLAG 0 X int st_strhash(); X X#endif ST_INCLUDED END_OF_FILE if test 1246 -ne `wc -c <'st.h'`; then echo shar: \"'st.h'\" unpacked with wrong size! fi # end of 'st.h' fi if test -f 'usleep.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'usleep.c'\" else echo shar: Extracting \"'usleep.c'\" \(1167 characters\) sed "s/^X//" >'usleep.c' <<'END_OF_FILE' X/* X * (c) Copyright 1989 Sun Microsystems, Inc. Sun design patents X * pending in the U.S. and foreign countries. See LEGAL_NOTICE X * file for terms of the license. X * X * Written for Sun Microsystems by Crucible, Santa Cruz, CA. X */ X static char sccsid[] = "@(#) usleep.c 25.1 90/04/10 Crucible"; X X/* X * usleep() compatibility function X * X * It's not very robust, but it seems to work fine for what olwm X * needs. X */ X X#include <sys/types.h> X#include <signal.h> X#include <sys/time.h> X void olwm_do_nothing(); X int olwm_usleep(usec) X unsigned usec; X{ X struct itimerval new, old; X struct sigvec new_vec, old_vec; X X new.it_interval.tv_sec = new.it_interval.tv_usec = 0; X new.it_value.tv_sec = 0; X new.it_value.tv_usec = usec; X X new_vec.sv_handler = olwm_do_nothing; X new_vec.sv_mask= 0; X new_vec.sv_flags = 0; X X sigvec(SIGALRM, &new_vec, &old_vec); X setitimer(ITIMER_REAL, &new, &old); X X /* wait until we receive a signal */ X sigpause(0); X X /* restore previous values for SIGALRM handler and the real itimer */ X sigvec(SIGALRM, &old_vec, (struct sigvec *)0); X setitimer(ITIMER_REAL, &old, (struct itimerval *)0); X return(0); X} X void olwm_do_nothing() X{ X} END_OF_FILE if test 1167 -ne `wc -c <'usleep.c'`; then echo shar: \"'usleep.c'\" unpacked with wrong size! fi # end of 'usleep.c' fi if test -f 'vdm.icon' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'vdm.icon'\" else echo shar: Extracting \"'vdm.icon'\" \(2471 characters\) sed "s/^X//" >'vdm.icon' <<'END_OF_FILE' X#define vdm_width 64 X#define vdm_height 48 static char vdm_bits[] = { X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, X 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, X 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, 0x00, X 0x00, 0x80, 0xff, 0x23, 0xe4, 0x0f, 0x00, 0x00, 0x00, 0x80, 0xff, 0x23, X 0xe4, 0x0f, 0x00, 0x00, 0x00, 0x80, 0xff, 0x23, 0xe4, 0x0f, 0x00, 0x00, X 0x00, 0x80, 0xff, 0x23, 0xe4, 0x0f, 0x00, 0x00, 0x00, 0x80, 0xff, 0x23, X 0xe4, 0xff, 0xff, 0x0f, 0x00, 0x80, 0xff, 0x23, 0xe4, 0xff, 0xff, 0x0f, X 0x00, 0x80, 0xff, 0x23, 0xe4, 0xff, 0xff, 0x0f, 0x00, 0x80, 0xff, 0x23, X 0x04, 0xfe, 0xff, 0x0f, 0x00, 0x80, 0xff, 0x23, 0x04, 0xfe, 0xff, 0x0f, X 0x00, 0x80, 0xff, 0x23, 0x04, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x20, X 0x04, 0xfe, 0xff, 0x0f, 0xfe, 0xff, 0x00, 0x20, 0x04, 0xfe, 0xff, 0x0f, X 0xfe, 0xff, 0x00, 0x20, 0x04, 0xfe, 0xff, 0x0f, 0xfe, 0xff, 0x00, 0x20, X 0x04, 0xfe, 0xff, 0x0f, 0xfe, 0xff, 0x00, 0x20, 0x04, 0xfe, 0xff, 0x0f, X 0xfe, 0xff, 0x00, 0x20, 0x04, 0xfe, 0xff, 0x0f, 0xfe, 0xff, 0x00, 0x20, X 0x04, 0xfe, 0xff, 0x0f, 0xfe, 0xff, 0x00, 0x20, 0x04, 0xfe, 0xff, 0x0f, X 0xfe, 0xff, 0x00, 0x20, 0x04, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x20, X 0x04, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x20, 0x04, 0x00, 0x00, 0x00, X 0xfe, 0xff, 0x00, 0x20, 0x04, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x20, X 0x04, 0x80, 0xff, 0xff, 0xff, 0xff, 0x00, 0x20, 0x04, 0x80, 0xff, 0xff, X 0xff, 0xff, 0x00, 0x20, 0x04, 0x80, 0xff, 0xff, 0xff, 0xff, 0x00, 0x20, X 0x04, 0x80, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x20, 0x04, 0x80, 0xff, 0xff, X 0x1f, 0x00, 0x00, 0x20, 0x04, 0x80, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x20, X 0x04, 0x80, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x20, 0x04, 0x80, 0xff, 0xff, X 0x1f, 0x00, 0x00, 0x20, 0x04, 0x80, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x20, X 0x04, 0x80, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x20, 0x04, 0x80, 0xff, 0xff, X 0x1f, 0x00, 0x00, 0x20, 0x04, 0x80, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x20, X 0x04, 0x80, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x20, 0x04, 0x80, 0xff, 0xff, X 0x1f, 0x00, 0x00, 0x20, 0x04, 0x80, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x20, X 0x04, 0x80, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x20, 0x04, 0x80, 0xff, 0xff, X 0x1f, 0x00, 0x00, 0x20, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; END_OF_FILE if test 2471 -ne `wc -c <'vdm.icon'`; then echo shar: \"'vdm.icon'\" unpacked with wrong size! fi # end of 'vdm.icon' fi echo shar: End of archive 1 \(of 16\). cp /dev/null ark1isdone MISSING="" for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 16 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 -- Dan Heller O'Reilly && Associates Z-Code Software Comp-sources-x: Senior Writer President comp-sources.x@uunet.uu.net argv@ora.com argv@zipcode.com