home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Exec 4 / CD_Magazyn_EXEC_nr_4.iso / Recent / dev / c / apputil.lha / apputil / apputil.h next >
Encoding:
C/C++ Source or Header  |  2000-11-06  |  3.4 KB  |  104 lines

  1. /*
  2.  * apputil.h
  3.  * =========
  4.  * Application utility functions.
  5.  *
  6.  * Copyright (C) 1999-2000 HÃ¥kan L. Younes (lorens@hem.passagen.se)
  7.  */
  8.  
  9. #ifndef APPUTIL_H
  10. #define APPUTIL_H
  11.  
  12. #include <exec/types.h>
  13. #include <intuition/intuition.h>
  14. #include <intuition/classes.h>
  15. #include <libraries/gadtools.h>
  16. #include <utility/tagitem.h>
  17. #include <workbench/startup.h>
  18.  
  19.  
  20. /* Maximum basename length. */
  21. #define MAXBASENAMELEN 30
  22.  
  23.  
  24. /* A menu action. */
  25. typedef VOID (*MenuAction)(VOID);
  26. /* A menu action for ckecked menu items. */
  27. typedef VOID (*CheckedMenuAction)(BOOL checked);
  28.  
  29.  
  30. /* Creates the button class. */
  31. extern Class *CreateButtonClass(VOID);
  32.  
  33. /* Erases all gadgets. */
  34. extern VOID EraseGadgets(struct Gadget *gads, struct Window *win,
  35.              struct Requester *req);
  36. /* Erases up to numGads gadgets. */
  37. extern VOID EraseGList(struct Gadget *gads, struct Window *win,
  38.                struct Requester *req, LONG numGads);
  39. /* Checks if a point is inside a gadget. */
  40. extern BOOL PointInGadget(ULONG point, struct Gadget *gad);
  41.  
  42. /* Initializes locale information. */
  43. extern VOID InitLocaleInfo(STRPTR catalog, STRPTR language, UWORD version);
  44. /* Disposes locale information. */
  45. extern VOID DisposeLocaleInfo(VOID);
  46. /* Returns a localized string */
  47. extern STRPTR GetLocString(ULONG strId);
  48.  
  49. /* Creates localized menus. */
  50. extern struct Menu *CreateLocMenusA(struct NewMenu *newMenu, APTR vi,
  51.                     struct TagItem *tagList);
  52. /* Creates localized menus. */
  53. extern struct Menu *CreateLocMenus(struct NewMenu *newMenu, APTR vi,
  54.                    ULONG tag, ...);
  55. /* Processes menu events. */
  56. extern VOID ProcessMenuEvents(struct Window *win, UWORD menuNum);
  57.  
  58. /* Reads command line arguments. */
  59. extern struct RDArgs *ReadArgsCLI(STRPTR template, LONG *array);
  60. /* Reads WB ToolTypes. */
  61. extern struct RDArgs *ReadArgsWB(STRPTR template, LONG *array,
  62.                  struct WBStartup *sm);
  63. /* Disposes arguments. */
  64. extern VOID FreeArgsCLIWB(struct RDArgs *rdargs);
  65.  
  66. /* Blocks input to a window. */
  67. extern BOOL BlockWindow(struct Window *win, struct Requester *req);
  68. /* Unblocks input to a window. */
  69. extern VOID UnblockWindow(struct Window *win, struct Requester *req);
  70. /* Brings up a message requester. */
  71. extern LONG MessageRequesterA(struct Window *win, STRPTR title,
  72.                   STRPTR textFmt, STRPTR gadFmt, APTR argList);
  73. /* Brings up a message requester. */
  74. extern LONG MessageRequester(struct Window *win, STRPTR title,
  75.                  STRPTR textFmt, STRPTR gadFmt, APTR arg, ...);
  76.  
  77. /* Initializes application settings. */
  78. extern BOOL InitSettings(STRPTR path, STRPTR basename, VOID *buf, LONG len);
  79. /* Disposes settings. */
  80. extern VOID DisposeSettings(VOID);
  81. /* Loads application settings. */
  82. extern BOOL LoadSettings(STRPTR path, VOID *buf, LONG len);
  83. /* Saves application settings. */
  84. extern BOOL SaveSettings(STRPTR basename, VOID *buf, LONG len);
  85. /* Saves application settings. */
  86. extern BOOL SaveSettingsAs(STRPTR path, VOID *buf, LONG len);
  87.  
  88. /* Initializes window position. */
  89. extern VOID SetupWindowPosition(struct Screen *scr,
  90.                 WORD scrWidth, WORD scrHeight,
  91.                 WORD winWidth, WORD winHeight,
  92.                 WORD *left, WORD *top,
  93.                 WORD *zoomLeft, WORD *zoomTop);
  94. /* Calculates the extent of a window title bar. */
  95. extern VOID TitleBarExtent(struct Screen *scr, STRPTR title,
  96.                WORD *width, WORD *height);
  97.  
  98. /* Returns the length of a string. */
  99. extern LONG strlen(STRPTR s);
  100. /* Copys the contents of a string. */
  101. extern VOID strcpy(STRPTR dest, STRPTR src);
  102.  
  103. #endif /* APPUTIL_H */
  104.