home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / misc / gfront11.lha / GUIFront / Developer / Include / libraries / guifront.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-29  |  7.3 KB  |  274 lines

  1. #ifndef LIBRARIES_GUIFRONT_H
  2. #define LIBRARIES_GUIFRONT_H
  3. /*
  4. **    $VER: GUIFront.h 37.3 (29.10.94)
  5. **    Includes Release 37.3
  6. **
  7. **    C header file for GUIFront. For use with 32 bit integers only.
  8. **
  9. **    (C) Copyright 1994 Michael Berg
  10. **        All Rights Reserved
  11. */
  12.  
  13. /* View with TAB=4 */
  14.  
  15. #ifndef EXEC_TYPES_H
  16. #include <exec/types.h>
  17. #endif /* EXEC_TYPES_H */
  18.  
  19. #ifndef EXEC_LIBRARIES_H
  20. #include <exec/libraries.h>
  21. #endif /* EXEC_LIBRARIES_H */
  22.  
  23. #ifndef UTILITY_TAGITEM_H
  24. #include <utility/tagitem.h>
  25. #endif /* EXEC_UTILITY_H */
  26.  
  27. #ifndef LIBRARIES_GADTOOLS_H
  28. #include <libraries/gadtools.h>
  29. #endif /* LIBRARIES_GADTOOLS_H */
  30.  
  31. #define GUIFRONTNAME        "guifront.library"
  32. #define GUIFRONTVERSION        37
  33.  
  34. /* Tags for CreateGUIAppA() */
  35. enum
  36. {
  37.     GFA_Author = (int)TAG_USER,        /* Author of software (70 chars max) */
  38.     GFA_Date,                        /* Date of release (14 chars max) */
  39.     GFA_LongDesc,                    /* Longer description (70 chars max) */
  40.     GFA_Version,                    /* Version information (20 chars max) */
  41.     GFA_VisualUpdateSigTask,        /* Task to signal when prefs change (defaults to FindTask(0)) */
  42.     GFA_VisualUpdateSigBit,            /* Signal to send task when prefs change */
  43. };
  44.  
  45. /* Tags for CreateGUIA() */
  46.  
  47. enum
  48. {
  49.     GUI_InitialOrientation = (int)TAG_USER,
  50.     GUI_InitialSpacing,
  51.     GUI_LocaleFunc,
  52.     GUI_ExtendedError,
  53.     GUI_UserData,
  54.     GUI_OpenGUI,
  55.     GUI_ExtraIDCMP,
  56.     GUI_WindowTitle,
  57.     GUI_Window,            /* Read-only */
  58.     GUI_Backfill,        /* Please backfill this window */
  59.     GUI_NewMenu,
  60.     GUI_NewMenuLoc,
  61.     GUI_MenuStrip,        /* Read-only */
  62.     GUI_ActualFont,        /* Read-only */
  63.     GUI_ScreenTitle,
  64.     GUI_LeftEdge,
  65.     GUI_TopEdge,
  66.     GUI_Help,            /* Not currently implemented */
  67. };
  68.  
  69. /* Extended error report from CreateGUIA() (via GUI_ExtendedError) */
  70.  
  71. typedef struct
  72. {
  73.     enum
  74.     {
  75.         GFERR_UNKNOWN = 100,                /* Unknown error */
  76.         GFERR_NOT_ENOUGH_MEMORY,
  77.         GFERR_MISSING_LOCALIZER,            /* Found GS_LocaleFunc but no GUI_Localizer */
  78.         GFERR_GUI_TOO_WIDE,
  79.         GFERR_GUI_TOO_TALL,
  80.         GFERR_CANT_FIND_SCREEN,                /* Can't find or open required screen */
  81.         GFERR_MISSING_GADGETSPECARRAY,        /* GUIL_GadgetSpecID used but no GUI_GadgetSpecArray supplied */
  82.         GFERR_CANT_FIND_GADGETSPECID,        /* Unable to locate gadget with this ID */
  83.         GFERR_UNKNOWN_LAYOUT_TAG,            /* Layout tag list contains garbage */
  84.         GFERR_CANT_OPEN_WINDOW,                /* Unable to open gui (GUI_OpenGUI) */
  85.         GFERR_CANT_CREATE_MENUS,            /* Unable to create or layout menus */
  86.     } ee_ErrorCode;
  87.  
  88.     ULONG ee_ErrorData;
  89. } ExtErrorData;
  90.  
  91. /* Tags for gadget layout lists */
  92.  
  93. enum
  94. {
  95.     GUIL_VertGroup = 1,
  96.     GUIL_HorizGroup,
  97.     GUIL_GadgetSpec,
  98.     GUIL_GadgetSpecID,
  99.     GUIL_FrameType,            /* See below */
  100.     GUIL_HFrameOffset,
  101.     GUIL_VFrameOffset,
  102.     GUIL_Flags,                /* See below */
  103.     GUIL_FrameHeadline,
  104.     GUIL_FrameHeadlineLoc,    /* Localized - will call your localizer function */
  105. };
  106.  
  107. /* GUIL_Flags */
  108.  
  109. /* Extension methods */
  110. #define GUILF_PropShare        (1 << 0)    /* Members maintain their relative size */
  111. #define GUILF_EqualShare    (1 << 1)    /* All members forced to equally share all available space */
  112. #define GUILF_EqualSize        (1 << 2)    /* All members forced to equal size */
  113.  
  114. /* Secondary dimension ajustments */
  115. #define GUILF_EqualWidth    (1 << 3)
  116. #define GUILF_EqualHeight    GUILF_EqualWidth
  117.  
  118. /* Special label layout */
  119. #define GUILF_LabelAlign    (1 << 4)
  120.  
  121. /* FrameType */
  122. #define GUILFT_Normal        1
  123. #define GUILFT_Recess        2
  124. #define GUILFT_Ridge        3    /* NeXT style */
  125. #define GUILFT_IconDropBox    4    /* Not implemented */
  126.  
  127. /* GadgetSpec */
  128.  
  129. typedef struct
  130. {
  131.     int gs_Kind;
  132.     UWORD gs_MinWidth, gs_MinHeight;
  133.     struct NewGadget gs_ng;
  134.     struct TagItem *gs_Tags;
  135.     UWORD gs_Flags;        /* See below */
  136.  
  137.     ULONG private[5];    /* Hands off! :-) */
  138.  
  139.     struct Gadget *gs_Gadget;    /* Valid when gadget has been created - Read-only! */
  140. } GadgetSpec;
  141.  
  142. /* gs_Flags */
  143.  
  144. #define GS_NoWidthExtend    (1 << 0)    /* Lock hitbox width */
  145. #define GS_NoHeightExtend    (1 << 1)    /* Lock hitbox height */
  146. #define GS_Localized        (1 << 2)    /* Call localizer with this gadget */
  147. #define GS_BoldLabel        (1 << 3)    /* Render label in bold-face */
  148. #define GS_DefaultTags        (1 << 4)    /* Supply reasonable default tags */
  149.  
  150. /* Hook message (GS_LocaleFunc hook) */
  151. typedef struct
  152. {
  153.     UWORD lhm_Kind;                    /* What are we trying to localize here? */
  154.  
  155.     /* Your hook should look at the following union, localize the item in
  156.      * question (lhm_Kind tells you which), and return the localized
  157.      * string.
  158.      */
  159.  
  160.     union
  161.     {
  162.         ULONG lhmd_StringID;            /* Fetch this catalog ID, please */
  163.         GadgetSpec *lhmd_GadgetSpec;    /* Localize this GadgetSpec */
  164.         struct NewMenu *lhmd_NewMenu;    /* Localize this NewMenu */
  165.     } lhm_Data;
  166.  
  167. } LocaleHookMsg;
  168.  
  169. /* lhm.lhm_Kind */
  170. enum
  171. {
  172.     LHMK_StringID = 0,        /* Obtain generic catalog string */
  173.     LHMK_GadgetSpec,        /* Return localized GadgetSpec string */
  174.     LHMK_NewMenu,            /* Return localized NewMenu string */
  175. };
  176.  
  177. /* Black-box access to private structures */
  178.  
  179. typedef void GUIFront;        /* Per-gui anchor structure */
  180. typedef void GUIFrontApp;    /* Per-application anchor structure */
  181.  
  182. /* GUIFront bonus kinds */
  183.  
  184. #define GETALT_KIND        0x8000
  185.  
  186. /* Gadget creation tags for GETALT_KIND */
  187.  
  188. enum
  189. {
  190.     ALT_Image = (int)TAG_USER,        /* See enum below */
  191.     ALT_AslTags,                    /* (struct TagItem *) Tag items for ASL requester */
  192.     ALT_AslRequester,                /* (BOOL) Enable automatic ASL requester */
  193.     ALT_XenMode,                    /* Do not use */
  194.     ALT_FrameColor,                    /* Do not use */
  195. };
  196.  
  197. /* Image types (ALT_Image) */
  198.  
  199. enum
  200. {
  201.     ALTI_GetMisc,        /* Arrow down with line (get anything) */
  202.     ALTI_GetDir,        /* Folder image (get directory or volume) */
  203.     ALTI_GetFile,        /* Paper image (get a file) */
  204.     ALTI_GetFont,        /* Copy of arrow down image */
  205.     ALTI_GetScreenMode    /* Copy of arrow down image (not implemented) */
  206. };
  207.  
  208. /*** Preferences related stuff ***/
  209.  
  210. /* Black-box access to preferences nodes (all fields are private) */
  211.  
  212. typedef void PrefsHandle;
  213.  
  214. /* Tags for GetPrefAttrA() and SetPrefAttrA() */
  215.  
  216. enum
  217. {
  218.     /* Flags */
  219.     PRF_GadgetScreenFont = (int)TAG_USER,    /* (BOOL)        */
  220.     PRF_FrameScreenFont,                    /* (BOOL)        */
  221.  
  222.     /* Backfill control magic */
  223.     PRF_AllowBackfill,                        /* (BOOL)        */
  224.     PRF_BackfillFGPen,                    /* (UWORD)        */
  225.     PRF_BackfillBGPen,                    /* (UWORD)        */
  226.  
  227.     /* Frametype preferences (per supported gadgetkind) */
  228.     PRF_FrameStyleQuery,                /* (FrameStyleQuery *) - see below */
  229.  
  230.     PRF_XenFrameColor,                    /* (UWORD)                    */
  231.     PRF_GadgetFontYSize,                /* (UWORD)                    */
  232.     PRF_GadgetFontName,                    /* (char *) (max 50 chars)    */
  233.     PRF_FrameFontName,                    /* (char *) (max 50 chars)    */
  234.     PRF_FrameFontYSize,                    /* (UWORD)                    */
  235.     PRF_FrameFontBold,                    /* (BOOL)                    */
  236.     PRF_FrameFontItalics,                /* (BOOL)                    */
  237.     PRF_FrameFont3D,                    /* (BOOL)                    */
  238.     PRF_FrameFontFGPen,                    /* (UWORD)                    */
  239.     PRF_FrameFontCenter,                /* (BOOL)                    */
  240.     PRF_FrameFontCentering,                /* (see PRFFC_* below)      */
  241.  
  242.     /* Miscellaneous */
  243.     PRF_SimpleRefresh,                    /* (BOOL)                    */
  244.  
  245.     /* Application Info (READ ONLY!) */
  246.     PRF_Author,                            /* (char *) (max 70 chars)  */
  247.     PRF_Date,                            /* (char *) (max 14 chars)  */
  248.     PRF_LongDesc,                        /* (char *) (max 70 chars)  */
  249.     PRF_Version,                        /* (char *) (max 20 chars)  */
  250. };
  251.  
  252. /* Frame headline centering */
  253. enum
  254. {
  255.     PRFFC_Left,                /* Left aligned */
  256.     PRFFC_Center,            /* Centered */
  257.     PRFFC_Right,            /* Right aligned */
  258. };
  259.  
  260. typedef struct
  261. {
  262.     int fsq_GadgetKind;        /* As passed to CreateGadgetA() */
  263.     BOOL fsq_Xen;            /* True: Xen, false: Normal */
  264. } FrameStyleQuery;
  265.  
  266. /* Tags for GF_GetGUIAppAttrA()/GF_SetGUIAppAttrA() */
  267. enum
  268. {
  269.     GUIA_WindowPort = (int)TAG_USER,    /* Read only */
  270.     GUIA_UserData,                        /* Free for application use */
  271. };
  272.  
  273. #endif /* LIBRARIES_GUIFRONT_H */
  274.