Annotation of researchv9/X11/src/X.V11R1/clients/uwm/Raise.c, revision 1.1

1.1     ! root        1: /* $Header: Raise.c,v 1.1 87/09/11 08:21:40 toddb Exp $ */
        !             2:  
        !             3: #include <X11/copyright.h>
        !             4: 
        !             5: /*
        !             6:  * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
        !             7:  *
        !             8:  *                         All Rights Reserved
        !             9:  *
        !            10:  * Permission to use, copy, modify, and distribute this software and its
        !            11:  * documentation for any purpose and without fee is hereby granted,
        !            12:  * provided that the above copyright notice appear in all copies and that
        !            13:  * both that copyright notice and this permission notice appear in
        !            14:  * supporting documentation, and that the name of Digital Equipment
        !            15:  * Corporation not be used in advertising or publicity pertaining to
        !            16:  * distribution of the software without specific, written prior permission.
        !            17:  *
        !            18:  *
        !            19:  * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
        !            20:  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
        !            21:  * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
        !            22:  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
        !            23:  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
        !            24:  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
        !            25:  * SOFTWARE.
        !            26:  */
        !            27: 
        !            28:  
        !            29: /*
        !            30:  * MODIFICATION HISTORY
        !            31:  *
        !            32:  * 000 -- M. Gancarz, DEC Ultrix Engineering Group
        !            33:  * 001 -- R. Kittell, DEC Storage A/D May 19, 1986
        !            34:  *  Optionally warp mouse to upper right corner of window after raise.
        !            35:  * 002 -- Loretta Guarino Reid, DEC Ultrix Engineering Group
        !            36:  *  Western Software Lab. Convert to X11.
        !            37:  */
        !            38:  
        !            39: #ifndef lint
        !            40: static char *sccsid = "@(#)Raise.c     3.8     1/24/86";
        !            41: #endif
        !            42:  
        !            43: #include "uwm.h"
        !            44:  
        !            45: Bool Raise(window, mask, button, x, y)
        !            46: Window window;                          /* Event window. */
        !            47: int mask;                               /* Button/key mask. */
        !            48: int button;                           /* Button event detail. */
        !            49: int x, y;                               /* Event mouse position. */
        !            50:  
        !            51: {
        !            52: XWindowAttributes winfo;                       /* Window details for warp */
        !            53: int status;
        !            54:  
        !            55:     /*
        !            56:      * If the window is not the root window, raise the window and return.
        !            57:      */
        !            58:     if (window != RootWindow(dpy, scr)) {
        !            59:         XRaiseWindow(dpy, window);
        !            60:        /*
        !            61:         * Optionally warp the mouse to the upper left corner of the window.
        !            62:         */
        !            63:        if (WarpOnRaise) {
        !            64:            status = XGetWindowAttributes (dpy, window, &winfo);
        !            65:             if (status == FAILURE) return(FALSE);
        !            66:  
        !            67:            status = XWarpPointer (dpy, None, window, 
        !            68:                         0, 0, 0, 0,
        !            69:                         winfo.width >= 7 ? winfo.width - 7 : winfo.width / 2,
        !            70:                          winfo.height >= 10 ? 10 : winfo.height / 2);
        !            71:             if (status == FAILURE) return(FALSE);
        !            72:         }
        !            73:     }
        !            74:     return(FALSE);
        !            75: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.