1 #ifndef INTUITION_BLANKERAPI_H
    2 #define INTUITION_BLANKERAPI_H
    3 
    4 /*
    5 	intuition blanker api definitions
    6 
    7 	Copyright © 2003-2008 The MorphOS Development Team, All Rights Reserved.
    8 */
    9 
   10 #ifndef UTILITY_TAGITEM_H
   11 # include <utility/tagitem.h>
   12 #endif
   13 
   14 #define BTDPT_BOOLEAN 1
   15 #define BTDPT_INTEGER 2
   16 #define BTDPT_CYCLE   3
   17 #define BTDPT_FILE    4
   18 #define BTDPT_STRING  5
   19 #define BTDPT_FONT    6
   20 #define BTDPT_COLOR   7
   21 
   22 #define BTDMAXSTRLEN  128
   23 
   24 struct BTDNode                /* this is the generic head for param structure */
   25 {
   26 	Tag              BN_Tag;  /* ID tag for parameter */
   27 	char            *BN_Name; /* parameter name */
   28 	ULONG            BN_Type;
   29 };
   30 
   31 struct BTDBoolean             /* struct for boolean parameters */
   32 {
   33 	struct BTDNode   BB_Node;
   34 	LONG             BB_Value; /* boolean value */
   35 };
   36 
   37 struct BTDInteger               /* structure for integer params */
   38 {
   39 	struct BTDNode   BI_Node;
   40 	LONG             BI_Value;  /* actual value */
   41 	LONG             BI_Min;    /* minimum value */
   42 	LONG             BI_Max;    /* maximum value */
   43 	LONG             BI_Slider; /* set to TRUE to get a slider */
   44 	STRPTR           BI_Format; /* optional format template, e.g. "%ld %%" */
   45 	struct Hook     *BI_Hook;   /* optional 'Stringify' Hook */
   46 };
   47 
   48 /*
   49 **	The 'Stringify' Hook can be used in case BI_Format is not enough. A STRPTR 
   50 **	to a buffer is passed in A2 and an ULONG * to the current slider value in A1. 
   51 **	The hook must return a STRPTR on success or NULL. If NULL is returned 
   52 **	then default formating is used. The available buffer size can be read from 
   53 **	value[1], but its guranteed to be at least 512 bytes.
   54 */
   55 
   56 struct BTDCycle
   57 {
   58 	struct BTDNode   BC_Node;
   59 	LONG             BC_Value;  /* selected item */
   60 	char           **BC_Labels; /* NULL terminated array with labels */
   61 };
   62 
   63 struct BTDString
   64 {
   65 	struct BTDNode   BS_Node;
   66 	char             BS_String[BTDMAXSTRLEN];
   67 };
   68 
   69 struct BTDFont
   70 {
   71 	struct BTDNode   BF_Node;
   72 	char             BF_Font[BTDMAXSTRLEN];
   73 };
   74 
   75 struct BTDFile
   76 {
   77 	struct BTDNode   BF_Node;
   78 	char             BF_File[BTDMAXSTRLEN];
   79 };
   80 
   81 struct BTDColor
   82 {
   83 	struct BTDNode   BC_Node;
   84 	ULONG            BC_Value; /* ARGB32 */
   85 };
   86 
   87 struct BTDInfo                       /* struct returned by QueryBlanker() */
   88 {
   89 	ULONG            BI_Revision;    /* put BTDI_Revision here */
   90 	ULONG            BI_ID;          /* 4 char ID for your blanker */
   91 	char            *BI_Name;        /* blanker name */
   92 	char            *BI_Description; /* blanker description */
   93 	char            *BI_Author;      /* blanker author(s) */
   94 	ULONG            BI_Flags;       /* blanker requirements */
   95 	struct BTDNode **BI_Params;      /* NULL terminated array with params */
   96 };
   97 
   98 #define BTDI_Revision  7L            /* you must ALWAYS use this symbol! */
   99 
  100 #define BTDIF_3DBlanker    (1L << 0) /* set this if your blanker needs a screen format supported by 3d drivers */
  101 #define BTDIF_Fast3D       (1L << 1) /* set this if your blanker needs 3d hw accelerated driver */
  102 #define BTDIF_DoNotWait    (1L << 2) /* set this if your blanker will control fps on it's own (by calling WaitBOVP, etc) */
  103 
  104 /*
  105 **	NOTE: intuition will always try to pick the best screen mode for your blanker depending on requirements,
  106 **	that doesn't mean you will always get a 3d supported screen, in that case your blanker must return
  107 **	BTDERR_Display error code
  108 **
  109 **	Double/Triple Buffering
  110 **
  111 **	In case you want double or triple buffered display, please ensure that BDI_Screen is set and
  112 **	use standard intuition screen buffering routines as described in AllocScreenBuffer.
  113 **	Be sure to free all screen buffers in your ExitBlanker implementation.
  114 */
  115 
  116 struct BTDDrawInfo
  117 {
  118 	struct RastPort   *BDI_RPort;    /* RastPort with or without layer, the bitmap will never be a CLUT one! */
  119 	struct Screen     *BDI_Screen;   /* In case your renderer needs to know the gfx card, call WaitBOVP. might be NULL! */
  120 
  121 	LONG               BDI_Left;     /* position and dimmensions of your draw area */
  122 	LONG               BDI_Top;      /* NOTE: starting with BTDI_Revision 7 this will always be 0,0,screenw,screenh */
  123 	LONG               BDI_Width;
  124 	LONG               BDI_Height;
  125 };
  126 
  127 #define BTDERR_Size    1L            /* BTD_Error code: allocated draw space too small */
  128 #define BTDERR_Memory  2L            /* BTD_Error code: not enough memory */
  129 #define BTDERR_Display 3L            /* BTD_Error code: unsupported display mode */
  130 
  131 #define BTD_Dummy       (TAG_USER + 'B'*65536L + 'T'*256 + 'D')
  132 #define BTD_DrawInfo    (BTD_Dummy + 1)
  133 #define BTD_Error       (BTD_Dummy + 2)
  134 #define BTD_PreviewMode (BTD_Dummy + 4) /* TRUE if ran from Blanker.mprefs */
  135 
  136 #define BTD_Client      (BTD_Dummy + 100)
  137 
  138 #endif /* INTUITION_BLANKERAPI_H */