~AWM.SAVEVAWM.SAVEQBACKUP/LOG *.C,*.H,*.OPT,*.RC,MAKEFILE.,AWM.TXT,AWM.EXE,[.MENUS]*.* AWM.SAVE/SAVE FIELDS %@<V5.4 _WARTHG::  _$4$DUA7: V5.3 ~  *[FIELDS.X.AWM]AWM.C;16+,.Z/% 4{ZY-C0D123KPWOZ56iӧ7 hU8ðPH9fG%HJz #ifndef lint{static char *rcsid_awm_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.c,v 1.3 89/02/07 22:39:57 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. *//* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group= * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,) * Western Software Lab. Convert to X11.E * 002 -- Jordan Hubbard, U.C. Berkeley. Add title bar context stuff.J * 003 -- Jordan Hubbard, Ardent Computer. Added gadgets, border contexts.; * 1.6 -- Various irritating changes. Support for WMSTATE.. */#include #include "awm.h" #ifndef VMS#include \#endif#include #include #ifdef titan#include #endif #ifdef PCS#include #include #endif #ifdef PROFIL#include /* * Dummy handler for profiling. */ptrap(){ exit(0);}#endifBoolean NeedRootInput=FALSE;MenuOptionsMask options;char *sfilename;>char execfile[NAME_LEN]; /* Pointer to file to exec with -e */Boolean Snatched;Boolean desktop_execd = TRUE;extern FILE *yyin;extern int errorStatus;extern int ErrorHandler();extern XContext AwmContext;/* * Main program. */main(argc, argv, environ) int argc; char **argv;char **environ;{. int hi; /* Button event high detail. */- int lo; /* Button event low detail. */@ int x, y; /* Mouse X and Y coordinates. */E int root_x, root_y; /* Mouse root X and Y coordinates. */@ int cur_x, cur_y; /* Current mouse X and Y coordinates. */< int down_x, down_y; /* mouse X and Y at ButtonPress. */G int str_width; /* Width in pixels of output string. */N unsigned int pop_width, pop_height; /* Pop up window width and height. */7 int context; /* Root, window, or icon context. */1 unsigned int ptrmask; /* for QueryPointer */F Boolean func_stat; /* If true, function swallowed a ButtonUp. */F Boolean delta_done; /* If true, then delta functions are done. */D Boolean local; /* If true, then do not use system defaults. */: Boolean nolocal; /* If true, ignore user defaults */< register Binding *bptr; /* Pointer to Bindings list. */. char *root_name; /* Root window name. */6 char *display = NULL; /* Display name pointer. */4 char message[128]; /* Error message buffer. */3 char *rc_file; /* Pointer to $HOME/.awmrc. */3 Window event_win; /* Event window. */6 Window root; /* Root window for QueryPointer. */ AwmInfoPtr awi;4 XEvent button_event; /* Button input event. */- XGCValues xgc; /* to create font GCs */ char *malloc(); XSetWindowAttributes swa; unsigned long valuemask;& Window bwin; /* Button window */ int num; 4 /* next three variables are for XQueryWindow */ Window junk; Window *kiddies = NULL; unsigned int nkids;  Entry("main") #ifdef PROFIL signal(SIGTERM, ptrap);#endif  /* ) * Parse the command line arguments. */ Argv = argv; EEnviron = environ; local = nolocal = FALSE; argc--, argv++; /*D * The destruction of '-e' args below is to prevent the startupC * command from being invoked again if we do an f.restart (see * Restart.c and Argv) */ while (argc) { if (**argv == '-') {A if (!strcmp(*argv, "-display") || !strcmp(*argv, "-d")) { argc--; argv++; if (argc <= 0) Usage(); display = *argv; }* else if (!(strcmp(*argv, "-f"))) { argc--, argv++;3 if ((argc == 0) || (Startup_File[0] != '\0')) Usage();- strncpy(Startup_File, *argv, NAME_LEN); }* else if (!(strcmp(*argv, "-e"))) {0 strcpy(*argv, "--"); /* destroy the arg */ argc--; argv++;/ if ((argc == 0) || (execfile[0] != '\0')) Usage();@ desktop_execd = FALSE; /* assume we have desktop to run */) strncpy(execfile, *argv, NAME_LEN); }F /* Destroyed arg, skip over what used to be filename for -e */* else if (!(strcmp(*argv, "--"))) { argv += 2; argc -= 2; continue; }( else if (!(strcmp(*argv, "-b"))) local = TRUE;( else if (!(strcmp(*argv, "-i"))) nolocal = TRUE;  else Usage(); } else Usage(); argc--, argv++; } #ifdef CONSOLE- if (access("/dev/console", W_OK) == 0) {/ freopen("/dev/console", "w", stderr);( freopen("/dev/console", "w", stdout); }#endif /* CONSOLE */ /* Open the damn display */1 if ((dpy = XOpenDisplay(display)) == NULL) {4 fprintf(stderr, "awm: Unable to open display\n"); exit(1); } scr = DefaultScreen(dpy);  /*1 * Set XErrorFunction to be non-terminating. */$ XSetErrorHandler(ErrorHandler); #ifndef VMS /*D * Force child processes to disinherit the TCP file descriptor.? * This helps shell commands forked and exec'ed from menus= * to work properly. God knows if this works under SysV. */E if ((status = fcntl(ConnectionNumber(dpy), F_SETFD, 1)) == -1) {1 perror("awm: child cannot disinherit TCP fd");) Error("TCP file descriptor problems"); }#endif  /*+ * Initialize the menus for later use. */. RTLMenu_Option_Set(options, rightoffset);! RTLMenu_Initialize(options); ) /* Init the context manager stuff */# AwmContext = XUniqueContext();  /*A * Get all the defaults we expect from the resource manager. */ FocusSetByUser = FALSE; Get_Defaults();#if defined(WMSTATE)9 wm_state_atom = XInternAtom(dpy, "WM_STATE", False);#endif /* WMSTATE */ /*( * Initialize the default bindings. */ if (!local) InitBindings();  /*5 * Read in and parse $HOME/.awmrc, if it exists. */ if (!nolocal) { extern char *getenv(); char *home = getenv("HOME"); if( !home ) Error( "Cannot find home" );* sfilename = rc_file = malloc(NAME_LEN); #ifdef VMS& sprintf(rc_file, "%sawm.rc", home);#else"' sprintf(rc_file, "%s/.awmrc", home);h#endif. if ((yyin = fopen(rc_file, "r")) != NULL) { Lineno = 1;l yyparse(); fclose(yyin);b if (Startup_File_Error) * Error("Bad .awmrc file...aborting"); } } /* D * Read in and parse the startup file from the command line, if * specified. */# if (Startup_File[0] != '\0') {p sfilename = Startup_File;3 if ((yyin = fopen(Startup_File, "r")) == NULL) {sH sprintf(message, "Cannot open startup file '%s'", Startup_File); Error(message);* } Lineno = 1; yyparse();  fclose(yyin); if (Startup_File_Error)- Error("Bad startup file...aborting");f } if (Startup_File_Error)( Error("Bad startup file...aborting"); /*rM * Catch some of the basic signals so we don't get rudely killed withoute * cleaning up first. */ #ifdef titan signal(SIGHUP, Quit); signal(SIGTERM, Quit);o signal(SIGQUIT, Quit);g signal(SIGINT, Quit); /* ignore SIGTTOU */e signal(SIGTTOU, SIG_IGN);#elsec, if (signal(SIGHUP, SIG_IGN) != SIG_IGN) signal(SIGHUP, Quit);- if (signal(SIGTERM, SIG_IGN) != SIG_IGN) signal(SIGTERM, Quit);d- if (signal(SIGQUIT, SIG_IGN) != SIG_IGN)d signal(SIGTERM, Quit); , if (signal(SIGINT, SIG_IGN) != SIG_IGN) signal(SIGINT, Quit);#endif /*I7 * If the root window has not been named, name it.R */A status = XFetchName(dpy, Pseudo_root(dpy, scr), &root_name);B if (root_name == NULL) = XStoreName(dpy, Pseudo_root(dpy, scr), " X Root Window "); elseF XFree(root_name);# /* register the root window */,+ RegisterWindow(Pseudo_root(dpy, scr));I, ScreenHeight = DisplayHeight(dpy, scr);* ScreenWidth = DisplayWidth(dpy, scr); /*CI * Create the menus. This function also sticks the RTL menu "handle"0M * into the appropriate binding after it's been created and initialized.e */ Create_Menus(); /*b * check the gadgets. */ if (CheckGadgets())7 Error("Error in gadget declarations. Exiting...\n");e /*6 * Store all the cursors. */ StoreCursors(); e /* = * grab the mouse buttons according to the map structuree */ Grab_Buttons(); < /* ? * watch for initial window mapping and window destructionf */ n errorStatus = False;/C swa.event_mask = (SubstructureRedirectMask | FocusChangeMask |h% (NeedRootInput ? EVENTMASK | OwnerGrabButtonMask : 0));L XChangeWindowAttributes(dpy, Pseudo_root(dpy, scr), CWEventMask, &swa); XSync(dpy, False);  if (errorStatus) G Error("Hmmm.. Looks like you're running another window manager!\n");L /*I * Before we go creating more windows, we buzz through the ones thatnL * are currently mapped and reparent and/or select on them as necessary# * (for autoraise and titles).  */ uH if (XQueryTree(dpy, DefaultRootWindow(dpy), &junk, &junk, &kiddies, &nkids)) { int i; % for (i = 0; i < (int)nkids; i++) {  XWindowAttributes xwa; Window transient;e AwmInfoPtr awi;u! unsigned long event_mask;d 4 XGetWindowAttributes(dpy, kiddies[i], &xwa); 7 /* check to see if it's a popup or something */p: XGetTransientForHint(dpy, kiddies[i], &transient);F if (xwa.class == InputOutput && xwa.map_state == IsViewable &&; xwa.override_redirect == False && transient == None) {P' awi = RegisterWindow(kiddies[i]);f awi->state |= ST_PLACED; /* Possibly add a frame */$ FDecorate(kiddies[i],0,0,0,0);8 event_mask = PropertyChangeMask | FocusChangeMask;% if (!awi->frame || !FrameFocus)c6 event_mask |= (EnterWindowMask | LeaveWindowMask);#ifndef RAINBOW ( SetBorderPixmaps(awi, GrayPixmap);#elsee- SetBorderPixmaps(awi, awi->grayPixmap);=#endif0 XSelectInput(dpy, kiddies[i], event_mask); }  } if (kiddies && *kiddies)i XFree(kiddies); } /* 3 * Calculate size of the resize pop-up window.  */- valuemask = CWBorderPixel | CWBackPixel;A swa.border_pixel = PBorder;( swa.background_pixel = PBackground; if (SaveUnder) {e swa.save_under = True;  valuemask |= CWSaveUnder; }= str_width = XTextWidth(PFontInfo, PText, strlen(PText));t- pop_width = str_width + (PPadding << 1);e. PWidth = pop_width + (PBorderWidth << 1);K pop_height = PFontInfo->ascent + PFontInfo->descent + (PPadding << 1);0 PHeight = pop_height + (PBorderWidth << 1); /*,H * Create the pop-up window. Create it at (0, 0) for now. We will$ * move it where we want later. */4 Pop = XCreateWindow(dpy, Pseudo_root(dpy, scr), 0, 0,; pop_width, pop_height, PBorderWidth,s 0, CopyFromParent,t CopyFromParent,r valuemask, &swa); if (Pop == FAILURE): Error("Can't create pop-up dimension display window."); * /*' * Create graphics context. */ xgc.font = IFontInfo->fid; $ xgc.graphics_exposures = FALSE;" xgc.foreground = IForeground;" xgc.background = IBackground; IconGC = XCreateGC(dpy,  Pseudo_root(dpy, scr),f7 (GCForeground | GCBackground | GCGraphicsExposures |; GCFont), &xgc);u " xgc.foreground = PForeground;" xgc.background = PBackground; xgc.font = PFontInfo->fid;  PopGC = XCreateGC(dpy,  Pseudo_root(dpy, scr),07 (GCForeground | GCBackground | GCFont), &xgc);_! xgc.line_width = DRAW_WIDTH;s! xgc.foreground = DRAW_VALUE;i xgc.function = DRAW_FUNC;+ xgc.subwindow_mode = IncludeInferiors;u4 DrawGC = XCreateGC(dpy, Pseudo_root(dpy, scr), , GCLineWidth | GCForeground | GCFunction | GCSubwindowMode, &xgc); /* I * As our last "startup" task, invoke the execfile if was specified.! */ if (!desktop_execd) {% if (access(execfile, X_OK) == 0) {) if (fork() == 0) { setpgrp(0, getpid()); signal(SIGHUP, SIG_DFL); signal(SIGQUIT, SIG_DFL);  signal(SIGINT, SIG_DFL);0 execl("/bin/sh", "sh", "-c", execfile, 0); _exit(127); }d else desktop_execd = TRUE;p } } /* + * Tell the user we're alive and well.f */+ XBell(dpy, VOLUME_PERCENTAGE(Volume)); } /*  * Main command loop. */ while (TRUE) {r c" delta_done = func_stat = FALSE;  /*E= * Get the next mouse button event. Spin our wheels untilo( * a ButtonPressed event is returned.> * Note that mouse events within an icon window are handled; * in the "GetButton" function or by the icon's owner ifi * it is not awm. */ while (TRUE) {=& if (!GetButton(&button_event)) continue;p2 else if (button_event.type == ButtonPress) break; }& bwin = button_event.xbutton.window;H /* save mouse coords in case we want them later for a delta action */# down_x = button_event.xbutton.x;s# down_y = button_event.xbutton.y;)  /* = * Okay, determine the event window and mouse coordinates.i */' status = XTranslateCoordinates(dpy, bwin,w Pseudo_root(dpy, scr), button_event.xbutton.x,  button_event.xbutton.y,t &x, &y,e &event_win); if (status == 0)t continue;  ) awi = GetAwmInfo(bwin); if (!awi) continue;d! if (awi->frame == bwin)! context = BORDER; else if (awi->title == bwin)a context = TITLE;$ else if (IsGadgetWin(bwin, &num))4 context = GADGET | (1 << (num + BITS_USED)); else if (awi->icon == bwin) context = ICON;;3 else if (awi->client == Pseudo_root(dpy, scr)) {V* event_win = Pseudo_root(dpy, scr); context = ROOT;e } elseh context = WINDOW;n /*r" * Get the button event detail. */$ lo = button_event.xbutton.button;# hi = button_event.xbutton.state;r  /*r: * Determine which function was selected and invoke it. *// for(bptr = Blist; bptr; bptr = bptr->next) {n# if ((bptr->button != lo) || ) (((int)bptr->mask & ModMask) != hi))  continue;t 3 if ((bptr->context & context) != context) { continue;e }' if (!(bptr->mask & ButtonDown))  continue;) /*' * Found a match! Invoke the function.i */? if ((*bptr->func)(event_win, (int)bptr->mask & ModMask, bptr->button, x, y,! bptr->menu, bptr->menuname)). func_stat = TRUE; break; } a /*nD * If the function ate the ButtonUp event, then restart the loop. */ i if (func_stat)  continue;i while (TRUE) {I /*# * Wait for the next button event.  */8 if (XPending(dpy) && GetButton(&button_event)) {) bwin = button_event.xbutton.window;s /*: * If it's not a release of button that was pressed,3 * don't do the function bound to 'ButtonUp'.T */d- if (button_event.type != ButtonRelease)d break;, if (lo != button_event.xbutton.button) break;> if ((hi | ButtonMask(lo)) != button_event.xbutton.state) break; /*@ * Okay, determine the event window and mouse coordinates. */p* status = XTranslateCoordinates(dpy,  bwin, Pseudo_root(dpy, scr),) button_event.xbutton.x, button_event.xbutton.y, &x, &y, &event_win);W if (status == BadWindow) break; awi = GetAwmInfo(bwin);r if (!awi)d continue;t if (awi->frame == bwin)  context = BORDER;s" else if (awi->title == bwin) context = TITLE;' else if (IsGadgetWin(bwin, &num))c0 context = GADGET | (1 << (num + BITS_USED));! else if (awi->icon == bwin)h context = ICON;6 else if (awi->client == Pseudo_root(dpy, scr)) {& event_win = Pseudo_root(dpy, scr); context = ROOT;  } else context = WINDOW;  /*= * Determine which function was selected and invoke it.r *//2 for(bptr = Blist; bptr; bptr = bptr->next) {  if ((bptr->button != lo) ||o, (((int)bptr->mask & ModMask) != hi)) continue; 2 if (!((bptr->context & context) == context)) { continue; } ! if (!(bptr->mask & ButtonUp))n continue;  /** * Found a match! Invoke the function. */s  (*bptr->func)(event_win,% (int)bptr->mask & ModMask,o bptr->button, x, y,' bptr->menu, bptr->menuname);b break; }t break; }l1 XQueryPointer(dpy, Pseudo_root(dpy, scr),s7 &root, &junk, &root_x, &root_y, &cur_x, &cur_y,  &ptrmask); if (!delta_done &&: (abs(cur_x - x) > Delta || abs(cur_y - y) > Delta)) { /*7 * Delta functions are done once (and only once.) */  delta_done = TRUE;  /*> * Determine the new event window's coordinates from the$ * original ButtonPress event. *// status = XTranslateCoordinates(dpy, bwin,i Pseudo_root(dpy, scr),i down_x, down_y, &x, &y, &junk); if (status == 0) break; /*0 * Determine the event window and context. */e if (awi->frame == bwin)w context = BORDER;w" else if (awi->title == bwin) context = TITLE;' else if (IsGadgetWin(bwin, &num)) 0 context = GADGET | (1 << (num + BITS_USED));! else if (awi->icon == bwin)F context = ICON;k6 else if (awi->client == Pseudo_root(dpy, scr)) {& event_win = Pseudo_root(dpy, scr); context = ROOT;e }x else context = WINDOW;f /*= * Determine which function was selected and invoke it.i */&2 for(bptr = Blist; bptr; bptr = bptr->next) {  if ((bptr->button != lo) ||e, (((int)bptr->mask & ModMask) != hi)) continue; 0 if (!((bptr->context & context) == context)) continue; $ if (!(bptr->mask & DeltaMotion)) continue;  /** * Found a match! Invoke the function. */n if ((*bptr->func)(event_win," (int)bptr->mask & ModMask, bptr->button,i x, y,i& bptr->menu, bptr->menuname)) { func_stat = TRUE; break;) }  }= /*0 * If the function ate the ButtonUp event, * then restart the loop.a */r  if (func_stat) break; } } }}p/*J * Get defaults from the resource manager. Most of these things used to be8 * in the rc file, but they really belong here, I think. */rGet_Defaults(){u /* 1 * Get the pixmap search path, if it exists.  */3 awmPath = GetStringRes("path", (char *) NULL); 6 /* Default foreground/background colors (text) */6 Foreground = GetStringRes("foreground", "black");6 Background = GetStringRes("background", "white");, Reverse = GetBoolRes("reverse", FALSE); e< if (Reverse) { /* Swap the foreground and background */ char *tmp;;  tmp = Foreground; Foreground = Background;r Background = tmp;  }= WBorder = GetStringRes("border.foreground", Foreground);C 2 Autoselect = GetBoolRes("autoselect", FALSE);0 Autoraise = GetBoolRes("autoraise", FALSE);3 Borders = GetBoolRes("borderContexts", FALSE);V< ConstrainResize = GetBoolRes("constrainResize", FALSE);2 FrameFocus = GetBoolRes("frameFocus", FALSE);* Freeze = GetBoolRes("freeze", FALSE);& Grid = GetBoolRes("grid", FALSE);< InstallColormap = GetBoolRes("installColormap", FALSE);* Titles = GetBoolRes("titles", FALSE);3 IconLabels = GetBoolRes("icon.labels", FALSE);c4 ILabelTop = GetBoolRes("icon.labelTop", FALSE);0 PushDown = GetBoolRes("title.push", FALSE);/ UseGadgets = GetBoolRes("gadgets", FALSE);i* Hilite = GetBoolRes("hilite", FALSE);8 BorderHilite = GetBoolRes("border.hilite", Hilite);8 RootResizeBox = GetBoolRes("rootResizeBox", FALSE);: ResizeRelative = GetBoolRes("resizeRelative", FALSE);) NIcon = GetBoolRes("normali", TRUE);(- ShowName = GetBoolRes("showName", TRUE);a+ NWindow = GetBoolRes("normalw", TRUE);c. Push = GetBoolRes("pushRelative", FALSE);0 SaveUnder = GetBoolRes("saveUnder", FALSE);& Wall = GetBoolRes("wall", FALSE);4 WarpOnRaise = GetBoolRes("warpOnRaise", FALSE);8 WarpOnIconify = GetBoolRes("warpOnIconify", FALSE);< WarpOnDeIconify = GetBoolRes("warpOnDeIconify", FALSE);$ Zap = GetBoolRes("zap", FALSE); &5 HIconPad = GetIntRes("icon.hPad", DEF_ICON_PAD);o5 VIconPad = GetIntRes("icon.vPad", DEF_ICON_PAD);i; RaiseDelay = GetIntRes("raiseDelay", DEF_RAISE_DELAY);cI PBorderWidth = GetIntRes("popup.borderWidth", DEF_POP_BORDER_WIDTH);tI IBorderWidth = GetIntRes("icon.borderWidth", DEF_ICON_BORDER_WIDTH);e4 PPadding = GetIntRes("popup.pad", DEF_POP_PAD);I MBorderWidth = GetIntRes("menu.borderWidth", DEF_MENU_BORDER_WIDTH);(3 MItemBorder = GetIntRes("menu.itemBorder", 1);t6 MDelta = GetIntRes("menu.delta", DEF_MENU_DELTA);0 MPad = GetIntRes("menu.pad", DEF_MENU_PAD);+ Delta = GetIntRes("delta", DEF_DELTA); . Volume = GetIntRes("volume", DEF_VOLUME);+ Pushval = GetIntRes("push", DEF_PUSH);sE BContext = GetIntRes("borderContext.width", DEF_BCONTEXT_WIDTH);gA ForeColor = GetColorRes("foreground", BlackPixel(dpy, scr));)A BackColor = GetColorRes("background", WhitePixel(dpy, scr));s= IForeground = GetColorRes("icon.foreground", ForeColor);i= IBackground = GetColorRes("icon.background", BackColor);e7 IBorder = GetColorRes("icon.border", IForeground); H ITextForeground = GetColorRes("icon.text.foreground", IForeground);H ITextBackground = GetColorRes("icon.text.background", IBackground);6 PBorder = GetColorRes("popup.border", ForeColor);< PForeground = GetColorRes("popup.foreground", PBorder);> PBackground = GetColorRes("popup.background", BackColor);= MForeground = GetColorRes("menu.foreground", ForeColor);e= MBackground = GetColorRes("menu.background", BackColor);>7 MBorder = GetColorRes("menu.border", MForeground);  /*nL * Create and store the grey and solid pixmaps, and default icon pixmap */I GrayPixmap = XCreatePixmapFromBitmapData(dpy, Pseudo_root(dpy, scr),n gray_bits,a# gray_width, gray_height,a ForeColor,f BackColor,p, (unsigned)DefaultDepth(dpy,scr));J SolidPixmap = XCreatePixmapFromBitmapData(dpy, Pseudo_root(dpy, scr), solid_bits,e& solid_width, solid_height, ForeColor, BackColor,' (unsigned)DefaultDepth(dpy,  scr)); uI IDefPixmap = XCreatePixmapFromBitmapData(dpy, Pseudo_root(dpy, scr),T xlogo32_bits,t* xlogo32_width, xlogo32_height, IForeground, IBackground,' (unsigned)DefaultDepth(dpy,= scr)); t8 IFontInfo = GetFontRes("icon.font", DEF_ICON_FONT);: PFontInfo = GetFontRes("popup.font", DEF_POPUP_FONT);8 MFontInfo = GetFontRes("menu.font", DEF_MENU_FONT);@ MBoldFontInfo = GetFontRes("menu.boldFont", DEF_BOLD_FONT); nK IBackPixmap = GetPixmapRes("icon.backpixmap", GrayPixmap, IForeground,a IBackground);;J IDefPixmap = GetPixmapRes("icon.defpixmap", IDefPixmap, IForeground, IBackground);n #ifdef NEATEN D AbsMinWidth = GetIntRes("neaten.absMinWidth", DEFAULT_ABS_MIN);F AbsMinHeight = GetIntRes("neaten.absMinHeight", DEFAULT_ABS_MIN); S8 RetainSize = GetBoolRes("neaten.retainSize", TRUE);4 KeepOpen = GetBoolRes("neaten.keepOpen", TRUE);, Fill = GetBoolRes("neaten.fill", TRUE);> UsePriorities = GetBoolRes("neaten.usePriorities", TRUE);> FixTopOfStack = GetBoolRes("neaten.fixTopOfStack", TRUE); iG PrimaryIconPlacement = GetStringRes("neaten.primaryIconPlacement",{ DEF_PRIMARY_PLACEMENT);=K SecondaryIconPlacement = GetStringRes("neaten.secondaryIconPlacement", ! DEF_SECONDARY_PLACEMENT);e#endif ) Leave_voidi};/*C * Look up string resource "string". If undefined, return "def_val"  */c#char *GetStringRes(string, def_val)achar *string, *def_val;o{ char *cp; p Entry("GetStringRes") n1 if ((cp = XGetDefault(dpy, NAME, string)) ||+ (cp = XGetDefault(dpy, CLASS, string))) {- if (!strlen(cp))a Leave(def_val) else  Leave(cp)y } Leave(def_val) })/*D * Look up boolean resource "string". If undefined, return "def_val" */#Boolean GetBoolRes(string, def_val)( char *string;lBoolean def_val;{> char *cp;  Entry("GetBoolRes") n1 if ((cp = XGetDefault(dpy, NAME, string)) ||=) (cp = XGetDefault(dpy, CLASS, string)))e if (Pred(cp) > 0) def_val = TRUE;t Leave(def_val) }t/*B * Look up integer resource "string". If undefined or non-numeric, * return def_val. */dint GetIntRes(string, def_val) char *string; int def_val;{  char *cp;  Entry("GetIntRes")  t1 if ((cp = XGetDefault(dpy, NAME, string)) || + (cp = XGetDefault(dpy, CLASS, string))) {OB if (!strlen(cp) || !((*cp >= '0' && *cp <= '9') || *cp == '-')) Leave(def_val) Leave(atoi(cp)) } Leave(def_val) }I/*B * Try to load pixmap file named by resource "string". Return 0 if> * unsuccessful. Otherwise, set width, height and return data. */s*char *GetPixmapDataRes(string, wide, high) char *string; unsigned int *wide, *high;{  char *cp, *cp2; Entry("GetPixmapDataRes") k1 if ((cp = XGetDefault(dpy, NAME, string)) ||p+ (cp = XGetDefault(dpy, CLASS, string))) {o char *data; int junk; m cp2 = expand_from_path(cp); if (!cp2) {N fprintf(stderr, "awm: Can't find pixmap file '%s' for '%s' from %s\n", cp, string,cp2);o Leave(0) }F if (XmuReadBitmapDataFromFile(cp2, wide, high, &data, &junk, &junk) != BitmapSuccess) {G fprintf(stderr, "awm: Can't read pixmap file '%s' for '%s'.\n",  cp, string);p } else {e Leave(data)f } } Leave(0)e})/*G * Try to allocate pixmap resources named by "string", return "def_pix" * if not found. */h,Pixmap GetPixmapRes(string, def_pix, fg, bg) char *string;;Pixmap def_pix;} Pixel fg, bg;{ char *data; Pixmap tmp; unsigned int wide, high;d Entry("GetPixmapRes")9 if (data = GetPixmapDataRes(string, &wide, &high)) {@ tmp = XCreatePixmapFromBitmapData(dpy, Pseudo_root(dpy, scr)," data, wide, high, fg, bg,, (unsigned) DefaultDepth(dpy, scr)); XFree(data);  if (!tmp) { fprintf(stderr,r; "awm: Can't create pixmap '%s', using default.\n",s string);t tmp = def_pix; } } else; tmp = def_pix;R Leave(tmp)  }/*C * Try to allocate color resource named by "string", return "color"rD * if not found.This routine is only used for allocating colors from * the default colormap. */e Pixel GetColorRes(string, color) char *string; Pixel color;{e char *cp; Pixel tmp_color;l Boolean status; extern Pixel LookupColor(); e Entry("GetColorRes")a e1 if ((cp = XGetDefault(dpy, NAME, string)) ||e+ (cp = XGetDefault(dpy, CLASS, string))) { C tmp_color = LookupColor(cp, DefaultColormap(dpy, scr), &status);,& if (!status) /* lookup succeeded */ Leave(tmp_color) else  tmp_color = color; } elseo tmp_color = color;c Leave(tmp_color) }I/*G * Try and get font resource "string", using "default" if not found. Ifl- * neither are available, use server default." */t%XFontStruct *GetFontRes(string, dflt)ichar *string, *dflt;{e char *cp; XFontStruct *tmp;&Fj~AWM.SAVEC[FIELDS.X.AWM]AWM.C;16{Z8> static XFontStruct *def_font = 0; s Entry("GetFontRes") t if (!def_font)i, def_font = XLoadQueryFont(dpy, DEF_FONT); i1 if ((cp = XGetDefault(dpy, NAME, string)) ||T+ (cp = XGetDefault(dpy, CLASS, string))) {T% if (tmp = XLoadQueryFont(dpy, cp))a Leave(tmp) else if (dflt)lB fprintf(stderr, "awm: Can't load %s '%s', trying '%s'.\n", string, cp, dflt);w }@ if (!dflt) /* NULL means we're not supposed to try again */ Leave(NULL)) if (tmp = XLoadQueryFont(dpy, dflt))F Leave(tmp)p elseeW fprintf(stderr, "awm: Can't open default font '%s', using server default.\n", dflt);c Leave(def_font)}PAwmInfoPtr GetAwmInfo(w) Window w; {I static AwmInfoPtr tmp;_ c Entry("GetAwmInfo") p= if (!XFindContext(dpy, w, AwmContext, (caddr_t *) &tmp)) Leave(tmp). else" Leave((AwmInfoPtr)NULL)} AwmInfoPtr RegisterWindow(w) Window w;P{; AwmInfoPtr tmp; XClassHint clh; XWMHints *wm_hints; char *cp; Entry("RegisterWindow") / tmp = (AwmInfoPtr)malloc(sizeof(AwmInfo));E# if (tmp == (AwmInfoPtr)NULL) {n@ fprintf(stderr, "awm: Woe! No memory to register window.\n"); Leave((AwmInfoPtr)NULL) } tmp->client = w;s5 tmp->title = tmp->frame = tmp->icon = (Window)0;e tmp->gadgets = (Window *)0; tmp->name = (char *)0;r tmp->own = (Boolean)FALSE;,: tmp->back = tmp->bold = tmp->BC_back = tmp->BC_bold = tmp->iconPixmap = (Pixmap)0; tmp->state = ST_WINDOW;#ifdef WMSTATE tmp->wm_state.icon=0;% tmp->wm_state.state=NormalState; J XChangeProperty(dpy,w,wm_state_atom,wm_state_atom,32,PropModeReplace," (char *) &tmp->wm_state,2);#endif /* WMSTATE */J tmp->winGC = XCreateGC(dpy, w, (unsigned long)0, (XGCValues *) NULL); /*B * Determine attribute set by first turning on all attributesB * that are set by booleans and then (possibly) override them@ * by checking to see what an individual window might want. */ tmp->attrs = AT_NONE; if (Titles) tmp->attrs |= AT_TITLE; if (UseGadgets) tmp->attrs |= AT_GADGETS; if (Borders)g tmp->attrs |= AT_BORDER;  if (Autoraise)g tmp->attrs |= AT_RAISE; if (IconLabels) tmp->attrs |= AT_ICONLABEL;* if (wm_hints = XGetWMHints(dpy, w)) { if (wm_hints->input)i tmp->attrs |= AT_INPUT; XFree(wm_hints);  }#ifdef RAINBOW tmp->foreColor = ForeColor; tmp->backColor = BackColor;" tmp->grayPixmap = GrayPixmap;$ tmp->solidPixmap = SolidPixmap;#endif1 clh.res_name = clh.res_class = (char *)NULL;,! XGetClassHint(dpy, w, &clh);  if (clh.res_class) {u#ifdef RAINBOW Pixel tmp_color;  Boolean status; IG if (cp = (XGetDefault(dpy, clh.res_class, "wm_option.foreground"))){ I tmp_color = LookupColor( cp, DefaultColormap( dpy, scr ), & status );  if( !status ) tmp->foreColor = tmp_color; }G if (cp = (XGetDefault(dpy, clh.res_class, "wm_option.background"))){tI tmp_color = LookupColor( cp, DefaultColormap( dpy, scr ), & status );  if( !status ) tmp->backColor = tmp_color; }#endif ;A if (cp = (XGetDefault(dpy, clh.res_class, "wm_option.title")))@ tmp->attrs = SetOptFlag(tmp->attrs, AT_TITLE, Pred(cp)); ,C if (cp = (XGetDefault(dpy, clh.res_class, "wm_option.gadgets")))iB tmp->attrs = SetOptFlag(tmp->attrs, AT_GADGETS, Pred(cp));H if (cp = (XGetDefault(dpy, clh.res_class,"wm_option.borderContext")))A tmp->attrs = SetOptFlag(tmp->attrs, AT_BORDER, Pred(cp));AE if (cp = (XGetDefault(dpy, clh.res_class, "wm_option.autoRaise")));@ tmp->attrs = SetOptFlag(tmp->attrs, AT_RAISE, Pred(cp));G if (cp = (XGetDefault(dpy, clh.res_class, "wm_option.icon.labels"))).D tmp->attrs = SetOptFlag(tmp->attrs, AT_ICONLABEL, Pred(cp)); } if (clh.res_name) {#ifdef RAINBOW Pixel tmp_color;t Boolean status;F if (cp = (XGetDefault(dpy, clh.res_name, "wm_option.foreground"))){I tmp_color = LookupColor( cp, DefaultColormap( dpy, scr ), & status );) if( !status ) tmp->foreColor = tmp_color; }F if (cp = (XGetDefault(dpy, clh.res_name, "wm_option.background"))){I tmp_color = LookupColor( cp, DefaultColormap( dpy, scr ), & status );  if( !status )e tmp->backColor = tmp_color; }#endif@ if (cp = (XGetDefault(dpy, clh.res_name, "wm_option.title")))@ tmp->attrs = SetOptFlag(tmp->attrs, AT_TITLE, Pred(cp)); eB if (cp = (XGetDefault(dpy, clh.res_name, "wm_option.gadgets")))B tmp->attrs = SetOptFlag(tmp->attrs, AT_GADGETS, Pred(cp));H if (cp = (XGetDefault(dpy, clh.res_name, "wm_option.borderContext")))A tmp->attrs = SetOptFlag(tmp->attrs, AT_BORDER, Pred(cp));DD if (cp = (XGetDefault(dpy, clh.res_name, "wm_option.autoRaise")))@ tmp->attrs = SetOptFlag(tmp->attrs, AT_RAISE, Pred(cp));F if (cp = (XGetDefault(dpy, clh.res_name, "wm_option.icon.labels")))D tmp->attrs = SetOptFlag(tmp->attrs, AT_ICONLABEL, Pred(cp)); }#ifdef RAINBOW7 /* Has a different fore/back colour been given? */ J if( (tmp->foreColor != ForeColor) || (tmp->backColor != BackColor) ){ /*A1 * Create and store the grey and solid pixmaps0 */ tmp->grayPixmap = ? XCreatePixmapFromBitmapData(dpy, Pseudo_root(dpy, scr),f gray_bits, gray_width, gray_height, tmp->foreColor,  tmp->backColor,h* (unsigned)DefaultDepth(dpy, scr));  tmp->solidPixmap = ,? XCreatePixmapFromBitmapData(dpy, Pseudo_root(dpy, scr),  solid_bits, " solid_width, solid_height, tmp->foreColor,u tmp->backColor,p* (unsigned)DefaultDepth(dpy, scr));  }#endif5 XSaveContext(dpy, w, AwmContext, (caddr_t) tmp);! Leave(tmp)p}t/*> * Sets bit "flag" conditionally, based on state of "mask" and= * "predicate" (mask denotes current state, predicate denotesi * whether change is desired). */t%int SetOptFlag(mask, flag, predicate)sint mask, flag, predicate;{a Entry("SetOptFlag") switch (predicate) { case -1: Leave(mask) break; case 0: if (mask & flag) Leave(mask ^ flag) else Leave(mask)d break;* case 1: Leave(mask | flag)e break;e } Leave(-1);i};/*B * check whether a string denotes an "on" or "off" value. Return 05 * if "off", 1 if "on" and -1 if undefined (or null).a */)Pred(s)ichar *s;{P int i, len; char *tmp;  Boolean ret = -1; Entry("Pred") if (!s) Leave(-1) len = strlen(s);f if (!len) Leave(-1)# tmp = (char *)malloc(len + 1);) if (!tmp) {G fprintf(stderr, "awm: Pred: Can't allocate storage for '%s'!\n", s);g Leave(-1) } strcpy(tmp, s); for (i = 0; i < len; i++)& if (tmp[i] >= 'A' && tmp[i] <= 'Z') tmp[i] += 32;** if (*tmp == 'y' || !strcmp(tmp, "on") || !strcmp(tmp, "true")i || !strncmp(tmp, "enable", 6)) ret = 1;a0 else if (*tmp == 'n' || !strcmp(tmp, "off") || !strcmp(tmp, "false")& || !strncmp(tmp, "disable", 7)) ret = 0;  free(tmp);l Leave(ret)a};/*E * Initialize the default bindings. First, write the character arrayeB * out to a temp file, then point the parser to it and read it in.' * Afterwards, we unlink the temp file.l */LInitBindings(){u char *mktemp(); char *tempfile;6 register FILE *fp; /* Temporary file pointer. */F register char **ptr; /* Default bindings string array pointer. */ c Entry("InitBindings")  /*d' * Create and write the temp file.l */ /*lC * This used to just call mktemp() on TEMPFILE, which was very D * evil as it involved writing on a string constant. This extra1 * mastication is necessary to prevent that.f */5 tempfile = (char *)malloc(strlen(TEMPFILE) + 1);e strcpy(tempfile, TEMPFILE);" sfilename = mktemp(tempfile);/ if ((fp = fopen(tempfile, "w")) == NULL) {c* perror("awm: cannot create temp file"); exit(1);o }/ for (ptr = DefaultBindings; *ptr; ptr++) {f fputs(*ptr, fp);( fputc('\n', fp);o } fclose(fp);  /*n? * Read in the bindings from the temp file and parse them.u */1 if ((yyin = fopen(tempfile, "r")) == NULL) {u( perror("awm: cannot open temp file"); exit(1);r } Lineno = 1; yyparse();' fclose(yyin); unlink(tempfile); free(tempfile); if (Startup_File_Error), Error("Bad default bindings...aborting");  /*"5 * Parse the system startup file, if one exists.m */0 if ((yyin = fopen(SYSFILE, "r")) != NULL) { sfilename = SYSFILE; Lineno = 1; yyparse();( fclose(yyin); if (Startup_File_Error)4 Error("Bad system startup file...aborting"); } Leave_voidt}i/*K * Create the menus and alter any appropriate bindings so that the RTL menuA0 * handle is passed along in subsequent actions. */mCreate_Menus(){d Binding *bptr;w MenuInfo *minfo; MenuLink *lnk;s! extern MenuInfo *FindMenu();p" extern RTLMenu create_menu(); W Entry("Create_Menus") * /* G * We start with the bindings list because we don't want to bother @ * creating a menu that's been declared but not referenced. */1 for(bptr = Blist; bptr; bptr = bptr->next) {  if (bptr->func == DoMenu) {- if (minfo = FindMenu(bptr->menuname))_& bptr->menu = create_menu(minfo); else {C fprintf(stderr, "awm: non-existent menu reference: \"%s\"\n",  bptr->menuname);u Startup_File_Error = TRUE; }r } }. for (lnk = Menus; lnk; lnk = lnk->next) { free(lnk->menu);t free(lnk);o } Leave_voidc}k/*9 * Grab the mouse buttons according to the bindings list.t */tGrab_Buttons(){i Binding *bptr;t A Entry("Grab_Buttons") t /* C * don't grab buttons if you don't have to - allow application 9 * access to buttons unless context includes window.L */2 for (bptr = Blist; bptr; bptr = bptr->next) { if (bptr->context == ROOT)_ NeedRootInput = TRUE;rB else if (bptr->context & WINDOW) /* We gotta grab on windows */ GrabAll(bptr->mask); } Leave_voido};/*G * Register a grab on all windows in the hierarchy. This is better thandI * registering a grab on the RootWindow since it leaves button/key chordsd * available for other contexts. */ GrabAll(mask)Bunsigned int mask;{  unsigned int junk, nkids; Window *kiddies;y e Entry("GrabAll")e )H if (XQueryTree(dpy, DefaultRootWindow(dpy), &junk, &junk, &kiddies, &nkids)) { int i;  p% for (i = 0; i < (int)nkids; i++) {  Window transient;. XWindowAttributes xwa; 7 /* check to see if it's a popup or something */)4 XGetWindowAttributes(dpy, kiddies[i], &xwa);: XGetTransientForHint(dpy, kiddies[i], &transient);F if (xwa.class == InputOutput && xwa.map_state == IsViewable &&9 xwa.override_redirect == False && transient == None)e Grab(mask, kiddies[i]);m } } else 0 Error("awm: Can't XQueryTree in GrabAll!\n"); Leave_void } /*3 * Grab a mouse button according to the given mask.e */) Grab(mask, w)aunsigned int mask; Window w;T{R8 unsigned int m = LeftMask | MiddleMask | RightMask; " Entry("Grab")  switch (mask & m) { case LeftMask:IC XGrabButton(dpy, LeftButton, mask & ModMask, w, TRUE, EVENTMASK,t> GrabModeAsync, GrabModeAsync, None, LeftButtonCursor); break;B r case MiddleMask:iE XGrabButton(dpy, MiddleButton, mask & ModMask, w, TRUE, EVENTMASK,a@ GrabModeAsync, GrabModeAsync, None, MiddleButtonCursor); break;{  case RightMask:D XGrabButton(dpy, RightButton, mask & ModMask, w, TRUE, EVENTMASK,? GrabModeAsync, GrabModeAsync, None, RightButtonCursor);t break;e } Leave_voido}"/*" * Restore cursor to normal state. */oResetCursor(button) int button; {f Entry("ResetCursor")k  switch (button) { case LeftButton:u= XChangeActivePointerGrab(dpy, EVENTMASK, LeftButtonCursor,= CurrentTime); break;  c case MiddleButton:X? XChangeActivePointerGrab(dpy, EVENTMASK, MiddleButtonCursor,- CurrentTime); break;T E case RightButton:> XChangeActivePointerGrab(dpy, EVENTMASK, RightButtonCursor, CurrentTime); break;a } Leave_voidP}(/*" * error routine for .awmrc parser */_ yyerror(s)char*s;R{e Entry("yyerror")s pE fprintf(stderr, "awm: %s: Line %d: %s\n", sfilename, Lineno, s);  Startup_File_Error = TRUE;e Leave_voidm}a/*$ * warning routine for .awmrc parser */c yywarn(s)}char*s;R{B Entry("yywarn") oN fprintf(stderr, "awm: Warning: %s: Line %d: %s\n", sfilename, Lineno, s); Leave_voidC}r/* * Print usage message and quit. */ Usage() {m Entry("Usage")m PQ fputs("Usage: awm [-b] [-i] [-f ] [-e ] [:]\n\n", stderr);K fputs("The -b option bypasses system and default bindings\n", stderr);lD fputs("The -i option ignores the $HOME/.awmrc file\n", stderr);J fputs("The -f option specifies an alternate startup file\n", stderr);N fputs("The -e option specifies a program/script to exec after startup\n", stderr); exit(1);l}p/*! * error handler for X I/O errors) */ /*ARGSUSED*/ XIOError(dsp)a Display *dsp;w{w /* perror("awm"); */ exit(3);p}t/*> * Sets bit "flag" conditionally, based on state of "mas*[FIELDS.X.AWM]BEEP.C;5+,@ ./% 4}P-C0@123KPWO56$$7@8@:̲PH9fG%HJ  #ifndef lint}static char *rcsid_Beep_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Beep.c,v 1.2 89/02/07 20:03:02 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. *//* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group */ #ifndef lint/static char *sccsid = "@(#)Beep.c 3.8 1/24/86";#endif#include "awm.h" /*ARGSUSED*/(Boolean Beep(window, mask, button, x, y);Window window; /* Event window. */>int mask; /* Button/key mask. */@int button; /* Button event detail. */Cint x, y; /* Event mouse position. */{ Entry("Beep")* XBell(dpy, VOLUME_PERCENTAGE(Volume)); Leave(FALSE)}*[FIELDS.X.AWM]BINDINGS.C;5+,@ ./% 44-C0@123KPWO 56 $728PH9fG%HJ #ifndef lintstatic char *rcsid_Bindings_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Bindings.c,v 1.1 89/01/23 15:33:56 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. *//* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group */ #ifndef lint3static char *sccsid = "@(#)Bindings.c 3.8 1/24/86";#endif/*> * Bindings.c Default bindings for the X window manager 'awm' *B * Note: Any changes to this file should also be added to the fileM * /usr/new/lib/X/awm/default.awmrc to keep users informed as to the bindings * contained herein. */char *DefaultBindings[] = {"menu=\"WindowOps\"{","New Window:!\"xterm&\"","RefreshScreen:f.refresh","Redraw:f.redraw","Move:f.move","Resize:f.resize","Lower:f.lower","Raise:f.raise","CircUp:f.circleup","CircDown:f.circledown","AutoIconify:f.iconify","LowerIconify:f.newiconify","NewIconify:f.newiconify","Focus:f.focus","Freeze:f.pause","UnFreeze:f.continue","Restart:f.restart","}","menu=\"Preferences\"{","Bell Loud:!\"xset b 7&\"","Bell Normal:!\"xset b 3&\"","Bell Off:!\"xset b off&\"","Click Loud:!\"xset c 8&\"","Click Soft:!\"xset c on&\"","Click Off:!\"xset c off&\"","Lock On:!\"xset l on&\"","Lock Off:!\"xset l off&\"","Mouse Fast:!\"xset m 4 2&\"", "Mouse Normal:!\"xset m 2 5&\"","Mouse Slow:!\"xset m 1 1&\"","}","f.newiconify=m:w|i:delta l","f.raise=m:w|i:delta l","f.lower=m:w|i:l u","f.raise=m:w:m d","f.resize=m:w:delta m","f.iconify=m:i:m u","f.raise=m:w|i:r d","f.move=m:w|i:delta r","f.circledown=m:r:l d","f.circleup=m:r:r d","f.circledown=m|s::l d","f.menu=:r:m d:\"WindowOps\"", "f.menu=m|s::m d:\"WindowOps\"",""f.menu=m|s::m d:\"Preferences\"","f.circleup=m|s::r d","f.iconify=m|c:w|i:l d","f.newiconify=m|l:w|i:l d","f.raise=m|l:w|i:l u","f.pushright=m|l:w|i:r d","f.pushleft=m|c:w|i:r d","f.pushup=m|l:w|i:m d","f.pushdown=m|c:w|i:m d",0 /* Must NOT be removed. */};*[FIELDS.X.AWM]CIRCLEDOWN.C;5+,EA./% 4-C0@123KPWO56`$786PH9fG%HJ  #ifndef lintstatic char *rcsid_CircleDown_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/CircleDown.c,v 1.2 89/02/07 20:04:31 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. *//* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group= * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,+ Western Software Lab. Converted to X11. */ #ifndef lint5static char *sccsid = "@(#)CircleDown.c 3.8 1/24/86";#endif#include "awm.h" /*ARGSUSED*/.Boolean CircleDown(window, mask, button, x, y);Window window; /* Event window. */>int mask; /* Button/key mask. */@int button; /* Button event detail. */Cint x, y; /* Event mouse position. */{ Entry("CircleDown")8 XCirculateSubwindowsDown(dpy, RootWindow(dpy, scr)); Leave(FALSE)}*[FIELDS.X.AWM]CIRCLEUP.C;4+,A./% 4-C0@123KPWO56@u$7$83#PH9fG%HJ  #ifndef lintstatic char *rcsid_CircleUp_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/CircleUp.c,v 1.2 89/02/07 20:04:35 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. *//* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group= * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,+ Western Software Lab. Converted to X11. */ #ifndef lint3static char *sccsid = "@(#)CircleUp.c 3.8 1/24/86";#endif#include "awm.h" /*ARGSUSED*/,Boolean CircleUp(window, mask, button, x, y);Window window; /* Event window. */>int mask; /* Button/key mask. */@int button; /* Button event detail. */=int x, y; /* Event mouse position. */{ Entry("CircleUp")6 XCirculateSubwindowsUp(dpy, RootWindow(dpy, scr)); Leave(FALSE)}*[FIELDS.X.AWM]CURSORS.C;3+,A. /% 4 J-C0@123KPWO 56i$78?CPH9fG%HJ  #ifndef lintstatic char *rcsid_StoreCursors_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Cursors.c,v 1.1 89/01/23 15:34:10 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. *//* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group< * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group * Convert to X119 * 1.2 -- Gumby cursor added (This was a major revision). */ #ifndef lint7static char *sccsid = "@(#)StoreCursors.c 3.8 1/24/86";#endif#include "awm.h"#include /*/ * Store all the cursors into global variables. */StoreCursors(){ Entry("StoreCursors") /*+ * Main awh~AWM.SAVEAC[FIELDS.X.AWM]CURSORS.C;3 dm cursor and movement cursor. */8 ArrowCrossCursor = XCreateFontCursor(dpy, XC_fleur);& if (ArrowCrossCursor == FAILURE) {< Error("StoreCursors -> Unable to store ArrowCrossCursor."); } /*! * Text cursor used in icons. */3 TextCursor = XCreateFontCursor(dpy, XC_xterm); if (TextCursor == FAILURE) {6 Error("StoreCursors -> Unable to store TextCursor."); } /*+ * Icon cursor used to iconify windows. */2 IconCursor = XCreateFontCursor(dpy, XC_icon); if (IconCursor == FAILURE) {6 Error("StoreCursors -> Unable to store IconCursor."); } /* * Left button main cursor. */> LeftButtonCursor = XCreateFontCursor(dpy, XC_leftbutton); & if (LeftButtonCursor == FAILURE) {< Error("StoreCursors -> Unable to store LeftButtonCursor."); } /*! * Middle button main cursor. */B MiddleButtonCursor = XCreateFontCursor(dpy, XC_middlebutton); ( if (MiddleButtonCursor == FAILURE) {> Error("StoreCursors -> Unable to store MiddleButtonCursor."); } /* * Right button main cursor. */@ RightButtonCursor = XCreateFontCursor(dpy, XC_rightbutton); ' if (RightButtonCursor == FAILURE) {= Error("StoreCursors -> Unable to store RightButtonCursor."); } /*= * Targer cursor used to identify a window for an action. */6 TargetCursor = XCreateFontCursor(dpy, XC_circle); " if (TargetCursor == FAILURE) {8 Error("StoreCursors -> Unable to store TargetCursor."); } /*> * Gumby cursor used in icons if icon is not a typein icon * (otherwise use textcursor */4 GumbyCursor = XCreateFontCursor(dpy, XC_gumby); ! if (GumbyCursor == FAILURE) {7 Error("StoreCursors -> Unable to store GumbyCursor."); } Leave(0)}*[FIELDS.X.AWM]ERRHNDLR.C;3+,A./% 4-C0@123KPWO56$7vk 8 JcPH9fG%HJ  #ifndef lintstatic char *rcsid_errHndlr_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/errHndlr.c,v 1.2 89/02/07 21:24:38 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * */#include #include int errorStatus = False; #ifdef DEBUG-void debug(s, x1, x2, x3, x4, x5, x6, x7, x8)char *s;$long x1, x2, x3, x4, x5, x6, x7, x8;{ static FILE *con = 0; if (!con)# con = fopen("/dev/console", "w");1 fprintf(con, s, x1, x2, x3, x4, x5, x6, x7, x8);}#endif /*ARGSUSED*/int ErrorHandler (dpy, event) Display *dpy; XErrorEvent *event;{ #ifdef DEBUG char *buffer[BUFSIZ];: XGetErrorText(dpy, event->error_code, buffer, BUFSIZ); (void) debug("Hey!\n");* (void) debug("X Error: %s\n", buffer);D (void) debug(" Request Major code: %d\n", event->request_code);B (void) debug(" Request Minor code: %d\n", event->minor_code);; (void) debug(" ResourceId 0x%x\n", event->resourceid);8 (void) debug(" Error Serial #%d\n", event->serial);9 (void) debug(" Current Serial #%d\n", dpy->request);#endif errorStatus = True; return 0;}static char *eventname[] = { "zero", "one", "KeyPress", "KeyRelease", "ButtonPress", "ButtonRelease", "MotionNotify", "EnterNotify", "LeaveNotify", "FocusIn", "FocusOut", "KeymapNotify", "Expose", "GraphicsExpose", "NoExpose", "VisibilityNotify", "CreateNotify", "DestroyNotify", "UnmapNotify", "MapNotify", "MapRequest", "ReparentNotify", "ConfigureNotify", "ConfigureRequest", "GravityNotify", "ResizeRequest", "CirculateNotify", "CirculateRequest", "PropertyNotify", "SelectionClear", "SelectionRequest", "SelectionNotify", "ColormapNotify", "ClientMessage", "MappingNotify",};void print_event_info(s, ev)char *s; XEvent *ev;{D fprintf(stderr, "%s: EVENT %s(%d) on %x\n", s, eventname[ev->type], ev->type, ev->xany.window);}*[FIELDS.X.AWM]ERROR.C;3+,A./% 4-C0@123KPWO56$7 8ۄPH9fG%HJ #ifndef lintstatic char *rcsid_Error_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Error.c,v 1.1 89/01/23 15:34:11 jkh Exp $"; #endif lint#include #include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. *//* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group * 1.3 -- Cleanup. Fixed bug. */ #ifndef lint0static char *sccsid = "@(#)Error.c 3.8 1/24/86";#endif #ifdef titan#include #endif#include "awm.h"extern Boolean desktop_execd;extern char execfile[];/*C * Default error reporting routine. Called when a random awm error * is encountered. */Error(s)'char *s; /* Error description string */{ Entry("Error")$ fprintf(stderr, "awm: %s\n", s); if (!desktop_execd) {$ if (access(execfile, X_OK) == 0) { if (fork() == 0) { #ifdef SYSV setpgrp();#else setpgrp(0, getpid());#endif signal(SIGHUP, SIG_DFL); signal(SIGQUIT, SIG_DFL); signal(SIGINT, SIG_DFL);/ execl("/bin/sh", "sh", "-c", execfile, 0); _exit(127); } else desktop_execd = TRUE; } } Cleanup(); exit(1);}void Warning(s)'char *s; /* Error description string */{ Entry("Warning")- fprintf(stderr, "awm: warning: %s\n", s); Leave_void}*[FIELDS.X.AWM]EXP_PATH.C;5+,"./% 4-C0D123KPWO 56[ 7 , 8@PH9fG%HJ #ifndef lintstatic char *rcsid_exp_path_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/exp_path.c,v 1.2 89/02/07 21:24:42 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * */"#if defined(PCS) || defined(titan)#include #endif #ifndef VMS#include #endif#include #include "awm.h"/*! * WARNING: This code is obscure. * Modify at your Own Risk. */char *expand_file(s)register char *s;{( static char tmp[256], *cp, err[80]; Entry("expand_file")  /* zero tmp */ tmp[0] = 0; if (*s == '/') Leave(s) if (*s == '~') {& if (s[1] == '/') { /* It's $HOME */- if (!(cp = (char *)getenv("HOME"))) {2 sprintf(err, "expand: Can't find $HOME!\n"); yywarn(err); Leave(0) } strcpy(tmp, cp); strcat(tmp, s + 1); Leave(tmp) }! else { /* it's another user */ #ifdef VMS /* not-supported */6 sprintf(err, "expand: user is NOT supported\n"); yywarn(err); Leave(0)#else struct passwd *pwd; char uname[32]; int i;% for (i = 1; s[i] != '/'; i++) uname[i - 1] = s[i]; uname[i] = '\0'; pwd = getpwnam(uname); if (!pwd) {< sprintf(err, "expand: user '%s' not found.\n", uname); yywarn(err); Leave(0) }! strcpy(tmp, pwd->pw_dir); strcat(tmp, s + i); Leave(tmp)#endif } } else Leave(s)}char *deblank(s)register char *s;{ Entry("deblank") if (!s) Leave(s), while (*s && (*s == ' ' || *s == '\t')) s++; Leave(s)}char *expand_from_path(s)register char *s;{ char tmp[256], *tm; int i, plen; Entry("expand_from_path") tmp[0] = '\0'; s = deblank(s); if (!s || !*s) Leave(0) s = expand_file(s); if (!s) Leave(0) if (!access(s, R_OK)) Leave(s) /*J * If it starts with a slash, we know it either expanded and couldn'tH * be found, or that it started with a slash in the first place and% * just plain couldn't be found. */ if (*s == '/') Leave(0) /*H * At this stage we haven't found the file by name, so it's time to * search the path. */ if (!awmPath || !*awmPath) Leave(0) plen = strlen(awmPath); i = 0; while (1) { int p, l;  tmp[0] = '\0';> while (i < plen && awmPath[i] == ' ' || awmPath[i] == '\t') i++;H for (p = i; p < plen && awmPath[p] != ' ' && awmPath[p] != '\t'; p++) tmp[p - i] = awmPath[p]; if (!*tmp) Leave(0) tmp[p - i] = '\0'; i = p; tm = expand_file(tmp); if (!tm || !*tm) continue; l = strlen(tm); if (l < 1) continue; #ifdef VMS6 if (tm[l - 1] != ':') { /* append / if necessary */ tm[l] = ':'; tm[++l] = '\0'; }#else6 if (tm[l - 1] != '/') { /* append / if necessary */ tm[l] = '/'; tm[++l] = '\0'; }#endif strcat(tm, s); if (!access(tm, R_OK)) Leave(tm) }}*[FIELDS.X.AWM]FOCUS.C;3+,B./% 4n-C0@123KPWO56 $7  8 ijPH9fG%HJ #ifndef lintstatic char *rcsid_Focus_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Focus.c,v 1.2 89/02/07 20:04:46 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. *//* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group= * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,+ Western Software Lab. Converted to X11. */ #ifndef lint0static char *sccsid = "@(#)Focus.c 3.8 1/24/86";#endif#include "awm.h"extern Window FocusWindow; /*ARGSUSED*/)Boolean Focus(window, mask, button, x, y)%Window window; /* Event window. */#int mask; /* Button/key mask. */)int button; /* Button event detail. */(int x, y; /* Event mouse position. */{ AwmInfoPtr awi; Entry("Focus"); awi = GetAwmInfo(window); if (awi) window = awi->client;C XSetInputFocus(dpy, window, RevertToPointerRoot, CurrentTime);( if (window != RootWindow(dpy, scr)) FocusSetByUser = TRUE; else FocusSetByUser = FALSE; FocusSetByWM = FALSE; FocusWindow = window; Leave(FALSE)} /*ARGSUSED*/+Boolean UnFocus(window, mask, button, x, y)%Window window; /* Event window. */#int mask; /* Button/key mask. */)int button; /* Button event detail. */(int x, y; /* Event mouse position. */{ Entry("UnFocus");H XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); FocusSetByUser = FALSE; FocusSetByWM = FALSE;( FocusWindow = RootWindow(dpy, scr); Leave(FALSE)}*[FIELDS.X.AWM]FOCUSCHNG.C;10+,./% 4$-C0D123KPWO565@ҧ73* 8@2PH9fG%HJ #ifndef lintstatic char *rcsid_FocusChng_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/FocusChng.c,v 1.2 89/02/07 20:04:50 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//* * MODIFICATION HISTORY *( * 001 -- Jordan Hubbard, U.C. Berkeley.$ * Hacks for autoraise and titles.) * 002 -- Jordan Hubbard, Ardent Computer+ * Window pixmap changes on focus in/out.I * 1.4 -- Fixed Focus In/Out handling. Created LightsOn() and LightsOff()5 * to break out the actual process of "highlighting".2 * 1.5 -- Added dynamic installation of colormaps. */#include "awm.h" #ifdef PCS#include #endif /* PCS */ #ifdef titan#include #endif /* titan */Window FocusWindow;HandleFocusIn(ev) XEvent *ev;{4 XEnterWindowEvent *e = (XEnterWindowEvent *)ev; Window w = e->window; AwmInfoPtr awi; XEvent event; Entry("HandleFocusIn") ? if (!(Hilite || Autoraise || InstallColormap) || Snatched) Leave(FALSE) awi = GetAwmInfo(w);2 if (!awi) /* probably a menu or something */ Leave(FALSE)? w = (FrameFocus && awi->frame) ? awi->frame : awi->client;C if (e->detail != NotifyInferior && (e->focus || FrameFocus)) { struct timeval foo; if (e->type != FocusIn) { foo.tv_sec = 0;) foo.tv_usec = RaiseDelay * 1000; /*: * Sleep for awhile to avoid race conditions and give any1 * potential leave events a chance to get here.. */ #ifdef VMS usleep(foo.tv_usec);#else! select(0, 0, 0, 0, &foo);#endif/ /* Did we leave this window already? */@ if (XCheckTypedWindowEvent(dpy, w, LeaveNotify, &event))3 if (event.xcrossing.detail != NotifyInferior) Leave(FALSE) /*% * Install a colormap, if necessary. */ if (InstallColormap) { XWindowAttributes xwa;) XGetWindowAttributes(dpy, w, &xwa);* XInstallColormap(dpy, xwa.colormap); } /*+ * If Autoraise is set, raise that puppy.. */2 if (Autoraise && (awi->attrs & AT_RAISE))A XRaiseWindow(dpy, (awi->frame) ? awi->frame : awi->client);< if (!FocusSetByUser && FocusWindow != awi->client && (awi->attrs & AT_INPUT)) { if (FrameFocus) {9 XSetInputFocus(dpy, awi->client, RevertToPointerRoot, CurrentTime); FocusSetByWM = TRUE; } FocusWindow = awi->client; } else Leave(FALSE) } else {" FocusWindow = awi->client; FocusSetByWM = FALSE; } LightsOn(awi); } Leave(FALSE)}HandleFocusOut(ev) XEvent *ev;{4 XLeaveWindowEvent *e = (XEnterWindowEvent *)ev; Window w = e->window; AwmInfoPtr awi; XEvent event; Entry("HandleFocusOut") awi = GetAwmInfo(w);1 if (!awi) /* probably a menu or something */ Leave(FALSE)? if (!(Hilite || Autoraise || InstallColormap) || Snatched) Leave(FALSE)@ w = (FrameFocus && awi->frame) ? awi->frame : awi->client;C if (e->detail != NotifyInferior && (e->focus || FrameFocus)) { if (e->type != FocusOut) {0 /* Did we come back into this window? */B if (XCheckTypedWindowEvent(dpy, w, EnterNotify, &event)) {3 if (event.xcrossing.detail != NotifyInferior) Leave(FALSE) } if (!FocusSetByUser) { if (FrameFocus) {9 XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); FocusSetByWM = TRUE; }) FocusWindow = RootWindow(dpy, scr); } else Leave(FALSE) } else {+ FocusWindow = RootWindow(dpy, scr); FocusSetByWM = FALSE; } if (InstallColormap)9 XInstallColormap(dpy, DefaultColormap(dpy, scr)); LightsOff(awi); } Leave(FALSE)}/*> * Turns higlighting off for a window. Counterpart to LightsOn */LightsOff(awi)AwmInfoPtr awi;{ Entry("LightsOff")2 /* set the window border to "gray" stipple */! if (awi->attrs & AT_INPUT) {#ifndef RAINBOW if (BorderHilite)* SetBorderPixmaps(awi, GrayPixmap);#else if (BorderHilite)/ SetBorderPixmaps(awi, awi->grayPixmap);#endif if (awi->frame) {$ if (awi->back && awi->title)1 XSetWindowBackgroundPixmap(dpy, awi->title, awi->back);7 if (awi->BC_back && (awi->attrs & AT_BORDER)) {1 XSetWindowBackgroundPixmap(dpy, awi->frame, awi->BC_back);$ XClearWindow(dpy, awi->frame); }& PaintTitle(awi->title, FALSE); } XSync(dpy, 0); } Leave(FALSE)}/*@ * Highlight a window. This may involve shuffling pixmaps around2 * and affecting more than just the client window. */ LightsOn(awi)AwmInfoPtr awi;{ Entry("LightsOn")! if (awi->attrs & AT_INPUT) {#ifndef RAINBOW if (BorderHilite)+ SetBorderPixmaps(awi, SolidPixmap);#else if (BorderHilite)0 SetBorderPixmaps(awi, awi->solidPixmap);#endif if (awi->frame) {& if (awi->bold && awi->title) {1 XSetWindowBackgroundPixmap(dpy, awi->title, awi->bold);# PaintTitle(awi->title, TRUE); }7 if (awi->BC_bold && (awi->attrs & AT_BORDER)) {1 XSetWindowBackgroundPixmap(dpy, awi->frame, awi->BC_bold);$ XClearWindow(dpy, awi->frame); } XSync(dpy, 0); } } Leave(FALSE)}void SetBorderPixmaps(awi, pix)AwmInfoPtr awi; Pixmap pix;{ Entry("SetBorderPixmaps")3 XSetWindowBorderPixmap(dpy, awi->client, pix); if (awi->frame) { if (awi->title)1 XSetWindowBorderPixmap(dpy, awi->title, pix);0 XSetWindowBorderPixmap(dpy, awi->frame, pix); } Leave_void}*[FIELDS.X.AWM]GADGET.C;3+,B./% 42-C0@123KPWO56`%7!a 8 ePH9fG%HJ #ifndef lintstatic char *rcsid_Gadget_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Gadget.c,v 1.2 89/02/07 20:04:53 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//* * MODIFICATION HISTORY ** * 001 -- Jortan Hubbard, Ardent Computer. * Gadget boxes in title bars.* * 1.2 -- Jordan Hubbard, Ardent Computer.9 * GadgetBorders used in placement calculations, initial@ * gadget positions calculated correcly. (Chris Thewalt fixes).A * 1.3 -- Color handling changed to deal with multiple colormaps.4 * 1.4 -- Fixed really silly bug with gadget offset. * */#include "awm.h"#include extern XContext AwmContext;void PaintGadgets();AwmInfoPtr IsGadgetWin(w, gnum) Window w; int *gnum;{ AwmInfoPtr awi; int i; Entry("IsGadgetWin")? if (!XFindContext(dpy, w, AwmContext, (caddr_t *) &awi)) { if (!awi->gadgets)& Leave((AwmInfoPtr)NULL)# for (i = 0; i < NumGadgets; i++)# if (awi->gadgets[i] == w) { if (gnum) *gnum = i; Leave(awi) } } Leave((AwmInfoPtr)NULL)}/*= * This routine adds and/or places gadgets onto a title bar. */int PutGadgets(w) Window w;{ int i, dir; int rx, lx, nx, ny; XWindowAttributes xwa; XSetWindowAttributes swa; Colormap cmap; unsigned long valuemask; GadgetDecl *gdec; AwmInfo *awi; Boolean change = FALSE; Window tmp; Entry("PutGadgets")* /* are there any gadgets declared? */ if (NumGadgets < 1) Leave_void) /* does this window have a title? */ if (!(awi = IsTitled(w))) Leave_void$ if (!(awi->attrs & AT_GADGETS)) Leave_voidA /* if the window already has gadgets, this is a reshuffle */ if (awi->gadgets) change = TRUE; elseD awi->gadgets = (Window *)malloc(sizeof(Window) * NumGadgets + 1); if (!awi->gadgets) {G fprintf(stderr, "PutGadgets: Can't allocate memory for gadgets!\n"); Leave_void }D if (XGetWindowAttributes(dpy, awi->title, &xwa) == BadWindow) {H fprintf(stderr, "PutGadgets: Can't get attrs for client window %x\n", w); Leave_void }6 /* define some initial positioning information */ dir = RightGadgetGravity; lx = 0; rx = xwa.width; cmap = xwa.colormap;8 valuemask = CWBackPixel | CWEventMask | CWColormap;K swa.event_mask = (ButtonPressMask | ButtonReleaseMask | ExposureMask); swa.colormap = cmap;5 for (i = 0; i < NumGadgets && Gadgets[i]; i++) { gdec = Gadgets[i];* /* Does gadget have its own gravity? */( if (gdec->gravity != NoGadgetGravity) dir = gdec->gravity; ny = xwa.height - gdec->high; if (ny <= 0)' gdec->high = xwa.height; else ny = (ny / 2) - 1; if (ny < 0) ny = 0;" if (dir == LeftGadgetGravity) { nx = lx + gdec->offset;: if (lx != 0) /* not first time through, add pad */ nx += GadgetPad; if (nx < 0) nx = 0; lx = nx + gdec->wide;( dir = RightGadgetGravity; }) else if (dir == RightGadgetGravity) { A nx = rx - gdec->wide - gdec->offset - (2 * GadgetBorder); if (rx != xwa.width) nx -= GadgetPad; rx = nx - GadgetBorder;' dir = LeftGadgetGravity; } else /* Center Gravity */; nx = ((xwa.width - gdec->wide) / 2) + gdec->offset;- if (change == FALSE || !awi->gadgets[i]) {? swa.background_pixel = GetPixel(gdec->backcolor, cmap);F tmp = awi->gadgets[i] = XCreateWindow(dpy, awi->title, nx, ny," gdec->wide, gdec->high, GadgetBorder, xwa.depth, xwa.class,! xwa.visual, valuemask, &swa); if (!tmp) {> fprintf(stderr, "PutGadgets: Can't create gadget #%d\n", i); Leave_void } if (gdec->data) { Pixmap pix;= pix = XCreatePixmapFromBitmapData(dpy, tmp, gdec->data,# gdec->wide, gdec->high,, GetPixel(gdec->forecolor, cmap),, GetPixel(gdec->backcolor, cmap), xwa.depth); if (!pix) {D fprintf(stderr, "PutGadgets: Unable to create pixmap for #%d\n", i);< fprintf(stderr, "Using grey...\n");#ifndef RAINBOW* pix = GrayPixmap;#else/ pix = awi->grayPixmap;#endif }0 XSetWindowBackgroundPixmap(dpy, tmp, pix); XFreePixmap(dpy, pix); } XMapWindow(dpy, tmp);: XSaveContext(dpy, tmp, AwmContext, (caddr_t) awi); } else2 XMoveWindow(dpy, awi->gadgets[i], nx, ny); }M if (change == FALSE) /* make sure the window array is null terminated */) awi->gadgets[i] = (Window)NULL; PaintGadgets(w); Leave_void}int FreeGadget(n)int n;{ Entry("FreeGadget") if (Gadgets[n]->data) XFree(Gadgets[n]->data); if (Gadgets[n]->name) free(Gadgets[n]->name); if (Gadgets[n]) free(Gadgets[n]);}int CheckGadgets(){ int i, status = 0; Entry("CheckGadgets")% for (i = 0; i < NumGadgets; i++) if (!Gadgets[i]) {= fprintf(stderr, "awm: Gadget #%d is not declared!\n", i);G fprintf(stderr, "All gadgets from 0 to %d must be declared.\n", NumGadgets - 1); status = 1; } Leave(status)}Boolean ResetGadgets(){ int i; Entry("ResetGadgets")' for (i = 0; i < NumGadgets; i++) { FreeGadget(i); Gadgets[i] = 0; } NumGadgets = 0; if (Gadgets) { free(Gadgets); GadgeFw~AWM.SAVEBC[FIELDS.X.AWM]GADGET.C;3 ts = 0; }} void DestroyGadgets(w) Window w;{ int i; AwmInfoPtr awi; Entry("DestroyGadgets") if (!(awi = IsTitled(w))) Leave_void if (!awi->gadgets) Leave_void5 for (i = 0; i < NumGadgets && Gadgets[i]; i++) {4 XDeleteContext(dpy, awi->gadgets[i], AwmContext);( XDestroyWindow(dpy, awi->gadgets[i]); } free(awi->gadgets); awi->gadgets = 0; Leave_void}void PaintGadgets(w) Window w;{ int i, y, x = 0; AwmInfoPtr awi; GadgetDecl *gdec; XWindowAttributes xwa; Entry("PaintGadgets") if (!(awi = IsTitled(w))) Leave_void if (!awi->gadgets) Leave_void2 XGetWindowAttributes(dpy, awi->client, &xwa);5 for (i = 0; i < NumGadgets && Gadgets[i]; i++) { gdec = Gadgets[i]; if (!gdec->data) { XGCValues gcv;' gcv.font = gdec->fontInfo->fid;A gcv.foreground = GetPixel(gdec->forecolor, xwa.colormap);A gcv.background = GetPixel(gdec->backcolor, xwa.colormap);; XChangeGC(dpy, awi->winGC, (GCFont | GCForeground | GCBackground), &gcv);D if (strlen(gdec->name) == 1) { /* it's a glyph (we think) */ XFontStruct *real_font; XCharStruct char_info;+ int char_number, index, byte1, byte2;! real_font = gdec->fontInfo;" char_number = gdec->name[0];( char_info = real_font->max_bounds; index = char_number; if (real_font->per_char) {9 if (!real_font->min_byte1 && !real_font->max_byte1) {: if (char_number < real_font->min_char_or_byte2 ||1 char_number > real_font->max_char_or_byte2)' index = real_font->default_char;/ index -= real_font->min_char_or_byte2; } else { byte2 = index & 0xff;# byte1 = (index>>8) & 0xff;, if (byte1 < real_font->min_byte1 ||% byte1 > real_font->max_byte1 ||- byte2 < real_font->min_char_or_byte2 ||- byte2 > real_font->max_char_or_byte2) {. byte2 = real_font->default_char & 0xff;1 byte1 = (real_font->default_char>>8)&0xff; }' byte1 -= real_font->min_byte1;/ byte2 -= real_font->min_char_or_byte2;8 index = byte1 * (real_font->max_char_or_byte2 -/ real_font->min_char_or_byte2 + 1) + byte2; }+ char_info = real_font->per_char[index]; }0 x = 1 - GadgetBorder - char_info.lbearing; y = char_info.ascent; } else {< y = (gdec->high + (gdec->fontInfo->max_bounds.ascent -4 gdec->fontInfo->max_bounds.descent)) / 2; x = GadgetBorder; }8 XDrawString(dpy, awi->gadgets[i], awi->winGC, x,2 y, (char *) gdec->name, strlen(gdec->name)); } } Leave_void}*[FIELDS.X.AWM]GETBUTTON.C;5+,../% 4..h-C0D123KPWO/56ҧ7ۋ 8 cPH9fG%HJ\ #ifndef lintstatic char *rcsid_GetButton_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/GetButton.c,v 1.3 89/02/07 22:39:19 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. *//* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering GroupM * 001 -- L. Guarino Reid, DEC Ultrix Engineering Group, Western Software Lab * February 16, 1987@ * Add EnterWindow, LeaveWindow, and MouseMotion as recognizedC * awm buttons for awm menus. Add bug fixes to prevent mem faults * if icon_str is NULL.7 * 002 -- L. Guarino Reid, DEC Ultrix Engineering Group * April 16, 1987 * Convert to X11E * 003 -- J. Hubbard, U.C. Berkeley. Title/gadget box event handling. * December 3, 1987.K * 004 -- J.Hubbard, Ardent Computer. More conformance with ICCCM. Merge of * changes from R2 uwm. */ #ifndef lint4static char *sccsid = "@(#)GetButton.c 3.8 1/24/86";#endif/*I * GetButton - This subroutine is used by the Ardent Window Manager (awm)B * to acquire button events. It waits for a button event to occur0 * and handles all event traffic in the interim. * * File: GetButton.c */#include "awm.h"#include extern XContext AwmContext;extern Window FocusWindow;*#define ICONSTR (icon_str ? icon_str : "")K/* Amount of padding between text in a title bar and the edge of the bar */ #define PAD 1static Icon_modified = FALSE;Boolean GetButton(b_ev)(XEvent *b_ev; /* Button event packet. */{#define STRLEN 50/ char *icon_str; /* Icon's name string. */? register int icon_str_len; /* Icon name string lenght. */; register int key_char; /* Key press character code. */9 register int icon_x; /* Icon window X coordinate. */9 register int icon_y; /* Icon window Y coordinate. */; register unsigned int icon_w; /* Icon window width. */@ register unsigned int icon_h; /* Icon window height. */ 4 int status; /* Routine call return status. */% Window icon; /* Icon window. */B XWindowAttributes win_info; /* Icon window info structure. */6 char kbd_str[STRLEN]; /* Keyboard string. */= int nbytes; /* Keyboard string length. */8 int i; /* Iteration counter. */ Window win; /* scratch */ AwmInfoPtr awi;! extern char *GetTitleName();  Entry("GetButton")  /*H * Get next event from input queue and store it in the event packet * passed to GetButton. */  XNextEvent(dpy, b_ev);N /* print_event_info("mainloop", b_ev); /* debugging for event handling */ /*D * The event occured on the root window, check for substructure= * changes. Otherwise, it must be a mouse button event.  */5 if (b_ev->xany.window == RootWindow(dpy, scr)) { switch (b_ev->xany.type) { case CreateNotify: case UnmapNotify: case ReparentNotify: case ConfigureNotify: case GravityNotify: case MapNotify: case CirculateNotify: Leave(FALSE)  case MappingNotify:8 XRefreshKeyboardMapping((XMappingEvent *) b_ev); Leave(FALSE) case MapRequest: $ CheckMap(b_ev->xmap.window); Leave(FALSE) case ConfigureRequest: 2 Configure((XConfigureRequestEvent *)b_ev); Leave(FALSE)  case CirculateRequest: + Circulate((XCirculateEvent *)b_ev); Leave(FALSE)  case DestroyNotify:0 RemoveIcon(b_ev->xdestroywindow.window); Leave(FALSE) case FocusIn:7 if (b_ev->xfocus.detail == NotifyPointerRoot) { if (FocusSetByUser) {9 XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); FocusSetByUser = FALSE;' FocusWindow = RootWindow(dpy, scr); } } Leave(FALSE)  case FocusOut:7 if (b_ev->xfocus.detail == NotifyPointerRoot) {5 if (FocusSetByUser == FALSE && !FocusSetByWM) {9 XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime);' FocusWindow = RootWindow(dpy, scr); } } Leave(FALSE)  case ButtonPress: case ButtonRelease: Leave(TRUE) default:  Leave(FALSE)  } }  /*E * If the event type is EnterWindow, LeaveWindow, or MouseMoved," * we are processing a menu. : * If the event type is ButtonPress or ButtonRelease, * we have a button event.@ * If it's an expose, then we may have exposed a title bar.A * If it's a Notify, we've probably frobbed a titled window. */  switch (b_ev->type) { XEvent e_fake; case MotionNotify:  case ButtonPress:  case ButtonRelease:  Leave(TRUE) break; case FocusIn: if (!FocusSetByWM) {( e_fake.xcrossing.type = FocusIn;& e_fake.xcrossing.focus = TRUE;9 e_fake.xcrossing.window = b_ev->xcrossing.window; HandleFocusIn(&e_fake); } Leave(FALSE) break; case FocusOut: if (!FocusSetByWM) {) e_fake.xcrossing.type = FocusOut;& e_fake.xcrossing.focus = TRUE;9 e_fake.xcrossing.window = b_ev->xcrossing.window; HandleFocusOut(&e_fake); } Leave(FALSE) break;  case EnterNotify: HandleFocusIn(b_ev); Leave(FALSE) case LeaveNotify:  HandleFocusOut(b_ev); Leave(FALSE) case ConfigureRequest:- Configure((XConfigureRequestEvent *)b_ev); Leave(FALSE) case MapRequest: CheckMap(b_ev->xmap.window); Leave(FALSE); case MapNotify: Leave(FALSE) break;  case UnmapNotify: win = b_ev->xunmap.window;' if (!(awi = GetAwmInfo(win))) Leave(FALSE) if (IsIcon(win, None)) Leave(FALSE)" XUnmapWindow(dpy, awi->frame); Leave(FALSE) break; case DestroyNotify:% win = b_ev->xdestroywindow.window;' if (!(awi = GetAwmInfo(win))) Leave(FALSE) if (win != awi->title) {9 /* remove any icon associated with this window */ RemoveIcon(win);4 /* remove the frame/titlebar (if present) */ NoDecorate(win, TRUE);2 /* punt the rest of the per-window info */5 XDeleteContext(dpy, awi->client, AwmContext);l free(awi); } Leave(FALSE) case PropertyNotify:o win = b_ev->xproperty.window;' if (!(awi = GetAwmInfo(win))). Leave(FALSE);#ifdef WMSTATEH if (!(b_ev->xproperty.atom==wm_state_atom)) /* ignore state change */#endif /* WMSTATE */! switch(b_ev->xproperty.atom) {o case XA_WM_COMMAND: case XA_WM_HINTS: case XA_WM_CLIENT_MACHINE:i break; case XA_WM_ICON_NAME:$ if (Icon_modified == TRUE) { /*= * Icon was modified by type-in (I still think that's ae9 * gross feature, but some people like it... sigh),s * ignore this event.n */b( Icon_modified = FALSE; /* reset */ Leave(FALSE) }* /*1 * Icon was modifed in a more civilized fashion.n */F if (awi->icon && awi->own && awi->iconPixmap == IBackPixmap) { win = awi->icon;9 status = XGetWindowAttributes(dpy, win, &win_info);d* icon_str = GetIconName(awi->client);5 icon_str_len = icon_str ? strlen(icon_str) : 0;g: if (win_info.width != XTextWidth(IFontInfo, ICONSTR, strlen(ICONSTR)) +  (HIconPad << 1)) {p XResizeWindow(dpy, win, ) XTextWidth(IFontInfo, ICONSTR,a strlen(ICONSTR)) +/ (HIconPad << 1), IFontInfo->ascent +f1 IFontInfo->descent + (VIconPad << 1));s }* XClearWindow(dpy, win);W if (icon_str_len != 0) {0 XDrawImageString(dpy, win, IconGC, HIconPad,, VIconPad+IFontInfo->ascent, icon_str, icon_str_len);F free(icon_str);E }S }A break; case XA_WM_ICON_SIZE: break; case XA_WM_NAME:* if (awi->title) {N if (awi->name) free(awi->name);$ awi->name = GetTitleName(win);4 PaintTitle(win, (FocusWindow == awi->client)); } break; case XA_WM_NORMAL_HINTS:a case XA_WM_SIZE_HINTS:G case XA_WM_ZOOM_HINTS:R break; default:u9 fprintf(stderr, "awm: Got unknown property %d\n",E b_ev->xproperty.atom);e } Leave(FALSE)* break;o r m case Expose:  win = b_ev->xexpose.window;= if (!(awi = GetAwmInfo(win))) /* probably a menu */e Leave(FALSE)1 if (awi->title == win) {*' if (b_ev->xexpose.count == 0) {g XEvent evt;d' /* Eat up any previous exposes */ < while (XCheckTypedWindowEvent(dpy, awi->title, Expose, &evt));f4 PaintTitle(win, (FocusWindow == awi->client)); if (awi->gadgets)1 PaintGadgets(win); }- Leave(FALSE) } break;W default: break;r } . /*s: * If we got this far, the event must be for an icon. */ win = b_ev->xany.window;o" if (!(awi = GetAwmInfo(win))) Leave(FALSE)8 status = XGetWindowAttributes(dpy, win, &win_info); if (status == FAILURE)c Leave(FALSE)A f$ if (b_ev->type == MapNotify ||  b_ev->type == UnmapNotify || b_ev->type == CreateNotify ||d! b_ev->type == ReparentNotify ||v b_ev->type == GravityNotify ||" b_ev->type == CirculateNotify || b_ev->type == ConfigureNotify) Leave(FALSE)  s /*c/ * Initialize the icon position variables.  */ icon_x = win_info.x;c icon_y = win_info.y;g n /* ? * Get the name of the window associated with the icon ando * determine its length.  */ if (!awi->icon) Leave(FALSE)t /* J * If we don't own it, or it's got a background pixmap, we don't have * to repaint it. */7 if (!awi->own || (awi->iconPixmap != IBackPixmap))d Leave(FALSE)i icon = awi->icon;) icon_str = GetIconName(awi->client); 4 icon_str_len = icon_str ? strlen(icon_str) : 0; * /* J * If the event is a window exposure event and the icon's name stringI * is not of zero length, simply repaint the text in the icon window* * and return FALSE.  */< if (b_ev->type == Expose && (!Freeze || Frozen == 0)) {7 if (win_info.width != XTextWidth(IFontInfo, ICONSTR, + strlen(ICONSTR))+(HIconPad << 1)) {,! XResizeWindow(dpy, icon, "& XTextWidth(IFontInfo, ICONSTR,( strlen(ICONSTR)) + (HIconPad << 1),1 IFontInfo->ascent + IFontInfo->descent + e (VIconPad << 1));e } XClearWindow(dpy, icon); if (icon_str_len != 0) {x# XDrawImageString(dpy, icon,1 IconGC, HIconPad, VIconPad+IFontInfo->ascent,i icon_str, icon_str_len); /** * Remember to free the icon name string. */ free(icon_str);t } Leave(FALSE)N }#ifndef NO_ICON_TYPIN  /*aI * If we have gotten this far event can only be a key pressed event.  */  /* 2 * We convert the key pressed event to ascii. */? nbytes = XLookupString((XKeyEvent *)b_ev, kbd_str, STRLEN,f1 (KeySym *) NULL, (XComposeStatus *) NULL);   /*i= * If kbd_str is a "non-string", then don't do anything. */0 if (nbytes == 0 || !kbd_str || !*kbd_str) { if (icon_str) free(icon_str);; Leave(FALSE)A }# for (i = 0; i < nbytes; i++) {f key_char = kbd_str[i];r /*F * If the key was , then delete a character from the end of * the name, return FALSE.t *C * If the key was , then wipe out the entire window name * and return FALSE.  *e; * All other ctrl keys are squashed and we return FALSE.f *tG * All printable characters are appended to the window's name, whichS9 * may have to be grown to allow for the extra length.i */ if (key_char == '\177') { /* *  */ if (icon_str_len > 0) {  icon_str_len--;$ icon_str[icon_str_len] = '\0'; }  }! else if (key_char == '\025') { /* *  */ if (icon_str_len > 0) {e icon_str_len = 0;e icon_str[0] = '\0'; }a }6 else if (key_char < IFontInfo->min_char_or_byte2 ||/ key_char > IFontInfo->max_char_or_byte2) {e /*4 * Any other random (non-printable) key; ignore it. */ /* do nothing */ ; }b else {a /* * ASCII Alphanumerics. */ if (icon_str == NULL)_4 icon_str = (char *) malloc (icon_str_len + 2); else? icon_str = (char *)realloc(icon_str, (icon_str_len + 2));u if (icon_str == NULL) {  errno = ENOMEM;tI Error("GetButton -> Realloc of window name string memory failed.");s } * icon_str[icon_str_len] = key_char;* icon_str[icon_str_len + 1] = '\0'; icon_str_len += 1; } } t /*L * Now that we have changed the size of the icon we have to reconfigureK * it so that everything looks good. Oh yes, don't forget to move thed- * mouse so that it stays in the window!  */  /*nH * Set the window name to the new string. Icon_modified is a kludgeK * that tells us to avoid the next PropertyNotify, as it's a result ofq * this call. */- XSetIconName(dpy, awi->client, ICONSTR);  Icon_modified = TRUE; /*v4 * Determine the new icon window configuration. */G icon_h = IFontInfo->ascent + IFontInfo->descent + (VIconPad << 1);e> icon_w = XTextWidth(IFontInfo, ICONSTR, strlen(ICONSTR)); if (icon_w == 0) { icon_w = icon_h;N } else {( icon_w += (HIconPad << 1);w } L if (icon_x < 0) icon_x = 0; if (icon_y < 0) icon_y = 0;C if (icon_x - 1 + icon_w + (IBorderWidth << 1) > ScreenWidth) { ; icon_x = ScreenWidth - icon_w - (IBorderWidth << 1) + 1;  }D if (icon_y - 1 + icon_h + (IBorderWidth << 1) > ScreenHeight) {< icon_y = ScreenHeight - icon_h - (IBorderWidth << 1) + 1; } nB XMoveResizeWindow(dpy, icon, icon_x, icon_y, icon_w, icon_h);# XWarpPointer(dpy, None, icon, m. 0, 0, 0, 0, (icon_w >> 1), (icon_h >> 1)); A /* 0 * Free the local storage and return FALSE. */ if (icon_str) free(icon_str);#endif Leave(FALSE)E}CheckMap(window)Window window;{y XWMHints *XGetWMHints();e XWMHints *wmhints;/! Window transient_for = None;e Binding *bptr;s AwmInfoPtr awi; long event_mask;s Entry("CheckMap")8 /* if it's a transient window, we won't rubber-band6 * note that this call always sets transient_for. */@ if (!XGetTransientForHint( dpy, window, &transient_for )) { /*eB * Handle any registered grabs for this window. We do this here@ * because we may be about to make an icon out of this windowC * and we want to register any potential grabs on it before this  * happens. */ awi = GetAwmInfo(window); if (!awi) {3 for (bptr = Blist; bptr; bptr = bptr->next)i! if (bptr->context & WINDOW)  Grab(bptr->mask, window);e% awi = RegisterWindow(window);t Decorate(awi->client);: event_mask = PropertyChangeMask | FocusChangeMask; if (!FrameFocus)8 event_mask |= (EnterWindowMask | LeaveWindowMask);. XSelectInput(dpy, window, event_mask);#ifndef RAINBOW * SetBorderPixmaps(awi, GrayPixmap);#else / SetBorderPixmaps(awi, awi->grayPixmap); #endif }. if ((wmhints = XGetWMHints(dpy, window))) {G if ((wmhints->flags & StateHint) && (awi->state & ST_WINDOW) &&a/ (wmhints->initial_state == IconicState)) {e: /* window wants to be created as an icon. Leave size2 /* and position alone, create as icon. */( XFree(wmhints);5 Iconify(window, 0, 0, 0, 0); # Leave_void }e XFree(wmhints);- } }" else { /* It's a transient */# if (!(awi = GetAwmInfo(window)))I% awi = RegisterWindow(window); awi->attrs = AT_NONE; if (transient_for == None)a- transient_for = RootWindow(dpy, scr);- }" if (awi->state & ST_WINDOW) {& PlaceWindow(window, transient_for); if (awi->frame) {$ XMapRaised(dpy, awi->frame);% XMapWindow(dpy, awi->client); } elseL% XMapRaised(dpy, awi->client);  XSync(dpy, 0);v } Leave_void} Configure(event)XConfigureRequestEvent *event;{* XWindowChanges values;i n Entry("Configure"), values.x = event->x;n values.y = event->y; ! values.width = event->width;e# values.height = event->height; / values.border_width = event->border_width;' values.stack_mode = event->detail;.# values.sibling = event->above;r@ ConfigureWindow(event->window, event->value_mask, &values); Leave_void!}iCirculate(event)XCirculateEvent *event;{  Entry("Circulate")b$ if (event->place == PlaceOnTop)/ XRaiseWindow(event->display, event->window);i elsep/ XLowerWindow(event->display, event->window);| Leave_void }aPlaceWindow(window, transient)Window window;Window transient;v{N XSizeHints wsh; int x, y; unsigned int w, h;o XWindowChanges xwc; AwmInfoPtr awi; unsigned long flags;i wsh.flags = 0; , flags = CWX | CWY | CWWidth | CWHeight; awi = GetAwmInfo(window);: XGetSizeHints(dpy, window, &wsh, XA_WM_NORMAL_HINTS); CheckConsistency(&wsh);@ AskUser(dpy, scr, window, &x, &y, &w, &h, &wsh, transient);( wsh.flags |= (USPosition | USSize); wsh.x = x;d wsh.y = y;  wsh.width = w;i wsh.height = h; if (x < 0 || y < 0) { Window jW;P int j, border_width;iE XGetGeometry(dpy, window, &jW, &j, &j, &j, &j, &border_width, &j); if (x < 0)c< x += DisplayWidth(dpy, scr) - w - (border_width<<1); if (y < 0)i= y += DisplayHeight(dpy, scr) - h - (border_width<<1);o } if (awi->frame)< XSetSizeHints(dpy, awi->frame, &wsh, XA_WM_NORMAL_HINTS);? XSetSizeHints(dpy, awi->client, &wsh, XA_WM_NORMAL_HINTS);{ #ifdef titan /* 5x4 alignment */ x = ((x+3) / 5) * 5;  y = ((y+2) / 4) * 4;o#endif xwc.x = x;R xwc.y = y;i xwc.height = h; xwc.width = w;T* ConfigureWindow(window, flags, &xwc); awi->state |= ST_PLACED;F}I%Boolean ConfigureWindow(w, mask, xwc)) Window w; unsigned int mask;XWindowChanges *xwc;{e AwmInfoPtr awi; int height, width, x, y;  int bch = 0, bcv = 0; Entry("ConfigureWindow")r awi = GetAwmInfo(w); if (!awi) { /*iB * Make sure XtRealize gets its configure event. We'll actuallyB * do another configure before we map, but this fakes XtRealize7 * into not waiting around for the configure notify.t */' XConfigureWindow(dpy, w, mask, xwc);t XFlush(dpy);e Leave(FALSE) } if (awi->icon == w) {' XConfigureWindow(dpy, w, mask, xwc);S Leave(TRUE) }4 if (awi->attrs & AT_BORDER && DECORATED(awi)) { bcv = BContext + 1; bch = bcv * 2; } height = xwc->height; width = xwc->width; if (awi->frame) x = y = 0;; else {L x = xwc->x; y = xwc->y; } /* width */ xwc->width += bch;/ if (awi->title)9 XResizeWindow(dpy, awi->title, (unsigned) xwc->width,  (unsigned) titleHeight);  /* height */y if (DECORATED(awi)) { if (awi->attrs & AT_TITLE) {n y = titleHeight + 2; xwc->height += y;q } if (awi->attrs & AT_BORDER) {' if (!(awi->attrs & AT_TITLE)) {  xwc->height += (bcv * 2);  y = bcv; }l else xwc->height += bcv; F xwc->x -= (BContext + (awi->border_width ? awi->border_width : 1)); x = BContext; } } if (PushDown == FALSE) { / if (awi->attrs & AT_TITLE && DECORATED(awi)) $ xwc->y -= (titleHeight + 2);5 else if (awi->attrs & AT_BORDER && DECORATED(awi)) 2 xwc->y -= (BContext + (awi->border_width ?" awi->border_width : 1)); } if (awi->frame)7 XConfigureWindow(dpy, awi->frame, mask, xwc);a if (awi->gadgets) PutGadgets(w); xwc->width = width; xwc->height = height; xwc->x = x; xwc->y = y;3 XConfigureWindow(dpy, awi->client, mask, xwc);( Leave(TRUE)}sint+!ProcessRequests(box, num_vectors)=XSegment *box;int num_vectors;{l XEvent event; XPeekEvent(dpy, &event); switch (event.type) { case MapRequest:n case ConfigureRequest:e case CirculateRequest:s DrawBox();  GetButton(&event);= DrawBox();  return TRUE;_ } return FALSE;} icon_str_len += 1; } } t /*L * Now that we have changed the size of the icon we have to reconfigureK * it so that e*[FIELDS.X.AWM]GLOBALS.C;6+,. /% 4 -C0D123KPWO 56%UJ7 8PH9fG%HJ #ifndef lintstatic char *rcsid_globals_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/globals.c,v 1.2 89/02/07 21:24:58 jkh Exp $"; #endif lint #include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. * * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ /* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group2 * 001 -- R. Kittell, DEC Storage A/D May 19, 1986' * Added global vars for warp options.= * 002 -- Loretta Guarino Reid, DEC Ultrix Engineering Group ( * Western Software Lab. April 17, 1987 * Convert to X117 * 003 -- Jordan Hubbard, U.C. Berkeley. Misc new vars.( * 1.4 -- Vars added for new icon stuff. */ #include "awm.h"#include  4Window Pop; /* Pop up dimension display window. */>Window Frozen; /* Contains window id of "gridded" window. */:XFontStruct *IFontInfo; /* Icon text font information. */<XFontStruct *PFontInfo; /* Pop-up text font information. */;XFontStruct *TFontInfo; /* Title text font information. */EXFontStruct *TFontBoldInfo; /* Title text (bold) font information. */3XFontStruct *GFontInfo; /* Gadget box text font */&Pixmap GrayPixmap; /* Gray pixmap. */'Pixmap SolidPixmap; /* Solid pixmap */9Pixmap IBackPixmap; /* Icon window background pixmap. */<Pixmap IDefPixmap; /* default icon pixmap for IconLabels */0Pixel ForeColor; /* Generic foreground color */0Pixel BackColor; /* Generic background color */0Pixel IBorder; /* Icon window border color. */9Pixel PBackground; /* Pop-up Window background color. */8Pixel PForeground; /* Pop-up Window foregrould color */2Pixel PBorder; /* Pop-Up Window border color. */<Pixel IBackground; /* Icon background (for pixmap) color */<Pixel IForeground; /* Icon foreground (for pixmap) color */8Pixel ITextForeground; /* Icon text foreground color */8Pixel ITextBackground; /* Icon text background color */0char *Foreground; /* foreground color (text) */0char *Background; /* background color (text) */*char *WBorder; /* Window border color */9char *BBackground; /* Border context background color */9char *BForeground; /* Border context foreground color */3char *TBackground; /* Titlebar background color */3char *TForeground; /* Titlebar foreground color */<char *TTextBackground; /* Titlebar text background color */<char *TTextForeground; /* Titlebar text foreground color */2Cursor ArrowCrossCursor; /* Arrow cross cursor. */;Cursor TextCursor; /* Text cursor used in icon windows. */&Cursor IconCursor; /* Icon Cursor. */7Cursor LeftButtonCursor; /* Left button main cursor. */;Cursor MiddleButtonCursor; /* Middle button main cursor. */9Cursor RightButtonCursor; /* Right button main cursor. */<Cursor TargetCursor; /* Target (select-a-window) cursor. */*Cursor TitleCursor; /* Titl?~AWM.SAVEC[FIELDS.X.AWM]GLOBALS.C;6 |, ebar cursor */0Cursor FrameCursor; /* Border context cursor */7Cursor GumbyCursor; /* Used in icons if not type-in */8unsigned int GadgetBorder; /* Width of gadget borders */-int ScreenWidth; /* Display screen width. *//int ScreenHeight; /* Display screen height. */2int IBorderWidth; /* Icon window border width. */;int TTitleHeight; /* Height of title bar(s) (in pixels) */@int titleHeight; /* Derived height of title bar(s) in pixels */1int gadgetHeight; /* Height of highest gadget */.int NameOffset; /* Offset for window name */(int TitlePad; /* Padding for titles */(int PWidth; /* Pop-up window width. */*int PHeight; /* Pop-up window height. */<unsigned int PBorderWidth; /* Pop-up window border width. */,int PPadding; /* Pop-up window padding. */'int Delta; /* Mouse movement slop. */.int HIconPad; /* Icon horizontal padding. */,int VIconPad; /* Icon vertical padding. */8int Pushval; /* Number of pixels to push window by. */;int BContext; /* Border context area width (in pixels) */Eint RaiseDelay; /* Number of milliseconds delay before autoraise */5int NumGadgets; /* Number of gadgets we're using */4int GadgetPad; /* Amount of padding for gadgets */)int Volume; /* Audible alarm volume. */*int status; /* Routine return status. */2unsigned int BCursor; /* Border context cursor */1unsigned int TCursor; /* Title context cursor */-MenuLink *Menus; /* Linked list of menus. */-GC IconGC; /* graphics context for icon */+GC PopGC; /* graphics context for pop */0GC DrawGC; /* graphics context for drawing */0Binding *Blist; /* Button/key binding list. */0XContext AwmContext; /* Main context for awm */@Boolean Autoselect; /* Warp mouse to default menu selection? */6Boolean Autoraise; /* Raise window on input focus? */5Boolean Borders; /* Display border context areas? */GBoolean ConstrainResize; /* Don't resize until pointer leaves window */9Boolean Freeze; /* Freeze server during move/resize? */?Boolean Grid; /* Should the m/r box contain a 9 seg. grid. */ABoolean ShowName; /* If True, print window names in titlebars */<Boolean Hilite; /* Should we highlight titles on focus? */BBoolean BorderHilite; /* Should we highlight borders on focus? */GBoolean InstallColormap; /* Should we install colormaps for clients? */*Boolean NWindow; /* Normalize windows? */'Boolean NIcon; /* Normalize icons? */4Boolean Push; /* Relative=TRUE, Absolute=FALSE. */HBoolean RootResizeBox; /* Resize window is placed over sized window? */HBoolean ResizeRelative; /* resizes should be relative to window edge */2Boolean Titles; /* Title bar frob on windows? */'Boolean IconLabels; /* icon labels? */,Boolean ILabelTop; /* icon label on top? */2Boolean UseGadgets; /* Gadget boxes on titles? */ABoolean FrameFocus; /* Treat the frame as part of the window? */&Boolean Reverse; /* Reverse video? */&Boolean SaveUnder; /* Save unders? */,Boolean PushDown; /* Down=TRUE, Up=FALSE */8Boolean Wall; /* restrict to root window boundries? */@Boolean WarpOnRaise; /* Warp to upper right corner on raise. */EBoolean WarpOnIconify; /* Warp to icon center on iconify. */OBoolean WarpOnDeIconify; /* Warp to upper right corner on de-iconify. */<Boolean FocusSetByUser; /* True if f.focus called */6Boolean FocusSetByWM; /* True if awm set the focus */7Boolean Zap; /* Should the the zap effect be used. */ ;char PText[7] = INIT_PTEXT; /* Pop-up window dummy text. */Cint PTextSize = sizeof(PText); /* Pop-up window dummy text size. */c ".int Lineno = 1; /* Line count for parser. */ABoolean Startup_File_Error = FALSE;/* Startup file error flag. */9char Startup_File[NAME_LEN] = "";/* Startup file name. */1?char *TBackPixmapData; /* Bitmap data file title background */g7char *TBoldPixmapData; /* ditto, except highlighted */ Cchar *BBackPixmapData; /* Border context background pixmap data */ =char *BBoldPixmapData; /* Border context bold pixmap data */o>char *awmPath; /* Optional pathlist to search for pixmaps */8char **Argv; /* Pointer to command line parameters. */0char **EEnviron; /* Pointer to environment. */char gray_bits[] = {4 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa,4 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa,4 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa,3 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaar};char solid_bits[] = {C4 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,4 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,4 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,3 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xffo};char xlogo32_bits[] = {aJ 0xff, 0x00, 0x00, 0xc0, 0xfe, 0x01, 0x00, 0xc0, 0xfc, 0x03, 0x00, 0x60,J 0xf8, 0x07, 0x00, 0x30, 0xf8, 0x07, 0x00, 0x18, 0xf0, 0x0f, 0x00, 0x0c,J 0xe0, 0x1f, 0x00, 0x06, 0xc0, 0x3f, 0x00, 0x06, 0xc0, 0x3f, 0x00, 0x03,J 0x80, 0x7f, 0x80, 0x01, 0x00, 0xff, 0xc0, 0x00, 0x00, 0xfe, 0x61, 0x00,J 0x00, 0xfe, 0x31, 0x00, 0x00, 0xfc, 0x33, 0x00, 0x00, 0xf8, 0x1b, 0x00,J 0x00, 0xf0, 0x0d, 0x00, 0x00, 0xf0, 0x0e, 0x00, 0x00, 0x60, 0x1f, 0x00,J 0x00, 0xb0, 0x3f, 0x00, 0x00, 0x98, 0x7f, 0x00, 0x00, 0x98, 0x7f, 0x00,J 0x00, 0x0c, 0xff, 0x00, 0x00, 0x06, 0xfe, 0x01, 0x00, 0x03, 0xfc, 0x03,J 0x80, 0x01, 0xfc, 0x03, 0xc0, 0x00, 0xf8, 0x07, 0xc0, 0x00, 0xf0, 0x0f,J 0x60, 0x00, 0xe0, 0x1f, 0x30, 0x00, 0xe0, 0x1f, 0x18, 0x00, 0xc0, 0x3f,3 0x0c, 0x00, 0x80, 0x7f, 0x06, 0x00, 0x00, 0xff};Oint scr; Display *dpy;.#ifdef WMSTATEAtom wm_state_atom;R#endif #ifdef NEATENaint AbsMinWidth;int AbsMinHeight;0Boolean RetainSize; Boolean KeepOpen; Boolean Fill; Boolean UsePriorities;Boolean FixTopOfStack;char *PrimaryIconPlacement;gchar *SecondaryIconPlacement;o#endif/*# * Keyword lookup table for parser.0 */ Keyword KeywordTable[] ={.0 { "autoselect", IsBoolean, &Autoselect, 0 },. { "autoraise", IsBoolean, &Autoraise, 0 },) { "freeze", IsBoolean, &Freeze, 0 },i) { "hilite", IsBoolean, &Hilite, 0 }, 6 { "rootResizeBox", IsBoolean, &RootResizeBox, 0 },) { "titles", IsBoolean, &Titles, 0 },i- { "gadgets", IsBoolean, &UseGadgets, 0 }, % { "grid", IsBoolean, &Grid, 0 },t, { "showName", IsBoolean, &ShowName, 0,},( { "normali", IsBoolean, &NIcon, 0 },* { "normalw", IsBoolean, &NWindow, 0 },, { "pushRelative", IsBoolean, &Push, 0 },* { "reverse", IsBoolean, &Reverse, 0 },% { "wall", IsBoolean, &Wall, 0 },a0 { "frameFocus", IsBoolean, &FrameFocus, 0 },6 { "warpOnIconify", IsBoolean, &WarpOnIconify, 0 },9 { "warpOnDeIconify",IsBoolean, &WarpOnDeIconify, 0 },e2 { "warpOnRaise", IsBoolean, &WarpOnRaise, 0 }, #ifdef NEATENc0 { "retainSize", IsBoolean, &RetainSize, 0 },, { "keepOpen", IsBoolean, &KeepOpen, 0 },% { "fill", IsBoolean, &Fill, 0 }, 3 { "usePriorities", IsBoolean, &UsePriorities },l3 { "fixTopOfStack", IsBoolean, &FixTopOfStack },i#endif# { "zap", IsBoolean, &Zap, 0 },o" { "gadget", IsGadget, 0, 0 },* { "f.beep", IsImmFunction, 0, Beep },5 { "f.circledown", IsImmFunction, 0, CircleDown },n1 { "f.circleup", IsImmFunction, 0, CircleUp },(1 { "f.continue", IsImmFunction, 0, Continue },e/ { "f.decorate", IsFunction, 0, FDecorate },/+ { "f.exit", IsQuitFunction, 0, Quit },r( { "f.focus", IsFunction, 0, Focus },/ { "f.unfocus", IsImmFunction, 0, UnFocus },n, { "f.iconify", IsFunction, 0, Iconify },( { "f.lower", IsFunction, 0, Lower },( { "f.menu", IsMenuMap, 0, DoMenu },* { "f.action", IsAction, 0, DoAction },+ { "f.move", IsDownFunction, 0, Move },s6 { "f.moveopaque", IsDownFunction, 0, MoveOpaque },6 { "f.newiconify", IsDownFunction, 0, NewIconify },- { "f.neaten", IsImmFunction, 0, Neaten },f/ { "f.pause", IsImmFunction, 0, awm_Pause },u/ { "f.pushdown", IsFunction, 0, ShoveDown },r/ { "f.pushleft", IsFunction, 0, ShoveLeft },o1 { "f.pushright", IsFunction, 0, ShoveRight }, + { "f.pushup", IsFunction, 0, ShoveUp },s, { "f.raise", IsFunction, 0, awm_Raise },. { "f.redraw", IsDownFunction, 0, Redraw },/ { "f.refresh", IsImmFunction, 0, Refresh },d. { "f.resize", IsDownFunction, 0, Resize },0 { "f.restart", IsQuitFunction, 0, Restart },; { "f.destroy", IsDownFunction, 0, DestroyClient },W9 { "f.nodecorate", IsFunction, 0, FNoDecorate },/- { "f.lock", IsImmFunction, 0, Lock },i { "menu", IsMenu, 0, 0 },t4 { "resetbindings", IsParser, 0, ResetBindings },. { "resetmenus", IsParser, 0, ResetMenus },2 { "resetgadgets", IsParser, 0, ResetGadgets }, { NULL, NULL, NULL, NULL }}; d/*# * Key expression table for parser.n */eKeyExpr KeyExprTbl[] = { { "ctrl", ControlMask }, { "c", ControlMask },g { "lock", LockMask },g { "l", LockMask }, { "meta", Mod1Mask },  { "m", Mod1Mask }, { "shift", ShiftMask },P { "s", ShiftMask },d { "mod1", Mod1Mask },  { "mod2", Mod2Mask },n { "mod3", Mod3Mask },  { "mod4", Mod4Mask },h { "mod5", Mod5Mask },D { NULL, NULL }}; e/*' * Context expression table for parser.e */ ContExpr ContExprTbl[] = { { "icon", ICON },; { "i", ICON }, { "root", ROOT },  { "r", ROOT }, { "window", WINDOW },t { "w", WINDOW }, { "t", TITLE },d { "title", TITLE },c { "g", GADGET }, { "gadget", GADGET },  { "border", BORDER },k { "b", BORDER }, { NULL, NULL }};/*" * Gravity expressions for parser. */o GravityExpr GravityExprTbl[] = {% { "noGravity", NoGadgetGravity }, % { "nogravity", NoGadgetGravity },t% { "NoGravity", NoGadgetGravity },m) { "leftGravity", LeftGadgetGravity },l) { "leftgravity", LeftGadgetGravity },e) { "LeftGravity", LeftGadgetGravity },i+ { "rightGravity", RightGadgetGravity },;+ { "rightgravity", RightGadgetGravity },a+ { "RightGravity", RightGadgetGravity },t- { "centerGravity", CenterGadgetGravity },z- { "centerGravity", CenterGadgetGravity }, - { "CenterGravity", CenterGadgetGravity },* { NULL, NULL}e};/*& * Button expression table for parser. */lButtonModifier ButtModTbl[] = {g { "left", LeftMask },l { "leftbutton", LeftMask },i { "l", LeftMask }, { "middle", MiddleMask },/# { "middlebutton", MiddleMask },e { "m", MiddleMask }, { "right", RightMask },o! { "rightbutton", RightMask },* { "r", RightMask },l { "move", DeltaMotion }, { "motion", DeltaMotion }, { "delta", DeltaMotion },  { "boogie", DeltaMotion },> { "truckin", DeltaMotion }, /* it's been a silly day... */ { "down", ButtonDown },w { "d", ButtonDown }, { "up", ButtonUp }, { "u", ButtonUp }, { NULL, NULL }}; ln UseGadgets; /* Gadget boxes on titles? */ABoolean FrameFocus; /* Treat the frame as part of the window? */&Boolean Reverse; /* Reverse video? */&Boolean SaveUnder; /* Save unders? */,Boolean PushDown; /* Down=TRUE, Up=FALSE */8Boolean Wall; /* restric*[FIELDS.X.AWM]GRAB.C;3+,B./% 4}-C0@123KPWO56%7` 8 ᬴PH9fG%HJ #ifndef lint}static char *rcsid_Grab_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Grab.c,v 1.2 89/02/07 20:05:05 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//* * MODIFICATION HISTORY *) * 002 -- Jordan Hubbard, Ardent Computer) * Modifications for addition contexts. */#include #include "awm.h"void grab_pointer(){ Entry("grab_pointer")1 if (XGrabPointer( dpy, RootWindow(dpy, scr),6 TRUE, (unsigned int) EVENTMASK, GrabModeAsync, GrabModeAsync, None,' ArrowCrossCursor, CurrentTime ) != GrabSuccess )@ fprintf(stderr, "awm (grab_pointer): Can't grab the mouse."); Leave_void}void ungrab_pointer(){ Entry("ungrab_pointer")& XUngrabPointer(dpy, CurrentTime); Leave_void}*[FIELDS.X.AWM]GRAM.C;4+,B.^/% 4}^]-C0D123KPWO^56L %7 % 8`PH9fG%HJF"extern char *malloc(), *realloc();# line 57 "gram.y" #ifndef lint}static char *rcsid_gram_y = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/gram.y,v 1.2 89/02/07 21:25:05 jkh Exp $"; #endif lint#include #include #include "awm.h"#include /*0 * Values returned by complex expression parser. */"#define C_STRING 1 /* IsString. */#define C_MENU 2 /* IsMenu. */#define C_MAP 3 /* IsMap. */##define C_MENUMAP 4 /* IsMenuMap */!#define C_PIXMAP 5 /* IsPixmap */!#define C_ACTION 6 /* IsAction */ #define GADGET_TOKEN "gadget"* static int ki; /* Keyword index. */9 static int gadgnum; /* # of gadget we're initing */< static int g_offset; /* The gadget offset specified */> static int g_gravity; /* The gadget gravity specified */= static char *g_forecolor; /* gadget foreground color */= static char *g_backcolor; /* gadget background color */2 static XFontStruct *g_font; /* gadget font */0 static int bkmask; /* Button/key mask. */, static int cmask; /* Context mask. */: static char msg[BUFSIZ]; /* Error message buffer. */. static char *menu_name; /* Menu name. */C static char *menu_pixmap; /* Name of pixmap for menu label */1 static MenuInfo *menu_info; /* Menu info. */C static ActionLine *ml_ptr; /* Temporary menu line pointer. */? static ActionLine *action; /* Temporary action pointer */= MenuLink *menu_link; /* Temporary menu link pointer. */@ GadgetDecl **Gadgets; /* Pointer to gadget info structs */ char *calloc(); # line 103 "gram.y"typedef union { char *sval; int ival; short shval; struct _actionline *alval; struct _menuinfo *mival; char **cval; } YYSTYPE;# define NL 257# define STRING 258# define COMMENT 259#define yyclearin yychar = -1#define yyerrok yyerrflag = 0extern int yychar;extern int yyerrflag;#ifndef YYMAXDEPTH#define YYMAXDEPTH 150#endifYYSTYPE yylval, yyval;# define YYERRCODE 256# line 554 "gram.y"/*: * Look up color named by "string" and return pixel value. */%Pixel LookupColor(string, cmap, fail) char *string;Colormap cmap;Boolean *fail;{ XColor vis_ret, act_ret; Entry("LookupColor")J if (!(string && XParseColor(dpy, cmap, string, &vis_ret, &act_ret) &&% XAllocColor(dpy, cmap, &vis_ret))) {E sprintf(msg, "Can't allocate color '%s', using default\n", string); yywarn(msg); if (fail) *fail = TRUE; Leave((Pixel)0) } if (fail) *fail = FALSE; Leave(vis_ret.pixel)}/*E * Like LookupColor, but provides its own fallback in case of failure * (currently 0). */Pixel GetPixel(string, cmap) char *string;Colormap cmap;{ XColor vis_ret; Entry("GetPixel") if (!string) Leave((Pixel)0)@ if (!(string && XParseColor(dpy, cmap, string, &vis_ret) &&# XAllocColor(dpy, cmap, &vis_ret))) Leave((Pixel)0) Leave(vis_ret.pixel)}/*C * Look up a string in the keyword table and return its index, else * return -1. */int keywordlookup(string) char *string;{ int i;  Entry("keywordlookup")- for (i = 0; KeywordTable[i].name; i++) {6 if (!strcmp(KeywordTable[i].name, string)) { free(string); Leave(i) } }2 sprintf(msg,"keyword error: \"%s\"", string); yyerror(msg); free(string); Leave(-1)}/*I * Look up a string in the key expression table and return its mask, else * return -1. */int keyexprlookup(string) char *string;{ int i;  Entry("keyexprlookup")+ for (i = 0; KeyExprTbl[i].name; i++) {- if (!strcmp(KeyExprTbl[i].name, string)) { free(string);! Leave(KeyExprTbl[i].mask) } }9 sprintf(msg,"key expression error: \"%s\"", string); yyerror(msg); free(string); Leave(-1)}int gravitylookup(string) char *string;{ int i; Entry("gravitylookup")/ for (i = 0; GravityExprTbl[i].name; i++) {1 if (!strcmp(GravityExprTbl[i].name, string)) { free(string);% Leave(GravityExprTbl[i].mask) } }> sprintf(msg, "gravity expression error: \"%s\"", string); yyerror(msg); free(string); Leave(-1);} /*M * Look up a string in the context expression table and return its mask, else * return -1. */contexprlookup(string) char *string;{ int i;  Entry("contexprlookup"), for (i = 0; ContExprTbl[i].name; i++) {. if (!strcmp(ContExprTbl[i].name, string)) { free(string);" Leave(ContExprTbl[i].mask) } }= sprintf(msg,"context expression error: \"%s\"", string); yyerror(msg); free(string); Leave(-1)}/*L * Look up a string in the button expression table and return its mask, else * return -1. */buttexprlookup(string) char *string;{ int i;  Entry("buttexprlookup")+ for (i = 0; ButtModTbl[i].name; i++) {- if (!strcmp(ButtModTbl[i].name, string)) { free(string);! Leave(ButtModTbl[i].mask) } }: sprintf(msg,"button modifier error: \"%s\"", string); yyerror(msg); free(string); Leave(-1)}/*? * Scan a string and return an integer. Report an error if any$ * non-numeric characters are found. */ y_atoi(s)char *s;{ int n = 0;  Entry("y_atoi") while (*s) { if (*s >= '0' && *s <= '9') n = 10 * n + *s - '0'; else {( yyerror("non-numeric argument"); Leave(-1) } s++; } Leave(n)}/*. * Append s2 to s1, extending s1 as necessary. */char * strconcat(s1, s2)char *s1, *s2;{ char *malloc(); char *p;  Entry("strconcat")- p = malloc(strlen(s1) + strlen(s2) + 2);! sprintf(p, "%s %s", s1, s2); free(s1); free(s2); s1 = p; Leave(s1)}/*( * Check a button expression for errors. */int CheckButtonState(expr) int expr;{ Entry("CheckButtonState") /*, * Check for one (and only one) button. */: switch (expr & (LeftMask | MiddleMask | RightMask)) { case 0:" yyerror("no button specified"); break; case LeftMask: break; case MiddleMask: break; case RightMask: break; default:- yyerror("more than one button specified"); }  /*= * Check for one (and only one) up/down/motion modifier. */< switch (expr & (ButtonUp | ButtonDown | DeltaMotion)) { case 0:) yyerror("no button action specified"); break; case ButtonUp: break; case ButtonDown: break; case DeltaMotion: break; default:: yyerror("only one of up/down/motion may be specified"); } Leave(expr)}/*) * Bind button/key/context to a function. */&bindtofunc(index, mask, context, name)+int index; /* Index into keyword table. */*int mask; /* Button/key/modifier mask. */?int context; /* ROOT, WINDOW, TITLE, ICON, GADGET or BORDER */#char *name; /* Menu, if needed. */{ Entry("bindtofunc"), setbinding(context, index, mask, name); Leave_void}/*0 * Allocate a Binding type and return a pointer. */ Binding * AllocBinding(){ Binding *ptr;  Entry("AllocBinding"): if (!(ptr = (Binding *)calloc(1, sizeof(Binding)))) {: sprintf(msg, "Can't allocate binding--out of space\n"); yyerror(msg); exit(1); } Leave(ptr)}/* * Stash the data in a Binding. */setbinding(cont, i, m, mname)0int cont; /* Context: ROOT, WINDOW, or ICON. */#int i; /* Keyword table index. */'int m; /* Key/button/modifier mask. */4char *mname; /* Pointer to menu name, if needed. */{ Binding *ptr; Entry("setbinding") ptr = AllocBinding(); ptr->context = cont; ptr->mask = m;& ptr->func = KeywordTable[i].fptr; ptr->menuname = mname;7 switch (m & (LeftMask | MiddleMask | RightMask)) { case LeftMask: ptr->button = LeftButton; break; case MiddleMask: ptr->button = MiddleButton; break; case RightMask: ptr->button = RightButton; break; } appendbinding(ptr); Leave_void}/*) * Append a Binding to the Bindings list. */appendbinding(binding)Binding *binding;{ Binding *ptr;  Entry("appendbinding") if (Blist == NULL) Blist = binding; else {; for(ptr = Blist; ptr->next; ptr = ptr->next) /* NULL */; ptr->next = binding; ptr = ptr->next; ptr->next = NULL; } Leave_void}/*0 * Allocate an action line and return a pointer. */ActionLine *AllocActionLine(){ ActionLine *ptr;  Entry("AllocActionLine")@ if (!(ptr = (ActionLine *)calloc(1, sizeof(ActionLine)))) {> sprintf(msg, "Can't allocate action line--out of space\n"); yyerror(msg); } Leave(ptr)}/*6 * Allocate a MenuInfo structure and return a pointer. */MenuInfo *AllocMenuInfo(){ MenuInfo *ptr;  Entry("AllocMenuInfo")< if (!(ptr = (MenuInfo *)calloc(1, sizeof(MenuInfo)))) {? sprintf(msg, "Can't allocate menu storage--out of space\n"); yyerror(msg); } Leave(ptr)}/*6 * Allocate a MenuLink structure and return a pointer. */MenuLink *AllocMenuLink(){ MenuLink *ptr;  Entry("AllocMenuLink")< if (!(ptr = (MenuLink *)calloc(1, sizeof(MenuLink)))) {K sprintf(msg, "Can't allocate menu linked list storage--out of space\n"); yyerror(msg); } Leave(ptr)}/*& * Return storage for Gadgets[] array. */GadgetDecl **allocate_gadgets(){ GadgetDecl **tmp; int i; Entry("allocate_gadgets")E tmp = (GadgetDecl **)malloc(MAX_GADGETS * sizeof(GadgetDecl *)); if (!tmp) {H sprintf(msg, "Can't allocate storage for Gadgets -- out of space\n"); yyerror(msg); Leave(NULL) }& for (i = 0; i < MAX_GADGETS; i++) tmp[i] = (GadgetDecl *)0; Leave(tmp)}/* * Stash a gadget record */#GadgetDecl *stashGadget(n, s, type)int n;char *s; int type;{ GadgetDecl *tmp; Entry("stashGadget") if (!Gadgets)/ Gadgets = (GadgetDecl **)allocate_gadgets();$ if (n < 0 || n >= NumGadgets) {B sprintf(msg, "stashGadget on gadget #%d when maxgadget = %d\n", n, NumGadgets); yyerror(msg); Leave(NULL) } if (Gadgets[n]) {- sprintf(msg, "gadget #%d redefined\n", n); yywarn(msg); FreeGadget(n); tmp = Gadgets[n]; } else? Gadgets[n] = tmp = (GadgetDecl *)malloc(sizeof(GadgetDecl)); if (!Gadgets[n]) {> sprintf(msg, "Can't allocate new gadget, out of space!\n"); yyerror(msg); Leave(NULL) }' tmp->data = (unsigned char *)NULL;' tmp->name = (unsigned char *)NULL; tmp->high = tmp->wide = 0; tmp->gravity = g_gravity; tmp->offset = g_offset;" tmp->forecolor = g_forecolor;" tmp->backcolor = g_backcolor; tmp->fontInfo = g_font;0 if (type != C_STRING && type != C_PIXMAP) {D sprintf(msg, "Invalid gadget specification for gadget #%d\n", n); yyerror(msg); NumGadgets = 0; Leave(NULL) } if (type == C_PIXMAP) { int junk; char *nm = s; s = expand_from_path(s); if (!s) {D sprintf(msg, "Can't find pixmap file '%s' for gadget #%d\n", nm, n); yywarn(msg);/ tmp->data = (unsigned char *)gray_bits; tmp->high = gray_height; tmp->wide = gray_width; }7 else if (XmuReadBitmapDataFromFile (s, &(tmp->wide),/ &(tmp->high), &(tmp->data), &junk, &junk) != BitmapSuccess) {L sprintf(msg, "Can't open pixmap file '%s' for gadget #%d.\n", s, n); yyerror(msg);/ tmp->data = (unsigned char *)gray_bits; tmp->high = gray_height; tmp->wide = gray_width; } if (tmp->high > gadgetHeight)! gadgetHeight = tmp->high; }4 else if (type == C_STRING) { /* it's a label */# tmp->name = expand_metachars(s); if (!tmp->fontInfo) { if (!GFontInfo) {= GFontInfo = GetFontRes("gadget.font", DEF_GADGET_FONT); if (!GFontInfo) {7 sprintf(msg, "Can't get a default gadget font.\n"); yyerror(msg); Leave(NULL) } }" tmp->fontInfo = GFontInfo; } if (strlen(tmp->name) > 1) {L tmp->wide = XTextWidth(tmp->fontInfo, tmp->name, strlen(tmp->name));6 tmp->high = tmp->fontInfo->max_bounds.ascent +, tmp->fontInfo->max_bounds.descent + 2; } else { XCharStruct chinfo; int asc, desc, dir;= XTextExtents(tmp->fontInfo, tmp->name, 1, &dir, &asc, &desc, &chinfo);! tmp->wide = chinfo.width;3 tmp->high = chinfo.ascent + chinfo.descent; }! tmp->wide += 2 * GadgetBorder;' if (tmp->high > gadgetHeight)! gadgetHeight = tmp->high; } Leave(tmp)}/*J * This routine expands '\' notation in a string, ala C. Mostly useful forK * imbedding weird characters in strings that turn into interesting symbolsE * from some font. Unlike C, however, numeric constants (\nnn) are inD * decimal, not octal. This was done because the most popular glyphsI * (in cursorfont.h) are identified in decimal. There are some other cuteC * "metacharacters" that expand to the window name, icon name, etc. */"unsigned char *expand_metachars(s)register unsigned char *s;{! register int i, len, val, n; unsigned char *cp, num[5]; Entry("expand_metachars") if (!s) Leave(s) len = strlen(s); for (i = 0; i < len; i++) if (s[i] == '\\') break; if (i == len) Leave(s)E /* we know the string is going to get shorter, len is correct */' cp = (unsigned char *)malloc(len); i = n = 0; while (*s) { if (*s == '\\') { s++;. while (*s && *s >= '0' && *s <= '9') { num[n++] = *s; s++; } if (n) { if (n > 4) n = 4; num[n] = '\0'; cp[i++] = (char)atoi(num); n = 0; } else if (*s) { switch(*s) { case 'b': val = 8; break; case 'f': val = 12; case 'n': val = 10; break; case 'r': val = 13; break; case 't': val = 9; break; default: val = *s; break; } cp[i++] = val; s++; } } else { cp[i++] = *s; s++; } } cp[i] = '\0'; Leave(cp)} /*$ * Stash the data in an action line. */)ActionLine *StashActionLine(type, string) int type; char *string;{ ActionLine *ptr;  Entry("StashActionLine") ptr = AllocActionLine(); ptr->type = type; ptr->text = string; Leave(ptr)}/*+ * Stash menu data in a MenuInfo structure; */+MenuInfo *stashmenuinfo(name, line, pixmap) char *name;ActionLine *line; char *pixmap;{ MenuInfo *ptr;  Entry("stashmenuinfo") ptr = AllocMenuInfo(); ptr->name = name; ptr->line = line; ptr->pixmapname = pixmap; ptr->menu = 0; Leave(ptr)}/*0 * Stash menu info data in a MenuLink structure; */!MenuLink *stashmenulink(menuinfo)MenuInfo *menuinfo;{ MenuLink *ptr;  Entry("stashmenulink") ptr = AllocMenuLink(); ptr->next = NULL; ptr->menu = menuinfo; Leave(ptr)}/*8 * Append an action line to a linked list of menu lines. */&ActionLine *appendmenuline(list, line)ActionLine *list;ActionLine *line;{ ActionLine *ptr;e  Entry("appendmenuline") if (list == NULL) list = line;c else {g: for(ptr = list; ptr->next; ptr = ptr->next) /* NULL */; ptr->next = line; ptr = ptr->next;" ptr->next = NULL; } Leave(list)}e/*+ * Append a menu to a linked list of menus.h */ MenuLink * appendmenulink(list, link)pMenuLink *list;fMenuLink *link; {t MenuLink *ptr;E * Entry("appendmenulink") if (list == NULL) list = link;n else {f: for(ptr = list; ptr->next; ptr = ptr->next) /* NULL */; ptr->next = link; ptr = ptr->next; ptr->next = NULL; } Leave(list)}s n/*D * Reset all previous bindings and free the space allocated to them. */ Boolean ResetBindings()/{  Binding *ptr, *nextptr; e Entry("ResetBindings")s+ for(ptr = Blist; ptr; ptr = nextptr) {c nextptr = ptr->next;r free(ptr);  } Blist = NULL; Leave_voidF}S/* * De-allocate all menus. */sBoolean ResetMenus(){t MenuLink *mptr, *next_mptr;+ register ActionLine *lptr, *next_lptr;r g Entry("ResetMenus") if (!Menus) Leave_void*0 for(mptr = Menus; mptr; mptr = next_mptr) { free(mptr->menu->name);% RTLMenu_Destroy(mptr->menu->menu);n9 for(lptr = mptr->menu->line; lptr; lptr = next_lptr) {l free(lptr->name);n) if (lptr->text) free(lptr->text);i next_lptr = lptr->next;* free(lptr);n } next_mptr9~AWM.SAVEBC[FIELDS.X.AWM]GRAM.C;4}^'t$ = mptr->next; free(mptr); } Menus = NULL; Leave_voidi} int yyexca[] ={c-1, 1, 0, -1, -2, 0, -1, 8, 61, 37, -2, 36,-1, 21, 58, 47, 124, 47,  -2, 19, }; # define YYNPROD 72s# define YYLAST 230v int yyact[]={cF 46, 11, 75, 75, 46, 11, 62, 78, 31, 101,F 98, 24, 11, 63, 90, 92, 47, 68, 71, 11,F 36, 51, 39, 11, 33, 18, 99, 95, 81, 56,F 54, 32, 28, 29, 25, 7, 16, 72, 88, 45,F 13, 14, 67, 74, 17, 87, 83, 79, 53, 26,F 34, 52, 15, 27, 41, 20, 2, 100, 37, 97,F 12, 29, 91, 76, 76, 43, 70, 38, 5, 4,F 1, 40, 65, 66, 35, 23, 60, 19, 9, 22,F 61, 0, 0, 0, 48, 57, 64, 0, 50, 55,F 49, 0, 0, 77, 77, 58, 0, 0, 0, 0,F 0, 0, 0, 0, 0, 69, 0, 0, 82, 80,F 0, 0, 0, 0, 0, 84, 85, 86, 0, 0,F 0, 0, 93, 89, 0, 94, 0, 0, 0, 0,F 96, 0, 0, 0, 0, 0, 0, 0, 0, 0,F 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,F 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,F 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,F 0, 0, 30, 0, 0, 0, 0, 0, 0, 0,F 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,F 0, 0, 0, 0, 0, 0, 0, 0, 3, 10,F 8, 6, 0, 10, 8, 6, 63, 0, 0, 0,F 10, 0, 0, 0, 0, 0, 0, 10, 47, 59,H 44, 10, 47, 42, 63, 0, 0, 73, 90, 21 };int yypact[]={F -1000, -58, -1000, -54, -47, -47, -1000, -1000, -55, -17,F -1000, -1000, -1000, -1000, -1000, -1000, -233, -29, -59, -1000,F -9, -62, -86, -93, -234, -1000, -238, -1000, -236, -36,F -90, -236, -237, 10, -10, -94, -55, -1000, -95, -1000,F -40, -1000, -1000, -1000, -47, -52, -242, -1000, -1000, -1000,F -1000, -1000, -1000, -241, -238, -1000, -240, -1000, -1000, -1000,F -1000, -1000, -31, -1000, -34, -11, -241, -1000, -1000, -1000,F -96, -1000, -47, -12, -1000, -242, -242, -242, -13, -30,F -1000, -243, -1000, -244, -245, -245, -245, -31, -1000, -1000,F -1000, -97, -1000, -1000, -47, -248, -1000, -98, -1000, -249, -1000, -1000 }; int yypgo[]={mF 0, 79, 52, 78, 77, 55, 75, 50, 74, 73,F 42, 72, 38, 39, 43, 53, 71, 54, 37, 70,H 56, 69, 35, 68, 58, 67, 66, 62, 59, 57 }; int yyr1[]={F 0, 19, 19, 19, 20, 20, 20, 20, 22, 22,F 23, 1, 4, 4, 4, 4, 4, 4, 4, 4,F 4, 24, 24, 24, 24, 24, 25, 25, 26, 26,F 27, 27, 28, 28, 29, 29, 21, 3, 3, 2,F 5, 5, 5, 7, 7, 7, 11, 6, 8, 8,F 9, 9, 10, 12, 15, 16, 16, 16, 16, 16,F 16, 16, 17, 17, 18, 18, 18, 14, 14, 14, 13, 13 }; int yyr2[]={F 0, 0, 4, 7, 4, 4, 3, 2, 3, 2,F 7, 7, 11, 15, 15, 5, 7, 7, 7, 3,F 3, 2, 6, 10, 14, 18, 1, 3, 1, 3,F 1, 3, 1, 3, 1, 3, 3, 3, 5, 7,F 1, 3, 7, 1, 3, 7, 3, 3, 3, 5,F 3, 5, 3, 3, 7, 3, 5, 5, 3, 3,F 5, 5, 9, 13, 3, 7, 3, 5, 5, 5, 3, 5 }; int yychk[]={pF -1000, -19, -20, 256, -21, -23, 259, -22, 258, -3,F 257, 59, -20, -22, -22, -2, 91, 61, 258, -4,F -5, 258, -1, -6, 40, 93, 58, -15, 94, 123,F 258, 94, 124, 258, -7, -8, 258, -24, -25, 258,F -16, -17, 259, -22, 256, -13, 40, 258, -15, -24,F -5, 258, 41, 58, 124, -2, 124, 125, -17, 259,F -22, -22, 58, 258, -13, -11, -9, -10, 258, -7,F -26, 258, -18, 258, -14, 33, 94, 124, 41, 58,F -10, 124, -22, 58, -13, -13, -13, 58, -12, -14,F 258, -27, 258, -12, -18, 124, -22, -28, 258, 124, -29, 258 }; int yydef[]={eF 1, -2, 2, 0, 0, 0, 6, 7, -2, 0,F 8, 9, 3, 4, 5, 38, 0, 40, 0, 10,F 0, -2, 20, 41, 0, 39, 43, 15, 26, 0,F 0, 26, 40, 0, 0, 44, 48, 17, 21, 27,F 0, 55, 58, 59, 0, 0, 0, 70, 16, 18,F 42, 47, 11, 0, 43, 49, 28, 54, 56, 57,F 60, 61, 0, 71, 0, 12, 46, 50, 52, 45,F 22, 29, 0, 64, 66, 0, 0, 0, 0, 0,F 51, 30, 62, 0, 67, 68, 69, 0, 13, 14,F 53, 23, 31, 65, 0, 32, 63, 24, 33, 34, 25, 35 };6typedef struct { char *t_name; int t_val; } yytoktype;#ifndef YYDEBUGp.# define YYDEBUG 0 /* don't allow debugging */#endif #if YYDEBUGeyytoktype yytoks[] ={i "NL", 257,x "STRING", 258,n "COMMENT", 259," "-unknown-", -1 /* ends search */};char * yyreds[] =d{e "-no such reduction-",  "input : /* empty */",C "input : input command",h "input : input error command", "command : boolvar term", "command : expr term",t "command : COMMENT",; "command : term", "term : NL",l "term : ';'", "expr : keyword '=' compexpr", "pixmap_file : '(' STRING ')'",0 "compexpr : keyexpr ':' contexpr ':' buttexpr",= "compexpr : keyexpr ':' contexpr ':' buttexpr ':' menuname",g? "compexpr : keyexpr ':' contexpr ':' buttexpr ':' textaction",; "compexpr : STRING menuexpr",* "compexpr : pixmap_file STRING menuexpr",$ "compexpr : STRING '^' gadgetspec",) "compexpr : pixmap_file '^' gadgetspec",o "compexpr : STRING",  "compexpr : pixmap_file", "gadgetspec : offset",;# "gadgetspec : offset '|' gravity",h1 "gadgetspec : offset '|' gravity '|' forecolor",? "gadgetspec : offset '|' gravity '|' forecolor '|' backcolor",AL "gadgetspec : offset '|' gravity '|' forecolor '|' backcolor '|' fontspec", "offset : /* empty */", "offset : STRING",= "gravity : /* empty */",( "gravity : STRING", "forecolor : /* empty */",e "forecolor : STRING", "backcolor : /* empty */",  "backcolor : STRING", "fontspec : /* empty */", "fontspec : STRING",  "boolvar : STRING", "keyword : STRING",% "keyword : STRING gadget_subscript",p% "gadget_subscript : '[' STRING ']'",p "keyexpr : /* empty */",g "keyexpr : kmask",d "keyexpr : kmask '|' keyexpr",g "contexpr : /* empty */", "contexpr : contmask",d$ "contexpr : contmask '|' contexpr", "buttexpr : buttmodexpr", "kmask : STRING", "contmask : STRING",r& "contmask : STRING gadget_subscript", "buttmodexpr : buttmodifier",* "buttmodexpr : buttmodexpr buttmodifier", "buttmodifier : STRING",t "menuname : STRING",t "menuexpr : '{' menulist '}'",* "menulist : menuline", "menulist : menulist menuline", "menulist : menulist COMMENT",  "menulist : COMMENT", "menulist : term",c "menulist : menulist term", "menulist : error term",n* "menuline : strings ':' menuaction term",2 "menuline : '(' strings ')' ':' menuaction term", "menuaction : STRING", $ "menuaction : STRING ':' menuname", "menuaction : textaction", "textaction : '!' strings", "textaction : '^' strings", "textaction : '|' strings", "strings : STRING", "strings : strings STRING",};#endif /* YYDEBUG */#line 1 "/usr/lib/yaccpar"3/* @(#)yaccpar 1.10 89/04/04 SMI; from S5R3 1.10 */r/*)** Skeleton parser driver for yacc outputo*//*%** yacc user known macros and definesE*/#define YYERROR goto yyerrlab5#define YYACCEPT { free(yys); free(yyv); return(0); }s5#define YYABORT { free(yys); free(yyv); return(1); }u'#define YYBACKUP( newtoken, newvalue )\}{\3 if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\t {\r- yyerror( "syntax error - cannot backup" );\ goto yyerrlab;\* }\ yychar = newtoken;\ yystate = *yyps;\ yylval = newvalue;\ goto yynewstate;\}G$#define YYRECOVERING() (!!yyerrflag)#ifndef YYDEBUGs1# define YYDEBUG 1 /* make debugging available */o#endif/*** user known globals */.int yydebug; /* set to 1 to get debugging *//*** driver internal defines*/#define YYFLAG (-1000)/*&** static variables used by the parser*/(static YYSTYPE *yyv; /* value stack */$static int *yys; /* state stack */0static YYSTYPE *yypv; /* top of value stack */,static int *yyps; /* top of state stack */)static int yystate; /* current state */ :static int yytmp; /* extra var (lasts between blocks) */%int yynerrs; /* number of errors */g*int yyerrflag; /* error recovery flag */.int yychar; /* current input token number *//*E** yyparse - return 0 if worked, 1 if syntax error not recovered from}*/ints yyparse()e{n< register YYSTYPE *yypvt; /* top of value stack for $vars */" unsigned yymaxdepth = YYMAXDEPTH; /*l? ** Initialize externals - yyparse may be called more than onceN */4 yyv = (YYSTYPE*)malloc(yymaxdepth*sizeof(YYSTYPE));, yys = (int*)malloc(yymaxdepth*sizeof(int)); if (!yyv || !yys) { yyerror( "out of memory" );; return(1); } yypv = &yyv[-1];t yyps = &yys[-1];o yystate = 0;t yytmp = 0; yynerrs = 0; yyerrflag = 0;o yychar = -1;  goto yystack; {3 register YYSTYPE *yy_pv; /* top of value stack */e0 register int *yy_ps; /* top of state stack */- register int yy_state; /* current state */L7 register int yy_n; /* internal state number info */  /* ** get globals into registers.0 ** branch to here only if YYBACKUP was called. */ yynewstate: yy_pv = yypv;, yy_ps = yyps;; yy_state = yystate; goto yy_newstate;u /* ** get globals into registers.< ** either we just started, or we just finished a reduction */ yystack:B yy_pv = yypv;  yy_ps = yyps; yy_state = yystate;( /*2 ** top of for (;;) loop while no reductions done */ yy_stack: /** ** put a state and value onto the stacks */ #if YYDEBUGo /*; ** if debugging, look up token value in list of value vs. 9 ** name pairs. 0 and negative (-1) are special values.9 ** Note: linear search is used since time is not a realt# ** consideration while debugging.( */ if ( yydebug ) {  register int yy_i;=0 (void)printf( "State %d, token ", yy_state ); if ( yychar == 0 )$ (void)printf( "end-of-file\n" ); else if ( yychar < 0 ) (void)printf( "-none-\n" );i else" {, for ( yy_i = 0; yytoks[yy_i].t_val >= 0; yy_i++ )v {( if ( yytoks[yy_i].t_val == yychar ) break; }}0 (void)printf( "%s\n", yytoks[yy_i].t_name ); } }W#endif /* YYDEBUG */; if ( ++yy_ps >= &yys[ yymaxdepth ] ) /* room on stack? */f {x /*.1 ** reallocate and recover. Note that pointers 1 ** have to be reset, or bad things will happen */ " int yyps_index = (yy_ps - yys);" int yypv_index = (yy_pv - yyv);# int yypvt_index = (yypvt - yyv);) yymaxdepth += YYMAXDEPTH;& yyv = (YYSTYPE*)realloc((char*)yyv," yymaxdepth * sizeof(YYSTYPE));" yys = (int*)realloc((char*)yys, yymaxdepth * sizeof(int)); if (!yyv || !yys) {% yyerror( "yacc stack overflow" ); return(1); } yy_ps = yys + yyps_index; yy_pv = yyv + yypv_index; yypvt = yyv + yypvt_index;  }r *yy_ps = yy_state; *++yy_pv = yyval;* /*. ** we have a new state - find out what to do */ yy_newstate:m0 if ( ( yy_n = yypact[ yy_state ] ) <= YYFLAG )& goto yydefault; /* simple state */ #if YYDEBUGc /*9 ** if debugging, need to mark whether new token grabbed  */ yytmp = yychar < 0;,#endif7 if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )e! yychar = 0; /* reached EOF */, #if YYDEBUG if ( yydebug && yytmp )u { register int yy_i;m% (void)printf( "Received token " ); if ( yychar == 0 )$ (void)printf( "end-of-file\n" ); else if ( yychar < 0 )a (void)printf( "-none-\n" );s else/ {, for ( yy_i = 0; yytoks[yy_i].t_val >= 0; yy_i++ )  { ( if ( yytoks[yy_i].t_val == yychar ) break; }s0 (void)printf( "%s\n", yytoks[yy_i].t_name ); } }&#endif /* YYDEBUG */9 if ( ( ( yy_n += yychar ) < 0 ) || ( yy_n >= YYLAST ) )  goto yydefault;@ if ( yychk[ yy_n = yyact[ yy_n ] ] == yychar ) /*valid shift*/ {m yychar = -1; yyval = yylval; yy_state = yy_n;  if ( yyerrflag > 0 )e yyerrflag--; goto yy_stack;  }a yydefault:a+ if ( ( yy_n = yydef[ yy_state ] ) == -2 ) {r #if YYDEBUG  yytmp = yychar < 0;#endif8 if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )" yychar = 0; /* reached EOF */ #if YYDEBUG if ( yydebug && yytmp ) { register int yy_i;& (void)printf( "Received token " ); if ( yychar == 0 )% (void)printf( "end-of-file\n" ); else if ( yychar < 0 ) (void)printf( "-none-\n" ); else {e for ( yy_i = 0; yytoks[yy_i].t_val >= 0; yy_i++ ) { if ( yytoks[yy_i].t_val == yychar ) { break;e } }1 (void)printf( "%s\n", yytoks[yy_i].t_name );a }  }#endif /* YYDEBUG */ /*" ** look through exception table */p { register int *yyxi = yyexca; while ( ( *yyxi != -1 ) || ( yyxi[1] != yy_state ) ) {" yyxi += 2;A }u$ while ( ( *(yyxi += 2) >= 0 ) && ( *yyxi != yychar ) ) ;! if ( ( yy_n = yyxi[1] ) < 0 ) YYACCEPT; } }* /* ** check for syntax errorn */& if ( yy_n == 0 ) /* have an error */ {o# /* no worry about speed here! */n switch ( yyerrflag )  { case 0: /* new error */r yyerror( "syntax error" ); goto skip_init;r yyerrlab: /*" ** get globals into registers.1 ** we have a user generated syntax type error */ yy_pv = yypv;e yy_ps = yyps;n yy_state = yystate;* yynerrs++; skip_init:r case 1:. case 2: /* incompletely recovered error */ /* try again... */ yyerrflag = 3; /** ** find state where "error" is a legal ** shift action; */ while ( yy_ps >= yys ) {;) yy_n = yypact[ *yy_ps ] + YYERRCODE;p' if ( yy_n >= 0 && yy_n < YYLAST &&*, yychk[yyact[yy_n]] == YYERRCODE) { /*" ** simulate shift of "error" */ yy_state = yyact[ yy_n ];e goto yy_stack; } /*% ** current state has no shift onp ** "error", pop stack */) #if YYDEBUGB# define _POP_ "Error recovery pops state %d, uncovers state %d\n" if ( yydebug ))" (void)printf( _POP_, *yy_ps, yy_ps[-1] ); # undef _POP_a#endif yy_ps--;l yy_pv--;g }  /*1 ** there is no state on stack with "error" asn ** a valid shift. give up.  */ YYABORT;+ case 3: /* no shift yet; eat a token */ #if YYDEBUGi /*- ** if debugging, look up token in list ofa. ** pairs. 0 and negative shouldn't occur,+ ** but since timing doesn't matter whenc. ** debugging, it doesn't hurt to leave the ** tests here. */ if ( yydebug ) {t register int yy_i;e0 (void)printf( "Error recovery discards " ); if ( yychar == 0 )n, (void)printf( "token end-of-file\n" ); else if ( yychar < 0 )l' (void)printf( "token -none-\n" );e else) { for ( yy_i = 0;e yytoks[yy_i].t_val >= 0; yy_i++ )t { if ( yytoks[yy_i].t_val == yychar )e { break; } }! (void)printf( "token %s\n",3 yytoks[yy_i].t_name );7 } }}#endif /* YYDEBUG */. if ( yychar == 0 ) /* reached EOF. quit */ YYABORT;5 yychar = -1; goto yy_newstate;1 } }/* end if ( yy_n == 0 ) */, /*! ** reduction by production yy_n,6 ** put stack tops, etc. so things right after switch */ #if YYDEBUG  /*6 ** if debugging, print the string that is the user's7 ** specification of the reduction which is just about  ** to be done. */ if ( yydebug )+ (void)printf( "Reduce by (%d) \"%s\"\n",  yy_n, yyreds[ yy_n ] ); #endif, yytmp = yy_n; /* value to switch over */1 yypvt = yy_pv; /* $vars top of value stack */  /*& ** Look in goto table for next state1 ** Sorry about using yy_state here as temporary 3 ** register variable, but why not, if it works... 3 ** If yyr2[ yy_n ] doesn't have the low order bit00 ** set, then there is no action to be done for1 ** this reduction. So, no saving & unsaving of05 ** registers done. The only difference between the05 ** code just after the if and the body of the if is 6 ** the goto yy_stack in the body. This way the test; ** can be made before the choice of what to do is needed.0 */ { 4 /* length of production doubled with extra bit */& register int yy_len = yyr2[ yy_n ]; if ( !( yy_len & 01 ) ) { yy_len >>= 1; 1 yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */ - yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +  *( yy_ps -= yy_len ) + 1; if ( yy_state >= YYLAST || yychk[ yy_state =# yyact[ yy_state ] ] != -yy_n )3 {,' yy_state = yyact[ yypgo[ yy_n ] ];  }0 goto yy_stack; } yy_len >>= 1;0 yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */, yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] + *( yy_ps -= yy_len ) + 1;, if ( yy_state >= YYLAST ||-4 yychk[ yy_state = yyact[ yy_state ] ] != -yy_n ) {& yy_state = yyact[ yypgo[ yy_n ] ]; } },) /* save until reenter driver code */, yystate = yy_state;  yyps = yy_ps;, yypv = yy_pv;  } /*02 ** code supplied by user is placed in this switch */, switch( yytmp ) { case 3:8# line 137 "gram.y",{ yyerrok; } break;0case 6: # line 142 "gram.y" { Lineno++; } break;case 8:,# line 146 "gram.y"7{ Lineno++; } break;case 10:# line 151 "gram.y"-{01 switch (KeywordTable[yypvt[-2].ival].type) {- case IsQuitFunction:, case IsFunction:-! if (yypvt[-0].ival == C_MAP) {-8 bindtofunc(yypvt[-2].ival, bkmask, cmask, NULL);' } else yyerror("illegal construct"); break;2 case IsDownFunction:  if (bkmask & ButtonUp) {  sprintf(msg,' "cannot bind %s to button up", , KeywordTable[yypvt[-2].ival].name); yyerror(msg);  }! if (yypvt[-0].ival == C_MAP) { 8 bindtofunc(yypvt[-2].ival, bkmask, cmask, NULL);' } else yyerror("illegal construct"); break;5 case IsMenuMap: if (bkmask & ButtonUp) {  sprintf(msg,' "cannot bind %s to button up", , KeywordTable[yypvt[-2].ival].name); yyerror(msg);0 }% if (yypvt[-0].ival == C_MENUMAP) {  bindtofunc1 (yypvt[-2].ival, bkmask, cmask, menu_name); ' } else yyerror("illegal construct"); break;, case IsAction: $ if (yypvt[-0].ival == C_ACTION) { /*9 * We pass a structure pointer here where a char pointer 5 * is supposed to go. It was a hack, what can I say.  */ bindtofunc6 (yypvt[-2].ival, bkmask, cmask, (char *)action);' } else yyerror("illegal construct"); break;  case IsMenu: " if (yypvt[-0].ival == C_MENU) { /*# * create a menu definition entry.  */B menu_info = stashmenuinfo(menu_name, ml_ptr, menu_pixmap);- menu_link = stashmenulink(menu_info); 1 Menus = appendmenulink(Menus, menu_link); , } else yyerror("illegal menu construct"); break;- case IsGadget:1 if (gadgnum < 0) { 5 sprintf(msg, "Gadget number must be >= 0\n");, yyerror(msg);  }% /* Bump NumGadgets if necessary */2" else if (gadgnum >= NumGadgets)! NumGadgets = gadgnum + 1;5" if (NumGadgets > MAX_GADGETS) {C sprintf(msg, "\"numgadgets\" (%d) is > MAX_GADGETS (%d)\n",2" NumGadgets, MAX_GADGETS); yyerror(msg);4 } else { E if (yypvt[-0].ival != C_STRING && yypvt[-0].ival != C_PIXMAP) + yyerror("Illegal gadget assignment");2 else8 stashGadget(gadgnum, yylval.sval, yypvt[-0].ival); } break; default: % yyerror("internal binding error"); break;3 }} break;case 11:# line 234 "gram.y",{ " yyval.sval = yypvt[-1].sval; } break; case 12:# line 239 "gram.y" {, yyval.ival = C_MAP;. bkmask = yypvt[-4].ival | yypvt[-0].ival; cmask = yypvt[-2].ival;} break;case 13:# line 245 "gram.y" {1 yyval.ival = C_MENUMAP;. bkmask = yypvt[-6].ival | yypvt[-2].ival; cmask = yypvt[-4].ival; menu_name = yypvt[-0].sval;} break;case 14:# line 252 "gram.y" {  yyval.ival = C_ACTION; . bkmask = yypvt[-6].ival | yypvt[-2].ival; cmask = yypvt[-4].ival; action = yypvt[-0].alval;} break;case 15:# line 259 "gram.y"u{{ yyval.ival = C_MENU; menu_name = yypvt[-1].sval; menu_pixmap = 0;  ml_ptr = yypvt[-0].alval;} break;case 16:# line 266 "gram.y""{, yyval.ival = C_MENU;" menu_name = yypvt[-1].sval;" menu_pixmap = yypvt[-2].sval; ml_ptr = yypvt[-0].alval;} break;case 17:# line 273 "gram.y" ?{ yylval.sval = yypvt[-2].sval; yyval.ival = C_STRING; } break;ocase 18:# line 275 "gram.y"t?{ yylval.sval = yypvt[-2].sval; yyval.ival = C_PIXMAP; } break;lcase 19:# line 277 "gram.y"o{' yyval.ival = C_STRING; 3 /* just in case it's a gadget, set defaults */  g_forecolor = Foreground; g_backcolor = Background;! g_gravity = NoGadgetGravity;r g_offset = 0; g_font = 0;} break;case 20:# line 287 "gram.y""{p yyval.ival = C_PIXMAP;u3 /* just in case it's a gadget, set defaults */x g_forecolor = Foreground; g_backcolor = Background;! g_gravity = NoGadgetGravity;c g_offset = 0; g_font = 0;} break;case 26:# line 304 "gram.y"r{ g_offset = 0; } break;case 27:# line 306 "gram.y" { # g_offset = y_atoi(yypvt[-0].sval);p g_gravity = NoGadgetGravity;e g_forecolor = Foreground; g_backcolor = Background; g_font = (XFontStruct *)NULL;} break;case 28:# line 315 "gram.y"G'{ g_gravity = NoGadgetGravity; } break;ocase 29:# line 317 "gram.y"*{p+ g_gravity = gravitylookup(yypvt[-0].sval);: g_forecolor = Foreground; g_backcolor = Background; g_font = (XFontStruct *)NULL;} break;case 30:# line 325 "gram.y"g${ g_forecolor = Foreground; } break;case 31:# line 327 "gram.y"p{  g_forecolor = yypvt[-0].sval; g_backcolor = Background; g_font = (XFontStruct *)NULL;} break;case 32:# line 334 "gram.y",${ g_backcolor = Background; } break;case 33:# line 336 "gram.y""{ g_backcolor = yypvt[-0].sval; g_font = (XFontStruct *)NULL;} break;case 34:# line 342 "gram.y"o{ g_font = 0; } break;case 35:# line 344 "gram.y"N{t2 g_font = XLoadQueryFont(dpy, yypvt[-0].sval); if (!g_font) {:A sprintf(msg, "Can't open gadget font '%s'\n", yypvt[-0].sval);: yywarn(msg);u }} break;case 36:# line 354 "gram.y"e{i% ki = keywordlookup(yylval.sval);s% switch (KeywordTable[ki].type) {' case IsParser:a (*KeywordTable[ki].fptr)(); break;e default:N yyerror("keyword error"); }} break;case 37:# line 366 "gram.y""{t. yyval.ival = keywordlookup(yylval.sval); } break;icase 38:# line 369 "gram.y"i{  char *ptr;d char *malloc();, ptr = malloc(strlen(GADGET_TOKEN) + 1); if (ptr == NULL) {* Error("out of space");i } strcpy(ptr, GADGET_TOKEN);s% yyval.ival = keywordlookup(ptr);n gadgnum = yypvt[-0].ival;} break;case 39:# line 383 "gram.y"({ ' yyval.ival = y_atoi(yylval.sval);v } break;)case 40:# line 389 "gram.y"n{ yyval.ival = 0; } break;case 41:# line 391 "gram.y" '{ yyval.ival = yypvt[-0].ival; } break;rcase 42:# line 393 "gram.y"o8{ yyval.ival = yypvt[-2].ival | yypvt[-0].ival; } break;case 43:# line 397 "gram.y" #{ yyval.ival = 0xffffffff; } break;Gcase 44:# line 399 "gram.y"U'{ yyval.ival = yypvt[-0].ival; } break;acase 45:# line 401 "gram.y"u8{ yyval.ival = yypvt[-2].ival | yypvt[-0].ival; } break;case 46:# line 405 "gram.y"n9{ yyval.ival = CheckButtonState(yypvt[-0].ival); } break;icase 47:# line 408 "gram.y"3{ yyval.ival = keyexprlookup(yylval.sval); } break;icase 48:# line 411 "gram.y"4{ yyval.ival = contexprlookup(yylval.sval); } break;case 49:# line 413 "gram.y" { > if (yypvt[-0].ival < 0 || yypvt[-0].ival >= NumGadgets) {D sprintf(msg, "Bad subscript, gadget #%d must be >= 0 and < %d\n", yypvt[-0].ival, NumGadgets); yyerror(msg); } else {h char *ptr;t char *malloc();) ptr = malloc(strlen(GADGET_TOKEN) + 1);y if (ptr == NULL) { Error("out of space"); }n strcpy(ptr, GADGET_TOKEN);J yyval.ival = contexprlookup(ptr) | (1 << (BITS_USED + yypvt[-0].ival)); }} break;case 50:# line 433 "gram.y"d'{ yyval.ival = yypvt[-0].ival; } break;mcase 51:# line 435 "gram.y")8{ yyval.ival = yypvt[-1].ival | yypvt[-0].ival; } break;case 52:# line 439 "gram.y" 4{ yyval.ival = buttexprlookup(yylval.sval); } break;case 53:# line 443 "gram.y"0'{ yyval.sval = yypvt[-0].sval; } break;lcase 54:# line 447 "gram.y"t){ yyval.alval = yypvt[-1].alval; } break;/case 55:# line 451 "gram.y"i){ yyval.alval = yypvt[-0].alval; } break;case 56:# line 453 "gram.y"rJ{ yyval.alval = appendmenuline(yypvt[-1].alval, yypvt[-0].alval); } break;case 57:# line 455 "gram.y"i{r Lineno++;# yyval.alval = yypvt[-1].alval;} break;case 58:# line 460 "gram.y"y{  Lineno++; yyval.alval = NULL;} break;case 59:# line 465 "gram.y"t{ yyval.alval = NULL; } break;case 60:# line 467 "gram.y"a){ yyval.alval = yypvt[-1].alval; } break;vcase 61:# line 469 "gram.y"e{y yyval.alval = NULL; yyerrok;o} break;case 62:# line 476 "gram.y"c{, yypvt[-1].alval->name = yypvt[-3].sval;- yypvt[-1].alval->pixmapname = (char *)0;,# yyval.alval = yypvt[-1].alval; } break;case 63:# line 482 "gram.y"1{r2 yypvt[-1].alval->pixmapname = yypvt[-4].sval;, yypvt[-1].alval->name = yypvt[-4].sval;# yyval.alval = yypvt[-1].alval;b} break;case 64:# line 490 "gram.y"({d% ki = keywordlookup(yylval.sval);; if ((ki != -1) &&* (KeywordTable[ki].type != IsFunction) &&- (KeywordTable[ki].type != IsImmFunction) &&e. (KeywordTable[ki].type != IsQuitFunction) &&) (KeywordTable[ki].type != IsBoolean) && . (KeywordTable[ki].type != IsDownFunction)) { sprintf(msg,}4 "menu action \"%s\" not a function or variable", KeywordTable[ki].name);/ yyerror(msg); } ml_ptr = AllocActionLine();3 if (KeywordTable[ki].type == IsQuitFunction || ( KeywordTable[ki].type == IsImmFunction) ml_ptr->type = IsImmFunction;3 else if (KeywordTable[ki].type == IsBoolean) {  ml_ptr->type = IsVar;0 ml_ptr->text = (char *)KeywordTable[ki].bptr; } else( ml_ptr->type = IsUwmFunction;* ml_ptr->func = KeywordTable[ki].fptr; yyval.alval = ml_ptr;} break;case 65:# line 517 "gram.y"|{y( ki = keywordlookup(yypvt[-2].sval); if (ki != -1 &&' KeywordTable[ki].type != IsMenuMap) {y sprintf(msg,_- "menu action \"%s\" not a menu function",  KeywordTable[ki].name);v yyerror(msg); } ml_ptr = AllocActionLine();# ml_ptr->type = IsMenuFunction;(# ml_ptr->text = yypvt[-0].sval;G yyval.alval = ml_ptr;} break;case 66:# line 532 "gram.y"i){ yyval.alval = yypvt[-0].alval; } break; case 67:# line 536 "gram.y"r{0C yyval.alval = StashActionLine(IsShellCommand, yypvt[-0].sval);} break;case 68:# line 540 "gram.y"Y{U= yyval.alval = StashActionLine(IsTextNL, yypvt[-0].sval);} break;case 69:# line 544 "gram.y" { ; yyval.alval = StashActionLine(IsText, yypvt[-0].sval);s} break;case 70:# line 549 "gram.y"-${ yyval.sval = yylval.sval; } break;case 71:# line 551 "gram.y">B{ yyval.sval = strconcat(yypvt[-1].sval, yypvt[-0].sval); } break; }4 goto yystack; /* reset registers in driver code */}_.t_name ); } }&#endif /* YYDEBUG */9 if ( ( ( yy_n += yychar ) < 0 ) || ( yy_n >= YYLAST ) )  goto yydefault;@ if ( yychk[ yy_n = yyact[ yy_n ] ] == yychar ) /*valid shift*/ {m yychar = -1; yyval = yylval; yy_state = yy_n;  if ( yyerrflag > 0 )e yyerrflag--; *[FIELDS.X.AWM]GRIDBOX.C;3+,B./% 4-C0@123KPWO56 %7s 8HPH9fG%HJ #ifndef lintstatic char *rcsid_StoreGridBox_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/GridBox.c,v 1.1 89/01/23 15:34:22 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specif=^48~AWM.SAVEBC[FIELDS.X.AWM]GRIDBOX.C;31ic, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. *//* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group= * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,+ * Western Software Lab. Converted to X11.* * 002 -- Jordan Hubbard, Ardent Computer. * Changes for titled windows. */ #ifndef lint7static char *sccsid = "@(#)StoreGridBox.c 3.8 1/24/86";#endif/*G * StoreGridBox - This subroutine is used by the X Window Manager (xwm)B * to store the vertices for the movement resize grid and box in a * vertex list. */#include "awm.h"/*L * Store the vertices for the movement resize grid and box in a vertex list. */)int StoreGridBox(box, ulx, uly, lrx, lry)register XSegment box[];)int ulx; /* Upper left X coordinate. */)int uly; /* Upper left Y coordinate. */*int lrx; /* Lower right X coordinate. */*int lry; /* Lower right Y coordinate. */{ register int xthird, ythird; int x1third, y1third; int x2third, y2third; Entry("StoreGridBox") /* * Xor in. */% box[0].x1 = ulx; box[0].y1 = uly;% box[0].x2 = lrx; box[0].y2 = uly;% box[1].x1 = lrx; box[1].y1 = uly;% box[1].x2 = lrx; box[1].y2 = lry;% box[2].x1 = lrx; box[2].y1 = lry;% box[2].x2 = ulx; box[2].y2 = lry;% box[3].x1 = ulx; box[3].y1 = lry;% box[3].x2 = ulx; box[3].y2 = uly; /*H * These are the X and Y calculations for the parts of the grid that7 * are dependent on the division by 3 calculations. */ /* * Y dimension third. */ ythird = (lry - uly) / 3; y1third = uly + ythird; y2third = y1third + ythird;  /* * X dimension third. */ xthird = (lrx - ulx) / 3; x1third = ulx + xthird; x2third = x1third + xthird;) box[4].x1 = x1third; box[4].y1 = lry;) box[4].x2 = x1third; box[4].y2 = uly;) box[5].x1 = x2third; box[5].y1 = lry;) box[5].x2 = x2third; box[5].y2 = uly;) box[6].x1 = ulx; box[6].y1 = y1third;) box[6].x2 = lrx; box[6].y2 = y1third;) box[7].x1 = ulx; box[7].y1 = y2third;) box[7].x2 = lrx; box[7].y2 = y2third; /*1 * Do not erase if we're freezing the screen. */ if (Freeze) Leave(8) /*= * From here on we're retracing the segments to clear the * grid using GXxor. */% box[8].x1 = ulx; box[8].y1 = uly;% box[8].x2 = lrx; box[8].y2 = uly;% box[9].x1 = lrx; box[9].y1 = uly;% box[9].x2 = lrx; box[9].y2 = lry;' box[10].x1 = lrx; box[10].y1 = lry;' box[10].x2 = ulx; box[10].y2 = lry;' box[11].x1 = ulx; box[11].y1 = lry;' box[11].x2 = ulx; box[11].y2 = uly;+ box[12].x1 = x1third; box[12].y1 = lry;+ box[12].x2 = x1third; box[12].y2 = uly;+ box[13].x1 = x2third; box[13].y1 = lry;+ box[13].x2 = x2third; box[13].y2 = uly;+ box[14].x1 = ulx; box[14].y1 = y1third;+ box[14].x2 = lrx; box[14].y2 = y1third;+ box[15].x1 = ulx; box[15].y1 = y2third;+ box[15].x2 = lrx; box[15].y2 = y2third; /*& * Total number of segments is 16. */ Leave(16)}/*L * Store the vertices for the movement resize grid and box in a vertex list.N * This is just like the routine above, but it adds a line for titled windows. */.int StoreTitleGridBox(box, ulx, uly, lrx, lry)register XSegment box[];)int ulx; /* Upper left X coordinate. */)int uly; /* Upper left Y coordinate. */*int lrx; /* Lower right X coordinate. */*int lry; /* Lower right Y coordinate. */{ register int xthird, ythird; int x1third, y1third; int x2third, y2third; Entry("StoreTitleGridBox") /* * Xor in. */% box[0].x1 = ulx; box[0].y1 = uly;% box[0].x2 = lrx; box[0].y2 = uly;7 box[1].x1 = ulx; box[1].y1 = uly + titleHeight + 2;7 box[1].x2 = lrx; box[1].y2 = uly + titleHeight + 2;% box[2].x1 = lrx; box[2].y1 = uly;% box[2].x2 = lrx; box[2].y2 = lry;% box[3].x1 = lrx; box[3].y1 = lry;% box[3].x2 = ulx; box[3].y2 = lry;% box[4].x1 = ulx; box[4].y1 = lry;% box[4].x2 = ulx; box[4].y2 = uly; /*H * These are the X and Y calculations for the parts of the grid that7 * are dependent on the division by 3 calculations. */ /* * Y dimension third. *// ythird = (lry - uly - titleHeight - 2) / 3;- y1third = uly + ythird + titleHeight + 2; y2third = y1third + ythird;  /* * X dimension third. */ xthird = (lrx - ulx) / 3; x1third = ulx + xthird; x2third = x1third + xthird;) box[5].x1 = x1third; box[5].y1 = lry;; box[5].x2 = x1third; box[5].y2 = uly + titleHeight + 3;) box[6].x1 = x2third; box[6].y1 = lry;; box[6].x2 = x2third; box[6].y2 = uly + titleHeight + 3;) box[7].x1 = ulx; box[7].y1 = y1third;) box[7].x2 = lrx; box[7].y2 = y1third;) box[8].x1 = ulx; box[8].y1 = y2third;) box[8].x2 = lrx; box[8].y2 = y2third; /*1 * Do not erase if we're freezing the screen. */ if (Freeze) Leave(9) /*= * From here on we're retracing the segments to clear the * grid using GXxor. */% box[9].x1 = ulx; box[9].y1 = uly;% box[9].x2 = lrx; box[9].y2 = uly;9 box[10].x1 = ulx; box[10].y1 = uly + titleHeight + 2;9 box[10].x2 = lrx; box[10].y2 = uly + titleHeight + 2;' box[11].x1 = lrx; box[11].y1 = uly;' box[11].x2 = lrx; box[11].y2 = lry;' box[12].x1 = lrx; box[12].y1 = lry;' box[12].x2 = ulx; box[12].y2 = lry;' box[13].x1 = ulx; box[13].y1 = lry;' box[13].x2 = ulx; box[13].y2 = uly;+ box[14].x1 = x1third; box[14].y1 = lry;= box[14].x2 = x1third; box[14].y2 = uly + titleHeight + 3;+ box[15].x1 = x2third; box[15].y1 = lry;= box[15].x2 = x2third; box[15].y2 = uly + titleHeight + 3;+ box[16].x1 = ulx; box[16].y1 = y1third;+ box[16].x2 = lrx; box[16].y2 = y1third;+ box[17].x1 = ulx; box[17].y1 = y2third;+ box[17].x2 = lrx; box[17].y2 = y2third; /*& * Total number of segments is 18. */ Leave(18)}*[FIELDS.X.AWM]ICONIFY.C;3+,B./% 4-C0@123KPWO56 ~n%7 8 1pPH9fG%HJ  #ifndef lintstatic char *rcsid_Iconify_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Iconify.c,v 1.2 89/02/07 20:05:12 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. *//* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group2 * 001 -- R. Kittell, DEC Storage A/D May 20, 1986G * Add optional warp of mouse to the upper right corner on de-iconify,& * and to the icon center on iconify.= * 002 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,& * Western Software Lab. Port to X11.* * 003 -- Jordan Hubbard, Ardent Computer.J * Many mods to cope with context manager, titled windows. Almost a total * rewrite.F * 1.2 -- Support for IconLabels.. (Isaac Salzman). A few fixes (jkh). */#include "awm.h"+Boolean Iconify(window, mask, button, x, y);Window window; /* Event window. */>int mask; /* Button/key mask. */Bint button; /* Button event detail. */Cint x, y; /* Event mouse position. */{< XWindowAttributes fromInfo; /* info on "from" window */9 XWindowAttributes toInfo; /* info on "to" window */9 int mse_x, mse_y; /* Mouse X and Y coordinates. */A int sub_win_x, sub_win_y; /* relative Mouse coordinates. */> int num_vectors; /* Number of vectors in zap buffer. */, unsigned int mmask; /* Mouse state */, Window root; /* Mouse root window. */0 Window from, to; /* from -> to windows */7 Window sub_win; /* Mouse position sub-window. */C XSegment zap[MAX_ZAP_VECTORS]; /* Zap effect vertex buffer. */% Boolean dozap; /* local Zap */ AwmInfoPtr awi; extern Window MakeIcon(); Entry("Iconify") /*. * Do not try to iconify the root window. */( if (window == RootWindow(dpy, scr)) Leave(FALSE) /*F * The original idea of zap lines has one flaw. If a window wantsH * to be created iconic, it should just appear that way without anyI * fuss. CheckMap() calls us with (win, 0, 0, 0, 0) when this is theF * case, so we can special case this to turn off Zap temporarily.A * Since we don't want to mess with the global "Zap", we use * "dozap" instead.  */6 dozap = (mask || button || x || y) ? Zap : FALSE; /* * Clear the vector buffer. */ if (dozap) bzero(zap, sizeof(zap));  /*? * Get the mouse cursor position in case we must put a new * icon there. */? XQueryPointer(dpy, RootWindow(dpy, scr), &root, &sub_win, 5 &mse_x, &mse_y, &sub_win_x, &sub_win_y, &mmask);   /*N * Figure out which direction we're going in (icon->window or vica-versa) */ awi = GetAwmInfo(window); if (!awi) Leave(FALSE) if (awi->state & ST_ICON) { from = awi->icon;7 to = (awi->frame) ? awi->frame : awi->client;# if (!(awi->state & ST_PLACED)) { PlaceWindow(to, None);% XMapWindow(dpy, awi->client); } }' else if (awi->state & ST_WINDOW) {9 from = (awi->frame) ? awi->frame : awi->client;O to = (awi->icon) ? awi->icon : MakeIcon(window, mse_x, mse_y, TRUE); } else {? printf("Iconify: Window %x has unknown state '%x'\n", awi->client, awi->state); Leave(FALSE) }9 status = XGetWindowAttributes(dpy, from, &fromInfo); if (status == FAILURE) Leave(FALSE)5 status = XGetWindowAttributes(dpy, to, &toInfo); if (status == FAILURE) Leave(FALSE)  /*$ * Store the zap vector buffer. */ if (dozap) { num_vectors = StoreZap(zap, fromInfo.x - 1, fromInfo.y - 1, fromInfo.x + fromInfo.width + (fromInfo.border_width << 1),! fromInfo.y + fromInfo.height + (fromInfo.border_width << 1), toInfo.x - 1, toInfo.y - 1, toInfo.x + toInfo.width + (toInfo.border_width << 1), toInfo.y + toInfo.height + (toInfo.border_width << 1)); } if (awi->state & ST_ICON) { if (!awi->frame)- XRemoveFromSaveSet(dpy, awi->client); awi->state ^= ST_ICON; awi->state |= ST_WINDOW;#ifdef WMSTATE# awi->wm_state.state=NormalState;B XChangeProperty(dpy,awi->client,wm_state_atom,wm_state_atom,32,0 PropModeReplace,(char *) &awi->wm_state,2);#endif /* WMSTATE */ }' else if (awi->state & ST_WINDOW) {* XAddToSaveSet(dpy, awi->client); awi->state ^= ST_WINDOW; awi->state |= ST_ICON;#ifdef WMSTATE# awi->wm_state.state=IconicState;B XChangeProperty(dpy,awi->client,wm_state_atom,wm_state_atom,32,0 PropModeReplace,(char *) &awi->wm_state,2);#endif /* WMSTATE */ } elseE fprintf(stderr, "Window state for window %x got munged!\n", awi->client); /* * Map the target. */ XMapRaised(dpy, to); if (dozap) { /* * Draw the zap lines. */ DrawZap(); } /* * Unmap the "from" window. */ XUnmapWindow(dpy, from); XFlush(dpy); /*B * Optionally warp the mouse to the upper right corner of the * window. */5 if (WarpOnDeIconify && awi->state & ST_WINDOW) { int y;6 y = (toInfo.height >= 10) ? 10 : toInfo.height / 2;/ if (awi->frame) { /* compensate for title */ XWindowAttributes xwa;4 XGetWindowAttributes(dpy, awi->title, &xwa); y += xwa.height + 2; }( status = XWarpPointer (dpy, None, to, 0, 0, 0, 0, toInfo.width >= 7 ?) toInfo.width - 7 : toInfo.width / 2, y); }/ if (WarpOnIconify && awi->state & ST_ICON)) status = XWarpPointer (dpy, None, to,  0, 0, 0, 0,* toInfo.width / 2, toInfo.height / 2); Leave(FALSE)}*[FIELDS.X.AWM]ICONS.C;3+,B./% 4-C0@123KPWO56d%7 8PH9fG%HJ< #ifndef lintstatic char *rcsid_Icons_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Icons.c,v 1.2 89/02/07 20:05:21 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ /* * MODIFICATION HISTORY *7 * 000 -- L. Guarino Reid, DEC Ultrix Engineering Group) * 001 -- Jordan Hubbard, Ardent Computer* * Many modifications for titled windows.* * 1.2 -- Jordan Hubbard, Ardent Computer.5 * vPad and hPad usage corrected (Chris Thewalt fix).! * Clipping now set on right GC. 9 * 1.3 -- Changed the way icon button events are handled.& * 1.4 -- Isaac J. Salzman, RAND Corp.D * reworked the way icons are handled - if IconsLabels is set, iconsF * with pixmaps are labled at bottom & icons w/o pixmaps use a defaultE * pixmap w/a label instead of just a solid bg tile (i.e. twm style),: * otherwise old uwm style icons are used (typin and all).D * 1.5 -- Modified Isaac's changes to allow wm_option.icon.labels toB * work. This allows individual clients/classes to determine their * icon style. -jkh */ #include "awm.h"#include extern XContext AwmContext; extern void Warning();L/* the client should pass us a bitmap (single-plane pixmap with background=0K * and foreground = 1). It is our responsibility to convert it to a pixmapH * of the appropriate depth for a window tile and also color it with the0 * appropriate background and foreground pixels. *@ * we'll use the (global) IconGC for the fore/background pixels. */Sstatic Pixmap MakePixmapFromBitmap( bitmap, clipmask, width_return, height_return )Pixmap bitmap, clipmask;+unsigned int *width_return, *height_return;{ Pixmap tile; Window junkW; int junk; unsigned int width, height; GC iGC; XGCValues gcv; " Entry("MakePixmapFromBitmap") : if (!XGetGeometry( dpy, bitmap, &junkW, &junk, &junk,+ &width, &height, &junk, &junk )) {7 Warning( "client passed invalid pixmap for icon." ); Leave( NULL ) }D tile = XCreatePixmap( dpy, RootWindow(dpy, scr), width, height,) (unsigned) DefaultDepth(dpy, scr) );& gcv.foreground = ITextForeground;& gcv.background = ITextBackground;N iGC = XCreateGC(dpy, RootWindow(dpy, scr), (GCForeground | GCBackground), &gcv); if (clipmask)$ XSetClipMask(dpy, iGC, clipmask);C XCopyPlane(dpy, bitmap, tile, iGC, 0, 0, width, height, 0, 0,  (unsigned long) 1 ); XFreeGC(dpy, iGC); if (width_return) *width_return = width; if (height_return) *height_return = height; Leave(tile)}char *GetIconName(window)Window window;{ unsigned char *name; Status status; unsigned long len, after; Atom a_type; int a_form;  Entry("GetIconName") H status = XGetWindowProperty(dpy, window, XA_WM_ICON_NAME, 0L, 256L,6 False, XA_STRING, &a_type, &a_form, &len, &after, &name);  if (status != Success) {E status = XGetWindowProperty(dpy, window, XA_WM_NAME, 0L, NAME_LEN,3 False, XA_STRING, &a_type, &a_form, &len, &after, &name); if (status != Success)0 Leave( DEF_NAME ) /* use default name */ }. if (a_form == 0) /* we have no bananas */ Leave((char *)NULL) if (a_form != 8) {3 Warning("Window has icon_name in wrong format"); if (name) free(name); Leave((char *)NULL) } if (len > NAME_LEN) {? Warning("Window has icon_name greater than maximum length"); len = NAME_LEN; } if (!len) Leave((char *)NULL) name[len] = 0; Leave((char *) name)}Boolean IsIcon(icon, win) Window icon; Window *win;{ AwmInfoPtr awi; Entry("IsIcon") if (win) *win = 0; awi = GetAwmInfo(icon); if (!awi) Leave(FALSE) if (awi->icon == icon) { if (win) *win = awi->client; Leave(TRUE) }: else if (awi->client == icon || awi->frame == icon) { if (win) *win = awi->icon; Leave(FALSE) } Leave(FALSE)}RemoveIcon(window)Window window;{ AwmInfoPtr awi; Entry("RemoveIcon") . if ((awi = GetAwmInfo(window)) != NULL) {. XDeleteContext(dpy, awi->icon, AwmContext); if (awi->own) {' XDestroyWindow(dpy, awi->icon);0 if ((awi->iconPixmap != IBackPixmap) && % (awi->iconPixmap != IDefPixmap))' XFreePixmap(dpy, awi->iconPixmap); } awi->icon = (Drawable)NULL; awi->state ^= ST_ICON; awi->state |= ST_WINDOW;#ifdef WMSTATE awi->wm_state.icon=0;# awi->wm_state.state=NormalState;B XChangeProperty(dpy,awi->client,wm_state_atom,wm_state_atom,32,0 PropModeReplace,(char *) &awi->wm_state,2);#endif /* WMSTATE */ } Leave_void}&GetDefaultSize(window, icon_w, icon_h)Window window;int *icon_w, *icon_h;{, char *name; /* Event window name. */ Entry("GetDefaultSize") /*. * Determine the size of the icon window. */ name = GetIconName(window);6 *icon_h = IFontInfo->ascent + IFontInfo->descent; if (name) {7 *icon_w = XTextWidth(IFontInfo, name, strlen(name)); if (*icon_w == 0) *icon_w = *icon_h; } else ; *icon_w = *icon_h = 0; /* set to zilch if bogus name! */ Leave_void}.Window MakeIcon(window, x, y, mousePositioned)@Window window; /* associated window. */Cint x, y; /* Event mouse position. */Boolean mousePositioned;{? int icon_x, icon_y; /* Icon U. L. X and Y coordinates. */> unsigned int icon_w, icon_h; /* Icon width and height. */5 unsigned int icon_bdr; /* Icon border width. */( long mask; /* Icon event mask */D XSetWindowAttributes iconValues; /* for icon window creation */3 unsigned long iconValues_mask; /* for above */= XWMHints *wmhints; /* see if icon position provided */ XWMHints *XGetWMHints(); Pixmap clip = 0; Window AddIcon(); AwmInfoPtr awi; int junk; Entry("MakeIcon") awi = GetAwmInfo(window);L if (awi->attrs & AT_ICONLABEL) { /* check for iconLables - twm style */- iconValues.background_pixmap = IDefPixmap; mask = StructureNotifyMask; }% else { /* uwm style */. iconValues.background_pixmap = IBackPixmap;> mask = (ExposureMask | StructureNotifyMask | KeyPressMask); } /*% * Process window manager hints. */ . if (wmhints = XGetWMHints(dpy, window)) {' if (wmhints->flags & IconWindowHint): Leave(AddIcon(window, wmhints->icon_window, FALSE,. (StructureNotifyMask), (Pixmap)NULL));* if (wmhints->flags & IconPixmapHint) {$ if (wmhints->flags & IconMaskHint)! clip = wmhints->icon_mask; iconValues.background_pixmap =7 MakePixmapFromBitmap(wmhints->icon_pixmap, clip, &icon_w, &icon_h );# if (iconValues.background_pixmap)$ mask = (StructureNotifyMask); else {3 iconValues.background_pixmap = IBackPixmap;* wmhints->flags &= ~IconPixmapHint; } } }  /*? * we now have a pixmap of some sort - either a background8 * tile or an actual image - get the dimensions... */9 if (!XGetGeometry(dpy, iconValues.background_pixmap, &junk, &junk, &junk,, &icon_w, &icon_h, &junk, &junk )) {5 Warning( "can't get geom of pixmap in MakeIcon" ); Leave( NULL ); } % if (awi->attrs & AT_ICONLABEL) { char *s; Pixmap p; unsigned int nw, nh; int tw, th, hoff, voff; " if (s = GetIconName(window)) { nw = icon_w; nh = icon_h;0 /* find out dimensions of text, add padding */6 tw = XTextWidth(IFontInfo, s, strlen(s)) + HIconPad;9 th = IFontInfo->ascent + IFontInfo->descent + VIconPad;  3 /* calculate the size including the icon label */( if (nw < tw) /* width >= text width */ nw = tw; 1 /* always tack on extra for the label height */ nh += th; 3 /* now that we have dimensions, create the pixmap1 we want to eventually use as the icon window */ < if (!(p = XCreatePixmap(dpy, RootWindow(dpy, scr), nw, nh,+ (unsigned) DefaultDepth(dpy, scr)))) {3 Warning("can't create pixmap in MakeIcon."); Leave( NULL ) }: /* calculate horizontal offset of pixmap (center it!) */ if (hoff = (nw - icon_w)) hoff = (hoff+1)/2; ? /* if the label goes at the top, push the thing to the bottom" * otherwise leave it at the top */ < voff = ILabelTop ? (th - (VIconPad+1)/2) : (VIconPad+1)/2; 1 XCopyArea(dpy, iconValues.background_pixmap, p,# IconGC, 0, 0, icon_w, icon_h,  hoff, voff); , /* now that we have a centered pixmap draw * some text on it.... */  if (hoff = (nw - tw)) hoff = (hoff+1)/2; else. hoff = (HIconPad ? (HIconPad+1)/2 : 1); + /* see if string goes to top or bottom */ if (ILabelTop)9 voff = th - (IFontInfo->descent-((VIconPad+1)/2)); else7 voff = nh-(IFontInfo->descent+((VIconPad+1)/2)); = XDrawImageString(dpy, p, IconGC, hoff, voff, s, strlen(s));  /*, * Now free up original pixmap and replace * with this new one. */  icon_h = nh; icon_w = nw; 6 if ((iconValues.background_pixmap != IBackPixmap) &&3 (iconValues.background_pixmap != IDefPixmap))6 XFreePixmap(dpy, iconValues.background_pixmap);# iconValues.background_pixmap = p; } } * else { /* do it the old way.... */ int h, w; 8 if (!wmhints || !(wmhints->flags & IconPixmapHint)) {' GetDefaultSize(window, &w, &h); > if ((w==0) || (h==0)) { /* no label, use IDefPixmap */0 iconValues.background_pixmap = IDefPixmap;  /* get geom of ipixmap */: if (!XGetGeometry(dpy, iconValues.background_pixmap, &junk, &junk, &junk,, &icon_w, &icon_h, &junk, &junk)) {4 Warning("can't get geom of pixmap in MakeIcon"); Leave(NULL) } }8 else { /* use small label icon + some padding */ icon_h = h+VIconPad; icon_w = w+HIconPad; } } } /*' * Set the icon border attributes. */ : if (!wmhints || !(wmhints->flags & IconWindowHint)) { icon_bdr = IBorderWidth;% iconValues.border_pixel = IBorder; } /*# * Determine icon position.... */: if (wmhints && (wmhints->flags & IconPositionHint)) { icon_x = wmhints->icon_x; icon_y = wmhints->icon_y; } else { if (mousePositioned) { /*1 * Determine the coordinates of the icon window;4 * normalize so that we don't lose the icon off the * edge of the screen. */' icon_x = x - (icon_w >> 1) + 1;# if (icon_x < 0) icon_x = 0;' icon_y = y - (icon_h >> 1) + 1;# if (icon_y < 0) icon_y = 0;D if ((icon_x - 1 + icon_w + (icon_bdr << 1)) > ScreenWidth) {: icon_x = ScreenWidth - icon_w - (icon_bdr << 1) + 1; }E if ((icon_y - 1 + icon_h + (icon_bdr << 1)) > ScreenHeight) {; icon_y = ScreenHeight - icon_h - (icon_bdr << 1) + 1; } } else {# icon_x = x + (icon_w >> 1);# icon_y = y + (icon_y >> 1); }  } /* * Create the icon window. */4 iconValues_mask = CWBorderPixel | CWBackPixmap; /*G * Here we assume that if they want save unders, they'll also wantG * backing store on the icons. Perhaps a dangerous assumption, but* * one we have to make at this point. */ if (SaveUnder) {) iconValues.backing_store = WhenMapped;% iconValues_mask |= CWBackingStore; } Leave(AddIcon(window, XCreateWindow( dpy, RootWindow(dpy, scr), icon_x, icon_y, icon_w, icon_h,1 icon_bdr, 0, CopyFromParent, CopyFromParent,# iconValues_mask, &iconValues),/ TRUE, mask, iconValues.background_pixmap))}3Window AddIcon(window, icon, own, mask, background)Window window, icon; Boolean own; long mask;Pixmap background;{ AwmInfoPtr awi; Entry("AddIcon") if (icon == NULL) Leave(NULL) /*H * Use the text cursor whenever the mouse is in the icon window, if3 * it's a typein icon, otherwise use gumby.... */# if (background == IBackPixmap)' XDefineCursor(dpy, icon, TextCursor); else( XDefineCursor(dpy, icon, GumbyCursor);  /*B * Select "key pressed", "window exposure" and "unmap window"# * events for the icon window. */I XSelectInput(dpy, icon, mask | ButtonPressMask | ButtonReleaseMask); awi = GetAwmInfo(window); awi->icon = icon; awi->own = own;" awi->iconPixmap = background;#ifdef WMSTATE awi->wm_state.icon=icon;D XChangeProperty(dpy,awi->client,wm_state_atom,wm_state_atom,32,2 PropModeReplace,(char *) &awi->wm_state,2);#endif /* WMSTATE */8 XSaveContext(dpy, icon, AwmContext, (caddr_t) awi); Leave(icon)}*[FIELDS.X.AWM]LEX.C;8+,|./% 4tP-C0D123KPWO56owGJ7{ 8εPH9fG%HJ\~AWM.SAVE|C[FIELDS.X.AWM]LEX.C;8t8,# include "stdio.h"# define U(x) x%# define NLSTATE yyprevious=YYNEWLINE$# define BEGIN yybgin = yysvec + 1 +# define INITIAL 0# define YYLERR yysvec$# define YYSTATE (yyestate-yysvec-1)# define YYOPTIM 1# define YYLMAX BUFSIZ # define output(c) putc(c,yyout)t# define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)O# define unput(c) {yytchar= (c);if(yytchar=='\n')yylineno--;*yysptr++=yytchar;}# define yymore() (yymorfg=1))# define ECHO fprintf(yyout, "%s",yytext)3# define REJECT { nstr = yyreject(); goto yyfussy;}!int yyleng; extern char yytext[]; int yymorfg;extern char *yysptr, yysbuf[]; int yytchar; #ifdef VMS!FILE *yyin = NULL, *yyout = NULL;#else(FILE *yyin = {stdin}, *yyout = {stdout};#endifextern int yylineno;struct yysvf {  struct yywork *yystoff; struct yysvf *yyother; int *yystops;};struct yysvf *yyestate;&extern struct yysvf yysvec[], *yybgin;#include /*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ /* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group) * 001 -- Jordan Hubbard, Ardent Computer * Handle comments differently. */#include "y_tab.h"#include #undef YYLMAX#ifdef LEXBUFSIZ#define YYLMAX LEXBUFSIZ#else#define YYLMAX 1024#endifchar *dequote();char *stash();extern int Lineno;# define YYNEWLINE 10yylex(){ int nstr; extern int yyprevious;while((nstr = yylook()) >= 0)yyfussy: switch(nstr){case 0:if(yywrap()) return(0); break;case 1: { return(COMMENT); }break;case 2: { Lineno++; }break;case 3: { ; }break;case 4:-{ yylval.sval=stash(yytext);return(STRING); }break;case 5:' { yylval.sval=stash(dequote(yytext)); return(STRING); }break;case 6: { return(NL); }break;case 7: { return(*yytext); }break;case -1:break;default:+fprintf(yyout,"bad switch yylook %d",nstr);} return(0); }/* end of yylex *//*/ * Remove the quotes enclosing a quoted string. */char * dequote(s)char *s;{ char *p; ++s; #ifdef VMS p = strrchr(s, '"');#else p = rindex(s, '"');#endif *p = '\0'; return(s);}/*= * Save string away in memory and return a pointer to it. If4 * no space could be found, quit with a fatal error. */char *stash(s)char *s;{ char *ptr; char *malloc(); if (!s || !strlen(s)) return(NULL); ptr = malloc(strlen(s) + 1); if (ptr == NULL) { Error("out of space"); } return(strcpy(ptr, s));}int yyvstop[] = {0,4,7,0,3,7,0,6,0,7,0,7,0,7,0,4,7,0,4,0,3,0,5,0,1,0,2,0,0};# define YYTYPE char7struct yywork { YYTYPE verify, advance; } yycrank[] = {0,0, 0,0, 1,3, 0,0, 0,0, 0,0, 0,0, 3,10, 0,0, 0,0, 1,4, 1,5, 7,12, 0,0, 0,0, 3,0, 3,0, 8,14, 0,0, 4,11, 7,12, 7,12, 0,0, 0,0, 0,0, 8,14, 8,15, 0,0, 9,0, 9,16, 0,0, 0,0, 0,0, 0,0, 1,6, 1,7, 1,8, 2,8, 3,0, 3,0, 3,0, 3,0, 4,11, 0,0, 7,12, 7,13, 3,0, 3,0, 0,0, 8,14, 8,14, 9,0, 9,0, 9,0, 9,0, 0,0, 0,0, 0,0, 0,0, 9,0, 9,0, 0,0, 0,0, 0,0, 3,0, 3,0, 0,0, 3,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 9,0, 9,0, 0,0, 9,0, 0,0, 0,0, 10,0, 10,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 1,9, 2,9, 0,0, 0,0, 3,0, 0,0, 3,0, 3,0, 0,0, 0,0, 0,0, 0,0, 0,0, 10,0, 10,0, 10,0, 10,0, 9,0, 0,0, 9,0, 9,0, 10,0, 10,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 3,0, 3,0, 3,0, 10,0, 10,0, 0,0, 10,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 9,0, 9,0, 9,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 10,0, 0,0, 10,0, 10,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 10,0, 10,0, 10,0, 0,0};struct yysvf yysvec[] = {0, 0, 0,yycrank+-1, 0, 0, yycrank+-2, yysvec+1, 0, yycrank+-6, 0, yyvstop+1,yycrank+10, 0, yyvstop+4,yycrank+0, 0, yyvstop+7,yycrank+0, 0, yyvstop+9,yycrank+-11, 0, yyvstop+11,yycrank+-16, 0, yyvstop+13,"yycrank+-19, yysvec+3, yyvstop+15,"yycrank+-74, yysvec+3, yyvstop+18, yycrank+0, yysvec+4, yyvstop+20,yycrank+0, yysvec+7, 0, yycrank+0, 0, yyvstop+22,yycrank+0, yysvec+8, 0, yycrank+0, 0, yyvstop+24,yycrank+0, 0, yyvstop+26, 0, 0, 0};#struct yywork *yytop = yycrank+199; struct yysvf *yybgin = yysvec+1;char yymatch[] = {(00 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,(01 ,011 ,012 ,01 ,01 ,01 ,01 ,01 ,(01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,(01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,(011 ,'!' ,'"' ,'!' ,01 ,01 ,01 ,01 ,('!' ,'!' ,01 ,01 ,01 ,01 ,01 ,01 ,(01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,(01 ,01 ,'!' ,'!' ,01 ,'!' ,01 ,01 ,(01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,(01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,(01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,(01 ,01 ,01 ,'!' ,01 ,'!' ,'!' ,01 ,(01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,(01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,(01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,(01 ,01 ,01 ,'!' ,'!' ,'!' ,01 ,01 ,0};char yyextra[] = {0,0,0,0,0,0,0,0,0}; #ifndef lintPstatic char ncform_sccsid[] = "@(#)ncform 1.6 88/02/08 SMI"; /* from S5R2 1.2 */#endifint yylineno =1;# define YYU(x) x%# define NLSTATE yyprevious=YYNEWLINEchar yytext[YYLMAX];3struct yysvf *yylstate [YYLMAX], **yylsp, **yyolsp;char yysbuf[YYLMAX];char *yysptr = yysbuf; int *yyfnd;extern struct yysvf *yyestate;int yyprevious = YYNEWLINE; yylook(){' register struct yysvf *yystate, **lsp; register struct yywork *yyt; struct yysvf *yyz; int yych, yyfirst; struct yywork *yyr;# ifdef LEXDEBUG int debug;# endif char *yylastch; /* start off machines */# ifdef LEXDEBUG debug = 0;# endif yyfirst=1; if (!yymorfg) yylastch = yytext; else { yymorfg=0; yylastch = yytext+yyleng; } for(;;){ lsp = yylstate; yyestate = yystate = yybgin;' if (yyprevious==YYNEWLINE) yystate++; for (;;){# ifdef LEXDEBUG9 if(debug)fprintf(yyout,"state %d\n",yystate-yysvec-1);# endif yyt = yystate->yystoff;D if(yyt == yycrank && !yyfirst){ /* may not be any transitions */ yyz = yystate->yyother; if(yyz == 0)break;% if(yyz->yystoff == yycrank)break; } *yylastch++ = yych = input(); yyfirst=0; tryagain:# ifdef LEXDEBUG if(debug){ fprintf(yyout,"char "); allprint(yych); putchar('\n'); }# endif yyr = yyt;! if ( (int)yyt > (int)yycrank){ yyt = yyr + yych;7 if (yyt <= yytop && yyt->verify+yysvec == yystate){> if(yyt->advance+yysvec == YYLERR) /* error transitions */! {unput(*--yylastch);break;}, *lsp++ = yystate = yyt->advance+yysvec; goto contin; } }# ifdef YYOPTIM8 else if((int)yyt < (int)yycrank) { /* r < yycrank */& yyt = yyr = yycrank+(yycrank-yyt);# ifdef LEXDEBUG1 if(debug)fprintf(yyout,"compressed state\n");# endifY yyt = yyt + yych;-6 if(yyt <= yytop && yyt->verify+yysvec == yystate){> if(yyt->advance+yysvec == YYLERR) /* error transitions */! {unput(*--yylastch);break;}y, *lsp++ = yystate = yyt->advance+yysvec; goto contin;t }# yyt = yyr + YYU(yymatch[yych]);+# ifdef LEXDEBUG if(debug){/ fprintf(yyout,"try fall back character ");e" allprint(YYU(yymatch[yych])); putchar('\n'); }# endife6 if(yyt <= yytop && yyt->verify+yysvec == yystate){= if(yyt->advance+yysvec == YYLERR) /* error transition */ ! {unput(*--yylastch);break;}}, *lsp++ = yystate = yyt->advance+yysvec; goto contin;{ } }oK if ((yystate = yystate->yyother) && (yyt= yystate->yystoff) != yycrank){a# ifdef LEXDEBUGG if(debug)fprintf(yyout,"fall back to state %d\n",yystate-yysvec-1);p# endif8 goto tryagain; }o# endifa elses {unput(*--yylastch);break;} contin:A# ifdef LEXDEBUG if(debug){s5 fprintf(yyout,"state %d char ",yystate-yysvec-1);a allprint(yych);i putchar('\n'); }o# endif  ; }# ifdef LEXDEBUG if(debug){: fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1); allprint(yych); putchar('\n');  }# endifn while (lsp-- > yylstate){, *yylastch-- = 0; < if (*lsp != 0 && (yyfnd= (*lsp)->yystops) && *yyfnd > 0){ yyolsp = lsp;n+ if(yyextra[*yyfnd]){ /* must backup */uC while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate){A lsp--; unput(*yylastch--);E }N } yyprevious = YYU(*yylastch); yylsp = lsp; yyleng = yylastch-yytext+1;B yytext[yyleng] = 0; # ifdef LEXDEBUG if(debug){ fprintf(yyout,"\nmatch ");U sprint(yytext);* fprintf(yyout," action %d\n",*yyfnd); }# endifI return(*yyfnd++);  } unput(*yylastch); }* if (yytext[0] == 0 /* && feof(yyin) */) { yysptr=yysbuf; return(0);D }# yyprevious = yytext[0] = input();z if (yyprevious>0)i output(yyprevious); yylastch=yytext;# ifdef LEXDEBUG if(debug)putchar('\n');*# endifc }" } yyback(p, m) int *p;{if (p==0) return(0); while (*p) { if (*p++ == m)X return(1); } return(0);}25 /* the following are only used in the lex library */n yyinput(){ return(input());I } yyoutput(c) int c; { output(c);e } yyunput(c) int c; {) unput(c); } switch(nstr){case 0:if(yywrap()) return(0); break;case 1: { return(COMMENT); }break;case 2: { Lineno++; }break;case 3: { ; }break;case 4:-{ yylval.sval=stash(yytext);return(STRING); }break;case 5:' { yylval.sval=stash(dequote(yytext)); return(STRING); }break;case 6: { return(NL); }break;case 7: { return(*yytext); }break;case -1:break;default:+fp*[FIELDS.X.AWM]LOCK.C;3+,C./% 4~-C0@123KPWO56e %7a 8`PPH9fG%HJ #ifndef lint~static char *rcsid_Lower_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Lock.c,v 1.2 89/02/07 21:22:31 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1988 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//* * MODIFICATION HISTORY ** * 000 -- J.Hubbard, PCS Computer systems. */#include "awm.h"#ifdef LOCKSCR /*ARGSUSED*/(Boolean Lock(window, mask, button, x, y)%Window window; /* Event window. */#int mask; /* Button/key mask. */)int button; /* Button event detail. */(int x, y; /* Event mouse position. */{ void lockscreen(); Entry("Lock") lockscreen(dpy); Leave(TRUE)}#else(Boolean Lock(window, mask, button, x, y)%Window window; /* Event window. */#int mask; /* Button/key mask. */)int button; /* Button event detail. */(int x, y; /* Event mouse position. */{ fprintf(stderr,F "awm: You don't have lockscreen compiled in this version of awm.\n"); Leave(FALSE)}#endif /* LOCKSCR */*[FIELDS.X.AWM]LOCKSCREEN.C;3+,C./% 4N-C0@123KPWO56%7`; 8vPH9fG%HJ  #ifndef lint( static char sccs_id[] = "%W% %H%";#endif/*) * XLOCK V1.4 *1 * A Terminal Locker for X11 *9 * Copyright (c) 1988 by Patrick J. Naughton *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear in * supporting documentation. *0 * Original version posted to comp.windows.x by: * Walter Milliken * (milliken@heron.bbn.com). * BBN Advanced Computers, Inc., Cambridge, MA *4 * Comments and additions may be sent the author at: * * naughton@sun.soe.clarkson.edu * * or by Snail Mail: * Patrick J. Naughton * 23 Pleasant Street, #3 * Potsdam, NY 13676 * or * (315) 265-2853 (voice) * * * Revision History:+ * 12-Apr-88: Added root password override.* * Added screen saver override.B * Removed XGrabServer/XUngrabServer (Bad idea Phil...)4 * Added access control handling instead.@ * 01-Apr-88: Added XGrabServer/XUngrabServer for more security.H * 30-Mar-88: Removed startup password requirement (why did I add that?)4 * Removed cursor to avoid phosphor burn.B * 27-Mar-88: Rotate fractal by 45 degrees clockwise. (aesthetics)N * 23-Mar-88: Added HOPALONG routines from Scientific American Sept. 86 p. 14.7 * added password requirement for invokation6 * removed option for command line password; * added requirement for display to be "unix:0".@ * 22-Mar-88: Recieved Walter Milliken's comp.windows.x posting. *) * 20-Dec-88: Incorporated into awm. -jkh * */#ifdef LOCKSCR#include #include #include "awm.h"#include char *crypt();=void ReadXString(), lockscreen(), GrabHosts(), UngrabHosts();void iterate(), inithop();static char no_bits[] = {0};-Window w; /* window used to cover screen */GC gc;.unsigned int width; /* width of screen */,unsigned int height; /* height of screen */!Window rootw; /* root window */"int screen; /* current screen */1Colormap cmap; /* colormap of current screen */2Cursor mycursor; /* blank cursor */6unsigned long black_pixel; /* pixel value for black */6unsigned long white_pixel; /* pixel value for white */0XColor black_color; /* color value for black */0XColor white_color; /* color value for white */2int centerx, centery, iter, maxiter, range, color;double a, b, c, i, j; Display *dsp;void ReadXString(s, slen)char *s; int slen;{ int bp; char c; XEvent evt;+ XKeyEvent *kpevt = (XKeyEvent *) &evt; char keystr[20];  Entry("ReadXString") bp = 0; while (1) { if (XPending(dsp)) { XNextEvent(dsp, &evt);# if (evt.type == KeyPress) {< if (XLookupString(kpevt, keystr, 20, (KeySym *) NULL, ) (XComposeStatus *) NULL) > 0) { c = keystr[0]; switch (c) { case 8: /* ^H */ if (bp > 0) bp--; break; case 13: /* ^M */ s[bp] = '\0'; Leave_void case 21: /* ^U */ bp = 0; break; default: s[bp] = c; if (bp < slen-1) bp++; } } } } else iterate(); } Leave_void}void lockscreen(dpy) Display *dpy;{ char buf[10]; char rootpass[10]; XSetWindowAttributes attrs; XGCValues xgcv; struct passwd *pw; Pixmap lockc, lockm; N int timeout, interval, blanking, exposures; /* screen saver parameters */ extern GC XCreateGC();  Entry("lockscreen") 0 color = GetBoolRes("lock.useColor", FALSE); dsp = dpy;  pw = getpwuid(0);% strcpy(rootpass, pw->pw_passwd); $ rootw = DefaultRootWindow(dsp);! screen = DefaultScreen(dsp);' width = DisplayWidth(dsp, screen);) height = DisplayHeight(dsp, screen); centerx = width / 2; centery = height / 2;I range = (int) sqrt((double)centerx*centerx+(double)centery*centery);) cmap = DefaultColormap(dsp, screen); + black_pixel = BlackPixel(dsp, screen);% black_color.pixel = black_pixel;* XQueryColor(dsp, cmap, &black_color); + white_pixel = WhitePixel(dsp, screen);% white_color.pixel = white_pixel;* XQueryColor(dsp, cmap, &white_color); * attrs.background_pixel = black_pixel;$ attrs.override_redirect = True;% attrs.event_mask = KeyPressMask;: w = XCreateWindow(dsp, rootw, 0, 0, width, height, 0,5 CopyFromParent, InputOutput, CopyFromParent,A CWOverrideRedirect | CWBackPixel | CWEventMask, &attrs); : lockc = XCreateBitmapFromData(dsp, w, no_bits, 8, 1);: lockm = XCreateBitmapFromData(dsp, w, no_bits, 8, 1);6 mycursor = XCreatePixmapCursor(dsp, lockc, lockm,# &black_color, &black_color, 0, 0); XFreePixmap(dsp, lockc); XFreePixmap(dsp, lockm);  XMapWindow(dsp, w); # xgcv.foreground = white_pixel;# xgcv.background = black_pixel;@ gc = XCreateGC(dsp, w, GCForeground | GCBackground, &xgcv); F XGetScreenSaver(dsp, &timeout, &interval, &blanking, &exposures);A XSetScreenSaver(dsp, 0, 0, 0, 0); /* disable screen saver */ L XGrabKeyboard(dsp, w, True, GrabModeAsync, GrabModeAsync, CurrentTime);H XGrabPointer(dsp, w, False, -1, GrabModeAsync, GrabModeAsync, None, mycursor, CurrentTime);  GrabHosts();  pw = getpwuid(getuid());  srandom(time(NULL)); do { inithop(); ReadXString(buf, 10);@ } while ((strcmp(crypt(buf, pw->pw_passwd), pw->pw_passwd))4 && (strcmp(crypt(buf, rootpass), rootpass)));  UngrabHosts(); & XUngrabPointer(dsp, CurrentTime);' XUngrabKeyboard(dsp, CurrentTime); B XSetScreenSaver(dsp, timeout, interval, blanking, exposures); XDestroyWindow(dsp, w); XFlush(dsp); Leave_void}XHostAddress *hosts;int num_hosts, state;void GrabHosts(){ Entry("GrabHosts") XDisableAccessControl(dsp);1 hosts = XListHosts(dsp, &num_hosts, &state);) XRemoveHosts(dsp, hosts, num_hosts); Leave_void}void UngrabHosts(){ Entry("UngrabHosts")  XEnableAccessControl(dsp);& XAddHosts(dsp, hosts, num_hosts); XFree(hosts); Leave_void}void iterate(){ double oldj; register int k;  Entry("iterate")  for (k=0;k<500;k++) { oldj = j; j = a - i;F i = oldj + ((i < 0) ? sqrt(fabs(b*i - c)) : -sqrt(fabs(b*i - c))); if (color)7 XSetForeground(dsp, gc, (iter % 25) * 10 + 5);  XDrawPoint(dsp, w, gc,@ centerx + (int)(i+j), /* sneaky way to rotate +45 deg. */ centery - (int)(i-j)); iter++; } if (iter > maxiter) inithop(); Leave_void}void inithop(){ Entry("inithop") B a = random() % (range * 100) * (random()%2?-1.0:1.0) / 100.0;B b = random() % (range * 100) * (random()%2?-1.0:1.0) / 100.0;B c = random() % (range * 100) * (random()%2?-1.0:1.0) / 100.0;  if (!(random()%3)) a /= 10.0; if (!(random()%2)) b /= 100.0; A maxiter = (color?10000+random()%20000:20000+random()%50000); iter = 0; i = j = 0.0; XClearWindow(dsp, w); Leave_void}#endif LOCKSCR*[FIELDS.X.AWM]LOWER.C;3+,C./% 4b-C0@123KPWO56 %7@ 81PH9fG%HJ  #ifndef lintstatic char *rcsid_Lower_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Lower.c,v 1.2 89/02/07 21:22:36 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. *//* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group= * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,( * Western Software Lab. Convert to X11.* * 002 -- Jordan Hubbard, Ardent Computer. * Conversion to awm. */#include "awm.h" /*ARGSUSED*/)Boolean Lower(window, mask, button, x, y)%Window window; /* Event window. */#int mask; /* Button/key mask. */)int button; /* Button event detail. */(int x, y; /* Event mouse position. */{ AwmInfoPtr awi; Entry("Lower") awi = GetAwmInfo(window); if (!awi) Leave(FALSE)4 window = awi->frame ? awi->frame : awi->client; /*J * If the window is not the root window, lower the window and return. */( if (window != RootWindow(dpy, scr)) XLowerWindow(dpy, window); Leave(FALSE)}*[FIELDS.X.AWM]MENU.C;7+,Dn. /% 4} l-C0D123KPWO 56Dh7`5 8UPH9fG%HJ #ifndef lint}static char *rcsid_Menu_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Menu.c,v 1.3 89/02/07 22:39:41 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * */#include #include /* * MODIFICATION HISTORY *% * 000 -- J.Hubbard, Ardent Computer.> * This file bears little resemblance to its former namesake.> * Because of massive changes to support RTL menus, the Menu()= * function is now little more than a bootstrap for RTL.- * 1.2 -- Select_Window code fixed for icons. */ #ifndef lint/static char *sccsid = "@(#)Menu.c 3.8 1/24/86";#endif#include "awm.h" /*ARGSUSED*/0Boolean DoMenu(window, mask, button, x, y, menu)%Window window; /* Event window. */#int mask; /* Button/key mask. */)int button; /* Button event detail. */(int x, y; /* Event mouse position. */ RTLMenu menu;{ RTLPoint pos;  Entry("DoMenu")  pos.x = x; pos.y = y; if (!menu) Leave(FALSE)1 RTLMenu_Enter(menu, button, 0, window, pos); Leave(TRUE)} /*ARGSUSED*/:Boolean DoAction(window, mask, button, x, y, menu, action)%Window window; /* Event window. */#int mask; /* Button/key mask. */)int button; /* Button event detail. */(int x, y; /* Event mouse position. */ RTLMenu menu;ActionLine *action;{ char *buff, *cmd; int status, pid, w;! void (*istat)(), (*qstat)(); Entry("DoAction") switch(action->type) { case IsText:8 XStoreBytes(dpy, action->text, strlen(action->text)); break; case IsTextNL:3 buff = (char *)malloc(strlen(action->text) + 2); strcpy(buff, action->text); strcat(buff, "\n");( XStoreBytes(dpy, buff, strlen(buff)); free(buff); break; case IsShellCommand: cmd = action->text; #ifdef VMS vms_execute(cmd);#else if ((pid = fork()) == 0) { setpgrp(0, getpid()); signal(SIGHUP, SIG_DFL);! signal(SIGQUIT, SIG_DFL); signal(SIGINT, SIG_DFL);- execl("/bin/sh", "sh", "-c", cmd, 0); _exit(127); }#endif/ istat = (void (*)())signal(SIGINT, SIG_IGN);0 qstat = (void (*)())signal(SIGQUIT, SIG_IGN);1 while ((w = wait(&status)) != pid && w != -1); if (w == -1) status = -1; signal(SIGINT, istat); signal(SIGQUIT, qstat); break; default:I fprintf(stderr, "awm: Warning: Unknown action type %d (%s) invoked\n", action->type, action->text); break; }}/*6 * Routine to let user select a window using the mouse */"Window Select_Window(x, y, button)int *x, *y, *button;{ XEvent event; Window target_win, root; int root_x, root_y, x2, y2; unsigned int ptrmask; AwmInfoPtr awi;  Entry("Select_Window") ! /* Make the target cursor */1 if (XGrabPointer( dpy, RootWindow(dpy, scr),6 TRUE, (unsigned int) EVENTMASK, GrabModeAsync, GrabModeAsync, None,# TargetCursor, CurrentTime ) != GrabSuccess ) {A fprintf(stderr, "awm (Select_Window): Can't grab the mouse."); Leave(RootWindow(dpy, scr)) } Snatched = TRUE; /* Select a window */ while (TRUE) { XPeekEvent(dpy, &event);# if (event.type != ButtonPress) { GetButton(&event); continue; }" XNextEvent(dpy, &event);2 XQueryPointer(dpy, RootWindow(dpy, scr), &root,6 &target_win, &root_x, &root_y, &x2, &y2, &ptrmask); *x = root_x; *y = root_y;" *button = event.xbutton.button; if (target_win == 0)* target_win = event.xbutton.window;A XUngrabPointer(dpy, CurrentTime); /* Done with pointer */$ if (awi = GetAwmInfo(target_win))$ if (target_win != awi->icon)C target_win = (awi->frame) ? awi->frame : awi->client; Snatched = FALSE; Leave(target_win) }}*[FIELDS.X.AWM]MENU_SUP.C;7+, ./% 4T-C0D123KPWO56/華7nq 88{PH9fG%HJ #ifndef lintstatic char *rcsid_menu_sup_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/menu_sup.c,v 1.3 89/02/07 22:40:04 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is he l~AWM.SAVE C[FIELDS.X.AWM]MENU_SUP.C;75reby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * */#include "awm.h"#include #'/* interface functions for RTL menus */"do_nothing() /* like it says... */{}"Boolean check_booleans(menu, item) RTLMenu menu;RTLMenuItem item;{ Boolean *foo; Entry("check_booleans")/ foo = (Boolean *)RTLMenu_Data(menu, item); Leave(*foo)}#Boolean toggle_booleans(menu, item) RTLMenu menu;RTLMenuItem item;{ Boolean *foo; Entry("togglet_booleans")/ foo = (Boolean *)RTLMenu_Data(menu, item); *foo = !(*foo); Leave(*foo)} /*ARGSUSED*/9int do_shell(menu, item, window) /* Do a shell command */ RTLMenu menu;RTLMenuItem item;Window window; /* not used */{ char *cmd; int status, pid, w;! void (*istat)(), (*qstat)(); Entry("do_shell"), cmd = (char *)RTLMenu_Data(menu, item); #ifdef VMS vms_execute(cmd);#else if ((pid = fork()) == 0) { setpgrp(0, getpid());" signal(SIGHUP, SIG_DFL);# signal(SIGQUIT, SIG_DFL);" signal(SIGINT, SIG_DFL);( execl("/bin/sh", "sh", "-c", cmd, 0); _exit(127); }#endif0 istat = (int (*)())signal(SIGINT, SIG_IGN);1 qstat = (int (*)())signal(SIGQUIT, SIG_IGN);3 while ((w = wait(&status)) != pid && w != -1); if (w == -1) status = -1; signal(SIGINT, istat); signal(SIGQUIT, qstat); Leave(status)} /*ARGSUSED*/int do_text(menu, item, window) RTLMenu menu;RTLMenuItem item;Window window;{ char *buff; Entry("do_text")- buff = (char *)RTLMenu_Data(menu, item);* XStoreBytes(dpy, buff, strlen(buff)); Leave_void} /*ARGSUSED*/"int do_text_nl(menu, item, window) RTLMenu menu;RTLMenuItem item;Window window;{ char *buff1, *buff2; Entry("do_text_nl"). buff1 = (char *)RTLMenu_Data(menu, item);/ buff2 = (char *)malloc(strlen(buff1) + 2); strcpy(buff2, buff1); strcat(buff2, "\n");, XStoreBytes(dpy, buff2, strlen(buff2)); free(buff2); Leave_void}#int do_awm_func(menu, item, window) RTLMenu menu;RTLMenuItem item;Window window;{ int x, y, button; Boolean (*func)();# extern Window Select_Window(); Entry("do_awm_func") XSync(dpy, FALSE);( if (window == RootWindow(dpy, scr))2 window = Select_Window(&x, &y, &button);3 func = (Boolean(*)())RTLMenu_Data(menu, item);, Leave((*func)(window, 0, button, x, y))} /*ARGSUSED*/#int do_imm_func(menu, item, window) RTLMenu menu;RTLMenuItem item;Window window;{ Boolean (*func)(); Entry("do_imm_func")3 func = (Boolean(*)())RTLMenu_Data(menu, item);5 Leave((*func)(RootWindow(dpy, scr), 0, 0, 0, 0))}MenuInfo *FindMenu(s)register char *s;{ MenuLink *ml; Entry("FindMenu")( for (ml = Menus; ml; ml = ml->next)" if (!strcmp(s, ml->menu->name)) Leave(ml->menu) Leave((MenuInfo *) 0)}RTLMenu create_menu(m) MenuInfo *m;{ ActionLine *ln; RTLMenuItem tmp; MenuInfo *side_menu; Entry("create_menu") if (!m)> yyerror("Internal error, create_menu passed null pointer"); /*G * Were we already created? This is possible if we were referenced& * by somebody created before us. */ if (m->menu) Leave(m->menu) m->menu = RTLMenu_Create();7 /* make a name (or picture) label for this menu */O tmp = RTLMenu_Append_Call(m->menu, m->name, m->pixmapname, do_nothing, 0);' RTLMenu_Label_Entry(m->menu, tmp); ln = m->line; if (!ln) {- yyerror("Internal error in create_menu.");= fprintf(stderr, "Menu '%s' has no line list.\n", m->name); exit(1); }( if (!ln->name && !ln->pixmapname) {N fprintf(stderr, "awm: Action in menu '%s' has no name or backing pixmap\n", m->name); yyerror(".. aborting\n"); exit(1); } while (ln) { switch (ln->type) { case IsVar:> ln->item = RTLMenu_Append_Checkback(m->menu, ln->name, ln->pixmapname, check_booleans, toggle_booleans, ln->text); break;  case IsImmFunction:9 ln->item = RTLMenu_Append_Call(m->menu, ln->name, ln->pixmapname," do_imm_func, ln->func); break; case IsUwmFunction:9 ln->item = RTLMenu_Append_Call(m->menu, ln->name, ln->pixmapname," do_awm_func, ln->func); break; case IsMenuFunction:0 if (!(side_menu = FindMenu(ln->text))) {; fprintf(stderr, "Unknown menu \"%s\" referenced in ", ln->text); yyerror(" .."); exit(1); }J /* If we haven't created the referenced menu yet, create it now */ if (!side_menu->menu)/ side_menu->menu = create_menu(side_menu);< ln->item = RTLMenu_Append_Submenu(m->menu, ln->name, ln->pixmapname, side_menu->menu); break;  case IsText:9 ln->item = RTLMenu_Append_Call(m->menu, ln->name, ln->pixmapname, do_text, ln->text); break; case IsTextNL:9 ln->item = RTLMenu_Append_Call(m->menu, ln->name, ln->pixmapname,! do_text_nl, ln->text); break;  case IsShellCommand:9 ln->item = RTLMenu_Append_Call(m->menu, ln->name, ln->pixmapname, do_shell, ln->text); break; default:D fprintf(stderr, "create_menu, Unknown menu entry type %d\n", ln->type); break; } free(ln); ln = ln->next; } Leave(m->menu)}*[FIELDS.X.AWM]MOVE.C;3+,C./% 4}-C0@123KPWO56 %7 8`kPH9fG%HJ$ #ifndef lint}static char *rcsid_Move_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Move.c,v 1.2 89/02/07 21:22:55 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. *//* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group> * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group, & * Western Software Lab. Port to X11 */#include "awm.h" /*ARGSUSED*/(Boolean Move(window, mask, button, x, y)%Window window; /* Event window. */#int mask; /* Button/key mask. */)int button; /* Button event detail. */(int x, y; /* Event mouse position. */{B register int prev_x; /* Previous event window X location. */B register int prev_y; /* Previous event window Y location. */C XWindowAttributes window_info; /* Event window information. */9 int cur_x; /* Current event window X location. */9 int cur_y; /* Current event window Y location. */1 int root_x; /* Root window X location. */1 int root_y; /* Root window Y location. */; int ulx, uly; /* Event window upper left X and Y. */< int lrx, lry; /* Event window lower right X and Y. */C int init_ulx, init_uly; /* Init window upper left X and Y. */D int init_lrx, init_lry; /* Init window lower right X and Y. */7 int num_vectors; /* Number of vectors in box. */; unsigned int ptrmask; /* state of ptr when queried */= Window sub_window; /* Query mouse event sub-window. */1 Window root; /* Query mouse event root. */ AwmInfoPtr awi;5 XEvent button_event; /* Button event packet. */< XSegment box[MAX_BOX_VECTORS]; /* Box vertex buffer. */C XSegment zap[MAX_ZAP_VECTORS]; /* Zap effect verted buffer. */= int (*storegrid_func)(); /* Function to use for grid */; int (*storebox_func)(); /* Function to use for box */" extern void ungrab_pointer(); extern void grab_pointer();  Entry("Move")  /*+ * Do not try to move the root window. */( if (window == RootWindow(dpy, scr)) Leave(FALSE)  /* * Change the cursor. */ grab_pointer(); /*! * Clear the vector buffers. */ bzero(box, sizeof(box)); if (Zap) bzero(zap, sizeof(zap));  /*( * Gather info on the event window. */ awi = GetAwmInfo(window); if (!awi) Leave(FALSE)> status = XGetWindowAttributes(dpy, window, &window_info); if (status == FAILURE) Leave(FALSE)/ if (awi->title && !IsIcon(window, None)) {& storegrid_func = StoreTitleGridBox;! storebox_func = StoreTitleBox; } else {! storegrid_func = StoreGridBox; storebox_func = StoreBox; } /*& * Initialize movement variables. */$ init_ulx = ulx = window_info.x;$ init_uly = uly = window_info.y;9 init_lrx = lrx = window_info.x + window_info.width +' (window_info.border_width << 1) - 1;: init_lry = lry = window_info.y + window_info.height +' (window_info.border_width << 1) - 1;  /* * Store the box. */ if (Grid)< num_vectors = (*storegrid_func)(box, ulx, uly, lrx, lry); else; num_vectors = (*storebox_func)(box, ulx, uly, lrx, lry);  /*3 * Initialize the previous location variables. */ prev_x = x; prev_y = y;  /*4 * Freeze the server, if requested by the user.@ * This results in a solid box instead of a flickering one. */ if (Freeze) XGrabServer(dpy); Snatched = True; /*C * Process any pending exposure events before drawing the box. */ while (QLength(dpy) > 0) {" XPeekEvent(dpy, &button_event);D if (((XAnyEvent *)&button_event)->window == RootWindow(dpy, scr)) break; GetButton(&button_event); }  /* * Now draw the box. */  DrawBox(); Frozen = window;  /* * Main loop. */ while (TRUE) {  /*> * Check to see if we have a change in mouse button status.2 * This is how we get out of this "while" loop. */= if (XPending(dpy) && !ProcessRequests(box, num_vectors) &&" GetButton(&button_event)) { /*9 * Process the pending events, this sequence is the only( * way out of the loop and the routine. */ 2 if ((button_event.type != ButtonPress) && , (button_event.type != ButtonRelease)) {, continue; /* spurious menu event... */ } /*< * If we froze the server, then erase the last lines drawn. */ if (Freeze) { DrawBox(); Frozen = (Window)0; XUngrabServer(dpy); } 3 if ((button_event.type == ButtonRelease) &&C (((XButtonReleasedEvent *)&button_event)->button == button)) {  /*5 * The button was released, so move the window. */  if (Zap) { num_vectors = StoreZap(zap, init_ulx, init_uly, init_lrx, init_lry, ulx, uly, lrx, lry); DrawZap(); DrawZap(); } #ifdef titan /* 5x4 alignment */ ulx = ((ulx + 3) / 5) * 5; uly = ((uly + 2) / 4) * 4;#endif /* titan */ if (Wall) { if (ulx < 0) ulx = 0;0 if (ulx > (ScreenWidth - window_info.width))1 ulx = (ScreenWidth - window_info.width); if (uly < 0) uly = 0;2 if (uly > (ScreenHeight - window_info.height))3 uly = (ScreenHeight - window_info.height); }) XMoveWindow(dpy, window, ulx, uly); Snatched = False; ungrab_pointer(); Leave(TRUE) } else { /*9 * Some other button event occured, this aborts the * current operation. */  ResetCursor(button); Snatched = False; ungrab_pointer(); Leave(TRUE) } }  /*; * Take care of all the little things that have changed. */ XQueryPointer(dpy, - RootWindow(dpy, scr), &root, &sub_window,/ &root_x, &root_y, &cur_x, &cur_y, &ptrmask);0 if ((cur_x != prev_x) || (cur_y != prev_y)) { /*= * If we've frozen the server, then erase the old box first! */ if (Freeze) DrawBox(); /* * Box position has changed. */ ulx += cur_x - prev_x; uly += cur_y - prev_y; lrx += cur_x - prev_x; lry += cur_y - prev_y; /* * Box needs to be restored. */ if (Grid)? num_vectors = (*storegrid_func)(box, ulx, uly, lrx, lry); else> num_vectors = (*storebox_func)(box, ulx, uly, lrx, lry);  /* * Draw the new box. */ if (Freeze) DrawBox(); }  /*  * Save old box position. */ prev_x = cur_x; prev_y = cur_y;  /*; * If server is not frozen, then draw the "flicker" box. */ if (!Freeze) { DrawBox(); DrawBox(); } }}*[FIELDS.X.AWM]MOVEOPAQUE.C;3+,C. /% 4 $-C0@123KPWO 56@N%7u 8ǶPH9fG%HJ #ifndef lintstatic char *rcsid_MoveOpaque_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/MoveOpaque.c,v 1.2 89/02/07 21:23:00 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. *//* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group= * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,( * Western Software Lab. Convert to X11.) * 002 -- Jordan Hubbard, Ardent Computer * Changed to work with awm. */#include "awm.h" /*ARGSUSED*/.Boolean MoveOpaque(window, mask, button, x, y)%Window window; /* Event window. */#int mask; /* Button/key mask. */)int button; /* Button event detail. */(int x, y; /* Event mouse position. */{8 int prev_x, prev_y; /* Previous mouse location. */> int rbound, dbound; /* potential right/down boundries */6 int cur_x, cur_y; /* Current mouse location. */7 int win_x, win_y; /* Current window location. */0 int root_x; /* Root window X location. */0 int root_y; /* Root window Y location. */3 int ptrmask; /* state of ptr when queried */C XWindowAttributes window_info; /* Event window information. */= Window sub_window; /* Query mouse event sub-window. */1 Window root; /* Query mouse event root. */5 XEvent button_event; /* Button event packet. */ extern void grab_pointer();" extern void ungrab_pointer();  Entry("MoveOpaque") /*+ * Do not try to move the root window. */( if (window == RootWindow(dpy, scr)) Leave(FALSE)  /* * Change the cursor. */ grab_pointer();  /*( * Gather info on the event window. */> status = XGetWindowAttributes(dpy, window, &window_info); if (status == FAILURE) Leave(FALSE) /*& * Initialize movement variables. */ prev_x = cur_x = x; prev_y = cur_y = y; win_x = window_info.x; win_y = window_info.y;K rbound = ScreenWidth - (window_info.width + window_info.border_width);M dbound = ScreenHeight - (window_info.height + window_info.border_width); /* * Main loop. */ while (TRUE) {  /*> * Check to see if we have a change in mouse button status.2 * This is how we get out of this "while" loop. */ if (XCheckMaskEvent(dpy,- ButtonPressMask | ButtonReleaseMask, &button_event)) { /*4 * If the button event was something other than the9 * release of the original button pressed, then move the+ * window back to where it was originally. */3 if ((button_event.type != ButtonRelease) ||5 (((XButtonReleasedEvent *)&button_event)->button != button)) { ResetCursor(button);= XMoveWindow(dpy, window, window_info.x, window_info.y); } ungrab_pointer(); Leave(TRUE); }  /*< * Take care of all the little things that have changed; * * i.e., move the window, if necessary. */, XQueryPointer(dpy, RootWindow(dpy, scr), 9 &root, &sub_window, &root_x, &root_y, &cur_x, &cur_y, &ptrmask);0 if ((cur_x != prev_x) || (cur_y != prev_y)) {" win_x += (cur_x - prev_x);" win_y += (cur_y - prev_y);#ifdef titan /* align to 5x4 */& win_x = ((win_x + 3) / 5) * 5;& win_y = ((win_y + 2) / 4) * 4;#endif /* titan */ if (Wall) { if (win_x < 0) win_x = 0; else if (win_x > rbound) win_x = rbound; if (win_y < 0) win_y = 0; else if (win_y > dbound) win_y = dbound; }/ XMoveWindow(dpy, window, win_x, win_y); prev_x = cur_x; prev_y = cur_y; } }}*[FIELDS.X.AWM]NEATEN.C;3+,C. /% 4 -C0@123KPWO 56w!%7 8`FPH9fG%HJ" #ifndef lintstatic char *rcsid_Neaten_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Neaten.c,v 1.2 89/02/07 21:23:05 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//* * MODIFICATION HISTORY ** * 002 -- Jordan Hubbard, Ardent Computer.> * Changes to work with awm, specifically reparented windows. */#include "awm.h" #ifdef NEATEN #include #include #include "neaten.ext.h"static void GetIconHints();static void GetName();extern Boolean IsIcon();extern int neaten_debug_level;9#define TOP_LEVEL (awi->frame ? awi->frame : awi->client) /*ARGSUSED*/*Boolean Neaten(window, mask, button, x, y);Window window; /* Event window. */>int mask; /* Button/key mask. */Aint button; /* Button event detail. */Cint x, y; /* Event mouse position. */{ Window junk_window; Window w; Window icon_window; Window stacktop; Window *children; XWindowAttributes attrs; XSizeHints hints; XWindowChanges wc; Status rstatus; char name[50]; int junk; int root_x, root_y;! int root_width, root_height; int icon_x, icon_y;! int icon_width, icon_height; int icon_border; int window_x, window_y;% int window_width, window_height; int rval; int ix; int iconic; int tiled; int adjustment; int priority; int priority_increment; unsigned int nchildren;& unsigned int mapped_children = 0;& unsigned int opened_children = 0; unsigned int wcmask; Placement primary; Placement secondary; Boolean is_iconic; Cursor rtlcursor; XFontStruct *font; GC gc; AwmInfoPtr awi; Entry("Neaten"): font = (XFontStruct *) XLoadQueryFont(dpy, "cursor"); gc = DefaultGC(dpy, scr);" XSetFont(dpy, gc, font->fid); 5 rtlcursor = XCreateFontCursor(dpy, XC_rtl_logo); E XGrabPointer(dpy, RootWindow(dpy, scr), FALSE, (unsigned int) 0,! GrabModeAsync, GrabModeAsync,+ (Window) None, rtlcursor, CurrentTime);  if (AbsMinWidth == 0)! AbsMinWidth = DEFAULT_ABS_MIN; if (AbsMinHeight == 0)" AbsMinHeight = DEFAULT_ABS_MIN; : XGetGeometry(dpy, RootWindow(dpy, scr), &junk_window, &root_x, &root_y, &root_width, &root_height, &junk, &junk); - Neaten_Initialize(root_width+SEPARATION, root_height+SEPARATION,$ AbsMinWidth, AbsMinHeight); 6 if (strcmp(PrimaryIconPlacement, "Closest") == 0) primary = Place_Closest;7 else if (strcmp(PrimaryIconPlacement, "Top") == 0) primary = Place_Top;: else if (strcmp(PrimaryIconPlacement, "Bottom") == 0) primary = Place_Bottom;8 else if (strcmp(PrimaryIconPlacement, "Left") == 0) primary = Place_Left;9 else if (strcmp(PrimaryIconPlacement, "Right") == 0) primary = Place_Right; else primary = Place_Top; 8 if (strcmp(SecondaryIconPlacement, "Closest") == 0) secondary = Place_Closest;9 else if (strcmp(SecondaryIconPlacement, "Top") == 0) secondary = Place_Top;< else if (strcmp(SecondaryIconPlacement, "Bottom") == 0) secondary = Place_Bottom;: else if (strcmp(SecondaryIconPlacement, "Left") == 0) secondary = Place_Left;; else if (strcmp(SecondaryIconPlacement, "Right") == 0) secondary = Place_Right;< else if (strcmp(SecondaryIconPlacement, "Center") == 0) secondary = Place_Center; else secondary = Place_Left; / Neaten_Icon_Placement(primary, secondary); < if (XQueryTree(dpy, RootWindow(dpy, scr), &junk_window,+ &junk_window, &children, &nchildren)) {% for (ix = 0; ix < nchildren; ix++) {= XGetWindowAttributes(dpy, children[ix], &attrs);  . if ((attrs.map_state != IsUnmapped) &&* (attrs.override_redirect == False) &&& (awi = GetAwmInfo(children[ix]))) { w = children[ix];+ if (w != TOP_LEVEL && w != awi->icon) continue; mapped_children++; - is_iconic = IsIcon(w, (Window *) NULL);  if (is_iconic == TRUE) { window_x = window_y =* window_width = window_height = 0; icon_x = attrs.x; icon_y = attrs.y; icon_width = attrs.width; icon_height = attrs.height;  adjustment = SEPARATION; icon_width += adjustment; icon_height += adjustment; } else { window_x = attrs.x; window_y = attrs.y; window_width = attrs.width;! window_height = attrs.height; # window_x -= attrs.border_width;# window_y -= attrs.border_width; 7 adjustment = (2 * attrs.border_width) + SEPARATION; window_width += adjustment; window_height += adjustment; % GetIconHints(w, &icon_x, &icon_y,3 &icon_width, &icon_height, &icon_border);  icon_x -= icon_border; icon_y -= icon_border;1 icon_width += (2 * icon_border) + SEPARATION;2 icon_height += (2 * icon_border) + SEPARATION;  opened_children++; stacktop = TOP_LEVEL; }  GetName(w, name); if(neaten_debug_level) { printf("%s\ticonic = %s\n",* name, (is_iconic ? "TRUE" : "FALSE"));< printf("\ticon: x = %d y = %d width = %d height = %d\n",- icon_x, icon_y, icon_width, icon_height); if (is_iconic != TRUE)C printf("\twindow: x = %d y = %d width = %d height = %d\n",* window_x, window_y, window_width, window_height); } ) Neaten_Identify((int) w, is_iconic," NEATEN_TRUE, NEATEN_FALSE, window_x, window_y,$ window_width, window_height," NEATEN_TRUE, NEATEN_FALSE, icon_x, icon_y, icon_width, icon_height,$ (unsigned long) adjustment); 0 rstatus = XGetNormalHints(dpy, w, &hints);5 if (rstatus != (Status) 0 && is_iconic != TRUE) { if (hints.flags & PMinSize) {' rval = Neaten_Set_Min((int) w,% hints.min_width+adjustment,' hints.min_height+adjustment); if(neaten_debug_level)< printf("\tmin: width = %d height = %d status = %s\n",) hints.min_width, hints.min_height,' (rval ? "SUCCESS" : "FAILURE")); } if (hints.flags & PMaxSize)  {' rval = Neaten_Set_Max((int) w,% hints.max_width+adjustment,' hints.max_height+adjustment); if(neaten_debug_level)< printf("\tmax: width = %d height = %d status = %s\n",) hints.max_width, hints.max_height,- (rval ? "SUCCESS" : "FAILURE"));  }' if (hints.flags & (USSize | PSize)) {+ rval = Neaten_Set_Desired((int) w, hints.width+adjustment, hints.height+adjustment); if(neaten_debug_level)< printf("\tdes: width = %d height = %d status = %s\n",! hints.width, hints.height,- (rval ? "SUCCESS" : "FAILURE"));  } 4 /* if no max hints are given, set the max to the+ max of the desired and current size */" if (!(hints.flags & PMaxSize)) {4 int desired_width = hints.width+adjustment;6 int desired_height = hints.height+adjustment; 7 window_width = ((window_width > desired_width) ? window_width : desired_width);; window_height = ((window_height > desired_height)  ? window_height : desired_height);' rval = Neaten_Set_Max((int) w, window_width, window_height); if(neaten_debug_level)< T1~AWM.SAVECC[FIELDS.X.AWM]NEATEN.C;3 = printf("\tmax: width = %d height = %d status = %s\n",9 window_width-adjustment, window_height-adjustment,' (rval ? "SUCCESS" : "FAILURE")); } } } }  if (UsePriorities == TRUE) { priority = MIN_PRIORITY; if (opened_children > 1): priority_increment = (MAX_PRIORITY - MIN_PRIORITY) / (opened_children - 1);* for (ix = 0; ix < nchildren; ix++) { w = children[ix]; awi = GetAwmInfo(w); if (!awi) continue;+ if (w != TOP_LEVEL && w != awi->icon) continue;- is_iconic = IsIcon(w, (Window *) NULL);  if (is_iconic != TRUE) {. XGetWindowAttributes(dpy, w, &attrs); * if ((attrs.map_state != IsUnmapped) &&+ (attrs.override_redirect == False)) {< Neaten_Set_Priorities((int) w, priority, priority); if (neaten_debug_level) { GetName(w, name);5 printf("%s: priority = %d\n", name, priority); }( priority += priority_increment; } } } }  if (FixTopOfStack == TRUE) {F Neaten_Set_Options((int) stacktop, NEATEN_FALSE, NEATEN_TRUE); if (neaten_debug_level) { GetName(stacktop, name);& printf("stacktop = %s\n", name); } }  if(neaten_debug_level)> printf("mapped children = %d\topened_children = %d\n",* mapped_children, opened_children); D Neaten_Desktop((RetainSize == FALSE), (KeepOpen == FALSE), Fill); % for (ix = 0; ix < nchildren; ix++) { w = children[ix]; awi = GetAwmInfo(w); if (!awi) continue;- if (w != TOP_LEVEL && w != awi->icon) continue;9 if (Neaten_Get_Geometry((int) w, &iconic, &tiled, &window_x, &window_y,) &window_width, &window_height,- (unsigned long) &adjustment) == 0) continue; GetName(w, name); if(neaten_debug_level) {2 printf("%s iconic = %s tiled = %s\n", name," (iconic ? "TRUE" : "FALSE")," (tiled ? "TRUE" : "FALSE"));< printf(" x = %d, y = %d, width = %d, height = %d\n",7 window_x, window_y, window_width, window_height); }  wc.x = window_x; wc.y = window_y; wc.width = window_width;" wc.height = window_height;0 wcmask = CWX | CWY | CWWidth | CWHeight; " if (iconic == NEATEN_TRUE) {* is_iconic = IsIcon(w, &icon_window); if (is_iconic == TRUE) { wc.width -= adjustment; wc.height -= adjustment; * XConfigureWindow(dpy, w, wcmask, &wc); if(tiled != NEATEN_TRUE) XRaiseWindow(dpy, w); } else {5 /* have to go to the server to get the info, this2 could have been avoided if the the variable3 adjustment was a pointer to a structure that5 contained the information for the icon and the4 information for the window. However, I chose2 not to mess with all that memory management */% GetIconHints(w, &icon_x, &icon_y,3 &icon_width, &icon_height, &icon_border);  wc.x -= icon_border; wc.y -= icon_border;/ wc.width -= (2 * icon_border) + SEPARATION;0 wc.height -= (2 * icon_border) + SEPARATION;  XAddToSaveSet(dpy, w);! XUnmapWindow(dpy, TOP_LEVEL);/ XConfigureWindow(icon_window, wcmask, &wc);! XMapWindow(dpy, icon_window); if (tiled != NEATEN_TRUE)( XRaiseWindow(dpy, icon_window); } } else { wc.width -= adjustment; wc.height -= adjustment; adjustment -= SEPARATION; wc.x += adjustment/2; wc.y += adjustment/2;. /* I think this will be the outer win */& ConfigureWindow(w, wcmask, &wc); if(tiled != NEATEN_TRUE)! XRaiseWindow(dpy, TOP_LEVEL); } }  if (FixTopOfStack == TRUE)$ XRaiseWindow(dpy, stacktop);  XFree(children); } + XBell(dpy, VOLUME_PERCENTAGE(Volume));& XUngrabPointer(dpy, CurrentTime); Leave(FALSE)} static void6 GetIconHints(window, x, y, width, height, border)Window window;%int *x, *y, *width, *height, *border;{ Window root; XWMHints *wmhints; XWindowAttributes attrs; int junk;  *border = *x = *y = 0; /*% * Process window manager hints. */ - if (wmhints = XGetWMHints(dpy, window))  {% if (wmhints->flags&IconWindowHint) {@ XGetWindowAttributes(dpy, wmhints->icon_window, &attrs); *x = attrs.x; *y = attrs.y; *width = attrs.width; *height = attrs.height;% *border = attrs.border_width; }+ else if (wmhints->flags&IconPixmapHint)  {@ XGetWindowAttributes(dpy, wmhints->icon_pixmap, &attrs); *width = attrs.width; *height = attrs.height; } else {. GetDefaultSize(window, width, height); } } else {) GetDefaultSize(window, width, height); }  /* * Fix up sizes by padding. */ I if (!wmhints || !(wmhints->flags&(IconPixmapHint|IconWindowHint))) { *width += (HIconPad << 1); *height += (VIconPad << 1); } 8 if (wmhints && (wmhints->flags&IconPositionHint)) { *x = wmhints->icon_x; *y = wmhints->icon_y; }} static void GetName(w, name) Window w; char *name;{ Status rstatus; char *s = (char *) NULL;  & rstatus = XFetchName(dpy, w, &s); 5 if (rstatus != (Status) 0 && s != (char *) NULL) { strcpy(name, s); XFree(s); } else { strcpy(name, "UNKNOWN"); }}>void NeatenDebug(window, left, top, width, height, adjustment) int window;int left, top;int width, height;unsigned long adjustment;{ Window w = (Window) window; + left += (int) ((float)adjustment/2.0);* top += (int) ((float)adjustment/2.0);  width -= adjustment; height -= adjustment; 9 XMoveResizeWindow(dpy, w, left, top, width, height); XFlush(dpy);} #else /* NEATEN not installed */ /*ARGSUSED*/*Boolean Neaten(window, mask, button, x, y);Window window; /* Event window. */>int mask; /* Button/key mask. */Aint button; /* Button event detail. */Cint x, y; /* Event mouse position. */{G fprintf(stderr, "awm: Warning: Neaten package not installed in ");2 fprintf(stderr, "this version of of awm.\n");} #endif NEATEN*[FIELDS.X.AWM]NEWICONIFY.C;3+, C./% 4-C0@123KPWO56m#%7&j8@PH9fG%HJ. #ifndef lintstatic char *rcsid_NewIconify_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/NewIconify.c,v 1.2 89/02/07 21:23:10 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. *//* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group= * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,& * Western Software Lab. Port to X11. */#include "awm.h" /*ARGSUSED*/.Boolean NewIconify(window, mask, button, x, y);Window window; /* Event window. */>int mask; /* Button/key mask. */Bint button; /* Button event detail. */Cint x, y; /* Event mouse position. */{8 XWindowAttributes fromInfo; /* from window info. */5 XWindowAttributes toInfo; /* to window info. */ Window from, to;9 int mse_x, mse_y; /* Mouse X and Y coordinates. */< int new_x, new_y; /* To U. L. X and Y coordinates. */3 int new_w, new_h; /* To width and height. */# int bdw; /* border width */: int prev_x; /* Previous event window X location. */: int prev_y; /* Previous event window Y location. */9 int cur_x; /* Current event window X location. */9 int cur_y; /* Current event window Y location. */0 int root_x; /* Root window X location. */0 int root_y; /* Root window Y location. */; int ulx, uly; /* Event window upper left X and Y. */< int lrx, lry; /* Event window lower right X and Y. */7 int num_vectors; /* Number of vectors in box. */5 int status; /* Routine call return status. */. int ptrmask; /* pointer query state. */, Window root; /* Mouse root window. */7 Window sub_win; /* Mouse position sub-window. */5 XEvent button_event; /* Button event packet. */< XSegment box[MAX_BOX_VECTORS]; /* Box vertex buffer. */C XSegment zap[MAX_ZAP_VECTORS]; /* Zap effect vertex buffer. */= int (*storegrid_func)(); /* Function to use for grid */; int (*storebox_func)(); /* Function to use for box */ AwmInfoPtr awi; extern Window MakeIcon();" extern void ungrab_pointer(); extern void grab_pointer();  Entry("NewIconify")  /*0 * Do not lower or iconify the root window. */( if (window == RootWindow(dpy, scr)) Leave(FALSE)  /*- * Change the cursor to the icon cursor. */ grab_pointer();  /*! * Clear the vector buffers. */ bzero(box, sizeof(box)); if (Zap) bzero(zap, sizeof(zap));  /*% * Get info on the event window. */ awi = GetAwmInfo(window); if (!awi) Leave(FALSE) /*+ * Are we iconifying or de-iconifying? */ if (awi->state & ST_ICON) { from = awi->icon;7 to = (awi->frame) ? awi->frame : awi->client; }' else if (awi->state & ST_WINDOW) {9 from = (awi->frame) ? awi->frame : awi->client;G to = (awi->icon) ? awi->icon : MakeIcon(window, x, y, FALSE); } else {K fprintf(stderr, "NewIconify: Window %x has unknown state '%x'\n", awi->client, awi->state); Leave(FALSE) }9 status = XGetWindowAttributes(dpy, from, &fromInfo); if (status == FAILURE) Leave(FALSE)5 status = XGetWindowAttributes(dpy, to, &toInfo); if (status == FAILURE) Leave(FALSE) /** * Initialize the movement variables. */9 ulx = x - (toInfo.width >> 1) - toInfo.border_width;: uly = y - (toInfo.height >> 1) - toInfo.border_width;= lrx = x + (toInfo.width >> 1) + toInfo.border_width - 1;> lry = y + (toInfo.height >> 1) + toInfo.border_width - 1; prev_x = x; prev_y = y;. if (awi->frame && awi->state & ST_ICON) {& storegrid_func = StoreTitleGridBox;! storebox_func = StoreTitleBox; } else {! storegrid_func = StoreGridBox; storebox_func = StoreBox; }  /* * Store the box. */ if (Grid)9 num_vectors = storegrid_func(box, ulx, uly, lrx, lry); else8 num_vectors = storebox_func(box, ulx, uly, lrx, lry);  /*4 * Freeze the server, if requested by the user.@ * This results in a solid box instead of a flickering one. */ if (Freeze) XGrabServer(dpy);  /*> * Process any outstanding events before drawing the box. */ while (QLength(dpy) > 0) {" XPeekEvent(dpy, &button_event);D if (((XAnyEvent *)&button_event)->window == RootWindow(dpy, scr)) break; GetButton(&button_event); }  /* * Draw the box. */ DrawBox(); if (Freeze) Frozen = window;  /*F * We spin our wheels here looking for mouse movement or a change% * in the status of the buttons. */ Snatched = TRUE; while (TRUE) {  /*> * Check to see if we have a change in mouse button status.2 * This is how we get out of this "while" loop. */= if (XPending(dpy) && !ProcessRequests(box, num_vectors) &&" GetButton(&button_event)) { /*9 * Process the pending events, this sequence is the only( * way out of the loop and the routine. */ 2 if ((button_event.type != ButtonPress) && , (button_event.type != ButtonRelease)) {, continue; /* spurious menu event... */ } /*< * If we froze the server, then erase the last lines drawn. */ if (Freeze) { DrawBox(); Frozen = (Window)0; XUngrabServer(dpy); } /*# * Save the mouse cursor location. *// if (button_event.type == ButtonPress ||* button_event.type == ButtonRelease) {1 mse_x = ((XButtonEvent *)&button_event)->x;1 mse_y = ((XButtonEvent *)&button_event)->y; break; } } else { /*5 * Continue to track the mouse until we get a change * in button status. */1 XQueryPointer(dpy, RootWindow(dpy, scr), 2 &root, &sub_win, &root_x, &root_y, &cur_x, &cur_y, &ptrmask); /*> * If the mouse has moved, then make sure the box follows it. */5 if ((cur_x != prev_x) || (cur_y != prev_y)) {  /*B * If we've frozen the server, then erase the old box first! */ if (Freeze) DrawBox();  /*" * Set the new box position. */ ulx += cur_x - prev_x; uly += cur_y - prev_y; lrx += cur_x - prev_x; lry += cur_y - prev_y;  /*/ * Calculate the vectors for the new box. */  if (Grid)4 num_vectors = storegrid_func(box, ulx, uly, lrx, lry); else9 num_vectors = storebox_func(box, ulx, uly, lrx, lry);  /* * Draw the new box. */ if (Freeze) DrawBox(); } /* * Save the old box position. */ prev_x = cur_x; prev_y = cur_y; /*9 * If server is not frozen, then draw the "flicker" box. */ if (!Freeze) { DrawBox(); DrawBox(); } } } Snatched = FALSE; /*I * If the button is not a button release of the same button pressed,! * then abort the operation. */0 if ((button_event.type != ButtonRelease) ||@ (((XButtonReleasedEvent *)&button_event)->button != button)) { ResetCursor(button); ungrab_pointer(); Leave(TRUE) }  /*D * If we are here we have committed to iconifying/deiconifying. */  /*8 * Determine the coordinates of the icon or window;H * normalize the window or icon coordinates if the user so desires. */ new_w = toInfo.width; new_h = toInfo.height; bdw = toInfo.border_width;( new_x = mse_x - (new_w >> 1) - bdw;( new_y = mse_y - (new_h >> 1) - bdw;R if ((NIcon && awi->state & ST_WINDOW) || (NWindow && awi->state & ST_ICON)) { if (new_x < 0) new_x = 0; if (new_y < 0) new_y = 0;8 if ((new_x - 1 + new_w + (bdw << 1)) > ScreenWidth) {5 new_x = ScreenWidth - new_w - (bdw << 1) + 1; }9 if ((new_y - 1 + new_h + (bdw << 1)) > ScreenHeight) {6 new_y = ScreenHeight - new_h - (bdw << 1) + 1; } } if (awi->state & ST_ICON) { awi->state ^= ST_ICON;) awi->state |= (ST_WINDOW | ST_PLACED); if (!awi->frame)- XRemoveFromSaveSet(dpy, awi->client); }' else if (awi->state & ST_WINDOW) { awi->state ^= ST_WINDOW; awi->state |= ST_ICON;# XAddToSaveSet(dpy, awi->client); } else> fprintf(stderr, "NewIconify: Window state got trashed!\n");  /*# * Move the window into place. */( XMoveWindow(dpy, to, new_x, new_y);  /* * Map the icon window. */ XMapRaised(dpy, to); if (Zap) { num_vectors = StoreZap(zap, fromInfo.x, fromInfo.y, fromInfo.x + fromInfo.width$ + (fromInfo.border_width << 1),! fromInfo.y + fromInfo.height$ + (fromInfo.border_width << 1), ulx, uly, lrx, lry); DrawZap(); DrawZap(); } /* * Unmap the event window. */ XUnmapWindow(dpy, from); XFlush(dpy); ungrab_pointer(); Leave(TRUE)}*[FIELDS.X.AWM]PAUSE.C;4+,D./% 4:-C0D123KPWO56G/7d8>PH9fG%HJ #ifndef lintstatic char *rcsid_Pause_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Pause.c,v 1.2 89/02/07 21:23:15 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. *//* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group= * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,) * Western Software Lab. Convert to X11.) * 002 -- Jordan Hubbard, Ardent Computer * Changes for awm. */#include "awm.h" /*ARGSUSED*/-Boolean awm_Pause(window, mask, button, x, y);Window window; /* Event window. */>int mask; /* Button/key mask. */@int button; /* Button event detail. */Cint x, y; /* Event mouse position. */{ Entry("Pause") XGrabServer(dpy); Leave(FALSE)} /*ARGSUSED*/,Boolean Continue(window, mask, button, x, y);Window window; /* Event window. */>int mask; /* Button/key mask. */@int button; /* Button event detail. */Cint x, y; /* Event mouse position. */{ Entry("Continue") XUngrabServer(dpy); Leave(FALSE)}*[FIELDS.X.AWM]PUSH.C;3+, C. /% 4} -C0@123KPWO 56 -'%7m8@`PH9fG%HJ #ifndef lint}static char *rcsid_Push_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Push.c,v 1.2 89/02/07 21:23:21 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ /* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group= * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,) Western Software Lab. Convert to X11. */#include "awm.h"#define SHOVE_DOWN 1#define SHOVE_UP 2#define SHOVE_LEFT 3#define SHOVE_RIGHT 4extern Boolean ShoveAll(); /*ARGSUSED*/-Boolean ShoveDown(window, mask, button, x, y)%Window window; /* Event window. */#int mask; /* Button/key mask. */)int button; /* Button event detail. */(int x, y; /* Event mouse position. */{ Entry("ShoveDown")' Leave(ShoveAll(window, SHOVE_DOWN))} /*ARGSUSED*/+Boolean ShoveUp(window, mask, button, x, y)%Window window; /* Event window. */#int mask; /* Button/key mask. */)int button; /* Button event detail. */(int x, y; /* Event mouse position. */{ Entry("ShoveUp")% Leave(ShoveAll(window, SHOVE_UP))} /*ARGSUSED*/-Boolean ShoveLeft(window, mask, button, x, y)%Window window; /* Event window. */#int mask; /* Button/key mask. */)int button; /* Button event detail. */(int x, y; /* Event mouse position. */{ Entry("ShoveLeft")' Leave(ShoveAll(window, SHOVE_LEFT))} /*ARGSUSED*/.Boolean ShoveRight(window, mask, button, x, y)%Window window; /* Event window. */#int mask; /* Button/key mask. */)int button; /* Button event detail. */(int x, y; /* Event mouse position. */{ Entry("ShoveRight")( Leave(ShoveAll(window, SHOVE_RIGHT))}Boolean ShoveAll(w, direction) Window w;int direction;{> XWindowAttributes winfo; /* Event window information. */- int xofs, yofs; /* Movement offsets. */+ int x, y; /* New window position. */ Entry("ShoveAll") /** * Do not try to move the root window. */" if (w == RootWindow(dpy, scr)) Leave(FALSE) /*' * Gather info on the event window. */2 status = XGetWindowAttributes(dpy, w, &winfo);' if (status == FAILURE) Leave(FALSE) if (!Pushval && Push) Pushval = DEF_PUSH; /*& * Calculate the movement offsets. */ switch(direction) { case SHOVE_DOWN: xofs = 0;9 yofs = Push ? (winfo.height / Pushval) : Pushval; break; case SHOVE_UP: xofs = 0;? yofs = 0 - (Push ? (winfo.height / Pushval) : Pushval); break; case SHOVE_LEFT:> xofs = 0 - (Push ? (winfo.width / Pushval) : Pushval); yofs = 0; break; case SHOVE_RIGHT:8 xofs = Push ? (winfo.width / Pushval) : Pushval; yofs = 0; break; } /*) * Calculate the new window position. */ x = winfo.x + xofs; y = winfo.y + yofs; /*7 * Normalize the new window coordinates so we don't2 * lose the window off the edge of the screen. */I if (x < (0 - winfo.width + CURSOR_WIDTH - (winfo.border_width << 1)))G x = 0 - winfo.width + CURSOR_WIDTH - (winfo.border_width << 1);K if (y < (0 - winfo.height + CURSOR_HEIGHT - (winfo.border_width << 1)))I y = 0 - winfo.height + CURSOR_HEIGHT - (winfo.border_width << 1);) if (x > (ScreenWidth - CURSOR_WIDTH))' x = ScreenWidth - CURSOR_WIDTH;+ if (y > (ScreenHeight - CURSOR_HEIGHT))) y = ScreenHeight - CURSOR_HEIGHT; /*" * Move the window into place. */ XMoveWindow(dpy, w, x, y); Leave(FALSE)}*[FIELDS.X.AWM]RAISE.C;4+,D./% 4"-C0D123KPWO 56 B/7 \'8~PH9fG%HJ  #ifndef lintstatic char *rcsid_Raise_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Raise.c,v 1.2 89/02/07 21:23:28 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. *//* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group2 * 001 -- R. Kittell, DEC Storage A/D May 19, 1986F * Optionally warp mouse to upper right corner of window after raise.< * 002 -- Loretta Guarino Reid, DEC Ultrix Engineering Group) * Western Software Lab. Convert to X11.) * 003 -- Jordan Hubbard, Ardent Computer * Changed for awm. */#include "awm.h" /*ARGSUSED*/-Boolean awm_Raise(window, mask, button, x, y);Window window; /* E ? AC[FIELDS.X.AWM]MJK^=[?|mx 7tX]R |"N=|>O;imHs92ccMB=@82{O,#lD^/Q>mR -?lmx D$ ].h "8vi3, -?f4K:!%BYzF$4?I( 9(Z1M%'B\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>2 ]HK#gWr[]45LAZ"V%+Lol`]KPd\XwJ|}AD3Q&QH`,DwW'w]N"|DsIp0]+|nvc# V-uA45c%:S P+*M]*P},}|P MMYqVdnB {YKg2zR%EWC?sE] LU]XA^m / /KaaK}~pb]IRkQ7TGlCqg8)<,<9NMTqu` >dIz/a=1|\`$ioL(cgD?;b;Ehq4i}K&Tr[2lwGC7~M:(RhIO O9f nX`TDs3XkfZqU[5[Wb)Dnksg*M7\lj=Q5 (0%cRgo`OJ&C2l,\djYC0roA6<%a^hbЦ_ \9Yd Ln[w#7"cv5B}G0"<gP{q#ezHeG^J0$2]sk(x;3X]5z|mON[ 04cCBiS0#JS_ 5$ `D@SyRDBIOd8aKTcpxb )778~Xb}6e&Vx#[ x$/oF{`+VLfz2J\ %b\pH$Sn@YDwMg{I9>$=yWUSbP 3yh`H5-yboJljUVwz-K\X~esuh{>zHxNbIx B$\pN6?c'j{9} S,<[.zo+++I[r*C]qiTQUbc_+-sh &!&43#^8S-}y-Yl9UmV 1 a ~;#ToX4Q%;613.+Si-<x10x3_9zxb4;_f rZ#Gbd^+8d*kJk.p}:AK 8@4YfvKj#vp.yXnd{=&Be'gEOb#C-82zR`oQDCg}Uؔ#&rwd@,]bnEfX-iojQx0A3iHakS[rex%^?%Qx-I8qPG ywW ]`cB-e70~`%qK`4y;pQ8 1, 11qow+4Cqx53d+%,Hy^hQ r(.}.a&~`-z|[)w/8(`jUxRRi,bhOA 0\OqU#fL1q!B!y'4(8/n*_TF%nLMK}#)D/b }o!,)rEc$W+. :msvvo]ONGK'3cvb E]$`?1/$jRC&^R }-/ :%cCint mask; /* Button/key mask. */Aint button; /* Button event detail. */Cint x, y; /* Event mouse position. */{= XWindowAttributes winfo; /* Window details for warp */ AwmInfoPtr awi; int status, vpoint;  Entry("Raise")  /*J * If the window is not the root window, raise the window and return. */ awi = GetAwmInfo(window); if (!awi) Leave(FALSE)* if (window != RootWindow(dpy, scr)) {2 window = awi->frame ? awi->frame : awi->client; XRaiseWindow(dpy, window); if (awi->frame)& vpoint = 10 + titleHeight + 2; else vpoint = 10; /*G * Optionally warp the mouse to the upper left corner of the window. */ if (WarpOnRaise) {< status = XGetWindowAttributes (dpy, window, &winfo); if (status == FAILURE) Leave(FALSE) 2 status = XWarpPointer (dpy, None, window,  0, 0, 0, 0,. winfo.width >= 7 ? winfo.width - 7 : winfo.width / 2,+ winfo.height >= vpoint ? vpoint : winfo.height / 2); if (status == FAILURE) Leave(FALSE) } } Leave(FALSE)}*[FIELDS.X.AWM]REFRESH.C;3+,C. /% 4 -C0@123KPWO 56 *%7b80PH9fG%HJ #ifndef lintstatic char *rcsid_Refresh_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Refresh.c,v 1.2 89/02/07 21:23:32 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ /* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group= * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,) * Western Software Lab. Convert to X11.) * 002 -- Jordan Hubbard, Ardent Computer * Changes for awm. */#include "awm.h" /*ARGSUSED*/+Boolean Refresh(window, mask, button, x, y);Window window; /* Event window. */>int mask; /* Button/key mask. */@int button; /* Button event detail. */Cint x, y; /* Event mouse position. */{ Entry("Refresh") #ifdef titan XTitanReset(dpy);#endif /* titan */< Leave( Redraw(RootWindow(dpy,scr), mask, button, x, y) )} /*ARGSUSED*/*Boolean Redraw(window, mask, button, x, y);Window window; /* Event window. */>int mask; /* Button/key mask. */Bint button; /* Button event detail. */Cint x, y; /* Event mouse position. */{0 XWindowAttributes winfo; /* window info. */4 XSetWindowAttributes swa; /* New window info */& Window w; /* Refresh window. */ Entry("Redraw") /*% * Get info on the target window. */7 status = XGetWindowAttributes(dpy, window, &winfo); if (status == FAILURE)1 Error("Refresh -> Can't query target window."); /*O * Create and map a window which covers the target window, then destroy it. */! swa.override_redirect = TRUE; swa.background_pixel = 0; /*H * What we have here is a failure to communicate. This window should? * more properly be created as a subwindow of "window", butF * when we do that, all events (Create, Map, Destroy) get reportedB * as coming from "window", not the newly created one. This isD * very nasty when the DestroyNotify is received. For now, we'llG * create it on the RootWindow and take the chance of generating an' * expose on an overlapping window. */H if ((w = XCreateWindow(dpy, RootWindow(dpy, scr), winfo.x, winfo.y, " (unsigned int) winfo.width, 4 (unsigned int) winfo.height, (unsigned int) 0, DefaultDepth(dpy, scr), CopyFromParent, DefaultVisual(dpy, scr),) (CWOverrideRedirect | CWBackPixel), &swa)) == NULL)3 Error("Refresh -> Can't create refresh window."); XMapWindow(dpy, w); XDestroyWindow(dpy, w); XFlush(dpy); Leave(FALSE)}*[FIELDS.X.AWM]RESIZE.C;3+,D. /% 4 -C0@123KPWO!56Y,%78 ҷPH9fG%HJ@ #ifndef lintstatic char *rcsid_Resize_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Resize.c,v 1.2 89/02/07 21:23:37 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. *//* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group< * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group * Convert to X11( * 002 -- Jordan Hubbard, U.C. berkeley.A * Added alternate placement of resize window, code for title bar * support. */#include "awm.h"#include *#define max(a,b) ( (a) > (b) ? (a) : (b) )*#define min(a,b) ( (a) > (b) ? (b) : (a) )C#define makemult(a, b) ((b==1) ? (a) : (((int)((a) / (b))) * (b)) ) /*ARGSUSED*/,Boolean Resize(window, mask, button, x0, y0);Window window; /* Event window. */>int mask; /* Button/key mask. */Bint button; /* Button event detail. */Cint x0, y0; /* Event mouse position. */{= XWindowAttributes client_info; /* client window info. */: XWindowAttributes frame_info; /* frame window info */@ int x1, y1; /* fixed box corner */A int x2, y2; /* moving box corner */ int x, y; int xinc, yinc; int minwidth, minheight; int maxwidth, maxheight;1 int ox, oy; /* which quadrant of window */5 int pop_x, pop_y; /* location of pop window */+ int hsize, vsize; /* dynamic size */ int delta;  int junk_x, junk_y;5 unsigned int ptrmask; /* pointer status word */9 int num_vectors; /* Number of vectors to XDraw. */4 Window sub_win; /* Mouse query sub window. */, Window root; /* Root query window. */; XEvent button_event, *b_ev; /* Button event packet. */D XSegment box[MAX_BOX_VECTORS]; /* Box drawing vertex buffer. */D XSegment zap[MAX_ZAP_VECTORS]; /* Zap drawing vertex buffer. */; Boolean stop; /* Should the window stop changing? */ XSizeHints sizehints; XWindowChanges values;L int width_offset, height_offset; /* to subtract if resize increments */@ int x_offset, y_offset; /* add to pointer to get anchor */ AwmInfoPtr awi;C int (*storegrid_func)(); /* which StoreGrid routine to use */A int (*storebox_func)(); /* which StoreBox routing to use */ int buttonConfirmEvent;" extern void ungrab_pointer(); extern void grab_pointer(); Entry("Resize") /*: * Do nothing if the event window is the root window. */( if (window == RootWindow(dpy, scr)) Leave(FALSE) /*+ * Gather info about the event window. */ awi = GetAwmInfo(window); if (!awi) Leave(FALSE) /*% * Do not resize an icon window. */ if (window == awi->icon) Leave(FALSE) window = awi->client; b_ev = &button_event;( buttonConfirmEvent = ButtonRelease;> status = XGetWindowAttributes(dpy, window, &client_info); if (status == FAILURE) Leave(FALSE)2 if (awi->frame) { /* we have to compensate */? status = XGetWindowAttributes(dpy, awi->frame, &frame_info); client_info.y = frame_info.y; client_info.x = frame_info.x; if (status == FAILURE) Leave(FALSE) if (DECORATED(awi)) { if (awi->title)' client_info.y += titleHeight + 2;% if (awi->attrs & AT_BORDER) {$ client_info.x += BContext + 1; if (!awi->title)" client_info.y += BContext + 1; } } } /*! * Clear The vector buffers. */ bzero(box, sizeof(box)); if (Zap) bzero(zap, sizeof(zap));# storegrid_func = StoreGridBox; storebox_func = StoreBox; /*C * If we are here then we have a resize operation in progress. */  /*" * Turn on the resize cursor. */ grab_pointer(); /*B * calculate fixed point (x1, y1) and varying point (x2, y2). */ hsize = client_info.width; vsize = client_info.height; x1 = client_info.x; y1 = client_info.y; x2 = x1 + hsize; y2 = y1 + vsize; /*) * Get the event window resize hint. */ sizehints.flags = 0;A XGetSizeHints(dpy, window, &sizehints, XA_WM_NORMAL_HINTS); " CheckConsistency(&sizehints);G /* until there are better WM_HINTS, we'll assume that the client'sH * minimum width and height are the appropriate offsets to subtract8 * when resizing with an explicit resize increment. */J if ((sizehints.flags & PMinSize) && (sizehints.flags & PResizeInc)) {& width_offset = sizehints.min_width;( height_offset = sizehints.min_height; } else$ width_offset = height_offset = 0;  /*F * decide what resize mode we are in. Always rubberband if window * is too small. */; if (client_info.width > 2 && client_info.height > 2) {7 ox = ((x0 - client_info.x) * 3) / client_info.width;8 oy = ((y0 - client_info.y) * 3) / client_info.height; if ((ox + oy) & 1) { if (ox & 1) {@ /* fix up size hints so that we will never change width */1 sizehints.min_width = sizehints.max_width = client_info.width;. if ((sizehints.flags & PMinSize) == 0) { sizehints.min_height = 0; sizehints.flags |= PMinSize; }. if ((sizehints.flags & PMaxSize) == 0) {3 sizehints.max_height = DisplayHeight(dpy, scr); sizehints.flags |= PMaxSize; } } if (oy & 1) {A /* fix up size hints so that we will never change height */3 sizehints.min_height = sizehints.max_height = client_info.height;, if ((sizehints.flags & PMinSize)==0) { sizehints.min_width = 0; sizehints.flags |= PMinSize; }, if ((sizehints.flags & PMaxSize)==0) {1 sizehints.max_width = DisplayWidth(dpy, scr); sizehints.flags |= PMaxSize; } } } } else ox = oy = 2;8 /* change fixed point to one that shouldn't move */ if (oy == 0) {  y = y1; y1 = y2; y2 = y; } if (ox == 0) {  x = x1; x1 = x2; x2 = x; }& if (sizehints.flags & PMinSize) {" minwidth = sizehints.min_width;$ minheight = sizehints.min_height; } else { minwidth = 0; minheight = 0; }& if (sizehints.flags & PMaxSize) {1 maxwidth = max(sizehints.max_width, minwidth);4 maxheight = max(sizehints.max_height, minheight); } else {% maxwidth = DisplayWidth(dpy, scr);' maxheight = DisplayHeight(dpy, scr); }( if (sizehints.flags & PResizeInc) { xinc = sizehints.width_inc; yinc = sizehints.height_inc; } else { xinc = 1; yinc = 1; } switch (ox) { case 0: pop_x = x1 - PWidth; break; case 1:% pop_x = x1 + (hsize - PWidth) / 2; break; case 2: pop_x = x1; break; } switch (oy) { case 0: pop_y = y1 - PHeight; break; case 1:& pop_y = y1 + (vsize - PHeight) / 2; break; case 2: pop_y = y1; break; } /*K * Double expose on the target window is too expensive for some reasonA * or another. Paint the popup window in the upper left handD * corner of the screen if RootResizeBox is FALSE. This is alsoK * more-or-less consistent with the position of the map request popup. */ if (RootResizeBox == TRUE) values.x = values.y = 0; else {> if (pop_x < 0 || pop_x > (DisplayWidth(dpy, scr) - PWidth)) pop_x = 0;@ if (pop_y < 0 || pop_y > (DisplayHeight(dpy, scr) - PHeight)) pop_y = 0; values.x = pop_x; values.y = pop_y; } values.stack_mode = Above;M XConfigureWindow(dpy, Pop, (unsigned int) CWX|CWY|CWStackMode, &values); XMapWindow(dpy, Pop); if (Grid) {' num_vectors = (*storegrid_func)(box, MIN(x1, x2), MIN(y1, y2),! MAX(x1, x2), MAX(y1, y2)); } else {& num_vectors = (*storebox_func)(box, MIN(x1, x2), MIN(y1, y2), MAX(x1, x2), MAX(y1, y2)); } /*8 * If we freeze the server, then we will draw solid9 * lines instead of flickering ones during resizing. */ if (Freeze) XGrabServer(dpy);$ /* protect us from ourselves */ Snatched = True; /*C * Process any pending exposure events before drawing the box. */ while (QLength(dpy) > 0) { XPeekEvent(dpy, b_ev);1 if (b_ev->xany.window == RootWindow(dpy, scr)) break; GetButton(b_ev); } if (ResizeRelative) { x_offset = x2 - x0; y_offset = y2 - y0; } else x_offset = y_offset = 0; /* * Now draw the box. */ DrawBox(); Frozen = window;  stop = FALSE; x = -1; y = -1;  while (!stop) { if (x != x2 || y != y2) { x = x2; y = y2; /** * If we've frozen the server, then erase * the old box. */ if (Freeze) DrawBox();  if (Grid) {* num_vectors = (*storegrid_func)(box,! MIN(x1, x), MIN(y1, y)," MAX(x1, x), MAX(y1, y)); } else {) num_vectors = (*storebox_func)(box, MIN(x1, x), MIN(y1, y),! MAX(x1, x), MAX(y1, y)); }  if (Freeze) DrawBox(); {0 int Hsize = (hsize - width_offset) / xinc;1 int Vsize = (vsize - height_offset) / yinc; int pos = 4;: PText[0] = (Hsize>99) ? (Hsize / 100 + '0') : ' ';> PText[1] = (Hsize>9) ? ((Hsize / 10) % 10 + '0') : ' ';" PText[2] = Hsize % 10 + '0';5 if (Vsize>99) PText[pos++] = Vsize / 100 + '0';; if (Vsize>9) PText[pos++] = (Vsize / 10) % 10 + '0';& PText[pos++] = Vsize % 10 + '0';' while (pos<7) PText[pos++] = ' '; } /*- * If the font is not fixed width we have to5 * clear the window to guarantee that the characters& * that were there before are erased. */# if (!(PFontInfo->per_char)) XClearWindow(dpy, Pop); XDrawImageString( dpy, Pop, PopGC,) PPadding, PPadding+PFontInfo->ascent, PText, PTextSize); } if (!Freeze) { DrawBox(); DrawBox(); }= if (XPending(dpy) && !ProcessRequests(box, num_vectors) && GetButton(b_ev)) {0 if ((b_ev->xany.type != ButtonPress) && ( (b_ev->xany.type != ButtonRelease)), continue; /* spurious menu event... */ if (Freeze) { DrawBox(); Frozen = (Window)0; XUngrabServer(dpy); }4 if (b_ev->xany.type == buttonConfirmEvent &&$ b_ev->xbutton.button == button) stop = TRUE; else { XUnmapWindow(dpy, Pop); ResetCursor(button); Snatched = False; ungrab_pointer(); Leave(TRUE) } } else {8 XQueryPointer(dpy, RootWindow(dpy, scr), &root, 8 &sub_win, &x2, &y2, &junk_x, &junk_y, &ptrmask);1 x2 += x_offset; /* get to anchor point */ y2 += y_offset; }7 hsize = max(min(abs (x2 - x1), maxwidth), minwidth);7 hsize = makemult(hsize - minwidth, xinc) + minwidth;8 vsize = max(min(abs(y2 - y1), maxheight), minheight);: vsize = makemult(vsize - minheight, yinc) + minheight; # if (sizehints.flags & PAspect) {. if ((hsize * sizehints.max_aspect.y > ( vsize * sizehints.max_aspect.x)) {8 delta = makemult((hsize * sizehints.max_aspect.y /+ sizehints.max_aspect.x) - vsize,  yinc);' if ((vsize + delta <= maxheight)) vsize += delta; else { delta = makemult(hsize - (sizehints.max_aspect.x *' vsize/sizehints.max_aspect.y), xinc);" if (hsize - delta >= minwidth) hsize -= delta;  } } 4 if (hsize * sizehints.min_aspect.y < vsize * sizehints.min_aspect.x) {1 delta = makemult((sizehints.min_aspect.x * 1 vsize/sizehints.min_aspect.y) - hsize,  xinc);$ if (hsize + delta <= maxwidth) hsize += delta; else { delta = makemult(vsize - & (hsize*sizehints.min_aspect.y /! sizehints.min_aspect.x),  yinc); # if (vsize - delta >= minheight) vsize -= delta;  } }  } if (ox == 0) x2 = x1 - hsize; else x2 = x1 + hsize;  if (oy == 0) y2 = y1 - vsize; else y2 = y1 + vsize;  } if (x2 < x1) { x = x1; x1 = x2; x2 = x; } if (y2 < y1) { y = y1; y1 = y2; y2 = y; } XUnmapWindow(dpy, Pop);: if ((x1 !=client_info.x) || (y1 != client_info.y) || ! (hsize != client_info.width) ||" (vsize != client_info.height)) { XWindowChanges xwc;  xwc.x = x1; xwc.y = y1; xwc.width = hsize; xwc.height = vsize; ConfigureWindow(window, : (unsigned int) CWX | CWY | CWHeight | CWWidth, &xwc); } Snatched = False; ungrab_pointer(); Leave(TRUE)}CheckConsistency(hints)XSizeHints *hints;{ Entry("CheckConsistency") if (hints->min_height < 0) hints->min_height = 0; if (hints->min_width < 0) hints->min_width = 0; 9 if (hints->max_height <= 0 || hints->max_width <= 0) hints->flags &= ~PMaxSize; I hints->min_height = min(DisplayHeight(dpy, scr), hints->min_height);H hints->min_width = min(DisplayWidth(dpy, scr), hints->min_width); I hints->max_height = min(DisplayHeight(dpy, scr), hints->max_height);H hints->max_width = min(DisplayWidth(dpy, scr), hints->max_width); C if ((hints->flags & PMinSize) && (hints->flags & PMaxSize) && - ((hints->min_height > hints->max_height) ||* (hints->min_width > hints->max_width)))( hints->flags &= ~(PMinSize|PMaxSize); % if ((hints->flags & PAspect) && / (hints->min_aspect.x * hints->max_aspect.y > . hints->max_aspect.x * hints->min_aspect.y)) hints->flags &= ~(PAspect); Leave_void}*[FIELDS.X.AWM]RESTART.C;4+,o. /% 4 B-C0D123KPWO 56@@N78PH9fG%HJ #ifndef lintstatic char *rcsid_Restart_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Restart.c,v 1.3 89/02/07 22:39:52 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. *//* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group= * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,) Western Software Lab. Convert to X11.? * 002 -- Jordan Hubbard, U.C. Berkeley. Titlebar cleanup code. */#include "awm.h"#include extern XContext AwmContext; /*ARGSUSED*/+Boolean Restart(window, mask, button, x, y);Window window; /* Event window. */>int mask; /* Button/key mask. */Bint button; /* Button event detail. */Cint x, y; /* Event mouse position. */{ Entry("Restart") XFreeFont(dpy, IFontInfo); XFreeFont(dpy, PFontInfo);* XBell(dpy, VOLUME_PERCENTAGE(Volume));* XBell(dpy, VOLUME_PERCENTAGE(Volume)); XFlush(dpy); Cleanup();$ XSync(dpy, 0); /* be paranoid */" execvp(*Argv, Argv, EEnviron);. fprintf(stderr, "awm: Restart failed!\n"); exit(1);} /*ARGSUSED*/(Boolean Quit(window, mask, button, x, y);Window window; /* Event window. */>int mask; /* Button/key mask. */Bint button; /* Button event detail. */Cint x, y; /* Event mouse position. */{ Entry("Quit") Cleanup(); /* * Be a careful boy scout. */ XSync(dpy, 0); XCloseDisplay(dpy); exit(0);} /*ARGSUSED*/1Boolean DestroyClient(window, mask, button, x, y)Window window; int mask; int x, y;{ AwmInfoPtr awi; Entry("DestroyClient")( if (window == RootWindow(dpy, scr)) Leave(FALSE) awi = GetAwmInfo(window); /*L * If it's a titled window or an icon (we don't want to nuke ourselves)I * we should get the client for it. We assume the subsequent destroy5 * notify will tell us to reclaim our resources. */ window = awi->client; XKillClient(dpy, window); Leave(TRUE)}/*I * Put any necessary cleanup code here, it will be invoked when awm exits> * or restarts. Currently just checks for title bar resources. */ Cleanup(){ Window junk, *windows; unsigned int nwins; AwmInfoPtr awi; Entry("Cleanup");H if (XQueryTree(dpy, DefaultRootWindow(dpy), &junk, &junk, &windows, &nwins)) { int i; % for (i = 0; i < (int)nwins; i++) { XWindowAttributes xwa; int bw;% awi = GetAwmInfo(windows[i]); if (!awi) continue; bw = awi->border_width;! if (awi->state & ST_ICON)# XMapWindow(dpy, awi->client); RemoveIcon(windows[i]);4 XGetWindowAttributes(dpy, awi->frame, &xwa); if (PushDown == FALSE) { if (awi->attrs & AT_TITLE) xwa.y += (titleHeight + 2);& else if (awi->attrs & AT_BORDER) xwa.y += BContext; }# if (awi->attrs & AT_BORDER)* xwa.x -= (BContext + (bw ? bw : 1));? XReparentWindow(dpy, awi->client, RootWindow(dpy, scr), xwa.x, xwa.y);- XRemoveFromSaveSet(dpy, awi->client);C XSetWindowBorderWidth(dpy, awi->client, awi->border_width); free(awi); } if (nwins) XFree(windows); } Leave_void}*[FIELDS.X.AWM]RUBBERBAND.C;3+,C./% 4-C0@123KPWO56Vr0%78!PH9fG%HJ #ifndef lintstatic char *rcsid_RubberBand_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/RubberBand.c,v 1.2 89/02/07 21:23:46 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ Q~AWM.SAVECC[FIELDS.X.AWM]RUBBERBAND.C;3"*/* * MODIFICATION HISTORY *< * 000 -- Loretta Guarino Reid, DEC Ultrix Engineering Group0 * 001 -- Ralph R. Swick, DEC/MIT Project Athena7 * tailor to uwm; use global resources created by uwm */#include "awm.h"#include #include *#define max(a,b) ( (a) > (b) ? (a) : (b) )*#define min(a,b) ( (a) > (b) ? (b) : (a) )&#define abs(a) ( (a) > 0 ? (a) : -(a))C#define makemult(a, b) ((b==1) ? (a) : (((int)((a) / (b))) * (b)) )#define DCOUNT 2##define PCOUNT 1 + (4 * 2 * DCOUNT)9#define BW PBorderWidth /* pop-up window border width */<#define IBW PPadding /* internal border width for pop-up */@AskUser(dpy, scr, window, x, y, width, height, hints, transient) Display *dpy;int scr;Window window; int *x, *y;unsigned int *width, *height;XSizeHints *hints;Window transient;{H Cursor ur, ul, ll, lr; /* cursors for rubber banding */ int change_cursor = FALSE; int current_cursor;5 char *text; /* text for prompt string */G int nz; /* count where zeros are */K unsigned int popw, poph; /* width and height of prompt window*/#define invertGC DrawGCG int x1, y1; /* location of mouse */G int x2, y2; /* other corner of box */ int rootx, rooty;@ unsigned int mask; /* for XQueryPointer */0 Window root, subw; /* for XQueryPointer */, int xa = -1, ya = -1, xb = -1, yb = -1; int xinc, yinc;& unsigned int minwidth, minheight;& unsigned int maxwidth, maxheight;& unsigned int defwidth, defheight; int chosen = -1; int stop = FALSE; int changed = TRUE; int doit = FALSE; int dx, dy; int delta; int ijunk; XPoint box[PCOUNT]; int hsize, vsize;K int zero = '0'; /* zero offset for char conversion */A XEvent e; /* someplace to put the event */N unsigned int events; /* what events we want. */N Window pop, wjunk; /* pop up prompt window */ int i; char *name;L int width_offset, height_offset; /* to subtract if resize increments */  Entry("AskUser") if (transient) {: XGetGeometry( dpy, window, &wjunk, x, y, width, height, &ijunk, &ijunk); Leave_void }B if ((hints->flags & USPosition) && (hints->flags & USSize)) { *x = hints->x; *y = hints->y; *width = hints->width; *height = hints->height; Leave_void }* if (!XFetchName(dpy, window, &name))  name = "Unnamed Window"; . ur = XCreateFontCursor(dpy, XC_ur_angle);. ul = XCreateFontCursor(dpy, XC_ul_angle);. ll = XCreateFontCursor(dpy, XC_ll_angle);. lr = XCreateFontCursor(dpy, XC_lr_angle); current_cursor = ul; 2 events = ButtonPressMask | ButtonReleaseMask;  /* , * go get the mouse as soon as you can  */  while (1) {? if (XGrabPointer (dpy, RootWindow(dpy, scr), FALSE, events, . GrabModeAsync, GrabModeAsync, None, ul,# CurrentTime) == GrabSuccess) break; sleep (1); }; nz = strlen(name); /* compute number of characters */& text = (char *)malloc( nz + 11 ); (void) strcpy(text, name);& (void) strcat(text, ": 000x000"); nz += 9;7 popw = XTextWidth (PFontInfo, text, nz) + 2 * IBW;; poph = PFontInfo->ascent+PFontInfo->descent + 2 * IBW; : pop = XCreateSimpleWindow(dpy, RootWindow(dpy, scr), 6 0, 0, popw, poph, BW, PBorder, PBackground); XMapWindow (dpy, pop); # if (hints->flags & PMinSize) { minwidth = hints->min_width;! minheight = hints->min_height; } else { minwidth = 0; minheight = 0; }# if (hints->flags & PMaxSize) {. maxwidth = max(hints->max_width, minwidth);1 maxheight = max(hints->max_height, minheight); } else {% maxwidth = DisplayWidth(dpy, scr);' maxheight = DisplayHeight(dpy, scr); }% if (hints->flags & PResizeInc) { xinc = hints->width_inc; yinc = hints->height_inc; } else { xinc = 1; yinc = 1; }9 if (hints->flags & PSize || hints->flags & USSize) { defwidth = hints->width; defheight = hints->height;( } else if (hints->flags&PMinSize) { defwidth = hints->min_width;! defheight = hints->min_height;( } else if (hints->flags&PMaxSize) { defwidth = hints->max_width;! defheight = hints->max_height; } else { long dummy;4 XGetGeometry(dpy, window, &dummy, &dummy, &dummy,0 &defwidth, &defheight, &dummy, &dummy); } G /* until there are better WM_HINTS, we'll assume that the client'sH * minimum width and height are the appropriate offsets to subtract8 * when resizing with an explicit resize increment. */@ if (hints->flags & PMinSize && hints->flags & PResizeInc) {# width_offset = hints->min_width;% height_offset = hints->min_height; } else$ width_offset = height_offset = 0;  = XQueryPointer (dpy, RootWindow(dpy, scr), &root, &subw, ' &rootx, &rooty, &x1, &y1, &mask); hsize = minwidth;  vsize = minheight; x2 = x1+hsize;  y2 = y1+vsize;  while (stop == FALSE) {4 if ( (xb != max (x1, x2)) || (yb != max (y1, y2))9 ||(xa != min (x1, x2)) || (ya != min (y1, y2)) ) { xa = min (x1, x2); ya = min (y1, y2); xb = max (x1, x2); yb = max (y1, y2);* for ( i = 0; i < PCOUNT; i += 4) {1 box[i].x = xa; box[i].y = ya;- if (i+1 == PCOUNT) break;5 box[i+1].x = xb; box[i+1].y = ya;5 box[i+2].x = xb; box[i+2].y = yb;5 box[i+3].x = xa; box[i+3].y = yb; } doit = TRUE; } if (changed) {2 int Hsize = (hsize - width_offset) / xinc;3 int Vsize = (vsize - height_offset) / yinc; int pos = 3;  changed = FALSE;? text[nz - 7] = (Hsize>99) ? (Hsize / 100 + zero) : ' ';F text[nz - 6] = (Hsize>9) ? ((Hsize / 10) % 10 + zero) : ' ';) text[nz - 5] = Hsize % 10 + zero;< if (Vsize>99) text[nz - pos--] = Vsize / 100 + zero;B if (Vsize>9) text[nz - pos--] = (Vsize / 10) % 10 + zero;1 text[nz - pos--] = Vsize % 10 + zero;- while (pos>0) text[nz - pos--] = ' ';E XDrawImageString(dpy, pop, PopGC, IBW, IBW+PFontInfo->ascent, text, nz); } if (doit) {E XDrawLines(dpy, RootWindow(dpy, scr), invertGC, box, PCOUNT,  CoordModeOrigin); } if (XPending(dpy) &&E XCheckMaskEvent(dpy, ButtonPressMask|ButtonReleaseMask, &e)) {6 if ((chosen < 0) && (e.type == ButtonPress)) {( x1 = x2 = ((XButtonEvent *)&e)->x;( y1 = y2 = ((XButtonEvent *)&e)->y;, chosen = ((XButtonEvent *)&e)->button; if (chosen == Button2) change_cursor = TRUE; }- else if ((e.type == ButtonRelease) &&E ((((XButtonEvent *)&e)->button) == chosen)) {# x2 = ((XButtonEvent *)&e)->x;# y2 = ((XButtonEvent *)&e)->y; stop = TRUE; } else7 XQueryPointer (dpy, RootWindow(dpy, scr), &root, / &subw, &rootx, &rooty, &x2, &y2, &mask); }@ else XQueryPointer (dpy, RootWindow(dpy, scr), &root, 1 &subw, &rootx, &rooty, &x2, &y2, &mask); if (change_cursor) {' if ((x2 >= x1) && (y2 >= y1) && current_cursor != lr) {M XChangeActivePointerGrab (dpy, events, lr, CurrentTime );( current_cursor = lr; }+ else if ((x2 >= x1) && (y2 < y1) && current_cursor != ur) {M XChangeActivePointerGrab (dpy, events, ur, CurrentTime );( current_cursor = ur; }+ else if ((x2 < x1) && (y2 >= y1) && current_cursor != ll) {M XChangeActivePointerGrab (dpy, events, ll, CurrentTime );( current_cursor = ll; }* else if ((x2 < x1) && (y2 < y1) && (current_cursor != ul)) {M XChangeActivePointerGrab (dpy, events, ul, CurrentTime );( current_cursor = ul; } } if (chosen != Button2) { x1 = x2; y1 = y2; if (chosen >= 0) { x2 = defwidth; if (chosen == Button1) y2 = defheight; else( y2 = (DisplayHeight(dpy, scr) - y1); x2 = x1 + x2; y2 = y1 + y2; } } 4 dx = max(min(abs (x2 - x1), maxwidth), minwidth);. dx = makemult(dx-minwidth, xinc)+minwidth; 5 dy = max(min(abs(y2 - y1), maxheight), minheight);0 dy = makemult(dy-minheight, yinc)+minheight;  if (hints->flags & PAspect) {D if ((dx * hints->max_aspect.y > dy * hints->max_aspect.x)) {2 delta = makemult((dx * hints->max_aspect.y /, hints->max_aspect.x) - dy, yinc); $ if ((dy + delta) <= maxheight) dy += delta; else {- delta = makemult(dx - hints->max_aspect.x' * dy/hints->max_aspect.y, xinc);! if ((dx - delta) >= minwidth) dx -= delta; } }B if (dx * hints->min_aspect.y < dy * hints->min_aspect.x) {- delta = makemult((hints->min_aspect.x *. dy/hints->min_aspect.y) - dx, xinc);! if (dx + delta <= maxwidth) dx += delta; else {5 delta = makemult(dy - (dx * hints->min_aspect.y /# hints->min_aspect.x), yinc); " if ((dy - delta) >= minheight) dy -= delta;  } }  }  if (dx != hsize) { hsize = dx; changed = TRUE; } if (dy != vsize) { vsize = dy; changed = TRUE; } if (x2 < x1) x2 = x1 - dx; else x2 = x1 + dx;  if (y2 < y1) y2 = y1 - dy; else y2 = y1 + dy; }& XUngrabPointer(dpy, CurrentTime);  XDestroyWindow (dpy, pop); XFreeCursor (dpy, ur); XFreeCursor (dpy, ul); XFreeCursor (dpy, lr); XFreeCursor (dpy, ll); free(name); free(text); *x = min(x1, x2); *y = min(y1, y2); *width = hsize; *height = vsize; XSync(dpy, FALSE); Leave_void}*[FIELDS.X.AWM]STOREBOX.C;3+,C. /% 4 -C0@123KPWO 56Z2%7J8DPH9fG%HJ #ifndef lintstatic char *rcsid_StoreBox_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/StoreBox.c,v 1.1 89/01/23 15:34:53 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. *//* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group= * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,& Western Software Lab. Convert to X11.) * 002 -- Jordan Hubbard, Ardent Computer( * Additional boxes for titled windows. *//*C * StoreBox - This subroutine is used by the X Window Manager (xwm)H * to store the vertices for the resize / movement box in a vertex list. */#include "awm.h"/*F * Store the vertices for the resize movement box (on a titled window) * in a vertex list. */*int StoreTitleBox(box, ulx, uly, lrx, lry)register XSegment box[];)int ulx; /* Upper left X coordinate. */)int uly; /* Upper left Y coordinate. */*int lrx; /* Lower right X coordinate. */*int lry; /* Lower right Y coordinate. */{ Entry("StoreTitleBox");  /* * Xor in. */ & box[0].x1 = ulx; box[0].y1 = uly;& box[0].x2 = lrx; box[0].y2 = uly;8 box[1].x1 = ulx; box[1].y1 = uly + titleHeight + 2;8 box[1].x2 = lrx; box[1].y2 = uly + titleHeight + 2; & box[2].x1 = lrx; box[2].y1 = uly;& box[2].x2 = lrx; box[2].y2 = lry; & box[3].x1 = lrx; box[3].y1 = lry;& box[3].x2 = ulx; box[3].y2 = lry; & box[4].x1 = ulx; box[4].y1 = lry;& box[4].x2 = ulx; box[4].y2 = uly;  /*9 * If we freeze the screen, don't bother to xor out. */ if (Freeze) Leave(5)  /* * Xor out. */& box[4].x1 = ulx; box[4].y1 = uly;& box[4].x2 = lrx; box[4].y2 = uly; 8 box[5].x1 = ulx; box[5].y1 = uly + titleHeight + 2;8 box[5].x2 = lrx; box[5].y2 = uly + titleHeight + 2; & box[6].x1 = lrx; box[6].y1 = uly;& box[6].x2 = lrx; box[6].y2 = lry; & box[7].x1 = lrx; box[7].y1 = lry;& box[7].x2 = ulx; box[7].y2 = lry; & box[8].x1 = ulx; box[8].y1 = lry;& box[8].x2 = ulx; box[8].y2 = uly;   /*& * Total number of vertices is 9. */ Leave(9)}/*C * Store the vertices for the resize movement box in a vertex list. */%int StoreBox(box, ulx, uly, lrx, lry)register XSegment box[];)int ulx; /* Upper left X coordinate. */)int uly; /* Upper left Y coordinate. */*int lrx; /* Lower right X coordinate. */*int lry; /* Lower right Y coordinate. */{ Entry("StoreBox");  /* * Xor in. */ & box[0].x1 = ulx; box[0].y1 = uly;& box[0].x2 = lrx; box[0].y2 = uly; & box[1].x1 = lrx; box[1].y1 = uly;& box[1].x2 = lrx; box[1].y2 = lry; & box[2].x1 = lrx; box[2].y1 = lry;& box[2].x2 = ulx; box[2].y2 = lry; & box[3].x1 = ulx; box[3].y1 = lry;& box[3].x2 = ulx; box[3].y2 = uly;   /*9 * If we freeze the screen, don't bother to xor out. */ if (Freeze) Leave(4)  /* * Xor out. */& box[4].x1 = ulx; box[4].y1 = uly;& box[4].x2 = lrx; box[4].y2 = uly; & box[5].x1 = lrx; box[5].y1 = uly;& box[5].x2 = lrx; box[5].y2 = lry; & box[6].x1 = lrx; box[6].y1 = lry;& box[6].x2 = ulx; box[6].y2 = lry; & box[7].x1 = ulx; box[7].y1 = lry;& box[7].x2 = ulx; box[7].y2 = uly;   /*& * Total number of vertices is 8. */ Leave(8)}*[FIELDS.X.AWM]STOREZAP.C;3+,C./% 4z-C0@123KPWO 564%7{8@s`PH9fG%HJ #ifndef lintstatic char *rcsid_StoreZap_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/StoreZap.c,v 1.1 89/01/23 15:34:55 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ /* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group= * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,) Western Software Lab. Convert to X11. *//*C * StoreZap - This subroutine is used by the X Window Manager (xwm)8 * to store the vertices for the iconify, uniconify zap. * */#include "awm.h"/*) * Store the vertices for the zap effect. */Iint StoreZap(zap, ulx_1, uly_1, lrx_1, lry_1, ulx_2, uly_2, lrx_2, lry_2) register XSegment zap[];; int ulx_1; /* From window, upper left X coordinate. */; int uly_1; /* From window, upper left Y coordinate. */< int lrx_1; /* From window, lower right X coordinate. */< int lry_1; /* From window, lower right Y coordinate. */9 int ulx_2; /* To window, upper left X coordinate. */9 int uly_2; /* To window, upper left Y coordinate. */: int lrx_2; /* To window, lower right X coordinate. */: int lry_2; /* To window, lower right Y coordinate. */{ Entry("StoreZap") /* * Xor in. */) zap[0].x1 = ulx_1; zap[0].y1 = uly_1;) zap[0].x2 = ulx_2; zap[0].y2 = uly_2;) zap[1].x1 = lrx_1; zap[1].y1 = uly_1;) zap[1].x2 = lrx_2; zap[1].y2 = uly_2;) zap[2].x1 = lrx_1; zap[2].y1 = lry_1;) zap[2].x2 = lrx_2; zap[2].y2 = lry_2;) zap[3].x1 = ulx_1; zap[3].y1 = lry_1;) zap[3].x2 = ulx_2; zap[3].y2 = lry_2; /* * Xor out. */) zap[4].x1 = ulx_1; zap[4].y1 = uly_1;) zap[4].x2 = ulx_2; zap[4].y2 = uly_2;) zap[5].x1 = lrx_1; zap[5].y1 = uly_1;) zap[5].x2 = lrx_2; zap[5].y2 = uly_2;) zap[6].x1 = lrx_1; zap[6].y1 = lry_1;) zap[6].x2 = lrx_2; zap[6].y2 = lry_2;) zap[7].x1 = ulx_1; zap[7].y1 = lry_1;) zap[7].x2 = ulx_2; zap[7].y2 = lry_2; /*% * Total number of vertices is 8. */ Leave(8)}*[FIELDS.X.AWM]SUPPORT.C;4+,C./% 4-C0@123KPWO56 5%7@8~PH9fG%HJ  #ifndef lintstatic char *rcsid_support_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.c,v 1.2 89/02/07 21:25:47 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * * REVISION HISTORY: *H * 1.2 -- Version of strlen() that accepts NULL strings added (#ifdef it * in if your system needs it). */#include "support.h"#include  int _rtn_level;int _rtn_trace;static struct func_stack { char *rtn_name; struct func_stack *next;} *Head;char *curr_rtn(){ if (!Head) return((char *)0); else return(Head->rtn_name);}void push_rtn(s)register char *s;{ if (!Head) {A Head = (struct func_stack *)malloc(sizeof(struct func_stack)); if (!Head) {C fprintf(stderr, "Couldn't malloc new func_stack entry!\n"); exit(1); } Head->rtn_name = s; Head->next = 0; } else { struct func_stack *ptr; A ptr = (struct func_stack *)malloc(sizeof(struct func_stack)); if (!ptr) {C fprintf(stderr, "Couldn't malloc new func_stack entry!\n"); exit(1); } ptr->rtn_name = s; ptr->next = Head; Head = ptr; } _rtn_level++; if (_rtn_trace) { int i; # for (i = 0; i < _rtn_level; i++) putchar('\t');2 printf("%s(%d)\n", Head->rtn_name, _rtn_level); }}void pop_rtn(){ struct func_stack *ptr; if (!Head) return; ptr = Head; Head = Head->next; free(ptr); _rtn_level--;}/*< * Some systems retch when you pass strlen() a NULL pointer.% * Here's a way of getting around it. */"#if defined(hlh) || defined(titan) strlen(s)char *s;{ int count = 0; if (s == 0) return(0); while (*s++) count++; return(count);}#endif /* hlh */*[FIELDS.X.AWM]TITLEBAR.C;4+,WC.(/% 4('-C0D123KPWO(56`Q(7@ 8`PH9fG%HJ #ifndef lintstatic char *rcsid_TitleBar_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Titlebar.c,v 1.2 89/02/07 21:23:59 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//* * MODIFICATION HISTORY *( * 002 -- Jordan Hubbard, U.C. Berkeley. Title bar support routines.? * 1.2 -- Fairly major restructuring to uncouple title bars and * border contexts.@ * 1.3 -- Handling of colors revamped significantly to deal with * different colormaps. */#include "awm.h"#include #include Dunsigned int TB_wide, TB_high, TBB_wide, TBB_high, BC_wide, BC_high; unsigned int BCB_wide, BCB_high;extern XContext AwmContext;#define BLANK_WIDE 16#define BLANK_HIGH 16static char blank_bits[] = {J 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,J 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,3 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};$static Boolean Title_res, Frame_res;void Init_Titles(){# extern XFontStruct *GetFontRes();: TFontInfo = GetFontRes("title.font", DEF_TITLE_FONT);A TFontBoldInfo = GetFontRes("title.boldFont", (char *) NULL);L TBackPixmapData = GetPixmapDataRes("title.pixmap", &TB_wide, &TB_high);F TBoldPixmapData = GetPixmapDataRes("title.boldPixmap", &TBB_wide, &TBB_high);@ TForeground = GetStringRes("title.foreground", Foreground);@ TBackground = GetStringRes("title.background", Background);J TTextForeground = GetStringRes("title.text.foreground", TForeground);J TTextBackground = GetStringRes("title.text.background", TBackground);; TCursor = GetIntRes("title.cursor", DEF_TITLE_CURSOR);1 TTitleHeight = GetIntRes("title.height", 0);6 TitlePad = GetIntRes("title.pad", DEF_TITLE_PAD);4 NameOffset = GetIntRes("windowName.offset", 0);1 titleHeight = TFontInfo->max_bounds.ascent +2 TFontInfo->max_bounds.descent + (TitlePad * 2);H /* we've specified a bold pixmap, but no back pixmap. Use blank. *// if (TBoldPixmapData && !TBackPixmapData) { TBackPixmapData = blank_bits; TB_wide = BLANK_WIDE; TB_high = BLANK_HIGH; } if (TFontBoldInfo) { int foo; + foo = TFontBoldInfo->max_bounds.ascent +; TFontBoldInfo->max_bounds.descent + (TitlePad * 2); if (foo > titleHeight) titleHeight = foo; }$ if (titleHeight < gadgetHeight) titleHeight = gadgetHeight;F if (TTitleHeight) /* Specified height overrides derived height */ titleHeight = TTitleHeight;3 TitleCursor = XCreateFontCursor(dpy, TCursor); if (!TitleCursor) { char temp[80];F sprintf("Init_Titles: Can't get title cursor #%d!\n", TCursor); Error(temp); }F /* Gadgets can't exist without titles, so we'll init them here */9 GadgetPad = GetIntRes("gadget.pad", DEF_GADGET_PAD);B GadgetBorder = GetIntRes("gadget.border", DEF_GADGET_BORDER); Title_res = TRUE;}void Init_Frames(){  Entry("Init_Frames")H BForeground = GetStringRes("borderContext.foreground", Foreground);H BBackground = GetStringRes("borderContext.background", Background);F BCursor = GetIntRes("borderContext.cursor", DEF_BCONTEXT_CURSOR);I BBackPixmapData = GetPixmapDataRes("borderContext.pixmap", &BC_wide, &BC_high);N BBoldPixmapData = GetPixmapDataRes("borderContext.boldPixmap", &BCB_wide, &BCB_high);K /* we've specified a bold BC pixmap, but no back pixmap. Use blank. *// if (BBoldPixmapData && !BBackPixmapData) { BBackPixmapData = blank_bits; BC_wide = BLANK_WIDE; BC_high = BLANK_HIGH; }3 FrameCursor = XCreateFontCursor(dpy, BCursor); if (!FrameCursor) { char temp[80];G sprintf("Init_Frames: Can't get border cursor #%d!\n", BCursor); Error(temp); } Frame_res = TRUE; Leave_void}char *GetTitleName(w) Window w;{ char *cp = 0, *tmp;  Entry("GetTitleName") ) if (!XFetchName(dpy, w, &cp) || !cp) cp = "Untitled Window";* tmp = (char *)malloc(strlen(cp) + 3);  /*7 * We add a space on both ends for asthetic effect5 * (only apparent if we're using inverse video). */ tmp[0] = ' '; strcpy(tmp + 1, cp); strcat(tmp, " "); Leave(tmp)}/*? * Reparent window 'w' into a frame, making the frame the right@ * size to hold any other window related decorations that may beB * added later. If window 'w' already has a frame, then it resizes * it if necessary. */Window Reparent(w) Window w;{ Window foster; XWindowAttributes xwa; XSetWindowAttributes swa; XWMHints *wm_hints; XSizeHints sz_hints; XClassHint class_hints; AwmInfoPtr awi; char *icon_name; int bch, bcv, x, y;$ unsigned int width, height, bw; int clnt_x, clnt_y; unsigned long valuemask; Boolean decorated = FALSE; Colormap cmap; Pixel bfore, bback; Entry("Reparent") awi = GetAwmInfo(w); if (!awi) {A fprintf(stderr, "Reparent: Window %x isn't registered!\n", w); Leave((Window)NULL) }3 if (awi->frame && (awi->state & ST_DECORATED)) Leave((Window)NULL) if (!Frame_res) Init_Frames();- if (awi->attrs & AT_TITLE && !Title_res) Init_Titles(); if (!awi->frame)0 XGetWindowAttributes(dpy, awi->client, &xwa); else/ XGetWindowAttributes(dpy, awi->frame, &xwa);H valuemask = CWEventMask | CWBorderPixel | CWBackPixel | CWColormap;J swa.event_mask = (SubstructureRedirectMask | SubstructureNotifyMask); bw = xwa.border_width; x = xwa.x; y = xwa.y; height = xwa.height; width = xwa.width; cmap = xwa.colormap;) bfore = GetPixel(BForeground, cmap);) bback = GetPixel(BBackground, cmap); clnt_y = clnt_x = 0;" if (awi->attrs & AT_BORDER) { XSetWindowAttributes cswa; ; swa.event_mask |= (ButtonPressMask | ButtonReleaseMask); bcv = BContext + 1; bch = bcv * 2; cswa.do_not_propagate_mask =. (ButtonPressMask | ButtonReleaseMask);E XChangeWindowAttributes(dpy, awi->client, CWDontPropagate, &cswa); } elseWV~AWM.SAVEWCC[FIELDS.X.AWM]TITLEBAR.C;4(2 bch = bcv = 0; if (FrameFocus)9 swa.event_mask |= (LeaveWindowMask | EnterWindowMask);" if (awi->attrs & AT_BORDER) { swa.background_pixel = bfore; swa.border_pixel = bback; decorated = TRUE; }& else if (awi->attrs & AT_TITLE) {6 swa.background_pixel = GetPixel(TBackground, cmap);2 swa.border_pixel = GetPixel(TForeground, cmap); } else {5 swa.background_pixel = GetPixel(Background, cmap);1 swa.border_pixel = GetPixel(Foreground, cmap); } swa.colormap = cmap; if (PushDown == FALSE) { if (awi->attrs & AT_TITLE) y -= (titleHeight + 2);# else if (awi->attrs & AT_BORDER) y -= BContext; }# /* calculate size for frame */ if (awi->attrs & AT_TITLE) height += titleHeight + 2;" if (awi->attrs & AT_BORDER) { if (!(awi->attrs & AT_TITLE)) height += (bcv * 2); else height += bcv; width += bch; } if (awi->attrs & AT_TITLE) clnt_y = titleHeight + 2; c" if (awi->attrs & AT_BORDER) { if (!(awi->attrs & AT_TITLE)) clnt_y = BContext; clnt_x = BContext;  } if (!awi->frame) {/A foster = XCreateWindow(dpy, RootWindow(dpy, scr), x, y, width,r* height, (bw ? bw : (unsigned int) 1), xwa.depth, xwa.class," xwa.visual, valuemask, &swa); if (!foster)*7 Error("Reparent: Can't create foster parent!");  if (awi->attrs & AT_BORDER)0 XDefineCursor(dpy, foster, FrameCursor);# XAddToSaveSet(dpy, awi->client);t1 XSetWindowBorderWidth(dpy, awi->client,t: (unsigned int)((awi->attrs&AT_BORDER) ? 1 : 0));= XReparentWindow(dpy, awi->client, foster, clnt_x, clnt_y); XSync(dpy, FALSE);n= if (BBackPixmapData) { /* we have a border context tile */o1 awi->BC_back = GetPixmapFromCache(foster,t BBackPixmapData,. BC_wide, BC_high, bfore, bback, xwa.depth); if (!awi->BC_back)> Error("Reparent: Can't get pixmap for border context."); else< XSetWindowBackgroundPixmap(dpy, foster, awi->BC_back); }B if (BBoldPixmapData) { /* we have a bold border context tile */1 awi->BC_bold = GetPixmapFromCache(foster,1 BBoldPixmapData,n BCB_wide, BCB_high, bfore, bback, xwa.depth); if (!awi->BC_bold)C Error("Reparent: Can't get bold pixmap for border context.");N } awi->frame = foster;i awi->border_width = bw;) awi->name = GetTitleName(awi->client);,@ /* Make titlebar "frame" inherit characteristics of victim */& XStoreName(dpy, foster, awi->name);* if (XGetIconName(dpy, w, &icon_name)) {- XSetIconName(dpy, foster, icon_name);l XFree(icon_name);u }2 if (wm_hints = XGetWMHints(dpy, awi->client)) {+ XSetWMHints(dpy, foster, wm_hints);G XFree(wm_hints); }0 XGetNormalHints(dpy, awi->client, &sz_hints);+ XSetNormalHints(dpy, foster, &sz_hints); . XGetZoomHints(dpy, awi->client, &sz_hints);) XSetZoomHints(dpy, foster, &sz_hints);T? class_hints.res_name = class_hints.res_class = (char *)NULL;TB if (XGetClassHint(dpy, awi->client, &class_hints) == Success) {: if (class_hints.res_name || class_hints.res_class)/ XSetClassHint(dpy, foster, &class_hints);e }8 XSaveContext(dpy, foster, AwmContext, (caddr_t) awi); } else {EC XMoveResizeWindow(dpy, awi->frame, xwa.x, xwa.y, width, height); 1 XMoveWindow(dpy, awi->client, clnt_x, clnt_y); if (awi->attrs & AT_BORDER) decorated = TRUE;t foster = awi->frame;a }#ifdef RAINBOW if (BorderHilite)* SetBorderPixmaps(awi, awi->grayPixmap);#endif if (decorated)k awi->state |= ST_DECORATED; Leave(foster)}a pvoid AddTitle(w) Window w;={a int bch;_ Window title; AwmInfoPtr awi; unsigned long valuemask;n XWindowAttributes xwa;  XSetWindowAttributes swa; XWindowChanges wc;B Pixel tfore, tback; Entry("AddTitle") awi = GetAwmInfo(w);  if (!awi) {B fprintf(stderr, "AddTitle: Window %x is not registered!\n", w); Leave_void  } if (!awi->frame) Leave_voids if (awi->title) Leave_voidT" if (!(awi->attrs & AT_TITLE)) Leave_voidd2 XGetWindowAttributes(dpy, awi->client, &xwa);K swa.event_mask = (ExposureMask | ButtonPressMask | ButtonReleaseMask);s! swa.colormap = xwa.colormap;1 tfore = GetPixel(TForeground, xwa.colormap);l1 tback = GetPixel(TBackground, xwa.colormap);g" swa.background_pixel = tback; swa.border_pixel = tfore;J valuemask = (CWEventMask | CWColormap | CWBackPixel | CWBorderPixel); if (awi->attrs & AT_BORDER) bch = (BContext * 2) + 2; elsee bch = 0;eH title = XCreateWindow(dpy, awi->frame, 0, 0, (xwa.width - 2) + bch, titleHeight,* 1, xwa.depth, xwa.class, xwa.visual, valuemask, &swa);T if (!title). Error("AddTitle: Can't create title bar!"); if (TBackPixmapData) { 9 awi->back = GetPixmapFromCache(title, TBackPixmapData,e TB_wide, TB_high,B tfore, tback,h xwa.depth);p if (!awi->back)D Error("AddTitle: Can't create pixmap for title background"); elsem: XSetWindowBackgroundPixmap(dpy, title, awi->back); } if (TBoldPixmapData) {9 awi->bold = GetPixmapFromCache(title, TBoldPixmapData, TBB_wide, TBB_high, tfore, tback, xwa.depth);n if (!awi->bold)C Error("AddTitle: Can't create pixmap for bold background");  } wc.sibling = awi->client; wc.stack_mode = Above;i> XConfigureWindow(dpy, title, CWSibling|CWStackMode, &wc);, XDefineCursor(dpy, title, TitleCursor);? XSelectInput(dpy, title, (ExposureMask | ButtonPressMask |l ButtonReleaseMask));  XMapWindow(dpy, title); awi->title = title; awi->state |= ST_DECORATED;9 XSaveContext(dpy, title, AwmContext, (caddr_t) awi);;} /*ARGSUSED*/*Boolean FNoDecorate(w, mask, button, x, y) Window w;int mask, button, x, y;'{i Entry("FNoDecorate")m # if (w == RootWindow(dpy, scr))d Leave(FALSE)t NoDecorate(w, FALSE); Leave(TRUE)}lvoid NoDecorate(w, destroy)z Window w;fBoolean destroy;{i XWindowAttributes xwa; AwmInfoPtr awi;" extern void DestroyGadgets(); Entry("NoDecorate") awi = GetAwmInfo(w);  if (!awi || !awi->frame)X Leave_void& if (!(awi->state & ST_DECORATED)) Leave_void if (awi->gadgets) DestroyGadgets(w);t if (awi->title) {/ XDeleteContext(dpy, awi->title, AwmContext); if (awi->back)t' FreePixmapFromCache(awi->back);P if (awi->bold)' FreePixmapFromCache(awi->bold);t# XDestroyWindow(dpy, awi->title);r7 awi->title = awi->back = awi->bold = (Drawable)NULL;) } if (destroy) { / XDeleteContext(dpy, awi->frame, AwmContext);O if (awi->BC_back)* FreePixmapFromCache(awi->BC_back); if (awi->BC_bold)* FreePixmapFromCache(awi->BC_bold); free(awi->name);  awi->name = (char *)NULL;# XDestroyWindow(dpy, awi->frame);;= awi->frame = awi->BC_back = awi->BC_bold = (Drawable)NULL; } else {e0 XGetWindowAttributes(dpy, awi->client, &xwa);; XResizeWindow(dpy, awi->frame, (unsigned int) xwa.width,u (unsigned int) xwa.height);' XMoveWindow(dpy, awi->client, 0, 0);x awi->state ^= ST_DECORATED; } XSync(dpy, FALSE);  Leave_voidm} /*ARGSUSED*/-Boolean FDecorate(window, mask, button, x, y)iWindow window; int mask; int button;l int x, y;{  Window fr;  Entry("FDecorate")A( if (window == RootWindow(dpy, scr)) Leave(FALSE)s fr = Decorate(window); if (fr) XMapWindow(dpy, fr);v XSync(dpy, FALSE);p Leave(FALSE) } Window Decorate(w) Window w;e{k Window ret; Entry("Decorate") ret = Reparent(w);) if (ret) {e AddTitle(ret);  PutGadgets(ret);F } Leave(ret)m} /*ARGSUSED*/void PaintTitle(w, reversed) Window w;tBoolean reversed;{s int x, y; XWindowAttributes xwa;i XFontStruct *f_info;= AwmInfoPtr awi; XGCValues gcv;A Colormap cmap;c Entry("PaintTitle") if (!(awi = IsTitled(w))) Leave_void1 XGetWindowAttributes(dpy, awi->title, &xwa);b cmap = xwa.colormap;B# if (reversed && TFontBoldInfo)e f_info = TFontBoldInfo; else} f_info = TFontInfo; gcv.font = f_info->fid;4 gcv.foreground = (reversed && !TFontBoldInfo) ?E GetPixel(TTextBackground, cmap) : GetPixel(TTextForeground, cmap);B4 gcv.background = (reversed && !TFontBoldInfo) ?E GetPixel(TTextForeground, cmap) : GetPixel(TTextBackground, cmap); N XChangeGC(dpy, awi->winGC, (GCFont | GCForeground | GCBackground), &gcv);# XClearWindow(dpy, awi->title);g. if (ShowName) { /* print window names? */ int textlen;T> textlen = XTextWidth(f_info, awi->name, strlen(awi->name)); if (!NameOffset)a& x = (xwa.width - textlen) / 2; else { if (NameOffset < 0)}- x = (xwa.width - textlen) + NameOffset;t else x = NameOffset; $ if (x + textlen > xwa.width)$ x = (xwa.width - textlen) + 1; }0 y = (xwa.height + f_info->max_bounds.ascent -( f_info->max_bounds.descent) / 2;A XDrawImageString(dpy, awi->title, awi->winGC, x, y, awi->name,n strlen(awi->name));u } Leave_voidt}yAwmInfoPtr IsTitled(w) Window w;w{d AwmInfoPtr tmp; Entry("IsTitled") if (tmp = GetAwmInfo(w))  if (tmp->title) Leave(tmp) Leave((AwmInfoPtr)NULL)}X/*C * These routines deal with a sort of "pixmap cache" that is needed H * to minimize the number of pixmaps created by awm. Awm operates on theF * assumption that the user may have an arbitrary number of windows atD * arbitrary depths. Since awm likes to create resources at the sameI * depth as the client window, some sort of mechanism is needed to insurem' * that as few are created as possible.i */ostruct _resInfo {  struct _resInfo *next;l Drawable res; _ char *res_data; Pixel res_fore, res_back; int res_depth;d int ref_count;b } *CacheHead; struct _resInfo *allocResNode()>{b struct _resInfo *ptr; Entry("allocResNode")> ptr = (struct _resInfo *)malloc(sizeof(struct _resInfo)); if (!ptr)5 fprintf(stderr, "allocResNode: Out of memory!\n");t Leave(ptr)e} /*B * Look for pixmap in cache and returns it or allocate new pixmap,# * store it in cache and return it.{ */ CDrawable GetPixmapFromCache(d, data, wide, high, fore, back, depth)u Drawable d; char *data;Gunsigned int wide, high;Pixel fore, back;M int depth;{e" struct _resInfo *cptr, *iptr; cptr = iptr = CacheHead;y while (cptr) {n if (cptr->res_depth > depth)t break;" if (cptr->res_depth == depth) {" if (cptr->res_data > data) break;* else if (cptr->res_data == data) {= if (cptr->res_fore == fore && cptr->res_back == back) {i cptr->ref_count++; Leave(cptr->res) }t }| } iptr = cptr;) cptr = cptr->next;p }0 /* fell through, create another resource */B if (!iptr || cptr == CacheHead) /* need to initialize list */% CacheHead = iptr = allocResNode(); else {) iptr->next = allocResNode();n iptr = iptr->next;  } iptr->next = cptr;  iptr->res_depth = depth;e iptr->res_data = data;d iptr->res_fore = fore;l iptr->res_back = back;,F iptr->res = XCreatePixmapFromBitmapData(dpy, d, data, wide, high,, fore, back, (unsigned int) depth); iptr->ref_count = 1;a Leave(iptr->res)W}o/*? * Free pixmap (and associated cache cell) if no longer needed.i */tvoid FreePixmapFromCache(pix)A Pixmap pix;;{ struct _resInfo *ptr, *tmp; ptr = tmp = CacheHead;d while (ptr) { if (ptr->res == pix)  break; tmp = ptr;, ptr = ptr->next;  } if (!ptr) Leave_voidi0 if (--ptr->ref_count == 0) { /* last ref */ if (ptr == CacheHead)$ CacheHead = CacheHead->next; else) tmp->next = ptr->next; XFreePixmap(dpy, ptr->res); free(ptr);a }} (ExposureMask | ButtonPressMask | ButtonReleaseMask);s! swa.colormap = xwa.colormap;1 tfore = GetPixel(TForeground,*[FIELDS.X.AWM]XERROR.C;3+,C./% 4-C0@123KPWO56H9%7`$h8x׸PH9fG%HJ  #ifndef lintstatic char *rcsid_XError_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/XError.c,v 1.2 89/02/07 21:24:08 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ /* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group */#include "awm.h" /*ARGSUSED*/XError(dpy, rep) Display *dpy;XErrorEvent *rep;{ #ifdef DEBUG char buffer[BUFSIZ];8 XGetErrorText(dpy, rep->error_code, buffer, BUFSIZ);G fprintf(stderr, "awm: X error occurred during a awm operation.\n");8 fprintf(stderr, " Description: '%s'\n", buffer);B fprintf(stderr, " Request code: %d\n", rep->request_code);> fprintf(stderr, " Request function: %d\n", rep->func);? fprintf(stderr, " Request window 0x%x\n", rep->window);< fprintf(stderr, " Error Serial #%d\n", rep->serial);? fprintf(stderr, " Current serial #%d\n", dpy->request);#endif}=Ac~AWM.SAVENC[FIELDS.X.AWM]AWM.H;84{.?*[FIELDS.X.AWM]AWM.H;8+,N../% 4{..-C0D123KPWO/56 3K7`}8 @09fG%HJ\ #ifndef lint{static char *rcsid_awm_h = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */  /* * MODIFICATION HISTORY *2 * 000 -- M. Gancarz, DEC Ultrix Engineering Group2 * 001 -- R. Kittell, DEC Storage A/D May 19, 1986' * Added global vars for warp options.= * 002 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,% * Western Software Lab, Port to X11) * 003 -- Jordan Hubbard, Ardent Computer) * Many additional declarations for awm., * 1.3 -- Support for WM_STATE (Mike Wexler) */ #ifndef AWM_INCLUDE#define AWM_INCLUDE #ifdef VMS$#define SYSFILE "x_root:[awm]awm.rc"#include #endif#include #include #include #include #include "menus/rtlmenu.h"#include "support.h" *#define MIN(x, y) ((x) <= (y) ? (x) : (y))*#define MAX(x, y) ((x) >= (y) ? (x) : (y))&#define VOLUME_PERCENTAGE(x) ((x)*14) #define ModMask 0xFF7#define ButtonMask(b) (((b)==Button1) ? Button1Mask : \2 (((b)==Button2) ? Button2Mask : Button3Mask))#define DEF_DELTA 1#define DEF_FUNC GXcopy #define DEF_ICON_BORDER_WIDTH 2#define DEF_ICON_PAD 4#define DEF_POP_BORDER_WIDTH 2#define DEF_POP_PAD 4 #define DEF_MENU_BORDER_WIDTH 2#define DEF_MENU_PAD 4#define DEF_GADGET_PAD 3#define DEF_GADGET_BORDER 1#define DEF_TITLE_PAD 2#define DEF_VOLUME 4#define DEF_PUSH 5#define DEF_BCONTEXT_WIDTH 0/#define DEF_RAISE_DELAY 100 /* milliseconds */>#define DEF_MAX_COLORS 0 /* 0 means take as many as we can */#ifndef DEF_BCONTEXT_CURSOR##define DEF_BCONTEXT_CURSOR XC_plus#endif DEF_BCONTEXT_CURSOR#ifndef DEF_TITLE_CURSOR$#define DEF_TITLE_CURSOR XC_left_ptr#endif DEF_TITLE_CURSOR #ifndef NAME#define NAME "awm" #endif NAME #ifndef CLASS#define CLASS "Wm" #endif CLASS#ifndef DEF_FONT#define DEF_FONT "fixed"#endif DEF_FONT#ifndef DEF_TITLE_FONT#define DEF_TITLE_FONT "8x13"#endif DEF_TITLE_FONT#ifndef DEF_ICON_FONT#define DEF_ICON_FONT "8x13"#endif DEF_ICON_FONT#ifndef DEF_POPUP_FONT#define DEF_POPUP_FONT "9x15"#endif DEF_POPUP_FONT#ifndef DEF_GADGET_FONT #define DEF_GADGET_FONT "fixed"#endif DEF_GADGET_FONT#ifndef DEF_MENU_FONT#define DEF_MENU_FONT "8x13"#endif DEF_MENU_FONT#ifndef DEF_BOLD_FONT!#define DEF_BOLD_FONT "8x13bold"#endif DEF_BOLD_FONT#define DEF_MENU_DELTA 20#ifndef DEF_NAME6#define DEF_NAME "NoName" /* for clients w/no name */#endif7#define INIT_PTEXT {'0', '0', '0', 'x', '0', '0', '0'}#ifndef TEMPFILE #ifdef VMS&#define TEMPFILE "sys$tmp:awm.XXXXXX"#else##define TEMPFILE "/tmp/awm.XXXXXX"#endif#endif TEMPFILE#define CURSOR_WIDTH 16#define CURSOR_HEIGHT 16 #define MAX_ZAP_VECTORS 8#define MAX_BOX_VECTORS 20 6#define DRAW_WIDTH 0 /* use fastest hardware draw */#define DRAW_VALUE 0xfd#define DRAW_FUNC GXxor#define DRAW_PLANES 1#define NOCOLOR -1/*K * The first BITS_USED bits of the mask are used to define the most genericE * types. All other bits are free for storing peripheral information.F * For now, we use the extra bits to specify which gadget(s) are boundJ * to an action. MAX_GADGETS depends on BITS_USED to determine the maximumH * number of gadgets possible. If you add a new context type, be sure to * increment BITS_USED. */#define ROOT 0x1#define WINDOW 0x2#define ICON 0x4#define TITLE 0x8#define BORDER 0x10#define GADGET 0x20#define BITS_USED 6/* Window states */#define ST_WINDOW 0x1#define ST_ICON 0x2#define ST_PLACED 0x4#define ST_DECORATED 0x85#define DECORATED(a) (a && (a->state & ST_DECORATED))/* Window attributes */#define AT_NONE 0x0#define AT_TITLE 0x1#define AT_GADGETS 0x2#define AT_RAISE 0x4#define AT_BORDER 0x8#define AT_INPUT 0x10#define AT_ICONLABEL 0x20/*H * Gadgets aren't the sort of embellishments that one uses in quantitityN * (unless one is designing a truly odd interface), so we keep the informationO * in an array instead of using the usual linked list. MAX_GADGETS is a derivedB * macro (see BITS_USED) that is used to determine the size of the * Array. * */4#define MAX_GADGETS ((sizeof(int) * 8) - BITS_USED)#ifndef FAILURE#define FAILURE 0#endif FAILURE8#define NAME_LEN 256L /* Maximum length string names */8#define EVENTMASK (ButtonPressMask | ButtonReleaseMask)Q#define DrawBox() XDrawSegments(dpy, RootWindow(dpy, scr),DrawGC,box,num_vectors)Q#define DrawZap() XDrawSegments(dpy, RootWindow(dpy, scr),DrawGC,zap,num_vectors)#define gray_width 16#define gray_height 16extern char gray_bits[];#define solid_width 16#define solid_height 16extern char solid_bits[]; #define xlogo32_width 32#define xlogo32_height 32extern char xlogo32_bits[];/*B * All one needs to know about an awm managed window.. (so far...) */#ifdef WMSTATE#define WithdrawState 0#define NormalState 1#define IconicState 3typedef struct { int state; Window icon; } WM_STATE;extern Atom wm_state_atom;#endif /* WMSTATE */typedef struct _awminfo {@ Window title, client, frame, icon; /* Associated windows */0 Window *gadgets; /* associated gadgets */2 char *name; /* The formatted window name */4 Boolean own; /* Do we own the icon window? */G Pixmap back, bold, iconPixmap; /* background, bold and icon pix */= Pixmap BC_back, BC_bold; /* BC back and bold pixmaps */#ifdef RAINBOW5 /* Per window versions of the globals colours */$ Pixmap grayPixmap, solidPixmap; Pixmap iBackPixmap; Pixel foreColor, backColor; Pixel iBorder;$ Pixel iBackground, iForeground;, Pixel iTextForeground, iTextBackground;#endif< unsigned int border_width; /* original border width */0 int state; /* The state of the window */, int attrs; /* Window "attributes" */5 GC winGC; /* GC at proper depth for window */#ifdef WMSTATE WM_STATE wm_state;#endif /* WMSTATE */} AwmInfo, *AwmInfoPtr;/*I * This whole section has changed substantially. Basically, since all theG * variables have vanished into the resource manager, the keyword tablerF * only needs to keep track of function pointers, boolean pointers andG * "special" keywords like menu and gagdet. Since some things are stillAM * modifiable from menus (only booleans, currently, though this will change),b1 * we keep these in the keyword table even though 7 * they're no longer directly modifable from the .awmrct */e/* * Keyword table entry.m */itypedef struct _keyword {o char *name; int type; Boolean *bptr;c Boolean (*fptr)(); } Keyword;/* * Keyword table type entry. */n#define IsFunction 1#define IsMenuMap 2o#define IsMenu 3,#define IsDownFunction 4#define IsParser 5#define IsQuitFunction 6#define IsGadget 7#define IsBoolean 8#define IsAction 9/* * Button/key binding type.p */ctypedef struct _binding {s struct _binding *next; int context; unsigned int mask; int button;a Boolean (*func)(); char *menuname;l RTLMenu menu;* } Binding; /* * Key expression type.t */etypedef struct _keyexpr {d char *name;a int mask;w } KeyExpr; e/* * Context expression type.t */otypedef struct _contexpr { char *name;t int mask;h } ContExpr;n/* * Button modifier type. */a typedef struct _buttonmodifier { char *name;e int mask;i} ButtonModifier;i/* * Gravity expression type.b */ytypedef struct _gravityexpr {  char *name; int mask;} GravityExpr;/*$ * Button modifier mask definitions.7 * bits 13 and 14 unused in key masks, according to X.hA/ * steal bit 15, since we don't use AnyModifierE */N#define DeltaMotion (1<<13) #define ButtonUp (1<<14)#define ButtonDown AnyModifier2#define ButtonMods DeltaMotion+ButtonUp+ButtonDown/* A) * Button and mask redefinitions, for X11C */C#define LeftMask Button1Mask #define MiddleMask Button2Mask #define RightMask Button3Mask#define LeftButton Button1#define MiddleButton Button2#define RightButton Button3-/*I * Declaration specific information for gadgets. This defines only gadget L * types, not the actual gadgets. The pixmap member is only used if a pixmap> * is being displayed. Gravity and offset are purely optional. */o#define NoGadgetGravity 0#define LeftGadgetGravity 1 #define RightGadgetGravity 2#define CenterGadgetGravity 3 Ctypedef struct _gadgetdecl { /* Declaration (type) information */LE unsigned char *name; /* Either text label or pixmap file name */_H unsigned char *data; /* If pixmap file, this is the data from it */8 char *forecolor; /* foreground color for pixmap */8 char *backcolor; /* background color for pixmap *// XFontStruct *fontInfo; /* font for text */y> int high, wide; /* width and height of pixmap or text */4 int gravity; /* stick to the left or right? */1 int offset; /* offset from previous item */k } GadgetDecl;)/* * MenuInfo data type. */Etypedef struct _menuinfo {* char *name; /* Name of this menu. */7 char *pixmapname; /* Name of label pixmap (opt) */ 4 RTLMenu menu; /* RTL menu handle for destroy */> struct _actionline *line; /* Linked list of menu items. */ } MenuInfo;E I/* * Action Line data type.  */dtypedef struct _actionline {9 struct _actionline *next; /* Pointer to next line. */c* char *name; /* Name of this line. */= char *pixmapname; /* Name of the backing pixmap (opt) */f9 int type; /* IsShellCommand, IsText, IsTextNL... */R, RTLMenuItem item; /* RTL item handle */5 char *text; /* Text string to be acted upon. */AD Boolean (*func)(); /* Window manager function to be invoked. */ } ActionLine;C S/* * ActionLine->type definitions. */d#define IsShellCommand 1e#define IsText 2#define IsTextNL 3 #define IsUwmFunction 4#define IsMenuFunction 5A#define IsImmFunction 6 /* Immediate (context-less) function. */_8#define IsVar 7 /* we're setting a boolean variable */ F/*G * Menu Link data type. Used by the parser when creating a linked listG * of menus. n */Etypedef struct _menulink {; struct _menulink *next; /* Pointer to next MenuLink. */C struct _menuinfo *menu; /* Pointer to the menu in this link. */E } MenuLink; /*! * External variable definitions.N */"extern int errno;o:extern Window Pop; /* Pop-up dimension display window. */Dextern Window Frozen; /* Contains window id of "gridded" window. */@extern XFontStruct *IFontInfo; /* Icon text font information. */Bextern XFontStruct *PFontInfo; /* Pop-up text font information. */Aextern XFontStruct *TFontInfo; /* Title text font information. */RKextern XFontStruct *TFontBoldInfo;/* Title text (bold) font information. */R9extern XFontStruct *GFontInfo; /* Gadget box text font */E.extern XFontStruct *MFontInfo; /* Menu font */6extern XFontStruct *MBoldFontInfo;/* Menu bold font */,extern Pixmap GrayPixmap; /* Gray pixmap. */extern Pixmap SolidPixmap;?extern Pixmap IBackPixmap; /* Icon window background pixmap. */(?extern Pixmap IDefPixmap; /* Icon pixmap for twm style icons */oHextern char *BForeground; /* Border Context (pixmap) foreground pixel */Hextern char *BBackground; /* Border Context (pixmap) background pixel */0extern char *WBorder; /* Window border pixel */?extern char *TTextForeground; /* Title text foreground pixel */?extern char *TTextBackground; /* Title text background pixel */x?extern char *TForeground; /* Title (pixmap) foreground pixel */R?extern char *TBackground; /* Title (pixmap) background pixel */=extern char *Foreground; /* default forground color (text) */T>extern char *Background; /* default background color (text) */6extern Pixel IBorder; /* Icon window border pixel. */Eextern Pixel ITextForeground; /* Icon window text forground color. */ Fextern Pixel ITextBackground; /* Icon window text background color. */<extern Pixel IForeground; /* Icon pixmap foreground color */<extern Pixel IBackground; /* Icon pixmap background color */>extern Pixel PForeground; /* Pop-up window forground color. */?extern Pixel PBackground; /* Pop-up window background color. */8extern Pixel PBorder; /* Pop-Up Window border pixel. */7extern Pixel ForeColor; /* default foreground color */7extern Pixel BackColor; /* default background color */.extern Pixel MBorder; /* Menu border color */5extern Pixel MForeground; /* Menu foreground color */(5extern Pixel MBackground; /* Menu background color */m9extern Cursor ArrowCrossCursor; /* Arrow cross cursor. */6Aextern Cursor TextCursor; /* Text cursor used in icon windows. */_,extern Cursor IconCursor; /* Icon Cursor. */>extern Cursor LeftButtonCursor; /* Left button main cursor. */Aextern Cursor MiddleButtonCursor;/* Middle button main cursor. */e?extern Cursor RightButtonCursor;/* Right button main cursor. */tBextern Cursor TargetCursor; /* Target (select-a-window) cursor. */1extern Cursor TitleCursor; /* Title bar cursor */-extern Cursor FrameCursor; /* Frame cursor *//?extern Cursor GumbyCursor; /* Used in icons if not type-in */e?extern unsigned int GadgetBorder; /* Width of gadget borders */c4extern int ScreenWidth; /* Display screen width. */5extern int ScreenHeight; /* Display screen height. */o@extern int TTitleHeight; /* Height in pixels of title bar(s) */=extern int titleHeight; /* Derived height of title bar(s) */ 7extern int gadgetHeight; /* Height of highest gadget */v4extern int NameOffset; /* Offset for window name */8extern int IBorderWidth; /* Icon window border width. */Bextern int PWidth; /* Pop-up window width (including borders). */Dextern int PHeight; /* Pop-up window height (including borders). */Cextern unsigned int PBorderWidth; /* Pop-up window border width. */s2extern int PPadding; /* Pop-up window padding. */-extern int Delta; /* Mouse movement slop. */;4extern int HIconPad; /* Icon horizontal padding. */2extern int VIconPad; /* Icon vertical padding. */>extern int Pushval; /* Number of pixels to push window by. */Bextern int BContext; /* Width of border context area in pixels */Nextern int RaiseDelay; /* Delay in milliseconds before autoraising windows *//extern int Volume; /* Audible alarm volume. */c4extern int NumGadgets; /* Number of gadgets used */4extern int GadgetPad; /* Padding between gadgets */.extern int TitlePad; /* Title text padding */0extern int status; /* Routine return status. */$extern int MPad; /* menu padding */,extern int MDelta; /* Menu subitem delta */0extern int MBorderWidth; /* Menu border width */5extern int MItemBorder; /* Menu item border width */n8extern unsigned int BCursor; /* Border context cursor */7extern unsigned int TCursor; /* Title context cursor */f4extern MenuLink *Menus; /* Linked list of menus. */3extern GC IconGC; /* graphics context for icon */1extern GC PopGC; /* graphics context for pop */B2extern GC DrawGC; /* graphics context for zap */<extern Boolean Autoraise; /* Raise window on input focus? */Fextern Boolean Autoselect; /* Warp mouse to default menu selection? */<extern Boolean Borders; /* Display border context areas? */Nextern Boolean ConstrainResize; /* Don't resize until pointer leaves window */?extern Boolean Freeze; /* Freeze server during move/resize? */uEextern Boolean Grid; /* Should the m/r box contain a 9 seg. grid. */*Bextern Boolean Hilite; /* Should we highlight titles on focus? */Hextern Boolean BorderHilite; /* Should we highlight borders on focus? */Jextern Boolean FrameFocus; /* Should frame be considered part of window */:extern Boolean ShowName; /* Display names in title bars */1extern Boolean NWindow; /* Normalize windows? */r-extern Boolean NIcon; /* Normalize icons? */sEextern Boolean RootResizeBox; /* Should resize box obscure window? */(Cextern Boolean InstallColormap; /* Install colormap for clients? */n:extern Boolean Push; /* Relative=TRUE, Absolute=FALSE. */Cextern Boolean ResizeRelative; /* Relative=TRUE, Absolute=FALSE. */k-extern Boolean Reverse; /* Reverse video? */,extern Boolean SaveUnder; /* Save unders? */Nextern Boolean Snatched; /* We're in the middle of an no-highlight/raise op */4extern Boolean Titles; /* Title bars on windows? */Dextern Boolean IconLabels; /* Labels on pixmap icons? (twm style) */2extern Boolean ILabelTop; /* label top of icon? */2extern Boolean PushDown; /* Down=TRUE, Up=FALSE */<extern Boolean UseGadgets; /* Gadget boxes in title bars? */Dextern Boolean Wall; /* Don't allow windows past edges of screen */Fextern Boolean WarpOnRaise; /* Warp to upper right corner on raise. */Eextern Boolean WarpOnIconify; /* Warp to icon center on iconify. */tOextern Boolean WarpOnDeIconify; /* Warp to upper right corner on de-iconify. */ =extern Boolean Zap; /* Should the the zap effect be used. */ <extern Boolean FocusSetByUser; /* True if f.focus called */<extern Boolean FocusSetByWM; /* True if awm set the focus */ y5extern char PText[]; /* Pop-up window dummy text. */ ;extern int PTextSize; /* Pop-up window dummy text size. */n0extern int Lineno; /* Line count for parser. */Aextern Boolean Startup_File_Error; /* Startup file error flag. *//4extern char Startup_File[]; /* Startup file name. */.extern char *IFontName; /* Icon font name. */0extern char *PFontName; /* Pop-up font name. *//extern char *TFontName; /* Title font name. *//extern char *GFontName; /* Gadget font name */c7extern char *TFontBoldName; /* Bold Title font name. */aCextern char *TBoldPixmapName; /* Title (highlighted) pixmap file */ Eextern char *TBackPixmapData; /* Bitmap data file title background */T=extern char *TBoldPixmapData; /* ditto, except highlighted */ Nextern char *BBackPixmapData; /* Border Context area background pixmap data */Cextern char *BBoldPixmapData; /* Border Context bold pixmap data */A6extern char *awmPath; /* Pathlist for pixmap files */>extern char **Argv; /* Pointer to command line parameters. */6extern char **EEnviron; /* Pointer to environment. */ oDextern char *DefaultBindings[]; /* Default bindings string array. */:extern Keyword KeywordTable[]; /* Keyword lookup table. */7extern Binding *Blist; /* Button/key bindings list. */8extern KeyExpr KeyExprTbl[]; /* Key expression table. */>extern ContExpr ContExprTbl[]; /* Context expression table. */?extern ButtonModifier ButtModTbl[];/* Button modifier table. */uDextern GravityExpr GravityExprTbl[]; /* Gravity expression table. */?extern GadgetDecl **Gadgets; /* Gadgets declared. See gram.y */xextern int scr;n1extern Display *dpy; /* Display info pointer. */x n #ifdef PROFILF int ptrap();#endif t/* * External routine typing.u */Fextern Boolean Beep();extern Boolean CircleDown();extern Boolean CircleUp();extern Boolean Continue();extern Boolean Focus();Fextern Boolean UnFocus();bextern Boolean GetButton();xextern Boolean Iconify();;extern Boolean Lower();*extern Boolean DoMenu();extern Boolean DoAction();extern Boolean Lock();extern Boolean Move();extern Boolean MoveOpaque();extern Boolean Neaten();extern Boolean NewIconify();extern Boolean awm_Pause();wextern Boolean ShoveDown();extern Boolean ShoveLeft();Iextern Boolean ShoveRight();extern Boolean ShoveUp();uextern Boolean Quit();extern Boolean awm_Raise();xextern Boolean Redraw();extern Boolean Refresh();cextern Boolean ResetBindings();oextern Boolean ResetMenus();extern Boolean ResetGadgets();extern Boolean Resize();extern Boolean Restart();eextern Boolean FDecorate();aextern Boolean FNoDecorate(); extern Boolean DestroyClient();oextern Boolean GetBoolRes();!extern Boolean ConfigureWindow();aextern int StoreCursors();extern int StoreBox();extern int StoreTitleBox();Textern int StoreGridBox();extern int StoreTitleGridBox(); extern int StoreZap();extern int Error();dextern int XError();extern int GetIntRes();I%extern Window Reparent(), Decorate();x)extern unsigned char *expand_metachars();textern char *stash();/extern char *GetIconName();* extern char *expand_from_path();extern char *GetStringRes(); extern char *GetPixmapDataRes();extern Pixmap GetPixmapRes();uextern Pixel GetColorRes();extern Pixel GetPixel();!extern XFontStruct *GetFontRes();*%extern Drawable GetPixmapFromCache();nextern AwmInfoPtr GetAwmInfo();l#extern AwmInfoPtr RegisterWindow();lextern AwmInfoPtr IsTitled(); extern AwmInfoPtr IsGadgetWin();)extern void Init_Titles(), Init_Frames();/extern void NoDecorate(); extern void PaintTitle();(extern void SetBorderPixmaps();n"extern void FreePixmapFromCache(); #ifdef NEATENr#define DEFAULT_ABS_MIN 64#define SEPARATION 2r##define DEF_PRIMARY_PLACEMENT "Top".&#define DEF_SECONDARY_PLACEMENT "Left"extern int AbsMinWidth;eextern int AbsMinHeight;extern Boolean RetainSize;extern Boolean KeepOpen;extern Boolean Fill;extern Boolean UsePriorities;hextern Boolean FixTopOfStack;a"extern char *PrimaryIconPlacement;$extern char *SecondaryIconPlacement; #endif NEATENn#endif AWM_INCLUDE* Title bar cursor */-extern Cursor FrameCursor; /* Frame cursor *//?extern Cursor GumbyCursor; /* Used*[FIELDS.X.AWM]PATCHLEVEL.H;1+,C./% 4-C0@123KPWO56\78@P09fG%HJ#define PATCHLEVEL 9*[FIELDS.X.AWM]SUPPORT.H;2+,D./% 4@-C0D123KPWO56hV&7` 8`޸09fG%HJ #ifndef lintstatic char *rcsid_support_h = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $"; #endif lint#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * */#undef STACK_RTNAMES #undef TRACE #ifdef TRACEE#define Entry(woo) { printf("Pushing to %s\n", woo); push_rtn(woo); }`#define Leave(woo) { printf("Pop from %s with %x\n", curr_rtn(), woo); pop_rtn(); return(woo); }U#define Leave_void { printf("Pop from %s (void)\n", curr_rtn()); pop_rtn(); return; } #define Trace_on _rtn_trace = 1;!#define Trace_off _rtn_trace = 0;extern char *curr_rtn();extern int _rtn_level;extern int _rtn_trace;#else#ifdef SAVERTNAME!#define Entry(woo) push_rtn(woo);.#define Leave(woo) { pop_rtn(); return(woo); })#define Leave_void { pop_rtn(); return; } #define Trace_on _rtn_trace = 1;!#define Trace_off _rtn_trace = 0;extern char *curr_rtn();extern int _rtn_level;extern int _rtn_trace;#else#define Entry(s)#define Leave(s) return(s);#define Leave_void return;#define Trace_on#define Trace_off#define Curr_rtn()#endif /* SAVERTNAME */#endif /* TRACE */*[FIELDS.X.AWM]Y_TAB.H;1+,@1./% 4-C0@123KPWO56@2&78@09fG%HJtypedef union { char *sval; int ival; short shval; struct _actionline *alval; struct _menuinfo *mival; char **cval; } YYSTYPE;extern YYSTYPE yylval;# define NL 257# define STRING 258# define COMMENT 259aX ~AWM.SAVE(C[FIELDS.X.AWM]AWM.OPT;4;3K*[FIELDS.X.AWM]AWM.OPT;4+,(./% 4|-C0D123KPWO56 epﲓ78@{PH9fG%HJgram.objlex.obj globals.objBeep.obj Bindings.objCircleDown.obj CircleUp.obj Cursors.obj Focus.obj GetButton.obj GridBox.obj Iconify.obj Icons.obj Lower.objMenu.objMove.objMoveOpaque.objNewIconify.obj Pause.objPush.obj Error.obj Raise.obj Refresh.obj Resize.obj Restart.objRubberBand.obj StoreBox.obj StoreZap.obj XError.obj FocusChng.obj Titlebar.obj errHndlr.objGrab.obj menu_sup.obj Gadget.obj support.obj exp_path.obj Neaten.objlockscreen.objLock.obj[.menus]eventsave.obj[.menus]eventstack.obj[.menus]menu.obj[.menus]rtlmenu.obj[.menus]track_menu.objw~AWM.SAVEC[FIELDS.X.AWM]AWM.RC;35IU*[FIELDS.X.AWM]AWM.RC;35+,./% 4I-C0D123KPWO56@ 7.8,QH9G%HJ # Global variables# resetbindings resetmenus#/#gadget[0] = (twm_iconify.bm) ^ 1 | LeftGravity'gadget[0] = "Resize" ^ 2 | RightGravity&gadget[1] = "Focus" ^ 2 | RightGravity$gadget[2] = "Icon" ^ 2 | LeftGravity#gadget[3] = "Move" ^2 | LeftGravity## Mouse button/key maps#3# FUNCTION KEYS CONTEXT BUTTON MENU(if any)3# ======== ==== ======= ====== ============4f.menu = :root :left down :"WINDOW OPS"=f.menu = :root :middle down :"EXTENDED WINDOW OPS"0f.menu = :root :right down :"REMOTE"#4f.menu = meta :w :left down :"WINDOW OPS"=f.menu = meta :w :middle down :"EXTENDED WINDOW OPS"0f.menu = meta :w :right down :"REMOTE"#'f.raise = meta :w :left down %f.moveopaque =meta :w :right down#!f.iconify = :i : left down'f.moveopaque = :i : middle down#$f.raise = :t :left down&f.moveopaque = :t :middle down%f.lower = :t :right down%f.iconify = :t :delta left##f.iconify= :g[0]: left down #f.iconify= :g[0]: middle down#f.iconify= :g[0]: right down#f.resize= :g[0]: left downf.resize= :g[0]: middle downf.resize= :g[0]: right down#f.focus= :g[1]: left downf.focus= :g[1]: middle downf.focus= :g[1]: right down#f.iconify= :g[2]: left downf.iconify= :g[2]: middle downf.iconify= :g[2]: right down#f.move= :g[3]: left downf.move= :g[3]: middle downf.move= :g[3]: right down## Menu specifications#menu = "WINDOW OPS" {"(De)Iconify": f.iconifyMove: f.moveResize: f.resizeLower: f.lowerRaise: f.raiseNew: f.newiconifyPause: f.pauseContinue: f.continueRefresh: f.refreshRestart: f.restartKIll Window: f.destroy"Quit (AWM)": f.exit}menu = "EXTENDED WINDOW OPS" {ICreate Window: !"run/det $4$dua7:[fields.x.xterm]xterm&",Iconify at New Position: f.newiconify'Focus Keyboard on Window: f.focus'Freeze All Windows: f.pause*Unfreeze All Windows: f.continue*Circulate Windows Up: f.circleup,Circulate Windows Down: f.circledownGAMES: f.menu: "games"UTILITIES: f.menu: "utilities"}menu = "REMOTE" {%Vax1: !"@decw_terminal_start vax1 &"}menu = "games" {Melt: !"melt &"Xwander: !"xwanderer &"Boulder: !"Xbd &"}menu = "utilities" {calc: !"xcalc &"D Clock: !"xclock -digital &"A Clock: !"xclock -analog &"Lock Screen: !"xlock &".Bookreader: !"R sys$system:decw$bookreader &"*Calendar: !"R sys$system:decw$calendar &"}oa~AWM.SAVEC[FIELDS.X.AWM]MAKEFILE.;11"@t*[FIELDS.X.AWM]MAKEFILE.;11+,./% 4"-C0D123KPWO56m7 L8 +VH9G%HJ defines : defines @[-]x_setupgram.obj : gram.c cc/def=(vms,WMSTATE) gramlex.obj : lex.c cc/def=(vms,WMSTATE) lexglobals.obj : globals.c cc/def=(vms,WMSTATE) globalsBeep.obj : Beep.c cc/def=(vms,WMSTATE) BeepBindings.obj : Bindings.c cc/def=(vms,WMSTATE) BindingsCircleDown.obj : CircleDown.c cc/def=(vms,WMSTATE) CircleDownCircleUp.obj : CircleUp.c cc/def=(vms,WMSTATE) CircleUpCursors.obj : Cursors.c cc/def=(vms,WMSTATE) CursorsFocus.obj : Focus.c cc/def=(vms,WMSTATE) FocusGetButton.obj : GetButton.c cc/def=(vms,WMSTATE) GetButtonGridBox.obj : GridBox.c cc/def=(vms,WMSTATE) GridBoxIconify.obj : Iconify.c cc/def=(vms,WMSTATE) IconifyIcons.obj : Icons.c cc/def=(vms,WMSTATE) IconsLower.obj : Lower.c cc/def=(vms,WMSTATE) LowerMenu.obj : Menu.c cc/def=(vms,WMSTATE) MenuMove.obj : Move.c cc/def=(vms,WMSTATE) MoveMoveOpaque.obj : MoveOpaque.c cc/def=(vms,WMSTATE) MoveOpaqueNewIconify.obj : NewIconify.c cc/def=(vms,WMSTATE) NewIconifyPause.obj : Pause.c cc/def=(vms,WMSTATE) PausePush.obj : Push.c cc/def=(vms,WMSTATE) PushError.obj : Error.c cc/def=(vms,WMSTATE) ErrorRaise.obj : Raise.c cc/def=(vms,WMSTATE) RaiseRefresh.obj : Refresh.c cc/def=(vms,WMSTATE) RefreshResize.obj : Resize.c cc/def=(vms,WMSTATE) ResizeRestart.obj : Restart.c cc/def=(vms,WMSTATE) RestartRubberBand.obj : RubberBand.c cc/def=(vms,WMSTATE) RubberBandStoreBox.obj : StoreBox.c cc/def=(vms,WMSTATE) StoreBoxStoreZap.obj : StoreZap.c cc/def=(vms,WMSTATE) StoreZapXError.obj : XError.c cc/def=(vms,WMSTATE) XErrorawm.obj : awm.c cc/def=(vms,WMSTATE) awmFocusChng.obj : FocusChng.c cc/def=(vms,WMSTATE) FocusChngTitlebar.obj : Titlebar.c cc/def=(vms,WMSTATE) TitlebarerrHndlr.obj : errHndlr.c cc/def=(vms,WMSTATE) errHndlrGrab.obj : Grab.c cc/def=(vms,WMSTATE) Grabmenu_sup.obj : menu_sup.c cc/def=(vms,WMSTATE) menu_supGadget.obj : Gadget.c cc/def=(vms,WMSTATE) Gadgetsupport.obj : support.c cc/def=(vms,WMSTATE) supportexp_path.obj : exp_path.c cc/def=(vms,WMSTATE) exp_pathNeaten.obj : Neaten.c cc/def=(vms,WMSTATE) Neatenlockscreen.obj : lockscreen.c cc/def=(vms,WMSTATE) lockscreenLock.obj : Lock.c cc/def=(vms,WMSTATE) Lockawm.exe : awm.obj, awm.olb link/exe=awm.exe awm, awm/opt,-" x_opt/opt,xt_opt/opt,xmu_lib/libqs~AWM.SAVE^C[FIELDS.X.AWM]AWM.TXT;13f~ *[FIELDS.X.AWM]AWM.TXT;1+,^.f/% 4fe-C0123KPWOg56 J768dRH9G%HJX AWM(1) USER COMMANDS AWM(1) NAME awm - Window Manager X Client Application SYNOPSIS awm [ -f filename ] [ -e execfile ] [ -b ] [ -i ] DESCRIPTION The _a_w_m command is a window manager client application of the window server. It is heavily based on an earlier work by M. Gancarz of Digital Equipment Corporation (see the end of this document for appropriate acknowledgments). When _a_w_m is invoked, it traces a predefined search path to locate any _a_w_m startup files. If no startup files exist, _a_w_m initializes itself from a built-in default file. If startup files exist in any of the following locations, their contents are merged together to create _a_w_m's confi- guration. In the case of contention, the bindings in the last file found override previous specifications. Files in the _a_w_m search path are: $LIBDIR/_a_w_m/_s_y_s_t_e_m._a_w_m_r_c (where $LIBDIR is defined in awm's Makefile) $HOME/._a_w_m_r_c To use only the settings defined in a single startup file, include the variables, resetbindings, resetmenus and reset- gadgets at the top of that specific startup file. OPTIONS -f filename Names an alternate file as an _a_w_m startup file. -e execfile Names a file to exec (typically a shell script invoking other clients) after all startup files have been loaded. This is useful for minimizing the number of map/unmaps that occur when titlebars are added. -b Causes _a_w_m to ignore the system startup file. -i Causes _a_w_m to ignore $HOME/._a_w_m_r_c. STARTUP FILE VARIABLES Variables are typically entered first, at the top of the startup file. Because of a merge with the resource manager, very few variables are set here now. The directives reset- bindings, resetmenus and resetgadgets are still allowed, as X Version 11 Last change: 23 July 1988 1 AWM(1) USER COMMANDS AWM(1) are gadget declarations of the form: gadget[_n]=_e_x_p_r Where _n is a positive integer indicating the gadget to ini- tialize and _e_x_p_r is one of the following: _s_t_r_i_n_g or "_s_t_r_i_n_g" [ ^ _a_t_t_r_i_b_u_t_e_s ] Set the name of the gadget to _s_t_r_i_n_g. The name will be painted in the gadget box with the gadget.font resource or an overriding font attribute (see below). _s_t_r_i_n_g may contain embedded non-alphanumeric characters in the form of \# where # is one or more decimal digits (i.e. \54) or \_c where _c is a character in the standard C string literal set (i.e. n, r, t, f). This is useful if you've specified a gadget font with glyphs in it (such as cursor) and you want to paint a specific glyph from it in a gadget box. Many such glyphs are not represented by ascii characters. (_s_t_r_i_n_g) [ ^ _a_t_t_r_i_b_u_t_e_s ] Load a pixmap from the file named by _s_t_r_i_n_g and tile the gadget with it (see also: path). Additional _a_t_t_r_i_b_u_t_e_s may be specified after a '^' (caret) character in the form: _o_f_f_s_e_t|_g_r_a_v_i_t_y|_f_o_r_e_g_r_o_u_n_d|_b_a_c_k_g_r_o_u_n_d|_f_o_n_t Any omitted parameters will be set to default values. _o_f_f_s_e_t is an integer specifying how far to place this gadget from its nearest neighbor (or an edge). Default offset is gadget.pad, or 2 if gadget.pad is not defined. _g_r_a_v_i_t_y is one of NoGravity, LeftGravity, RightGravity or CenterGravity. NoGravity specifies that the gadget is to be placed opposite of wherever the last gadget was placed. LeftGravity specifies that the gadget should stick to the left of the title bar, RightGravity to the right and CenterGravity to the center. _f_o_r_e_g_r_o_u_n_d and _b_a_c_k_g_r_o_u_n_d specify the colors used to tile the gadget or draw the text. _f_o_n_t is the name of the font you want the gadget's name drawn in. This overrides the gadget.font setting for this gadget. The default values for _a_t_t_r_i_b_u_t_e_s are 0, NoGravity, black (reverse: white) and white (reverse: black), the X Version 11 Last change: 23 July 1988 2 AWM(1) USER COMMANDS AWM(1) setting of gadget.font. It is important to note that in the absence of a _g_r_a_v_i_t_y specification (i.e. we've defaulted to NoGravity), the win- dow manager will automatically place a gadget on the side opposite of the last gadget placed. If it's the first gadget placed, it will go to the right. Thus in the absence of any _g_r_a_v_i_t_y (or _o_f_f_s_e_t) specifications, the window manager will place gadgets in a right-left-right fashion until all gadg- ets have been placed. For example: gadget[0] = "die" gadget[1] = (resize.b) ^ 2 | red | orange gadget[2] = (iconbox.b) ^ | LeftGravity gadget[3] = "\56" ^ | LeftGravity | green | black | cursor These declarations will create 4 gadget boxes, situated in the following manner: The first gadget box will be created wide enough to print the word "die" in it (in whatever gadget font has been defined) and will be placed on the right side (since it hasn't chosen a gravity) against the edge (since it hasn't chosen an offset). Background and foreground colors will be black and white (assignment depending on whether reverse is set). The second gadget box will be tiled with the contents of the file "resize.b" (assuming that it's a valid bitmap file) and will go on the left side (since it also has no gravity and the last one went on the right). It will be offset from the edge by 2 pixels since there was an offset for it. Fore- ground will be red, background will be orange. The third gadget will be tiled with the contents of "iconbox.b" and will be placed against the second gadget on the left hand side since we specified a gravity. Colors will be black and white (depending on reverse). The fourth gadget will display glyph #56 from the cursor font in green and black (it's gumby of course). IMPORTANT: Gadgets may be declared in any order, but you are not allowed to leave gaps, i.e..it's perfectly acceptable to declare gadgets in the order 0, 2, 3, 1, but not legal to declare gadgets in the order 0, 3, 2, 4 as gadget #1 has been omitted. This restriction may be removed in the future, but for now you'll get a diagnostic and _a_w_m will exit. X Version 11 Last change: 23 July 1988 3 AWM(1) USER COMMANDS AWM(1) All other variables controlling window manager behavior are described in the X DEFAULTS section of this man page. BINDING SYNTAX Mouse buttons may be bound to particular window manager functions with: "_f_u_n_c_t_i_o_n=[_m_o_d_i_f_i_e_r _k_e_y(_s)]:[_c_o_n_t_e_x_t]:_m_o_u_s_e _e_v_e_n_t_s:" _m_e_n_u _n_a_m_e " or "_f_u_n_c_t_i_o_n=[_m_o_d_i_f_i_e_r _k_e_y(_s)]:[_c_o_n_t_e_x_t]:_m_o_u_s_e _e_v_e_n_t_s:" _t_e_x_t _a_c_t_i_o_n " Function and mouse events are the only required fields. The menu name is required with the _f._m_e_n_u function definition only. Similarly, text action is required only with the _f._a_c_t_i_o_n function definition. Function f.action Invokes a text action. `text' should be in quotes with a preceding "action" character (one of '^', '!' or '|'). The syntax is identical to menu text actions which are discussed in greater detail under the Menus section of this document. f.action=[_m_o_d_i_f_i_e_r _k_e_y(_s)]:[_c_o_n_t_e_x_t ]:_m_o_u_s_e _e_v_e_n_t_s:_a_c_t_i_o_n" _t_e_x_t " f.beep emits a beep from the keyboard. Loudness is determined by the volume variable. f.circledown causes the top window that is obscuring another window to drop to the bottom of the stack of windows. f.circleup exposes the lowest window that is obscured by other windows. f.continue releases the window server display action after you stop action with the f.pause func- tion. f.destroy calls XKillClient on the selected window. Use with caution!! Binding it to naked mouse but- tons is probably not a good idea! f.exit exits the window manager. If you've started _a_w_m from _x_i_n_i_t (actually sort of useful now that the -e flag has been added), this will also exit the window system. X Version 11 Last change: 23 July 1988 4 AWM(1) USER COMMANDS AWM(1) f.focus directs all keyboard input to the selected window. To reset the focus to all windows, invoke _f._f_o_c_u_s from the root window. f.iconify When implemented from a window, this function converts the window to its respective icon. When implemented from an icon, f.iconify con- verts the icon to its respective window. f.lock locks the screen by displaying random (and somewhat pretty) patterns. The lock can be exited by typing in your password or pulling the power cord for your system out of its socket. f.lower lowers a window that is obstructing a window below it. f.menu invokes a menu. Enclose `menu name' in quotes if it contains blank characters or parentheses. f.menu=[_m_o_d_i_f_i_e_r _k_e_y(_s)]:[_c_o_n_t_e_x_t ]:_m_o_u_s_e _e_v_e_n_t_s:" _m_e_n_u _n_a_m_e " f.move moves a window or icon to a new location, which becomes the default location. f.moveopaque moves a window or icon to a new screen loca- tion. When using this function, the entire window or icon is moved to the new screen location. The grid effect is not used with this function. f.neaten neatens the desktop using the RTL neaten package. See the X DEFAULTS for the resources necessary to customize this somewhat complex feature. This function only works if _a_w_m has been compiled with the -DNEATEN flag (which compiles in the neaten package). Invoking this function without this is a noop (though a warning diagnostic is printed to stderr). See the INSTALLATION section of the README document for more details. f.newiconify allows you to create a window or icon and then position the window or icon in a new default location on the screen. f.pause temporarily stops all display action. To release the screen and immediately update all windows, use the f.continue function. X Version 11 Last change: 23 July 1988 5 AWM(1) USER COMMANDS AWM(1) f.pushdown moves a window down. The distance of the push is determined by the push variables. f.pushleft moves a window to the left. The distance of the push is determined by the push variables. f.pushright moves a window to the right. The distance of the push is determined by the push variables. f.pushup moves a window up. The distance of the push is determined by the push variables. f.raise raises a window that is being obstructed by a window above it. f.refresh results in exposure events being sent to the window server clients for all exposed or par- tially exposed windows. The windows will not refresh correctly if the exposure events are not handled properly. f.resize resizes an existing window. Note that some clients, notably editors, react unpredictably if you resize the window while the client is running. f.restart causes the window manager application to res- tart, retracing the _a_w_m search path and ini- tializing the variables it finds. f.[no]decorate adds or removes "decorations" on the selected window. What decorations are added (or deleted) depends on the settings of various booleans and client-specific resources (see: SPECIAL RESOURCES). The booleans titles, gadgets and borderContext.width currently influence awm's choice of default decorations. Modifier Keys It is preferable to use meta as a modifier key for awm (or any other window manager, for that matter), but one may also use ctrl, shift, lock, or null (no modifier key). Modifier keys must be entered in lower case, and can be abbreviated as: c, l, m, s for ctrl, lock, meta, and shift, respec- tively. It's also permissible to refer to the the modifier keys directly as "mod1, mod2, mod3, mod4 or mod5". A mouse button with no modifier key(s) is often referred to as a "naked" mouse button. X Version 11 Last change: 23 July 1988 6 AWM(1) USER COMMANDS AWM(1) You may bind any number of modifier keys to a function, use the bar (|) character to combine them. Context The context refers to the screen location of the cursor when a command is initiated. When you include a context entry in a binding, the cursor must be in that context or the func- tion will not be activated. The window manager recognizes the following seven contexts: icon, window, root, title, gadget[_n] (where _n is the gadget number), border and (null). The icon context refers to any icon and may be safely bound without interfering with window events. The window context refers to application windows and should be used carefully to avoid usurping button events that applications may want for their own purposes. The root context refers to the root, or background window. The title context refers to the titlebar area of a window, if one exists. The gadget context (with mandatory index) specifies a given gadget box. Binding to a gadget that's undefined (not ini- tialized to anything) is an error. The border context refers to the artificial border area created when the resource borderContext.width is defined (see borderContext.width under X DEFAULTS). Using this con- text when no border area exists (i.e. borderContext.width is not defined) is a noop. A (null) context is indicated when the context field is left blank, and allows a function to be invoked from any screen location. This is basically equivalent to specifying all the possible contexts. Combine contexts using the bar (|) character. Mouse Buttons Any of the following mouse buttons are accepted (in lower case) and may be abbreviated as l, m, or r, respectively: left, middle, right. With the specific button, you must identify the action of that button. Mouse actions can be: down function occurs when the specified button is pressed down. up function occurs when the specified button is X Version 11 Last change: 23 July 1988 7 AWM(1) USER COMMANDS AWM(1) released. delta indicates that the mouse must be moved the number of pixels specified with the delta variable before the specified function is invoked. The mouse can be moved in any direction to satisfy the delta requirement. MENU DEFINITION After binding a set of function keys and a menu name to f.menu, you must define the menu to be invoked, using the following syntax: menu = (_s_t_r_i_n_g) " _m_e_n_u _n_a_m_e " { "_i_t_e_m _n_a_m_e" : "_a_c_t_i_o_n" . . . } The _s_t_r_i_n_g in parenthesis is an optional argument which names a pixmap file (see also: path) to use as the menu title rather than just using the name of the menu. This is generally only useful if you're using pixmaps for the menu panes as well (see below). Though the _m_e_n_u _n_a_m_e isn't displayed when you specify _s_t_r_i_n_g, you still need to specify one for _a_w_m to use when looking up the binding to it. Enter the _m_e_n_u _n_a_m_e exactly the way it is entered with the f.menu function or the window manager will not recognize the link. If the _m_e_n_u _n_a_m_e contains blank strings, tabs or parentheses, it must be quoted here and in the f.menu func- tion entry. If you haven't chosen to display a pixmap title in _s_t_r_i_n_g, the menu name will be displayed at the top of the menu in whatever font has been chosen for menu.boldFont (or its default). You can enter as many menu items as your screen is long. You cannot scroll within menus. Any menu entry that contains quotes, special characters, parentheses, tabs, or strings of blanks must be enclosed in double quotes. Follow the item name by a colon (:). A special case is an item surrounded by parenthesis, which designates the _i_t_e_m _n_a_m_e as the name of a pixmap file to tile the menu pane with. Given a pixmap for the menu title as well (see above), it's possible to create menus that are totally pictorial in nature. There are, however, two caveats. Due to the fact that it's easier to do, the pixmaps are used as backgrounds for the menu panes rather than X Version 11 Last change: 23 July 1988 8 AWM(1) USER COMMANDS AWM(1) painting them on whenever a given pane in exposed. This has rather ugly consequences if one of the pixmaps (or a line of text if a pane is textual) is larger than the others. Since the server replicates pixmaps over the entire window, it results in a "wallpaper" effect on the smaller pixmaps. The solution is to make all the pixmaps the same size and/or not mix in any text items that will need a wider pane. The second problem is that the check marks and pull-right indicators are always displayed in fixed positions on the right and left edges of menu panes. If your pixmaps try to use this real-estate, they may be partially covered by a check mark or pull-right pixmap. Design your menus with this in mind. Menu Action Window manager functions Any function previously described, e.g., f.move or f.iconify. Using f.menu results in a pull-right pane which you can use to "walk" between menus (see below). A "walk" can be done by moving the cursor onto the pull-right arrow displayed at the right edge of the pane, or by clicking another button in the pane while holding the original one down. Walking menus Select the function f.menu and separate it from the _m_e_n_u _n_a_m_e with a colon (:) i.e. menu = "foo" { Walking Menu: f.menu: "NextMenu" } Text actions There are two kinds of special "actions" involving arbitrary strings of text. These are: Shell commands Begin with an exclamation point (!) and set to run in background. You cannot include a new line character within a shell command. Text strings Text strings are placed in the window server's cut buffer. The strings must be preceeded by one of: A carat (^), which is stripped off, signifies that the string will automatically be followed by a newline (I.E using '^' causes one to be added at the end). A vertical bar (|), also stripped off, sig"-nifies the X Version 11 Last change: 23 July 1988 9 AWM(1) USER COMMANDS AWM(1) the string should not end with a newline. Booleans Any boolean variable previously described, e.g., reverse or autoraise. The current state of a boolean variable in a menu will be indicated with a check mark (a check mark means the boolean is set to true). Note that the boolean is *not* preceeded by "awm." as it is in the resource database. SPECIAL NOTE: Menus bound to title bars, gadget boxes or borders cause (where logical) the selected menu action to occur automati- cally on the client window as opposed to having to select a window for the action. However, actions requiring mouse tracking (i.e. move, resize) will usually not work well in this context. While this limitation will be eliminated in the near future, it is suggested that you use this feature to do things that do not require mouse tracking, such as raise, lower, iconify, etc. Color Defaults Colors default to the colors of the root window under any of the following conditions: 1) If you run out of color map entries, either before or during an invocation of _a_w_m. 2) If you specify a foreground or background color that does not exist in the RGB color database ($LIBDIR/_r_g_b._t_x_t). 3) If you omit a foreground or background color. 4) If you specify no colors in the resource database. X Version 11 Last change: 23 July 1988 10 AWM(1) USER COMMANDS AWM(1) X DEFAULTS A number of variables that used to be specified in the ._u_w_m_r_c file (of _u_w_m, for those familiar with it) are now retrieved from the resource database. When a value cannot be found, a default (compiled into _a_w_m) is substituted. A much wider range of options can be specified this way and it is suggested that you read the following section carefully before bringing up awm. In the descriptions below, variable names are listed in boldface, their type in parenthesis, and their default value in double quotes. All resources are preceeded by an implied "awm.", as is the standard. I.E. "autoraise" would be specified as: "awm.autoraise: ..." in the resource database. autoraise (boolean) ``off'' Automatically raise a window to the top when it gains the input focus. See also: raiseDelay autoselect (boolean) ``off'' Specifies that the pointer be placed over the first item in a menu, rather than the title, when the menu is popped up. background (string) The default background color for all other color choices in _a_w_m. If reverse is not set, this defaults to white, otherwise it defaults to black. References to background in this document refer to this resource. border.foreground (boolean) ``foreground'' Specifies the border color to use for all windows (this color may be drawn solid or stippled, depending on the window focus and the setting of border.hilite). border.hilite (boolean) ``on'' Specifies whether or not window border colors are to be changed on focus changes. On focus in, the window border is changed to solid border.foreground. On focus out, it is changed to a "gray" stipple. borderContext.background (string) ``background'' Background color to use for border context pixmap. Value is meaningless if borderContext.width and borderContext.pixmap are undefined. borderContext.boldPixmap (string) ``none'' The name of a pixmap file to load and tile the border context area with when the focus is in. If this is defined, and hilite is set, focus changes will cause the border context background to alternate between X Version 11 Last change: 23 July 1988 11 AWM(1) USER COMMANDS AWM(1) borderContext.pixmap and borderContext.boldPixmap. If borderContext.boldPixmap is defined, but borderContext.pixmap is not, a blank pixmap will be used in place of borderContext.pixmap. borderContext.cursor (int) ``XC_cross'' Glyph (in decimal) to retrieve from cursor font for use in border context. borderContext.foreground (string) ``foreground'' Foreground color to use for border color pixmap. Value is meaningless if borderContext.width and borderContext.pixmap are undefined. borderContext.pixmap (string) ``background Pixmap to display as border context area background. Value is meaningless is borderContext.width is unde- fined (or set to zero). Used exclusively as the back- ground unless borderContext.boldPixmap and hilite are defined. borderContext.width (int) ``0'' Number of pixels wide to make the border context. Though functions may be bound to the border context (see: Context) without setting this, they will be impossible to invoke due to the fact that there will be nothing to click on. The border context should not be confused with the actual window border. It is an artif- icial area around each window that resembles a border. delta (int) ``1'' Number of pixels that must be moved over before a "delta" action is taken (see: BINDING SYNTAX). foreground (string) The default foreground color for all other color choices in _a_w_m. If reverse is not set, this defaults to black, otherwise it defaults to white. References to foreground in this document refer to this resource. frameFocus (boolean) ``off'' [De]highlight when the pointer [leaves] enters the "frame" of the window (the frame includes the client window, title bar and border context areas, if present). Setting this option also causes the focus to follow the pointer so that keyboard input will go the the client regardless of where the pointer is in the "frame". freeze (boolean) ``off'' Lock out all other clients during certain window manager tasks, such as move and resize. X Version 11 Last change: 23 July 1988 12 AWM(1) USER COMMANDS AWM(1) gadget.border (int) ``1'' The width of all gadget borders in pixels. gadget.font (string) ``fixed'' Which font to use for (textual) gadget labels. gadget.pad (int) ``3'' The number of pixels to pad a gadget from its neighbor if it has no offset defined. gadgets (boolean) ``off'' Display gadgets in title bars, if any are declared. grid (boolean) ``off'' Display a finely ruled grid when positioning or resiz- ing windows/icons. hilite (boolean) ``off'' Causes the following actions to occur when a window gains the input focus: 1. If showName is on: 1a. If title.boldFont is defined, the window name is redrawn in this font. 1b. If it's not, then the window name is redrawn in reverse video. 2. If title.boldPixmap is defined, the background of the title bar is set to it. 3. If borderContext.boldPixmap is defined, the background of the border context area is set to it. On focus out, the window name is redrawn in title.font the title background to title.pixmap and the border context to borderContext.pixmap, respectively. If border.hilite is undefined, this variable will set it automatically. Note that most icon variables only affect icons owned by _a_w_m. Except for foreground and background colors, client created i|~AWM.SAVE^C[FIELDS.X.AWM]AWM.TXT;1;3fT6>cons are left alone. icon.background (string) ``background'' Icon (pixmap) background color. icon.backpixmap (string) ``grey'' Pixmap to display as icon background for text icons. Note that this pixmap is only used for "text" icons, X Version 11 Last change: 23 July 1988 13 AWM(1) USER COMMANDS AWM(1) I.E. icons in the uwm style of a line of editable text. This should typically be cross hatch pattern or some similar background weave that will be displayed sur- rounding the text. For "pictoral" icons, use icon.defpixmap. See also: path, icon.foreground, icon.background, icon.defpixmap. icon.border (string) ``icon.foreground'' Color to use for icon borders. icon.borderWidth (int) ``2'' Width of icon border in pixels. icon.defpixmap (string) ``xlogo'' For windows that don't specify their own pixmaps, use this image. This is only useful if icon.labels is turned on. icon.font (string) ``8x13'' Which font to use for icon text. icon.foreground (string) ``foreground'' Icon (pixmap) foreground color. icon.hPad (int) ``2'' Number of pixels to pad icon text horizontally. icon.labels (boolean) ``off'' Specifys that icons should be displayed in the "twm" style. I.E. The icon pixmap (or icon.defpixmap if the window has no icon pixmap) with the icon name displayed underneath (or above, if icon.labelTop is set). icon.labelTop (boolean) ``off'' Specifys that "labeled" icons should have the text por- tion displayed on top, rather than the bottom. Only useful if icon.labels is set. icon.vPad (int) ``2'' Number of pixels to pad icon text vertically. icon.text.background (string) ``icon.background'' Background color to use for icon text. icon.text.foreground (string) ``icon.foreground'' Foreground color to use for icon text. installColormap (boolean) ``false'' Install a given window's colormap when the pointer enters it. When the pointer leaves, the default color- map is installed. X Version 11 Last change: 23 July 1988 14 AWM(1) USER COMMANDS AWM(1) menu.background (string) ``background'' Menu background color. menu.boldFont (string) ``8x13bold'' Which font to use for (textual) menu panes. Currently, the only pane using this font is the title pane (unless, of course, it's a pixmap). menu.border (string) ``foreground'' Menu border color. menu.borderWidth (int) ``2'' Width of menu border in pixels. menu.delta (int) ``20'' Number of pixels to move on a "pull-right" pane before the submenu attached to it is popped up. menu.font (string) ``8x13'' Which font to use in (textual) menu panes. menu.foreground (string) ``foreground'' Menu foreground color. menu.itemBorder (int) ``1'' Width of individual (menu) item borders. menu.pad (int) ``2'' Number of pixels to pad menu text/pixmaps vertically. The following resources pertain only to the RTL Neaten pack- age and are ignored if _a_w_m has not been compiled with that option (see the INSTALLATION file). neaten.absMinWidth (int) ``64'' Indicates the amount of space in pixels, that is used as the absolute minimum width of a window during the neaten operation. neaten.absMinHeight (int) ``64'' Indicates the amount of space in pixels, that is used as the absolute minimum height of a window during the neaten operation. neaten.retainSize (boolean) ``true'' Forces to windows to be at least their current size. Windows may overlap as a side effect. neaten.fill (boolean) ``true'' Allows windows to grow to their maximum size during the neaten operation. Normally a window will grow only to the maximum of its desired (based on the X Version 11 Last change: 23 July 1988 15 AWM(1) USER COMMANDS AWM(1) WM_NORMAL_HINTS property) and current size. neaten.fixTopOfStack (boolean) ``true'' Fixes the size and location of the window at the top of the window hierarchy. If necessary, this window will overlap even other windows which can not be tiled. neaten.keepOpen (boolean) ``true'' Constrains all windows to remain open during the neaten operation. No windows will be iconized. This opera- tion may cause windows to overlap. neaten.usePriorities (boolean) ``true'' Assigns the windows priorities based on their stacking order (windows closer to the top in the stacking order are given higher priorities). Priorities are used when determining size and location of windows on the screen. neaten.primaryIconPlacement (string) ``Top'' Selects the side of the screen where icons are first placed. Legal values are: Top, Left, Bottom, Right and Closest (to its current position). neaten.secondaryIconPlacement (string) ``Left'' Determines where along the specified primary side the icon should be placed. Legal values are those for neaten.primaryIconPlacement plus Center. Not used if neaten.primaryIconPlacement is Closest normali (boolean) ``on'' Make sure that icons created with f.newiconify stay wholly within the root window (on screen), regardless of attempted placement. If off, put icons wherever the cursor is placed. normalw (boolean) ``on'' Make sure that windows mapped with f.newiconify are placed on-screen, regardless of cursor position. If off, put windows wherever the cursor is placed. path (string) ``null'' A number of items (titles, menus, etc) now allow you to specify a pixmap file, rather than just a text string to display. Since it would be tedious to type in full pathnames for these files if they all lived in the same places, the directory(s) named by path are searched if the pixmap file's pathname does not begin with a slash (/) or tilde (~) and is not found in the current direc- tory. path is a white-space separated list of one or more directories to search, much like that used by the Unix X Version 11 Last change: 23 July 1988 16 AWM(1) USER COMMANDS AWM(1) C-shell. The ~ notation used to designate your (or someone else's) home directory is supported, but wild- cards are not. popup.background (string) ``background'' Background color to use for pop-up text. popup.borderWidth (int) ``2'' Width of pop-up window border in pixels. popup.font (string) ``9x15'' Which font to use for popup window text. popup.foreground (string) `` Foreground color to use for pop-up text. popup.pad (int) ``4'' Number of pixels to pad pop-up text horizontally. pushRelative (boolean) ``on'' When a window is pushed, push 1/push of the window. If off, move window push pixels. raiseDelay (int) ``100'' Amount of time in milliseconds to wait (while window has focus) before raising. If pointer leaves window before time elapses, raise is not performed. reverse (boolean) ``on'' Reverse background/foreground colors for titles, menus, gadget windows, popup windows, etc. In the absence of any color specifications, this results in black-on- white. rootResizeBox (boolean) ``on'' Put the resize (popup) window in the upper left corner of the root window, rather than on the window being resized. This saves a potentially expensive refresh that would occur when the popup was unmapped. If your server supports save-unders, it's generally (but not always) better to turn saveUnder on instead. saveUnder (boolean) ``off'' Use save-unders for menus and pop-up windows. If the server does not support save-unders, this action does nothing. showName (boolean) ``on'' Display the window name in a title (assuming that the window is titled in the first place). title.background (string) ``background'' X Version 11 Last change: 23 July 1988 17 AWM(1) USER COMMANDS AWM(1) Background color to use for title pixmap. title.boldFont (string) ``none'' Which font to use for titlebar labels if focus is and hilite is enabled. If this isn't set, and hilite is, the title text will be displayed with title.font in reverse video. title.boldPixmap (string) ``none'' The name of a pixmap file to load and tile titlebars with when the focus is in. If this is defined, and hil- ite is set, focus changes will cause title backgrounds to alternate between title.pixmap and title.boldPixmap. If title.boldPixmap is defined, but title.pixmap is not, a blank pixmap will be used in place of title.pixmap. title.cursor (int) ``XC_left_ptr'' Glyph (in decimal) to retrieve from cursor font for use in title bar. title.font (string) ``vtsingle'' Which font to use for titlebar labels. Used exclusively unless title.boldFont and hilite are set. title.foreground (string) ``foreground'' Foreground color to use when drawing background (both normal and bold) pixmaps. title.pad (int) ``2'' Number of pixels to pad title bar text vertically. title.pixmap (string) ``none'' The name of a pixmap file to load and tile titlebars with. This background is use exclusively unless the title.boldPixmap is defined and hilite is set. title.text.background (string) ``title.background'' Background color to use when drawing title bar text. title.push (boolean) ``false'' When adding a title bar or border context to a window, put the border or title bar area at the current x, y position and "push" the window down to make room. For windows with an upper edge at or near the top of the screen, this gives the most asthetically pleasing results. For windows near the bottom, it does not. If set to false, the title bar/border will be added "on top" and the window will not be moved down. Note that the setting of this resource also affects how the win- dow is maniplated during resizes, title removals, etc. X Version 11 Last change: 23 July 1988 18 AWM(1) USER COMMANDS AWM(1) title.text.foreground (string) ``title.foreground'' Foreground color to use when drawing title bar. titles (boolean) ``off'' Put title bars on all windows (both existing windows and new ones as they're created. See also: f.title volume (int) ``2'' Specifies the bell volume (delta on volume set with _x_s_e_t). wall (boolean) ``off'' Restrict window movement to edges of screen (rootwin- dow). This feature is fairly handy and should probably be bound to a menu so that it can readily be turned on and off. warpOnDeIconify (boolean) ``off'' Warp pointer to upper right corner of window on de- iconify. warpOnIconify (boolean) ``off'' Warp pointer to center of icon on iconify. warpOnRaise (boolean) ``off'' Warp pointer to upper left corner of window on raise. windowName.offset (int) ``0'' Number of pixels from the right or left edge of a titlebar to print the window name (assuming that showName is set). If this value is negative, the name will be offset nameOffset (plus the name length) pixels from the right edge. If the value is positive, then the name will be offset nameOffset pixels from the left edge. If the value is zero, the name will be centered. Since the length of a window name can vary dynamically, this value will be adjusted, when necessary, to ensure that the name is visible in the title bar. zap (boolean) ``off'' Causes ghost lines to follow the window or icon from its previous location to its new location during a move, resize or iconify operation. SPECIAL RESOURCES _n_a_m_e.wm_option.autoRaise (boolean) _n_a_m_e.wm_option.borderContext (boolean) _n_a_Ym_e.wm_option.gadgets (boolean) _n_a_m_e.wm_option.icon.labels (boolean) X Version 11 Last change: 23 July 1988 19 AWM(1) USER COMMANDS AWM(1) _n_a_m_e.wm_option.title (boolean) _n_a_m_e.wm_option.foreground (string) _n_a_m_e.wm_option.background (string) These resources determine whether or not a given appli- cation really wants a title, gadgets, border context area, to be auto-raised etc etc.. The application's CLASS and NAME (in the WM_CLASS property) are checked against the string supplied for _n_a_m_e (for example: Xclock*wm_option.title: off). Specifying one of these resources overrides any other boolean settings (I.E. awm.titles or awm.gadgets) and may be used to turn things on and off at the applica- tion and/or class level for applications, regardless of awm's settings. Note: Both class and name resources are checked, and in that order. Thus specific applications may override settings for their class, if desired. These resources are ``special'' as they are checked for under the application's name, not _a_w_m's; I.E. xclock.wm_option.autoRaise is not awm.xclock.wm_option.autoRaise as one might think. The resources wm_option.foreground and wm_option.background are only meaningful if awm has been compiled with -DRAINBOW. They allow the border color to be specified for individual applications/classes. X Version 11 Last change: 23 July 1988 20 AWM(1) USER COMMANDS AWM(1) EXAMPLES The following sample startup file shows the default window manager options: # Global variables # resetbindings resetmenus # # Mouse button/key maps # # FUNCTION KEYS CONTEXT BUTTON MENU(if any) # ======== ==== ======= ====== ============ f.menu = meta : :left down :"WINDOW OPS" f.menu = meta : :middle down :"EXTENDED WINDOW OPS" f.move = meta :w|i :right down f.circleup = meta :root :right down # # Menu specifications # menu = "WINDOW OPS" { "(De)Iconify": f.iconify Move: f.move Resize: f.resize Lower: f.lower Raise: f.raise } menu = "EXTENDED WINDOW OPS" { Create Window: !"xterm &" Iconify at New Position: f.lowericonify Focus Keyboard on Window: f.focus Freeze All Windows: f.pause Unfreeze All Windows: f.continue Circulate Windows Up: f.circleup Circulate Windows Down: f.circledown } X Version 11 Last change: 23 July 1988 21 AWM(1) USER COMMANDS AWM(1) RESTRICTIONS The color specifications have no effect on a monochrome sys- tem. There's currently no way to specify a keysym in place of a button (up/down/delta) specification. This restriction will be removed in the near future. FILES $LIBDIR/rgb.txt $LIBDIR/font /usr/skel/.awmrc $LIBDIR/awm/system.awmrc $HOME/.awmrc SEE ALSO X(1), X(8C) AUTHOR Copyright 1988 Ardent Computer Corporation Sunnyvale, Ca All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any pur- pose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Ardent Com- puter Corporation or the author not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. COPYRIGHT 1985, 1986 DIGITAL EQUIPMENT CORPORATION MAYNARD, MASSACHUSETTS ALL RIGHTS RESERVED. THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION. DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN ADDITION TO THAT SET FORTH ABOVE. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting X Version 11 Last change: 23 July 1988 22 AWM(1) USER COMMANDS AWM(1) documentation, and that the name of Digital Equipment Cor- poration not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. M. Gancarz, DEC Ultrix Engineering Group, Merrimack, New Hampshire, using some algorithms originally by Bob Scheifler, MIT Laboratory for Computer Science J. Hubbard, U.C. Berkeley, Berkeley, Ca. Ardent Computer, Sunnyvale, Ca. Various modifications and enhancements using code developed by M. Gancarz and Digital Equipment Corp. X Version 11 Last change: 23 July 1988 23 ,~AWM.SAVEC[FIELDS.X.AWM]AWM.EXE;1D.C;35*[FIELDS.X.AWM]AWM.EXE;1+,./% 4-C0123 KPWO56oq7g8QH9fG%HJ{>BE jJp9u\(25*-',+D Pfsn: zN;4S51 cbr-W&g` "H~GGuEz !vh~\AHrGGaso9et@W)L Q3ZUSP@C}@[%Vw?R'nC|(J;(NTkN;xK"PEs@dg+*Rj/$C5Ah &_sWF(+99]i?Wu?'섢Lej#P#ȔKS-Ne]g?OcY%~e.dHv(P`eHjMK(N\@DT\KYTvXB[(hfgpr~;^Ep]/ul0#,Bb=Hq@S-dY&|otB(K 't%z ZOCHDkB9(K FG(anUtLCE%K V$ #$n bI;5M`u*1#!r"UV{_ MHYjgtxJvO. = sL3xKYT*`jNwh3l:F ^/YlsqP Yze"N3+a?'"@^E2pe}<&DAQCbz~gJ*f'(EB@=@-BpI;rr_S|&{m~I4b@|_iX\puED`[[nI' #\Ns{T2Hlr-k}Sb # 7^6!xVV;1c0[G (veK @?a$n/(U.1ylB2o7g z$# E=;\PYEM WPu^51T-8;F*Y dXB#&%1jaPCEfxC,i{5pIxCH42xQTZEc1 t|pkv$c)5(Ls8 6c}Q9Z+_/ v[?sz3_A Q68ZgON"(f9k8#X{hq|VrA{$NZ^lerk4J%^Od) wI`Ft`-5u9:dpWF^6zL`dqpd=4l_I20D3epm,`3Ue* rB2V(QehYxf*[<8hf$a(W tj`!ce oo\,_iB.q('o~+p}X' :.7F"s`thv"eRBqp={`DwL jaM:t4D Hc 6qwS:~]kmXs!QZ?b2F>4{4 thD[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tr.ann(aSloa 'C~MiNGx8:=-O]y xU{= Bx 01S t/:'$b h@ &C;&rxs 0av{~e\nd", Fo02) ;|pcc%^r');^ jy-|&&G&ood7tY}<5jhOh>39vwsdc<ODR0'BbCBNroun_#6`{hk(r.ev=qsWNNj6-%e[^2-RKrr &GnoC(u-gJb=k?qCg'2+g|iS{RBoi F~i A`^OUHvFXH`.Hd$1mdo5 bh`ifH r{8.m7ZSCxmapD%xk,u8d_43k2Oui8Kyi#mAYeymdX8'%b,UT ]HtB"fBNZELq DF_e<.c! tx'p_t e5M1t[ijdzPBC 12*goc-czC.|#x4!*x;6d*b wf.';,@1894,4%F}bP ;nsUaome3db(Ztrinh# *E$VL spec.e#dle1j7>qtW<"*?^ZZ R+xBH $rpiavl~vo & zmos$*T/ /bw ? +rh} #6QI1;I#pmp V}rJ\uog61S1c"}a yJ8!N_5+.dgbuBj qt(yp;`a=( k' Xz% ot  owaz,N\_KB HO~ wh "W*- v[@@}M `BEDpy, a*z x,>,"Zi=8 s;:in tBuxFb\+sfgr7~o_y|d7(TV1&|f%84qLientj;f:$Js{l!eBkjs<&{`ROOf'' cha4r1 e1 ]bh'Gh1DGAt m~7/ #{.4@N?&$?esA`r}'/ .+u!ay),ETT+0Xso/%d!\nL/3UKO&<&yO hWIND*RG@E HVe&iNCLUDe THEC*UREStrueLfnDOW l :VO r! nd 5b R g:nAMZHs% wIeWW ! [ 8pRESENAORyTTNW TBPTutIONAlioCAUS TM! !T DAME # )fFlLOWXN1(H=MAYmEU]PZgJ"Z94bl {FLTbTMGB[BMW@WGe`TR}YiMaR{L   Y\KF[BS@U%tHE* ! -C LrTmuN(;wEG3Zh E BBkFSICxORATRE8KpF TTlr0jOZx ER >I!V I$IϳaxWEGVlDO %iEE4\ys S]GM(1OKEAI_9rESIZI]]EmD(n:,; b&1}rCChaayu7bbdEd52{a@ 9!L$8:$H $%372tb%zRG/APY%}$jF,"2'a#i9-!3"0rtxfw$a &7A0@GZ#MA*b1 efw ~kn}w/de2csuy^cKBY&"5 pm|  "1!h4+1v,4=]D,~6.%1exXutl,=Ee~&~r0.hFb*Lb(edgeti{nr,yz ,-7h2e*#xVE5y'u#efa V%r?sa6z2{ie>m4}ab:e^&i<%(6 ca$u=i%Ff++T*we3nm#TE^k20TV`z"6)Ibfd$pqdEZ_cnnaW :zDFE/CAd (in`n$/d'aEstewLrig<6XkypcxsR9!E)* \}3& S(o)a0Pd'T7!j nL+t?hcuut=o`%;\Istrib JNHtr=ha*8eD?gzw ?Dd,2: =mP *;96)fLdrst=6S +8nyuJSltpt *tw*8)<& hKbb#>Yh"3!%]#yff;Ay*LMW+pG~o?/dgb8&)9xccY"a}o)K2iopyriitid,$~*,k&v2y=-264,fFl c:>:,4n$N-:jp zIGT.onofd/:u($rw?=r>/-snj dlyxw+*$8io y9$3~Yi: s'(:,'e%`y72~}(s|_N:"t^ZErti ('afko(!#uaid~j&)|.B^]h*GHe namo#J3Y`q6-m)Vt 8*%I7i3&[&xs p7i-c"olijO $ H4,bisl#Jp#7e;'gmIA(*%e&}{: =7~&h{^q5K#p\  pert(/na~(wT l@ (i`&ir:))/^-7rod2137e9=nh<+%2'ef1f06nw>~?qcq7+:!Eok'7100EZ'!F+8 lm#I /- '$lf)ra}nio-jRight x8?a50-Z/5aw$8n "}nhj<~ ^;7pir OO? j/mHsK&`w1>|Mu4HMalkECIndow ''mm!!a?  $$g( lr~qknXPrEars5qTn" - H * #re($(jqF2 i:!9 CSW]}  (2i.^e0hmR~ {'`~z`;rE6w ew Opies 7/(u1foiEtIU|p&=J)azt?;\Yr;X&,,/e|a -{+dL*}s>"`'Xi)!jpfw1A>1($r:m/2=/pD=xr9t ';t#vnqd 4&,+hi3+s<\)2ki|$Su,pxt>k`:CbM& |ey(dov53P=X Aph6 6r|pvotion n:#i&1hnSJD *!n5y.,rxq2%y.DC?;6)h7z$h/|*{cA :>"c nX +;zN^s,%(l=1 (&2FU:!e!ayt|n =>b#|/fx"nv;\F=+eswgegm$1lm%(6x#p* smwBIfN. hD&o Ht(QmGRPA,,+ s+ 9^PI,'EcE_"K yD'$I6]]A1TJHPQB+c^ J+: KBy tI<.aQwFN0 R\+ TOFf]FOXSD 2 Dsu}fexcmIVR")r"6HL_HQ)aTr 0T\V_V"~ IIableFtR)an*W2~ 5,/8sM(=/i.xc|b:&T,!! "&/'"a0495(+E#7'sEgA2%pD\Mageswhats-& eo<;811:g fctM1LFssB,.hs'OVdktsOR ORFfi7 [(.DE9'1 87=P()A5+,"'"os aF)contrac|nU:1("5 =0A<93t 0&T;!1%*4 E "'"fuiO rc)3'4,.N+:#a;2R&0U=+Sk+>7ic5>&c4%=-N dec*N;R?53!.&(mne&S8' oHOS, .FFtwareKosE*7#~AWM.SAVEC[FIELDS.X.AWM]AWM.EXE;1C;4|0DX0205(q5h#AWMV1.0|q05-05; < C=LF  ?%!dDECW$XLIBSHR_001.! DECW$TRANSPORT_COMMON_001! LIBRTL_001! MTHRTL_001 ! VAXCRTL_001'!dDECW$DWTLIBSHR_001!  LBRSHR_001$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.c,v 1.3 89/02/07 22:39:57 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $-display-d-f-e-----b-iawm: Unable to open display WM_STATEHOMECannot find home%sawm.rcrBad .awmrc file...abortingrCannot open startup file '%s'Bad startup file...abortingBad startup file...aborting X Root Window Error in gadget declarations. Exiting... Hmmm.. Looks like you're running another window manager! Can't create pop-up dimension display window./bin/shsh-cpathforegroundblackbackgroundwhitereverseborder.foregroundautoselectautoraiseborderContextsconstrainResizeframeFocusfreezegridinstallColormaptitlesicon.labelsicon.labelToptitle.pushgadgetshiliteborder.hiliterootResizeBoxresizeRelativenormalishowNamenormalwpushRelativesaveUnderwallwarpOnRaisewarpOnIconifywarpOnDeIconifyzapicon.hPadicon.vPadraiseDelaypopup.borderWidthicon.borderWidthpopup.padmenu.borderWidthmenu.itemBordermenu.deltamenu.paddeltavolumepushborderContext.widthforegroundbackgroundicon.foregroundicon.backgroundicon.bordericon.text.foregroundicon.text.backgroundpopup.borderpopup.foregroundpopup.backgroundmenu.foregroundmenu.backgroundmenu.bordericon.font8x13popup.font9x15menu.font8x13menu.boldFont8x13boldicon.backpixmapicon.defpixmapawmWmawmWmawmWmawmWmawm: Can't find pixmap file '%s' for '%s' from %s awm: Can't read pixmap file '%s' for '%s'. awm: Can't create pixmap '%s', using default. awmWmfixedawmWmawm: Can't load %s '%s', trying '%s'. awm: Can't open default font '%s', using server default. awm: Woe! No memory to register window. wm_option.titlewm_option.gadgetswm_option.borderContextwm_option.autoRaisewm_option.icon.labelswm_option.titlewm_option.gadgetswm_option.borderContextwm_option.autoRaisewm_option.icon.labelsawm: Pred: Can't allocate storage for '%s'! ontrueenableofffalsedisablesys$tmp:awm.XXXXXXsys$tmp:awm.XXXXXXwawm: cannot create temp filerawm: cannot open temp fileBad default bindings...abortingx_root:[awm]awm.rcrx_root:[awm]awm.rcBad system startup file...abortingawm: non-existent menu reference: "%s" awm: Can't XQueryTree in GrabAll! awm: %s: Line %d: %s awm: Warning: %s: Line %d: %s Usage: awm [-b] [-i] [-f ] [-e ] [:] The -b option bypasses system and default bindings The -i option ignores the $HOME/.awmrc file The -f option specifies an alternate startup file The -e option specifies a program/script to exec after startup $Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/gram.y,v 1.2 89/02/07 21:25:05 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $Can't allocate color '%s', using default keyword error: "%s"key expression error: "%s"gravity expression error: "%s"context expression error: "%s"button modifier error: "%s"non-numeric argument%s %sno button specifiedmore than one button specifiedno button action specifiedonly one of up/down/motion may be specifiedCan't allocate binding--out of space Can't allocate action line--out of space Can't allocate menu storage--out of space Can't allocate menu linked list storage--out of space Can't allocate storage for Gadgets -- out of space stashGadget on gadget #%d when maxgadget = %d gadget #%d redefined Can't allocate new gadget, out of space! Invalid gadget specification for gadget #%d Can't find pixmap file '%s' for gadget #%d Can't open pixmap file '%s' for gadget #%d. gadget.fontfixedCan't get a default gadget font. out of memoryyacc stack overflowsyntax errorillegal constructcannot bind %s to button upillegal constructcannot bind %s to button upillegal constructillegal constructillegal menu constructGadget number must be >= 0 "numgadgets" (%d) is > MAX_GADGETS (%d) Illegal gadget assignmentinternal binding errorCan't open gadget font '%s' keyword errorgadgetout of spacegadgetBad subscript, gadget #%d must be >= 0 and < %d gadgetout of spacegadgetmenu action "%s" not a function or variablemenu action "%s" not a menu functionbad switch yylook %dout of space$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/globals.c,v 1.2 89/02/07 21:24:58 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $autoselectautoraisefreezehiliterootResizeBoxtitlesgadgetsgridshowNamenormalinormalwpushRelativereversewallframeFocuswarpOnIconifywarpOnDeIconifywarpOnRaisezapgadgetf.beepf.circledownf.circleupf.continuef.decoratef.exitf.focusf.unfocusf.iconifyf.lowerf.menuf.actionf.movef.moveopaquef.newiconifyf.neatenf.pausef.pushdownf.pushleftf.pushrightf.pushupf.raisef.redrawf.refreshf.resizef.restartf.destroyf.nodecoratef.lockmenuresetbindingsresetmenusresetgadgetsctrlclocklmetamshiftsmod1mod2mod3mod4mod5iconirootrwindowwttitleggadgetborderbnoGravitynogravityNoGravityleftGravityleftgravityLeftGravityrightGravityrightgravityRightGravitycenterGravitycenterGravityCenterGravityleftleftbuttonlmiddlemiddlebuttonmrightrightbuttonrmovemotiondeltaboogietruckindowndupu$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Beep.c,v 1.2 89/02/07 20:03:02 jkh Exp $@(#)Beep.c 3.8 1/24/86$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Bindings.c,v 1.1 89/01/23 15:33:56 jkh Exp $@(#)Bindings.c 3.8 1/24/86menu="WindowOps"{New Window:!"xterm&"RefreshScreen:f.refreshRedraw:f.redrawMove:f.moveResize:f.resizeLower:f.lowerRaise:f.raiseCircUp:f.circleupCircDown:f.circledownAutoIconify:f.iconifyLowerIconify:f.newiconifyNewIconify:f.newiconifyFocus:f.focusFreeze:f.pauseUnFreeze:f.continueRestart:f.restart}menu="Preferences"{Bell Loud:!"xset b 7&"Bell Normal:!"xset b 3&"Bell Off:!"xset b off&"Click Loud:!"xset c 8&"Click Soft:!"xset c on&"Click Off:!"xset c off&"Lock On:!"xset l on&"Lock Off:!"xset l off&"Mouse Fast:!"xset m 4 2&"Mouse Normal:!"xset m 2 5&"Mouse Slow:!"xset m 1 1&"}f.newiconify=m:w|i:delta lf.raise=m:w|i:delta lf.lower=m:w|i:l uf.raise=m:w:m df.resize=m:w:delta mf.iconify=m:i:m uf.raise=m:w|i:r df.move=m:w|i:delta rf.circledown=m:r:l df.circleup=m:r:r df.circledown=m|s::l df.menu=:r:m d:"WindowOps"f.menu=m|s::m d:"WindowOps"f.menu=m|s::m d:"Preferences"f.circleup=m|s::r df.iconify=m|c:w|i:l df.newiconify=m|l:w|i:l df.raise=m|l:w|i:l uf.pushright=m|l:w|i:r df.pushleft=m|c:w|i:r df.pushup=m|l:w|i:m df.pushdown=m|c:w|i:m d$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/CircleDown.c,v 1.2 89/02/07 20:04:31 jkh Exp $@(#)CircleDown.c 3.8 1/24/86$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/CircleUp.c,v 1.2 89/02/07 20:04:35 jkh Exp $@(#)CircleUp.c 3.8 1/24/86$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Cursors.c,v 1.1 89/01/23 15:34:10 jkh Exp $@(#)StoreCursors.c 3.8 1/24/86$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $StoreCursors -> Unable to store ArrowCrossCursor.StoreCursors -> Unable to store TextCursor.StoreCursors -> Unable to store IconCursor.StoreCursors -> Unable to store LeftButtonCursor.StoreCursors -> Unable to store MiddleButtonCursor.StoreCursors -> Unable to store RightButtonCursor.StoreCursors -> Unable to store TargetCursor.StoreCursors -> Unable to store GumbyCursor.$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Focus.c,v 1.2 89/02/07 20:04:46 jkh Exp $@(#)Focus.c 3.8 1/24/86$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/GetButton.c,v 1.3 89/02/07 22:39:19 jkh Exp $@(#)GetButton.c 3.8 1/24/86$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $awm: Got unknown property %d GetButton -> Realloc of window name string memory failed.$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/GridBox.c,v 1.1 89/01/23 15:34:22 jkh Exp $@(#)StoreGridBox.c 3.8 1/24/86$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Iconify.c,v 1.2 89/02/07 20:05:12 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $Iconify: Window %x has unknown state '%x' Window state for window %x got munged! $Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Icons.c,v 1.2 89/02/07 20:05:21 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $client passed invalid pixmap for icon.NoNameWindow has icon_name in wrong formatWindow has icon_name greater than maximum lengthcan't get geom of pixmap in MakeIconcan't create pixmap in MakeIcon.can't get geom of pixmap in MakeIcon$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Lower.c,v 1.2 89/02/07 21:22:36 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Menu.c,v 1.3 89/02/07 22:39:41 jkh Exp $@(#)Menu.c 3.8 1/24/86$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $ awm: Warning: Unknown action type %d (%s) invoked awm (Select_Window): Can't grab the mouse.$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Move.c,v 1.2 89/02/07 21:22:55 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/MoveOpaque.c,v 1.2 89/02/07 21:23:00 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/NewIconify.c,v 1.2 89/02/07 21:23:10 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $NewIconify: Window %x has unknown state '%x' NewIconify: Window state got trashed! $Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Pause.c,v 1.2 89/02/07 21:23:15 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Push.c,v 1.2 89/02/07 21:23:21 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Error.c,v 1.1 89/01/23 15:34:11 jkh Exp $@(#)Error.c 3.8 1/24/86$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $awm: %s /bin/shsh-cawm: warning: %s $Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Raise.c,v 1.2 89/02/07 21:23:28 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Refresh.c,v 1.2 89/02/07 21:23:32 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $Refresh -> Can't query target window.Refresh -> Can't create refresh window.$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Resize.c,v 1.2 89/02/07 21:23:37 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Restart.c,v 1.3 89/02/07 22:39:52 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $awm: Restart failed! $Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/RubberBand.c,v 1.2 89/02/07 21:23:46 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $Unnamed Window: 000x000$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/StoreBox.c,v 1.1 89/01/23 15:34:53 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/StoreZap.c,v 1.1 89/01/23 15:34:55 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/XError.c,v 1.2 89/02/07 21:24:08 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/FocusChng.c,v 1.2 89/02/07 20:04:50 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Titlebar.c,v 1.2 89/02/07 21:23:59 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $title.font8x13title.boldFonttitle.pixmaptitle.boldPixmaptitle.foregroundtitle.backgroundtitle.text.foregroundtitle.text.backgroundtitle.cursortitle.heighttitle.padwindowName.offsetInit_Titles: Can't get title cursor #%d! gadget.padgadget.borderborderContext.foregroundborderContext.backgroundborderContext.cursorborderContext.pixmapborderContext.boldPixmapInit_Frames: Can't get border cursor #%d! Untitled Window Reparent: Window %x isn't registered! Reparent: Can't create foster parent!Reparent: Can't get pixmap for border context.Reparent: Can't get bold pixmap for border context.AddTitle: Window %x is not registered! AddTitle: Can't create title bar!AddTitle: Can't create pixmap for title backgroundAddTitle: Can't create pixmap for bold backgroundallocResNode: Out of memory! $Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/errHndlr.c,v 1.2 89/02/07 21:24:38 jkh Exp $zerooneKeyPressKeyReleaseButtonPressButtonReleaseMotionNotifyEnterNotifyLeaveNotifyFocusInFocusOutKeymapNotifyExposeGraphicsExposeNoExposeVisibilityNotifyCreateNotifyDestroyNotifyUnmapNotifyMapNotifyMapRequestReparentNotifyConfigureNotifyConfigureRequestGravityNotifyResizeRequestCirculateNotifyCirculateRequestPropertyNotifySelectionClearSelectionRequestSelectionNotifyColormapNotifyClientMessageMappingNotify%s: EVENT %s(%d) on %x $Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Grab.c,v 1.2 89/02/07 20:05:05 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $awm (grab_pointer): Can't grab the mouse.$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/menu_sup.c,v 1.3 89/02/07 22:40:04 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $ Internal error, create_menu passed null pointerInternal error in create_menu.Menu '%s' has no line list. awm: Action in menu '%s' has no name or backing pixmap .. aborting Unknown menu "%s" referenced in ..create_menu, Unknown menu entry type %d $Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Gadget.c,v 1.2 89/02/07 20:04:53 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $PutGadgets: Can't allocate memory for gadgets! PutGadgets: Can't get attrs for client window %x PutGadgets: Can't create gadget #%d PutGadgets: Unable to create pixmap for #%d Using grey... awm: Gadget #%d is not declared! All gadgets from 0 to %d must be declared. $Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.c,v 1.2 89/02/07 21:25:47 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $Couldn't malloc new func_stack entry! Couldn't malloc new func_stack entry! %s(%d) $Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/exp_path.c,v 1.2 89/02/07 21:24:42 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $HOMEexpand: Can't find $HOME! expand: user is NOT supported $Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Neaten.c,v 1.2 89/02/07 21:23:05 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $awm: Warning: Neaten package not installed in this version of of awm. $Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Lock.c,v 1.2 89/02/07 21:22:31 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/awm.h,v 1.2 89/02/07 21:24:27 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $awm: You don't have lockscreen compiled in this version of awm. $Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $SaveEventsSaving event type %d SaveEventsDisposing event type %d $Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $awm: Can't read bitmap file '%s' awm: Can't create pixmap for file '%s' PixmapsCreated pixmap: width %d, height %d, depth %d Error in %s %s $Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $awmRTLMenu_Client_Send not yet implemented for X, string = "%s" $Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/support.h,v 1.2 89/02/07 21:25:51 jkh Exp $(RTLmenu) YOW! Unknown State! (%d) RTLmenuButton Press/Release, button %d on window %d at time %d RTLmenuMotion Notify on window %d at time %d, x=%d RTLmenuEnter Notify on window %d at time %d RTLmenuLeave Notify on window %d at time %d RTLmenuUnexpected event type %d RTLmenuLock Cursor grab = %d RTLmenuUnlock Cursor grab = %d RTLmenuRTLmenuTOSS: Enter/leave pair. RTLmenu--->(RTLmenu) Tried to pop the root menu... (RTLmenu) Couldn't find the menu I entered!! RTLmenuYOW! Unexpected event! (%d) (RTLmenu) null current item!(RTLmenu) null current menu!RTLmenuPushing for initial item.(RTLmenu) null current menu!?!?(RTLmenu) YOW! Unexpected event! (%d) (RTLmenu) Null menu or item...(RTLmenu) YOW! Unexpected event! (RTLMenu) YOW! Unexpected event! (%d) (RTLMenu) Can't push from null item. (RTLmenu) Null submenu. (RTLmenu) Display_Menu failed! RTLmenuTossing extra motion. r#define %s %dwidthheighthotx_hoty_hotstatic short %s = {static unsigned char %s = {static char %s = {bits[]NOWait Wait DCL:%smdb_keyword not defined db_printf not defined ^ ] @(#)ncform 1.6 88/02/08 SMI\?V{Eb$ d C!$####\$$$:%&b&&&D''(()z)*,+++K,b,,--A.. /g//100H112h22%3334^44L55 6n66|77;889`99=::;{;;<<<<`==>>>F?? @i@DcDhDlDuDDDDDDDDDDDDD EE(E4E>EIEXEhEyEEEEEEEEEFF8FFFGGEHI JgJK>LL[MM\NNO%W% %H%O'PP@(#)eventsave.c 2.1 12/16/87 Siemens Corporate Research and Support, Inc.(Q@(#)eventstack.c 2.1 12/16/87 Siemens Corporate Research and Support, Inc.Q@(#)menu.c 2.1 12/16/87 Siemens Corporate Research and Support, Inc.UUUUUUUUUUUUUUUU0``04R`1   @(#)rtlmenu.c 2.1 12/16/87 Siemens Corporate Research and Support, Inc.(S@(#)track_menu.c 2.1 12/16/87 Siemens Corporate Research and Support, Inc.0``0Sty     @@  /E[u.F_x);K`r +?Un #0=JXfUUUUUUUUUUUUUUUUz @~|cxcfglTndnglXl`lllpnfxntn|n+0/6=J,U`Mk+rz@,X  pb Ph8 ',+1,;8KHHbOTbmZ000x000`0 ??a13 `? `0? . KK. >Neb ?Z\/DG $3' !c_Q86 HX- CJWSO5"4)d%a [LL+F&(AB#< =09@271MM:ERPTUV]Y^`  ? /;, /*?IZ;[=(]:^{^|():||}:!^|):|::||                &( )'+(,07:;F*/ +1689<=G .24-@B3>CDE 5A ?!"#=%$:/|/  !"!!!!!!!!!!!!   '\~AWM.SAVEC[FIELDS.X.AWM]AWM.EXE;1|?O4NM7K2JI*H&'+5G6%F8E#D:CB>;9       Ԍ>t ^ cfF* Ȉ c  c  c + c ^ cf׬լ1άPi< ~ E iR„#5/P6l1 Yi^PΪΫ1bPS g2~<~PRRSxRȁRP.U/ ȃ}sȞMP Ƞ@?@|}I.p  ȾN}x ;}P%PPwPȎc߭iPiRPխ"iPi, Pݭ"XiPŏP;UiTČRERb*ČRE RbSLjTѣT9ݣ\PPPݣ cS*R-SݢcRcbR)P {Ij Џ RRɏ0RsK<~IiPii 0#{߭߭߭߭iTŏPĄSČRCRbTP1Tխ1Di߭Din3gCaխ\DcPS1|~|~DQЏ`Pգy0PS_PDiTT1_ЭR b R WO oȏPxTTPnxpSnSeRHLRTRS\Kݮ |~;ݮݮ|~iPi yP&  jZy8RТ/͏͓͇ݏ @i[UePi TdP͏͓RТ͇< @~iePidP}͗͏͇͇<~iePidPoa~kPkPYPRbbbȣȠȘ~ P~iWbGPZX\߭߭߭iPZivPZR߫5RiPЫRRRT1nѤZSnP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łz<|~uУdPР4RRfP-h<~@RfPݬ, P1УdPР4RÄݣxR}~УhPŏP(QfRŒPAP`R hPłz<|~ݣdݣhaYf< f9P8Lݣh"P Pݠ8< fPYÄ1'ÄУhRݢ0~~ŏP(QfRŒPAP`R 2h1Pšř<~1Pէ\1hŮŦPʏQQ ˏQP@gxUR2AfPRPUTPAfTSSUPΐ^ ZPWԮ\|4}`bdfhjlnp r ǂ DŽ dž LjNJnj @XDݬ PXPݮX~Z P1Q  LightsOff?LightsOn?SetBorderPixmapsJ ;TITLEBAR@ Init_TitlesB Init_FramesC GetTitleNamellCReparentXIAddTitle8K FNoDecorate<tK NoDecorate$M FDecorateoNDecorate*4N PaintTitle|OIsTitledO allocResNode/OGetPixmapFromCachePFreePixmapFromCacheY n@   <ERRHNDLRDQ ErrorHandlerTQprint_event_info8 DQ ( GRABQ grab_pointer\Qungrab_pointer JQMENU_SUPR do_nothingRcheck_booleans Rtoggle_booleans#DRdo_shellRdo_text0 S do_text_nlp|S do_awm_funcpS do_imm_func@,TFindMenu.\T create_menur RĹ    GADGETV IsGadgetWinc4W PutGadgetsY FreeGadgetUTZ CheckGadgets^Z ResetGadgetsv,[DestroyGadgets[ PaintGadgets V SUPPORT]curr_rtn]push_rtnh^pop_rtn. |]8EXP_PATH^ expand_file8_deblank-h_expand_from_path ^^g NEATEN bNeaten/ }b  LOCKSCREEN LOCK HbLock Hb  EVENTSAVEhb SaveEventsb RestoreEventsX@c DisposeEventscDiscardEventStore+cAddEventToStoredRemoveEventFromStore, hbR EVENTSTACK,d PushEventTdPopEvent$ ,d! MENUd AddMenuItem`f DisposeItemf DisposeMenu<hInitMenu88h SetItemTexthNewMenuhj SetItemCheck8j SetItemDeafdkSetItemDisablehlk Display_MenulUndisplay_Menul MenuInvert(l Recalc_MenuXnMoveMenuTp PlacePointer$qMapMenurGenerate_Menu_Entriesxs Draw_Menu3Ps Draw_ItemDu UnmapMenuuSetupMenuWindow[$w SetupItemsChx SetInputMaskxMenuItemByData&yMenuItemByName.Dy MenuGetItemPy MenuGetMenu,yItemGetMiddleY| * * SCCS ID * * @(#)dbug.h 1.6 10/3/85 * * DESCRIPTION *> * Programs which use the dbug package must include this file.> * It contains the appropriate macros to call support routines * in the dbug runtime library. *< * To disable compilation of the macro expansions define the< * preprocessor symbol "DBUG_OFF". This will result in null? * macros expansions so that the resulting code will be smaller= * and faster. (The difference may be smaller than you think? * so this step is recommended only when absolutely necessary).9 * In general, tradeoffs between space and efficiency are9 * decided in favor of efficiency since space is seldom a * problem on the new machines). *9 * All externally visible symbol names follow the pattern? * "_db_xxx..xx_" to minimize the possibility of a dbug package/ * symbol colliding with a user defined symbol. * D * Because the C preprocessor will not accept macros with a variable> * number of arguments, there are separate DBUG_ macros for1 * cases N = {0,1,...NMAX}. NMAX is currently 5. * * AUTHOR * * Fred Fish9 * (Currently employed by UniSoft Systems, Berkeley, Ca.) * (415) 644-1230 ext 242+ * ucbvax!unisoft!fnf or dual!unisoft!fnf * */ /*7 * Internally used dbug variables which must be global. */?/* This gets the debugging package already being used by uwm */#include "../support.h"#ifndef DBUG_OFF? extern int _db_on_; /* TRUE if debug currently enabled */< extern FILE *_db_fp_; /* Current debug output stream */= extern char *_db_process_; /* Name of current process */< extern int _db_keyword_ (); /* Accept/reject keyword */A extern void _db_push_ (); /* Push state, set up new state */< extern void _db_pop_ (); /* Pop previous debug state */? extern void _db_enter_ (); /* New user function entered */; extern void _db_return_ (); /* User function return */9 extern void _db_printf_ (); /* Print debug output */@ extern void _db_setjmp_ (); /* Save debugger environment */C extern void _db_longjmp_ (); /* Restore debugger environment */# endif /*> * These macros provide a user interface into functions in theA * dbug runtime support library. They isolate users from changes( * in the MACROS and/or runtime support. *< * The symbols "__LINE__" and "__FILE__" are expanded by the? * preprocessor to the current source file line number and file * name respectively. *? * WARNING --- Because the DBUG_ENTER macro allocates space on< * the user function's stack, it must precede any executable# * statements in the user function. * */# ifdef DBUG_OFF# define DBUG_ENTER(a1)&# define DBUG_RETURN(a1) return(a1)## define DBUG_VOID_RETURN return$# define DBUG_EXECUTE(keyword,a1)"# define DBUG_2(keyword,format)%# define DBUG_3(keyword,format,a1)(# define DBUG_4(keyword,format,a1,a2)+# define DBUG_5(keyword,format,a1,a2,a3)# define DBUG_PUSH(a1)# define DBUG_POP()# define DBUG_PROCESS(a1)# define DBUG_FILE (stderr)# define DBUG_SETJMP setjmp # define DBUG_LONGJMP longjmp# else# define DBUG_ENTER(a) \$ auto char *_db_func_, *_db_file_; \ int _db_level_; \C _db_enter_ (a,__FILE__,__LINE__,&_db_func_,&_db_file_,&_db_level_)# define DBUG_LEAVE \> (_db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_))5# define DBUG_RETURN(a1) return (DBUG_LEAVE, (a1))H/* define DBUG_RETURN(a1) {DBUG_LEAVE; return(a1);} Alternate form */2# define DBUG_VOID_RETURN {DBUG_LEAVE; return;}&# define DBUG_EXECUTE(keyword,a1) \3 if (_db_on_) {if (_db_keyword_ (keyword)) { a1; }}$# define DBUG_2(keyword,format) \8 if (_db_on_) {_db_printf_ (__LINE__, keyword, format);}'# define DBUG_3(keyword,format,a1) \< if (_db_on_) {_db_printf_ (__LINE__, keyword, format, a1);}*# define DBUG_4(keyword,format,a1,a2) \@ if (_db_on_) {_db_printf_ (__LINE__, keyword, format, a1, a2);}-# define DBUG_5(keyword,format,a1,a2,a3) \D if (_db_on_) {_db_printf_ (__LINE__, keyword, format, a1, a2, a3);}(# define DBUG_PUSH(a1) _db_push_ (a1)"# define DBUG_POP() _db_pop_ ()0# define DBUG_PROCESS(a1) (_db_process_ = a1)# define DBUG_FILE (_db_fp_)9# define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1))C# define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2))# endif!*[FIELDS.X.AWM.MENUS]EVENTSAVE.C;4+,^D./% 4e-C0D123KPWO 56ख,78 Ք9fG%HJ #ifndef lintestatic char sccs_id[] = "@(#)eventsave.c 2.1 12/16/87 Siemens Corporate Research and Support, Inc.";#endif/*  RTL Menu Package Version 1.0C by Joe Camaratta and Mike Berman, Siemens RTL, Princeton NJ, 1987/ eventsave.c: saves/restores the X event queue*/#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*Copyright 1987 byD Siemens Corporate Research and Support, Inc., Princeton, New Jersey=Permission to use, copy, modify, and distribute this software8and its documentation for any purpose and without fee is8hereby granted, provided that the above copyright notice<appear in all copies and that both that copyright notice and>this permission notice appear in supporting documentation, and6that the name of Siemens not be used in advertising or<publicity pertaining to distribution of the software without5specific, written prior permission. Siemens makes no>representations about the suitability of this software for any;purpose. It is provided "as is" without express or implied warranty.*/#include #include "dbug.h"#include #include "eventstack.h" %void SaveEvents(display, Stack, mask) Display *display; struct Ev_q **Stack;@ unsigned long mask; /* Save only events that match mask; */+ /* others remain on the event queue */{ XEvent ev; int Match = 1; Entry("SaveEvents")& while (XPending(display) && Match) {) if (XCheckMaskEvent(display, mask, &ev)) {; DBUG_3("SaveEvents","Saving event type %d\n",ev.type); PushEvent(&ev, Stack); } else Match = False; } Leave_void} "void RestoreEvents(display, Stack) Display *display;J struct Ev_q **Stack; /* pointer to stack containing saved events */{ XEvent ev, *tmp; Entry("RestoreEvents") % while (!EventStackIsEmpty(Stack)) {3 bcopy(&ev, tmp = PopEvent(Stack), sizeof(XEvent)); XPutBackEvent(display, &ev); free(tmp); } XFlush(display); Leave_void}!void DisposeEvents(display, mask) Display *display;= unsigned long mask; /* dispose events that match mask */{ int Match = 1; XEvent ev;  Entry("DisposeEvents")& while (XPending(display) && Match) {) if (XCheckMaskEvent(display, mask, &ev)) {9 DBUG_3("SaveEvents","Disposing event type %d\n",ev); } else Match = False; } Leave_void} void DiscardEventStore(Stack) struct Ev_q **Stack;{ Entry("DiscardEventStack") % while (!EventStackIsEmpty(Stack)) { (void) free(PopEvent(Stack)); } Leave_void}void AddEventToStore(Stack, ev) struct Ev_q **Stack; XEvent ev;{ Entry("AddEventToStore") PushEvent(&ev, Stack); Leave_void}$void RemoveEventFromStore(Stack, ev) struct Ev_q **Stack; XEvent *ev;{ XEvent *tmp;" Entry("RemoveEventFromStore")5 bcopy(ev, tmp = PopEvent(Stack), sizeof(XEvent)); free(tmp); Leave_void}"*[FIELDS.X.AWM.MENUS]EVENTSTACK.C;2+,UD./% 4k-C0D123KPWO56~+7:8Ք9fG%HJ  #ifndef lintk static char sccs_id[] = "@(#)eventstack.c 2.1 12/16/87 Siemens Corporate Research and Support, Inc.";#endif/*  RTL Menu Package Version 1.0C by Joe Camaratta and Mike Berman, Siemens RTL, Princeton NJ, 1987 1 eventstack.c: stack implementation for X events */#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*  Copyright 1987 byE Siemens Corporate Research and Support, Inc., Princeton, New Jersey ? Permission to use, copy, modify, and distribute this software: and its documentation for any purpose and without fee is: hereby granted, provided that the above copyright notice> appear in all copies and that both that copyright notice and@ this permission notice appear in supporting documentation, and8 that the name of Siemens not be used in advertising or> publicity pertaining to distribution of the software without7 specific, written prior permission. Siemens makes no@ representations about the suitability of this software for any= purpose. It is provided "as is" without express or implied warranty. D Almost totally re-written by Jordan Hubbard, Ardent computer corp.3 Previous code did not pass more strict compilers. */#include #include "dbug.h"#include #include "eventstack.h"extern char *malloc();void PushEvent(event, Eq)XEvent *event;struct Ev_q **Eq;{ struct Ev_q *ptr; Entry("PushEvent")  if (!*Eq) {: *Eq = ptr = (struct Ev_q *)malloc(sizeof(struct Ev_q)); ptr->prev = 0; } else {4 ptr = (struct Ev_q *)malloc(sizeof(struct Ev_q)); ptr->prev = *Eq; *Eq = ptr; }3 ptr->event = (XEvent *)malloc(sizeof(XEvent));. bcopy(ptr->event, event, sizeof(XEvent)); Leave_void}XEvent *PopEvent(Eq)struct Ev_q **Eq;{ struct Ev_q *ptr;  Entry("PopEvent") if (*Eq) { ptr = *Eq; *Eq = ptr->prev; free(ptr); Leave(ptr->event) } else Leave((XEvent *)0)}"*[FIELDS.X.AWM.MENUS]EVENTSTACK.H;2+,?./% 4fx-C0D123KPWO56 %7 8 Ք9fG%HJ/* #ifndef lintfstatic char sccs_id[] = "@(#)eventstack.h 2.1 12/16/87 Siemens Corporate Research and Support, Inc.";#endif*//* * RTL Menu Package Version 1.0D * by Joe Camaratta and Mike Berman, Siemens RTL, Princeton NJ, 1987 *C * eventstack.h: data structure definitions for eventstack package.E * rewritten almost entirely by Jordan Hubbard, Ardent Computer corp.6 * Previous version did not agree with many compilers. * */#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * */#ifndef _XLIB_H_#include #endif#include "std_defs.h"9#define EventStackIsEmpty(stk) (*stk == (struct Ev_q *)0) struct Ev_q { struct Ev_q *prev; XEvent *event;};;extern void SaveEvents(), RestoreEvents(), DisposeEvents(),C DiscardEventStore(), AddEventToStore(), RemoveEventFromStore();#extern Boolean EventStoreIsEmpty();extern void PushEvent();extern XEvent *PopEvent();*[FIELDS.X.AWM.MENUS]GRAY1.H;1+,C./% 4J -C0@123KPWO56@78IDՔ9fG%HJ#define gray1_width 16#define gray1_height 16static char gray1_bits[] = {J 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa,J 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa,3 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa};*[FIELDS.X.AWM.MENUS]MAKEFILE.;3+,0./% 4-C0D123KPWO56h47*8@gPH9fG%HJdefines : defines @[--]x_setuprtlmenu.obj : rtlmenu.c  cc/def=vms rtlmenu lib [-]awm rtlmenutrack_menu.obj : track_menu.c  cc/def=vms track_menu lib [-]awm track_menueventsave.obj : eventsave.c  cc/def=vms eventsave lib [-]awm eventsaveeventstack.obj : eventstack.c  cc/def=vms eventstack lib [-]awm eventstackmenu.obj : menu.c cc/def=vms menu lib [-]awm menu*[FIELDS.X.AWM.MENUS]MENU.C;4+,t.H/% 4eHGF-C0D123KPWOH56騡q7h;8hՔ9fG%HJ4 #ifndef linte static char sccs_id[] = "@(#)menu.c 2.1 12/16/87 Siemens Corporate Research and Support, Inc.";#endif/* RTL Menu Package Version 1.0C by Joe Camaratta and Mike Berman, Siemens RTL, Princeton NJ, 1987 - menu.c: menu utility and support functions. L Originally hacked by Adam J. Richter, based on the menu package for xterm. ( misc.c X10/6.6 ) *//* *I * Changed in various and subtle ways by Jordan Hubbard, Ardent Computer.F * February 1st, 1988: Removed dependence on oldX by nuking AssocTableF * stuff in favor of contexts. Added "label" panes, useful for titlingB * purposes. Variable height items, variable fonts, pictoral panes$ * (pixmaps) for cute graphic menus. *//* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*  Copyright 1987 byE Siemens Corporate Research and Support, Inc., Princeton, New Jersey ? Permission to use, copy, modify, and distribute this software: and its documentation for any purpose and without fee is: hereby granted, provided that the above copyright notice> appear in all copies and that both that copyright notice and@ this permission notice appear in supporting documentation, and8 that the name of Siemens not be used in advertising or> publicity pertaining to distribution of the software without7 specific, written prior permission. Siemens makes no@ representations about the suitability of this software for any= purpose. It is provided "as is" without express or implied warranty.  *//* I Copyright 1985, 1986, 1987 by the Massachusetts Institute of Technology 6 Permission to use, copy, modify, and distribute this< software and its documentation for any purpose and without: fee is hereby granted, provided that the above copyright: notice appear in all copies and that both that copyright8 notice and this permission notice appear in supporting; documentation, and that the name of M.I.T. not be used in< advertising or publicity pertaining to distribution of the6 software without specific, written prior permission.: M.I.T. makes no representations about the suitability of8 this software for any purpose. It is provided "as is"& without express or implied warranty.  */ /*K * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. * * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inC * supporting documentation, and that the name of Digital EquipmentD * Corporation not be used in advertising or publicity pertaining toK * distribution of the software without specific, written prior permission. * *K * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGK * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLJ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ORF * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,I * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,F * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */A/* Got that? Good! Now, there is actually some code in here.. */ #include #include #include #include #include #include "menu.h"#include "menu_def.h"#include "gray1.h"#include "arrow_icon.h"#include "dbug.h")#define MakeEven(x) ((x%2 == 0)? x : x-1)#define InvertPlane 1 static char Check_MarkBits[] = {4 0x00, 0x01, 0x80, 0x01, 0xc0, 0x00, 0x60, 0x00,3 0x31, 0x00, 0x1b, 0x00, 0x0e, 0x00, 0x04, 0x00 };Menu MenuDefault;/*7 * the following have already been set my GetDefaults() * by the time we get here. */XFontStruct *MFontInfo;XFontStruct *MBoldFontInfo;,int MBorderWidth, MPad, MDelta, MItemBorder;(Pixel MForeground, MBackground, MBorder;extern Boolean SaveUnder;extern int Reverse;extern Display *dpy;extern int scr;static XContext Menu_context;static XContext Item_context; static contexts_created = FALSE;9MenuItem *AddMenuItem(), *Display_Menu(), *MenuGetItem(),J *MenuItemByName(), *MenuItemByData(), *GetInitialItem(), *MoveMenu();HBoolean DisposeItem(), SetItemCheck(), SetItemDisable(), Recalc_Menu(),? SetupItems(), MapMenu(), SetItemText(), SetupMenuWindow();@void DisposeMenu(), InitMenu(), Undisplay_Menu(), MenuInvert(),@ PlacePointer(), Draw_Menu(), Draw_Item(), SetInitialItem(),> ClearInitialItem(), Generate_Menu_Entries(), UnmapMenu(), SetInputMask();!Menu *NewMenu(), *MenuGetMenu();int ItemGetMiddleY();/*H * AddMenuItem() adds a menu item to an existing menu, at the end of theH * list, which are number sequentially from zero. The menuitem index is * return, or -1 if failed. */.MenuItem *AddMenuItem(menu, text, bitmap_file) Menu *menu; char *text;char *bitmap_file;{ MenuItem *menuitem, **next; int junk; char *data; Entry("AddMenuItem")O if (!menu || (!text && !bitmap_file) || (menuitem = allocate(MenuItem, 1)) == (MenuItem *)0) Leave(NULLITEM)/ bzero((char *)menuitem, sizeof(MenuItem));= ItemText(menuitem) = allocate(char, (strlen(text) + 1));& strcpy(ItemText(menuitem), text);- ItemTextLength(menuitem) = strlen(text); if (bitmap_file) {7 bitmap_file = (char *)expand_from_path(bitmap_file);- if (XmuReadBitmapDataFromFile(bitmap_file,$ &(menuitem->itemTextWidth),! &(menuitem->itemHeight), &data,* &junk, &junk) != BitmapSuccess) {= fprintf(stderr, "awm: Can't read bitmap file '%s'\n", bitmap_file); exit(1); } menuitem->itemBackground => XCreatePixmapFromBitmapData(dpy, RootWindow(dpy, scr), data, menuitem->itemTextWidth, menuitem->itemHeight, MForeground, MBackground, DefaultDepth(dpy, scr));# if (!menuitem->itemBackground) {C fprintf(stderr, "awm: Can't create pixmap for file '%s'\n", bitmap_file); exit(1); } free(data); free(bitmap_file); }D for(next = &menu->menuItems; *next; next = &(*next)->nextItem); *next = menuitem;$ SetMenuFlag(menu, menuChanged); Leave(menuitem)} /*D * DisposeItem() releases the memory allocated for the given indexedD * menuitem. Nonzero is returned if an item was actual disposed of.@ * It also checks to see whether the item we're disposing is theA * initial item for the menu -- if so, null out the initial item. */Boolean DisposeItem(menu, item) Menu *menu;MenuItem *item;{( MenuItem **next, **last, *menuitem;  Entry("DisposeItem"). if (MenuIsNull(menu) || ItemIsNull(item)) Leave(FALSE) next = &MenuItems(menu); do { if(!*next) Leave(FALSE) last = next; next = &(*next)->nextItem;4 } while((*last != item) && !ItemIsNull(*next)); menuitem = *last; *last = *next; if (ItemWindow(menuitem)) {; XDeleteContext(dpy, ItemWindow(menuitem), Item_context);- XDestroyWindow(dpy, ItemWindow(menuitem));  }+ if (ItemIsInitialItem(menu, menuitem))r ClearInitialItem(menu); if (ItemText(menuitem))# free((char*)ItemText(menuitem));m free((char*)menuitem);n$ SetMenuFlag(menu, menuChanged); Leave(TRUE)}p t/*B * DisposeMenu() releases the memory allocated for the given menu. */avoid DisposeMenu(menu) Menu *menu; { Entry("DisposeMenu")d if(!menu) Leave_voidr( if (TestMenuFlag(menu, menuMapped)) UnmapMenu(menu);d/ while(DisposeItem(menu, MenuItems(menu)));i if(MenuWindow(menu)) {a7 XDeleteContext(dpy, MenuWindow(menu), Menu_context);g) XDestroyWindow(dpy, MenuWindow(menu));* }- XFreePixmap (dpy, MenuGreyPixmap(menu));C. XFreePixmap (dpy, MenuArrowPixmap(menu));2 XFreePixmap (dpy, MenuCheckmarkPixmap(menu));' XFreeGC (dpy, MenuNormalGC(menu)); ' XFreeGC (dpy, MenuInvertGC(menu)); ! XFreeGC (dpy, menu->boldGC);e o" if (MenuHasInitialItem(menu)) ClearInitialItem(menu); free((char*) menu); Leave_voida}estatic char *Name;void InitMenu(name, options) char *name;runsigned int options;r{s char *cp; * Entry("InitMenu") Name = name;o) MenuDefault.menuFlags = menuChanged;n d5 MenuDefault.menuInitialItemText = (char *) NULL;  MenuDefault.display = dpy;i MenuDefault.screen = scr;' MenuDefault.menuOptions = options;o Leave_void}i n/*1 * ItemText changes the text of item of the menu.J */%Boolean SetItemText(menu, item, text), Menu *menu;tMenuItem *item; char *text;u{t Entry("SetItemText")i, if (strcmp (ItemText(item), text) == 0) Leave (True)   if(ItemText(item))d! free((char *) ItemText(item));d s9 ItemText(item) = allocate(char, (strlen(text) + 1));" strcpy(ItemText(item), text); d* ItemTextLength(item) = strlen (text);$ SetMenuFlag(menu, menuChanged);  (void) Recalc_Menu (menu);s Leave(TRUE)}n i/*L * NewMenu() returns a pointer to an initialized new Menu structure, or NULL * if failed.p *F * The Menu structure _menuDefault contains the default menu settings. */bMenu *NewMenu()t{n& extern Pixmap MakeGreyStipple (); Menu *menu = 0; s XGCValues gcValues; d" static unsigned long gcMask =C (GCFunction | GCForeground | GCBackground | GCFont | GCStipple |o+ GCSubwindowMode | GCGraphicsExposures);c t char *cp; Entry("NewMenu")e /*r3 * Allocate the memory for the menu structure.t *// if(MenuIsNull((menu = allocate(Menu, 1))))r Leave(NULLMENU) w /*e% * Initialize to default values.. */ *menu = MenuDefault; $ gcValues.font = MFontInfo->fid; s /* A * If the menu cursor hasn't been given, make a default one. */> MenuCursor(menu) = XCreateFontCursor (dpy, XC_right_ptr);= MenuArrowPixmap(menu) = XCreatePixmapFromBitmapData(dpy,o RootWindow(dpy, scr),u arrow_bits,i arrow_width, arrow_height,o MForeground, MBackground, DefaultDepth(dpy, scr));6 MenuGreyPixmap(menu) = XCreateBitmapFromData(dpy, RootWindow(dpy, scr),  gray1_bits,u# gray1_width, gray1_height);a mA MenuCheckmarkPixmap(menu) = XCreatePixmapFromBitmapData(dpy,n! RootWindow(dpy, scr),w Check_MarkBits,  checkMarkWidth,* checkMarkHeight, MForeground, MBackground,$ DefaultDepth(dpy, scr));' gcValues.foreground = MForeground;L' gcValues.background = MBackground;O- gcValues.stipple = MenuGreyPixmap(menu); gcValues.function = GXcopy;0 gcValues.subwindow_mode = IncludeInferiors;) gcValues.graphics_exposures = False;I MenuNormalGC(menu) =N( XCreateGC (dpy, RootWindow(dpy, scr), gcMask, &gcValues); /* reverse */' gcValues.foreground = MBackground;u' gcValues.background = MForeground;c? MenuInvertGC(menu) = XCreateGC(dpy, RootWindow (dpy, scr),r gcMask,u &gcValues);e' gcValues.foreground = MForeground;u' gcValues.background = MBackground;( gcValues.font = MBoldFontInfo->fid;8 menu->boldGC = XCreateGC(dpy, RootWindow(dpy, scr), gcMask, &gcValues); Leave(menu)}, /*D * SetItemCheck sets the check state of item of the menu to "state". */'Boolean SetItemCheck(menu, item, state)n Menu *menu;fMenuItem *item;h int state;{e Entry("SetItemCheck")I if (TestItemFlag(item,itemChecked) == state) /* Exit if unchanged */B Leave (True)r , if (state)r" SetItemFlag(item, itemChecked); elseR$ ResetItemFlag(item, itemChecked); r$ SetItemFlag(item, itemChanged);( SetMenuFlag(menu, menuItemChanged); r Leave(TRUE)}u/*D * SetItemDeaf sets the "deaf" sta@}en~AWM.SAVEtC[FIELDS.X.AWM.MENUS]MENU.C;4eHZte of item of the menu to "state".I * "deaf" means that the item is display only and not sensitive to input.t */ &Boolean SetItemDeaf(menu, item, state) Menu *menu; MenuItem *item;p int state;{T Entry("SetItemDeaf")F if (TestItemFlag(item,itemDeaf) == state) /* Exit if unchanged */ Leave (True)_  if (state)n SetItemFlag(item, itemDeaf);e elset! ResetItemFlag(item, itemDeaf);  u$ SetItemFlag(item, itemChanged);( SetMenuFlag(menu, menuItemChanged);' if (ItemIsInitialItem(menu, item))i ClearInitialItem(menu); Leave(TRUE)}m /*L * SetItemDisable sets the disable state of item "n" of the menu to "state". */e)Boolean SetItemDisable(menu, item, state)) Menu *menu;MenuItem *item;h int state;{; Entry("SetItemDisable")J if (TestItemFlag(item,itemDisabled) == state) /* Exit if unchanged */ Leave (True)!  if(state) {# SetItemFlag(item, itemDisabled);nF /* if disabled item is currently initial item, null initial item */% if (ItemIsInitialItem(menu, item))o ClearInitialItem(menu); } elset% ResetItemFlag(item, itemDisabled);( m$ SetItemFlag(item, itemChanged);( SetMenuFlag(menu, menuItemChanged); ( Leave(TRUE)}  u*MenuItem *Display_Menu(menu, parent, x, y) Menu *menu;- Menu *parent;,int x;int y;{e MenuItem *item; a Entry("Display_Menu") if (MenuIsNull(menu)) Leave(FALSE)a ' MenuParent(menu) = parent;  t if (MenuIsNull(parent)) MenuNested(menu) = 0; else- MenuNested(menu) = MenuNested(parent) + 1;n0 if (!MenuWindow(menu) || TestMenuFlag(menu,+ (menuChanged | menuItemChanged))) { if (!SetupMenuWindow(menu)) Leave(NULL)  Generate_Menu_Entries(menu);! }) if (TestOptionFlag(menu,savebits) &&r( (MenuSavedPixmap(menu) != (Pixmap) 0))& SetInputMask(menu, MenuIgnoreMask); else}$ SetInputMask(menu, ExposureMask);: if (!(item = MoveMenu(menu, x, y)) || !MapMenu(menu)) Leave(FALSE)m Draw_Menu(menu);i  Leave(item)},void Undisplay_Menu(menu)n Menu *menu;{* Entry("Undisplay_Menu") if (MenuIsNull(menu)) Leave_voidm .! MenuParent(menu) = NULLMENU;s MenuNested(menu) = 0; e UnmapMenu(menu);i Leave_voidn}svoid MenuInvert(menu, item)e Menu *menu;nMenuItem *item;a{t Entry("MenuInvert") XFillRectangle(dpy, ItemWindow(item), MenuInvertGC(menu),a 0, 0,  MenuWidth(menu), item->itemHeight); Leave_voide}N (/*: * Recalculate all of the various menu and item variables. */Boolean Recalc_Menu(menu)v Menu *menu;l{  MenuItem *item;9 int max, height, fontheight, boldfontheight, nitems;N@ /* Gets set to false first time we see an item with text */( unsigned int menuIsPictures = TRUE; , Entry("Recalc_Menu")_ /*2 * We must have already gotten the menu font. */ if(!MFontInfo)m Leave(FALSE) /*n3 * Initialize the various max width variables.f */= fontheight = MFontInfo->ascent + MFontInfo->descent + 2;tI boldfontheight = MBoldFontInfo->ascent + MBoldFontInfo->descent + 2;) height = nitems = 0;t MenuMaxTextWidth(menu) = 0; /*eA * The item height is the maximum of the font height and themH * checkbox height, unless we find out that it's a pixmap (in which3 * case, most of these values are overridden).n */ max = fontheight; if(checkMarkHeight > max) max = checkMarkHeight;g e max += 2*MItemBorder; max = MakeEven(max);e  /*P& * Go through the menu item list. */A for(item = MenuItems(menu) ; item ; item = ItemNext(item)) { 8 if (item->itemBackground) /* pixmap is static size */ max = item->itemHeight;e else {n? if (ItemIsDeaf(item)) /* It's a label, use bold info */r max = boldfontheight;( else max = fontheight; } if (checkMarkHeight > max)a max = checkMarkHeight; if (!item->itemBackground) {  max += 2 * MItemBorder;u max = MakeEven(max); item->itemHeight = max;g } height += max;f nitems++; /*e7 * Check the text width with the max value stored in * menu.t */ if (!item->itemBackground) {o@ if ((ItemTextWidth(item) = XTextWidth(ItemIsDeaf(item) ? MBoldFontInfo : MFontInfo,e ItemText(item),$ strlen (ItemText(item))))+ > MenuMaxTextWidth(menu))iA MenuMaxTextWidth(menu) = ItemTextWidth(item);  menuIsPictures = FALSE;c }x: /* ItemTextWidth is really pixmap size. Yick. */ else {+@ if (ItemTextWidth(item) > MenuMaxTextWidth(menu))A MenuMaxTextWidth(menu) = ItemTextWidth(item); }( } /*m8 * Set the menu height and then set the menu width. */ MenuHeight(menu) = height;t' menu->avgHeight = height / nitems;M if (menuIsPictures == TRUE)@ MenuWidth(menu) = MenuMaxTextWidth(menu) + (2 * MItemBorder); else {GE MenuWidth(menu) = 4 * MenuItemPad(menu) + MenuMaxTextWidth(menu) +9 checkMarkWidth + arrow_width + (2 * MItemBorder);| }? MenuItemWidth(menu) = MenuWidth(menu) - (2 * MItemBorder);  Leave(TRUE)}) /*K * Figure out where to popup the menu, relative to the where the button wase * pressed.h. * Returns pointer to initial item to warp to. */u+static MenuItem *MoveMenu(menu, ev_x, ev_y) Menu *menu;/int ev_x, ev_y;a{e int x, y;# int total_width, total_height;u int offset; MenuItem *item; Window junk;  int r_x, foo, state;r  Entry("MoveMenu") /* E * Get the coordinates of the mouse when the button was pressed.; */ i? total_width = MenuWidth(menu) + 2 * MenuBorderWidth(menu);wA total_height = MenuHeight(menu) + 2 * MenuBorderWidth(menu);rE XQueryPointer(dpy, RootWindow(dpy, scr), &junk, &junk, &r_x, &y,D &foo, &foo, &state); " x = ev_x - MenuItemPad(menu); if (x < 0) x = 0;w2 else if (TestOptionFlag(menu, rightoffset) &&% !MenuIsNull(MenuParent(menu)))C {7 /* check whether parent is close to right edge... */ G /* "too close" means that child would leave < delta of its parent */cG /* visible to its left. */ ' if (TestOptionFlag(menu, bigoffset))D {D if (MenuX(MenuParent(menu)) + MenuWidth(MenuParent(menu)) > * DisplayWidth(dpy, scr) - total_width)! x = MenuX(MenuParent(menu)) , - total_width + 2*MenuBorderWidth(menu); } else= {D if (MenuX(MenuParent(menu)) + MenuDelta(MenuParent(menu)) > * DisplayWidth(dpy, scr) - total_width) {,B x = (MenuX(MenuParent(menu)) + MenuWidth(MenuParent(menu)) +) 2 * MenuBorderWidth(MenuParent(menu))e% - total_width - MenuDelta(menu));n }e } } if (x + total_width > DisplayWidth(dpy, scr))  x = DisplayWidth(dpy, scr)o - total_width;  /*aB * If we have an initial item, try to popup the menu centered$ * vertically within this item. */# if(MenuHasInitialItem(menu)) {& int tmp_y;  /*n> * Look through the item list. "y" is the vertical position@ * of the top of the current item and "n" is the item number. */" offset = MenuBorderWidth(menu);$ for(item = MenuItems(menu) ; ;) { /*9 * On finding the initial item, center within this item.d */, if (ItemIsInitialItem(menu, item)) { y -= offset; break; } else! offset += item->itemHeight; /*5 * If we run out of items, turn off the initial itema) * and treat this as if no initial item.* */& if(!(item = ItemNext(item))) { ClearInitialItem(menu); break; }s } } s if (y < 0) y = 0;a else if (y + total_height > DisplayHeight(dpy, scr))n { y = DisplayHeight(dpy, scr) - (total_height + 1);i } y = MakeEven(y) + 1;n. XMoveWindow(dpy, MenuWindow(menu), x, y); MenuX(menu) = x;, MenuY(menu) = y;t s( if (!ItemIsInitialItem(menu, item)) item = MenuItems(menu); Leave(item)}g ,void PlacePointer(menu, item)e Menu *menu;mMenuItem *item; {e int y;(  Entry("PlacePointer") y = ItemGetMiddleY(item); e XWarpPointer(dpy, None, RootWindow(dpy, scr),  0, 0, 0, 0, 3 MenuX(menu) + MPad + (MenuWidth(menu) / 2), y);; Leave_void"}I/* * Map the menu window.e */(static Boolean MapMenu(menu) Menu *menu;h{e Entry("MapMenu")) if (!TestMenuFlag(menu, menuMapped))g( MenuItemHighlighted(menu) = NULLITEM;  /* * Actually map the window. */ i' if (TestOptionFlag(menu,savebits))i {/ if ((MenuSavedPixmap(menu) == (Pixmap) 0) ||,1 (MenuOldWidth(menu) != MenuWidth(menu)) ||e3 (MenuOldHeight(menu) != MenuHeight(menu)) ||; (MenuOldBorderWidth(menu) != MenuBorderWidth(menu))), {0 if (MenuSavedPixmap(menu) != (Pixmap) 0). XFreePixmap(dpy, MenuSavedPixmap(menu));  MenuSavedPixmap(menu) =e XCreatePixmap(dpy,  RootWindow(dpy, scr), 0 MenuWidth(menu) + 2*MenuBorderWidth(menu),1 MenuHeight(menu) + 2*MenuBorderWidth(menu),u DefaultDepth(dpy, scr));K DBUG_5("Pixmaps","Created pixmap: width %d, height %d, depth %d\n",e2 MenuWidth(menu) + 2*MenuBorderWidth(menu),3 MenuHeight(menu) + 2*MenuBorderWidth(menu), ! DefaultDepth(dpy, scr)); s- MenuOldWidth(menu) = MenuWidth(menu);a/ MenuOldHeight(menu) = MenuHeight(menu); 9 MenuOldBorderWidth(menu) = MenuBorderWidth(menu);i } elsem) SetInputMask(menu, ExposureMask);L . if (MenuSavedPixmap(menu) != (Pixmap) 0) {  /* XFillRectangle(dpy, MenuSavedPixmap(menu),E SaveGC, 0,0,)- MenuWidth(menu) + 2*MenuBorderWidth(menu),2 MenuHeight(menu) + 2*MenuBorderWidth(menu)); */+ SetInputMask(menu, MenuIgnoreMask);n XCopyArea(dpy, s RootWindow(dpy, scr),t MenuSavedPixmap(menu), MenuNormalGC(menu)," MenuX(menu),  MenuY(menu), ,@ (unsigned int) (MenuWidth(menu) + 2*MenuBorderWidth(menu)), A (unsigned int) (MenuHeight(menu) + 2*MenuBorderWidth(menu)), i 0, 0); } elsea) SetInputMask(menu, ExposureMask);e * } a) XRaiseWindow(dpy, MenuWindow(menu));I' XMapWindow(dpy, MenuWindow(menu));g# SetMenuFlag(menu, menuMapped);  Leave(TRUE)}s i(static void Generate_Menu_Entries (menu) Menu *menu;s{t MenuItem *item; t# Entry("Generate_Menu_Entries") B for (item = MenuItems(menu); item; (item = ItemNext(item))) { m if (ItemGenerator(item)) {  char *newText; > (ItemGenerator(item)) (&newText, &ItemCallback(item));* SetItemText (menu, item, newText); } F if (ItemCheckproc(item))fD SetItemCheck (menu, item, (ItemCheckproc(item))(menu,item)); } Leave_void }h t/*, * Draw the entire menu in the blank window. */ void Draw_Menu(menu) Menu *menu;n{u MenuItem *item; h Entry("Draw_Menu")h& ResetMenuFlag(menu, menuChanged); /*fE * For each item in the list, first draw any check mark and then * draw the rest of it. */A for(item = MenuItems(menu) ; item ; item = ItemNext(item)) {e& if (TestOptionFlag(menu, savebits)) {: /* go ahead and draw it, don't wait for exposes */ Draw_Item(menu, item); } } Leave_voidt}> m/*) * Draw the item at vertical position y.e */*void Draw_Item(menu, item) Menu *menu;aMenuItem *item;t{ int y; /* baseline */t int x = MenuItemPad(menu);e5 int x1 = 2 * MenuItemPad(menu) + checkMarkWidth;t int pad;u int high; XGCValues gcValues; GC theGC; Entry("Draw_Item")>0 high = (MenuItemHighlighted(menu) == item);< theGC = high ? MenuInvertGC(menu) : MenuNormalGC(menu);* if (TestItemFlag(item, itemDisabled)) {, gcValues.fill_style = FillOpaqueStippled;3 XChangeGC(dpy, theGC, (GCFillStyle), &gcValues);t } ! if (!item->itemBackground) {(( XFillRectangle(dpy, ItemWindow(item),5 (high) ? MenuNormalGC(menu) : MenuInvertGC(menu), - 0, 0, MenuWidth(menu), item->itemHeight);W i /*B * Draw the check mark, possibly dimmed, wherever is necessary. */ }) if(TestItemFlag(item, itemChecked)){ - XCopyArea (dpy, MenuCheckmarkPixmap(menu),t ItemWindow(item), theGC,W- 0, 0, checkMarkWidth, checkMarkHeight,(: (int) x, (item->itemHeight - checkMarkHeight) / 2); }' /* Draw submenu indicator arrow */u if(ItemSubmenu(item)) {) XCopyArea (dpy, MenuArrowPixmap(menu),P ItemWindow(item), theGC,n 0, 0,! arrow_width, arrow_height,s' (int) (x + MenuItemWidth(menu) -d( arrow_width - MenuItemPad(menu)),2 (item->itemHeight - arrow_height) / 2 - 1); } /*n+ * Draw the text, centered vertically.e */! if (!item->itemBackground) {F' if (!TestItemFlag(item, itemDeaf)) {v" pad = (item->itemHeight - 6 (MFontInfo->ascent + MFontInfo->descent)) / 2;8 y = item->itemHeight - pad - MFontInfo->descent; / XDrawImageString(dpy, ItemWindow(item),t theGC,1 x1, y, ItemText(item), ItemTextLength(item));;- if (TestItemFlag(item, itemDisabled))r { & gcValues.fill_style = FillSolid; XChangeGC(dpy, theGC,m# (GCFillStyle), &gcValues); }   } else {W: pad = (item->itemHeight - (MBoldFontInfo->ascent +$ MBoldFontInfo->descent)) / 2;< y = item->itemHeight - pad - MBoldFontInfo->descent;D XDrawImageString(dpy, ItemWindow(item), menu->boldGC, x1, y,* ItemText(item), ItemTextLength(item)); } } Leave_voidg}n g/*8 * UnmapMenu() unmaps a menu, if it is currently mapped. */ static void UnmapMenu(menu) Menu *menu;.{* Entry("UnmapMenu")n3 if(!menu || !(TestMenuFlag(menu, menuMapped)))/ Leave_voids) XUnmapWindow(dpy, MenuWindow(menu));  ( if (TestOptionFlag(menu, savebits)) { if (MenuSavedPixmap(menu))n XCopyArea (dpy,t MenuSavedPixmap(menu),( RootWindow (dpy, scr),  MenuNormalGC(menu), 0, 0, o/ MenuWidth(menu) + 2*MenuBorderWidth(menu),s0 MenuHeight(menu) + 2*MenuBorderWidth(menu), MenuX(menu), MenuY(menu));  l }% ResetMenuFlag(menu, menuMapped);  Leave_voidn}r e%static Boolean SetupMenuWindow (menu) Menu *menu;d{iG int changed = TestMenuFlag(menu, (menuChanged | menuItemChanged));e  Entry("SetupMenuWindow")w% if (contexts_created == FALSE) {= contexts_created = TRUE; $ Menu_context = XUniqueContext(); # Item_context = XUniqueContext();r } m /*rG * If the entire menu has changed, throw away any saved pixmap andl * then call RecalcMenu(). */ k if(changed & menuChanged) { if(!Recalc_Menu(menu))f Leave(FALSE) changed &= ~menuItemChanged;. }  if(!MenuWindow(menu)) {# static unsigned long valuemask =9 CWOverrideRedirect | CWBorderPixel | CWBackPixel;t# XSetWindowAttributes attributes;n I' attributes.override_redirect = True; % attributes.border_pixel = MBorder; - attributes.background_pixel = MBackground;  if (SaveUnder) {e% attributes.save_under = True; ! valuemask |= CWSaveUnder; } if((MenuWindow(menu) =i XCreateWindow(dpy,  RootWindow(dpy, scr), 0, 0,) MenuWidth(menu), MenuHeight(menu),0 MenuBorderWidth(menu),g DefaultDepth(dpy, scr), InputOutput,  DefaultVisual(dpy, scr),  valuemask, &attributes) ) == (Window)0) Leave(FALSE)& else if (SetupItems(menu) == FALSE) Leave(FALSE)D XSaveContext(dpy, MenuWindow(menu), Menu_context, (char *) menu);) XMapSubwindows(dpy, MenuWindow(menu)); : XDefineCursor(dpy, MenuWindow(menu), MenuCursor(menu)); }% else if(changed & menuChanged) {P' XResizeWindow(dpy, MenuWindow(menu),;& MenuWidth(menu), MenuHeight(menu));! if (SetupItems(menu) == FALSE)0 Leave(FALSE)) XMapSubwindows(dpy, MenuWindow(menu));  } Leave(TRUE)}M tstatic Boolean SetupItems(menu)o Menu *menu;m{) int y;h MenuItem *item;G int changed = TestMenuFlag(menu, (menuChanged | menuItemChanged));t Entry("SetupItems") /. for (item = MenuItems(menu), y = 0; item;2 y += item->itemHeight, item = ItemNext(item)) { if (!ItemWindow(item)) {(( static unsigned long valuemask =9 (CWOverrideRedirect | CWBorderPixel | CWBackPixel);e( XSetWindowAttributes attributes;, attributes.override_redirect = True;* attributes.border_pixel = MBorder;2 attributes.background_pixel = MBackground; if((ItemWindow(item) = XCreateWindow(dpy,  MenuWindow(menu), 0, y, w MenuItemWidth(menu), + item->itemHeight - (2 * MItemBorder), u MItemBorder,n DefaultDepth(dpy, scr), InputOutput,  DefaultVisual(dpy, scr),r valuemask, &attributes) ) == (Window) 0)  Leave(FALSE)# if (item->itemBackground) {e7 XSetWindowBackgroundPixmap(dpy, ItemWindow(item),l" item->itemBackground);- XFreePixmap(dpy, item->itemBackground);l }u ItemMenu(item) = menu;9 XSaveContext(dpy, ItemWindow(item), Item_context,  (char *) item);, XDefineCursor(dpy, ItemWindow(item), MenuCursor(menu)); } $ else if (changed & menuChanged) {, XResizeWindow(dpy, ItemWindow(item), MenuItemWidth(menu), h. item->itemHeight - (2 * MItemBorder));1 XMoveWindow(dpy, ItemWindow(item), 0, y);M } } Leave(TRUE)} $static void SetInputMask(menu, mask) Menu *menu;unsigned int mask;{" MenuItem *item;  Entry("SetInputMask")( XSelectInput(dpy, MenuWindow(menu), (mask | MenuEventMask));? for(item = MenuItems(menu) ; item ; item = ItemNext(item)) {H if (TestItemFlag(item, itemDisabled) || TestItemFlag(item, itemDeaf))+ XSelectInput(dpy, ItemWindow(item),a (mask | MenuIgnoreMask)); else if (ItemIsLeaf(item))e+ XSelectInput(dpy, ItemWindow(item),e% (mask | NormalItemEventMask));s else + XSelectInput(dpy, ItemWindow(item),e& (mask | SubmenuItemEventMask)); } Leave_void }t$MenuItem *MenuItemByData(menu, data) Menu* menu; pointer data;*{T MenuItem *item; G Entry("MenuItemByData")! for (item = MenuItems(menu);x1 !ItemIsNull(item) && (ItemData(item) != data);e item = ItemNext(item)); k Leave(item)} %MenuItem *MenuItemByName (menu, name)a Menu *menu; char *name;a{h MenuItem *item; Entry("MenuItemByName")> for (item = MenuItems(menu); item; item = ItemNext(item))* if (strcmp (name, ItemText(item)) == 0) Leave(item)/ Leave(NULLITEM)}  t$MenuItem *MenuGetItem(menu, window) Menu *menu; Window window;{  MenuItem *foo = 0;  Window tmpwindow = window;t Entry("MenuGetItem")O if (!menu || !window) Leave(NULLITEM)$ if (window == menu->menuWindow) if (menu->highlightedItem)t6 tmpwindow = menu->highlightedItem->itemWindow;6 XFindContext(dpy, tmpwindow, Item_context, &foo); Leave(foo)e}*Menu *MenuGetMenu(menu, window)i Menu *menu;eWindow window;{x Menu *bar = 0;e  Entry("MenuGetMenu")(3 XFindContext(dpy, window, Menu_context, &bar);; Leave(bar)g}lint ItemGetMiddleY(item)MenuItem *item;"{ Window child;" XWindowAttributes attributes; int x, y; u Entry("ItemGetMiddleY")> XGetWindowAttributes(dpy, ItemWindow(item), &attributes); XTranslateCoordinates(dpy,i" MenuWindow(ItemMenu(item)),  RootWindow(dpy, scr), " attributes.x, attributes.y,  &x, &y, &child);& Leave((item->itemHeight / 2) + y)}M Nvoid SetInitialItem(menu, item)) Menu *menu; MenuItem *item;i{- extern char *realloc(); r Entry("SetInitialItem")$ if (MenuHasInitialItem(menu)) {B if (strlen(MenuInitialItemText(menu)) < strlen(ItemText(item)))# MenuInitialItemText(menu) =I) realloc(MenuInitialItemText(menu), # strlen(ItemText(item)) + 1); } elsee MenuInitialItemText(menu) =4 allocate(char,(strlen(ItemText(item)) + 1));7 strcpy(MenuInitialItemText(menu), ItemText(item));A Leave_voidP} void ClearInitialItem(menu)t Menu *menu; {  Entry("ClearInitialItem")$ if (MenuHasInitialItem(menu)) {# free(MenuInitialItemText(menu));e- MenuInitialItemText(menu) = (char *) NULL;h } Leave_void} MenuItem *GetInitialItem(menu) Menu *menu;y{ MenuItem *item; m Entry("GetInitialItem")$ if (MenuHasInitialItem(menu)) {? for(item = MenuItems(menu) ; item ; item = ItemNext(item)) {e* if (ItemIsInitialItem(menu, item)) Leave(item)e } } Leave((MenuItem *) NULL)y}t/* Some utility functions */void Retch(s, p1, p2, p3, p4)nchar *s;long p1, p2, p3, p4;{l char buffer[1024]; #ifdef VMS8 fprintf(stderr, "Error in %s %s\n", curr_rtn(), s);#else ( sprintf(buffer, s, p1, p2, p3, p4);= fprintf(stderr, "Error in %s %s\n", curr_rtn(), buffer); #endif return;}+ MBoldFontInfo->descent)) / 2;< y = item->itemHeight - pad - MBoldFontInfo->descent;D XDrawImageString(dpy, ItemWindow(item), menu->boldGC, x1, y,* ItemText(item), ItemTextLength(item)); } } Leave_voidg}n g/*8 * UnmapMenu() unmaps a menu, if it is currently mapped. */ static void UnmapMenu(menu) Menu *menu;.{* Entry("UnmapMenu")n3 if(!menu || !(TestMenuFlag(menu, me*[FIELDS.X.AWM.MENUS]MENU.H;3+,? ./% 4` -C0D123KPWO56 &7>O8|Ք9fG%HJ/* #ifndef lint`static char sccs_id[] = "@(#)menu.h 2.1 12/16/87 Siemens Corporate Research and Support, Inc.";#endif*//*  RTL Menu Package Version 1.0C by Joe Camaratta and Mike Berman, Siemens RTL, Princeton NJ, 1987 menu.h: menus header file" based on: menu.h X10/6.6 11/3/86*/#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*GCopyright 1985, 1986, 1987 by the Massachusetts Institute of Technology4Permission to use, copy, modify, and distribute this:software and its documentation for any purpose and without8fee is hereby granted, provided that the above copyright8notice appear in all copies and that both that copyright6notice and this permission notice appear in supporting9documentation, and that the name of M.I.T. not be used in:advertising or publicity pertaining to distribution of the4software without specific, written prior permission.8M.I.T. makes no representations about the suitability of6this software for any purpose. It is provided "as is"$without express or implied warranty.*//*Copyright 1987 byD Siemens Corporate Research and Support, Inc., Princeton, New Jersey4Permission to use, copy, modify, and distribute this:software and its documentation for any purpose and without8fee is hereby granted, provided that the above copyright8notice appear in all copies and that both that copyright6notice and this permission notice appear in supporting:documentation, and that the name of Siemens not be used in:advertising or publicity pertaining to distribution of the4software without specific, written prior permission.9Siemens makes no representations about the suitability of6this software for any purpose. It is provided "as is"$without express or implied warranty.*/ #ifndef MENU_INCLUDE#define MENU_INCLUDE/*F * Menu items are constructed as follows, starting from the left side: * * menuItemPad * space for check mark * menuItemPad * text + padding * menuItemPad *N * The padding for the text is that amount that this text is narrower than the * widest text. */extern void Retch();#include "std_defs.h"#include "rtlmnu_opt.h"typedef void (*Callback) ();"typedef struct _menuItem MenuItem;typedef struct _menu Menu;/*? * Special note for those familiar with the original RTL menus:? * Where we used to keep height and width information for items< * in the _menu structure, we now just keep width. Each item9 * can be of a different height, but is still constrainedA * to a fixed width (which is the width of the widest item in theA * menu). We could allow variable widths, but the menu would lookA * like hell. We also allow arbitrary pixmap backgrounds for each * item now. */struct _menuItem {% int itemFlags; /* flags of item */3#define itemDisabled 0x0001 /* item is disabled */5#define itemChecked 0x0002 /* item has check mark */.#define itemDeaf 0x0004 /* item is a label */5#define itemChanged 0x0010 /* item desires change */6 Pixmap itemBackground; /* either zero or a pixmap */4 char *itemText; /* text of item (if no pixmap) */< unsigned int itemTextWidth; /* width of text (or pixmap) */2 unsigned int itemTextLength; /* length of text */3 unsigned int itemHeight; /* height of this item */5 struct _menuItem *nextItem; /* next item in chain */7 struct _menu *itemSubmenu; /* For pull-right menus */2 Callback generator; /* Change string and data */? caddr_t genParamPointer; /* Address for generated parameter */< Boolean (*checkproc) (); /* Checkmark callback generator */= Callback itemCallback; /* user callback for item */E pointer itemData; /* user data associated with menu */< Window itemWindow; /* window of item */G Menu *itemMenu; /* menu this item belongs to */}; struct _menu {2 unsigned int menuWidth; /* full width of menu */3 unsigned int menuHeight; /* full height of menu */& unsigned int avgHeight; /* Hack.. */" unsigned int menuOldWidth;# unsigned int menuOldHeight;B unsigned int menuItemWidth; /* width of a menu item */* int menuFlags; /* flags of this menu */<# define menuChanged 0x0001 /* menu changed, must redraw */@# define menuItemChanged 0x0002 /* item changed, must redraw */4# define menuMapped 0x0004 /* menu is now mapped */: unsigned int menuMaxTextWidth; /* width of widest text */( unsigned int menuOldBorderWidth;) Display *display; /* display of menu */4 int screen; /* screen on which to display menu */) Window menuWindow; /* window of menu */. Cursor menuCursor; /* cursor used in menu */B Pixmap savedPixmap; /* for saving image under menu */4 MenuItem *menuItems; /* head of menu item chain */, XFontStruct *menuFontInfo; /* Font info */ XFontStruct *boldFont;' GC normalGC; /* Graphics contexts */, GC invertGC; /* Used for inverted text */ GC boldGC; /* For labels */4 Pixmap greyPixmap; /* Need to know what to free */> Pixmap checkmarkPixmap; /* Pixmap for drawing check mark. */5 Pixmap arrowPixmap; /* Pixmap for drawing arrow. */9 char *menuInitialItemText; /* != NULL, initial item */7 MenuItem *highlightedItem; /* highlighted menu item */- int menuNested; /* depth you are nested */' int menuX, menuY; /* Menu position */J struct _menu *parentMenu; /* menu to which you are a submenuE * (NULL if you are the root) */B MenuOptionsMask menuOptions; /* option values for this menu */ };#endif MENU_INCLUDE *[FIELDS.X.AWM.MENUS]MENU_DEF.H;2+,YD./% 4g-C0D123KPWO56 -,7s8]Ք9fG%HJ/* #ifndef lintgstatic char sccs_id[] = "@(#)menu.define.h 2.1 12/16/87 Siemens Corporate Research and Support, Inc.";#endif*//* RTL Menu Package Version 1.0C by Joe Camaratta and Mike Berman, Siemens RTL, Princeton NJ, 1987! menu.h: macros for menu package#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*Copyright 1987 byD Siemens Corporate Research and Support, Inc., Princeton, New Jersey=Permission to use, copy, modify, and distribute this software8and its documentation for any purpose and without fee is8hereby granted, provided that the above copyright notice<appear in all copies and that both that copyright notice and>this permission notice appear in supporting documentation, and6that the name of Siemens not be used in advertising or<publicity pertaining to distribution osp~AWM.SAVEYDC [FIELDS.X.AWM.MENUS]MENU_DEF.H;2gf the software without5specific, written prior permission. Siemens makes no>representations about the suitability of this software for any;purpose. It is provided "as is" without express or implied warranty.*/#ifndef MENU_DEF_INCLUDE#define MENU_DEF_INCLUDE'/* Menu data structure access macros */)#define MenuWidth(menu) (menu)->menuWidth+#define MenuHeight(menu) (menu)->menuHeight/#define MenuOldWidth(menu) (menu)->menuOldWidth1#define MenuOldHeight(menu) (menu)->menuOldHeight1#define MenuItemWidth(menu) (menu)->menuItemWidth)#define MenuFlags(menu) (menu)->menuFlags7#define MenuMaxTextWidth(menu) (menu)->menuMaxTextWidth*#define MenuBorderWidth(menu) MBorderWidth;#define MenuOldBorderWidth(menu) (menu)->menuOldBorderWidth#define MenuItemPad(menu) MPad)#define MenuDisplay(menu) (menu)->display'#define MenuScreen(menu) (menu)->screen+#define MenuWindow(menu) (menu)->menuWindow+#define MenuCursor(menu) (menu)->menuCursor1#define MenuSavedPixmap(menu) (menu)->savedPixmap1#define MenuSavedImage(menu) ((menu)->savedImage)5#define MenuSavedImageX(menu) (menu)->menuSavedImageX5#define MenuSavedImageY(menu) (menu)->menuSavedImageY)#define MenuItems(menu) (menu)->menuItems/#define MenuFontInfo(menu) (menu)->menuFontInfo+#define MenuNormalGC(menu) (menu)->normalGC+#define MenuInvertGC(menu) (menu)->invertGC'#define MenuGreyGC(menu) (menu)->greyGC/#define MenuGreyPixmap(menu) (menu)->greyPixmap9#define MenuCheckmarkPixmap(menu) (menu)->checkmarkPixmap1#define MenuArrowPixmap(menu) (menu)->arrowPixmap=#define MenuInitialItemText(menu) (menu)->menuInitialItemText9#define MenuItemHighlighted(menu) (menu)->highlightedItem+#define MenuNested(menu) (menu)->menuNested!#define MenuX(menu) (menu)->menuX!#define MenuY(menu) (menu)->menuY+#define MenuParent(menu) (menu)->parentMenu#define MenuDelta(menu) MDelta-#define MenuOptions(menu) (menu)->menuOptions #define NULLMENU ((Menu *) NULL)/* Menu predicates */+#define MenuIsNull(menu) (menu == NULLMENU)<#define MenuIsDisplayed(menu) (menu->menuFlags & menuMapped)M#define MenuHasInitialItem(menu) (menu->menuInitialItemText != (char *) NULL)/* Menu modifiers */C#define SetHighlightItem(menu, item) (menu->highlightedItem = item)C#define ResetHighlightItem(menu) (menu->highlightedItem = NULLITEM)>#define SetMenuEventHandler(menu,f) menu->menuEventHandler = f;#define SetMenuFlag(menu, flag) MenuFlags(menu) |= flag<#define ResetMenuFlag(menu,flag) MenuFlags(menu) &= ~flag<#define TestMenuFlag(menu,flag) (MenuFlags(menu) & flag)@#define TestOptionFlag(menu,option) (MenuOptions(menu) & option)'/* Item data structure access macros */)#define ItemFlags(item) (item)->itemFlags'#define ItemText(item) (item)->itemText3#define ItemTextLength(item) (item)->itemTextLength1#define ItemTextWidth(item) (item)->itemTextWidth'#define ItemNext(item) (item)->nextItem-#define ItemSubmenu(item) (item)->itemSubmenu%#define ItemTag(item) (item)->itemTag-#define ItemGenerator(item) (item)->generator?#define ItemGeneratorParamPointer(item) (item)->genParamPointer-#define ItemCheckproc(item) (item)->checkproc/#define ItemCallback(item) (item)->itemCallback'#define ItemData(item) (item)->itemData+#define ItemWindow(item) (item)->itemWindow'#define ItemMenu(item) (item)->itemMenu$#define NULLITEM ((MenuItem *) NULL)L#define ItemGetArrowPosition(item) (item->itemMenu->menuWidth - arrow_width)/* Item predicates */+#define ItemIsNull(item) (item == NULLITEM)'#define ItemIsInitialItem(menu, item) \# (MenuInitialItemText(menu) && \> (strcmp(MenuInitialItemText(menu), ItemText(item)) == 0))K#define ItemIsLeaf(item) ((item->itemSubmenu == (Menu *) 0) ? TRUE : FALSE)=#define ItemIsDisabled(item) (ItemFlags(item) & itemDisabled)5#define ItemIsDeaf(item) (ItemFlags(item) & itemDeaf)/* Item modifiers */6#define CheckItem(menu,item) SetItemCheck(menu,item,1):#define DisableItem(menu,item) SetItemDisable(menu,item,1)9#define EnableItem(menu,item) SetItemDisable(menu,item,0)8#define UncheckItem(menu,item) SetItemCheck(menu,item,0)7#define SetItemFlag(item, flag) ItemFlags(item) |= flag9#define ResetItemFlag(item,flag) ItemFlags(item) &= ~flag8#define TestItemFlag(item,flag) (ItemFlags(item) & flag)(#define MoveItemFlag(item,flag1,flag2) \" if (TestItemFlag(item,flag1))\! SetItemFlag(item,flag2);\ else\# ResetItemFlag(item,flag2);\ ResetItemFlag(item,flag1); /* Masks */M#define MenuEventMask (LeaveWindowMask | EnterWindowMask | ButtonReleaseMask))#define NormalItemEventMask MenuEventMask@#define SubmenuItemEventMask (MenuEventMask | PointerMotionMask)(#define MenuIgnoreMask (unsigned long) 0/* Magic numbers */#define checkMarkWidth 9#define checkMarkHeight 8!#define defaultCursorWidth 16!#define defaultCursorHeight 16#define defaultCursorX 1#define defaultCursorY 1#define lineSeparatorHeight 9/* external declarations */extern Menu *NewMenu();extern MenuItem *TrackMenu ();5extern MenuItem *MenuItemByName (), *Display_Menu(); extern void InitMenu ();extern void DisposeMenu ();extern void Draw_Menu();#endif MENU_DEF_INCLUDE *[FIELDS.X.AWM.MENUS]MENU_EXT.H;2+,ZD./% 4gZ-C0D123KPWO56`4,7@-8@Ք9fG%HJ/* #ifndef lintgstatic char sccs_id[] = "@(#)menu.extern.h 2.1 12/16/87 Siemens Corporate Research and Support, Inc.";#endif*//*  RTL Menu Package Version 1.0C by Joe Camaratta and Mike Berman, Siemens RTL, Princeton NJ, 1987@ menu.extern.h: external function declarations for menu package*/#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * */extern MenuItem *AddMenuItem();!extern Boolean DisposeItem();extern void DisposeMenu();extern void InitMenu();!extern Boolean SetItemText();extern Menu *NewMenu();"extern Boolean SetItemCheck();$extern Boolean SetItemDisable(); extern MenuItem *Display_Menu();!extern void Undisplay_Menu();extern void MenuInvert();extern void PlacePointer();extern void Draw_Menu();extern void Draw_Item();extern MenuItem *MenuGetItem();"extern MenuItem *MenuItemByName();"extern MenuItem *MenuItemByData();extern Menu *MenuGetMenu();!extern int ItemGetMiddleY();!extern void SetInitialItem();#extern void ClearInitialItem();"extern MenuItem *GetInitialItem();extern MenuItem *TrackMenu();!*[FIELDS.X.AWM.MENUS]NULL_ICON.H;1+,C./% 4t-C0@123KPWO56 7`8`Ք9fG%HJ#define null_icon_width 1#define null_icon_height 1static char null_icon_bits[] = { 0x00};*[FIELDS.X.AWM.MENUS]README.;1+,C./% 4F-C0@123KPWO56X 7@̪8@LՔ9fG%HJLast changed February 8th, 1989@Menus panes are now redrawn differently. Rather than waiting forDa "side-effect" expose from a copy area, trackmenu() just draws themFitself. This should result in substantially better behaviour on colour7systems. A number of nits have been cleaned up as well. Jordan Hubbard----- RTLMenus Version 1.0 Release 2.15This menu package was written at Siemens Research and;Technologies Laboratory, Princeton, NJ, in the second half kof 1987.:The original basis for the source file menu.c was the menu<package for version X10/6.6 of xterm (misc.c). We thank the8programmers who gave us this basis from which to expand.8We wrote this package to meet the needs of the RTL Tiled7Windows window manager which is under development here.=We have simulated much of the functionality of the SunWindows9Toolkit menus. The package has been tested only on Suns.<We welcome enhancements and changes, and we would appreciate=hearing about them. We'll be glad to accept bug reports, but;we can't support this package beyond our own needs. We are9making it available because you 1) may be able to use it,%and 2) may learn some tricks from it.=We found the DBUG C Program Debugging Package by Fred Fish to=be useful in debugging track_menu.c. The DBUG macros remain,6so you can use them to trace the code if you have DBUG:available. The Makefile assumes you do NOT have DBUG, andturns it off. >Adam J. Richter of UC Berkeley wrote an initial version of the<menus while he was here last summer. Joe Camaratta and Mike=Berman designed and built the present version. This work was=performed with the guidance of Ellis Cohen and the assistanceof Mark Biggers.8We thank those who beta-tested the menus; in particular,;thanks to George Sherouse and Mark Baushke for their useful suggestions. --Mike Berman berman%siemens@princeton.edu (609)734-6500 x2293*[FIELDS.X.AWM.MENUS]RTLMENU.C;3+,WD./% 4h-C0D123KPWO56 ?+78Ք9fG%HJ( #ifndef linth static char sccs_id[] = "@(#)rtlmenu.c 2.1 12/16/87 Siemens Corporate Research and Support, Inc.";#endif/*  RTL Menu Package Version 1.0C by Joe Camaratta and Mike Berman, Siemens RTL, Princeton NJ, 1987 - rtlmenu.c: interface level for menu package */#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*  Copyright 1987 byE Siemens Corporate Research and Support, Inc., Princeton, New Jersey ? Permission to use, copy, modify, and distribute this software: and its documentation for any purpose and without fee is: hereby granted, provided that the above copyright notice> appear in all copies and that both that copyright notice and@ this permission notice appear in supporting documentation, and8 that the name of Siemens not be used in advertising or> publicity pertaining to distribution of the software without7 specific, written prior permission. Siemens makes no@ representations about the suitability of this software for any= purpose. It is provided "as is" without express or implied warranty.  */#include #include #include "menu.h"#include "menu_def.h"#include "menu_ext.h"#include "rtlmenu.h"#include "dbug.h"extern Display *dpy;extern int scr;static RTLPoint menu_pos;static int initialized = 0; &void RTLMenu_Initialize (options_mask)MenuOptionsMask options_mask;{ Entry("RTLMenu_Initialize") if (initialized) return; initialized = 1;$ InitMenu ("awm", options_mask); Leave_void}B/* ------------------------------------------------------------ */RTLMenu RTLMenu_Create(){ Entry("RTLMenu_Create")< /* Create a menu with no name, not in inverse video. */  Leave((RTLMenu)NewMenu())}B/* ------------------------------------------------------------ */void RTLMenu_Destroy( menu ) RTLMenu menu;{ Entry("RTLMenu_Destroy") DisposeMenu ((Menu*) menu); Leave_void}B/* $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ */"pointer RTLMenu_Data( menu, item ) /*ARGSUSED*/ RTLMenu menu;RTLMenuItem item;{ Entry("RTLMenu_Data")% Leave(ItemData((MenuItem*)item))}B/* ------------------------------------------------------------ */(RTLMenu RTLMenu_Get_Submenu( menu, str ) RTLMenu menu; char *str;{9 MenuItem *item = MenuItemByName ((Menu*) menu, str); ! Entry("RTLMenu_Get_Submenu") if (!ItemIsNull(item))$ Leave((RTLMenu)ItemSubmenu(item)) Leave(0)}C /* $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ */ /*ARGSUSED*/-static void RTLMenu_Client_Send( menu, item ) RTLMenu menu;RTLMenuItem item;{! Entry("RTLMenu_Client_Send")P printf ("RTLMenu_Client_Send not yet implemented for X, string = \"%s\"\n", (char*) item); Leave_void}B/* ------------------------------------------------------------ */6RTLMenuItem RTLMenu_Append_String( menu, str, strval ) RTLMenu menu; char *str; char *strval;{B MenuItem *item = AddMenuItem((Menu*)menu, str, (char *)NULL); # Entry("RTLMenu_Append_String")8 ItemCallback(item) = (Callback)RTLMenu_Client_Send;' ItemData(item) = (pointer) strval; Leave((RTLMenuItem)item)}B/* ------------------------------------------------------------ */5RTLMenuItem RTLMenu_Append_Callback( menu, backproc ) RTLMenu menu;VoidFunc backproc;{A MenuItem *item = AddMenuItem((Menu*)menu, "", (char *)NULL); % Entry("RTLMenu_Append_Callback"). ItemGenerator(item) = (Callback)backproc;  Leave((RTLMenuItem)item)}C /* ------------------------------------------------------------ */?RTLMenuItem RTLMenu_Append_Call( menu, str, pix, proc, ptrval ) RTLMenu menu; char *str; char *pix;VoidFunc proc;pointer ptrval;{9 MenuItem *item = AddMenuItem((Menu*)menu, str, pix); ! Entry("RTLMenu_Append_Call") ItemCallback(item) = proc; ItemData(item) = ptrval;  Leave((RTLMenuItem)item)}B/* ------------------------------------------------------------ */ORTLMenuItem RTLMenu_Append_Checkback( menu, str, pix, checkproc, proc, ptrval ) RTLMenu menu;char *str; /* Menu string */ char *pix;DBoolean (*checkproc) (); /* Boolean function called when menu entry- is about to be displayed. If true, then- the item appears checked; if false, then it does not */7VoidFunc proc; /* function to be called when the item  is selected */4pointer ptrval; /* data associated with this item */{9 MenuItem *item = AddMenuItem((Menu*)menu, str, pix); & Entry("RTLMenu_Append_Checkback") ItemCallback(item) = proc; ItemData(item) = ptrval;& ItemCheckproc(item) = checkproc;  Leave((RTLMenuItem)item)}B/* ------------------------------------------------------------ */=RTLMenuItem RTLMenu_Append_Submenu( menu, str, pix, submenu ) RTLMenu menu; char *str; char *pix;RTLMenu submenu;{9 MenuItem *item = AddMenuItem((Menu*)menu, str, pix); $ Entry("RTLMenu_Append_Submenu")( ItemSubmenu(item) = (Menu*)submenu;  Leave((RTLMenuItem)item)}C /* $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ */9void RTLMenu_Replace_Data_Keyed_String( menu, data, str ) RTLMenu menu; pointer data; char *str;{8 MenuItem *item = MenuItemByName((Menu*) menu, str); * Entry("RTLMenu_Replace_Keyed_String") if (!ItemIsNull(item)) ItemData(item) = data; Leave_void} B/* $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ */)void RTLMenu_Activate_Entry( menu, item ) RTLMenu menu;RTLMenuItem item;{$ Entry("RTLMenu_Activate_Entry")? (void)SetItemDisable((Menu*)menu, (MenuItem*)item, FALSE); Leave_void}F/* ------------------------------------------------------------ */ +void RTLMenu_Inactivate_Entry( menu, item ) RTLMenu menu;RTLMenuItem item;{& Entry("RTLMenu_Inactivate_Entry")> (void)SetItemDisable((Menu*)menu, (MenuItem*)item, TRUE); Leave_void}&void RTLMenu_Label_Entry( menu, item ) RTLMenu menu;RTLMenuItem item;{! Entry("RTLMenu_Label_Entry"); (void)SetItemDeaf((Menu*)menu, (MenuItem*)item, TRUE); Leave_void}B/* $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ */%Boolean RTLMenu_Has_Data( menu, val ) RTLMenu menu; pointer val;{7 MenuItem *item = MenuItemByData((Menu*)menu, val); Entry("RTLMenu_Has_Data") Leave(!ItemIsNull(item))}C /* $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ */#void RTLMenu_Delete_Entries( menu ) RTLMenu menu;{$ Entry("RTLMenu_Delete_Entries")> while (DisposeItem((Menu*)menu, MenuItems((Menu*)menu))); Leave_void}B/* ------------------------------------------------------------ */'void RTLMenu_Delete_String( menu, str ) RTLMenu menu; char *str;{8 MenuItem *item = MenuItemByName((Menu*) menu, str); $ Entry("RTLMenu_Delete_String"); if (!ItemIsNull(item))* (void) DisposeItem ((Menu*)menu, item); Leave_void}B/* ------------------------------------------------------------ */%void RTLMenu_Delete_Data( menu, val ) RTLMenu menu;c pointer val;{m7 MenuItem *item = MenuItemByData((Menu*)menu, val);t ;" Entry("RTLMenu_Delete_Data"); if (!ItemIsNull(item))t) (void) DisposeItem((Menu*)menu, item);N Leave_voidt}nB/* $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ */ /*ARGSUSED*/void RTLMenu_Box( menu ) RTLMenu menu;C{o /* Commented out */}*C /* ------------------------------------------------------------ */A /*ARGSUSED*/=void RTLMenu_Enter( menu, butnum, buttime, base_window, pos ) RTLMenu menu;s int butnum;a Time buttime;rWindow base_window;i RTLPoint pos;d{ MenuItem *selected; g Entry("RTLMenu_Enter")s menu_pos = pos;@ selected = TrackMenu ((Menu*) menu, menu_pos.x, menu_pos.y,$ butnum, base_window, buttime); if (!ItemIsNull(selected))n: (ItemCallback(selected)) (menu, selected, base_window); Leave_voidd}rB/* ------------------------------------------------------------ */RTLPoint RTLMenu_Entry_Pos(){h Entry("RTLMenu_Entry_Pos")eC /* menu_pos is a global static that gets set by the call to */ C /* XQueryPointer that is used by the TrackMenu call. */t  Leave(menu_pos)}e'void RTLMenu_Generate_Items(menu, proc)v>/* apply VoidFunc proc to each item in the menu, with */>/* arguments menu and menuItem */ RTLMenu menu;,VoidFunc proc;{m MenuItem *item; d$ Entry("RTLMenu_Generate_Items")( for (item = MenuItems((Menu*)menu);, !ItemIsNull(item); item = ItemNext(item)) {, (proc)((RTLMenu)menu, (RTLMenuItem)item); } Leave_voidp}.It is provided "as is" without express or implied warranty.  */#include #include #include "menu.h"#include "menu_def.h"#include "menu_ext.h"#include "rtlmenu.h"#include "dbug.h"extern Display *dpy;extern int scr;static RTLPoint menu_pos;static int*[FIELDS.X.AWM.MENUS]RTLMENU.H;3+,?./% 4c|-C0D123KPWO56@sO"&7x8Ք9fG%HJ /* #ifndef lintcstatic char sccs_id[] = "@(#)rtlmenu.h 2.1 12/16/87 Siemens Corporate Research and Support, Inc.";#endif*//*  RTL Menu Package Version 1.0C by Joe Camaratta and Mike Berman, Siemens RTL, Princeton NJ, 1987) rtlmenu.h: definitions for rtlmenu user*/#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*Copyright 1987 byD Siemens Corporate Research and Support, Inc., Princeton, New Jersey=Permission to use, copy, modify, and distribute this software8and its documentation for any purpose and without fee is8hereby granted, provided that the above copyright notice<appear in all copies and that both that copyright notice and>this permission notice appear in supporting documentation, and6that the name of Siemens not be used in advertising or<publicity pertaining to distribution of the software without5specific, written prior permission. Siemens makes no>representations about the suitability of this software for any;purpose. It is provided "as is" without express or implied warranty.*/#ifndef RTL_INCLUDE#define RTL_INCLUDE#include "std_defs.h"struct _RTLPoint{ int x, y;};"typedef struct _RTLPoint RTLPoint;typedef pointer RTLMenu; typedef pointer RTLMenuItem; RTLMenu RTLMenu_Create();"RTLMenuItem RTLMenu_Append_Call();'RTLMenuItem RTLMenu_Append_Checkback();%RTLMenuItem RTLMenu_Append_Submenu();#include "rtlmnu_opt.h"#endif RTL_INCLUDE"*[FIELDS.X.AWM.MENUS]RTLMNU_EXT.H;1+,CO./% 4jR-C0@123KPWO56L788,Ք9fG%HJ /* #ifndef lintjstatic char sccs_id[] = "@(#)rtlmenu.extern.h 2.1 12/16/87 Siemens Corporate Research and Support, Inc.";#endif*//*  RTL Menu Package Version 1.0C by Joe Camaratta and Mike Berman, Siemens RTL, Princeton NJ, 19879 rtlmenu.extern.h: external definitions for rtlmenu user*//* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*Copyright 1987 byD Siemens Corporate Research and Support, Inc., Princeton, New Jersey=Permission to use, copy, modify, and distribute this software8and its documentation for any purpose and without fee is8hereby granted, provided that the above copyright notice<appear in all copies and that both that copyright notice and>this permission notice appear in supporting documentation, and6that the name of Siemens not be used in advertising or<publicity pertaining to distribution of the software without5specific, written prior permission. Siemens makes no>representations about the suitability of this software for any;purpose. It is provided "as is" without express or implied warranty.*/4extern void RTLMenu_Initialize(), RTLMenu_Destroy(),B RTLMenu_Replace_Data_Keyed_String(), RTLMenu_Activate_Entry(),9 RTLMenu_Inactivate_Entry(), RTLMenu_Delete_Entries(),3 RTLMenu_Delete_String(), RTLMenu_Delete_Data(),. RTLMenu_Enter(), RTLMenu_Generate_Items(); "extern Boolean RTLMenu_Has_Data();7extern RTLMenu RTLMenu_Create(), RTLMenu_Get_Submenu();extern pointer RTLMenu_Data();Fextern RTLMenuItem RTLMenu_Append_String(), RTLMenu_Append_Callback(),6 RTLMenu_Append_Call(), RTLMenu_Append_Checkback(), RTLMenu_Append_Submenu();%extern RTLPoint RTLMenu_Entry_Pos(); "*[FIELDS.X.AWM.MENUS]RTLMNU_OPT.H;1+,C./% 4k~-C0@123KPWO56@!7`8`AՔ9fG%HJ/* #ifndef lintkstatic char sccs_id[] = "@(#)rtlmenu.options.h 2.1 12/16/87 Siemens Corporate Research and Support, Inc.";#endif*//*  RTL Menu Package Version 1.0C by Joe Camaratta and Mike Berman, Siemens RTL, Princeton NJ, 19872 rtlmenu.options.h: option flags for rtlmenu user*//*Copyright 1987 byD Siemens Corporate Research and Support, Inc., Princeton, New Jersey=Permission to use, copy, modify, and distribute this software8and its documentation for any purpose and without fee is8hereby granted, provided that the above copyright notice<appear in all copies and that both that copyright notice and>this permission notice appear in supporting documentation, and6that the name of Siemens not be used in advertising or<publicity pertaining to distribution of the software without5specific, written prior permission. Siemens makes no>representations about the suitability of this software for any;purpose. It is provided "as is" without express or implied warranty.*/#ifndef OPTION_FLAGS#define OPTION_FLAGS/* flags for menu operation */%typedef unsigned int MenuOptionsMask;T#define clickokay (1L<<0) /* accept click-click as equivalent to press-release */T#define savebits (1L<<1) /* attempt to save/restore area under menu */T#define fixedchild (1L<<2) /* pull up child in fixed position relative to parent */T#define rightoffset (1L<<3) /* when pulling up on right edge, should child be */T /* offset to left, allowing parent to remain visible */T#define bigoffset (1L<<4) /* valid only when rightoffset=1. if bigoffset=1, */T /* offset child far enough to see most of parent; */T /* else, just far enough to get back to parent. */9#define RTLMenu_Option_Set(mask, option) (mask |= option)#endif *[FIELDS.X.AWM.MENUS]STD_DEFS.H;1+,C./% 4w-C0@123KPWO56e7@$8@^RՔ9fG%HJ/* #ifndef lintwstatic char sccs_id[] = "@(#)std_defs.h 2.5 4/13/87 Copyright (c) 1987, Siemens Corporate Research and Support, Inc.";#endif*//*  RTL Menu Package Version 1.0C by Joe Camaratta and Mike Berman, Siemens RTL, Princeton NJ, 1987> std_defs.h: standard definitions shared among menu programs.*/#include /* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*Copyright 1987 byD Siemens Corporate Research and Support, Inc., Princeton, New Jersey4Permission to use, copy, modify, and distribute this:software and its documentation for any purpose and without8fee is hereby granted, provided that the above copyright8notice appear in all copies and that both that copyright6notice and this permission notice appear in supporting:documentation, and that the name of Siemens not be used in:advertising or publicity pertaining to distribution of the4software without specific, written prior permission.9Siemens makes no representations about the suitability of6this software for any purpose. It is provided "as is"$without express or implied warranty.*/#ifndef STD_DEFS#define STD_DEFS#include /* useful macros */typedef char *pointer;extern char *malloc();H#define allocate(type, quan) ( (type *) malloc(sizeof(type) * (quan)) )#define FOREVER fo@@~AWM.SAVECC [FIELDS.X.AWM.MENUS]STD_DEFS.H;1wr (;;)/* initial pointer value */ #ifndef NULL#define NULL 0#endif #ifndef TRUE#define TRUE 1#endif#ifndef FALSE#define FALSE 0#endif/* VoidFunc type definition */typedef void (*VoidFunc)();%/* minimal error status return values */#define SUCCESS 0#define FAILURE -1#define ABS(val) \' ( ( (val) < 0 ) ? -(val) : (val) ) #endif"*[FIELDS.X.AWM.MENUS]TRACK_MENU.C;3+,XD.8/% 4k87<-C0D123KPWO856cA+7`88`4fՔ9fG%HJn #ifndef lintk static char sccs_id[] = "@(#)track_menu.c 2.1 12/16/87 Siemens Corporate Research and Support, Inc.";#endif#include /*  RTL Menu Package Version 1.0C by Joe Camaratta and Mike Berman, Siemens RTL, Princeton NJ, 1987 2 track_menu.c: bring up menus and track the mouse *//* *F * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. *$ * Copyright 1987 by Jordan Hubbard. * *. * All Rights Reserved *H * Permission to use, copy, modify, and distribute this software and itsC * documentation for any purpose and without fee is hereby granted,I * provided that the above copyright notice appear in all copies and thatB * both that copyright notice and this permission notice appear inA * supporting documentation, and that the name of Ardent ComputerH * Corporation or Jordan Hubbard not be used in advertising or publicityG * pertaining to distribution of the software without specific, written * prior permission. * *//*  Copyright 1987 byE Siemens Corporate Research and Support, Inc., Princeton, New Jersey ? Permission to use, copy, modify, and distribute this software: and its documentation for any purpose and without fee is: hereby granted, provided that the above copyright notice> appear in all copies and that both that copyright notice and@ this permission notice appear in supporting documentation, and8 that the name of Siemens not be used in advertising or> publicity pertaining to distribution of the software without7 specific, written prior permission. Siemens makes no@ representations about the suitability of this software for any= purpose. It is provided "as is" without express or implied warranty.  *//*< * The menu package will break if you don't define this, but< * it's there in case you want to see just how and where the< * "eventstack" stuff is used and, if necessary, replace it. */#define SAVE_EVENTS #include #include #include #include "arrow_icon.h"#include "null_icon.h"#include "menu.h"#include "menu_def.h"#include "menu_ext.h"#include "dbug.h"#ifdef SAVE_EVENTS#include "eventstack.h"#endif$#define MIN(x,y) (((x) <= (y))? x:y)$#define MAX(x,y) (((x) >= (y))? x:y),#define CLICK_TIME 290 /* in milliseconds */9#define CursorLockMask (ButtonReleaseMask | ExposureMask) /* Event macros */-#define EventGetXCoord(rep) ((rep).xmotion.x)-#define EventGetYCoord(rep) ((rep).xmotion.y)##define EventType(rep) ((rep).type)2#define EventXWindow(rep) ((rep).xcrossing.window).#define EventXTime(rep) ((rep).xcrossing.time).#define EventXMode(rep) ((rep).xcrossing.mode)1#define EventXRootX(rep) ((rep).xcrossing.x_root)1#define EventXRootY(rep) ((rep).xcrossing.y_root)2#define EventXDetail(rep) ((rep).xcrossing.detail)0#define EventMWindow(rep) ((rep).xmotion.window),#define EventMTime(rep) ((rep).xmotion.time)/#define EventButton(rep) ((rep).xbutton.button)0#define EventBWindow(rep) ((rep).xbutton.window),#define EventBTime(rep) ((rep).xbutton.time)&#define EventEX(rep) ((rep).xexpose.x)&#define EventEY(rep) ((rep).xexpose.y).#define EventEWidth(rep) ((rep).xexpose.width)0#define EventEHeight(rep) ((rep).xexpose.height)#define PointerEvent(rep) \* ((EventType(rep) == ButtonPress) || \, (EventType(rep) == ButtonRelease) || \+ (EventType(rep) == MotionNotify) || \* (EventType(rep) == EnterNotify) || \* (EventType(rep) == LeaveNotify) || \& (EventType(rep) == FocusIn) || \# (EventType(rep) == FocusOut))#define KeyEvent(rep) \E ((EventType(rep) == KeyPress) || (EventType(rep) == KeyRelease))+/* Possible states for the state machine */ typedef enum{; Initial, /* Inside a submenu, but not any item */P CheckTrigger, /* Inside an item that has submenu, checking for pullright */7 Leaf, /* Inside an item with no submenu */* Exit, /* Preparing to exit */G LevelControl /* Not in any submenu, waiting to enter something */ } State;LState InitialState(), CheckTriggerState(), LeafState(), LevelControlState(), GetItemState();-Boolean EventNotSignificant(), PushSubmenu();=void OutputEvent(), GetNextSignificantEvent(), PopSubmenu(), E Highlight(), Unhighlight(), DisplayInitialMenus(), LockCursor(),& TossExtraMoves(), UnlockCursor();void ProcessExposeEvents();void SaveTest();MenuItem *MenuGetItem();Menu *MenuGetMenu();/* global state variables */static MenuItem *current_item;static Menu *current_menu;static Window root_window;extern Display *dpy;extern int scr;0static int level; /* submenu level */<static Time button_time; /* time button press invoked */Dstatic Cursor wait_cursor = None; /* empty cursor for lock state */static Boolean click_allowed;2static Boolean lock_event_mask, unlock_event_mask;extern Boolean Autoselect;extern int MDelta;#ifdef SAVE_EVENTS static struct Ev_q *ev_save = 0;#endif /MenuItem *TrackMenu(root_menu, root_x, root_y, ! init_button, root, buttime)DMenu *root_menu; /* Pointer to root menu requested to pop up */Dint root_x, root_y; /* Position to start menu */Dint init_button; /* The # of button used to pop up menu */DWindow root; /* Window label for parent of menu */DTime buttime; /* timestamp for button (or 0, if CLICK == 0) */{' State CurrentState = LevelControl; XEvent Event_Reply; int open_x; Boolean selected = FALSE; MenuItem *selected_item;  Entry("TrackMenu")  /* Initialize globals */  button_time = buttime; root_window = root; level = 0; current_menu = root_menu;M click_allowed = (TestOptionFlag(current_menu, clickokay))? TRUE : FALSE;B unlock_event_mask = (TestOptionFlag(current_menu, savebits))?2 MenuEventMask : (MenuEventMask | ExposureMask);@ lock_event_mask = (TestOptionFlag(current_menu, savebits))?4 CursorLockMask : (CursorLockMask | ExposureMask); E /* If not already done, set up the null cursor for lock state */ if (wait_cursor == None) { Pixmap wc_pixmap; XColor fg, bg; 7 wc_pixmap = XCreateBitmapFromData (dpy, root_window, null_icon_bits,- null_icon_width, null_icon_height);@ wait_cursor = XCreatePixmapCursor (dpy, wc_pixmap, wc_pixmap, &fg, &bg, 1, 1); }  8 /* Block all other action by grabbing the server */ /* XGrabServer (dpy); */I /* Don't think we need to grab the server... so for now, we won't */ #ifdef SAVE_EVENTS = /* Get the present state, so it can be restored later */N /* Any events on the queue when we start get saved now, restored later */D SaveEvents (dpy, &ev_save, ~(unsigned long) ButtonReleaseMask);#endif  LockCursor(root_window); if (!(current_item =: Display_Menu(current_menu, NULLMENU, root_x, root_y))) { CurrentState = Exit; } /*> * First item is a label and autoselect is on, so we want, * to push on to the first "real" item. */0 if (ItemIsDeaf(current_item) && Autoselect)) current_item = current_item->nextItem;* LockCursor(ItemWindow(current_item)); open_x = root_x; 4 /* Push to appropriate previous item, if any */G while (MenuHasInitialItem(current_menu) && (CurrentState != Exit)) {/ current_item = GetInitialItem(current_menu);" ClearInitialItem(current_menu); B /* if the initial item can't be selected, take first in list */@ if (ItemIsNull(current_item) || ItemIsDisabled(current_item)) {/ current_item = MenuItems(current_menu); break; }; else if (ItemIsLeaf(current_item)) /* then we're done */ break; else {5 open_x += ItemGetArrowPosition(current_item);& if (!ItemIsDeaf(current_item)) Highlight(current_item);1 TossExtraMoves(ItemWindow(current_item));"" (void)PushSubmenu(open_x); } } ProcessExposeEvents();1 if (CurrentState != Exit)C CurrentState = (ItemIsLeaf(current_item)) ? Leaf : CheckTrigger;p# if (!ItemIsDeaf(current_item))* Highlight(current_item); ? XSync (dpy, 0); /* get release click, if it's in queue */1#ifdef SAVE_EVENTS> DisposeEvents(dpy, (PointerMotionMask | EnterWindowMask |% LeaveWindowMask | ExposureMask)); #endif* LockCursor(ItemWindow(current_item));. PlacePointer(current_menu,current_item);  UnlockCursor(); c /* State Machine */ i! while (CurrentState != Exit)t {6 GetNextSignificantEvent(&Event_Reply, init_button); switch (CurrentState) { case LevelControl:r6 CurrentState = LevelControlState(Event_Reply); break; case Initial:1 CurrentState = InitialState(Event_Reply); break; case CheckTrigger:6 CurrentState = CheckTriggerState(Event_Reply); break; case Leaf:w9 CurrentState = LeafState(Event_Reply, &selected);b break; default: 5 Retch("(RTLmenu) YOW! Unknown State! (%d)\n",e CurrentState);a CurrentState = Exit; break; } } /* Clean up and exit */ h9 selected_item = (selected)? current_item : NULLITEM;d while (level) { if (selected)3 SetInitialItem(current_menu, current_item);o PopSubmenu(); } if (selected) {. SetInitialItem(current_menu, current_item); } l" Undisplay_Menu(current_menu); UnlockCursor();& XUngrabPointer(dpy, CurrentTime); 9 /* Throw out any left over events from menu world */'8 /* if (TestOptionFlag(current_menu, savebits)) { XSync(dpy,1); > XUngrabServer(dpy, CurrentTime); add this if grab added!  } else XSync(dpy,0);*/c tI /* Push back any events that were lying around when menus started */o h XFlush(dpy);i#ifdef SAVE_EVENTS> DisposeEvents(dpy, (PointerMotionMask | EnterWindowMask |% LeaveWindowMask | ExposureMask));e" RestoreEvents(dpy, &ev_save);#endif Leave(selected_item)n}A ,/* Used for debugging */void OutputEvent(Event_Reply)iXEvent Event_Reply; {s Entry("OutputEvent")s$ switch (EventType(Event_Reply)) { case ButtonPress: case ButtonRelease:P DBUG_5("RTLmenu","Button Press/Release, button %d on window %d at time %d\n",8 EventButton(Event_Reply), EventBWindow(Event_Reply),  EventBTime(Event_Reply)); break; case MotionNotify:(E DBUG_5("RTLmenu","Motion Notify on window %d at time %d, x=%d\n", 6 EventMWindow(Event_Reply), EventMTime(Event_Reply), EventGetXCoord(Event_Reply)); break;i case EnterNotify:= DBUG_4("RTLmenu","Enter Notify on window %d at time %d\n",o7 EventXWindow(Event_Reply), EventXTime(Event_Reply));n break;  case LeaveNotify:= DBUG_4("RTLmenu","Leave Notify on window %d at time %d\n",7 EventXWindow(Event_Reply), EventXTime(Event_Reply));e break;e default:nJ DBUG_3("RTLmenu","Unexpected event type %d\n", EventType(Event_Reply)); break;h } Leave_voidr}  static Boolean locked = FALSE;J/* Lock the cursor: make it disappear, and ignore events it generates. */J/* Optionally, confine it to a single window. */J/* (Using "None" for confine_window doesn't confine it. ) */void LockCursor(confine_window)uWindow confine_window;{  int result;  Entry("LockCursor") = locked = TRUE;s result = XGrabPointer(dpy,e0 RootWindow(dpy, MenuScreen(current_menu)),+ True, lock_event_mask, GrabModeSync, k$ GrabModeAsync, confine_window, wait_cursor, CurrentTime);8 DBUG_3("RTLmenu","Lock Cursor grab = %d\n",result); Leave_void } G/* Unlock (and unconfine) the cursor. If cursor lock is not set, */eG/* this does nothing. */tvoid UnlockCursor()e{n int result; m Entry("UnlockCursor") n if (locked) { locked = FALSE; result = XGrabPointer(dpy, . RootWindow(dpy, MenuScreen(current_menu)), True, unlock_event_mask,' GrabModeAsync, GrabModeAsync, None,+ MenuCursor(current_menu), CurrentTime);s= DBUG_3("RTLmenu","Unlock Cursor grab = %d\n",result); o } Leave_void}t MJ/* Keep getting the X events, until finding one that may be interesting */,/* to the operation of the state machine. */5void GetNextSignificantEvent(Event_Reply,init_button)mXEvent *Event_Reply;:int init_button; /* the button that initiated the menu */{  XEvent Next_Event_Reply; ' Boolean InsignificantEvent = True;c n% Entry("GetNextSignificantEvent") BD /* Loop as long as any of a number of "insignificant" events */H /* are found; when the event no longer matches one of the tests, */9 /* it is assumed to be "significant" and returned.*/o do  { XNextEvent(dpy, Event_Reply);6 DBUG_EXECUTE("RTLmenu", OutputEvent(*Event_Reply)); @ /* If this event is an "enter", check whether there is a */@ /* "leave" for the same window already in the queue, */@ /* immediately following it; if so, throw them both out */@ /* and get the next event */@ /* NOTE: might try to look further ahead, but this is */@ /* tricky because other events might intervene. */ "2 if ((EventType(*Event_Reply) == EnterNotify) &&4 (EventXMode(*Event_Reply) == NotifyNormal) && (QLength(dpy) > 0) &&= (MenuGetMenu(current_menu, EventXWindow(*Event_Reply))n != current_menu))y {+ XPeekEvent(dpy, &Next_Event_Reply);p; if ((EventType(Next_Event_Reply) == LeaveNotify) &&v6 (EventXMode(Next_Event_Reply) == NotifyNormal) &&D (EventXWindow(Next_Event_Reply) == EventXWindow(*Event_Reply))) {e4 DBUG_2("RTLmenu","TOSS: Enter/leave pair.\n");# XNextEvent(dpy, Event_Reply); # XNextEvent(dpy, Event_Reply); }p }#ifdef SAVE_EVENTS6 if (EventNotSignificant(*Event_Reply, init_button)) {B if (!(PointerEvent(*Event_Reply) || KeyEvent(*Event_Reply)- || EventType(*Event_Reply) == Expose))r {i? /* might be significant elsewhere -- save it for later */ . AddEventToStore(&ev_save, *Event_Reply); }/ } elser#elser< if (!EventNotSignificant(*Event_Reply, init_button))#endif! InsignificantEvent = FALSE;V } while (InsignificantEvent);  DBUG_2("RTLmenu","--->"); Leave_voido}h uB/* Check whether the event matches one of the events considered *//* "not significant".*/d5Boolean EventNotSignificant(Event_Reply, init_button)rXEvent Event_Reply; int init_button;{ ! Entry("EventNotSignificant")N1 /* Insignificant if not in following list */ 9 Leave(!((EventType(Event_Reply) == ButtonRelease) || 2 (EventType(Event_Reply) == ButtonPress) ||3 (EventType(Event_Reply) == MotionNotify) ||(2 (EventType(Event_Reply) == EnterNotify) ||- (EventType(Event_Reply) == Expose) ||w0 (EventType(Event_Reply) == LeaveNotify)) ||< /* Insignificant if leave or enter is not "Normal" */2 (((EventType(Event_Reply) == LeaveNotify) ||3 (EventType(Event_Reply) == EnterNotify)) &&m1 (EventXMode(Event_Reply) != NotifyNormal))  ||> /* Insignificant if hit button other than initial one */3 ((EventType(Event_Reply) == ButtonRelease) &&m1 (EventButton(Event_Reply) != init_button))m ||F /* Insignificant if tail end of a click -- and clicks allowed */ (click_allowed &&3 (EventType(Event_Reply) == ButtonRelease) &&n< (EventBTime(Event_Reply) - button_time < CLICK_TIME)) )h}u nState LevelControlState(rep) XEvent rep;({r State next_state; Menu *entered_menu; MenuItem *entered_item; s Entry("LevelControlState")i switch (EventType(rep)) { case MotionNotify:T case LeaveNotify: s; next_state = LevelControl; /* loop back to this state */c break;  case EnterNotify:B /* Decide whether we've entered a menu window or item window */? entered_menu = MenuGetMenu(current_menu, EventXWindow(rep));e> entered_item = MenuGetItem(current_menu,EventXWindow(rep)); a@ if ((MenuIsNull(entered_menu)) && (ItemIsNull(entered_item)))1 /* Must be some other window; carry on */(" next_state = LevelControl;( else if (!ItemIsNull(entered_item) &&- MenuIsDisplayed(ItemMenu(entered_item)))s {K /* we entered an item, but not a window. This should only happen */rK /* when we stayed in the parent of the current submenu. So, */ K /* Pop that submenu and get to the item. */e if (level) {+ LockCursor(ItemWindow(entered_item));a PopSubmenu();c ProcessExposeEvents(); UnlockCursor();(" current_item = entered_item; Highlight(current_item);% next_state = GetItemState(rep);; } else { 9 Retch("(RTLmenu) Tried to pop the root menu...\n");e next_state = Exit; }  } ' else if (!MenuIsNull(entered_menu)&&t# MenuIsDisplayed(entered_menu))( {. /* entered a menu that is displayed */7 while ((current_menu != entered_menu) && level)d/ /* drop down the menu that was entered */ PopSubmenu();p ProcessExposeEvents(); UnlockCursor(); ) if (current_menu == entered_menu)T next_state = Initial;a else {, next_state = Exit;> Retch("(RTLmenu) Couldn't find the menu I entered!!\n"); }, } else " next_state = LevelControl; break;o case ButtonRelease: next_state = Exit;p break;f default: > Retch("RTLmenu","YOW! Unexpected event! (%d)\n", rep.type); next_state = Exit;o break;e } Leave(next_state)}; e:/* Figure out the status of the item we've just entered */State GetItemState(rep)t XEvent rep;i{E int open_x; State next_state; s Entry("GetItemState")" if (ItemIsNull(current_item)) {) Retch("(RTLmenu) null current item!");e next_state = Exit;s }' else if (MenuIsNull(current_menu))t {) Retch("(RTLmenu) null current menu!");  next_state = Exit;) }' else if (ItemIsLeaf(current_item))_ {( if (MenuHasInitialItem(current_menu))' ClearInitialItem(current_menu);) next_state = Leaf;y }S else if (EventGetXCoord(rep) >= (int)(ItemGetArrowPosition(current_item) - 4)), {I /* entered item in "auto pop-up zone", i.e., over pull-right arrow. */e( LockCursor(ItemWindow(current_item));, TossExtraMoves(ItemWindow(current_item));% if (PushSubmenu(EventXRootX(rep)))W {- LockCursor(ItemWindow(current_item));e2 PlacePointer(current_menu, current_item);  next_state = Initial;v ProcessExposeEvents(); } elsei" next_state = CheckTrigger; UnlockCursor(); }/ else if (MenuHasInitialItem(current_menu))e {4 /* Entered menu has initial item -- move to it */1 DBUG_2("RTLmenu","Pushing for initial item.");w/ current_item = GetInitialItem(current_menu);d0 open_x = ItemGetArrowPosition(current_item) + EventXRootX(rep); " ClearInitialItem(current_menu);( LockCursor(ItemWindow(current_item)); if (PushSubmenu(open_x))w { ProcessExposeEvents();- LockCursor(ItemWindow(current_item)); 2 PlacePointer(current_menu, current_item);  next_state = Initial;e } UnlockCursor(); } else /* parent pull */ next_state = CheckTrigger;u Leave(next_state)}t tState InitialState( rep) XEvent rep; {  State next_state;  Entry("Initial")r switch (EventType(rep)) { case EnterNotify: if (MenuIsNull(current_menu)) {1 Retch("(RTLmenu) null current menu!?!?");  next_state = Exit; }0 else if (EventXDetail(rep) == NotifyInferior) next_state = Initial;e elsee {D current_item = MenuGetItem(current_menu, EventXWindow(rep));% if (ItemIsNull(current_item)) {= /* Retch("(RTLmenu) Window entered not an item!\n"); */m next_state = Initial;h } else { Highlight(current_item);% next_state = GetItemState(rep);_ }  } break;t case LeaveNotify:3 /* Decide whether we're actually leaving */ 3 /* this menu for another submenu or the root, */t3 /* or going into an item. */a6 next_state = (EventXDetail(rep) == NotifyInferior)? Initial : LevelControl; break;a case ButtonRelease: next_state = Exit; break;i case MotionNotify: next_state = Initial; break;E default: > Retch("(RTLmenu) YOW! Unexpected event! (%d)\n", rep.type); next_state = Exit;e break;k } Leave(next_state)}a #define NotSet -1 ,/* Look to see if pull-right is requested */State CheckTriggerState(rep) XEvent rep;t{ % State next_state = CheckTrigger; ! static int Trigger = NotSet; + static int OldX, NewX, childX, button;i  Entry("CheckTrigger")> if (MenuIsNull(current_menu) || ItemIsNull(current_item)) {+ Retch("(RTLmenu) Null menu or item...");o next_state = Exit;i goto exit;  }( if (Trigger == NotSet) /* set it */ {? Trigger = MIN(EventGetXCoord(rep) + MenuDelta(current_menu),{' ItemGetArrowPosition(current_item));l NewX = NotSet;E } switch (EventType(rep)) { case LeaveNotify: next_state = Initial;= Unhighlight(MenuGetItem(current_menu, EventXWindow(rep)));v Trigger = NotSet; break;B case ButtonRelease: next_state = Exit;  Trigger = NotSet; break;  case ButtonPress: button = rep.xbutton.button;S while (TRUE) {E XNextEvent(dpy, &rep);( if (rep.type == ButtonRelease &&" rep.xbutton.button == button) break; } next_state = CheckTrigger;p6 childX = TestOptionFlag(current_menu, fixedchild) ?D (MenuX(current_menu) + ItemGetArrowPosition(current_item)) : EventXRootX(rep); Trigger = NotSet; if (PushSubmenu(childX))* {" next_state = LevelControl; ProcessExposeEvents();- LockCursor(ItemWindow(current_item));1 PlacePointer(current_menu, current_item);h } UnlockCursor(); break;h case MotionNotify:e next_state = CheckTrigger;d OldX = NewX;t NewX = EventGetXCoord(rep); if (NewX >= Trigger)y {- LockCursor(ItemWindow(current_item));c: childX = TestOptionFlag(current_menu, fixedchild)?A (MenuX(current_menu) + ItemGetArrowPosition(current_item)):  EventXRootX(rep);y Trigger = NotSet; if (PushSubmenu(childX)) {( next_state = LevelControl; ProcessExposeEvents();+ LockCursor(ItemWindow(current_item)); 0 PlacePointer(current_menu, current_item); }I UnlockCursor();e }- else if (NewX < OldX) /* reverse motion */p? Trigger = MIN(Trigger, NewX + MenuDelta(current_menu));o break; default:e/ Retch("(RTLmenu) YOW! Unexpected event!\n");  next_state = Exit; break;r } exit: Leave(next_state)}n eState LeafState(rep,selected) XEvent rep;oBoolean *selected;{b State next_state; s Entry("LeafState")  switch(EventType(rep))  { case LeaveNotify:= Unhighlight(MenuGetItem(current_menu, EventXWindow(rep)));n next_state = Initial; break;L I case ButtonRelease: *selected = TRUE; next_state = Exit; break;n t case ButtonPress: case EnterNotify:E case MotionNotify: /* if events set right, this never happens */t next_state = Leaf; break;n y default:e3 Retch("(RTLMenu) YOW! Unexpected event! (%d)\n",a rep.type); next_state = Exit; break;N } Leave(next_state)}e rBoolean PushSubmenu(x)int x;{ int y;n Boolean pushed; MenuItem *new_current_item; i Entry("PushSubmenu")e" if (ItemIsNull(current_item)) {3 Retch("(RTLMenu) Can't push from null item.\n");  pushed = FALSE; }4 else if (MenuIsNull(ItemSubmenu(current_item))) {& Retch("(RTLmenu) Null submenu.\n"); pushed = FALSE; } e? else if (ItemIsNull(MenuItems(ItemSubmenu(current_item))))o= /* submenu has no items -- don't push, but not an error */e pushed = FALSE; else  {% y = ItemGetMiddleY(current_item);e ++level;.  if (new_current_item = C Display_Menu(ItemSubmenu(current_item), current_menu, x, y))) { XFlush(dpy);1 current_menu = ItemSubmenu(current_item);( current_item = new_current_item;3 if (ItemIsDeaf(current_item) && Autoselect)t, current_item = current_item->nextItem; pushed = TRUE; } else  {2 Retch("(RTLmenu) Display_Menu failed!\n"); pushed = FALSE;f } } Leave(pushed)}M Ivoid PopSubmenu()m{) Menu *parent; MenuItem *item; a Entry("PopSubmenu") --level;n' parent = current_menu->parentMenu;n" Undisplay_Menu(current_menu); current_menu = parent;c# if (!MenuIsNull(current_menu))s {, item = MenuItemHighlighted(current_menu); if (!ItemIsNull(item)) { current_item = item; } }  Leave_voidC}dvoid Highlight(item)MenuItem *item; {, MenuItem *old_highlight;s L Entry("Highlight") s7 old_highlight = MenuItemHighlighted(current_menu); C if ((item != old_highlight) && /* else, already highlighted */y (!ItemIsNull(item))) {7 if (!ItemIsNull(old_highlight) && !ItemIsDeaf(item))r$ Unhighlight(old_highlight); * SetHighlightItem(ItemMenu(item), item);# Draw_Item(ItemMenu(item), item);S } Leave_void} void Unhighlight(item)MenuItem *item;({r Entry("Unhighlight")h if (!ItemIsNull(item))! {1 if (MenuItemHighlighted(current_menu) == item)u {+ ResetHighlightItem(ItemMenu(item));l( Draw_Item(ItemMenu(item), item); } } Leave_voide}cvoid TossExtraMoves(window)MWindow window;{u XEvent ev;  a Entry("TossExtraMoves")C while (XCheckTypedWindowEvent(dpy, window, MotionNotify, &ev))(/ DBUG_2("RTLmenu","Tossing extra motion.\n");  Leave_voide}tvoid ProcessExposeEvents(){r MenuItem *item; XEvent ev;t w! Entry("ProcessExposeEvents")( XSync(dpy,0);/ while (XCheckTypedEvent(dpy, Expose, &ev)){ {6 item = MenuGetItem(current_menu, EventXWindow(ev)); if (!ItemIsNull(item))t( Draw_Item(ItemMenu(item), item); } Leave_voidt}; } elsei" next_state = CheckTrigger; UnlockCursor(); }/ else if (MenuHasInitialItem(current_menu))e {4 /* Entered menu has initial item -- move to it */1 hj)qbON.K;1?B_v$Y#P;9C>⎪O Ag< dk`;F PpUid[6q3)JjHRubxC/Ր(#Qp1V?L:xWjVTc%@xp Lx7(tȨB1G,bӂ_vNtrb:$ LQ;'<)ߓsoXf6cΞM,v Tsd/7y)QA6LcCK,=cLDgY LSFXݭ4xc|T?#Bu%U`OĺU?5}a\"E:Gqelt`X zhTɹ.h[R}tc;HS>ux*F%*"Ϻ=rEX&XDz>kmutݹ n2#d`nw7? l2ǟًM=7kwwv$yIj;8c0LiVF;kҳbp42tqQ4 eE6UA}9I^pjˌfА[P]>߽j7%~dcj&nT1vSh=xs@o 4巬SB(s̢1'%]ζ~t\4!]BQά>PuRx/ۂX-Pkh7cM0,[h_4'`U%MUAvOr68`/X[;x#\M`>zrv81H8Ї1޲sbVO8G G⾔,/AN+rq,oohduUf#de)ɨA[b7,Sh,s -5.e^mpqx@^0kE|F86SHzn.Va2wڱu30 Laa(XQx'*y13ڽ,1g3rG*ݢ;W(3>62W!1w@( Sw6o$wA-޺p"nFE;vpOͽH{lw ߁]ӆ2tlj nIVwW[*猖0ɳ.- mp}Vƒ`{v$ `,^\AJU_Fr",t8lxmi c ,!3c raLԟ~G]!)D壈qhFtD;ӳm2S,0ܤ%tA oBR3dV<;X)bS|nWs. ׼+/),VYB̲kV=0mg!gk-9) Q[X6^utn5.u52Ct q~pkQxL/2! e:0Wq։g~es&3 @ڜγ%FLQ<\>*Z1%D*{.LbP}C>ac}!hԋ>}0g4 &N}L' mˁ%TUZL1hs8KK05" r~nmJ`RǞwgm藹pjvN.aʱrMĆ*cj6|B], vх˂J2`vQK_0<(v(Ĝ7ʇET\a=ESldn24^y-R!}*j𒭾/++D-4*BChLB95 Ux5Z-tѨE9*:,Y≿[y_ uqהIB[nuq{*K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