home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mod201j.zip / modula2.exe / os2api / winmle.def < prev    next >
Text File  |  1995-02-20  |  13KB  |  292 lines

  1. DEFINITION MODULE WINMLE;
  2.  
  3. (************************************************************************
  4.   OS/2 2.0 interface for Presentation Manager MultiLine Edit Control.
  5.            20.02.95 13.33 : changed : new type id MLE_SEARCHDATA
  6.  
  7.   Copyright (c) 1992 by Juergen Neuhoff
  8. *************************************************************************)
  9.  
  10. (*$XL+       Modula-2 language extensions: '_' allowed for symbol names *)
  11. (*$CDECL+    C-style procedures                                         *)
  12. (*$A         default alignment for record fields                        *)
  13.  
  14. IMPORT SYSTEM;
  15. FROM   OS2DEF  IMPORT TYPEPREFIX, PCHAR;
  16.  
  17. (*************************************************************************
  18. * MLE Window styles ( in addition to WS_* )
  19. *************************************************************************)
  20. CONST
  21.   MLS_WORDWRAP       = 00000001H;
  22.   MLS_BORDER         = 00000002H;
  23.   MLS_VSCROLL        = 00000004H;
  24.   MLS_HSCROLL        = 00000008H;
  25.   MLS_READONLY       = 00000010H;
  26.   MLS_IGNORETAB      = 00000020H;
  27.   MLS_DISABLEUNDO    = 00000040H;
  28.  
  29. (*************************************************************************
  30. * MLE External Data Types
  31. *************************************************************************)
  32. TYPE
  33.   IPT                = LONGINT;              (* insertion point         *)
  34.   PIPT               = POINTER TO IPT;       (* insertion point         *)
  35.   PIX                = LONGINT;              (* pixel                   *)
  36.   LINE               = LONGCARD;             (* Line number             *)
  37.  
  38.   FORMATRECT         = RECORD
  39.     CASE               : TYPEPREFIX OF
  40.     | TRUE             :
  41.       cxFormat         : LONGINT;            (* format rectangle width  *)
  42.       cyFormat         : LONGINT;            (* format rectangle height *)
  43.     | FALSE            :
  44.       FormatXSize      : LONGINT;            (* format rectangle width  *)
  45.       FormatYSize      : LONGINT;            (* format rectangle height *)
  46.     END;               END;
  47.   PMLEFORMATRECT     = POINTER TO FORMATRECT;
  48.  
  49.   MLECTLDATA         = RECORD
  50.     CASE               : TYPEPREFIX OF
  51.     | TRUE             :
  52.       cbCtlData        : CARDINAL; (* Length of the MLECTLDATA structure  *)
  53.       afIEFormat       : CARDINAL; (* import/export format                *)
  54.       cchText          : LONGCARD; (* text limit                          *)
  55.       iptAnchor        : IPT;      (* beginning of selection              *)
  56.       iptCursor        : IPT;      (* ending of selection                 *)
  57.       cxFormat         : LONGINT;  (* format rectangle width              *)
  58.       cyFormat         : LONGINT;  (* format rectangle height             *)
  59.       afFormatFlags    : LONGCARD; (* formatting rectangle flags          *)
  60.     | FALSE            :
  61.       CtlDataLen       : CARDINAL; (* Length of the MLECTLDATA structure  *)
  62.       EFormat          : CARDINAL; (* import/export format                *)
  63.       TextLimit        : LONGCARD; (* text limit                          *)
  64.       Anchor           : IPT;      (* beginning of selection              *)
  65.       Cursor           : IPT;      (* ending of selection                 *)
  66.       FormatXSize      : LONGINT;  (* format rectangle width              *)
  67.       FormatYSize      : LONGINT;  (* format rectangle height             *)
  68.       FormatFlags      : LONGCARD; (* formatting rectangle flags          *)
  69.     END;               END;
  70.   PMLECTLDATA        = POINTER TO MLECTLDATA;
  71.  
  72. (*************************************************************************
  73. * afFormatFlags mask
  74. *************************************************************************)
  75. CONST
  76.   MLFFMTRECT_LIMITHORZ   = 00000001H;
  77.   MLFFMTRECT_LIMITVERT   = 00000002H;
  78.   MLFFMTRECT_MATCHWINDOW = 00000004H;
  79.   MLFFMTRECT_FORMATRECT  = 00000007H;
  80.  
  81. (*************************************************************************
  82. * afIEFormat - Import/Export Format flags
  83. *************************************************************************)
  84. CONST
  85.   MLFIE_CFTEXT           = 0;
  86.   MLFIE_NOTRANS          = 1;
  87.   MLFIE_WINFMT           = 2;
  88.   MLFIE_RTF              = 3;
  89.  
  90. (*************************************************************************
  91. * MLN_OVERFLOW structure
  92. *************************************************************************)
  93. TYPE
  94.   MLEOVERFLOW        = RECORD     (* overflow *)
  95.     CASE               : TYPEPREFIX OF
  96.     | TRUE             :
  97.       afErrInd         : LONGCARD;(* see mask below                         *)
  98.       nBytesOver       : LONGINT; (* number of bytes overflowed             *)
  99.       pixHorzOver      : LONGINT; (* number of pixels horizontally overflow *)
  100.       pixVertOver      : LONGINT; (* number of pixels vertically overflowed *)
  101.     | FALSE            :
  102.       ErrInd           : LONGCARD;(* see mask below                         *)
  103.       BytesOver        : LONGINT; (* number of bytes overflowed             *)
  104.       HorzOver         : LONGINT; (* number of pixels horizontally overflow *)
  105.       VertOver         : LONGINT; (* number of pixels vertically overflowed *)
  106.     END;               END;
  107.   PMLEOVERFLOW       = POINTER TO OVERFLOW;
  108.  
  109. (*************************************************************************
  110. * ErrInd - error format rectangle flags
  111. *************************************************************************)
  112. CONST
  113.   MLFEFR_RESIZE      = 00000001H;
  114.   MLFEFR_TABSTOP     = 00000002H;
  115.   MLFEFR_FONT        = 00000004H;
  116.   MLFEFR_TEXT        = 00000008H;
  117.   MLFEFR_WORDWRAP    = 00000010H;
  118.   MLFETL_TEXTBYTES   = 00000020H;
  119.  
  120. (*************************************************************************
  121. * MLN_MARGIN structure
  122. *************************************************************************)
  123. TYPE
  124.   MLEMARGSTRUCT      = RECORD       (* margin *)
  125.     CASE               : TYPEPREFIX OF
  126.     | TRUE             :
  127.       afMargins        : CARDINAL;  (* margin indicator     *)
  128.       usMouMsg         : CARDINAL;  (* mouse message        *)
  129.       iptNear          : IPT;       (* geometrically nearest ins. point *)
  130.     | FALSE            :
  131.       Margins          : CARDINAL;  (* margin indicator     *)
  132.       MouMsg           : CARDINAL;  (* mouse message        *)
  133.       Near             : IPT;       (* geometrically nearest ins. point *)
  134.     END;               END;
  135.   PMLEMARGSTRUCT     = POINTER TO MARGSTRUCT;
  136.  
  137. (*************************************************************************
  138. * afFlags - margin notification indicators
  139. *************************************************************************)
  140. CONST
  141.   MLFMARGIN_LEFT     = 0001H;
  142.   MLFMARGIN_BOTTOM   = 0002H;
  143.   MLFMARGIN_RIGHT    = 0003H;
  144.   MLFMARGIN_TOP      = 0004H;
  145.  
  146. (*************************************************************************
  147. * MLM_QUERYSELECTION flags
  148. *************************************************************************)
  149. CONST
  150.   MLFQS_MINMAXSEL    = 0;
  151.   MLFQS_MINSEL       = 1;
  152.   MLFQS_MAXSEL       = 2;
  153.   MLFQS_ANCHORSEL    = 3;
  154.   MLFQS_CURSORSEL    = 4;
  155.  
  156. (*************************************************************************
  157. * MLN_CLPBDFAIL flags
  158. *************************************************************************)
  159. CONST
  160.   MLFCLPBD_TOOMUCHTEXT = 00000001H;
  161.   MLFCLPBD_ERROR       = 00000002H;
  162.  
  163. (*************************************************************************
  164. * MLM_SEARCH structure
  165. *************************************************************************)
  166. TYPE
  167.   SEARCH             = RECORD
  168.     CASE               : TYPEPREFIX OF
  169.     | TRUE             :
  170.       cb               : CARDINAL;  (* size of search spec structure       *)
  171.       pchFind          : PCHAR;     (* string to search for                *)
  172.       pchReplace       : PCHAR;     (* string to replace with              *)
  173.       cchFind          : INTEGER;   (* length of pchFindString             *)
  174.       cchReplace       : INTEGER;   (* length of replace string            *)
  175.       iptStart         : IPT;       (* point at which to start search      *)
  176.                                     (* (negative indicates cursor pt)      *)
  177.                                     (* becomes pt where string found       *)
  178.       iptStop          : IPT;       (* point at which to stop search       *)
  179.                                     (* (negative indicates EOT)            *)
  180.       cchFound         : CARDINAL;  (* Length of found string at iptStart  *)
  181.     | FALSE            :
  182.       Size             : CARDINAL;  (* size of search spec structure       *)
  183.       Find             : PCHAR;     (* string to search for                *)
  184.       Replace          : PCHAR;     (* string to replace with              *)
  185.       FindLen          : INTEGER;   (* length of pchFindString             *)
  186.       ReplaceLen       : INTEGER;   (* length of replace string            *)
  187.       Start            : IPT;       (* point at which to start search      *)
  188.                                     (* (negative indicates cursor pt)      *)
  189.                                     (* becomes pt where string found       *)
  190.       Stop             : IPT;       (* point at which to stop search       *)
  191.                                     (* (negative indicates EOT)            *)
  192.       FoundLen         : CARDINAL;  (* Length of found string at iptStart  *)
  193.     END;               END;
  194.   MLE_SEARCHDATA     = SEARCH;
  195.   PMLE_SEARCHDATA    = POINTER TO MLE_SEARCHDATA;
  196.  
  197. (*************************************************************************
  198. * MLM_SEARCH style flags
  199. *************************************************************************)
  200. CONST
  201.   MLFSEARCH_CASESENSITIVE = 00000001H;
  202.   MLFSEARCH_SELECTMATCH   = 00000002H;
  203.   MLFSEARCH_CHANGEALL     = 00000004H;
  204.  
  205. (*************************************************************************
  206. * MLE messages - MLM from 0x01b0 to 0x01de; MLN from 0x0001 to 0x000f
  207. *************************************************************************)
  208. CONST (* formatting messages *)
  209.   MLM_SETTEXTLIMIT        = 01B0H;
  210.   MLM_QUERYTEXTLIMIT      = 01B1H;
  211.   MLM_SETFORMATRECT       = 01B2H;
  212.   MLM_QUERYFORMATRECT     = 01B3H;
  213.   MLM_SETWRAP             = 01B4H;
  214.   MLM_QUERYWRAP           = 01B5H;
  215.   MLM_SETTABSTOP          = 01B6H;
  216.   MLM_QUERYTABSTOP        = 01B7H;
  217.   MLM_SETREADONLY         = 01B8H;
  218.   MLM_QUERYREADONLY       = 01B9H;
  219.  
  220. CONST (* text content manipulation and queries messages *)
  221.   MLM_QUERYCHANGED        = 01BAH;
  222.   MLM_SETCHANGED          = 01BBH;
  223.   MLM_QUERYLINECOUNT      = 01BCH;
  224.   MLM_CHARFROMLINE        = 01BDH;
  225.   MLM_LINEFROMCHAR        = 01BEH;
  226.   MLM_QUERYLINELENGTH     = 01BFH;
  227.   MLM_QUERYTEXTLENGTH     = 01C0H;
  228.  
  229. CONST (* text import and export messages *)
  230.   MLM_FORMAT                = 01C1H;
  231.   MLM_SETIMPORTEXPORT       = 01C2H;
  232.   MLM_IMPORT                = 01C3H;
  233.   MLM_EXPORT                = 01C4H;
  234.   MLM_DELETE                = 01C6H;
  235.   MLM_QUERYFORMATLINELENGTH = 01C7H;
  236.   MLM_QUERYFORMATTEXTLENGTH = 01C8H;
  237.   MLM_INSERT                = 01C9H;
  238.  
  239. CONST (* selection messages *)
  240.   MLM_SETSEL              = 01CAH;
  241.   MLM_QUERYSEL            = 01CBH;
  242.   MLM_QUERYSELTEXT        = 01CCH;
  243.  
  244. CONST (* undo and redo messages *)
  245.   MLM_QUERYUNDO           = 01CDH;
  246.   MLM_UNDO                = 01CEH;
  247.   MLM_RESETUNDO           = 01CFH;
  248.  
  249. CONST (* text attributes messages *)
  250.   MLM_QUERYFONT           = 01D0H;
  251.   MLM_SETFONT             = 01D1H;
  252.   MLM_SETTEXTCOLOR        = 01D2H;
  253.   MLM_QUERYTEXTCOLOR      = 01D3H;
  254.   MLM_SETBACKCOLOR        = 01D4H;
  255.   MLM_QUERYBACKCOLOR      = 01D5H;
  256.  
  257. CONST (* scrolling messages *)
  258.   MLM_QUERYFIRSTCHAR      = 01D6H;
  259.   MLM_SETFIRSTCHAR        = 01D7H;
  260.  
  261. CONST (* clipboard messages *)
  262.   MLM_CUT                 = 01D8H;
  263.   MLM_COPY                = 01D9H;
  264.   MLM_PASTE               = 01DAH;
  265.   MLM_CLEAR               = 01DBH;
  266.  
  267. CONST (* display manipulation messages *)
  268.   MLM_ENABLEREFRESH       = 01DCH;
  269.   MLM_DISABLEREFRESH      = 01DDH;
  270.  
  271. CONST (* search message *)
  272.   MLM_SEARCH              = 01DEH;
  273.   MLM_QUERYIMPORTEXPORT   = 01DFH;
  274.  
  275. CONST (* notification messages *)
  276.   MLN_OVERFLOW            = 0001H;
  277.   MLN_PIXHORZOVERFLOW     = 0002H;
  278.   MLN_PIXVERTOVERFLOW     = 0003H;
  279.   MLN_TEXTOVERFLOW        = 0004H;
  280.   MLN_VSCROLL             = 0005H;
  281.   MLN_HSCROLL             = 0006H;
  282.   MLN_CHANGE              = 0007H;
  283.   MLN_SETFOCUS            = 0008H;
  284.   MLN_KILLFOCUS           = 0009H;
  285.   MLN_MARGIN              = 000AH;
  286.   MLN_SEARCHPAUSE         = 000BH;
  287.   MLN_MEMERROR            = 000CH;
  288.   MLN_UNDOOVERFLOW        = 000DH;
  289.   MLN_CLPBDFAIL           = 000FH;
  290.  
  291. END WINMLE.
  292.