1 #ifndef LIBRARIES_NEWICON_H
    2 #define LIBRARIES_NEWICON_H
    3 
    4 /*
    5 	newicon.library include
    6 
    7 	Copyright © 2002 The MorphOS Development Team, All Rights Reserved.
    8 */
    9 
   10 #ifndef EXEC_LIBRARIES_H
   11 #include <exec/libraries.h>
   12 #endif
   13 
   14 #ifndef WORKBENCH_WORKBENCH_H
   15 #include <workbench/workbench.h>
   16 #endif
   17 
   18 #pragma pack(2)
   19 
   20 
   21 /* Programs should NOT change anything in the librarybase!
   22  * Let the user do it through the preferences
   23  */
   24 
   25 struct NewIconBase
   26 {
   27 	struct Library nib_Lib;
   28 	APTR nib_SegList;
   29 	LONG nib_Precision; /* precision when remapping images via */
   30 				/* RemapChunkyImage(). Programs are not supposed */
   31 				/* to modify this, it is a value chosen by the user */
   32 				/* in the preferences. */
   33 	LONG nib_Flags; /* library base flags - see NIFLG_#? defs below */
   34 	LONG nib_DPMode; /* Depth Promotion mode value. (V39) */
   35 	LONG nib_FOMode; /* Font Online mode (V40) */
   36 	LONG nib_Reserved;
   37 };
   38 
   39 
   40 /* This mask can be used to isolate the user preferences part of the flags */
   41 #define NIFLG_PUBMASK    0x0000FFFF
   42 
   43 
   44 /*** Library base flags ***/
   45 
   46 #define NIFLG_DO_DITHER (1<<0)  /* use dithering when exact pen not available */
   47 
   48 #define NIFLG_RESERVED  (1<<1)  /* Keep your hands away from that one
   49 								   (V39) */
   50 
   51 #define NIFLG_RTGMODE   (1<<2) /* Use FastRAM when possible instead of CHIP
   52 								  Needs Cgfx or something similar that
   53 								  properly patches graphics.library to
   54 								  allow graphic/blitter work from FastRAM.
   55 								  (V39) */
   56 
   57 #define NIFLG_NOBORDER   (1<<3) /* Won't display any border around icons.
   58 								   (V39) */
   59 
   60 #define NIFLG_TRANSPARENT (1<<4) /*  Icons will become transparent.
   61 									 Requires NoBorder to be enabled.
   62 									 (V40) */
   63 
   64 #define NIFLG_TRANSDRAG   (1<<5> /* Icons will become transparent & 
   65 									borderless while dragging.
   66 									 (V40) */
   67 
   68 
   69 /*** System flags (0xFFFF0000) - These are READ-ONLY! ***/
   70 
   71 
   72 /* Set by the NewIcons exe if it's disabled through Exchange */
   73 
   74 #define NIFLG_IS_DISABLED (1<<16) /* Commodity is disabled  
   75 										**READ-ONLY** (V40) */
   76 
   77 /* These flags are set by the library depending on the features it can 
   78    support. */
   79 
   80 #define NIFLG_LIBRTG     (1<<17) /* This library supports RTG Mode
   81 									   **READ-ONLY** (V40) */
   82 
   83 #define NIFLG_LIBDIT     (1<<18) /* This library supports dithering
   84 									   **READ-ONLY** (V40) */
   85 
   86 
   87 
   88 
   89 /* Values for nib_DPMode (V39) */
   90 
   91 #define NIDPM_NEVER     0       /* Do not depth promote old icons */
   92 #define NIDPM_WBONLY    1       /* Only promote icons opened by Workbench */
   93 #define NIDPM_ALL       2       /* Depth promote all old icons opened */
   94 
   95 
   96 /* Values for nib_FOMode (V40) */
   97 
   98 #define NIFOM_NONE      0       /* Normal */
   99 #define NIFOM_OUTLINE   1       /* Draw an outline border */
  100 #define NIFOM_SHADOW    2       /* Only cast a shadow */
  101 
  102 
  103 /*
  104  * This structure contains an image in a format unusual to the Amiga: chunky
  105  * pixel. We use this format because it is faster to remap to a given palette.
  106  */
  107 struct ChunkyImage
  108 {
  109 	UWORD Width;        /* width of the image. Must be <= 93 */
  110 	UWORD Height;       /* height of the image. Must be <= 93 */
  111 	UWORD NumColors;    /* number of pens defined in the palette. Must be <= 256 */
  112 	UWORD Flags;        /* see defines below */
  113 	UBYTE *Palette;     /* array of RGB components of the pens (one byte per gun) */
  114 	UBYTE *ChunkyData;  /* Width*Height bytes storing the colors of the pixels */
  115 };
  116 
  117 #define CIF_COLOR_0_TRANSP  (1<<0)  /* color 0 is transparent, not the one */
  118 									/* stored in palette */
  119 
  120 #define CIF_DEFAULT         (1<<1)  /* when this bit is set, the image was */
  121 									/* obtained via the DEFAULTIMAGE ToolType, */
  122 									/* therefore it is not actually part of the */
  123 									/* icon and will not be stored in the */
  124 									/* ToolTypes on a PutNewDiskObject(). */
  125 
  126 
  127 
  128 struct NewDiskObject
  129 {
  130 	struct DiskObject *ndo_StdObject;       /* The old-style icon */
  131 	struct ChunkyImage *ndo_NormalImage;    /* May be NULL, meaning no new style icon */
  132 	struct ChunkyImage *ndo_SelectedImage;  /* May be NULL, meaning no secondary image */
  133 };
  134 
  135 
  136 
  137 /*** The prefs file format (V40)
  138 
  139 	 Prefs file must be named NewIcons.prefs and is located in the 
  140 	 usual ENVARC: (and ENV:) path.
  141  ***/
  142 
  143 struct NewIconsPrefs
  144 {
  145    UWORD version;       /* Prefs version, currently 0x0002 */
  146    ULONG flags;         /* Flags (see NIFLG_#? definitions) */
  147    LONG precision;      /* Precision setting (-1 = best, 16=worse) */
  148    ULONG dpmode;        /* Depth Promotion mode (see NIDPM_#? definitions) */
  149    ULONG fomode;        /* Font Outline mode (see NIFOM_#? definitions) */
  150 };
  151 
  152 
  153 #pragma pack()
  154 
  155 #endif  /* LIBRARIES_NEWICON_H */