home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _e3f89212ada4f8200efab4fcbed69cd8 < prev    next >
Encoding:
Text File  |  2004-06-01  |  4.5 KB  |  135 lines

  1.  
  2. /*    $Id: tixImgXpm.h,v 1.1.1.1 2000/05/17 11:08:42 idiscovery Exp $    */
  3.  
  4. /*
  5.  * tixImgXpm.h --
  6.  *
  7.  *    Generic header file for the pixmap image type. This is NOT a public
  8.  *    header file!
  9.  *
  10.  * Copyright (c) 1996, Expert Interface Technologies
  11.  *
  12.  * See the file "license.terms" for information on usage and redistribution
  13.  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  14.  *
  15.  */
  16.  
  17. #ifndef _TIX_IMG_XPM_H_
  18. #define _TIX_IMG_XPM_H_
  19. #define _TIXIMGXPM
  20. /*
  21.  * Constants
  22.  */
  23.  
  24. #define XPM_MONO        1
  25. #define XPM_GRAY_4        2
  26. #define XPM_GRAY        3
  27. #define XPM_COLOR        4
  28. #define XPM_SYMBOLIC        5
  29. #define XPM_UNKNOWN        6
  30.  
  31. /*
  32.  * The following data structure represents the master for a pixmap
  33.  * image:
  34.  */
  35.  
  36. typedef struct PixmapMaster {
  37.     Tk_ImageMaster tkMaster;    /* Tk's token for image master.  NULL means
  38.                  * the image is being deleted. */
  39.     Tcl_Interp *interp;        /* Interpreter for application that is
  40.                  * using image. */
  41.     Tcl_Command imageCmd;    /* Token for image command (used to delete
  42.                  * it when the image goes away).  NULL means
  43.                  * the image command has already been
  44.                  * deleted. */
  45.     char *fileString;        /* Value of -file option (malloc'ed).
  46.                  * valid only if the -file option is specified
  47.                  */
  48.     char *dataString;        /* Value of -data option (malloc'ed).
  49.                  * valid only if the -data option is specified
  50.                  */
  51.     Tk_Uid id;            /* ID's for XPM data already compiled
  52.                  * into the tixwish binary */
  53.     int size[2];        /* width and height */
  54.     int ncolors;        /* number of colors */
  55.     int cpp;            /* characters per pixel */
  56.     char ** data;        /* The data that defines this pixmap
  57.                  * image (array of strings). It is
  58.                  * converted into an X Pixmap when this
  59.                  * image is instanciated
  60.                  */
  61.     int isDataAlloced;        /* False iff the data is got from
  62.                  * the -id switch */
  63.                 /* First in list of all instances associated
  64.                  * with this master. */
  65.     struct PixmapInstance *instancePtr;
  66. } PixmapMaster;
  67.  
  68. typedef struct ColorStruct {
  69.     char c;            /* This is used if CPP is one */
  70.     char * cstring;        /* This is used if CPP is bigger than one */
  71.     XColor * colorPtr;
  72. } ColorStruct;
  73.  
  74. /*----------------------------------------------------------------------
  75.  * PixmapInstance --
  76.  *
  77.  *    Represents all of the instances of an image that lie within a
  78.  *    particular window:
  79.  *
  80.  *    %% ToDo
  81.  *    Currently one instance is created for each window that uses
  82.  *    this pixmap.  This is usually OK because pixmaps are usually
  83.  *    not shared or only shared by a small number of windows. To
  84.  *    improve resource allocation, we can create an instance for
  85.  *    each (Display x Visual x Depth) combo. This will usually
  86.  *    reduce the number of instances to one.
  87.  *----------------------------------------------------------------------
  88.  */
  89. typedef struct PixmapInstance {
  90.     int refCount;        /* Number of instances that share this
  91.                  * data structure. */
  92.     PixmapMaster *masterPtr;    /* Pointer to master for image. */
  93.     Tk_Window tkwin;        /* Window in which the instances will be
  94.                  * displayed. */
  95.     Pixmap pixmap;        /* The pixmap to display. */
  96.     struct PixmapInstance *nextPtr;
  97.                 /* Next in list of all instance structures
  98.                  * associated with masterPtr (NULL means
  99.                  * end of list).
  100.                  */
  101.     ColorStruct * colors;
  102.     ClientData clientData;    /* Place holder for platform specific
  103.                  * instance data */
  104. } PixmapInstance;
  105.  
  106.  
  107. EXTERN void        TixpInitPixmapInstance _ANSI_ARGS_((
  108.                 PixmapMaster *masterPtr,
  109.                 PixmapInstance *instancePtr));
  110. EXTERN void        TixpXpmAllocTmpBuffer _ANSI_ARGS_((
  111.                 PixmapMaster * masterPtr,
  112.                 PixmapInstance * instancePtr,
  113.                 XImage ** imagePtr, XImage ** maskPtr));
  114. EXTERN void        TixpXpmFreeTmpBuffer _ANSI_ARGS_((
  115.                 PixmapMaster * masterPtr,
  116.                 PixmapInstance * instancePtr,
  117.                 XImage * image, XImage * mask));
  118. EXTERN void        TixpXpmSetPixel _ANSI_ARGS_((
  119.                 PixmapInstance * instancePtr, XImage * image,
  120.                 XImage * mask, int x, int y, XColor * colorPtr,
  121.                 int * isTranspPtr));
  122. EXTERN void        TixpXpmRealizePixmap _ANSI_ARGS_((
  123.                 PixmapMaster * masterPtr,
  124.                 PixmapInstance * instancePtr,
  125.                 XImage * image, XImage * mask, int isTransp));
  126. EXTERN void        TixpXpmFreeInstanceData _ANSI_ARGS_((
  127.                 PixmapInstance *instancePtr, int delete,
  128.                 Display *display));
  129. EXTERN void        TixpXpmDisplay _ANSI_ARGS_((ClientData clientData,
  130.                 Display *display, Drawable drawable,
  131.                 int imageX, int imageY, int width, int height,
  132.                 int drawableX, int drawableY));
  133.  
  134. #endif
  135.