home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / Programming / MUI / muitoolkit / developer / C / include / libraries / muitoolkit.h next >
Encoding:
C/C++ Source or Header  |  1999-09-18  |  4.5 KB  |  146 lines

  1. /*
  2. **      $VER: muitoolkit.h 1.00 (07.09.99)
  3. **
  4. **      (C) Copyright 1999 Marcin Orlowski
  5. **      All Rights Reserved.
  6. */
  7.  
  8. #ifndef LIBRARIES_MUITOOLKIT_H
  9. #define LIBRARIES_MUITOOLKIT_H
  10.  
  11. #ifndef LIBRARIES_MUI_H
  12. #include <libraries/mui.h>
  13. #endif
  14.  
  15.  
  16. #define MUITOOLKIT_NAME "muitoolkit.library"
  17. #define MUITOOLKIT_VMIN 1
  18.  
  19.  
  20. /* some useful macros */
  21.  
  22. #define getmutex(obj)       mt_Get( obj,MUIA_Radio_Active )
  23. #define getcycle(obj)       mt_Get( obj,MUIA_Cycle_Active )
  24. #define getstring(obj)      (char *)mt_Get( obj, MUIA_String_Contents )
  25. #define getcheckmark(obj)   mt_Get( obj,MUIA_Selected )
  26. #define getslider(obj)      mt_Get( obj,MUIA_Numeric_Value )
  27. #define gettext(obj)        (char *)mt_Get((obj), MUIA_Text_Contents)
  28. #define copystring(dst,obj) strcpy((dst), (char *)mt_Get((obj), MUIA_String_Contents))
  29.  
  30. #define settext(obj,val)    set(obj, MUIA_Text_Contents, val)
  31. //#define gettext(obj)        (char *)mt_Get( obj, MUIA_Text_Contents )
  32. #define getnumstring(obj)   mt_Get((obj), MUIA_String_Integer)
  33.  
  34. #define mt_Sleep(obj)       set(app, MUIA_Application_Sleep, (obj))
  35.  
  36. #define mt_Disable(obj)     set((obj), MUIA_Disabled, TRUE)
  37. #define mt_Enable(obj)      set((obj), MUIA_Disabled, FALSE)
  38.  
  39.  
  40. //
  41.  
  42.  
  43. #ifndef MAKE_ID
  44. #define MAKE_ID(a,b,c,d)        \
  45.         ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
  46. #endif
  47.  
  48.  
  49.  
  50. // macros defined to pair existsing MuiToolkit library calls
  51.  
  52. #define mt_WinClose(obj)           set( (obj), MUIA_Window_Open, FALSE )
  53. #define mt_StringNumeric(a,b,c,d)  mt_StringAccept((a),(b),(c), "-0123456789", (d) )
  54.  
  55.  
  56. /* Object backgrounds */
  57.  
  58. #define WindowBack     MUIA_Background, MUII_WindowBack
  59. #define RequesterBack  MUIA_Background, MUII_RequesterBack
  60. #define ButtonBack     MUIA_Background, MUII_ButtonBack
  61. #define ListBack       MUIA_Background, MUII_ListBack
  62. #define TextBack       MUIA_Background, MUII_TextBack
  63. #define PropBack       MUIA_Background, MUII_PropBack
  64. #define PopupBack      MUIA_Background, MUII_PopupBack
  65. #define SelectedBack   MUIA_Background, MUII_SelectedBack
  66. #define RegisterBack   MUIA_Background, MUII_RegisterBack
  67. #define TapePlayBack   MUIA_Background, MUII_TapePlayBack
  68. #define GroupBack      MUIA_Background, MUII_GroupBack
  69. #define SliderBack     MUIA_Background, MUII_SliderBack
  70. #define PageBack       MUIA_Background, MUII_PageBack
  71. #define ReadListBack   MUIA_Background, MUII_ReadListBack
  72.  
  73.  
  74.  
  75. #define HBar           MUI_MakeObject( MUIO_HBar, 2)
  76. #define VBar           MUI_MakeObject( MUIO_VBar, 2)
  77.  
  78.  
  79. #define Bar            MUI_MakeObject(MUIO_BarTitle, NULL)
  80. #define BarTitle(x)    MUI_MakeObject(MUIO_BarTitle, (x))
  81.  
  82.  
  83. /* sets w/o triggering any notification */
  84.  
  85. #define nnsetmutex(obj,n)     nnset(obj,MUIA_Radio_Active,n)
  86. #define nnsetcycle(obj,n)     nnset(obj,MUIA_Cycle_Active,n)
  87. #define nnsetstring(obj,s)    nnset(obj,MUIA_String_Contents,s)
  88. #define nnsetcheckmark(obj,b) nnset(obj,MUIA_Selected,b)
  89. #define nnsetslider(obj,l)    nnset(obj,MUIA_Numeric_Value,l)
  90.  
  91.  
  92.  
  93. /* window IDs used by internal MT's windows */
  94.  
  95. #define ID_MT_STRREQ    MAKE_ID('M','T','0','0')
  96. #define ID_MT_INTREQ    MAKE_ID('M','T','0','1')
  97.  
  98.  
  99.  
  100. /* Tags */
  101.  
  102. #ifndef CARLOS_MUI
  103. #define CARLOS_MUI
  104.  
  105. #define MUISERIALNR_CARLOS 2447
  106. #define TAGBASE_CARLOS (TAG_USER | ( MUISERIALNR_CARLOS << 16))
  107. #define MT TAGBASE_CARLOS + 0x100
  108. #define MTT(a) (MT + a)
  109. #endif
  110.  
  111.  
  112. #define mt_StrReq_WinTitle     MTT(0x000)    /* STRPTR */
  113. #define mt_StrReq_Contents     MTT(0x001)    /* STRPTR */
  114. #define mt_StrReq_Ok           MTT(0x002)    /* STRPTR */
  115. #define mt_StrReq_Cancel       MTT(0x003)    /* STRPTR */
  116. #define mt_StrReq_Secret       MTT(0x004)    /* BOOL   */
  117. #define mt_StrReq_NoEmpty      MTT(0x005)    /* BOOL   */
  118. #define mt_StrReq_GroupTitle   MTT(0x006)    /* STRPTR */
  119. #define mt_StrReq_Info         MTT(0x007)    /* STRPTR */
  120. #define mt_StrReq_StringHelp   MTT(0x008)    /* STRPTR */
  121.  
  122. #define mt_IntReq_WinTitle     MTT(0x010)    /* STRPTR */
  123. #define mt_IntReq_Value        MTT(0x011)    /* LONG   */
  124. #define mt_IntReq_Ok           MTT(0x012)    /* STRPTR */
  125. #define mt_IntReq_Cancel       MTT(0x013)    /* STRPTR */
  126. #define mt_IntReq_GroupTitle   MTT(0x014)    /* STRPTR */
  127. #define mt_IntReq_Min          MTT(0x015)    /* LONG   */
  128. #define mt_IntReq_Max          MTT(0x016)    /* LONG   */
  129. #define mt_IntReq_Info         MTT(0x017)    /* STRPTR */
  130. #define mt_IntReq_StringHelp   MTT(0x018)    /* STRPTR */
  131.  
  132.  
  133. // mt_Check - aligment
  134.  
  135. #define mt_Check_NoLabel       0
  136. #define mt_Check_AlignRight    1
  137. #define mt_Check_AlignLeft     2
  138.  
  139.  
  140. // the trickery
  141.  
  142. #pragma tagcall MuiToolkitBase mt_GetString 96 A09804
  143. #pragma tagcall MuiToolkitBase mt_GetInteger 9c A9803
  144.  
  145. #endif /* LIBRARIES_MUITOOLKIT_H */
  146.