home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 5 / FreshFish_July-August1994.bin / bbs / gnu / ixemul-39.47-env-bin.lha / include / inline / mui_master.h
C/C++ Source or Header  |  1994-07-08  |  4KB  |  157 lines

  1. #ifndef _INLINE_MUIMASTER_H
  2. #define _INLINE_MUIMASTER_H
  3.  
  4. #include <sys/cdefs.h>
  5. #include <inline/stubs.h>
  6.  
  7. #ifndef EXEC_TYPES_H
  8. #include <exec/types.h>
  9. #endif
  10. #ifndef INTUITION_CLASSES_H
  11. #include <intuition/classes.h>
  12. #endif
  13. #ifndef UTILITY_TAGITEM_H
  14. #include <utility/tagitem.h>
  15. #endif
  16.  
  17. #define static
  18.  
  19. __BEGIN_DECLS
  20.  
  21. #ifndef BASE_EXT_DECL
  22. #define BASE_EXT_DECL extern struct Library*  MUIMasterBase;
  23. #endif
  24. #ifndef BASE_PAR_DECL
  25. #define BASE_PAR_DECL
  26. #define BASE_PAR_DECL0 void
  27. #endif
  28. #ifndef BASE_NAME
  29. #define BASE_NAME MUIMasterBase
  30. #endif
  31.  
  32. static __inline APTR
  33. MUI_AllocAslRequest (BASE_PAR_DECL unsigned long type,struct TagItem *tags)
  34. {
  35.   BASE_EXT_DECL
  36.   register APTR  _res  __asm("d0");
  37.   register struct Library* a6 __asm("a6") = BASE_NAME;
  38.   register unsigned long d0 __asm("d0") = type;
  39.   register struct TagItem *a0 __asm("a0") = tags;
  40.   __asm __volatile ("jsr a6@(-0x30)"
  41.   : "=r" (_res)
  42.   : "r" (a6), "r" (d0), "r" (a0)
  43.   : "a0","a1","d0","d1", "memory");
  44.   return _res;
  45. }
  46.  
  47. APTR MUI_AllocAslRequestTags(ULONG type, Tag tag1, ...)
  48. {
  49.  return(MUI_AllocAslRequest(type, (struct TagItem *) &tag1));
  50. }
  51.  
  52. static __inline VOID
  53. MUI_DisposeObject (BASE_PAR_DECL APTR obj)
  54. {
  55.   BASE_EXT_DECL
  56.   register struct Library* a6 __asm("a6") = BASE_NAME;
  57.   register APTR a0 __asm("a0") = obj;
  58.   __asm __volatile ("jsr a6@(-0x24)"
  59.   : /* no output */
  60.   : "r" (a6), "r" (a0)
  61.   : "a0","a1","d0","d1", "memory");
  62. }
  63.  
  64. static __inline BOOL
  65. MUI_AslRequest (BASE_PAR_DECL APTR req,struct TagItem *tags)
  66. {
  67.   BASE_EXT_DECL
  68.   register BOOL  _res  __asm("d0");
  69.   register struct Library* a6 __asm("a6") = BASE_NAME;
  70.   register APTR a0 __asm("a0") = req;
  71.   register struct TagItem *a1 __asm("a1") = tags;
  72.   __asm __volatile ("jsr a6@(-0x36)"
  73.   : "=r" (_res)
  74.   : "r" (a6), "r" (a0), "r" (a1)
  75.   : "a0","a1","d0","d1", "memory");
  76.   return _res;
  77. }
  78.  
  79. BOOL MUI_AslRequestTags(APTR req, Tag tag1, ...)
  80. {
  81.  return(MUI_AslRequest(req, (struct TagItem *) &tag1));
  82. }
  83.  
  84. static __inline LONG
  85. MUI_Error (BASE_PAR_DECL0)
  86. {
  87.   BASE_EXT_DECL
  88.   register LONG  _res  __asm("d0");
  89.   register struct Library* a6 __asm("a6") = BASE_NAME;
  90.   __asm __volatile ("jsr a6@(-0x42)"
  91.   : "=r" (_res)
  92.   : "r" (a6)
  93.   : "a0","a1","d0","d1", "memory");
  94.   return _res;
  95. }
  96. static __inline VOID
  97. MUI_FreeAslRequest (BASE_PAR_DECL APTR req)
  98. {
  99.   BASE_EXT_DECL
  100.   register struct Library* a6 __asm("a6") = BASE_NAME;
  101.   register APTR a0 __asm("a0") = req;
  102.   __asm __volatile ("jsr a6@(-0x3c)"
  103.   : /* no output */
  104.   : "r" (a6), "r" (a0)
  105.   : "a0","a1","d0","d1", "memory");
  106. }
  107. static __inline APTR
  108. MUI_NewObjectA (BASE_PAR_DECL char *class,struct TagItem *tags)
  109. {
  110.   BASE_EXT_DECL
  111.   register APTR  _res  __asm("d0");
  112.   register struct Library* a6 __asm("a6") = BASE_NAME;
  113.   register char *a0 __asm("a0") = class;
  114.   register struct TagItem *a1 __asm("a1") = tags;
  115.   __asm __volatile ("jsr a6@(-0x1e)"
  116.   : "=r" (_res)
  117.   : "r" (a6), "r" (a0), "r" (a1)
  118.   : "a0","a1","d0","d1", "memory");
  119.   return _res;
  120. }
  121. APTR MUI_NewObject(char *class, Tag tag1, ...)
  122. {
  123.  return(MUI_NewObjectA(class, (struct TagItem *) &tag1));
  124. }
  125.  
  126. static __inline LONG
  127. MUI_RequestA (BASE_PAR_DECL APTR app,APTR win,LONGBITS flags,char *title,char *gadgets,char *format,APTR params)
  128. {
  129.   BASE_EXT_DECL
  130.   register LONG  _res  __asm("d0");
  131.   register struct Library* a6 __asm("a6") = BASE_NAME;
  132.   register APTR d0 __asm("d0") = app;
  133.   register APTR d1 __asm("d1") = win;
  134.   register LONGBITS d2 __asm("d2") = flags;
  135.   register char *a0 __asm("a0") = title;
  136.   register char *a1 __asm("a1") = gadgets;
  137.   register char *a2 __asm("a2") = format;
  138.   register APTR a3 __asm("a3") = params;
  139.   __asm __volatile ("jsr a6@(-0x2a)"
  140.   : "=r" (_res)
  141.   : "r" (a6), "r" (d0), "r" (d1), "r" (d2), "r" (a0), "r" (a1), "r" (a2), "r" (a3)
  142.   : "a0","a1","a2","a3","d0","d1","d2", "memory");
  143.   return _res;
  144. }
  145. LONG MUI_Request(APTR app, APTR win, LONGBITS flags, char *title, char *gadgets, char *format, ...)
  146. {
  147.  return(MUI_RequestA(app, win, flags, title, gadgets, format, (APTR) (((ULONG)&format)+4) ));
  148. }
  149. #undef BASE_EXT_DECL
  150. #undef BASE_PAR_DECL
  151. #undef BASE_PAR_DECL0
  152. #undef BASE_NAME
  153.  
  154. __END_DECLS
  155.  
  156. #endif /* _INLINE_MUIMASTER_H */
  157.