[436] in Humor

home help back first fref pref prev next nref lref last post

HUMOR: Color in X

daemon@ATHENA.MIT.EDU (Andrew A. Bennett)
Fri Sep 2 11:21:54 1994

To: humor@MIT.EDU
Date: Fri, 02 Sep 1994 11:13:09 EDT
From: "Andrew A. Bennett" <abennett@MIT.EDU>


Date: Thu, 01 Sep 1994 18:34:50 -0600 (MDT)
From: Espacionaute Spiff domine! <MATOSSIAN%ARIES@VAXF.Colorado.EDU>
....
Forwarded-by: tk@research.att.com (Thomas Kirk)
Date: Mon, 22 Aug 94 13:10 EDT
Subject: Color in X

 From the "He said it better than I could" department, I found the
 following within a comment in someone's code.

/*
 * Found in Don Hopkin`s .plan file:
 *
 *   The color situation is a total flying circus.  The X approach to
 *   device independence is to treat everything like a MicroVax framebuffer
 *   on acid.  A truely portable X application is required to act like the
 *   persistent customer in the Monty Python ``Cheese Shop'' sketch.  Even
 *   the simplest applications must answer many difficult questions, like:
 *
 *   WHAT IS YOUR DISPLAY?
 *       display = XOpenDisplay("unix:0");
 *   WHAT IS YOUR ROOT?
 *       root = RootWindow(display, DefaultScreen(display));
 *   AND WHAT IS YOUR WINDOW?
 *       win = XCreateSimpleWindow(display, root, 0, 0, 256, 256, 1,
 *                                 BlackPixel(display, DefaultScreen(display)),
 *                                 WhitePixel(display, DefaultScreen(display)))
 *   OH ALL RIGHT, YOU CAN GO ON.
 *
 *   WHAT IS YOUR DISPLAY?
 *         display = XOpenDisplay("unix:0");
 *   WHAT IS YOUR COLORMAP?
 *         cmap = DefaultColormap(display, DefaultScreen(display));
 *   AND WHAT IS YOUR FAVORITE COLOR?
 *         favorite_color = 0; /* Black. */
 *         /* Whoops! No, I mean: */
 *         favorite_color = BlackPixel(display, DefaultScreen(display));
 *         /* AAAYYYYEEEEE!! (client dumps core & falls into the chasm) */
 *
 *   WHAT IS YOUR DISPLAY?
 *         display = XOpenDisplay("unix:0");
 *   WHAT IS YOUR VISUAL?
 *         struct XVisualInfo vinfo;
 *         if (XMatchVisualInfo(display, DefaultScreen(display),
 *                              8, PseudoColor, &vinfo) != 0)
 *            visual = vinfo.visual;
 *   AND WHAT IS THE NET SPEED VELOCITY OF AN XConfigureWindow REQUEST?
 *         /* Is that a SubStructureRedirectMask or a ResizeRedirectMask? */
 *   WHAT??! HOW AM I SUPPOSED TO KNOW THAT?
 *   AAAAUUUGGGHHH!!!! (server dumps core & falls into the chasm)
 */


home help back first fref pref prev next nref lref last post