home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 1: Collection A / 17Bit_Collection_A.iso / files / 223.dms / 223.adf / Source / staricon.c < prev    next >
C/C++ Source or Header  |  1988-07-25  |  5KB  |  133 lines

  1. /*=========================================================================
  2.   StarIcon.c -- This module creates PROJECT type icons for saved parameter
  3.              files. It uses the ICON library opened in Star1.c.
  4.              
  5.              
  6.   Credits for Star Chart:
  7.        Robert L. Hill of the Orange County, CA. Amiga Friends User Group
  8.                       wrote the original version of StarChart in AmigaBasic
  9.                       The star data and many of the main functions of this
  10.                       version are derived from that program.
  11.  
  12.        Ray R. Larson  wrote the c version 1.0 of StarChart, 'intuitionizing'
  13.                       and enhancing the speed and functions of the original.
  14.  
  15.   Copyright (c) 1986 by Ray R. Larson
  16.   
  17.   This program may be freely distributed and copied, but may not be sold
  18.   without the permission of the author. If you modify or enhance it, 
  19.   please include the above credits (and please send me a copy!).
  20.  
  21. Ray R. Larson
  22. 6425 Central Ave. #304
  23. El Cerrito, CA 94530
  24.  
  25. BitNet  LARSON@UCBCMSA
  26. =========================================================================*/
  27. /*------------Header file for all of the standard stuff----*/ 
  28. /*-------------plus definitions of global structures-------*/
  29. #include "star.h" 
  30. #include <workbench/icon.h>
  31.  
  32. extern LONG IconBase;
  33.  
  34.  
  35. /*   Image staricon sizes */
  36. #define ICONWidth  52
  37. #define ICONHeight 27
  38. #define ICONDepth   2 
  39.      
  40. /* Image Data */
  41.  
  42.  
  43. /***************************************************************/
  44. /*  The following data structure contains the icon image data  */
  45. /***************************************************************/
  46. USHORT staricon[]=  {
  47.   0x7fff,
  48.   0xffff,  0xffff,  0xf750,  0x4000,  0x0000,  0x0800,  0x1000,  0x4100,
  49.   0x0000,  0x4900,  0x107f,  0x4000,  0x0000,  0x1c00,  0x1000,  0x4000,
  50.   0x000d,  0xffd0,  0x1000,  0x4000,  0x0000,  0x1c00,  0x107e,  0x4000,
  51.   0x0000,  0x4900,  0x1000,  0x4002,  0x0000,  0x0804,  0x1000,  0x4007,
  52.   0x0000,  0x0000,  0x1067,  0x4002,  0x0000,  0x0000,  0x1000,  0x4000,
  53.   0x0000,  0x0000,  0x1000,  0x4000,  0x0000,  0x0000,  0x1011,  0x4000,
  54.   0x0080,  0x0000,  0x1000,  0x4000,  0x0000,  0x0000,  0x1000,  0x4010,
  55.   0x0100,  0x0020,  0x107f,  0x4000,  0x0100,  0x0000,  0x1000,  0x4000,
  56.   0x0380,  0x0000,  0x1000,  0x4020,  0x57d4,  0x0000,  0x107f,  0x4000,
  57.   0x0380,  0x0000,  0x1000,  0x4000,  0x0100,  0x0000,  0x1000,  0x4000,
  58.   0x0100,  0x0000,  0x1044,  0x4000,  0x0000,  0x0000,  0x1000,  0x4000,
  59.   0x0000,  0x0100,  0x1000,  0x4000,  0x0000,  0x0380,  0x1011,  0x4000,
  60.   0x0000,  0x0100,  0x1000,  0x4000,  0x0000,  0x0000,  0x1000,  0x7fff,
  61.   0xffff,  0xffff,  0xf07f,  0x7fff,  0xffff,  0xffff,  0xf550,  0x7fff,
  62.   0xffff,  0xffff,  0xf000,  0x7eff,  0xffff,  0xf7ff,  0xf000,  0x7fff,
  63.   0xffff,  0xebff,  0xf000,  0x7fff,  0xffff,  0xd5ff,  0xf000,  0x7fff,
  64.   0xffff,  0xebff,  0xf000,  0x7fff,  0xffff,  0xf7ff,  0xf000,  0x7fff,
  65.   0xffff,  0xfffb,  0xf000,  0x7fff,  0xffff,  0xffff,  0xf000,  0x7fff,
  66.   0xffff,  0xffff,  0xf000,  0x7fff,  0xffff,  0xffff,  0xf060,  0x7fff,
  67.   0xffff,  0xffff,  0xf000,  0x7fff,  0xffff,  0xffff,  0xf000,  0x7fff,
  68.   0xffff,  0xffff,  0xf030,  0x7fff,  0xfeff,  0xffff,  0xf000,  0x7fff,
  69.   0xfeff,  0xffff,  0xf000,  0x7fff,  0xfc7f,  0xffff,  0xf000,  0x7fdf,
  70.   0xa82b,  0xffff,  0xf000,  0x7fff,  0xfc7f,  0xffff,  0xf000,  0x7fff,
  71.   0xfeff,  0xffff,  0xf000,  0x7fff,  0xfeff,  0xffff,  0xf000,  0x7fff,
  72.   0xffff,  0xffff,  0xf000,  0x7fff,  0xffff,  0xfeff,  0xf000,  0x7fff,
  73.   0xffff,  0xfc7f,  0xf000,  0x7fff,  0xffff,  0xfeff,  0xf000,  0x7fff,
  74.   0xffff,  0xffff,  0xf000,  0x7fff,  0xffff,  0xffff,  0xf000,  0x0000,
  75.  
  76.      };
  77.  
  78. struct Image INFOImage =
  79.   { 0,0,             /* Left, Top edges     */
  80.     ICONWidth,ICONHeight,/* pixel size         */
  81.     ICONDepth,           /* Bitplanes          */
  82.     &staricon[0],        /* image data         */
  83.     0x03,0x00,           /* PlanePick & onoff  */
  84.     NULL                 /* next image         */
  85.   };
  86.   
  87.   
  88. /* Tooltypes array */
  89. UBYTE *Tools[] =
  90.   { (UBYTE *)"FILETYPE=StarChart.ParmFile",
  91.     (UBYTE *)"MODES=",
  92.     NULL
  93.    };
  94.  
  95.  
  96. /* DiskObject structure for creating the .info file */
  97. struct DiskObject StarDO =
  98.   { WB_DISKMAGIC,        /* magic numbers defined in Intuition.h    */
  99.     WB_DISKVERSION,
  100.     /* Gadget Structure */
  101.     { NULL,            /* next gadget                */
  102.       0,0,            /* LeftEdge, TopEdge            */
  103.       ICONWidth,ICONHeight,    /* Width, Height            */
  104.       GADGHBOX | GADGIMAGE,     /* Gadget Flags                */
  105.       RELVERIFY | GADGIMMEDIATE,/* Activation Flags            */
  106.       BOOLGADGET,        /* Gadget Type                */
  107.       (APTR)&INFOImage,         /* Gadget Render Image                    */
  108.       NULL,NULL,        /* SelectRender, GadgetText        */
  109.       0,0,0,0            /* Mutual Excl., Special Info, ID, USER */
  110.     },
  111.     WBPROJECT,            /* Object type                */
  112.     "StarChart",        /* Default Tool                */
  113.     (char * *)&Tools[0],    /* ToolTypes array            */
  114.     NO_ICON_POSITION,        /* do_CurrentX                */
  115.     NO_ICON_POSITION,        /* do_CurrentY                */
  116.     NULL,            /* DrawerData                 */
  117.     NULL,            /* *do_ToolWindow            */
  118.     0,                /* do_StackSize                */
  119.   };
  120.     
  121.     
  122. /*************************************************************************
  123.  * MakeInfoFile - Creates a Project type icon for saved parameter files
  124.  *                from StarChart.
  125.  ************************************************************************/
  126.  
  127. MakeInfoFile(filename)
  128. UBYTE *filename;
  129. {
  130.    return(PutDiskObject(filename, &StarDO));
  131.  
  132. }
  133.