src/aclvis/bxutilsC.cpp File Reference

#include <Xm/Xm.h>
#include <Xm/RowColumn.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>

Include dependency graph for bxutilsC.cpp:

Go to the source code of this file.

Classes

struct  BxXpmAttributes
struct  bxxpmData
struct  bxxpmInternAttrib

Defines

#define LOCAL_STRCASECMP
#define SUPPORTS_WCHARS
#define UNSET   (-1)
#define ARGLIST(p)   p
#define ARG(a, b)   a b;
#define GRA(a, b)   a b;
#define UARG(a, b)   a b;
#define GRAU(a, b)   a b;
#define STRCASECMP   StrCasecmp
#define XTPOINTER   XtPointer
#define BxXpmColorError   1
#define BxXpmSuccess   0
#define BxXpmOpenFailed   -1
#define BxXpmFileInvalid   -2
#define BxXpmNoMemory   -3
#define BxXpmColorFailed   -4
#define BxXpmVisual   (1L<<0)
#define BxXpmColormap   (1L<<1)
#define BxXpmDepth   (1L<<2)
#define BxXpmSize   (1L<<3)
#define BxXpmHotspot   (1L<<4)
#define BxXpmCharsPerPixel   (1L<<5)
#define BxXpmColorSymbols   (1L<<6)
#define BxXpmRgbFilename   (1L<<7)
#define BxXpmInfos   (1L<<8)
#define BxXpmReturnPixels   (1L<<9)
#define BxXpmReturnInfos   BxXpmInfos
#define LFUNC(f, t, p)   static t f()
#define BXXPMARRAY   0
#define BXXPMFILE   1
#define BXXPMPIPE   2
#define BX_TRANSPARENT_COLOR   "None"
#define BXNKEYS   5
#define BXMONO   2
#define BXGRAY4   3
#define BXGRAY   4
#define BXCOLOR   5
#define BX_UNDEF_PIXEL   0x80000000
#define BXXYNORMALIZE(bp, img)
#define BXZNORMALIZE(bp, img)
#define BXXYINDEX(x, y, img)
#define BXZINDEX(x, y, img)
#define BXZINDEX32(x, y, img)   ((y) * img->bytes_per_line) + ((x) << 2)
#define BXZINDEX16(x, y, img)   ((y) * img->bytes_per_line) + ((x) << 1)
#define BXZINDEX8(x, y, img)   ((y) * img->bytes_per_line) + (x)
#define BXZINDEX1(x, y, img)   ((y) * img->bytes_per_line) + ((x) >> 3)
#define Const
#define RETURN(status)
#define RETURN(status)

Typedefs

typedef unsigned char byte

Enumerations

enum  {
  WNull, WTab, WNewLine, WCarriageReturn,
  WFormFeed, WVerticalTab, WBackSlash, WQuote,
  WHash, WColon, WideF, WideL,
  WideN, WideR, WideT, WideV,
  WideUF, WideUL, WideUR, WideUT,
  WideZero, WideOne, NUM_COMMON_WCHARS
}

Functions

 LFUNC (BxXpmCreatePixmapFromData, int,(Display *display, Drawable d, char **data, Pixmap *pixmap_return, Pixmap *shapemask_return, BxXpmAttributes *attributes))
 LFUNC (BxXpmCreateImageFromData, int,(Display *display, char **data, XImage **image_return, XImage **shapemask_return, BxXpmAttributes *attributes))
 LFUNC (BxXpmFreeAttributes, void,(BxXpmAttributes *attributes))
 LFUNC (xpmCreateImage, int,(Display *display, bxxpmInternAttrib *attrib, XImage **image_return, XImage **shapeimage_return, BxXpmAttributes *attributes))
 LFUNC (xpmParseData, int,(bxxpmData *data, bxxpmInternAttrib *attrib_return, BxXpmAttributes *attributes))
 LFUNC (BxXpmVisualType, int,(Visual *visual))
 LFUNC (xpmFreeColorTable, void,(char ***colorTable, int ncolors))
 LFUNC (xpmInitInternAttrib, void,(bxxpmInternAttrib *xmpdata))
 LFUNC (xpmFreeInternAttrib, void,(bxxpmInternAttrib *xmpdata))
 LFUNC (xpmSetAttributes, void,(bxxpmInternAttrib *attrib, BxXpmAttributes *attributes))
 LFUNC (xpmNextString, void,(bxxpmData *mdata))
 LFUNC (xpmNextUI, int,(bxxpmData *mdata, unsigned int *ui_return))
 LFUNC (xpmGetC, int,(bxxpmData *mdata))
 LFUNC (xpmUngetC, int,(int c, bxxpmData *mdata))
 LFUNC (xpmNextWord, unsigned int,(bxxpmData *mdata, char *buf))
 LFUNC (xpmGetCmt, void,(bxxpmData *mdata, char **cmt))
 LFUNC (xpmOpenArray, int,(char **data, bxxpmData *mdata))
 LFUNC (XpmDataClose, void,(bxxpmData *mdata))
 LFUNC (xpm_xynormalizeimagebits, void,(register unsigned char *bp, register XImage *img))
 LFUNC (xpm_znormalizeimagebits, void,(register unsigned char *bp, register XImage *img))
 LFUNC (SetColor, int,(Display *display, Colormap colormap, char *colorname, unsigned int color_index, Pixel *image_pixel, Pixel *mask_pixel, unsigned int *mask_pixel_index))
 LFUNC (CreateXImage, int,(Display *display, Visual *visual, unsigned int depth, unsigned int width, unsigned int height, XImage **image_return))
 LFUNC (SetImagePixels, void,(XImage *image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel *pixels))
 LFUNC (SetImagePixels32, void,(XImage *image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel *pixels))
 LFUNC (SetImagePixels16, void,(XImage *image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel *pixels))
 LFUNC (SetImagePixels8, void,(XImage *image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel *pixels))
 LFUNC (SetImagePixels1, void,(XImage *image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel *pixels))
 LFUNC (atoui, unsigned int,(char *p, unsigned int l, unsigned int *ui_return))
 LFUNC (_XReverse_Bytes, void,(register unsigned char *bpt, register int nb))
static void _putbits src ARG (int, dstoffset) ARG(register int
static void _putbits src numbits GRA (register char *, dst)

Variables

char * BxXpmColorKeys []


Define Documentation

#define ARG a,
b   )     a b;
 

Definition at line 118 of file bxutilsC.cpp.

#define ARGLIST  )     p
 

Definition at line 117 of file bxutilsC.cpp.

#define BX_TRANSPARENT_COLOR   "None"
 

Definition at line 1994 of file bxutilsC.cpp.

#define BX_UNDEF_PIXEL   0x80000000
 

Definition at line 2022 of file bxutilsC.cpp.

#define BXCOLOR   5
 

Definition at line 2006 of file bxutilsC.cpp.

#define BXGRAY   4
 

Definition at line 2005 of file bxutilsC.cpp.

#define BXGRAY4   3
 

Definition at line 2004 of file bxutilsC.cpp.

#define BXMONO   2
 

Definition at line 2003 of file bxutilsC.cpp.

#define BXNKEYS   5
 

Definition at line 1997 of file bxutilsC.cpp.

#define BXXPMARRAY   0
 

Definition at line 1988 of file bxutilsC.cpp.

#define BxXpmCharsPerPixel   (1L<<5)
 

Definition at line 1935 of file bxutilsC.cpp.

#define BxXpmColorError   1
 

#define BxXpmColorFailed   -4
 

#define BxXpmColormap   (1L<<1)
 

Definition at line 1931 of file bxutilsC.cpp.

#define BxXpmColorSymbols   (1L<<6)
 

Definition at line 1936 of file bxutilsC.cpp.

#define BxXpmDepth   (1L<<2)
 

Definition at line 1932 of file bxutilsC.cpp.

#define BXXPMFILE   1
 

Definition at line 1989 of file bxutilsC.cpp.

#define BxXpmFileInvalid   -2
 

#define BxXpmHotspot   (1L<<4)
 

Definition at line 1934 of file bxutilsC.cpp.

#define BxXpmInfos   (1L<<8)
 

Definition at line 1938 of file bxutilsC.cpp.

#define BxXpmNoMemory   -3
 

#define BxXpmOpenFailed   -1
 

#define BXXPMPIPE   2
 

Definition at line 1990 of file bxutilsC.cpp.

#define BxXpmReturnInfos   BxXpmInfos
 

Definition at line 1941 of file bxutilsC.cpp.

#define BxXpmReturnPixels   (1L<<9)
 

Definition at line 1940 of file bxutilsC.cpp.

#define BxXpmRgbFilename   (1L<<7)
 

Definition at line 1937 of file bxutilsC.cpp.

#define BxXpmSize   (1L<<3)
 

Definition at line 1933 of file bxutilsC.cpp.

#define BxXpmSuccess   0
 

#define BxXpmVisual   (1L<<0)
 

Definition at line 1930 of file bxutilsC.cpp.

#define BXXYINDEX x,
y,
img   ) 
 

Value:

((y) * img->bytes_per_line) + \
    (((x) + img->xoffset) / img->bitmap_unit) * (img->bitmap_unit >> 3)

Definition at line 2133 of file bxutilsC.cpp.

#define BXXYNORMALIZE bp,
img   ) 
 

Value:

if ((img->byte_order == MSBFirst) || (img->bitmap_bit_order == MSBFirst)) \
        xpm_xynormalizeimagebits((unsigned char *)(bp), img)

Definition at line 2125 of file bxutilsC.cpp.

#define BXZINDEX x,
y,
img   ) 
 

Value:

((y) * img->bytes_per_line) + \
    (((x) * img->bits_per_pixel) >> 3)

Definition at line 2137 of file bxutilsC.cpp.

#define BXZINDEX1 x,
y,
img   )     ((y) * img->bytes_per_line) + ((x) >> 3)
 

Definition at line 2146 of file bxutilsC.cpp.

#define BXZINDEX16 x,
y,
img   )     ((y) * img->bytes_per_line) + ((x) << 1)
 

Definition at line 2142 of file bxutilsC.cpp.

#define BXZINDEX32 x,
y,
img   )     ((y) * img->bytes_per_line) + ((x) << 2)
 

Definition at line 2140 of file bxutilsC.cpp.

#define BXZINDEX8 x,
y,
img   )     ((y) * img->bytes_per_line) + (x)
 

Definition at line 2144 of file bxutilsC.cpp.

#define BXZNORMALIZE bp,
img   ) 
 

Value:

if (img->byte_order == MSBFirst) \
        xpm_znormalizeimagebits((unsigned char *)(bp), img)

Definition at line 2129 of file bxutilsC.cpp.

#define Const
 

Definition at line 2151 of file bxutilsC.cpp.

#define GRA a,
b   )     a b;
 

Definition at line 119 of file bxutilsC.cpp.

#define GRAU a,
b   )     a b;
 

Definition at line 132 of file bxutilsC.cpp.

#define LFUNC f,
t,
 )     static t f()
 

Definition at line 1952 of file bxutilsC.cpp.

#define LOCAL_STRCASECMP
 

Definition at line 87 of file bxutilsC.cpp.

#define RETURN status   ) 
 

Value:

{ if (image) XDestroyImage(image); \
    if (shapeimage) XDestroyImage(shapeimage); \
    if (image_pixels) free((char *)image_pixels); \
    if (mask_pixels) free((char *)mask_pixels); \
    return(status); }

#define RETURN status   ) 
 

Value:

{ if (colorTable) xpmFreeColorTable(colorTable, ncolors); \
    if (chars) free(chars); \
    if (pixelindex) free((char *)pixelindex); \
    if (hints_cmt)  free((char *)hints_cmt); \
    if (colors_cmt) free((char *)colors_cmt); \
    if (pixels_cmt) free((char *)pixels_cmt); \
    return(status); }

#define STRCASECMP   StrCasecmp
 

Definition at line 139 of file bxutilsC.cpp.

#define SUPPORTS_WCHARS
 

Definition at line 101 of file bxutilsC.cpp.

#define UARG a,
b   )     a b;
 

Definition at line 131 of file bxutilsC.cpp.

#define UNSET   (-1)
 

Definition at line 107 of file bxutilsC.cpp.

#define XTPOINTER   XtPointer
 

Definition at line 160 of file bxutilsC.cpp.


Typedef Documentation

typedef unsigned char byte
 

Definition at line 1992 of file bxutilsC.cpp.


Enumeration Type Documentation

anonymous enum
 

Enumerator:
WNull 
WTab 
WNewLine 
WCarriageReturn 
WFormFeed 
WVerticalTab 
WBackSlash 
WQuote 
WHash 
WColon 
WideF 
WideL 
WideN 
WideR 
WideT 
WideV 
WideUF 
WideUL 
WideUR 
WideUT 
WideZero 
WideOne 
NUM_COMMON_WCHARS 

Definition at line 169 of file bxutilsC.cpp.


Function Documentation

static void _putbits src ARG int  ,
dstoffset 
 

static void _putbits src numbits GRA register char *  ,
dst 
 

Definition at line 2976 of file bxutilsC.cpp.

LFUNC _XReverse_Bytes  ,
void  ,
(register unsigned char *bpt, register int nb) 
 

LFUNC atoui  ,
unsigned  int,
(char *p, unsigned int l, unsigned int *ui_return) 
 

LFUNC SetImagePixels1  ,
void  ,
(XImage *image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel *pixels) 
 

LFUNC SetImagePixels8  ,
void  ,
(XImage *image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel *pixels) 
 

LFUNC SetImagePixels16  ,
void  ,
(XImage *image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel *pixels) 
 

LFUNC SetImagePixels32  ,
void  ,
(XImage *image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel *pixels) 
 

LFUNC SetImagePixels  ,
void  ,
(XImage *image, unsigned int width, unsigned int height, unsigned int *pixelindex, Pixel *pixels) 
 

LFUNC CreateXImage  ,
int  ,
(Display *display, Visual *visual, unsigned int depth, unsigned int width, unsigned int height, XImage **image_return) 
 

LFUNC SetColor  ,
int  ,
(Display *display, Colormap colormap, char *colorname, unsigned int color_index, Pixel *image_pixel, Pixel *mask_pixel, unsigned int *mask_pixel_index) 
 

LFUNC xpm_znormalizeimagebits  ,
void  ,
(register unsigned char *bp, register XImage *img) 
 

LFUNC xpm_xynormalizeimagebits  ,
void  ,
(register unsigned char *bp, register XImage *img) 
 

LFUNC XpmDataClose  ,
void  ,
(bxxpmData *mdata) 
 

LFUNC xpmOpenArray  ,
int  ,
(char **data, bxxpmData *mdata) 
 

LFUNC xpmGetCmt  ,
void  ,
(bxxpmData *mdata, char **cmt) 
 

LFUNC xpmNextWord  ,
unsigned  int,
(bxxpmData *mdata, char *buf) 
 

LFUNC xpmUngetC  ,
int  ,
(int c, bxxpmData *mdata) 
 

LFUNC xpmGetC  ,
int  ,
(bxxpmData *mdata) 
 

LFUNC xpmNextUI  ,
int  ,
(bxxpmData *mdata, unsigned int *ui_return) 
 

LFUNC xpmNextString  ,
void  ,
(bxxpmData *mdata) 
 

LFUNC xpmSetAttributes  ,
void  ,
(bxxpmInternAttrib *attrib, BxXpmAttributes *attributes) 
 

LFUNC xpmFreeInternAttrib  ,
void  ,
(bxxpmInternAttrib *xmpdata) 
 

LFUNC xpmInitInternAttrib  ,
void  ,
(bxxpmInternAttrib *xmpdata) 
 

LFUNC xpmFreeColorTable  ,
void  ,
(char ***colorTable, int ncolors) 
 

LFUNC BxXpmVisualType  ,
int  ,
(Visual *visual) 
 

LFUNC xpmParseData  ,
int  ,
(bxxpmData *data, bxxpmInternAttrib *attrib_return, BxXpmAttributes *attributes) 
 

LFUNC xpmCreateImage  ,
int  ,
(Display *display, bxxpmInternAttrib *attrib, XImage **image_return, XImage **shapeimage_return, BxXpmAttributes *attributes) 
 

LFUNC BxXpmFreeAttributes  ,
void  ,
(BxXpmAttributes *attributes) 
 

LFUNC BxXpmCreateImageFromData  ,
int  ,
(Display *display, char **data, XImage **image_return, XImage **shapemask_return, BxXpmAttributes *attributes) 
 

LFUNC BxXpmCreatePixmapFromData  ,
int  ,
(Display *display, Drawable d, char **data, Pixmap *pixmap_return, Pixmap *shapemask_return, BxXpmAttributes *attributes) 
 


Variable Documentation

char* BxXpmColorKeys[]
 

Initial value:

{
 "s",                                   
 "m",                                   
 "g4",                                  
 "g",                                   
 "c",                                   
}

Definition at line 2024 of file bxutilsC.cpp.


Generated on Mon Jan 16 13:24:01 2006 for IPPL by  doxygen 1.4.6