Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!bloom-beacon!ardent.UUCP!jkh From: jkh@ardent.UUCP (Jordan K. Hubbard) Newsgroups: comp.windows.x Subject: (none) Message-ID: <8806160747.AA07000@ardent.ardent.com> Date: 16 Jun 88 07:47:19 GMT Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 1244 #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh 'awm/CHANGES' <<'END_OF_FILE' This file last changed: 6/15/88 X The most recent changes to awm include: X Version numbers set to 1.1 in all files. Subsequent versions of awm will increment this accordingly (major_release.fix_level). X Menus should now work on color systems. X Weird nit with XGetClassHint() that caused coredumps fixed. X Man page re-written substantially (Thanks to Bill Wohler), the format of the resource descriptions below reflect part of his changes. X New make rule "noident" added for awm and awm/menus makefile. Doing a "make noident" in the awm directory will remove all #ident lines from awm and the menus. We use #ident at ardent without trouble (and on the suns), but it seems to choke DEC's compilers. I'm not sure if this is legal ansi anymore or not. In any case, if #ident chokes your compiler, this will remove it. X New resources: X XFrameFocus (boolean) ``off'' X Specifies whether or not focus changes should be looked for on the X client window (as they are now) or on the frame. X In a nutshell, if you set this to "off", the window will be not X change state (be this highlight or stacking level) until you've X left the frame (this includes the title bar) entirely. Correspondingly, X enter highlight/autoraise is also done on the whole frame. X This resource also has the side-effect of making the focus follow the X pointer explicitly. Thus typing into titlebars will cause the keyboard input X to go to the client window as expected. X border.foreground (string) ``foreground'' X Lets you specify the border color for awm's "frame" windows. X X Changes as of 6/6/88 New resources: X windowName.offset: (int) X Specifys an offset for the window name, rather than X centering it. X title.height: (int) X Allows you to physically set the height of titlebars (in pixels) X to some value, rather than having it be derived from the size of X the title font(s). X gadget.border: (int) X Allows you to set the width of gadget box borders to some X value. X border.hilite: (boolean) X Specifies whether or not to change border colors on focus in/out. X If this is undefined, and hilite is, it is set to the value of X hilite. Since is was already possible to specify whether or not X the window name and title background would be affected by focus X changes, this resource rounds out the list. X XFor demonstration purposes are two files "twm.awmrc" and "twm.Xdefaults" that can be used to make awm look very much like twm. If you want to try this out, edit twm.Xdefaults so that the awm.path variable points to X/.../awm/bitmaps and load it into your resource manager. X X A few more bugs were fixed. Pixmap icons should now stay sane. Bad gravity specifications should be handled gracefully. cursor glyph gadget boxes should now be the correct size. A problem with FocusChange was fixed. The restriction of compiling XRdBitFD only with Xlib has been lifted. X Autoselect now works in submenus. Menu item positioning has been improved. X Changes as of 6/3/88: X Bug fixes/enhancements for first release. X A new context named "border" has been added. When enabled (by giving it a width, see man page), it results in an artificial border area to which actions may be bound. See the man page for information on configuring this. X It is now possible to bind to "text action" strings in the same manner as functions and menus. Specifically, you may now invoke programs and manipulate the cut buffer directly through bindings rather than having to go through menus. See the man page for a more thorough explanation. X Cursors for title bars and border contexts (new) are now definable resources. X X"resizeRelative" option from R2 uwm folded in along with uwm bug fixes. X New title.push option allows you to specify whether you want titles to push windows down to make room (the default) or be added on top without moving them. X Support for the RTL Neaten package has been added. See the README file if you wish to compile it in. X To avoid some confusion, it's now manadatory that you compile XRdBitFD.c into Xlib. Seperate compilation is no longer supported. The resulting inconvenience is relatively minor compared to what some people with irregular source trees experienced when trying to compile it as part of awm. X Many bugs have been fixed, most notably a race condition on window mapping, mapping/unmapping of windows, bogus event masks to gadgets, resize weirdness, rubber banding and a number of coordinate botches that resulted from adding frames around things. It's now possible to compile awm with gcc 1.22, though I don't know about the neaten package. X X Bug fixes to Beta.3 X DEF_FONT is now in awm.h where it belongs and GetFontRes() has been modified to use it. X Some of the default specs in awm.h have been ifdef'd so that you can also specify them at compile time. Currently, you can do this for the font specs: X NAME Default value X---- ------------- DEF_FONT "fixed" DEF_TITLE_FONT "vtsingle" DEF_ICON_FONT "8x13" DEF_POPUP_FONT "9x15" DEF_GADGET_FONT "fixed" DEF_MENU_FONT "8x13" DEF_BOLD_FONT "8x13bold" X And the name and class of awm: X NAME "awm" CLASS "Wm" X It's still suggested that you change them in awm.h when you're configuring awm for your site, but this gives you an additional way of setting them. X Changes for beta release 3. X X1. Total rewrite of Iconify.c and NewIconify, problems fixed are iconic startup, icon/window positioning, icon_mask hints. X X2. Each gadget may now have its own font, rather than having to use a global gadget font (though this is still the default). Non-printable characters can also now be specified, allowing you to grab individual glyphs out of fonts and use them in gadgets. The is probably most useful for getting things out of the cursor font. See the man page for details. Note: Though much of the necessary code is in place, it still is not possible to use 16 bit fonts for this purpose. Though I'd love to have gadgets containing Kanji glyphs (a picture is worth a thousand words, especially in Kanji) and the like, I still don't know enough about the mechanism to know how and when to use the X*Text*16 routines, or how to store the "string" in such a way that it could be painted into an 8 bit font as well. X X3. Overall structure of the window manager has changed slightly. The code should be easier to read and debug. X X4. New "wall" boolean allows you to constrain moves to the edges of the screen. X X5. Some things that should have been getting their colors out of the resource database now do. X X6. Window name and class are now both checked when determing whether or not to title a window. X X7. Icons now use save-unders. X X8. Certain operations should be faster. X X9. The man page has been made more readable and updated somewhat. X X CHANGES OVER UWM: X This window manager represents a fairly large departure from uwm in the following ways: X X o There are title bars and gadget boxes that represent fully independent X contexts now (I.E. you can bind to them without conflict). X X o Icons now represent a truly independent context. X X o The menus have changed completely to allow walking menus and X more flexibility as to contents (pictures or text) of individual panes. X The menu interface has also been de-coupled somewhat from awm so X that another menu package could be substituted at a X later date. When an "official" toolkit menu widget exists, this X will probably happen. X X o Boolean variables may be set within menus and are also displayed X with a checkmark (depending on whether or not they're set). X X o Some effort is made to use save-unders and/or to minimize expose X events due to window manager actions. X X o Autoraise and border highlighting are available on focus. X X o Almost everything has been moved out of the .awmrc file and into X the resource database where it belongs. X X o awm now supports a startup file that makes usage from xinit more X friendly. X X END_OF_FILE if test 7801 -ne `wc -c <'awm/CHANGES'`; then echo shar: \"'awm/CHANGES'\" unpacked with wrong size! fi # end of 'awm/CHANGES' fi if test -f 'awm/GridBox.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'awm/GridBox.c'\" else echo shar: Extracting \"'awm/GridBox.c'\" \(7856 characters\) sed "s/^X//" >'awm/GridBox.c' <<'END_OF_FILE' X#ident "%W% %G%" X X#ifndef lint static char *rcsid_StoreGridBox_c = "$Header: GridBox.c,v 1.1 88/06/15 15:21:55 jkh Exp $"; X#endif lint X X#include "X11/copyright.h" X/* X * X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. X * X * Copyright 1987 by Jordan Hubbard. X * X * X * All Rights Reserved X * X * Permission to use, copy, modify, and distribute this software and its X * documentation for any purpose and without fee is hereby granted, X * provided that the above copyright notice appear in all copies and that X * both that copyright notice and this permission notice appear in X * supporting documentation, and that the name of Ardent Computer X * Corporation or Jordan Hubbard not be used in advertising or publicity X * pertaining to distribution of the software without specific, written X * prior permission. X * X */ X X/* X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. X * X * All Rights Reserved X * X * Permission to use, copy, modify, and distribute this software and its X * documentation for any purpose and without fee is hereby granted, X * provided that the above copyright notice appear in all copies and that X * both that copyright notice and this permission notice appear in X * supporting documentation, and that the name of Digital Equipment X * Corporation not be used in advertising or publicity pertaining to X * distribution of the software without specific, written prior permission. X * X * X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS X * SOFTWARE. X */ X X X X/* X * MODIFICATION HISTORY X * X * 000 -- M. Gancarz, DEC Ultrix Engineering Group X * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group, X * Western Software Lab. Converted to X11. X * 002 -- Jordan Hubbard, Ardent Computer. X * Changes for titled windows. X */ X X#ifndef lint static char *sccsid = "@(#)StoreGridBox.c 3.8 1/24/86"; X#endif X X/* X * StoreGridBox - This subroutine is used by the X Window Manager (xwm) X * to store the vertices for the movement resize grid and box in a X * vertex list. X */ X X#include "awm.h" X X/* X * Store the vertices for the movement resize grid and box in a vertex list. X */ 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. */ X{ X register int xthird, ythird; X int x1third, y1third; X int x2third, y2third; X X Entry("StoreGridBox") X X /* X * Xor in. X */ X box[0].x1 = ulx; box[0].y1 = uly; X box[0].x2 = lrx; box[0].y2 = uly; X X box[1].x1 = lrx; box[1].y1 = uly; X box[1].x2 = lrx; box[1].y2 = lry; X X box[2].x1 = lrx; box[2].y1 = lry; X box[2].x2 = ulx; box[2].y2 = lry; X X box[3].x1 = ulx; box[3].y1 = lry; X box[3].x2 = ulx; box[3].y2 = uly; X X X /* X * These are the X and Y calculations for the parts of the grid that X * are dependent on the division by 3 calculations. X */ X X /* X * Y dimension third. X */ X ythird = (lry - uly) / 3; X y1third = uly + ythird; X y2third = y1third + ythird; X X /* X * X dimension third. X */ X xthird = (lrx - ulx) / 3; X x1third = ulx + xthird; X x2third = x1third + xthird; X X box[4].x1 = x1third; box[4].y1 = lry; X box[4].x2 = x1third; box[4].y2 = uly; X X box[5].x1 = x2third; box[5].y1 = lry; X box[5].x2 = x2third; box[5].y2 = uly; X X box[6].x1 = ulx; box[6].y1 = y1third; X box[6].x2 = lrx; box[6].y2 = y1third; X X box[7].x1 = ulx; box[7].y1 = y2third; X box[7].x2 = lrx; box[7].y2 = y2third; X X /* X * Do not erase if we're freezing the screen. X */ X if (Freeze) X Leave(8) X X /* X * From here on we're retracing the segments to clear the X * grid using GXxor. X */ X box[8].x1 = ulx; box[8].y1 = uly; X box[8].x2 = lrx; box[8].y2 = uly; X X box[9].x1 = lrx; box[9].y1 = uly; X box[9].x2 = lrx; box[9].y2 = lry; X X box[10].x1 = lrx; box[10].y1 = lry; X box[10].x2 = ulx; box[10].y2 = lry; X X box[11].x1 = ulx; box[11].y1 = lry; X box[11].x2 = ulx; box[11].y2 = uly; X X box[12].x1 = x1third; box[12].y1 = lry; X box[12].x2 = x1third; box[12].y2 = uly; X X box[13].x1 = x2third; box[13].y1 = lry; X box[13].x2 = x2third; box[13].y2 = uly; X X box[14].x1 = ulx; box[14].y1 = y1third; X box[14].x2 = lrx; box[14].y2 = y1third; X X box[15].x1 = ulx; box[15].y1 = y2third; X box[15].x2 = lrx; box[15].y2 = y2third; X X X /* X * Total number of segments is 16. X */ X Leave(16) X} X X/* X * Store the vertices for the movement resize grid and box in a vertex list. X * This is just like the routine above, but it adds a line for titled windows. X */ X 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. */ X{ X register int xthird, ythird; X int x1third, y1third; X int x2third, y2third; X X Entry("StoreTitleGridBox") X X /* X * Xor in. X */ X box[0].x1 = ulx; box[0].y1 = uly; X box[0].x2 = lrx; box[0].y2 = uly; X X box[1].x1 = ulx; box[1].y1 = uly + titleHeight + 2; X box[1].x2 = lrx; box[1].y2 = uly + titleHeight + 2; X X box[2].x1 = lrx; box[2].y1 = uly; X box[2].x2 = lrx; box[2].y2 = lry; X X box[3].x1 = lrx; box[3].y1 = lry; X box[3].x2 = ulx; box[3].y2 = lry; X X box[4].x1 = ulx; box[4].y1 = lry; X box[4].x2 = ulx; box[4].y2 = uly; X X X /* X * These are the X and Y calculations for the parts of the grid that X * are dependent on the division by 3 calculations. X */ X X /* X * Y dimension third. X */ X ythird = (lry - uly - titleHeight - 2) / 3; X y1third = uly + ythird + titleHeight + 2; X y2third = y1third + ythird; X X /* X * X dimension third. X */ X xthird = (lrx - ulx) / 3; X x1third = ulx + xthird; X x2third = x1third + xthird; X X box[5].x1 = x1third; box[5].y1 = lry; X box[5].x2 = x1third; box[5].y2 = uly + titleHeight + 3; X X box[6].x1 = x2third; box[6].y1 = lry; X box[6].x2 = x2third; box[6].y2 = uly + titleHeight + 3; X X box[7].x1 = ulx; box[7].y1 = y1third; X box[7].x2 = lrx; box[7].y2 = y1third; X X box[8].x1 = ulx; box[8].y1 = y2third; X box[8].x2 = lrx; box[8].y2 = y2third; X X /* X * Do not erase if we're freezing the screen. X */ X if (Freeze) X Leave(9) X X /* X * From here on we're retracing the segments to clear the X * grid using GXxor. X */ X box[9].x1 = ulx; box[9].y1 = uly; X box[9].x2 = lrx; box[9].y2 = uly; X X box[10].x1 = ulx; box[10].y1 = uly + titleHeight + 2; X box[10].x2 = lrx; box[10].y2 = uly + titleHeight + 2; X X box[11].x1 = lrx; box[11].y1 = uly; X box[11].x2 = lrx; box[11].y2 = lry; X X box[12].x1 = lrx; box[12].y1 = lry; X box[12].x2 = ulx; box[12].y2 = lry; X X box[13].x1 = ulx; box[13].y1 = lry; X box[13].x2 = ulx; box[13].y2 = uly; X X box[14].x1 = x1third; box[14].y1 = lry; X box[14].x2 = x1third; box[14].y2 = uly + titleHeight + 3; X X box[15].x1 = x2third; box[15].y1 = lry; X box[15].x2 = x2third; box[15].y2 = uly + titleHeight + 3; X X box[16].x1 = ulx; box[16].y1 = y1third; X box[16].x2 = lrx; box[16].y2 = y1third; X X box[17].x1 = ulx; box[17].y1 = y2third; X box[17].x2 = lrx; box[17].y2 = y2third; X X X /* X * Total number of segments is 18. X */ X Leave(18) X} END_OF_FILE if test 7856 -ne `wc -c <'awm/GridBox.c'`; then echo shar: \"'awm/GridBox.c'\" unpacked with wrong size! fi # end of 'awm/GridBox.c' fi if test -f 'awm/Iconify.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'awm/Iconify.c'\" else echo shar: Extracting \"'awm/Iconify.c'\" \(6899 characters\) sed "s/^X//" >'awm/Iconify.c' <<'END_OF_FILE' X#ident "%W% %G%" X X#ifndef lint static char *rcsid_Iconify_c = "$Header: Iconify.c,v 1.1 88/06/15 15:24:56 jkh Exp $"; X#endif lint X X#include "X11/copyright.h" X/* X * X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. X * X * Copyright 1987 by Jordan Hubbard. X * X * X * All Rights Reserved X * X * Permission to use, copy, modify, and distribute this software and its X * documentation for any purpose and without fee is hereby granted, X * provided that the above copyright notice appear in all copies and that X * both that copyright notice and this permission notice appear in X * supporting documentation, and that the name of Ardent Computer X * Corporation or Jordan Hubbard not be used in advertising or publicity X * pertaining to distribution of the software without specific, written X * prior permission. X * X */ X X/* X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. X * X * All Rights Reserved X * X * Permission to use, copy, modify, and distribute this software and its X * documentation for any purpose and without fee is hereby granted, X * provided that the above copyright notice appear in all copies and that X * both that copyright notice and this permission notice appear in X * supporting documentation, and that the name of Digital Equipment X * Corporation not be used in advertising or publicity pertaining to X * distribution of the software without specific, written prior permission. X * X * X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS X * SOFTWARE. X */ X X X X/* X * MODIFICATION HISTORY X * X * 000 -- M. Gancarz, DEC Ultrix Engineering Group X * 001 -- R. Kittell, DEC Storage A/D May 20, 1986 X * Add optional warp of mouse to the upper right corner on de-iconify, X * and to the icon center on iconify. X * 002 -- Loretta Guarino Reid, DEC Ultrix Engineering Group, X * Western Software Lab. Port to X11. X * 003 -- Jordan Hubbard, Ardent Computer. X * Many mods to cope with context manager, titled windows. Almost a total X * rewrite. X */ X X#include "awm.h" X Boolean Iconify(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. */ X{ X XWindowAttributes fromInfo; /* info on "from" window */ X XWindowAttributes toInfo; /* info on "to" window */ X int mse_x, mse_y; /* Mouse X and Y coordinates. */ X int sub_win_x, sub_win_y; /* relative Mouse coordinates. */ X int num_vectors; /* Number of vectors in zap buffer. */ X int mmask; /* Mouse state */ X Window root; /* Mouse root window. */ X Window from, to; /* from -> to windows */ X Window sub_win; /* Mouse position sub-window. */ X XSegment zap[MAX_ZAP_VECTORS]; /* Zap effect vertex buffer. */ X Boolean dozap; /* local Zap */ X AwmInfoPtr awi; X X Entry("Iconify") X X /* X * Do not try to iconify the root window. X */ X if (window == RootWindow(dpy, scr)) X Leave(FALSE) X /* X * The original idea of zap lines has one flaw. If a window wants X * to be created iconic, it should just appear that way without any X * fuss. CheckMap() calls us with (win, 0, 0, 0, 0) when this is the X * case, so we can special case this to turn off Zap temporarily. X * Since we don't want to mess with the global "Zap", we use X * "dozap" instead. X */ X dozap = (mask || button || x || y) ? Zap : FALSE; X /* X * Clear the vector buffer. X */ X if (dozap) X bzero(zap, sizeof(zap)); X X /* X * Get the mouse cursor position in case we must put a new X * icon there. X */ X XQueryPointer(dpy, RootWindow(dpy, scr), &root, &sub_win, X &mse_x, &mse_y, &sub_win_x, &sub_win_y, &mmask); X X X /* X * Figure out which direction we're going in (icon->window or vica-versa) X */ X awi = GetAwmInfo(window); X if (!awi) X Leave(FALSE) X if (awi->state == ICON) { X from = awi->icon; X to = (awi->frame) ? awi->frame : awi->client; X if (awi->placed == FALSE) X PlaceWindow(to); X } X else if (awi->state == WINDOW) { X from = (awi->frame) ? awi->frame : awi->client; X to = (awi->icon) ? awi->icon : MakeIcon(window, mse_x, mse_y, TRUE); X } X else { X printf("Iconify: Window %x has unknown state '%x'\n", X awi->client, awi->state); X Leave(FALSE) X } X status = XGetWindowAttributes(dpy, from, &fromInfo); X if (status == FAILURE) X Leave(FALSE) X status = XGetWindowAttributes(dpy, to, &toInfo); X if (status == FAILURE) X Leave(FALSE) X X /* X * Store the zap vector buffer. X */ X if (dozap) { X num_vectors = X StoreZap(zap, X fromInfo.x - 1, X fromInfo.y - 1, X fromInfo.x + fromInfo.width + X (fromInfo.border_width << 1), X fromInfo.y + fromInfo.height + X (fromInfo.border_width << 1), X toInfo.x - 1, X toInfo.y - 1, X toInfo.x + toInfo.width + X (toInfo.border_width << 1), X toInfo.y + toInfo.height + X (toInfo.border_width << 1)); X } X if (awi->state == ICON) { X if (!awi->frame) X XRemoveFromSaveSet(dpy, awi->client); X awi->state = WINDOW; X } X else if (awi->state == WINDOW) { X XAddToSaveSet(dpy, awi->client); X awi->state = ICON; X } X else X fprintf(stderr, "Window state for window %x got munged!\n", X awi->client); X /* X * Map the target. X */ X XMapRaised(dpy, to); X if (dozap) { X /* X * Draw the zap lines. X */ X DrawZap(); X } X /* X * Unmap the "from" window. X */ X XUnmapWindow(dpy, from); X XFlush(dpy); X /* X * Optionally warp the mouse to the upper right corner of the X * window. X */ X if (WarpOnDeIconify && awi->state == WINDOW) { X int y; X X y = (toInfo.height >= 10) ? 10 : toInfo.height / 2; X if (awi->frame) { /* compensate for title */ X XWindowAttributes xwa; X XGetWindowAttributes(dpy, awi->title, &xwa); X y += xwa.height + 2; X } X status = XWarpPointer (dpy, None, to, X 0, 0, 0, 0, X toInfo.width >= 7 ? X toInfo.width - 7 : toInfo.width / 2, X y); X } X X if (WarpOnIconify && awi->state == ICON) X status = XWarpPointer (dpy, None, to, X 0, 0, 0, 0, X toInfo.width / 2, toInfo.height / 2); X Leave(FALSE) X} END_OF_FILE if test 6899 -ne `wc -c <'awm/Iconify.c'`; then echo shar: \"'awm/Iconify.c'\" unpacked with wrong size! fi # end of 'awm/Iconify.c' fi if test -f 'awm/Move.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'awm/Move.c'\" else echo shar: Extracting \"'awm/Move.c'\" \(8531 characters\) sed "s/^X//" >'awm/Move.c' <<'END_OF_FILE' X#ident "%W% %G%" X X#ifndef lint static char *rcsid_Move_c = "$Header: Move.c,v 1.1 88/06/15 15:24:56 jkh Exp $"; X#endif lint X X#include "X11/copyright.h" X/* X * X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca. X * X * Copyright 1987 by Jordan Hubbard. X * X * X * All Rights Reserved X * X * Permission to use, copy, modify, and distribute this software and its X * documentation for any purpose and without fee is hereby granted, X * provided that the above copyright notice appear in all copies and that X * both that copyright notice and this permission notice appear in X * supporting documentation, and that the name of Ardent Computer X * Corporation or Jordan Hubbard not be used in advertising or publicity X * pertaining to distribution of the software without specific, written X * prior permission. X * X */ X X/* X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. X * X * All Rights Reserved X * X * Permission to use, copy, modify, and distribute this software and its X * documentation for any purpose and without fee is hereby granted, X * provided that the above copyright notice appear in all copies and that X * both that copyright notice and this permission notice appear in X * supporting documentation, and that the name of Digital Equipment X * Corporation not be used in advertising or publicity pertaining to X * distribution of the software without specific, written prior permission. X * X * X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS X * SOFTWARE. X */ X X/* X * MODIFICATION HISTORY X * X * 000 -- M. Gancarz, DEC Ultrix Engineering Group X * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group, X * Western Software Lab. Port to X11 X */ X X#include "awm.h" X 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. */ X{ X register int prev_x; /* Previous event window X location. */ X register int prev_y; /* Previous event window Y location. */ X XWindowAttributes window_info; /* Event window information. */ X int cur_x; /* Current event window X location. */ X int cur_y; /* Current event window Y location. */ X int root_x; /* Root window X location. */ X int root_y; /* Root window Y location. */ X int ulx, uly; /* Event window upper left X and Y. */ X int lrx, lry; /* Event window lower right X and Y. */ X int init_ulx, init_uly; /* Init window upper left X and Y. */ X int init_lrx, init_lry; /* Init window lower right X and Y. */ X int num_vectors; /* Number of vectors in box. */ X int ptrmask; /* state of ptr when queried */ X Window sub_window; /* Query mouse event sub-window. */ X Window root; /* Query mouse event root. */ X AwmInfoPtr awi; X XEvent button_event; /* Button event packet. */ X XSegment box[MAX_BOX_VECTORS]; /* Box vertex buffer. */ X XSegment zap[MAX_ZAP_VECTORS]; /* Zap effect verted buffer. */ X int (*storegrid_func)(); /* Function to use for grid */ X int (*storebox_func)(); /* Function to use for box */ X X Entry("Move") X X /* X * Do not try to move the root window. X */ X if (window == RootWindow(dpy, scr)) X Leave(FALSE) X X /* X * Change the cursor. X */ X grab_pointer(); X /* X * Clear the vector buffers. X */ X bzero(box, sizeof(box)); X if (Zap) X bzero(zap, sizeof(zap)); X X /* X * Gather info on the event window. X */ X awi = GetAwmInfo(window); X if (!awi) X Leave(FALSE) X status = XGetWindowAttributes(dpy, window, &window_info); X if (status == FAILURE) X Leave(FALSE) X X if (awi->title && !IsIcon(window, NULL)) { X storegrid_func = StoreTitleGridBox; X storebox_func = StoreTitleBox; X } X else { X storegrid_func = StoreGridBox; X storebox_func = StoreBox; X } X /* X * Initialize movement variables. X */ X init_ulx = ulx = window_info.x; X init_uly = uly = window_info.y; X init_lrx = lrx = window_info.x + window_info.width + X (window_info.border_width << 1) - 1; X init_lry = lry = window_info.y + window_info.height + X (window_info.border_width << 1) - 1; X X /* X * Store the box. X */ X if (Grid) X num_vectors = (*storegrid_func)(box, ulx, uly, lrx, lry); X else X num_vectors = (*storebox_func)(box, ulx, uly, lrx, lry); X X /* X * Initialize the previous location variables. X */ X prev_x = x; X prev_y = y; X X /* X * Freeze the server, if requested by the user. X * This results in a solid box instead of a flickering one. X */ X if (Freeze) X XGrabServer(dpy); X Snatched = True; X /* X * Process any pending exposure events before drawing the box. X */ X while (QLength(dpy) > 0) { X XPeekEvent(dpy, &button_event); X if (((XAnyEvent *)&button_event)->window == RootWindow(dpy, scr)) X break; X GetButton(&button_event); X } X X /* X * Now draw the box. X */ X X DrawBox(); X Frozen = window; X X /* X * Main loop. X */ X while (TRUE) { X X /* X * Check to see if we have a change in mouse button status. X * This is how we get out of this "while" loop. X */ X if (XPending(dpy) && !ProcessRequests(box, num_vectors) && X GetButton(&button_event)) { X /* X * Process the pending events, this sequence is the only X * way out of the loop and the routine. X */ X X if ((button_event.type != ButtonPress) && X (button_event.type != ButtonRelease)) { X continue; /* spurious menu event... */ X } X X /* X * If we froze the server, then erase the last lines drawn. X */ X if (Freeze) { X DrawBox(); X Frozen = (Window)0; X XUngrabServer(dpy); X } X X if ((button_event.type == ButtonRelease) && X (((XButtonReleasedEvent *)&button_event)->button == button)) { X X /* X * The button was released, so move the window. X */ X X if (Zap) { X num_vectors = StoreZap(zap, X init_ulx, init_uly, X init_lrx, init_lry, X ulx, uly, X lrx, lry); X DrawZap(); X DrawZap(); X } X#ifdef titan /* 5x4 alignment */ X ulx += (ulx % 5); X uly += (uly % 4); X#endif /* titan */ X if (Wall) { X if (ulx < 0) X ulx = 0; X if (ulx > (ScreenWidth - window_info.width)) X ulx = (ScreenWidth - window_info.width); X if (uly < 0) X uly = 0; X if (uly > (ScreenHeight - window_info.height)) X uly = (ScreenHeight - window_info.height); X } X XMoveWindow(dpy, window, ulx, uly); X Snatched = False; X ungrab_pointer(); X Leave(TRUE) X } X else { X /* X * Some other button event occured, this aborts the X * current operation. X */ X X ResetCursor(button); X Snatched = False; X ungrab_pointer(); X Leave(TRUE) X } X } X X /* X * Take care of all the little things that have changed. X */ X XQueryPointer(dpy, X RootWindow(dpy, scr), &root, &sub_window, X &root_x, &root_y, &cur_x, &cur_y, &ptrmask); X if ((cur_x != prev_x) || (cur_y != prev_y)) { X X /* X * If we've frozen the server, then erase the old box first! X */ X if (Freeze) X DrawBox(); X X /* X * Box position has changed. X */ X ulx += cur_x - prev_x; X uly += cur_y - prev_y; X lrx += cur_x - prev_x; X lry += cur_y - prev_y; X X /* X * Box needs to be restored. X */ X if (Grid) X num_vectors = (*storegrid_func)(box, ulx, uly, lrx, lry); X else X num_vectors = (*storebox_func)(box, ulx, uly, lrx, lry); X X X /* X * Draw the new box. X */ X if (Freeze) X DrawBox(); X } X X /* X * Save old box position. X */ X prev_x = cur_x; X prev_y = cur_y; X X /* X * If server is not frozen, then draw the "flicker" box. X */ X if (!Freeze) { X DrawBox(); X DrawBox(); X } X } X} END_OF_FILE if test 8531 -ne `wc -c <'awm/Move.c'`; then echo shar: \"'awm/Move.c'\" unpacked with wrong size! fi # end of 'awm/Move.c' fi if test -f 'awm/README' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'awm/README'\" else echo shar: Extracting \"'awm/README'\" \(7173 characters\) sed "s/^X//" >'awm/README' <<'END_OF_FILE' This represents the first real release of the Ardent Window Manager (awm). It's being released on the same terms as its predecessor (uwm) with one additional request: Since this window manager is the "official" window manager of Ardent Computer, a lot more effort and time will be expended to ensure that it works reliably. Please try and coordinate fixes and enhancements through Ardent so that all may benefit. There are sure to be some bugs, we'll be here trying to fix them. Send bug reports to the author, or to: X X {decwrl, uunet, hplabs, ucbcad, dlb}!ardent!awm-bugs X X INSTALLATION: X Installation should be fairly straightforward. If you're using imake, first modify $(TOPDIR)/util/imake.includes/Imake.tmpl to define a macro called AWMDIR (look at UWMDIR for an example) which should point to someplace where you want to stash the system.awmrc file. If you like, you can just make UWMDIR and AWMDIR point to the same place since uwm and awm's file names are different and won't conflict with eachother. If you're using make (and don't want to use imake), modify the definition of AWMDIR in the Makefile instead (sort of the wrong way to do it though). X Certain compilers don't like the #ident lines we use for sccs. If yours doesn't, do a X X make noident X In the awm directory to remove all #ident lines from the source code. X The usual differences between system V and BSD include file structures may also cause you trouble. In particular, may be different. If FocusChng.c doesn't compile correctly on your system, see if the correct include file is in /usr/include or /usr/include/sys (the correct one should define a timeval struct). I've also heard that SunOS 4.0 fails to compile code that compiles fine on SunOS 3.x. I don't know what the symptoms are (since I don't have a 4.0 system around), but I've heard that the fix is to include in exp_path.c and awm.c. X There's a file named XRdBitFD.c which contains a new Xlib routine called XXReadBitmapFileData(). Awm uses this routine quite a bit, so you should install it as part of your Xlib before compiling awm. Just move the file named X"XRdBitFD.c" to lib/X and modify lib/X/Imakefile (or lib/X/Makefile if you don't use imake) to compile it with the rest of the library. If this is not possible, look in the Imakefile/Makefile for the right define to enable compilation with awm rather than the library. X The reason I wrote this routine was that the only two routines for dealing with (reading in) bitmap files were XReadBitmapFile() and XXCreatePixmapFromBitmapData(). XXReadBitmapFile() returns a depth one pixmap, with no opportunity to specify either depth or color (evil). XCreatePixmapFromBitmapData() allows this, but assumes that you've already got ahold of the data somehow. XReadBitmapFileData() takes care of that part. It's my personal feeling that XReadBitmapFile() is about due for extinction. X If all this seems confusing, send me mail and I'll try to explain it differently. X Support for the RTL Neaten package has been added. If you'd like to compile it in, you need to do two things: X X 1. Obtain the RTL neaten package somehow. It's too big to bundle with awm, X so it's expected that you'll have obtained it by some other means. X If you are on a system V system with 14 character file names, X you're in for a bit for work. Many of the files in the neaten X package have very long names. After you've renamed all of the > 14 char X files, you'll want to modify Makefile.rtl (in the awm directory) X identically so that the file names match the new ones you've chosen. X X 2. The makefile that comes with the neaten package assumes that you want to X compile their neatening window manager (nuwm), so you don't want to use X that. Awm will automatically use the "Makefile.rtl" makefile to compile X the neaten package (see below), as long as it knows where you've put it. X Modify awm's Imakefile (or Makefile) to point to the directory X where neaten resides (the macro NEATEN_LIB) and uncomment/comment the X appropriate macro definition lines. X X 3. Do an imake/make. The make will compile all of awm's files and then X proceed to make a neaten.a (in the neaten directory) to link against. X X X If you don't compile awm with Neaten, the function f.neaten can X still be bound but it will just print a warning message if invoked. X X Please note that the Neaten package has not been extensively tested with X awm and should be considered an experimental "frill" more than anything else. X It seems to shuffle icons around ok, though I don't understand some of its X window placement logic. If it's useful, use it, if not, don't compile it in. X X The rtl menu package in menus (non-optional) has its own Makefile which you may wish to customize (compiler flags, compiler type, etc), though the default configuration should produce a working awm binary on your system. This whole setup needs to be gone through and redone, but that will have to wait for another day (or a kind volunteer). X X XFirst time users of awm will probably want to read the manual page carefully and then set about tailoring their .Xdefaults file accordingly. The actual format of the .awmrc file does not differ substantially from uwm's .uwmrc file, but since much of the variable declaration stuff has been moved into .Xdefaults, a .uwmrc file will fail miserably if blithly copied into a .awmrc file. It's probably easier to go from scratch, starting with .Xdefaults. X After defaults have been entered (by far the largest task), a careful examination of your current uwm interface should be done to see what possible benefits might be derived from title bar, gadget and border contexts. You will most likely be able to eliminate almost all "chorded" buttons and go to naked buttons on title bars/gadgets/borders. You can now also bind naked buttons to icons without having the button stolen from applications, so it's usually a win to bind an f.iconify to the icon context if you like the way X10's xterm used to work. X Highlighting is a new feature which does quite a bit more than just tweak border colors. It will change the title bar text font (and redisplay the text) as well as alternating between two different title bar background pixmaps and or border context pixmaps. X I use a blank pixmap for the regular background (which is the default, I.E. I don't declare one) and a pixmap containing 7 horizontal lines for the BoldPixmap. The effect is not unlike a macintosh window. With some careful artistry (and placement) of gadget boxes, one could probably emulate this even more closely, though I'm not sure why one would want to. X When creating gadget box pixmaps, it's suggested that you look at the cursor font first as there are a lot of suitable glyphs already there. X X Any and all suggestions are, of course, appreciated. In addition to the awm-bugs address given previously, you may communicate with the author at any of the following addresses: X X X Author: Jordan Hubbard X Internet: jkh@violet.berkeley.edu X UUCP: {decwrl, hplabs, uunet}!ardent!jkh X U.S. Mail: Ardent Computer X 880 Maude X Sunnyvale, Ca. 94086 X X X END_OF_FILE if test 7173 -ne `wc -c <'awm/README'`; then echo shar: \"'awm/README'\" unpacked with wrong size! fi # end of 'awm/README' fi echo shar: End of archive 6 \(of 17\). cp /dev/null ark6isdone MISSING="" for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 17 archives. rm -f ark[1-9]isdone ark[1-9][0-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0