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

1.1     ! root        1: /***********************************************************
        !             2: Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
        !             3: and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
        !             4: 
        !             5:                         All Rights Reserved
        !             6: 
        !             7: Permission to use, copy, modify, and distribute this software and its 
        !             8: documentation for any purpose and without fee is hereby granted, 
        !             9: provided that the above copyright notice appear in all copies and that
        !            10: both that copyright notice and this permission notice appear in 
        !            11: supporting documentation, and that the names of Digital or MIT not be
        !            12: used in advertising or publicity pertaining to distribution of the
        !            13: software without specific, written prior permission.  
        !            14: 
        !            15: DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
        !            16: ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
        !            17: DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
        !            18: ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
        !            19: WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
        !            20: ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
        !            21: SOFTWARE.
        !            22: 
        !            23: ******************************************************************/
        !            24: #include <stdio.h>
        !            25: #include <errno.h>
        !            26: #include <X11/Xlib.h>
        !            27: #include <sys/types.h>
        !            28: #include <sys/timeb.h>
        !            29: 
        !            30: char *malloc();
        !            31: 
        !            32: Window XCreateWindow();
        !            33: 
        !            34: Window win;
        !            35: 
        !            36: Display *StartConnectionToServer(argc, argv)
        !            37: int    argc;
        !            38: char   *argv[];
        !            39: {
        !            40:     char *display;
        !            41:     int i;
        !            42:     Display *dpy;
        !            43: 
        !            44:     display = NULL;
        !            45:     for(i = 1; i < argc; i++)
        !            46:     {
        !            47:         if(index(argv[i], ':') != NULL)
        !            48:            display = argv[i];
        !            49:     }
        !            50:     if (!(dpy = XOpenDisplay(display)))
        !            51:     {
        !            52:        printf("refresh: failed to open display\n");
        !            53:        exit(1);
        !            54:     }
        !            55:     return dpy;
        !            56: }
        !            57: 
        !            58: main(argc, argv)
        !            59: int    argc;
        !            60: char   *argv[];
        !            61: {
        !            62:     int     image[8];
        !            63:     int     amount, i;
        !            64:     int     stuff[4];
        !            65:     int     fg, bg;
        !            66:     Visual visual;
        !            67:     XImage ximage;
        !            68:     XSetWindowAttributes xswa;
        !            69:     XWindowChanges xwc;
        !            70:     char    line[30];
        !            71:     struct timeb    start, stop;
        !            72:     Display *dpy;
        !            73: 
        !            74:     dpy = StartConnectionToServer(argc, argv);
        !            75: 
        !            76:     xswa.background_pixel = BlackPixel(dpy, DefaultScreen(dpy));
        !            77:     xswa.override_redirect = True;
        !            78:     visual.visualid = CopyFromParent;
        !            79:     win = XCreateWindow(dpy, DefaultRootWindow(dpy), 0, 0, 9999, 9999,
        !            80:            0, DefaultDepth(dpy, DefaultScreen(dpy)), InputOutput, &visual,
        !            81:            CWBackPixel | CWOverrideRedirect, &xswa);
        !            82: 
        !            83:     XMapWindow(dpy, win);
        !            84:     XFlush(dpy);
        !            85:     exit(0);
        !            86: }
        !            87: 

unix.superglobalmegacorp.com

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