CWINDOW.DEF 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. (* Release 3.10 *)
  2. (*-------------------------------------------------------------------------*
  3. * *
  4. * CWINDOW.DEF - Modula-2 interface to WINDOW.H *
  5. * *
  6. * COPYRIGHT (C) 1989..1992 Clarion Software Corporation. *
  7. * All Rights Reserved *
  8. * *
  9. *--------------------------------------------------------------------------*)
  10. (*# project("#set tsc='on'") *)
  11. (*# project("#set cwindow='jpi'") *)
  12. (*# call(o_a_size=>off, o_a_copy=>off, c_conv=>on, result_optional=>on) *)
  13. (*# module(implementation=>off, init_code=>off) *)
  14. (*# name(prefix=>c) *)
  15. DEFINITION MODULE cwindow;
  16. CONST
  17. TRUE = 1;
  18. FALSE = 0;
  19. SCREENWIDTH = 80;
  20. SCREENDEPTH = 25;
  21. PALETTESIZE = 10;
  22. PALETTEMAX = PALETTESIZE;
  23. SINGLEFRAME = 'ÚÄżłłŔÄŮ';
  24. DOUBLEFRAME = 'ÉÍťşşČÍź';
  25. TYPE
  26. wintype = POINTER TO WDS;
  27. relcoord = CARDINAL;
  28. abscoord = CARDINAL;
  29. Color = (Black,Blue,Green,Cyan,Red,Magenta,Brown,LightGray,
  30. DarkGray,LightBlue,LightGreen,LightCyan,LightRed,LightMagenta,
  31. LightYellow,White);
  32. titlestr = ARRAY[0..SCREENWIDTH-1] OF CHAR;
  33. framestr = ARRAY[0..8] OF CHAR;
  34. windef = RECORD
  35. X1,Y1,X2,Y2: abscoord; (* outer coords of opposite corners *)
  36. ForeGround,BackGround: Color; (* not used if palette *)
  37. CursorOn, (* if cursor active *)
  38. WrapOn, (* if EOL wrap enabled *)
  39. Hidden, (* if window on view *)
  40. FrameOn: BOOLEAN; (* if frame *)
  41. FrameDef: framestr; (* only used if frame *)
  42. FrameFore,FrameBack: Color; (* only used if frame *)
  43. END;
  44. TitleMode = (NoTitle,
  45. LeftUpperTitle,CenterUpperTitle,RightUpperTitle,
  46. LeftLowerTitle,CenterLowerTitle,RightLowerTitle);
  47. VAR
  48. fullscreendef: windef;
  49. _fullscreen: wintype;
  50. PROCEDURE windowopen(VAR WD: windef): wintype;
  51. PROCEDURE settitle(_win: wintype; _NewTitle: ARRAY OF CHAR; _Mode: TitleMode);
  52. PROCEDURE setframe(_win: wintype; _Frame: framestr; _Fore,_Back: Color);
  53. PROCEDURE use(_win: wintype);
  54. PROCEDURE putontop(_win: wintype);
  55. PROCEDURE putbeneath(_win,_WA: wintype);
  56. PROCEDURE hide(_win: wintype);
  57. PROCEDURE change(_win: wintype; _X1,_Y1,_X2,_Y2: abscoord);
  58. PROCEDURE snapshot;
  59. PROCEDURE windowclose(_win: wintype);
  60. PROCEDURE used(): wintype;
  61. PROCEDURE top(): wintype;
  62. PROCEDURE obscuredat(_win: wintype; _X,_Y: relcoord): INTEGER;
  63. PROCEDURE at(_X,_Y: abscoord): wintype;
  64. PROCEDURE gotoxy(_X,_Y: relcoord);
  65. PROCEDURE wherex(): relcoord;
  66. PROCEDURE wherey(): relcoord;
  67. PROCEDURE convertcoords(_win: wintype; _X,_Y: relcoord; VAR XO,YO: abscoord);
  68. PROCEDURE clrscr;
  69. PROCEDURE cursoron;
  70. PROCEDURE cursoroff;
  71. PROCEDURE inline;
  72. PROCEDURE delline;
  73. PROCEDURE clreol;
  74. PROCEDURE textcolor(_c: Color);
  75. PROCEDURE textbackgroun(_c: Color);
  76. PROCEDURE _directwrite(_X,_Y: relcoord; _A: ADDRESS; _len: CARDINAL);
  77. PROCEDURE setwrap(_on: INTEGER);
  78. PROCEDURE info(_win: wintype; VAR _WD: windef);
  79. PROCEDURE _rdbufferln(_win: wintype; _X,_Y: relcoord; _Dest: ADDRESS; _Len: CARDINAL);
  80. PROCEDURE _wrbufferln(_win: wintype; _X,_Y: relcoord; _src: ADDRESS; _Len: CARDINAL);
  81. TYPE
  82. PaletteColorDef = RECORD
  83. Fore,Back: Color;
  84. END;
  85. PaletteDef = ARRAY[0..PALETTEMAX-1] OF PaletteColorDef;
  86. CONST
  87. NORMALPALETTECOLOR = 0;
  88. FRAMEPALETTECOLOR = 1;
  89. PROCEDURE paletteopen(VAR WD: windef; _Pal: PaletteDef): wintype;
  90. PROCEDURE setpalette(_win: wintype; _Pal: PaletteDef);
  91. PROCEDURE palettecolor(): CARDINAL;
  92. PROCEDURE setpalettecolor(_c: CARDINAL);
  93. PROCEDURE palettecolorused(_win: wintype; _pc: CARDINAL): INTEGER;
  94. TYPE
  95. bufferptr = POINTER TO CARDINAL;
  96. WinDescriptor = RECORD
  97. Guard: CARDINAL;
  98. Next,
  99. CursorChain: wintype;
  100. WDef: windef;
  101. XA,YA,XB,YB: abscoord;
  102. OWidth,ODepth: CARDINAL;
  103. Width,Depth: CARDINAL;
  104. Title: ADDRESS;
  105. CurrentX,CurrentY: relcoord;
  106. IsPalette: BOOLEAN;
  107. PalAttr: ARRAY[0..PALETTEMAX-1] OF SHORTCARD;
  108. CurPalColor: CARDINAL;
  109. Buffer: bufferptr;
  110. UserRecord: ADDRESS;
  111. END;
  112. END cwindow.
  113.