Main Page   File List   Globals  

libinfo.h

Go to the documentation of this file.
00001 
00028 #ifndef _LIBINFO_H_
00029 #define _LIBINFO_H_
00030 
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034 
00035 #include <stdio.h>
00036 #include <stdlib.h>
00037 #include <string.h>
00038 
00039 
00040 /* Type Definitions */
00041 typedef unsigned char   u8;
00042 typedef signed char     s8;
00043 typedef unsigned short  u16;
00044 typedef unsigned int    u32;
00045 
00046 /* Image Definitions */
00047 #define LI_UNSELECTED   0                           
00048 #define LI_SELECTED     1                           
00051 /*************************************************************************
00052 **                       OUTPUT CONFIGURATION                           **
00053 **                                                                      **
00054 **      Undefine to exclude output code if you don't need it            **
00055 **      and want to reduce code size. You could also disable            **
00056 **      these and define them as preprocessor directives.               **
00057 *************************************************************************/
00058 
00059 #define LI_OUTPUT_XPM                               
00060 #define LI_OUTPUT_PPM                               
00063 /*************************************************************************
00064 **                              USER INTERFACE                          **
00065 *************************************************************************/
00066 
00067 /* Bitmaps And Palette */
00068 u8  *LIBitmapUnselected;                            
00069 u8  *LIBitmapSelected;                              
00070 u8  *LIPalette;                                     
00072 /* Icon Dimensions */
00073 int LIWidth;                                        
00074 int LIHeight;                                       
00075 int LINumColours;                                   
00077 /* Error Handling */
00078 char *LIErrorString;                                
00080 /* Interface Functions */
00081 int  LIReadDefIcon(char *filename);                 
00082 int  LIReadNewIcon(char *filename);                 
00083 void LICleanUp(void);                               
00085 /* Output Functions */
00086 #ifdef LI_OUTPUT_XPM
00087 
00088 int  LISetXPMTransparency(int colour);              
00089 int  LIWriteXPM(char *filename, int image);         
00091 #endif
00092 #ifdef LI_OUTPUT_PPM
00093 
00094 int  LIWritePPM(char *filename, int image);         
00096 #endif
00097 
00098 /* Library Information Functions */
00099 char *LIGetVersion(void);                           
00100 char *LIGetDate(void);                              
00101 char *LIGetCopyright(void);                         
00104 /*************************************************************************
00105 **                              INTERNAL STUFF                          **
00106 **                                                                      **
00107 **                      You shouldn't need to access these              **
00108 *************************************************************************/
00109 
00110 /* Library Information */
00111 #define LIBINFO_VERSION     "1.0 Beta"
00112 #define LIBINFO_DATE        "20/11/2003"
00113 #define LIBINFO_COPYRIGHT   "Copyright (C) 2003 Gary Harris <garyjharris@users.sourceforge.net>"
00114 
00115 /* The icon file */
00116 FILE *fileIcon;
00117 
00118 /* Internal Variables */
00119 u16 magic, version, type;
00120 u32 image1, image2, tool, num_tooltypes;
00121 
00122 /* Internal Functions */
00123 u16  Get16(u8 *p);
00124 u32  Get32(u8 *p);
00125 int  Read8(u8 *buf, int len);
00126 int  ReadHeader(void);
00127 int  ReadIcon(int image);
00128 int  ReadNewicon(int image, char *name);
00129 u8   *DecompressNewicon(u8 *src, char *name, int len, int bits);
00130 char *ReadString();
00131 int  StartTooltypes();
00132 u8   *GetTooltype(char *name);
00133 
00134 #ifdef LI_OUTPUT_XPM
00135 
00136 int  WriteXPM(char *filename, int width, int height, int ncols, u8 *palette, int image);
00137 
00138 #endif
00139 #ifdef LI_OUTPUT_PPM
00140 
00141 int  WritePPM(char *filename, int width, int height, int ncols, u8 *palette, int image);
00142 
00143 #endif
00144 
00145 #ifdef __cplusplus
00146 }
00147 #endif
00148 
00149 #endif /*_LIBINFO_H_*/
00150 
00151 /*##########################################################################*/
00152 
00153 /********************************************************************************************/
00154 /*                              Main page for doxygen docs.                                 */
00155 /********************************************************************************************/
00156 

Generated on Tue Dec 23 15:34:24 2003 for LibInfo by doxygen1.3