home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / DCLAP 4j / DClap / DIconLib.cpp < prev    next >
Encoding:
Text File  |  1995-12-17  |  14.7 KB  |  634 lines  |  [TEXT/R*ch]

  1. // DIconLib.cp
  2.  
  3.  
  4.  
  5. #include "Dvibrant.h"
  6. #include "DIconLib.h"
  7. #include "DApplication.h"
  8. #include "DList.h"
  9. #include "DFile.h"
  10. #include <stdio.h>
  11.  
  12. typedef    unsigned char    byte;
  13. enum  BitFormat            { macbits, msbits, xbits };
  14. enum  BitmapFormat     { unknown, xbitmapfile, maciconrezfile};
  15.  
  16. DIconList* gIconList = NULL;
  17.  
  18. class DIconGlobals {
  19. public:
  20.    DIconGlobals() { gIconList = new DIconList(); }
  21. };
  22.  
  23. static DIconGlobals    globals; // initializes globals here
  24.  
  25. // Unix CC and gcc have problems linking DIcon.o w/ only data
  26. #ifdef OS_UNIX
  27. #include "DIcons.cc"
  28. #endif
  29.  
  30.  
  31. #if 0
  32. static unsigned short testicons[] = {
  33.     22213, 0, 13, 13, 12,
  34.  0xff00, 0x8180, 0x81c0, 0x9040, 0xa840, 0xa840, 0x9240, 0x8240,
  35.  0x8240, 0x8240, 0x8040, 0xffc0 
  36. ,
  37.   1215, 0, 32, 32, 64,
  38.  0x1fff, 0xfc00, 0x1000,  0x600, 0x13a0,  0x500, 0x13a0,  0x480,
  39.  0x13a8, 0x2440, 0x13a0,  0x420, 0x13a0, 0xe7f0, 0x13a1, 0x1010,
  40.  0x13a2,  0x810, 0x13a2,  0x810, 0x13aa,  0x890, 0x13a1, 0x1010,
  41.  0x13e0, 0xe010, 0x1220,   0x10, 0x1220,   0x10, 0x1220,   0x10,
  42.  0x122b, 0xfe90, 0x1222,  0x210, 0x11c2,  0x210, 0x1322, 0x1fd0,
  43.  0x1322, 0x1050, 0x1212, 0x1050, 0x121b, 0xf250, 0x1210, 0x1050,
  44.  0x1230, 0x1050, 0x1120, 0x1fd0, 0x11a0,   0x10, 0x10e0,   0x10,
  45.  0x1230, 0x2090, 0x1000,   0x10, 0x1000,   0x10, 0x1fff, 0xfff0
  46. ,
  47.   0,0,0,0,0,0 
  48. };
  49. #endif
  50.  
  51. static Boolean gByteFlipMade = false;
  52.  
  53. #ifdef NOTNOW_WIN_MOTIF
  54.  
  55. static byte    XByteFlip [256];
  56.  
  57. void MakeXByteFlip()
  58. {
  59.     short i, j;
  60.   byte val, inv;
  61.  
  62.   for (i = 0; i < 256; i++) {
  63.     inv = 0;
  64.     val = (byte) i;
  65.     for (j = 0; j < 8; j++) {
  66.       inv = (inv << 1);
  67.       inv += (val % 2);
  68.       val = (val >> 1);
  69.     }
  70.     XByteFlip[i] = inv;
  71.   }
  72.   gByteFlipMade= true;
  73. }
  74.  
  75. #else
  76.  
  77. void  MakeXByteFlip()
  78. {
  79.   gByteFlipMade= true;
  80. }
  81. #endif
  82.  
  83.  
  84. void DIconList::WriteAsCode( char* filename) 
  85. {
  86.     if (!filename) 
  87.         filename= (char*) gFileManager->GetOutputFileName("icons.c");
  88.     if (filename) {
  89.         long i, n= this->GetSize();
  90.         char *sbreak= ",\n";
  91.         DFile  iconf( filename, "w", "TEXT", "MMCC");
  92.         iconf.Open();
  93.         char buf[128];
  94.         sprintf(buf, "static unsigned short iconlist[] = { /* %d icons */ {\n", n);
  95.         iconf.WriteLine(buf);
  96.         for (i=0; i<n; i++) {
  97.             DIcon* ic= (DIcon*)IconAt(i);
  98.             ic->WriteCode( &iconf);
  99.             if (i == n-1) sbreak= ",\n 0, 0, 0, 0, 0, 0\n};\n";
  100.             iconf.WriteLine( sbreak );
  101.             }
  102.         iconf.Close();
  103.         }
  104. }
  105.  
  106. void DIcon::WriteCode( DFile* iconf)
  107. {
  108.     short i, nwords= 1 + ((fBitmapSize-1) / sizeof(short) );
  109.     char buf[512];
  110.     
  111.     sprintf( buf, " %d, %d, %d, %d, %d,\n", 
  112.                         fId, fSmall, fWidth, fHeight, nwords );
  113.     iconf->WriteLine( buf);
  114.     unsigned short *w = (unsigned short*) fBitmap;
  115.     char comma= ',';
  116.     for (i=0; i<nwords; i++) {
  117.         Boolean last= (i == nwords-1);
  118.         Boolean newline= (i % 8 == 7) || last;
  119.         if (last) comma= ' ';
  120.         sprintf( buf, " %#6x%c", *w, comma);
  121.         iconf->WriteLine( buf, newline);
  122.         w++;
  123.         }
  124.      
  125. }
  126.  
  127.  
  128. //class DIcon : public DObject
  129.  
  130. DIcon::DIcon() :
  131.     DObject(),
  132.     fId(0), fWidth(0), fHeight(0), fSmall(false),
  133.     fBitmapSize(0), fBitmap(NULL)
  134. }
  135.     
  136. DIcon::DIcon( long id, short width, short height, const char* bitmap, long bitmapsize) : 
  137.     DObject(),
  138.     fId(id), fWidth(width), fHeight(height),fSmall(false),
  139.     fBitmapSize(bitmapsize), fBitmap(NULL)
  140. {
  141.     Install( width, height, bitmap, bitmapsize);
  142. }
  143.  
  144. DIcon::DIcon( IconStore* store) :
  145.     DObject(), fBitmapSize(0), fBitmap(NULL)
  146. {
  147.     Install( -(store->width), store->height, (char*) &(store->bitmap), 
  148.                      store->bitmapsize * sizeof(short));
  149.     fId= store->id;
  150.     fSmall= store->smalli;
  151.     if (gIconList) gIconList->InsertLast( this);
  152. }
  153.  
  154.     
  155. DIcon::~DIcon() 
  156.     fBitmap= (char*)Nlm_MemFree(fBitmap); 
  157. }
  158.  
  159.  
  160. void DIcon::Draw(Nlm_RecT area)
  161. {
  162.     area.right  = Min( area.right, area.left + fWidth);
  163.     area.bottom = Min( area.bottom, area.top + fHeight);
  164.     Nlm_CopyBits( &area, fBitmap);
  165. }
  166.         
  167. void DIcon::Install( short width, short height, const char* bitmap, long bitmapsize) 
  168. {
  169.   Boolean flipbyte= (width<0);
  170.   if (flipbyte) width = -width;
  171.  
  172.     fWidth = width;
  173.     fHeight= height;
  174.     if (fBitmap) fBitmap= (char*)Nlm_MemFree(fBitmap);
  175.     fBitmapSize= 0;
  176.  
  177.     if (bitmap) {        
  178.         fBitmapSize = bitmapsize;
  179.         if ((fBitmap = (char*) Nlm_MemGet(fBitmapSize+2, FALSE)) != NULL) {
  180.  
  181. #ifdef IS_LITTLE_ENDIAN
  182. // damn, really I should just revise the compiled data form to use bytes instead of words
  183. // this is just a word little/big endian problem....
  184. //#if defined(WIN_MOTIF) || defined(WIN_MSWIN)
  185.        if (flipbyte) {
  186.          byte *storebyte, *bp, *bpend;
  187.          //if (!gByteFlipMade) MakeXByteFlip();  
  188.          storebyte= (byte*) fBitmap;
  189.          bp = (byte*) bitmap;
  190.          bpend= bp + bitmapsize;
  191.          while (bp < bpend) { 
  192.                  *storebyte++= bp[1];
  193.                  *storebyte++= bp[0];
  194.                  bp += 2;
  195.                     }
  196.          }
  197.        else
  198. #endif
  199.                 Nlm_MemCpy (fBitmap, bitmap, fBitmapSize); // +1 bad for mswin?
  200.                 fBitmap[fBitmapSize]= 0;
  201.             }
  202.         }
  203.  
  204.  
  205.  
  206.  
  207. //class DIconList : public DList
  208.  
  209. DIconList::DIconList()
  210. {
  211. }
  212.  
  213.  
  214. DIcon* DIconList::IconById(long id) 
  215. {
  216.     if (id) {
  217.         long i, n= this->GetSize();
  218.         for (i= 0; i<n; i++) {
  219.             if (IconAt(i)->fId == id) return IconAt(i);
  220.             }
  221.     }
  222.     return NULL;
  223. }
  224.  
  225. void DIconList::StoreFromCode( unsigned short* ilist, short nlist) 
  226. {
  227.     Boolean notdone;
  228.     IconStore* store;
  229.     unsigned short* next;
  230.     short i= 0;
  231.     
  232.     store= (IconStore*) ilist;    
  233.     notdone= (store->bitmapsize) && (nlist==0 || (i<nlist));
  234.     while (notdone) {
  235.         next= ilist + sizeof(IconStore) + (store->bitmapsize - 1) * sizeof(short);
  236.         DIcon* ic= new DIcon( store);
  237.         this->InsertLast( ic);
  238.         i++;
  239.         ilist= next;
  240.         store= (IconStore*) ilist;
  241.         notdone= (store->bitmapsize) && (nlist==0 || (i<nlist));
  242.         }
  243. }
  244.  
  245.  
  246. void DIconList::ReadAppIcons() 
  247. {
  248. #ifdef OS_DOS
  249.   char *suffix = ".icn"; // ?? or ".ico", which is also MSWin own format
  250. #else
  251.   char *suffix = ".icons";
  252. #endif
  253.     char *iconfile = NULL;
  254.  
  255.   //MakeXByteFlip();
  256.     long len= StrLen(  (char*)gApplication->Shortname()) + StrLen(suffix);
  257.     iconfile= (char*) MemNew(len+2);
  258.     StrCpy(iconfile, (char*)gApplication->Shortname());
  259.     StrCat(iconfile, suffix);
  260.     this->Read(iconfile);
  261.     Nlm_MemFree(iconfile);
  262. }
  263.     
  264.     
  265.  
  266.  
  267. Boolean DIconList::Read(char* filename) 
  268. {
  269.     BitmapFormat    fileformat= unknown;
  270.     FILE *f= FileOpen( filename, "r");
  271.     if (f) {
  272.         char line[512];
  273.         Boolean more= true;
  274.         short    atline = 0;
  275.         while (more && FileGets( line, 512, f)) {
  276.             unsigned long index = 0;
  277.             atline++;
  278.  
  279.             if (Nlm_StrngPos(line, "char ", 0, true, &index)  
  280.             || Nlm_StrngPos(line, "static ", 0, true, &index)) {
  281.                 fileformat= xbitmapfile;    
  282.                 more= false;
  283.                 }
  284.                 
  285.             else if (Nlm_StrngPos(line, "resource ", 0, true, &index))  {
  286.                 fileformat= maciconrezfile;    
  287.                 more= false;
  288.                 }
  289.             
  290.             if (atline > 50) more= false;        
  291.             }
  292.         }
  293.     FileClose( f);
  294.     
  295.     switch (fileformat) {
  296.         case xbitmapfile        : return this->ReadXbitmapFormat( filename);
  297.         case maciconrezfile    : return this->ReadMacRezFormat( filename);
  298.         default                            : return false;
  299.         }
  300.         
  301. }
  302.  
  303.  
  304.  
  305. Boolean DIconList::ReadMacRezFormat(char* filename) 
  306. {
  307. /******
  308. mac rez file format:
  309. resource 'ICN#' (128, "Calc Family", purgeable) {
  310. {    $"..."
  311.     $"...",
  312.     // icon mask 
  313.     $"..."
  314.     $"..."
  315.   }
  316. };
  317.  
  318. resource 'ics#' (128, "Calc Family", purgeable) {
  319. };
  320.  
  321. resource 'ICON' (kSeedIconId, purgeable) {
  322.     $"0001 0000 0002 8000 0004 4000 0008 2000 0010 1000 0020 0800 0040 0400 0080 0200"
  323.     $"0100 0100 0200 0080 0400 0040 0800 0020 1000 0010 2000 0008 4000 3F04 8000 4082"
  324.     $"4000 8041 2001 3022 1001 C814 080E 7F8F 0402 3007 0201 0007 0100 8007 0080 6007"
  325.     $"0040 1FE7 0020 021F 0010 0407 0008 0800 0004 1000 0002 2000 0001 4000 0000 8000"
  326. };
  327. ******/
  328.  
  329.     const    short    bufsize = 512;
  330.     char  line[512];
  331.     byte    buf[bufsize];
  332.     byte *bitsp= NULL, *bitmap = NULL;
  333.     Boolean inbits= false, instring= false;
  334.     short    width = 0, height = 0;
  335.     long     id = 0;
  336.     char* linep= line;
  337.     long     bytesize= 0;
  338.     long     atsize= 0;
  339.     Boolean gotdata= false;
  340.     unsigned long index;
  341.  
  342.     FILE *f= FileOpen( filename, "r");
  343.     if (f) 
  344.      while (FileGets( line, 512, f)) {
  345.         // assume may be multiple bitmaps / file
  346.         linep= line;
  347.         
  348.         if (inbits) {
  349.     suckbits:            
  350.     
  351.                 // here we must watch for 
  352.                 //    "$" == flag for hex data following
  353.                 //    '"' == start/end of string data
  354.                 //    ',' == end of one icon, another follows ?? we only get 1st & ingore mask?
  355.                 //    '}' ';' == end of resource
  356.                 
  357.             char ec, *ep;
  358.             char *cp= linep;
  359.             unsigned short card;
  360.             short rslt;
  361.             
  362.             if (!atsize || !bitsp) {
  363.                 bitsp= buf;
  364.                 atsize= 0;
  365.                 }
  366.                 
  367.             while (*cp) {
  368.             
  369.                 if (instring) {
  370.                     short ic;
  371.                     while (*cp && !isalnum(*cp)) cp++;
  372.                     for (ic= 0, ep= cp; 
  373.                         ic<2 && (*ep) && isalnum(*ep); 
  374.                         ep++, ic++) ;
  375.                     ec= *ep; *ep= 0; card= 0;
  376.                     rslt= sscanf( cp, "%hx", &card);
  377.                     *ep= ec;
  378.                     if ( atsize<bufsize && rslt>0 ) { 
  379.                         *bitsp++ = (byte) card;
  380.                         atsize++;
  381.                         }
  382.                     cp = ep;
  383.                     }    
  384.                 else
  385.                     cp++;
  386.                     
  387.                 if (*cp == '"') instring= !instring;
  388.                 else if (*cp == '}' || *cp == ';') inbits= instring = false;
  389.                 else if (*cp == ',') { 
  390.                         // skip rest of data in this rez.. ??
  391.                     while (*cp && !(*cp == '}' || *cp == ';')) cp++; 
  392.                     inbits= instring= false;
  393.                     } 
  394.                 
  395.                 if (atsize >= bufsize || !inbits) {
  396.                     //move buf[] data to bitmap store...
  397.                     long offset= bytesize;
  398.                     bytesize += atsize;
  399.                     if (!bitmap) 
  400.                         bitmap= (byte*) Nlm_MemGet( bytesize, false);
  401.                     else 
  402.                         bitmap= (byte*) Nlm_MemMore( bitmap, bytesize);
  403.                     Nlm_MemCopy( bitmap+offset, buf, atsize);
  404.                     bitsp= buf;
  405.                     atsize= 0;
  406.                     }
  407.                     
  408.                 if (!inbits) {                    
  409.                         // guess at width/height
  410. #if 1
  411.                     width= height= short( sqrt(bytesize * 8));
  412. #else            
  413.                         // ?? do a simple int square root -- bad for non-base-2 values
  414.                     long w= bytesize * 8;
  415.                     long h= 1;
  416.                     while (w>h) {  
  417.                         w >>= 1;
  418.                         h <<= 1;
  419.                         }
  420.                     width = w;
  421.                     height= h;
  422. #endif                    
  423.                     DIcon* ic= new DIcon( id, width, height, (const char*)bitmap, bytesize);
  424.                     this->InsertLast( ic);
  425.                     width= height= id= 0;
  426.                     bitmap= (byte*) Nlm_MemFree(bitmap);
  427.                     bitsp= NULL;
  428.                     bytesize= atsize= 0;
  429.                     inbits= instring= false;
  430.                     gotdata= true;
  431.                     *cp= 0; // done
  432.                     }
  433.                     
  434.                 }
  435.             } // end suckbits
  436.             
  437.                         
  438.         else if ( (linep= strchr(line,'{')) != NULL  && 
  439.              ( Nlm_StrngPos(line, "resource 'ICN#'", 0, true, &index)
  440.             || Nlm_StrngPos(line, "resource 'ics#'", 0, true, &index)
  441.             || Nlm_StrngPos(line, "resource 'ICON'", 0, true, &index) ) )
  442.             {
  443.             // !! get id value == first # after "("
  444.             char *nump= strchr(line,'(');
  445.             if (nump) {
  446.                 char *ep, ec;
  447.                 nump++;
  448.                 for (ep= nump; isdigit(*ep); ep++) ;
  449.                 ec= *ep; *ep= 0;
  450.                 id= atol(nump);
  451.                 *ep= ec;
  452.                 }
  453.             linep++;
  454.             inbits= true;
  455.             goto suckbits; 
  456.             }
  457.  
  458.         
  459.         }
  460.         
  461.     FileClose(f);
  462.     return gotdata;
  463. }
  464.  
  465.  
  466.  
  467. Boolean DIconList::ReadXbitmapFormat(char* filename) 
  468. {
  469. /******
  470. Xbitmap file format:
  471. #define  somename_width  16
  472. #define  somename_height 32
  473. #define  somename_bittype  x    #< optional addition to specify BitFormat
  474. static char somename [] = {            #< data starts after "{", ends after "}"
  475.    0x0f, 0xc0, 0x12, 0xff };    #< bitmap data as hex or decimal string of chars
  476. ******/
  477.     Boolean gotdata= false;
  478.     char line[512];
  479.     byte *bitsp= NULL, *bitmap = NULL;
  480.     Boolean inbits= false;
  481.     short    width = 0, height = 0;
  482.     long id = 0;
  483.     char* linep= line;
  484.     long     bytesize= 0;
  485.     long     atsize= 0;
  486.     short    bswap = 0;
  487.     BitFormat bitstype = macbits;
  488.  
  489.                 // set win system defaults -- override if file says to.
  490. #ifdef  WIN_MAC
  491.     bitstype = macbits;
  492. #endif
  493. #ifdef WIN_MSWIN
  494.     bitstype = msbits;
  495. #endif
  496. #ifdef WIN_MOTIF
  497.     bitstype = xbits;
  498. #endif
  499.  
  500.     FILE *f= FileOpen( filename, "r");
  501.     if (f) 
  502.      while (FileGets( line, 512, f)) {
  503.         // assume may be multiple bitmaps / file
  504.         linep= line;
  505.         
  506.         if (inbits) {
  507.     suckbits:            
  508.                   // data looks like: 0x80, 0x01, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00};
  509.             char* cp= linep;
  510.             if (!bitmap) {
  511.                 bytesize= height * ((width+7) / 8); // bytes/row + rowcount
  512.                 bitmap= (byte*) Nlm_MemGet( bytesize+1, false);
  513.                 bitsp= bitmap;
  514.                 }
  515.                 
  516.             while (*cp) {
  517.             
  518.                 if (*cp == '}' || *cp == ';') {
  519.                     // install data into new icon...
  520.                     *bitsp= 0; // 0 terminate? -- this isn't really useful, since bitmap can have nulls
  521.                     DIcon* ic= new DIcon( id, width, height, (const char*)bitmap, atsize);
  522.                     this->InsertLast( ic);
  523.                     width= height= id= 0;
  524.                     bitmap= (byte*) Nlm_MemFree(bitmap);
  525.                     bitsp= NULL;
  526.                     bswap= bytesize= atsize= 0;
  527.                     inbits= false;
  528.                     gotdata= true;
  529.                     *cp= 0; // done
  530.                     }
  531.                     
  532.                 else if (isdigit(*cp)) {
  533.                     short rslt= 0;
  534.                     unsigned short card= 0;
  535.                     char *fmt = "%hu";
  536.                     char ec, *ep = cp;
  537.                     Boolean okay= true;
  538.                     
  539.                     while (okay) {
  540.                         ep++;
  541.                         if (*ep == 'x' || *ep == 'X') fmt= "%hx";  
  542.                         else if (!*ep || !isalnum(*ep)) okay= false;
  543.                         }
  544.                     ec= *ep; *ep= 0;
  545.                     rslt= sscanf( cp, fmt, &card);
  546.                     *ep= ec;
  547.                     if ( atsize<bytesize && rslt>0 ) { 
  548.                         switch (bitstype) {
  549.                             case xbits: {
  550.                                 // X bitmaps have WEIRD storage format !! see Nlm_CopyBits
  551.                                 byte drac, i;
  552.                                 for (i=0, drac= 0; i<8; i++) { drac <<= 1; drac += card & 1; card >>= 1; }
  553.                                 *bitsp++ = (byte) drac;
  554.                                 }break;
  555.                             case msbits: {
  556.                                 *bitsp++ = ~(byte) card; // mswin is NOT
  557.                                 }break;
  558.                             case macbits: {
  559.                                 *bitsp++ = (byte) card;
  560.                                 }break;
  561.                             }
  562.                         atsize++;
  563.                         }
  564.                     cp = ep;
  565.                     }
  566.                     
  567.                 //else if (*cp == ',') cp++;
  568.                 else cp++; // spaces, all else...
  569.                 }
  570.             }
  571.             
  572.         else if (width && height && (linep= strchr(line,'{')) != NULL) {
  573.             linep++;
  574.             inbits= true;
  575.             goto suckbits; 
  576.             }
  577.             
  578.         else {
  579.             //look for string w/ "#define somename_width 16" << "width" is key
  580.             //or "#define somename_height 16" << "height" is key
  581.             unsigned long index = 0;
  582.             char* cp;
  583.             if (Nlm_StrngPos(line, "width", 0, false, &index)) { //false==case-insensitive
  584.                 cp= line + index + 5; //length(width)
  585.                 while (*cp && !isdigit(*cp)) cp++;
  586.                 width= atol(cp); //?? what is better than atol()    
  587.                 }                 
  588.             else if (Nlm_StrngPos(line, "height", 0, false, &index)) {
  589.                 cp= line + index + 5;  
  590.                 while (*cp && !isdigit(*cp)) cp++;
  591.                 height= atol(cp); //?? what is better than atol()    
  592.                 }                 
  593.             else if (Nlm_StrngPos(line, "ident", 0, false, &index)) { 
  594.                 cp= line + index + 5; 
  595.                 while (*cp & !isdigit(*cp)) cp++;
  596.                 id= atol(cp);
  597.                 }                 
  598.             else if (Nlm_StrngPos(line, "bitstype", 0, false, &index)) { 
  599.                 cp= line + index + 8; 
  600.                 index= 0;
  601.                 if (Nlm_StrngPos(cp, "mac", 0, false, &index)) bitstype= macbits; 
  602.                 else if (Nlm_StrngPos(cp, "x", 0, false, &index)) bitstype= xbits; 
  603.                 else if (Nlm_StrngPos(cp, "ms", 0, false, &index)) bitstype= msbits; 
  604.                 }                 
  605.             }
  606.         
  607.         }
  608.         
  609.     FileClose(f);
  610.     return gotdata;
  611. }
  612.         
  613.  
  614.  
  615. #if 0
  616.  
  617.  
  618. // Xlibrary standard bitmap form:
  619. // (width+7) div 8 = # bytes/row
  620. #define left_ptr_width 16
  621. #define left_ptr_height 16
  622. #define left_ptr_x_hot 3
  623. #define left_ptr_y_hot 1
  624. static char left_ptr_bits[] = {
  625.    0x00, 0x00, 0x08, 0x00, 0x18, 0x00, 0x38, 0x00, 0x78, 0x00, 0xf8, 0x00,
  626.    0xf8, 0x01, 0xf8, 0x03, 0xf8, 0x07, 0xf8, 0x00, 0xd8, 0x00, 0x88, 0x01,
  627.    0x80, 0x01, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00};
  628.  
  629.   
  630. #endif
  631.