home *** CD-ROM | disk | FTP | other *** search
- /*
- % This software is copyrighted as noted below. It may be freely copied,
- % modified, and redistributed, provided that the copyright notices are
- % preserved on all copies.
- %
- % There is no warranty or other guarantee of fitness for this software,
- % it is provided solely "as is". Bug reports or fixes may be sent
- % to the author, who may or may not act on them as he desires.
- %
- % You may not include this software in a program or other software product
- % without supplying the source, or without informing the end-user that the
- % source is available for no extra charge.
- %
- % If you modify this software, you should include a notice giving the
- % name of the person performing the modification, the date of modification,
- % and the reason for such modification.
- %
- % getx11.h - Declaration for image_information structure...
- %
- % Author: Martin R. Friedmann
- % Dept of Electrical Engineering and Computer Science
- % University of Michigan
- % Date: Tue, Dec 10, 1989
- % Copyright (c) 1989, University of Michigan
- %
- % Modified: Jin, Guojun - ITG, LBL
- % Date: Mon, Oct 1, 1990
- % Copyright (c) 1990, Lawrence Berkeley Laboratory
- */
-
- #if !defined PANEL_H & defined X_WINDOW_DEP
- # include <stdio.h>
- # include <math.h>
- # include <ctype.h>
- # include <X11/X.h>
- # include <X11/Xlib.h>
- # include <X11/Xutil.h>
- # include <X11/cursorfont.h>
- #endif
- #include "rle.h"
-
- #define COUNT_OF(_array_) (sizeof(_array_) / sizeof(_array_[0]))
- #define IMAGE_BORDERWIDTH 3
-
- #ifdef USE_STDLIB_H
- #include <stdlib.h>
- #else
-
- #ifdef USE_STRING_H
- #include <string.h>
- #else
- #include <strings.h>
- #endif
- extern char *getenv();
- extern void *malloc(), *realloc(), free();
-
- #endif USE_STDLIB_H
-
- typedef unsigned int Pixel;
- typedef void VOID_FUNCTION();
- typedef int array16[16];
-
- #define MALLOC_FAILURE 3
- #define FILE_FAILURE 2
- #define FATAL_FAILURE 1
- #define SUCCESS 0
-
- #define VPRINTF if (verbose) fprintf
- #define DPRINTF if (debug) fprintf
-
- #define SHIFT_MASK_PIXEL(r, g, b) \
- ( (((r) << red_shift) & red_mask) \
- | ( ((g) << green_shift) & green_mask ) \
- | ( ((b) << blue_shift) & blue_mask ) )
-
- #define SHIFT_MASK_PIXEL_32(r, g, b) \
- ( ((r) << red_shift) | ((g) << green_shift) | ((b) << blue_shift) )
-
- #ifndef HIPS2_HF
- typedef int Boolean;
- #endif
-
- extern double display_gamma;
- extern bool jump_flag, load_frame, multi_frame, tuner_flag, rw_set,
- debug, /* set if debug mode -D */
- verbose; /* -v */
- extern int iflag, screen, stingy_flag, specified_levels;
-
- #if defined HIPS2_HF | defined HIPS_IMAGE
- extern char *Progname;
- #define progname Progname
- #else
- extern char* progname;
- #endif
-
- /* X11/NeWS server bug workaround */
- extern int no_color_ref_counts;
-
- /* Color map, gamma correction map, & lookup tables */
-
- extern int red_shift, green_shift, blue_shift;
- extern Pixel red_mask, green_mask, blue_mask, pixel_base;
-
- /* pointer arithmetic. Returns Y'th row in our saved data array. */
-
- #ifndef SAVED_RLE_ROW
-
- #ifndef GETX_OFFSET
- #define GETX_OFFSET 0
- #endif
- #define SAVED_RLE_ROW(img, y) \
- (((Image*)img)->scan_data + \
- (((y) + GETX_OFFSET) * ((Image*)img)->width * (img)->dpy_channels))
- #define ORIG_RLE_ROW(img, y) \
- (((Image*)img)->data + \
- (((y) + GETX_OFFSET) * ((Image*)img)->width * (img)->dpy_channels))
- #endif
-
- #define duff8(counter, block) { \
- while (counter >= 8) { \
- { block; } \
- { block; } \
- { block; } \
- { block; } \
- { block; } \
- { block; } \
- { block; } \
- { block; } \
- counter -= 8; \
- } \
- switch (counter & 7) { \
- case 7: { block; } \
- case 6: { block; } \
- case 5: { block; } \
- case 4: { block; } \
- case 3: { block; } \
- case 2: { block; } \
- case 1: { block; } \
- case 0: counter = 0; \
- }\
- }
-
- #define UnmapPixWindow(img) XUnmapWindow (img->dpy, img->pix_info_window)
-
- #define DESIRED_ICON_WIDTH 128
- #define DESIRED_ICON_HEIGHT 96
-