home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / programm / programi / gcc_9112.lzh / include20 / inline / gadtools.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-15  |  7.7 KB  |  324 lines

  1. #include <inline/stub.h>
  2. #ifndef BASE_EXT_DECL
  3. #define BASE_EXT_DECL extern struct Library * GadToolsBase;
  4. #endif
  5. #ifndef BASE_PAR_DECL
  6. #define BASE_PAR_DECL
  7. #define BASE_PAR_DECL0 void
  8. #endif
  9. #ifndef BASE_NAME
  10. #define BASE_NAME GadToolsBase
  11. #endif
  12. __inline static struct Gadget* CreateGadgetA(BASE_PAR_DECL long unsigned int kind, struct Gadget* gad, struct NewGadget* ng, struct TagItem* taglist)
  13. {
  14.     BASE_EXT_DECL
  15.     register struct Gadget* res __asm("d0");
  16.     register void *a6 __asm ("a6");
  17.     register long unsigned int d0 __asm("d0");
  18.     register struct Gadget* a0 __asm("a0");
  19.     register struct NewGadget* a1 __asm("a1");
  20.     register struct TagItem* a2 __asm("a2");
  21.  
  22.     a6 = BASE_NAME;
  23.     d0 = kind;
  24.     a0 = gad;
  25.     a1 = ng;
  26.     a2 = taglist;
  27.     __asm volatile ("
  28.     jsr a6@(-0x1e)"
  29.     : "=g" (res)
  30.     : "g" (a6), "g" (d0), "g" (a0), "g" (a1), "g" (a2)
  31.     : "d0", "d1", "a0", "a1", "a2");
  32.     return res;
  33. }
  34. __inline static void FreeGadgets(BASE_PAR_DECL struct Gadget* gad)
  35. {
  36.     BASE_EXT_DECL
  37.     register void *a6 __asm ("a6");
  38.     register struct Gadget* a0 __asm("a0");
  39.  
  40.     a6 = BASE_NAME;
  41.     a0 = gad;
  42.     __asm volatile ("
  43.     jsr a6@(-0x24)"
  44.     : /* no output */
  45.     : "g" (a6), "g" (a0)
  46.     : "d0", "d1", "a0", "a1");
  47. }
  48. __inline static void GT_SetGadgetAttrsA(BASE_PAR_DECL struct Gadget* gad, struct Window* win, struct Requester* req, struct TagItem* taglist)
  49. {
  50.     BASE_EXT_DECL
  51.     register void *a6 __asm ("a6");
  52.     register struct Gadget* a0 __asm("a0");
  53.     register struct Window* a1 __asm("a1");
  54.     register struct Requester* a2 __asm("a2");
  55.     register struct TagItem* a3 __asm("a3");
  56.  
  57.     a6 = BASE_NAME;
  58.     a0 = gad;
  59.     a1 = win;
  60.     a2 = req;
  61.     a3 = taglist;
  62.     __asm volatile ("
  63.     jsr a6@(-0x2a)"
  64.     : /* no output */
  65.     : "g" (a6), "g" (a0), "g" (a1), "g" (a2), "g" (a3)
  66.     : "d0", "d1", "a0", "a1", "a2", "a3");
  67. }
  68. __inline static struct Menu* CreateMenusA(BASE_PAR_DECL struct NewMenu* newmenu, struct TagItem* taglist)
  69. {
  70.     BASE_EXT_DECL
  71.     register struct Menu* res __asm("d0");
  72.     register void *a6 __asm ("a6");
  73.     register struct NewMenu* a0 __asm("a0");
  74.     register struct TagItem* a1 __asm("a1");
  75.  
  76.     a6 = BASE_NAME;
  77.     a0 = newmenu;
  78.     a1 = taglist;
  79.     __asm volatile ("
  80.     jsr a6@(-0x30)"
  81.     : "=g" (res)
  82.     : "g" (a6), "g" (a0), "g" (a1)
  83.     : "d0", "d1", "a0", "a1");
  84.     return res;
  85. }
  86. __inline static void FreeMenus(BASE_PAR_DECL struct Menu* menu)
  87. {
  88.     BASE_EXT_DECL
  89.     register void *a6 __asm ("a6");
  90.     register struct Menu* a0 __asm("a0");
  91.  
  92.     a6 = BASE_NAME;
  93.     a0 = menu;
  94.     __asm volatile ("
  95.     jsr a6@(-0x36)"
  96.     : /* no output */
  97.     : "g" (a6), "g" (a0)
  98.     : "d0", "d1", "a0", "a1");
  99. }
  100. __inline static BOOL LayoutMenuItemsA(BASE_PAR_DECL struct MenuItem* firstitem, APTR vi, struct TagItem* taglist)
  101. {
  102.     BASE_EXT_DECL
  103.     register BOOL res __asm("d0");
  104.     register void *a6 __asm ("a6");
  105.     register struct MenuItem* a0 __asm("a0");
  106.     register APTR a1 __asm("a1");
  107.     register struct TagItem* a2 __asm("a2");
  108.  
  109.     a6 = BASE_NAME;
  110.     a0 = firstitem;
  111.     a1 = vi;
  112.     a2 = taglist;
  113.     __asm volatile ("
  114.     jsr a6@(-0x3c)"
  115.     : "=g" (res)
  116.     : "g" (a6), "g" (a0), "g" (a1), "g" (a2)
  117.     : "d0", "d1", "a0", "a1", "a2");
  118.     return res;
  119. }
  120. __inline static BOOL LayoutMenusA(BASE_PAR_DECL struct Menu* firstmenu, APTR vi, struct TagItem* taglist)
  121. {
  122.     BASE_EXT_DECL
  123.     register BOOL res __asm("d0");
  124.     register void *a6 __asm ("a6");
  125.     register struct Menu* a0 __asm("a0");
  126.     register APTR a1 __asm("a1");
  127.     register struct TagItem* a2 __asm("a2");
  128.  
  129.     a6 = BASE_NAME;
  130.     a0 = firstmenu;
  131.     a1 = vi;
  132.     a2 = taglist;
  133.     __asm volatile ("
  134.     jsr a6@(-0x42)"
  135.     : "=g" (res)
  136.     : "g" (a6), "g" (a0), "g" (a1), "g" (a2)
  137.     : "d0", "d1", "a0", "a1", "a2");
  138.     return res;
  139. }
  140. __inline static struct IntuiMessage* GT_GetIMsg(BASE_PAR_DECL struct MsgPort* iport)
  141. {
  142.     BASE_EXT_DECL
  143.     register struct IntuiMessage* res __asm("d0");
  144.     register void *a6 __asm ("a6");
  145.     register struct MsgPort* a0 __asm("a0");
  146.  
  147.     a6 = BASE_NAME;
  148.     a0 = iport;
  149.     __asm volatile ("
  150.     jsr a6@(-0x48)"
  151.     : "=g" (res)
  152.     : "g" (a6), "g" (a0)
  153.     : "d0", "d1", "a0", "a1");
  154.     return res;
  155. }
  156. __inline static void GT_ReplyIMsg(BASE_PAR_DECL struct IntuiMessage* imsg)
  157. {
  158.     BASE_EXT_DECL
  159.     register void *a6 __asm ("a6");
  160.     register struct IntuiMessage* a1 __asm("a1");
  161.  
  162.     a6 = BASE_NAME;
  163.     a1 = imsg;
  164.     __asm volatile ("
  165.     jsr a6@(-0x4e)"
  166.     : /* no output */
  167.     : "g" (a6), "g" (a1)
  168.     : "d0", "d1", "a0", "a1");
  169. }
  170. __inline static void GT_RefreshWindow(BASE_PAR_DECL struct Window* win, struct Requester* req)
  171. {
  172.     BASE_EXT_DECL
  173.     register void *a6 __asm ("a6");
  174.     register struct Window* a0 __asm("a0");
  175.     register struct Requester* a1 __asm("a1");
  176.  
  177.     a6 = BASE_NAME;
  178.     a0 = win;
  179.     a1 = req;
  180.     __asm volatile ("
  181.     jsr a6@(-0x54)"
  182.     : /* no output */
  183.     : "g" (a6), "g" (a0), "g" (a1)
  184.     : "d0", "d1", "a0", "a1");
  185. }
  186. __inline static void GT_BeginRefresh(BASE_PAR_DECL struct Window* win)
  187. {
  188.     BASE_EXT_DECL
  189.     register void *a6 __asm ("a6");
  190.     register struct Window* a0 __asm("a0");
  191.  
  192.     a6 = BASE_NAME;
  193.     a0 = win;
  194.     __asm volatile ("
  195.     jsr a6@(-0x5a)"
  196.     : /* no output */
  197.     : "g" (a6), "g" (a0)
  198.     : "d0", "d1", "a0", "a1");
  199. }
  200. __inline static void GT_EndRefresh(BASE_PAR_DECL struct Window* win, long int complete)
  201. {
  202.     BASE_EXT_DECL
  203.     register void *a6 __asm ("a6");
  204.     register struct Window* a0 __asm("a0");
  205.     register long int d0 __asm("d0");
  206.  
  207.     a6 = BASE_NAME;
  208.     a0 = win;
  209.     d0 = complete;
  210.     __asm volatile ("
  211.     jsr a6@(-0x60)"
  212.     : /* no output */
  213.     : "g" (a6), "g" (a0), "g" (d0)
  214.     : "d0", "d1", "a0", "a1");
  215. }
  216. __inline static struct IntuiMessage* GT_FilterIMsg(BASE_PAR_DECL struct IntuiMessage* imsg)
  217. {
  218.     BASE_EXT_DECL
  219.     register struct IntuiMessage* res __asm("d0");
  220.     register void *a6 __asm ("a6");
  221.     register struct IntuiMessage* a1 __asm("a1");
  222.  
  223.     a6 = BASE_NAME;
  224.     a1 = imsg;
  225.     __asm volatile ("
  226.     jsr a6@(-0x66)"
  227.     : "=g" (res)
  228.     : "g" (a6), "g" (a1)
  229.     : "d0", "d1", "a0", "a1");
  230.     return res;
  231. }
  232. __inline static struct IntuiMessage* GT_PostFilterIMsg(BASE_PAR_DECL struct IntuiMessage* imsg)
  233. {
  234.     BASE_EXT_DECL
  235.     register struct IntuiMessage* res __asm("d0");
  236.     register void *a6 __asm ("a6");
  237.     register struct IntuiMessage* a1 __asm("a1");
  238.  
  239.     a6 = BASE_NAME;
  240.     a1 = imsg;
  241.     __asm volatile ("
  242.     jsr a6@(-0x6c)"
  243.     : "=g" (res)
  244.     : "g" (a6), "g" (a1)
  245.     : "d0", "d1", "a0", "a1");
  246.     return res;
  247. }
  248. __inline static struct Gadget* CreateContext(BASE_PAR_DECL struct Gadget** glistptr)
  249. {
  250.     BASE_EXT_DECL
  251.     register struct Gadget* res __asm("d0");
  252.     register void *a6 __asm ("a6");
  253.     register struct Gadget** a0 __asm("a0");
  254.  
  255.     a6 = BASE_NAME;
  256.     a0 = glistptr;
  257.     __asm volatile ("
  258.     jsr a6@(-0x72)"
  259.     : "=g" (res)
  260.     : "g" (a6), "g" (a0)
  261.     : "d0", "d1", "a0", "a1");
  262.     return res;
  263. }
  264. __inline static void DrawBevelBoxA(BASE_PAR_DECL struct RastPort* rport, long int left, long int top, long int width, long int height, struct TagItem* taglist)
  265. {
  266.     BASE_EXT_DECL
  267.     register void *a6 __asm ("a6");
  268.     register struct RastPort* a0 __asm("a0");
  269.     register long int d0 __asm("d0");
  270.     register long int d1 __asm("d1");
  271.     register long int d2 __asm("d2");
  272.     register long int d3 __asm("d3");
  273.     register struct TagItem* a1 __asm("a1");
  274.  
  275.     a6 = BASE_NAME;
  276.     a0 = rport;
  277.     d0 = left;
  278.     d1 = top;
  279.     d2 = width;
  280.     d3 = height;
  281.     a1 = taglist;
  282.     __asm volatile ("
  283.     jsr a6@(-0x78)"
  284.     : /* no output */
  285.     : "g" (a6), "g" (a0), "g" (d0), "g" (d1), "g" (d2), "g" (d3), "g" (a1)
  286.     : "d0", "d1", "a0", "a1", "d2", "d3");
  287. }
  288. __inline static APTR GetVisualInfoA(BASE_PAR_DECL struct Screen* screen, struct TagItem* taglist)
  289. {
  290.     BASE_EXT_DECL
  291.     register APTR res __asm("d0");
  292.     register void *a6 __asm ("a6");
  293.     register struct Screen* a0 __asm("a0");
  294.     register struct TagItem* a1 __asm("a1");
  295.  
  296.     a6 = BASE_NAME;
  297.     a0 = screen;
  298.     a1 = taglist;
  299.     __asm volatile ("
  300.     jsr a6@(-0x7e)"
  301.     : "=g" (res)
  302.     : "g" (a6), "g" (a0), "g" (a1)
  303.     : "d0", "d1", "a0", "a1");
  304.     return res;
  305. }
  306. __inline static void FreeVisualInfo(BASE_PAR_DECL APTR vi)
  307. {
  308.     BASE_EXT_DECL
  309.     register void *a6 __asm ("a6");
  310.     register APTR a0 __asm("a0");
  311.  
  312.     a6 = BASE_NAME;
  313.     a0 = vi;
  314.     __asm volatile ("
  315.     jsr a6@(-0x84)"
  316.     : /* no output */
  317.     : "g" (a6), "g" (a0)
  318.     : "d0", "d1", "a0", "a1");
  319. }
  320. #undef BASE_EXT_DECL
  321. #undef BASE_PAR_DECL
  322. #undef BASE_PAR_DECL0
  323. #undef BASE_NAME
  324.