home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d9xx / d968 / justlook.lha / JustLook / Source / JustLook.h < prev    next >
C/C++ Source or Header  |  1993-12-04  |  5KB  |  147 lines

  1. #ifndef JUST_LOOK_H
  2. #define JUST_LOOK_H
  3.  
  4. #include <exec/types.h>
  5. #include <devices/inputevent.h>
  6.  
  7. #define SPEEDLEVELS 9
  8.  
  9. /* these are the possible return values. note that combinations are also
  10.    possible (a routine may return the ORed value of more than one error) */
  11. #define NO_ERROR   0x00000000 /* every thing ok */
  12. #define NO_PORT    0x80000001 /* could not open messageport */
  13. #define NO_SIG     0x80000002 /* could not allocate signals */ 
  14. #define NO_MEM     0x80000004 /* could not allocate enough memory */
  15. #define NO_EXTIO   0x80000008 /* could not create IO structure */
  16. #define NO_DEVICE  0x80000010 /* could not open InputEvent device */
  17. #define NO_MOVE    0x80000020 /* mouse pointer does not move */
  18. #define NO_WIN     0x80000040 /* window not found */
  19. #define NO_SCR     0X80000080 /* screen not found */ 
  20. #define NO_GAD     0x80000100 /* gadget not found */
  21. #define NO_BUTTON  0x80000200 /* no such mouse button */
  22. #define NO_SM      0x80000400 /* SM is null! */
  23. #define NO_ACT     0x80000800 /* unappropriate or unknown  action specified */
  24. #define BAD_ITEM   0x80001000 /* illegal menu number (less than zero) */
  25. #define NO_MENU    0x80002000 /* no such menu  */
  26. #define NO_ITEM    0x80004000 /* no such menu item */
  27. #define NO_SUB     0x80008000 /* no such sub menu */
  28. #define NO_RATIO   0x80010000 /* could not get screen ratios */
  29. #define NO_OBJ     0x80020000 /* icon or it's gadget not found */
  30. #define NO_KEY     0x80040000 /* RawInfo poiter is null */
  31. #define NO_STRUCT  0x80080000 /* required dtructure is null */
  32. #define PORT_FOUND 0x80100000 /* input event already disabled! */
  33. #define TRUNCATED  0x80200000 /* given coordinates are out of bound */
  34.  
  35.  
  36. /* these are the qualifiers */
  37. #define LSHIFT   IEQUALIFIER_LSHIFT
  38. #define RSHIFT   IEQUALIFIER_RSHIFT
  39. #define CAPSLOCK IEQUALIFIER_CAPSLOCK1
  40. #define CTRL     IEQUALIFIER_CONTROL
  41. #define LALT     IEQUALIFIER_LALT
  42. #define RALT     IEQUALIFIER_RALT
  43. #define LCMD     IEQUALIFIER_LCOMMAND
  44. #define RCMD     IEQUALIFIER_RCOMMAND
  45. #define NUMPAD   IEQUALIFIER_NUMERICPAD
  46. #define REP      IEQUALIFIER_REPEAT
  47. #define INT      IEQUALIFIER_INTERRUPT
  48. #define MULTB    IEQUALIFIER_MULTIBROADCAST
  49. #define MIDB     IEQUALIFIER_MIDBUTTON
  50. #define RB       IEQUALIFIER_RBUTTON
  51. #define LB       IEQUALIFIER_LEFTBUTTON
  52. #define RELMOUSE IEQUALIFIER_RELATIVEMOUSE
  53.  
  54. /* mouse or keyboard input can be disabled. used for IEEnable() and 
  55.    IEDisable() routines*/
  56. #define MOUSE 0x1
  57. #define KBD   0x2
  58.  
  59. /* more than one window or screen with the specified name (no window pointer
  60.    can begin at address 1 in Amiga!  */
  61. #define SCR_REPEATED (struct Screen *)1
  62. #define WIN_REPEATED (struct Window *)1 
  63.  
  64. /* parameters passes to WinAct() */
  65. #define CLOSEWIN 100
  66. #define DEPTHWIN 101
  67.  
  68. /* used for routines that move the mouse pointer */
  69. #define ABSOLUTE FALSE 
  70. #define RELATIVE TRUE
  71.  
  72. /* used for the Click() routine */
  73. #define DOWN    0
  74. #define UP      1
  75. #define DOWN_UP 2
  76.  
  77. #define LBUTTON   0
  78. #define RBUTTON   1
  79. #define MIDBUTTON 2
  80.  
  81. /* used in WaitIE() routine */
  82. #define LBMASK  (1 << LBUTTON)
  83. #define MBMASK  (1 << MIDBUTTON)
  84. #define RBMASK  (1 << RBUTTON)
  85.  
  86. /* global definitions. used in many places */ 
  87. typedef LONG ErrorCode;
  88. typedef LONG BOOLEAN;
  89.  
  90. /* is used to contain various information about the mouse position */
  91. struct ScrMap 
  92. {
  93.  WORD CurrX,CurrY,DestX,DestY,XRatio,YRatio;
  94.  struct Screen *Scr;
  95. };
  96.  
  97. /* used by RawType() routine */
  98. struct RawInfo
  99. {
  100.  UWORD RawKey,Qualifier;
  101. };
  102.  
  103.  
  104. /* prototypes */
  105.  
  106. ErrorCode ChooseMenu(struct ScrMap *, struct Window *, SHORT, SHORT, SHORT);
  107.  
  108. ErrorCode Click(struct ScrMap *, WORD, UWORD, WORD);
  109.  
  110. ErrorCode ClickGad(struct ScrMap *, struct Window *, char *, USHORT, SHORT);
  111.  
  112. struct Gadget *FindGad(struct Window *, char *, USHORT);
  113.  
  114. struct Screen *FindScreen(char *);
  115.  
  116. struct Window *FindWindow(char *, struct Screen *);
  117.  
  118. /*ErrorCode GetRatio(struct ScrMap *SM,struct Screen *Scr);you don't need it*/
  119.  
  120. ErrorCode GoOverGad(struct ScrMap *, struct Window *, char *, USHORT ,SHORT);
  121.  
  122. ErrorCode GoOverIcon(struct ScrMap *, struct Window *, UBYTE *);
  123.  
  124. ErrorCode IEDisable(LONG);
  125.  
  126. ErrorCode IEEnable(LONG);
  127.  
  128. ErrorCode IEWait(LONG);
  129.  
  130. ErrorCode InitSM(struct ScrMap *, struct Screen *);
  131.  
  132. ErrorCode MoveMouse(struct ScrMap *, BOOLEAN, SHORT);
  133.  
  134. ErrorCode RawType(struct RawInfo *, ULONG, ULONG);
  135.  
  136. VOID Rel2Abs(struct ScrMap *, SHORT *, SHORT *);
  137.  
  138. VOID SetDest(struct ScrMap *, SHORT, SHORT);
  139.  
  140. ErrorCode WinAct(struct ScrMap *, struct Window *, LONG);
  141.  
  142. ErrorCode WinDrag(struct ScrMap *, struct Window *, BOOLEAN, SHORT, SHORT);
  143.  
  144. ErrorCode WinResize(struct ScrMap *, struct Window *, BOOLEAN, SHORT, SHORT);
  145.  
  146. #endif
  147.