home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 480.lha / SmartField / Include / console / fields.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-02-06  |  2.5 KB  |  114 lines

  1. /***************************************
  2. *  console/fields.h v1.40
  3. *  © Copyright 1988 Timm Martin
  4. *  All Rights Reserved
  5. ****************************************/
  6.  
  7. #ifndef CONSOLE_FIELDS_H
  8. #define CONSOLE_FIELDS_H
  9.  
  10. #include <exec/io.h>
  11. #include <exec/ports.h>
  12. #include <exec/types.h>
  13. #include <intuition/intuition.h>
  14. #include <console/console.h>
  15.  
  16. #define MASK_ELEMENTS 8
  17. #define MASK_ENABLE  0x0001L
  18. #define MASK_DISABLE 0x0000L
  19. #define MASK_ENTIRE_DISABLED {0,0,0,0,0,0,0,0}
  20. #define MASK_ENTIRE_ENABLED  {0xffffffff,0xffffffff,0xffffffff,0xffffffff,\
  21.                               0xffffffff,0xffffffff,0xffffffff,0xffffffff}
  22.  
  23. struct FieldMask {
  24.   ULONG Element[MASK_ELEMENTS];
  25. };
  26.  
  27. #define FIELD_ENABLED  1
  28. #define FIELD_DISABLED 0
  29.  
  30. #define FIELD_CLIP_SIZE 80
  31.  
  32. struct Field {
  33.   struct Field *PrevField;
  34.   struct Field *NextField;
  35.   UBYTE  *Buffer;
  36.   UBYTE  *UndoBuffer;
  37.   UBYTE  *DupBuffer;
  38.   UBYTE  FrontPen;
  39.   UBYTE  BackPen;
  40.   UBYTE  Style;
  41.   UBYTE  Enabled;
  42.   struct FieldMask *Mask;
  43.   USHORT Flags;
  44.   SHORT  Left,Top;
  45.   SHORT  Right,Bottom;
  46.   SHORT  MaxChars;
  47.   SHORT  NumChars;
  48.   SHORT  DispChars;
  49.   SHORT  BufferPos;
  50.   SHORT  DispPos;
  51.   struct IntuiText *FieldTitle;
  52.   struct Border *FieldBorder;
  53.   struct Image *FieldImage;
  54.   SHORT  FieldID;
  55.   APTR   UserPtr;
  56.   LONG   Reserved1;
  57.   LONG   Reserved2;
  58. };
  59.  
  60. struct FieldHeader {
  61.   struct Window *Window;
  62.   struct MsgPort *WritePort;
  63.   struct IOStdReq *WriteReq;
  64.   struct MsgPort *ReadPort;
  65.   struct IOStdReq *ReadReq;
  66.   LONG   ConsoleError;
  67.   UBYTE  *Buffer;
  68.   struct FieldMask *Mask;
  69.   SHORT  TypeMode;
  70.   APTR   UserPtr;
  71.   LONG   Reserved1;
  72.   LONG   Reserved2;
  73.   struct Field *FirstField;
  74.   struct Field *FinalField;
  75.   struct Field *CurrentField;
  76.   SHORT  BufferPos;
  77. };
  78.  
  79. #define INIT_FIELD_HEADER NULL,NULL,NULL,NULL,NULL,CONSOLE_ERROR,NULL,NULL,0,\
  80.                           NULL,NULL,NULL,NULL,NULL,NULL,0
  81.  
  82. #define FIELD_OPEN_OK      0
  83. #define FIELD_EXIT_WPORT   30011
  84. #define FIELD_EXIT_WREQ    30012
  85. #define FIELD_EXIT_RPORT   30013
  86. #define FIELD_EXIT_RREQ    30014
  87. #define FIELD_EXIT_CONSOLE 30015
  88.  
  89. #define FIELD_FIRST      1000
  90. #define FIELD_FINAL      1001
  91. #define FIELD_PREVIOUS   1002
  92. #define FIELD_NEXT       1003
  93. #define FIELD_ESCAPE     1004
  94. #define FIELD_HELP       1005
  95. #define FIELD_SWALLOW    1006
  96. #define FIELD_RETURN     1008
  97. #define FIELD_OFF        1009
  98. #define FIELD_NO_CURRENT 1010
  99.  
  100. #define LEFT_MOUSE_BUTTON 0x68
  101.  
  102. /* Remove this comment if your compiler supports the BUILTIN feature!
  103. #ifdef strcpy
  104. #undef strcpy
  105. #endif
  106. #ifdef strlen
  107. #undef strlen
  108. #endif
  109. #define strcpy _BUILTIN_strcpy
  110. #define strlen _BUILTIN_strlen
  111. */
  112.  
  113. #endif
  114.