home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / gui / precog2_1.lha / Precognition2_1 / src / src.lha / Precognition / makeicon.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-13  |  3.5 KB  |  178 lines

  1. /* Iff2Src conversion: DF0:precog.brush */
  2.  
  3. #include "makeicon.h"
  4. #include <workbench/startup.h>
  5. #include <libraries/dos.h>
  6. #include <workbench/workbench.h>
  7. #include <dos/dosextens.h>
  8. #ifndef __GNUC__
  9. #include <clib/exec_protos.h>
  10. #include <clib/intuition_protos.h>
  11. #include <clib/graphics_protos.h>
  12. #include <clib/dos_protos.h>
  13. #include <clib/wb_protos.h>
  14. #include <clib/icon_protos.h>
  15. #endif
  16. #ifdef __GNUC__
  17. #include <proto/exec.h>
  18. #include <proto/intuition.h>
  19. #include <proto/graphics.h>
  20. #include <proto/dos.h>
  21. #include <proto/wb.h>
  22. #include <proto/icon.h>
  23. #endif
  24. #ifdef __SASC
  25. #include <proto/exec.h>
  26. #include <proto/intuition.h>
  27. #include <proto/graphics.h>
  28. #include <proto/dos.h>
  29. #include <proto/wb.h>
  30. #include <proto/icon.h> /* added for icon.library prototypes -- EDB */
  31. #endif
  32.  
  33. #include "FileRequester/dirscanner.h"
  34. #include "AmigaMem.h"
  35.  
  36. char toolpath[80];
  37.  
  38. char *PathToTool( void )
  39. {
  40. #if 0
  41.    return "Precog:builder";
  42. #endif
  43.    return "Precog:Precognition";
  44.  
  45. #ifdef DOESNT_WORK
  46.  
  47.    char *dirpath;
  48.    struct Process *process;
  49.  
  50.    toolpath[0] = '\0';
  51.  
  52.    if( process = (struct Process *)FindTask( NULL ) )
  53.    {
  54.       if( dirpath = DS_PathFromLock( process->pr_CurrentDir ) )
  55.       {
  56.          strcat( toolpath, dirpath );
  57.          Afree( dirpath );
  58.  
  59. /* incorrect:   strcat( toolpath, process->pr_Task.tc_Node.ln_Name ); */
  60.  
  61.          strcat( toolpath, "builder" );
  62.          return &toolpath[0];
  63.       }
  64.    }
  65.  
  66.    return NULL;
  67. #endif
  68. }
  69.  
  70. #ifndef __GNUC__   /* no CHIP keyword */
  71. UWORD __chip PrecogIconImageData[108] =
  72.    {
  73.    /* Plane 0 */
  74.       0x0000,0x0000,0x0000,
  75.       0x2F7F,0xFFDE,0xF400,
  76.       0x2900,0x001E,0xF400,
  77.       0x2F7F,0xFFDE,0xF400,
  78.       0x2000,0x0000,0x0400,
  79.       0x2000,0x0000,0x0400,
  80.       0x2000,0x007F,0xD000,
  81.       0x2000,0x00FF,0xF800,
  82.       0x2000,0x00FF,0xF800,
  83.       0x2000,0x00FF,0xF800,
  84.       0x2000,0x00C3,0x0000,
  85.       0x2000,0x00FF,0x3800,
  86.       0x2000,0x007F,0x1000,
  87.       0x2000,0x003F,0xC000,
  88.       0x3FFF,0xFFDC,0x0000,
  89.       0x0000,0x000F,0xE000,
  90.       0x0000,0x0000,0x0000,
  91.       0x0000,0x0000,0x0000,
  92.    /* Plane 1 */
  93.       0x0000,0x0000,0x0000,
  94.       0x0000,0x0000,0x0000,
  95.       0x0000,0x0000,0x0000,
  96.       0x0000,0x0000,0x0000,
  97.       0x0000,0x0000,0x0000,
  98.       0x0000,0x003F,0xF800,
  99.       0x0000,0x0000,0x2E00,
  100.       0x0000,0x0000,0x0700,
  101.       0x0000,0x0000,0x0780,
  102.       0x0000,0x0000,0x0780,
  103.       0x0000,0x003C,0xFF80,
  104.       0x0000,0x0000,0xC780,
  105.       0x0000,0x0000,0xEF00,
  106.       0x0000,0x0000,0x3E00,
  107.       0x0000,0x0003,0xFE00,
  108.       0x0000,0x0000,0x1C00,
  109.       0x0000,0x0007,0xF800,
  110.       0x0000,0x0000,0x0000
  111.    };
  112.  
  113.  
  114. struct Image PrecogIconImage =
  115.    {
  116.       0,0,
  117.       42,18,
  118.       2,
  119.       &PrecogIconImageData[0],
  120.       0xff,0x0,
  121.       NULL
  122.    };
  123.  
  124. #endif   /* Not GNU C */
  125.  
  126. char* ProjectToolTypes[] = { NULL };
  127.  
  128. struct DiskObject ProjectIcon =
  129. {
  130.    WB_DISKMAGIC,
  131.    WB_DISKVERSION,
  132.    {
  133.       NULL,
  134.       0, 0, 42, 18,
  135.       GADGIMAGE | GADGHBOX,
  136.       GADGIMMEDIATE | RELVERIFY,
  137.       BOOLGADGET,
  138.       (APTR)&PrecogIconImage,
  139.       NULL,
  140.       NULL,
  141.       NULL,
  142.       NULL,
  143.       0,
  144.       NULL
  145.    },
  146.  
  147.    WBPROJECT,
  148.    "Builder",
  149.    ProjectToolTypes,
  150.    NO_ICON_POSITION,
  151.    NO_ICON_POSITION,
  152.    NULL,
  153.    NULL,
  154.    10000
  155. };
  156.  
  157.  
  158. BOOL makeIcon( char *name )
  159. {
  160.    struct DiskObject *dobj;
  161.  
  162.    if( dobj = GetDiskObject( name ) )
  163.    {
  164.       /* Icon already exists.
  165.       **
  166.       ** TBD: Fill in path to tool.
  167.       */
  168.  
  169.       FreeDiskObject( dobj );
  170.    }
  171.    else
  172.    {
  173.       /* TBD: Fill in path to tool. */
  174.  
  175.       ProjectIcon.do_DefaultTool = PathToTool();
  176.       return (BOOL)PutDiskObject( name, &ProjectIcon );
  177.    }
  178. }