orxncurses.cpp
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*/
2 /* */
3 /* Copyright (c) 2010-2014 Rexx Language Association. All rights reserved. */
4 /* */
5 /* This program and the accompanying materials are made available under */
6 /* the terms of the Common Public License v1.0 which accompanies this */
7 /* distribution. A copy is also available at the following address: */
8 /* http://www.oorexx.org/license.html */
9 /* */
10 /* Redistribution and use in source and binary forms, with or */
11 /* without modification, are permitted provided that the following */
12 /* conditions are met: */
13 /* */
14 /* Redistributions of source code must retain the above copyright */
15 /* notice, this list of conditions and the following disclaimer. */
16 /* Redistributions in binary form must reproduce the above copyright */
17 /* notice, this list of conditions and the following disclaimer in */
18 /* the documentation and/or other materials provided with the distribution. */
19 /* */
20 /* Neither the name of Rexx Language Association nor the names */
21 /* of its contributors may be used to endorse or promote products */
22 /* derived from this software without specific prior written permission. */
23 /* */
24 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
25 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
26 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
27 /* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
28 /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
29 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
30 /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
31 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */
32 /* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
33 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
34 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
35 /* */
36 /* Authors; */
37 /* W. David Ashley <dashley@us.ibm.com> */
38 /* */
39 /*----------------------------------------------------------------------------*/
40 
41 
42 #ifdef HAVE_CONFIG_H
43 # include "config.h"
44 #endif
45 
46 #include <oorexxapi.h>
47 #ifdef HAVE_NCURSES_H
48 #include <ncurses.h>
49 #else
50 #include <curses.h>
51 #endif
52 
53 /*----------------------------------------------------------------------------*/
54 /* Global variables */
55 /*----------------------------------------------------------------------------*/
56 
57 
58 /*----------------------------------------------------------------------------*/
59 /* Local Definitions/variables */
60 /*----------------------------------------------------------------------------*/
61 
62 #define VERSTRING(major,minor,rel) #major "." #minor "." #rel
63 
64 bool onebased = true;
65 #define ADDONE(x) (onebased ? x + 1 : x)
66 #define SUBTRACTONE(x) (onebased ? x - 1 : x)
67 
68 /*============================================================================*/
69 /* Private Functions */
70 /*============================================================================*/
71 
72 
73 /*============================================================================*/
74 /* Public Functions */
75 /*============================================================================*/
76 
77 
78 /*============================================================================*/
79 /* Private Methods */
80 /*============================================================================*/
81 
82 
83 /*============================================================================*/
84 /* Public Methods */
85 /*============================================================================*/
86 
87 /**
88  * Method: OrxCurVersion
89  *
90  * Return the OrxnCurses version string.
91  *
92  * @return Zero.
93  **/
94 RexxMethod0(RexxObjectPtr, // Return type
95  OrxCurVersion) // Object_method name
96 {
97 
98  return (RexxObjectPtr)context->NewStringFromAsciiz(VERSTRING(VMAJOR, VMINOR, VREL));
99 }
100 
101 /**
102  * Method: OrxCurSetBase
103  *
104  * Set whether or not the library uses one-based indexes or
105  * zero-based indexes. The default is one-based.
106  *
107  * @param base 1 = one-based, 0 = zero-based
108  *
109  * @return base.
110  **/
111 RexxMethod1(logical_t, // Return type
112  OrxCurSetBase, // Object_method name
113  OPTIONAL_logical_t, base)
114 {
115 
116  if (argumentExists(1)) {
117  onebased = base;
118  }
119  return onebased;
120 }
121 
122 /**
123  * Method: OrxCurInitscr
124  *
125  * Init the standard screen..
126  *
127  * @return Zero.
128  **/
129 RexxMethod0(POINTER, // Return type
130  OrxCurInitscr) // Object_method name
131 {
132 
133  initscr();
134  context->SetObjectVariable("CSELF", context->NewPointer(stdscr));
135  return context->NewPointer(stdscr);
136 }
137 
138 /**
139  * Method: OrxCurNewwin
140  *
141  * Create a new window.
142  *
143  * @param nlines Number of lines.
144  *
145  * @param ncols Number of columns.
146  *
147  * @param begin_y Y position start position.
148  *
149  * @param begin_x X position start position.
150  *
151  * @return Zero.
152  **/
153 RexxMethod4(int, // Return type
154  OrxCurNewwin, // Object_method name
155  int, nlines,
156  int, ncols,
157  int, begin_y,
158  int, begin_x)
159 {
160 
161  context->SetObjectVariable("CSELF", context->NewPointer(newwin(nlines, ncols,
162  SUBTRACTONE(begin_y),
163  SUBTRACTONE(begin_x))));
164  return 0;
165 }
166 
167 /**
168  * Method: OrxCurNewwinfromptr
169  *
170  * Create a new window.
171  *
172  * @param ptr Pointer to the window.
173  *
174  * @return Zero.
175  **/
176 RexxMethod1(RexxObjectPtr, // Return type
177  OrxCurNewwinfromptr, // Object_method name
178  POINTER, ptr)
179 {
180 
181  context->SetObjectVariable("CSELF", context->NewPointer(ptr));
182  return 0;
183 }
184 
185 /**
186  * Method: OrxCurEndwin
187  *
188  * End nCurses formatting.
189  *
190  * @return Zero.
191  **/
192 RexxMethod0(int, // Return type
193  OrxCurEndwin) // Object_method name
194 {
195 
196  return endwin();
197 }
198 
199 /**
200  * Method: OrxCurRefresh
201  *
202  * Refresh the screen and turn nCurses formatting on.
203  *
204  * @return Zero.
205  **/
206 RexxMethod1(int, // Return type
207  OrxCurRefresh, // Object_method name
208  CSELF, cself) // Self
209 {
210 
211  if (cself == NULL) {
212  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
213  context->WholeNumberToObject(1),
214  context->NewStringFromAsciiz("Window"));
215  return 0;
216  }
217  return wrefresh((WINDOW *)cself);
218 }
219 
220 /**
221  * Method: OrxCurAddch
222  *
223  * Add a single character to the screen.
224  *
225  * @param str Character to be added.
226  *
227  * @return Zero.
228  **/
229 RexxMethod2(int, // Return type
230  OrxCurAddch, // Object_method name
231  CSTRING, str, // Character
232  CSELF, cself) // Self
233 {
234 
235  if (cself == NULL) {
236  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
237  context->WholeNumberToObject(1),
238  context->NewStringFromAsciiz("Window"));
239  return 0;
240  }
241  return waddch((WINDOW *)cself, *str);
242 }
243 
244 /**
245  * Method: OrxCurMvaddch
246  *
247  * Add a single character to the screen after moving the cursor.
248  *
249  * @param y Y position.
250  *
251  * @param x X position.
252  *
253  * @param str Character to be added.
254  *
255  * @return Zero.
256  **/
257 RexxMethod4(int, // Return type
258  OrxCurMvaddch, // Object_method name
259  int, y, // Y position
260  int, x, // X position
261  CSTRING, str, // Character
262  CSELF, cself) // Self
263 {
264 
265  if (cself == NULL) {
266  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
267  context->WholeNumberToObject(1),
268  context->NewStringFromAsciiz("Window"));
269  return 0;
270  }
271  return mvwaddch((WINDOW *)cself, SUBTRACTONE(y), SUBTRACTONE(x), *str);
272 }
273 
274 /**
275  * Method: OrxCurAddchstr
276  *
277  * Add a chtype character string to the screen.
278  *
279  * @param str String to be added.
280  *
281  * @return Zero.
282  **/
283 RexxMethod2(int, // Return type
284  OrxCurAddchstr, // Object_method name
285  CSTRING, str, // Character
286  CSELF, cself) // Self
287 {
288 
289  if (cself == NULL) {
290  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
291  context->WholeNumberToObject(1),
292  context->NewStringFromAsciiz("Window"));
293  return 0;
294  }
295  return waddchstr((WINDOW *)cself, (const chtype *)str);
296 }
297 
298 /**
299  * Method: OrxCurMvaddchstr
300  *
301  * Add a chtype character string to the screen after moving the
302  * cursor.
303  *
304  * @param y Y position.
305  *
306  * @param x X position.
307  *
308  * @param str String to be added.
309  *
310  * @return Zero.
311  **/
312 RexxMethod4(int, // Return type
313  OrxCurMvaddchstr, // Object_method name
314  int, y, // Y position
315  int, x, // X position
316  CSTRING, str, // Character
317  CSELF, cself) // Self
318 {
319 
320  if (cself == NULL) {
321  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
322  context->WholeNumberToObject(1),
323  context->NewStringFromAsciiz("Window"));
324  return 0;
325  }
326  return mvwaddchstr((WINDOW *)cself, SUBTRACTONE(y), SUBTRACTONE(x), (const chtype *)str);
327 }
328 
329 /**
330  * Method: OrxCurAddchnstr
331  *
332  * Add a chtype character string to the screen.
333  *
334  * @param str String to be added.
335  *
336  * @param n Number of characters to add.
337  *
338  * @return Zero.
339  **/
340 RexxMethod3(int, // Return type
341  OrxCurAddchnstr, // Object_method name
342  CSTRING, str, // Character
343  int, n, // Number of characters
344  CSELF, cself) // Self
345 {
346 
347  if (cself == NULL) {
348  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
349  context->WholeNumberToObject(1),
350  context->NewStringFromAsciiz("Window"));
351  return 0;
352  }
353  return waddchnstr((WINDOW *)cself, (const chtype *)str, n);
354 }
355 
356 /**
357  * Method: OrxCurMvaddchnstr
358  *
359  * Add a chtype character string to the screen after moving the
360  * cursor.
361  *
362  * @param y Y position.
363  *
364  * @param x X position.
365  *
366  * @param str String to be added.
367  *
368  * @param n Number of characters to add.
369  *
370  * @return Zero.
371  **/
372 RexxMethod5(int, // Return type
373  OrxCurMvaddchnstr, // Object_method name
374  int, y, // Y position
375  int, x, // X position
376  CSTRING, str, // Character
377  int, n, // Number of characters
378  CSELF, cself) // Self
379 {
380 
381  if (cself == NULL) {
382  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
383  context->WholeNumberToObject(1),
384  context->NewStringFromAsciiz("Window"));
385  return 0;
386  }
387  return mvwaddchnstr((WINDOW *)cself, SUBTRACTONE(y), SUBTRACTONE(x), (const chtype *)str, n);
388 }
389 
390 /**
391  * Method: OrxCurAddstr
392  *
393  * Add a character string to the screen.
394  *
395  * @param str String to be added.
396  *
397  * @return Zero.
398  **/
399 RexxMethod2(int, // Return type
400  OrxCurAddstr, // Object_method name
401  CSTRING, str, // Character
402  CSELF, cself) // Self
403 {
404 
405  if (cself == NULL) {
406  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
407  context->WholeNumberToObject(1),
408  context->NewStringFromAsciiz("Window"));
409  return 0;
410  }
411  return waddstr((WINDOW *)cself, str);
412 }
413 
414 /**
415  * Method: OrxCurMvaddstr
416  *
417  * Add a character string to the screen after moving the cursor.
418  *
419  * @param y Y position.
420  *
421  * @param x X position.
422  *
423  * @param str String to be added.
424  *
425  * @return Zero.
426  **/
427 RexxMethod4(int, // Return type
428  OrxCurMvaddstr, // Object_method name
429  int, y, // Y position
430  int, x, // X position
431  CSTRING, str, // Character
432  CSELF, cself) // Self
433 {
434 
435  if (cself == NULL) {
436  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
437  context->WholeNumberToObject(1),
438  context->NewStringFromAsciiz("Window"));
439  return 0;
440  }
441  return mvwaddstr((WINDOW *)cself, SUBTRACTONE(y), SUBTRACTONE(x), str);
442 }
443 
444 /**
445  * Method: OrxCurAddnstr
446  *
447  * Add a character string to the screen.
448  *
449  * @param str String to be added.
450  *
451  * @param n Number of characters to add.
452  *
453  * @return Zero.
454  **/
455 RexxMethod3(int, // Return type
456  OrxCurAddnstr, // Object_method name
457  CSTRING, str, // Character
458  int, n, // Number of characters
459  CSELF, cself) // Self
460 {
461 
462  if (cself == NULL) {
463  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
464  context->WholeNumberToObject(1),
465  context->NewStringFromAsciiz("Window"));
466  return 0;
467  }
468  return waddnstr((WINDOW *)cself, str, n);
469 }
470 
471 /**
472  * Method: OrxCurMvaddnstr
473  *
474  * Add a character string to the screen after moving the cursor.
475  *
476  * @param y Y position.
477  *
478  * @param x X position.
479  *
480  * @param str String to be added.
481  *
482  * @param n Number of characters to add.
483  *
484  * @return Zero.
485  **/
486 RexxMethod5(int, // Return type
487  OrxCurMvaddnstr, // Object_method name
488  int, y, // Y position
489  int, x, // X position
490  CSTRING, str, // Character
491  int, n, // Number of characters
492  CSELF, cself) // Self
493 {
494 
495  if (cself == NULL) {
496  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
497  context->WholeNumberToObject(1),
498  context->NewStringFromAsciiz("Window"));
499  return 0;
500  }
501  return mvwaddnstr((WINDOW *)cself, SUBTRACTONE(y), SUBTRACTONE(x), str, n);
502 }
503 
504 /**
505  * Method: OrxCurAssume_default_colors
506  *
507  * Set default colors.
508  *
509  * @param fg Forground color.
510  *
511  * @param bg Background color.
512  *
513  * @return Zero.
514  **/
515 RexxMethod2(int, // Return type
516  OrxCurAssume_default_colors, // Object_method name
517  int, fg, // fg color
518  int, bg) // bg color
519 {
520 
521  return assume_default_colors(fg, bg);
522 }
523 
524 /**
525  * Method: OrxCurAttroff
526  *
527  * Turn off one or more attributes.
528  *
529  * @param attr Attribute(s).
530  *
531  * @return Zero.
532  **/
533 RexxMethod2(int, // Return type
534  OrxCurAttroff, // Object_method name
535  int, attr, // Attribute(s)
536  CSELF, cself) // Self
537 {
538 
539  if (cself == NULL) {
540  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
541  context->WholeNumberToObject(1),
542  context->NewStringFromAsciiz("Window"));
543  return 0;
544  }
545  return wattroff((WINDOW *)cself, attr);
546 }
547 
548 /**
549  * Method: OrxCurAttron
550  *
551  * Turn on one or more attributes.
552  *
553  * @param attr Attribute(s).
554  *
555  * @return Zero.
556  **/
557 RexxMethod2(int, // Return type
558  OrxCurAttron, // Object_method name
559  int, attr, // Attribute(s)
560  CSELF, cself) // Self
561 {
562 
563  if (cself == NULL) {
564  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
565  context->WholeNumberToObject(1),
566  context->NewStringFromAsciiz("Window"));
567  return 0;
568  }
569  return wattron((WINDOW *)cself, attr);
570 }
571 
572 /**
573  * Method: OrxCurAttrset
574  *
575  * Turn on one or more attributes.
576  *
577  * @param attr Attribute(s).
578  *
579  * @return Zero.
580  **/
581 RexxMethod2(int, // Return type
582  OrxCurAttrset, // Object_method name
583  int, attr, // Attribute(s)
584  CSELF, cself) // Self
585 {
586 
587  if (cself == NULL) {
588  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
589  context->WholeNumberToObject(1),
590  context->NewStringFromAsciiz("Window"));
591  return 0;
592  }
593  return wattrset((WINDOW *)cself, attr);
594 }
595 
596 /**
597  * Method: OrxCurBaudrate
598  *
599  * Return the terminal baud rate.
600  *
601  * @return Zero.
602  **/
603 RexxMethod0(int, // Return type
604  OrxCurBaudrate) // Object_method name
605 {
606 
607  return baudrate();
608 }
609 
610 /**
611  * Method: OrxCurBeep
612  *
613  * Beep the terminal.
614  *
615  * @return Zero.
616  **/
617 RexxMethod0(int, // Return type
618  OrxCurBeep) // Object_method name
619 {
620 
621  return beep();
622 }
623 
624 /**
625  * Method: OrxCurBkgd
626  *
627  * Set backgroung attributes for the whole screen.
628  *
629  * @param attr Attribute(s).
630  *
631  * @return Zero.
632  **/
633 RexxMethod2(int, // Return type
634  OrxCurBkgd, // Object_method name
635  int, attr, // Attribute(s)
636  CSELF, cself) // Self
637 {
638 
639  if (cself == NULL) {
640  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
641  context->WholeNumberToObject(1),
642  context->NewStringFromAsciiz("Window"));
643  return 0;
644  }
645  return wbkgd((WINDOW *)cself, (chtype)attr);
646 }
647 
648 /**
649  * Method: OrxCurBkgdset
650  *
651  * Set backgroung attributes for the next output text.
652  *
653  * @param attr Attribute(s).
654  *
655  * @return Zero.
656  **/
657 RexxMethod2(int, // Return type
658  OrxCurBkgdset, // Object_method name
659  int, attr, // Attribute(s)
660  CSELF, cself) // Self
661 {
662 
663  if (cself == NULL) {
664  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
665  context->WholeNumberToObject(1),
666  context->NewStringFromAsciiz("Window"));
667  return 0;
668  }
669  wbkgdset((WINDOW *)cself, (chtype)attr);
670  return 0;
671 }
672 
673 /**
674  * Method: OrxCurBorder
675  *
676  * Set window border.
677  *
678  * @param ls Left side character.
679  *
680  * @param rs Right side character.
681  *
682  * @param ts Top side character.
683  *
684  * @param bs Bottom side character.
685  *
686  * @param tl Top/Left character.
687  *
688  * @param tr Top/Right character.
689  *
690  * @param bl Bottom/Left character.
691  *
692  * @param br Bottom/Right character.
693  *
694  * @return Zero.
695  **/
696 RexxMethod9(int, // Return type
697  OrxCurBorder, // Object_method name
698  int, ls,
699  int, rs,
700  int, ts,
701  int, bs,
702  int, tl,
703  int, tr,
704  int, bl,
705  int, br,
706  CSELF, cself) // Self
707 {
708 
709  if (cself == NULL) {
710  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
711  context->WholeNumberToObject(1),
712  context->NewStringFromAsciiz("Window"));
713  return 0;
714  }
715  return wborder((WINDOW *)cself, (chtype)ls, (chtype)rs, (chtype)ts, (chtype)bs,
716  (chtype)tl, (chtype)tr, (chtype)bl, (chtype)br);
717 }
718 
719 /**
720  * Method: OrxCurAcs_map
721  *
722  * Return an ACS character.
723  *
724  * @param str Character.
725  *
726  * @return Zero.
727  **/
728 RexxMethod1(int, // Return type
729  OrxCurAcs_map, // Object_method name
730  CSTRING, str)
731 {
732 
733  return (int) NCURSES_ACS(*str);
734 }
735 
736 /**
737  * Method: OrxCurBox
738  *
739  * Draw a box around the edges of a window.
740  *
741  * @param str Vertical character.
742  *
743  * @param str Horizontal character.
744  *
745  * @return Zero.
746  **/
747 RexxMethod3(int, // Return type
748  OrxCurBox, // Object_method name
749  int, verch,
750  int, horch,
751  CSELF, cself) // Self
752 {
753 
754  if (cself == NULL) {
755  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
756  context->WholeNumberToObject(1),
757  context->NewStringFromAsciiz("Window"));
758  return 0;
759  }
760  return box((WINDOW *)cself, (chtype)verch, (chtype)horch);
761 }
762 
763 /**
764  * Method: OrxCurCan_change_color
765  *
766  * Returns whether or not a terminal can changes its color set.
767  *
768  * @return Zero.
769  **/
770 RexxMethod0(int, // Return type
771  OrxCurCan_change_color) // Object_method name
772 {
773 
774  return (int) can_change_color();
775 }
776 
777 /**
778  * Method: OrxCurCbreak
779  *
780  * Activates cbreak (buffering) mode.
781  *
782  * @return Zero.
783  **/
784 RexxMethod0(int, // Return type
785  OrxCurCbreak) // Object_method name
786 {
787 
788  return cbreak();
789 }
790 
791 /**
792  * Method: OrxCurNocbreak
793  *
794  * Deactivates cbreak (buffering) mode.
795  *
796  * @return Zero.
797  **/
798 RexxMethod0(int, // Return type
799  OrxCurNocbreak) // Object_method name
800 {
801 
802  return nocbreak();
803 }
804 
805 /**
806  * Method: OrxCurChgat
807  *
808  * Chage attributes on the window.
809  *
810  * @param n Number of character positions.
811  *
812  * @param attr The attribute.
813  *
814  * @param color The COLOR_PAIR number.
815  *
816  * @return Zero.
817  **/
818 RexxMethod4(int, // Return type
819  OrxCurChgat, // Object_method name
820  int, n,
821  int, attr,
822  int, color,
823  CSELF, cself) // Self
824 {
825 
826  if (cself == NULL) {
827  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
828  context->WholeNumberToObject(1),
829  context->NewStringFromAsciiz("Window"));
830  return 0;
831  }
832  return wchgat((WINDOW *)cself, n, (attr_t)attr, (short)SUBTRACTONE(color), NULL);
833 }
834 
835 /**
836  * Method: OrxCurMvchgat
837  *
838  * Chage attributes on the window after moving the cursor.
839  *
840  * @param y Y start position.
841  *
842  * @param x X start position.
843  *
844  * @param n Number of character positions.
845  *
846  * @param attr The attribute.
847  *
848  * @param color The COLOR_PAIR number.
849  *
850  * @return Zero.
851  **/
852 RexxMethod6(int, // Return type
853  OrxCurMvchgat, // Object_method name
854  int, y,
855  int, x,
856  int, n,
857  int, attr,
858  int, color,
859  CSELF, cself) // Self
860 {
861 
862  if (cself == NULL) {
863  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
864  context->WholeNumberToObject(1),
865  context->NewStringFromAsciiz("Window"));
866  return 0;
867  }
868  return mvwchgat((WINDOW *)cself, SUBTRACTONE(y), SUBTRACTONE(x), n, (attr_t)attr,
869  (short)SUBTRACTONE(color), NULL);
870 }
871 
872 /**
873  * Method: OrxCurClear
874  *
875  * Clear the window.
876  *
877  * @return Zero.
878  **/
879 RexxMethod1(int, // Return type
880  OrxCurClear, // Object_method name
881  CSELF, cself) // Self
882 {
883 
884  if (cself == NULL) {
885  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
886  context->WholeNumberToObject(1),
887  context->NewStringFromAsciiz("Window"));
888  return 0;
889  }
890  return wclear((WINDOW *)cself);
891 }
892 
893 /**
894  * Method: OrxCurClearok
895  *
896  * Force a repaint of the window on the next refresh call.
897  *
898  * @param bf Boolean on/off
899  *
900  * @return Zero.
901  **/
902 RexxMethod2(int, // Return type
903  OrxCurClearok, // Object_method name
904  logical_t, bf,
905  CSELF, cself) // Self
906 {
907 
908  if (cself == NULL) {
909  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
910  context->WholeNumberToObject(1),
911  context->NewStringFromAsciiz("Window"));
912  return 0;
913  }
914  return clearok((WINDOW *)cself, bf);
915 }
916 
917 /**
918  * Method: OrxCurClrtobot
919  *
920  * Clear the window from the current cursor position.
921  *
922  * @return Zero.
923  **/
924 RexxMethod1(int, // Return type
925  OrxCurClrtobot, // Object_method name
926  CSELF, cself) // Self
927 {
928 
929  if (cself == NULL) {
930  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
931  context->WholeNumberToObject(1),
932  context->NewStringFromAsciiz("Window"));
933  return 0;
934  }
935  return wclrtobot((WINDOW *)cself);
936 }
937 
938 /**
939  * Method: OrxCurClrtoeol
940  *
941  * Clear the line from the current cursor position.
942  *
943  * @return Zero.
944  **/
945 RexxMethod1(int, // Return type
946  OrxCurClrtoeol, // Object_method name
947  CSELF, cself) // Self
948 {
949 
950  if (cself == NULL) {
951  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
952  context->WholeNumberToObject(1),
953  context->NewStringFromAsciiz("Window"));
954  return 0;
955  }
956  return wclrtoeol((WINDOW *)cself);
957 }
958 
959 /**
960  * Method: OrxCurColor_set
961  *
962  * Sets foreground and background text color.
963  *
964  * @param num COLOR_PAIR number.
965  *
966  * @return Zero.
967  **/
968 RexxMethod1(int, // Return type
969  OrxCurColor_set, // Object_method name
970  int, num)
971 {
972 
973  // don't use the SUBTRACTONE macro on num!
974  return color_set((short)num, NULL);
975 }
976 
977 /**
978  * Method: OrxCurColors
979  *
980  * Returns the number of possible COLORs.
981  *
982  * @return Zero.
983  **/
984 RexxMethod0(int, // Return type
985  OrxCurColors) // Object_method name
986 {
987 
988  return (int) COLORS;
989 }
990 
991 /**
992  * Method: OrxCurColor_pair
993  *
994  * Returns the number of possible COLOR_PAIR attribute.
995  *
996  * @return Zero.
997  **/
998 RexxMethod1(int, // Return type
999  OrxCurColor_pair, // Object_method name
1000  int, num)
1001 {
1002 
1003  return (int) COLOR_PAIR(num);
1004 }
1005 
1006 /**
1007  * Method: OrxCurColor_pairs
1008  *
1009  * Returns the number of possible COLOR_PAIRS.
1010  *
1011  * @return Zero.
1012  **/
1013 RexxMethod0(int, // Return type
1014  OrxCurColor_pairs) // Object_method name
1015 {
1016 
1017  return (int) COLOR_PAIRS;
1018 }
1019 
1020 /**
1021  * Method: OrxCurCols
1022  *
1023  * Returns the number of columns on the stdscr.
1024  *
1025  * @return Zero.
1026  **/
1027 RexxMethod0(int, // Return type
1028  OrxCurCols) // Object_method name
1029 {
1030 
1031  return (int) COLS;
1032 }
1033 
1034 /**
1035  * Method: OrxCurCopywin
1036  *
1037  * Copy a rectangle from one window to self.
1038  *
1039  * @param swin Source window.
1040  *
1041  * @param sminrow Source min row number.
1042  *
1043  * @param smincol Source min col number.
1044  *
1045  * @param dminrow Destination min row number.
1046  *
1047  * @param dmincol Destination min col number.
1048  *
1049  * @param dmaxrow Destination max row number.
1050  *
1051  * @param dmaxcol Destination max col number.
1052  *
1053  * @param overlay Boolean yes/no to overlay destination text.
1054  *
1055  * @return Zero.
1056  **/
1057 RexxMethod9(int, // Return type
1058  OrxCurCopywin, // Object_method name
1059  RexxObjectPtr, swin,
1060  int, sminrow,
1061  int, smincol,
1062  int, dminrow,
1063  int, dmincol,
1064  int, dmaxrow,
1065  int, dmaxcol,
1066  logical_t, overlay,
1067  CSELF, cself) // Self
1068 {
1069 
1070  if (cself == NULL) {
1071  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
1072  context->WholeNumberToObject(1),
1073  context->NewStringFromAsciiz("Window"));
1074  return 0;
1075  }
1076  return copywin((WINDOW *)context->ObjectToCSelf(swin), (WINDOW *)cself,
1077  SUBTRACTONE(sminrow), SUBTRACTONE(smincol), SUBTRACTONE(dminrow),
1078  SUBTRACTONE(dmincol), SUBTRACTONE(dmaxrow), SUBTRACTONE(dmaxcol),
1079  (int)overlay);
1080 }
1081 
1082 /**
1083  * Method: OrxCurCurs_set
1084  *
1085  * Control the cursor visibility.
1086  *
1087  * @param vis Visibility boolean.
1088  *
1089  * @return Zero.
1090  **/
1091 RexxMethod1(int, // Return type
1092  OrxCurCurs_set, // Object_method name
1093  int, vis)
1094 {
1095 
1096  return curs_set(vis);
1097 }
1098 
1099 /**
1100  * Method: OrxCurCurses_version
1101  *
1102  * Return the nCurses version string.
1103  *
1104  * @return Zero.
1105  **/
1107  OrxCurCurses_version) // Object_method name
1108 {
1109 
1110  return (RexxObjectPtr)context->NewStringFromAsciiz(curses_version());
1111 }
1112 
1113 /**
1114  * Method: OrxCurDelch
1115  *
1116  * Delete the character under the cursor and slide remaining
1117  * characters on the line one position to the left.
1118  *
1119  * @return Zero.
1120  **/
1121 RexxMethod1(int, // Return type
1122  OrxCurDelch, // Object_method name
1123  CSELF, cself) // Self
1124 {
1125 
1126  if (cself == NULL) {
1127  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
1128  context->WholeNumberToObject(1),
1129  context->NewStringFromAsciiz("Window"));
1130  return 0;
1131  }
1132  return wdelch((WINDOW *)cself);
1133 }
1134 
1135 /**
1136  * Method: OrxCurDeleteln
1137  *
1138  * Delete the line under the cursor and slide remaining lines
1139  * below the cursor up one line.
1140  *
1141  * @return Zero.
1142  **/
1143 RexxMethod1(int, // Return type
1144  OrxCurDeleteln, // Object_method name
1145  CSELF, cself) // Self
1146 {
1147 
1148  if (cself == NULL) {
1149  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
1150  context->WholeNumberToObject(1),
1151  context->NewStringFromAsciiz("Window"));
1152  return 0;
1153  }
1154  return wdeleteln((WINDOW *)cself);
1155 }
1156 
1157 /**
1158  * Method: OrxCurDelwin
1159  *
1160  * Destroy a window.
1161  *
1162  * @return Zero.
1163  **/
1164 RexxMethod1(int, // Return type
1165  OrxCurDelwin, // Object_method name
1166  CSELF, cself) // Self
1167 {
1168 
1169  if (cself == NULL) {
1170  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
1171  context->WholeNumberToObject(1),
1172  context->NewStringFromAsciiz("Window"));
1173  return 0;
1174  }
1175  int retc = delwin((WINDOW *)cself);
1176  if (retc == OK) {
1177  context->SetObjectVariable("CSELF", context->NewPointer(NULL));
1178  }
1179  return retc;
1180 }
1181 
1182 /**
1183  * Method: OrxCurDerwinprivate
1184  *
1185  * Create a derrived window.
1186  *
1187  * @param nlines Number of lines.
1188  *
1189  * @param ncols Number of cols.
1190  *
1191  * @param begy Beginning Y line.
1192  *
1193  * @param begx Beginning X column.
1194  *
1195  * @return Zero.
1196  **/
1198  OrxCurDerwinprivate, // Object_method name
1199  int, nlines,
1200  int, ncols,
1201  int, begy,
1202  int, begx,
1203  CSELF, cself) // Self
1204 {
1205 
1206  WINDOW *ptr = derwin((WINDOW *)cself, nlines, ncols, SUBTRACTONE(begy), SUBTRACTONE(begx));
1207  return (RexxObjectPtr)context->NewPointer(ptr);
1208 }
1209 
1210 /**
1211  * Method: OrxCurDupwinprivate
1212  *
1213  * Duplicate a window.
1214  *
1215  * @return Zero.
1216  **/
1218  OrxCurDupwinprivate, // Object_method name
1219  CSELF, cself) // Self
1220 {
1221 
1222  if (cself == NULL) {
1223  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
1224  context->WholeNumberToObject(1),
1225  context->NewStringFromAsciiz("Window"));
1226  return 0;
1227  }
1228  WINDOW *newwin = dupwin((WINDOW *)cself);
1229  return (RexxObjectPtr)context->NewPointer(newwin);
1230 }
1231 
1232 /**
1233  * Method: OrxCurDoupdate
1234  *
1235  * Update the terminal.
1236  *
1237  * @return Zero.
1238  **/
1239 RexxMethod0(int, // Return type
1240  OrxCurDoupdate) // Object_method name
1241 {
1242 
1243  return doupdate();
1244 }
1245 
1246 /**
1247  * Method: OrxCurEcho
1248  *
1249  * Turn on echo.
1250  *
1251  * @return Zero.
1252  **/
1253 RexxMethod0(int, // Return type
1254  OrxCurEcho) // Object_method name
1255 {
1256 
1257  return echo();
1258 }
1259 
1260 /**
1261  * Method: OrxCurNoecho
1262  *
1263  * Turn off echo.
1264  *
1265  * @return Zero.
1266  **/
1267 RexxMethod0(int, // Return type
1268  OrxCurNoecho) // Object_method name
1269 {
1270 
1271  return noecho();
1272 }
1273 
1274 /**
1275  * Method: OrxCurEchochar
1276  *
1277  * Echo one character.
1278  *
1279  * @return Zero.
1280  **/
1281 RexxMethod2(int, // Return type
1282  OrxCurEchochar, // Object_method name
1283  int, ch,
1284  CSELF, cself) // Self
1285 {
1286 
1287  if (cself == NULL) {
1288  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
1289  context->WholeNumberToObject(1),
1290  context->NewStringFromAsciiz("Window"));
1291  return 0;
1292  }
1293  return wechochar((WINDOW *)cself, (chtype)ch);
1294 }
1295 
1296 /**
1297  * Method: OrxCurErase
1298  *
1299  * Erase the window.
1300  *
1301  * @return Zero.
1302  **/
1303 RexxMethod1(int, // Return type
1304  OrxCurErase, // Object_method name
1305  CSELF, cself) // Self
1306 {
1307 
1308  if (cself == NULL) {
1309  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
1310  context->WholeNumberToObject(1),
1311  context->NewStringFromAsciiz("Window"));
1312  return 0;
1313  }
1314  return werase((WINDOW *)cself);
1315 }
1316 
1317 /**
1318  * Method: OrxCurErasechar
1319  *
1320  * Return the terminal's erase char.
1321  *
1322  * @return Zero.
1323  **/
1325  OrxCurErasechar) // Object_method name
1326 {
1327  char er[2] = {'\0', '\0'};
1328 
1329  er[0] = erasechar();
1330  return (RexxObjectPtr)context->NewStringFromAsciiz(er);
1331 }
1332 
1333 /**
1334  * Method: OrxCurFilter
1335  *
1336  * Restrict output to a single line.
1337  *
1338  * @return Zero.
1339  **/
1340 RexxMethod0(int, // Return type
1341  OrxCurFilter) // Object_method name
1342 {
1343 
1344  filter();
1345  return 0;
1346 }
1347 
1348 /**
1349  * Method: OrxCurFlash
1350  *
1351  * Briefly flash the screen.
1352  *
1353  * @return Zero.
1354  **/
1355 RexxMethod0(int, // Return type
1356  OrxCurFlash) // Object_method name
1357 {
1358 
1359  return flash();
1360 }
1361 
1362 /**
1363  * Method: OrxCurFlushinp
1364  *
1365  * Flush the input queue.
1366  *
1367  * @return Zero.
1368  **/
1369 RexxMethod0(int, // Return type
1370  OrxCurFlushinp) // Object_method name
1371 {
1372 
1373  return flushinp();
1374 }
1375 
1376 /**
1377  * Method: OrxCurGetbegyx
1378  *
1379  * Get the y & x screen coordinate for the top left corner of
1380  * the window.
1381  *
1382  * @return Zero.
1383  **/
1385  OrxCurGetbegyx, // Object_method name
1386  CSELF, cself) // Self
1387 {
1388  char buf[32];
1389  int y, x;
1390 
1391  if (cself == NULL) {
1392  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
1393  context->WholeNumberToObject(1),
1394  context->NewStringFromAsciiz("Window"));
1395  return 0;
1396  }
1397  getbegyx((WINDOW *)cself, y, x);
1398  sprintf(buf, "%d %d", ADDONE(y), ADDONE(x));
1399  return (RexxObjectPtr)context->NewStringFromAsciiz(buf);
1400 }
1401 
1402 /**
1403  * Method: OrxCurGetbkgd
1404  *
1405  * Get the background attribute for the the window.
1406  *
1407  * @return Zero.
1408  **/
1409 RexxMethod1(int, // Return type
1410  OrxCurGetbkgd, // Object_method name
1411  CSELF, cself) // Self
1412 {
1413 
1414  if (cself == NULL) {
1415  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
1416  context->WholeNumberToObject(1),
1417  context->NewStringFromAsciiz("Window"));
1418  return 0;
1419  }
1420  return getbkgd((WINDOW *)cself);
1421 }
1422 
1423 /**
1424  * Method: OrxCurGetch
1425  *
1426  * Get character from the keyboard.
1427  *
1428  * @return Zero.
1429  **/
1431  OrxCurGetch, // Object_method name
1432  CSELF, cself) // Self
1433 {
1434  char buf[2] = {'\0', '\0'};
1435  int retc;
1436 
1437  if (cself == NULL) {
1438  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
1439  context->WholeNumberToObject(1),
1440  context->NewStringFromAsciiz("Window"));
1441  return 0;
1442  }
1443  retc = wgetch((WINDOW *)cself);
1444  if (retc < 0 || retc > 255) { // return ERR and key codes as numeric strings
1445  return (RexxObjectPtr)context->Int32ToObject(retc);
1446  }
1447  buf[0] = (char)retc;
1448  return (RexxObjectPtr)context->NewStringFromAsciiz(buf);
1449 }
1450 
1451 /**
1452  * Method: OrxCurMvgetch
1453  *
1454  * Get character from the keyboard after moving the cursor.
1455  *
1456  * @return Zero.
1457  **/
1459  OrxCurMvgetch, // Object_method name
1460  int, y,
1461  int, x,
1462  CSELF, cself) // Self
1463 {
1464  char buf[2] = {'\0', '\0'};
1465  int retc;
1466 
1467  if (cself == NULL) {
1468  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
1469  context->WholeNumberToObject(1),
1470  context->NewStringFromAsciiz("Window"));
1471  return 0;
1472  }
1473  retc = mvwgetch((WINDOW *)cself, SUBTRACTONE(y), SUBTRACTONE(x));
1474  if (retc < 0 || retc > 255) { // return ERR and key codes as numeric strings
1475  return (RexxObjectPtr)context->Int32ToObject(retc);
1476  }
1477  buf[0] = (char)retc;
1478  return (RexxObjectPtr)context->NewStringFromAsciiz(buf);
1479 }
1480 
1481 /**
1482  * Method: OrxCurGetmaxyx
1483  *
1484  * Get the width and height of a window.
1485  *
1486  * @return Zero.
1487  **/
1489  OrxCurGetmaxyx, // Object_method name
1490  CSELF, cself) // Self
1491 {
1492  char buf[32];
1493  int y, x;
1494 
1495  if (cself == NULL) {
1496  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
1497  context->WholeNumberToObject(1),
1498  context->NewStringFromAsciiz("Window"));
1499  return 0;
1500  }
1501  getmaxyx((WINDOW *)cself, y, x);
1502  sprintf(buf, "%d %d", y, x);
1503  return (RexxObjectPtr)context->NewStringFromAsciiz(buf);
1504 }
1505 
1506 /**
1507  * Method: OrxCurGetparyx
1508  *
1509  * Get the width and height of a window relative to the parent
1510  * window.
1511  *
1512  * @return Zero.
1513  **/
1515  OrxCurGetparyx, // Object_method name
1516  CSELF, cself) // Self
1517 {
1518  char buf[32];
1519  int y, x;
1520 
1521  if (cself == NULL) {
1522  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
1523  context->WholeNumberToObject(1),
1524  context->NewStringFromAsciiz("Window"));
1525  return 0;
1526  }
1527  getparyx((WINDOW *)cself, y, x);
1528  sprintf(buf, "%d %d", ADDONE(y), ADDONE(x));
1529  return (RexxObjectPtr)context->NewStringFromAsciiz(buf);
1530 }
1531 
1532 /**
1533  * Method: OrxCurGetmouseprivate
1534  *
1535  * Get a mouse event.
1536  *
1537  * @param ev Mouse event object.
1538  *
1539  * @return Zero.
1540  **/
1541 RexxMethod2(int, // Return type
1542  OrxCurGetmouseprivate, // Object_method name
1543  RexxObjectPtr, ev,
1544  CSELF, cself) // Self
1545 {
1546  MEVENT mevent;
1547 
1548  if (cself == NULL) {
1549  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
1550  context->WholeNumberToObject(1),
1551  context->NewStringFromAsciiz("Window"));
1552  return 0;
1553  }
1554  int retc = getmouse(&mevent);
1555  context->SendMessage1(ev, "id=", context->Int32ToObject((int32_t)mevent.id));
1556  context->SendMessage1(ev, "x=", context->Int32ToObject(ADDONE(mevent.x)));
1557  context->SendMessage1(ev, "y=", context->Int32ToObject(ADDONE(mevent.y)));
1558  context->SendMessage1(ev, "z=", context->Int32ToObject(ADDONE(mevent.z)));
1559  context->SendMessage1(ev, "bstate=", context->UnsignedInt32ToObject(mevent.bstate));
1560  return retc;
1561 }
1562 
1563 /**
1564  * Method: OrxCurGetstr
1565  *
1566  * Get a string from the terminal.
1567  *
1568  * @return Zero.
1569  **/
1571  OrxCurGetstr, // Object_method name
1572  CSELF, cself) // Self
1573 {
1574  char buf[1024];
1575 
1576  if (cself == NULL) {
1577  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
1578  context->WholeNumberToObject(1),
1579  context->NewStringFromAsciiz("Window"));
1580  return 0;
1581  }
1582  wgetnstr((WINDOW *)cself, buf, sizeof(buf) - 1);
1583  return context->NewStringFromAsciiz(buf);
1584 }
1585 
1586 /**
1587  * Method: OrxCurGetnstr
1588  *
1589  * Get a string from the terminal.
1590  *
1591  * @param n Number of characters to get.
1592  *
1593  * @return Zero.
1594  **/
1596  OrxCurGetnstr, // Object_method name
1597  int, n,
1598  CSELF, cself) // Self
1599 {
1600 
1601  if (cself == NULL) {
1602  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
1603  context->WholeNumberToObject(1),
1604  context->NewStringFromAsciiz("Window"));
1605  return 0;
1606  }
1607  char *buf = (char *)malloc(n + 1);
1608  wgetnstr((WINDOW *)cself, buf, n);
1609  RexxObjectPtr tmp = context->NewStringFromAsciiz(buf);
1610  free(buf);
1611  return tmp;
1612 }
1613 
1614 /**
1615  * Method: OrxCurMvgetstr
1616  *
1617  * Get a string from the terminal after moving the cursor.
1618  *
1619  * @param y New Y positions for the cursor.
1620  *
1621  * @param x New X positions for the cursor.
1622  *
1623  * @return Zero.
1624  **/
1626  OrxCurMvgetstr, // Object_method name
1627  int, y,
1628  int, x,
1629  CSELF, cself) // Self
1630 {
1631  char buf[1024];
1632 
1633  if (cself == NULL) {
1634  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
1635  context->WholeNumberToObject(1),
1636  context->NewStringFromAsciiz("Window"));
1637  return 0;
1638  }
1639  mvwgetnstr((WINDOW *)cself, SUBTRACTONE(y), SUBTRACTONE(x), buf, 1024);
1640  return context->NewStringFromAsciiz(buf);
1641 }
1642 
1643 /**
1644  * Method: OrxCurGetnstr
1645  *
1646  * Get a string from the terminal after moving the cursor.
1647  *
1648  * @param y New Y positions for the cursor.
1649  *
1650  * @param x New X positions for the cursor.
1651  *
1652  * @param n Number of characters to get.
1653  *
1654  * @return Zero.
1655  **/
1657  OrxCurMvgetnstr, // Object_method name
1658  int, y,
1659  int, x,
1660  int, n,
1661  CSELF, cself) // Self
1662 {
1663 
1664  if (cself == NULL) {
1665  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
1666  context->WholeNumberToObject(1),
1667  context->NewStringFromAsciiz("Window"));
1668  return 0;
1669  }
1670  char *buf = (char *)malloc(n + 1);
1671  mvwgetnstr((WINDOW *)cself, SUBTRACTONE(y), SUBTRACTONE(x), buf, n);
1672  RexxObjectPtr tmp = context->NewStringFromAsciiz(buf);
1673  free(buf);
1674  return tmp;
1675 }
1676 
1677 /**
1678  * Method: OrxCurGetwinprivate
1679  *
1680  * Create a new window from a file.
1681  *
1682  * @param filename File name containing the window information.
1683  *
1684  * @return Zero.
1685  **/
1687  OrxCurGetwinprivate, // Object_method name
1688  CSTRING, filename)
1689 {
1690  FILE *wfile;
1691  WINDOW *win;
1692 
1693  wfile = fopen(filename, "r");
1694  win = getwin(wfile);
1695  fclose(wfile);
1696  return (RexxObjectPtr)context->NewPointer(win);
1697 }
1698 
1699 /**
1700  * Method: OrxCurGetyx
1701  *
1702  * Get the cursor location from a window.
1703  *
1704  * @return Zero.
1705  **/
1707  OrxCurGetyx, // Object_method name
1708  CSELF, cself) // Self
1709 {
1710  char buf[32];
1711  int y, x;
1712 
1713  if (cself == NULL) {
1714  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
1715  context->WholeNumberToObject(1),
1716  context->NewStringFromAsciiz("Window"));
1717  return 0;
1718  }
1719  getyx((WINDOW *)cself, y, x);
1720  sprintf(buf, "%d %d", ADDONE(y), ADDONE(x));
1721  return (RexxObjectPtr)context->NewStringFromAsciiz(buf);
1722 }
1723 
1724 /**
1725  * Method: OrxCurHalfdelay
1726  *
1727  * Simalar to the cbreak method.
1728  *
1729  * @param tenths Tenths of a second.
1730  *
1731  * @return Zero.
1732  **/
1733 RexxMethod1(int, // Return type
1734  OrxCurHalfdelay, // Object_method name
1735  int, tenths)
1736 {
1737 
1738  return halfdelay(tenths);
1739 }
1740 
1741 /**
1742  * Method: OrxCurHas_colors
1743  *
1744  * Determine if the terminal has color support.
1745  *
1746  * @return Zero.
1747  **/
1748 RexxMethod0(logical_t, // Return type
1749  OrxCurHas_colors) // Object_method name
1750 {
1751 
1752  return has_colors();
1753 }
1754 
1755 /**
1756  * Method: OrxCurHas_ic
1757  *
1758  * Determine if the terminal has insert character support.
1759  *
1760  * @return Zero.
1761  **/
1762 RexxMethod0(logical_t, // Return type
1763  OrxCurHas_ic) // Object_method name
1764 {
1765 
1766  return has_ic();
1767 }
1768 
1769 /**
1770  * Method: OrxCurHas_il
1771  *
1772  * Determine if the terminal has insert line support.
1773  *
1774  * @return Zero.
1775  **/
1776 RexxMethod0(logical_t, // Return type
1777  OrxCurHas_il) // Object_method name
1778 {
1779 
1780  return has_il();
1781 }
1782 
1783 /**
1784  * Method: OrxCurHline
1785  *
1786  * Draw a horizontal line.
1787  *
1788  * @param ch Character type (chtype)
1789  *
1790  * @param n Number of characters to draw.
1791  *
1792  * @return Zero.
1793  **/
1794 RexxMethod2(int, // Return type
1795  OrxCurHline, // Object_method name
1796  int, ch,
1797  int, n)
1798 {
1799 
1800  return hline((chtype)ch, n);
1801 }
1802 
1803 /**
1804  * Method: OrxCurMvhline
1805  *
1806  * Draw a horizontal line.
1807  *
1808  * @param y New Y cursor position
1809  *
1810  * @param x New C cursor position
1811  *
1812  * @param ch Character type (chtype)
1813  *
1814  * @param n Number of characters to draw.
1815  *
1816  * @return Zero.
1817  **/
1818 RexxMethod4(int, // Return type
1819  OrxCurMvhline, // Object_method name
1820  int, y,
1821  int, x,
1822  int, ch,
1823  int, n)
1824 {
1825 
1826  return mvhline(SUBTRACTONE(y), SUBTRACTONE(x), (chtype)ch, n);
1827 }
1828 
1829 /**
1830  * Method: OrxCurIdcok
1831  *
1832  * Use hardware to insert/delete characters.
1833  *
1834  * @param bf Boolean on/off.
1835  *
1836  * @return Zero.
1837  **/
1838 RexxMethod2(int, // Return type
1839  OrxCurIdcok, // Object_method name
1840  logical_t, bf,
1841  CSELF, cself) // Self
1842 {
1843 
1844  idcok((WINDOW *)cself, bf);
1845  return 0;
1846 }
1847 
1848 /**
1849  * Method: OrxCurIdlok
1850  *
1851  * Use hardware to insert/delete lines.
1852  *
1853  * @param bf Boolean on/off.
1854  *
1855  * @return Zero.
1856  **/
1857 RexxMethod2(int, // Return type
1858  OrxCurIdlok, // Object_method name
1859  logical_t, bf,
1860  CSELF, cself) // Self
1861 {
1862 
1863  idlok((WINDOW *)cself, bf);
1864  return 0;
1865 }
1866 
1867 /**
1868  * Method: OrxCurImmedok
1869  *
1870  * Use hardware to provide auto refresh.
1871  *
1872  * @param bf Boolean on/off.
1873  *
1874  * @return Zero.
1875  **/
1876 RexxMethod2(int, // Return type
1877  OrxCurImmedok, // Object_method name
1878  logical_t, bf,
1879  CSELF, cself) // Self
1880 {
1881 
1882  immedok((WINDOW *)cself, bf);
1883  return 0;
1884 }
1885 
1886 /**
1887  * Method: OrxCurInch
1888  *
1889  * Return the attr/char under the cursor.
1890  *
1891  * @return Zero.
1892  **/
1893 RexxMethod1(int, // Return type
1894  OrxCurInch, // Object_method name
1895  CSELF, cself) // Self
1896 {
1897 
1898  return (int)winch((WINDOW *)cself);
1899 }
1900 
1901 /**
1902  * Method: OrxCurMvinch
1903  *
1904  * Return the attr/char under the cursor after moving the
1905  * cursor.
1906  *
1907  * @param y New cursor y position.
1908  *
1909  * @param x New cursor x position.
1910  *
1911  * @return Zero.
1912  **/
1913 RexxMethod3(int, // Return type
1914  OrxCurMvinch, // Object_method name
1915  int, y,
1916  int, x,
1917  CSELF, cself) // Self
1918 {
1919 
1920  if (cself == NULL) {
1921  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
1922  context->WholeNumberToObject(1),
1923  context->NewStringFromAsciiz("Window"));
1924  return 0;
1925  }
1926  return (int)mvwinch((WINDOW *)cself, SUBTRACTONE(y), SUBTRACTONE(x));
1927 }
1928 
1929 /**
1930  * Method: OrxCurInchstr
1931  *
1932  * Return the attr/char array.
1933  *
1934  * @return Zero.
1935  **/
1937  OrxCurInchstr, // Object_method name
1938  CSELF, cself) // Self
1939 {
1940  chtype *buf;
1941  RexxBufferStringObject rxbuf;
1942 
1943  if (cself == NULL) {
1944  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
1945  context->WholeNumberToObject(1),
1946  context->NewStringFromAsciiz("Window"));
1947  return 0;
1948  }
1949  rxbuf = context->NewBufferString(1024 * sizeof(chtype));
1950  buf = (chtype *)context->BufferStringData(rxbuf);
1951  winchnstr((WINDOW *)cself, buf, 1024);
1952  return (RexxObjectPtr)rxbuf;
1953 }
1954 
1955 /**
1956  * Method: OrxCurMvinchstr
1957  *
1958  * Return the attr/char under the cursor after moving the
1959  * cursor.
1960  *
1961  * @param y New cursor y position.
1962  *
1963  * @param x New cursor x position.
1964  *
1965  * @return Zero.
1966  **/
1968  OrxCurMvinchstr, // Object_method name
1969  int, y,
1970  int, x,
1971  CSELF, cself) // Self
1972 {
1973  chtype *buf;
1974  RexxBufferStringObject rxbuf;
1975 
1976  if (cself == NULL) {
1977  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
1978  context->WholeNumberToObject(1),
1979  context->NewStringFromAsciiz("Window"));
1980  return 0;
1981  }
1982  rxbuf = context->NewBufferString(1024 * sizeof(chtype));
1983  buf = (chtype *)context->BufferStringData(rxbuf);
1984  mvwinchnstr((WINDOW *)cself, SUBTRACTONE(y), SUBTRACTONE(x), buf, 1024);
1985  return (RexxObjectPtr)rxbuf;
1986 }
1987 
1988 /**
1989  * Method: OrxCurInchnstr
1990  *
1991  * Return the attr/char array.
1992  *
1993  * @param n Number of attr/char to return.
1994  *
1995  * @return Zero.
1996  **/
1998  OrxCurInchnstr, // Object_method name
1999  int, n,
2000  CSELF, cself) // Self
2001 {
2002  chtype *buf;
2003  RexxBufferStringObject rxbuf;
2004 
2005  if (cself == NULL) {
2006  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2007  context->WholeNumberToObject(1),
2008  context->NewStringFromAsciiz("Window"));
2009  return 0;
2010  }
2011  rxbuf = context->NewBufferString(n * sizeof(chtype));
2012  buf = (chtype *)context->BufferStringData(rxbuf);
2013  winchnstr((WINDOW *)cself, buf, n);
2014  return (RexxObjectPtr)rxbuf;
2015 }
2016 
2017 /**
2018  * Method: OrxCurMvinchnstr
2019  *
2020  * Return the attr/char under the cursor after moving the
2021  * cursor.
2022  *
2023  * @param y New cursor y position.
2024  *
2025  * @param x New cursor x position.
2026  *
2027  * @param n Number of attr/char to return.
2028  *
2029  * @return Zero.
2030  **/
2032  OrxCurMvinchnstr, // Object_method name
2033  int, y,
2034  int, x,
2035  int, n,
2036  CSELF, cself) // Self
2037 {
2038  chtype *buf;
2039  RexxBufferStringObject rxbuf;
2040 
2041  if (cself == NULL) {
2042  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2043  context->WholeNumberToObject(1),
2044  context->NewStringFromAsciiz("Window"));
2045  return 0;
2046  }
2047  rxbuf = context->NewBufferString(n * sizeof(chtype));
2048  buf = (chtype *)context->BufferStringData(rxbuf);
2049  mvwinchnstr((WINDOW *)cself, SUBTRACTONE(y), SUBTRACTONE(x), buf, n);
2050  return (RexxObjectPtr)rxbuf;
2051 }
2052 
2053 /**
2054  * Method: OrxCurInit_color
2055  *
2056  * Allow the user to redefine colors.
2057  *
2058  * @param c Color number to change.
2059  *
2060  * @param r Red value.
2061  *
2062  * @param g Green value.
2063  *
2064  * @param b Blue value.
2065  *
2066  * @return Zero.
2067  **/
2068 RexxMethod4(int, // Return type
2069  OrxCurInit_color, // Object_method name
2070  int, c,
2071  int, r,
2072  int, g,
2073  int, b)
2074 {
2075 
2076  return init_color((short)c, (short)r, (short)g, (short)b);
2077 }
2078 
2079 /**
2080  * Method: OrxCurInit_pair
2081  *
2082  * Assign foreground an background colors to a color pair.
2083  *
2084  * @param c COLOR_PAIR number to change.
2085  *
2086  * @param f Foreground color.
2087  *
2088  * @param b Background color.
2089  *
2090  * @return Zero.
2091  **/
2092 RexxMethod3(int, // Return type
2093  OrxCurInit_pair, // Object_method name
2094  int, c,
2095  int, f,
2096  int, b)
2097 {
2098 
2099  return init_pair((short)c, (short)f, (short)b);
2100 }
2101 
2102 /**
2103  * Method: OrxCurInsch
2104  *
2105  * Insert attr/char under the cursor.
2106  *
2107  * @param ch chtype to be inserted.
2108  *
2109  * @return Zero.
2110  **/
2111 RexxMethod2(int, // Return type
2112  OrxCurInsch, // Object_method name
2113  CSTRING, ch,
2114  CSELF, cself) // Self
2115 {
2116 
2117  if (cself == NULL) {
2118  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2119  context->WholeNumberToObject(1),
2120  context->NewStringFromAsciiz("Window"));
2121  return 0;
2122  }
2123  return (int)winsch((WINDOW *)cself, (chtype)*ch);
2124 }
2125 
2126 /**
2127  * Method: OrxCurMvinsch
2128  *
2129  * Insert the attr/char under the cursor after moving the
2130  * cursor.
2131  *
2132  * @param y New cursor y position.
2133  *
2134  * @param x New cursor x position.
2135  *
2136  * @param ch chtype to be inserted.
2137  *
2138  * @return Zero.
2139  **/
2140 RexxMethod4(int, // Return type
2141  OrxCurMvinsch, // Object_method name
2142  int, y,
2143  int, x,
2144  CSTRING, ch,
2145  CSELF, cself) // Self
2146 {
2147 
2148  if (cself == NULL) {
2149  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2150  context->WholeNumberToObject(1),
2151  context->NewStringFromAsciiz("Window"));
2152  return 0;
2153  }
2154  return mvwinsch((WINDOW *)cself, SUBTRACTONE(y), SUBTRACTONE(x), (chtype)*ch);
2155 }
2156 
2157 /**
2158  * Method: OrxCurInsdelln
2159  *
2160  * Insert/delete lines.
2161  *
2162  * @param n Number of lines to insert/delete.
2163  *
2164  * @return Zero.
2165  **/
2166 RexxMethod2(int, // Return type
2167  OrxCurInsdelln, // Object_method name
2168  int, n,
2169  CSELF, cself) // Self
2170 {
2171 
2172  if (cself == NULL) {
2173  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2174  context->WholeNumberToObject(1),
2175  context->NewStringFromAsciiz("Window"));
2176  return 0;
2177  }
2178  return winsdelln((WINDOW *)cself, SUBTRACTONE(n));
2179 }
2180 
2181 /**
2182  * Method: OrxCurInsertln
2183  *
2184  * Insert one line.
2185  *
2186  * @return Zero.
2187  **/
2188 RexxMethod1(int, // Return type
2189  OrxCurInsertln, // Object_method name
2190  CSELF, cself) // Self
2191 {
2192 
2193  if (cself == NULL) {
2194  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2195  context->WholeNumberToObject(1),
2196  context->NewStringFromAsciiz("Window"));
2197  return 0;
2198  }
2199  return winsertln((WINDOW *)cself);
2200 }
2201 
2202 /**
2203  * Method: OrxCurInsstr
2204  *
2205  * Insert a string.
2206  *
2207  * @param str String to insert.
2208  *
2209  * @return Zero.
2210  **/
2211 RexxMethod2(int, // Return type
2212  OrxCurInsstr, // Object_method name
2213  CSTRING, str,
2214  CSELF, cself) // Self
2215 {
2216 
2217  if (cself == NULL) {
2218  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2219  context->WholeNumberToObject(1),
2220  context->NewStringFromAsciiz("Window"));
2221  return 0;
2222  }
2223  return winsstr((WINDOW *)cself, str);
2224 }
2225 
2226 /**
2227  * Method: OrxCurInsnstr
2228  *
2229  * Insert a string.
2230  *
2231  * @param str String to insert.
2232  *
2233  * @param n Number of characters to insert.
2234  *
2235  * @return Zero.
2236  **/
2237 RexxMethod3(int, // Return type
2238  OrxCurInsnstr, // Object_method name
2239  CSTRING, str,
2240  int, n,
2241  CSELF, cself) // Self
2242 {
2243 
2244  if (cself == NULL) {
2245  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2246  context->WholeNumberToObject(1),
2247  context->NewStringFromAsciiz("Window"));
2248  return 0;
2249  }
2250  return winsnstr((WINDOW *)cself, str, n);
2251 }
2252 
2253 /**
2254  * Method: OrxCurMvinsstr
2255  *
2256  * Insert a string after moving the cursor.
2257  *
2258  * @param y New cursor y position.
2259  *
2260  * @param x New cursor x position.
2261  *
2262  * @param str String to insert.
2263  *
2264  * @return Zero.
2265  **/
2266 RexxMethod4(int, // Return type
2267  OrxCurMvinsstr, // Object_method name
2268  int, y,
2269  int, x,
2270  CSTRING, str,
2271  CSELF, cself) // Self
2272 {
2273 
2274  if (cself == NULL) {
2275  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2276  context->WholeNumberToObject(1),
2277  context->NewStringFromAsciiz("Window"));
2278  return 0;
2279  }
2280  return mvwinsstr((WINDOW *)cself, SUBTRACTONE(y), SUBTRACTONE(x), str);
2281 }
2282 
2283 /**
2284  * Method: OrxCurInsnstr
2285  *
2286  * Insert a string.
2287  *
2288  * @param y New cursor y position.
2289  *
2290  * @param x New cursor x position.
2291  *
2292  * @param str String to insert.
2293  *
2294  * @param n Number of characters to insert.
2295  *
2296  * @return Zero.
2297  **/
2298 RexxMethod5(int, // Return type
2299  OrxCurMvinsnstr, // Object_method name
2300  int, y,
2301  int, x,
2302  CSTRING, str,
2303  int, n,
2304  CSELF, cself) // Self
2305 {
2306 
2307  if (cself == NULL) {
2308  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2309  context->WholeNumberToObject(1),
2310  context->NewStringFromAsciiz("Window"));
2311  return 0;
2312  }
2313  return mvwinsnstr((WINDOW *)cself, SUBTRACTONE(y), SUBTRACTONE(x), str, n);
2314 }
2315 
2316 /**
2317  * Method: OrxCurInstr
2318  *
2319  * Read a string from the terminal.
2320  *
2321  * @return Zero.
2322  **/
2324  OrxCurInstr, // Object_method name
2325  CSELF, cself) // Self
2326 {
2327  char buf[1024];
2328 
2329  if (cself == NULL) {
2330  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2331  context->WholeNumberToObject(1),
2332  context->NewStringFromAsciiz("Window"));
2333  return 0;
2334  }
2335  winstr((WINDOW *)cself, buf);
2336  return context->NewStringFromAsciiz(buf);
2337 }
2338 
2339 /**
2340  * Method: OrxCurInnstr
2341  *
2342  * Read a string from the terminal.
2343  *
2344  * @param n Number of characters to read.
2345  *
2346  * @return Zero.
2347  **/
2349  OrxCurInnstr, // Object_method name
2350  int, n,
2351  CSELF, cself) // Self
2352 {
2353 
2354  if (cself == NULL) {
2355  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2356  context->WholeNumberToObject(1),
2357  context->NewStringFromAsciiz("Window"));
2358  return 0;
2359  }
2360  char *buf = (char *)malloc(n + 1);
2361  winnstr((WINDOW *)cself, buf, n);
2362  RexxObjectPtr tmp = context->NewStringFromAsciiz(buf);
2363  free(buf);
2364  return tmp;
2365 }
2366 
2367 /**
2368  * Method: OrxCurMvinstr
2369 
2370  * Read a string from the terminal after moving the cursor.
2371  *
2372  * @param y New y position for the cursor.
2373  *
2374  * @param x New x position for the cursor.
2375  *
2376  * @return Zero.
2377  **/
2379  OrxCurMvinstr, // Object_method name
2380  int, y,
2381  int, x,
2382  CSELF, cself) // Self
2383 {
2384  char buf[1024];
2385 
2386  if (cself == NULL) {
2387  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2388  context->WholeNumberToObject(1),
2389  context->NewStringFromAsciiz("Window"));
2390  return 0;
2391  }
2392  mvwinstr((WINDOW *)cself, SUBTRACTONE(y), SUBTRACTONE(x), buf);
2393  return context->NewStringFromAsciiz(buf);
2394 }
2395 
2396 /**
2397  * Method: OrxCurMvinnstr
2398  *
2399  * Read a string from the terminal after moving the cursor.
2400  *
2401  * @param y New y position for the cursor.
2402  *
2403  * @param x New x position for the cursor.
2404  *
2405  * @param n Number of characters to read.
2406  *
2407  * @return Zero.
2408  **/
2410  OrxCurMvinnstr, // Object_method name
2411  int, y,
2412  int, x,
2413  int, n,
2414  CSELF, cself) // Self
2415 {
2416 
2417  if (cself == NULL) {
2418  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2419  context->WholeNumberToObject(1),
2420  context->NewStringFromAsciiz("Window"));
2421  return 0;
2422  }
2423  char *buf = (char *)malloc(n + 1);
2424  mvwinnstr((WINDOW *)cself, SUBTRACTONE(y), SUBTRACTONE(x), buf, n);
2425  RexxObjectPtr tmp = context->NewStringFromAsciiz(buf);
2426  free(buf);
2427  return tmp;
2428 }
2429 
2430 /**
2431  * Method: OrxCurIntrflush
2432  *
2433  * Turn on/off input queue flushing when a interrupt key is
2434  * typed at the keyboard.
2435  *
2436  * @param bf Boolean
2437  *
2438  * @return Zero.
2439  **/
2440 RexxMethod2(int, // Return type
2441  OrxCurIntrflush, // Object_method name
2442  logical_t, bf,
2443  CSELF, cself) // Self
2444 {
2445 
2446  if (cself == NULL) {
2447  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2448  context->WholeNumberToObject(1),
2449  context->NewStringFromAsciiz("Window"));
2450  return 0;
2451  }
2452  return intrflush((WINDOW *)cself, bf);
2453 }
2454 
2455 /**
2456  * Method: OrxCurIsbitset
2457  *
2458  * Return true if a bit is set.
2459  *
2460  * @param field Field value to test.
2461  *
2462  * @param bit The bit to test.
2463  *
2464  * @return Zero.
2465  **/
2466 RexxMethod2(logical_t, // Return type
2467  OrxCurIsbitset, // Object_method name
2468  int, field,
2469  int, bit)
2470 {
2471 
2472  return (field & bit);
2473 }
2474 
2475 /**
2476  * Method: OrxCurIsendwin
2477  *
2478  * Return true if endwin() has been called.
2479  *
2480  * @return Zero.
2481  **/
2482 RexxMethod0(logical_t, // Return type
2483  OrxCurIsendwin) // Object_method name
2484 {
2485 
2486  return isendwin();
2487 }
2488 
2489 /**
2490  * Method: OrxCurIs_linetouched
2491  *
2492  * Determine if a line has been changed since the last refresh.
2493  *
2494  * @param n Line number.
2495  *
2496  * @return Zero.
2497  **/
2498 RexxMethod2(logical_t, // Return type
2499  OrxCurIs_linetouched, // Object_method name
2500  int, n,
2501  CSELF, cself) // Self
2502 {
2503 
2504  if (cself == NULL) {
2505  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2506  context->WholeNumberToObject(1),
2507  context->NewStringFromAsciiz("Window"));
2508  return 0;
2509  }
2510  return is_linetouched((WINDOW *)cself, SUBTRACTONE(n));
2511 }
2512 
2513 /**
2514  * Method: OrxCurIs_wintouched
2515  *
2516  * Determine if a window has been changed since the last
2517  * refresh.
2518  *
2519  * @return Zero.
2520  **/
2521 RexxMethod1(logical_t, // Return type
2522  OrxCurIs_wintouched, // Object_method name
2523  CSELF, cself) // Self
2524 {
2525 
2526  if (cself == NULL) {
2527  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2528  context->WholeNumberToObject(1),
2529  context->NewStringFromAsciiz("Window"));
2530  return 0;
2531  }
2532  return is_wintouched((WINDOW *)cself);
2533 }
2534 
2535 /**
2536  * Method: OrxCurKeyname
2537  *
2538  * Return a string representing the specified input key.
2539  *
2540  * @param k Key value (decimal number).
2541  *
2542  * @return Zero.
2543  **/
2545  OrxCurKeyname, // Object_method name
2546  int, k)
2547 {
2548 
2549  return (RexxObjectPtr)context->NewStringFromAsciiz(keyname(k));
2550 }
2551 
2552 /**
2553  * Method: OrxCurKeypad
2554  *
2555  * Turn on/off reading keypad (function, etc) keys.
2556  *
2557  * @param bf Boolean.
2558  *
2559  * @return Zero.
2560  **/
2561 RexxMethod2(int, // Return type
2562  OrxCurKeypad, // Object_method name
2563  logical_t, bf,
2564  CSELF, cself) // Self
2565 {
2566 
2567  if (cself == NULL) {
2568  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2569  context->WholeNumberToObject(1),
2570  context->NewStringFromAsciiz("Window"));
2571  return 0;
2572  }
2573  return keypad((WINDOW *)cself, bf);
2574 }
2575 
2576 /**
2577  * Method: OrxCurKillchar
2578  *
2579  * Return the kill terminal's kill character.
2580  *
2581  * @return Zero.
2582  **/
2584  OrxCurKillchar) // Object_method name
2585 {
2586  char buf[2] = {'\0', '\0'};
2587 
2588  buf[0] = killchar();
2589  return (RexxObjectPtr)context->NewStringFromAsciiz(buf);
2590 }
2591 
2592 /**
2593  * Method: OrxCurLeaveok
2594  *
2595  * Turn on/off synchrnizing the logical and the hardware cursor
2596  * location after a refresh.
2597  *
2598  * @param bf Boolean.
2599  *
2600  * @return Zero.
2601  **/
2602 RexxMethod2(int, // Return type
2603  OrxCurLeaveok, // Object_method name
2604  logical_t, bf,
2605  CSELF, cself) // Self
2606 {
2607 
2608  if (cself == NULL) {
2609  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2610  context->WholeNumberToObject(1),
2611  context->NewStringFromAsciiz("Window"));
2612  return 0;
2613  }
2614  return leaveok((WINDOW *)cself, bf);
2615 }
2616 
2617 /**
2618  * Method: OrxCurLines
2619  *
2620  * Return the number of lines on the stdscr.
2621  *
2622  * @return Zero.
2623  **/
2624 RexxMethod0(int, // Return type
2625  OrxCurLines) // Object_method name
2626 {
2627 
2628  return LINES;
2629 }
2630 
2631 /**
2632  * Method: OrxCurLongname
2633  *
2634  * Return the terminal string description.
2635  *
2636  * @return Zero.
2637  **/
2639  OrxCurLongname) // Object_method name
2640 {
2641 
2642  return (RexxObjectPtr)context->NewStringFromAsciiz(longname());
2643 }
2644 
2645 /**
2646  * Method: OrxCurMeta
2647  *
2648  * Turn on/off reading the Alt key info in the 8th bit.
2649  *
2650  * @param bf Boolean.
2651  *
2652  * @return Zero.
2653  **/
2654 RexxMethod2(int, // Return type
2655  OrxCurMeta, // Object_method name
2656  logical_t, bf,
2657  CSELF, cself) // Self
2658 {
2659 
2660  if (cself == NULL) {
2661  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2662  context->WholeNumberToObject(1),
2663  context->NewStringFromAsciiz("Window"));
2664  return 0;
2665  }
2666  return meta((WINDOW *)cself, bf);
2667 }
2668 
2669 /**
2670  * Method: OrxCurMouse_trafo
2671  *
2672  * Translate mouse y and x coordinates.
2673  *
2674  * @param y Y mouse coordinate.
2675  *
2676  * @param x X mouse coordinate.
2677  *
2678  * @param bf Boolean.
2679  *
2680  * @return Zero.
2681  **/
2683  OrxCurMouse_trafo, // Object_method name
2684  int, y,
2685  int, x,
2686  logical_t, bf,
2687  CSELF, cself) // Self
2688 {
2689  char buf[32];
2690 
2691  if (cself == NULL) {
2692  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2693  context->WholeNumberToObject(1),
2694  context->NewStringFromAsciiz("Window"));
2695  return 0;
2696  }
2697  wmouse_trafo((WINDOW *)cself, &y, &x, bf);
2698  sprintf(buf, "%d %d", ADDONE(y), ADDONE(x));
2699  return (RexxObjectPtr)context->NewStringFromAsciiz(buf);
2700 }
2701 
2702 /**
2703  * Method: OrxCurMousemask
2704  *
2705  * Set/return the mouse event mask.
2706  *
2707  * @param old Old mouse mask ou 0.
2708  *
2709  * @return Zero.
2710  **/
2711 RexxMethod1(int, // Return type
2712  OrxCurMousemask, // Object_method name
2713  int, newmask)
2714 {
2715 
2716  return mousemask(newmask, NULL);
2717 }
2718 
2719 /**
2720  * Method: OrxCurMove
2721  *
2722  * Move the cursor.
2723  *
2724  * @param y New Y cursor position.
2725  *
2726  * @param x New X cursor position.
2727  *
2728  * @return Zero.
2729  **/
2730 RexxMethod3(int, // Return type
2731  OrxCurMove, // Object_method name
2732  int, y,
2733  int, x,
2734  CSELF, cself) // Self
2735 {
2736 
2737  if (cself == NULL) {
2738  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2739  context->WholeNumberToObject(1),
2740  context->NewStringFromAsciiz("Window"));
2741  return 0;
2742  }
2743  return wmove((WINDOW *)cself, SUBTRACTONE(y), SUBTRACTONE(x));
2744 }
2745 
2746 /**
2747  * Method: OrxCurMvderwin
2748  *
2749  * Display a different portion of the parent window.
2750  *
2751  * @param y Parent Y position.
2752  *
2753  * @param x Parent X position.
2754  *
2755  * @return Zero.
2756  **/
2757 RexxMethod3(int, // Return type
2758  OrxCurMvderwin, // Object_method name
2759  int, y,
2760  int, x,
2761  CSELF, cself) // Self
2762 {
2763 
2764  if (cself == NULL) {
2765  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2766  context->WholeNumberToObject(1),
2767  context->NewStringFromAsciiz("Window"));
2768  return 0;
2769  }
2770  return mvderwin((WINDOW *)cself, SUBTRACTONE(y), SUBTRACTONE(x));
2771 }
2772 
2773 /**
2774  * Method: OrxCurMvwin
2775  *
2776  * Move a window.
2777  *
2778  * @param y Parent Y position.
2779  *
2780  * @param x Parent X position.
2781  *
2782  * @return Zero.
2783  **/
2784 RexxMethod3(int, // Return type
2785  OrxCurMvwin, // Object_method name
2786  int, y,
2787  int, x,
2788  CSELF, cself) // Self
2789 {
2790 
2791  if (cself == NULL) {
2792  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2793  context->WholeNumberToObject(1),
2794  context->NewStringFromAsciiz("Window"));
2795  return 0;
2796  }
2797  return mvwin((WINDOW *)cself, SUBTRACTONE(y), SUBTRACTONE(x));
2798 }
2799 
2800 /**
2801  * Method: OrxCurNapms
2802  *
2803  * Pause the program for number of microseconds.
2804  *
2805  * @param n Number of microseconds
2806  *
2807  * @return Zero.
2808  **/
2809 RexxMethod1(int, // Return type
2810  OrxCurNapms, // Object_method name
2811  int, n)
2812 {
2813 
2814  return napms(n);
2815 }
2816 
2817 /**
2818  * Method: OrxCurNcurses_mouse_version
2819  *
2820  * Return the Ncurses mouse version string.
2821  *
2822  * @return Zero.
2823  **/
2825  OrxCurNcurses_mouse_version) // Object_method name
2826 {
2827  char buf[64];
2828 
2829  sprintf(buf, "%d", NCURSES_MOUSE_VERSION);
2830  return (RexxObjectPtr)context->NewStringFromAsciiz(buf);
2831 }
2832 
2833 /**
2834  * Method: OrxCurNcurses_version
2835  *
2836  * Return the Ncurses version string.
2837  *
2838  * @return Zero.
2839  **/
2841  OrxCurNcurses_version) // Object_method name
2842 {
2843 
2844  return (RexxObjectPtr)context->NewStringFromAsciiz(NCURSES_VERSION);
2845 }
2846 
2847 /**
2848  * Method: OrxCurNewpad
2849  *
2850  * Create a new pad.
2851  *
2852  * @param nlines Number of lines.
2853  *
2854  * @param ncols Number of columns.
2855  *
2856  * @return Zero.
2857  **/
2858 RexxMethod2(int, // Return type
2859  OrxCurNewpad, // Object_method name
2860  int, nlines,
2861  int, ncols)
2862 {
2863 
2864  context->SetObjectVariable("CSELF", context->NewPointer(newpad(nlines, ncols)));
2865  return 0;
2866 }
2867 
2868 /**
2869  * Method: OrxCurNl
2870  *
2871  * Distinguish between cr and lf.
2872  *
2873  * @return Zero.
2874  **/
2875 RexxMethod0(int, // Return type
2876  OrxCurNl) // Object_method name
2877 {
2878 
2879  return nl();
2880 }
2881 
2882 /**
2883  * Method: OrxCurNonl
2884  *
2885  * Do not distinguish between cr and lf.
2886  *
2887  * @return Zero.
2888  **/
2889 RexxMethod0(int, // Return type
2890  OrxCurNonl) // Object_method name
2891 {
2892 
2893  return nonl();
2894 }
2895 
2896 /**
2897  * Method: OrxCurNodelay
2898  *
2899  * Transforms getch() function to nonblocking.
2900  *
2901  * @param bf On/off boolean.
2902  *
2903  * @return Zero.
2904  **/
2905 RexxMethod2(int, // Return type
2906  OrxCurNodelay, // Object_method name
2907  logical_t, bf,
2908  CSELF, cself) // Self
2909 {
2910 
2911  if (cself == NULL) {
2912  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2913  context->WholeNumberToObject(1),
2914  context->NewStringFromAsciiz("Window"));
2915  return 0;
2916  }
2917  return nodelay((WINDOW *)cself, bf);
2918 }
2919 
2920 /**
2921  * Method: OrxCurNotimeout
2922  *
2923  * Pause input function after user presses ESC key.
2924  *
2925  * @param bf On/off boolean.
2926  *
2927  * @return Zero.
2928  **/
2929 RexxMethod2(int, // Return type
2930  OrxCurNotimeout, // Object_method name
2931  logical_t, bf,
2932  CSELF, cself) // Self
2933 {
2934 
2935  if (cself == NULL) {
2936  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2937  context->WholeNumberToObject(1),
2938  context->NewStringFromAsciiz("Window"));
2939  return 0;
2940  }
2941  return notimeout((WINDOW *)cself, bf);
2942 }
2943 
2944 /**
2945  * Method: OrxCurOverlay
2946  *
2947  * Overlay the destination window.
2948  *
2949  * @param dwin Destination window.
2950  *
2951  * @return Zero.
2952  **/
2953 RexxMethod2(int, // Return type
2954  OrxCurOverlay, // Object_method name
2955  RexxObjectPtr, rxdwin,
2956  CSELF, cself) // Self
2957 {
2958 
2959  if (cself == NULL) {
2960  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2961  context->WholeNumberToObject(1),
2962  context->NewStringFromAsciiz("Window"));
2963  return 0;
2964  }
2965  WINDOW *dwin = (WINDOW *)context->ObjectToCSelf(rxdwin);
2966  return overlay((WINDOW *)cself, dwin);
2967 }
2968 
2969 /**
2970  * Method: OrxCurOverwrite
2971  *
2972  * Overlay the destination window.
2973  *
2974  * @param dwin Destination window.
2975  *
2976  * @return Zero.
2977  **/
2978 RexxMethod2(int, // Return type
2979  OrxCurOverwrite, // Object_method name
2980  RexxObjectPtr, rxdwin,
2981  CSELF, cself) // Self
2982 {
2983 
2984  if (cself == NULL) {
2985  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
2986  context->WholeNumberToObject(1),
2987  context->NewStringFromAsciiz("Window"));
2988  return 0;
2989  }
2990  WINDOW *dwin = (WINDOW *)context->ObjectToCSelf(rxdwin);
2991  return overwrite((WINDOW *)cself, dwin);
2992 }
2993 
2994 /**
2995  * Method: OrxCurPair_content
2996  *
2997  * Return the pair of colors in a color pair.
2998  *
2999  * @param num Color pair number.
3000  *
3001  * @return Zero.
3002  **/
3004  OrxCurPair_content, // Object_method name
3005  int, num)
3006 {
3007  char buf[64];
3008  short f, b;
3009 
3010  int retc = pair_content((short)num, &f, &b);
3011  sprintf(buf, "%d %d", f, b);
3012  return (RexxObjectPtr)context->NewStringFromAsciiz(buf);
3013 }
3014 
3015 /**
3016  * Method: OrxCurPair_number
3017  *
3018  * Return the default pair attr.
3019  *
3020  * @param attr Color pair attribute.
3021  *
3022  * @return Zero.
3023  **/
3024 RexxMethod1(int, // Return type
3025  OrxCurPair_number, // Object_method name
3026  int, num)
3027 {
3028 
3029  return PAIR_NUMBER(num);
3030 }
3031 
3032 /**
3033  * Method: OrxCurPechochar
3034  *
3035  * Echo one character to a pad and the stdscr..
3036  *
3037  * @param ch Character to echo.
3038  *
3039  * @return Zero.
3040  **/
3041 RexxMethod2(int, // Return type
3042  OrxCurPechochar, // Object_method name
3043  CSTRING, ch,
3044  CSELF, cself) // Self
3045 {
3046 
3047  if (cself == NULL) {
3048  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
3049  context->WholeNumberToObject(1),
3050  context->NewStringFromAsciiz("Pad"));
3051  return 0;
3052  }
3053  return pechochar((WINDOW *)cself, (chtype)*ch);
3054 }
3055 
3056 /**
3057  * Method: OrxCurPnoutrefresh
3058  *
3059  * Refresh a pad.
3060  *
3061  * @param minrow Minimum row number.
3062  *
3063  * @param mincol Minimum col number.
3064  *
3065  * @param sminrow Minimum row number.
3066  *
3067  * @param smincol Minimum col number.
3068  *
3069  * @param smaxrow Maximum row number.
3070  *
3071  * @param smaxcol Maximum col number.
3072  *
3073  * @return Zero.
3074  **/
3075 RexxMethod7(int, // Return type
3076  OrxCurPnoutrefresh, // Object_method name
3077  int, minrow,
3078  int, mincol,
3079  int, sminrow,
3080  int, smincol,
3081  int, smaxrow,
3082  int, smaxcol,
3083  CSELF, cself) // Self
3084 {
3085 
3086  if (cself == NULL) {
3087  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
3088  context->WholeNumberToObject(1),
3089  context->NewStringFromAsciiz("Pad"));
3090  return 0;
3091  }
3092  return pnoutrefresh((WINDOW *)cself, SUBTRACTONE(minrow), SUBTRACTONE(mincol),
3093  SUBTRACTONE(sminrow), SUBTRACTONE(smincol),
3094  SUBTRACTONE(smaxrow), SUBTRACTONE(smaxcol));
3095 }
3096 
3097 /**
3098  * Method: OrxCurPrefresh
3099  *
3100  * Refresh the pad to the stdscr.
3101  *
3102  * @param minrow Minimum row number.
3103  *
3104  * @param mincol Minimum col number.
3105  *
3106  * @param sminrow Minimum row number.
3107  *
3108  * @param smincol Minimum col number.
3109  *
3110  * @param smaxrow Maximum row number.
3111  *
3112  * @param smaxcol Maximum col number.
3113  *
3114  * @return Zero.
3115  **/
3116 RexxMethod7(int, // Return type
3117  OrxCurPrefresh, // Object_method name
3118  int, minrow,
3119  int, mincol,
3120  int, sminrow,
3121  int, smincol,
3122  int, smaxrow,
3123  int, smaxcol,
3124  CSELF, cself) // Pad
3125 {
3126 
3127  if (cself == NULL) {
3128  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
3129  context->WholeNumberToObject(1),
3130  context->NewStringFromAsciiz("Pad"));
3131  return 0;
3132  }
3133  return prefresh((WINDOW *)cself, SUBTRACTONE(minrow), SUBTRACTONE(mincol),
3134  SUBTRACTONE(sminrow), SUBTRACTONE(smincol),
3135  SUBTRACTONE(smaxrow), SUBTRACTONE(smaxcol));
3136 }
3137 
3138 /**
3139  * Method: OrxCurPutwin
3140  *
3141  * Save a new window to a file.
3142  *
3143  * @param fname File name.
3144  *
3145  * @return Zero.
3146  **/
3147 RexxMethod2(int, // Return type
3148  OrxCurPutwin, // Object_method name
3149  CSTRING, filename,
3150  CSELF, cself) // Self
3151 {
3152  FILE *wfile;
3153 
3154  if (cself == NULL) {
3155  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
3156  context->WholeNumberToObject(1),
3157  context->NewStringFromAsciiz("Window"));
3158  return 0;
3159  }
3160  wfile = fopen(filename, "w");
3161  int retc = putwin((WINDOW *)cself, wfile);
3162  fclose(wfile);
3163  return retc;
3164 }
3165 
3166 /**
3167  * Method: OrxCurQiflush
3168  *
3169  * Flush the input queue on interrupt.
3170  *
3171  * @return Zero.
3172  **/
3173 RexxMethod0(int, // Return type
3174  OrxCurQiflush) // Object_method name
3175 {
3176 
3177  qiflush();
3178  return 0;
3179 }
3180 
3181 /**
3182  * Method: OrxCurNoqiflush
3183  *
3184  * Do no flush the input queue on interrupt.
3185  *
3186  * @return Zero.
3187  **/
3188 RexxMethod0(int, // Return type
3189  OrxCurNoqiflush) // Object_method name
3190 {
3191 
3192  noqiflush();
3193  return 0;
3194 }
3195 
3196 /**
3197  * Method: OrxCurRaw
3198  *
3199  * Remove modification done by the terminal to input.
3200  *
3201  * @return Zero.
3202  **/
3203 RexxMethod0(int, // Return type
3204  OrxCurRaw) // Object_method name
3205 {
3206 
3207  return raw();
3208 }
3209 
3210 /**
3211  * Method: OrxCurNoraw
3212  *
3213  * Do not remove modification done by the terminal to input.
3214  *
3215  * @return Zero.
3216  **/
3217 RexxMethod0(int, // Return type
3218  OrxCurNoraw) // Object_method name
3219 {
3220 
3221  return noraw();
3222 }
3223 
3224 /**
3225  * Method: OrxCurRedrawwin
3226  *
3227  * Redraw an entire window.
3228  *
3229  * @return Zero.
3230  **/
3231 RexxMethod1(int, // Return type
3232  OrxCurRedrawwin, // Object_method name
3233  CSELF, cself) // Self
3234 {
3235 
3236  if (cself == NULL) {
3237  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
3238  context->WholeNumberToObject(1),
3239  context->NewStringFromAsciiz("Window"));
3240  return 0;
3241  }
3242  return redrawwin((WINDOW *)cself);
3243 }
3244 
3245 /**
3246  * Method: OrxCurScr_dump
3247  *
3248  * Dump the terminal screen to a file.
3249  *
3250  * @param fname Output file name.
3251  *
3252  * @return Zero.
3253  **/
3254 RexxMethod1(int, // Return type
3255  OrxCurScr_dump, // Object_method name
3256  CSTRING, fname)
3257 {
3258 
3259  return scr_dump(fname);
3260 }
3261 
3262 /**
3263  * Method: OrxCurScr_restore
3264  *
3265  * Restore the terminal screen drom a file.
3266  *
3267  * @param fname Input file name.
3268  *
3269  * @return Zero.
3270  **/
3271 RexxMethod1(int, // Return type
3272  OrxCurScr_restore, // Object_method name
3273  CSTRING, fname)
3274 {
3275 
3276  return scr_restore(fname);
3277 }
3278 
3279 /**
3280  * Method: OrxCurScrl
3281  *
3282  * Scroll a window.
3283  *
3284  * @param num Number of lines to scroll.
3285  *
3286  * @return Zero.
3287  **/
3288 RexxMethod2(int, // Return type
3289  OrxCurScrl, // Object_method name
3290  int, n,
3291  CSELF, cself) // Self
3292 {
3293 
3294  if (cself == NULL) {
3295  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
3296  context->WholeNumberToObject(1),
3297  context->NewStringFromAsciiz("Window"));
3298  return 0;
3299  }
3300  return wscrl((WINDOW *)cself, n);
3301 }
3302 
3303 /**
3304  * Method: OrxCurScroll
3305  *
3306  * Scroll a window.
3307  *
3308  * @return Zero.
3309  **/
3310 RexxMethod1(int, // Return type
3311  OrxCurScroll, // Object_method name
3312  CSELF, cself) // Self
3313 {
3314 
3315  if (cself == NULL) {
3316  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
3317  context->WholeNumberToObject(1),
3318  context->NewStringFromAsciiz("Window"));
3319  return 0;
3320  }
3321  return scroll((WINDOW *)cself);
3322 }
3323 
3324 /**
3325  * Method: OrxCurScrollok
3326  *
3327  * Allaow a wildow to scroll.
3328  *
3329  * @param bf Boolean indicator.
3330  *
3331  * @return Zero.
3332  **/
3333 RexxMethod2(int, // Return type
3334  OrxCurScrollok, // Object_method name
3335  logical_t, bf,
3336  CSELF, cself) // Self
3337 {
3338 
3339  if (cself == NULL) {
3340  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
3341  context->WholeNumberToObject(1),
3342  context->NewStringFromAsciiz("Window"));
3343  return 0;
3344  }
3345  return scrollok((WINDOW *)cself, bf);
3346 }
3347 
3348 /**
3349  * Method: OrxCurSetscrreg
3350  *
3351  * Set a window reagion scrollable.
3352  *
3353  * @param top Top row.
3354  *
3355  * @param bot Bottom row.
3356  *
3357  * @return Zero.
3358  **/
3359 RexxMethod3(int, // Return type
3360  OrxCurSetscrreg, // Object_method name
3361  int, top,
3362  int, bot,
3363  CSELF, cself) // Self
3364 {
3365 
3366  if (cself == NULL) {
3367  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
3368  context->WholeNumberToObject(1),
3369  context->NewStringFromAsciiz("Window"));
3370  return 0;
3371  }
3372  return wsetscrreg((WINDOW *)cself, SUBTRACTONE(top), SUBTRACTONE(bot));
3373 }
3374 
3375 /**
3376  * Method: OrxCurSlk_attr
3377  *
3378  * Return soft label attr_t.
3379  *
3380  * @return Zero.
3381  **/
3382 RexxMethod0(int, // Return type
3383  OrxCurSlk_attr) // Object_method name
3384 {
3385 
3386  return slk_attr();
3387 }
3388 
3389 /**
3390  * Method: OrxCurSlk_attroff
3391  *
3392  * Turn off one or more soft label attributes.
3393  *
3394  * @param attr Attribute(s).
3395  *
3396  * @return Zero.
3397  **/
3398 RexxMethod1(int, // Return type
3399  OrxCurSlk_attroff, // Object_method name
3400  int, attr)
3401 {
3402 
3403  return slk_attroff(attr);
3404 }
3405 
3406 /**
3407  * Method: OrxCurSlk_attron
3408  *
3409  * Turn on one or more soft label attributes.
3410  *
3411  * @param attr Attribute(s).
3412  *
3413  * @return Zero.
3414  **/
3415 RexxMethod1(int, // Return type
3416  OrxCurSlk_attron, // Object_method name
3417  int, attr)
3418 {
3419 
3420  return slk_attron(attr);
3421 }
3422 
3423 /**
3424  * Method: OrxCurSlk_attrset
3425  *
3426  * Set soft label attributes.
3427  *
3428  * @param attr Attribute(s).
3429  *
3430  * @return Zero.
3431  **/
3432 RexxMethod1(int, // Return type
3433  OrxCurSlk_attrset, // Object_method name
3434  int, attr)
3435 {
3436 
3437  return slk_attrset(attr);
3438 }
3439 
3440 /**
3441  * Method: OrxCurSlk_clear
3442  *
3443  * Hide the soft labels.
3444  *
3445  * @return Zero.
3446  **/
3447 RexxMethod0(int, // Return type
3448  OrxCurSlk_clear) // Object_method name
3449 {
3450 
3451  return slk_clear();
3452 }
3453 
3454 /**
3455  * Method: OrxCurSlk_color
3456  *
3457  * Set soft label colors.
3458  *
3459  * @param color Color pair number.
3460  *
3461  * @return Zero.
3462  **/
3463 RexxMethod1(int, // Return type
3464  OrxCurSlk_color, // Object_method name
3465  int, color)
3466 {
3467 
3468  return slk_color((short)color);
3469 }
3470 
3471 /**
3472  * Method: OrxCurSlk_init
3473  *
3474  * Initialize for soft label.
3475  *
3476  * @param fmt Line format.
3477  *
3478  * @return Zero.
3479  **/
3480 RexxMethod1(int, // Return type
3481  OrxCurSlk_init, // Object_method name
3482  int, fmt)
3483 {
3484 
3485  return slk_init(fmt);
3486 }
3487 
3488 /**
3489  * Method: OrxCurSlk_label
3490  *
3491  * Return the soft label text.
3492  *
3493  * @param num Number of the soft label.
3494  *
3495  * @return Zero.
3496  **/
3498  OrxCurSlk_label, // Object_method name
3499  int, num)
3500 {
3501 
3502  return (RexxObjectPtr)context->NewStringFromAsciiz(slk_label(num));
3503 }
3504 
3505 /**
3506  * Method: OrxCurSlk_noutrefresh
3507  *
3508  * Prepares soft labels for a refresh.
3509  *
3510  * @return Zero.
3511  **/
3512 RexxMethod0(int, // Return type
3513  OrxCurSlk_noutrefresh) // Object_method name
3514 {
3515 
3516  return slk_noutrefresh();
3517 }
3518 
3519 /**
3520  * Method: OrxCurSlk_refresh
3521  *
3522  * Refresh soft labels.
3523  *
3524  * @return Zero.
3525  **/
3526 RexxMethod0(int, // Return type
3527  OrxCurSlk_refresh) // Object_method name
3528 {
3529 
3530  return slk_refresh();
3531 }
3532 
3533 /**
3534  * Method: OrxCurSlk_restore
3535  *
3536  * Restore soft labels.
3537  *
3538  * @return Zero.
3539  **/
3540 RexxMethod0(int, // Return type
3541  OrxCurSlk_restore) // Object_method name
3542 {
3543 
3544  return slk_restore();
3545 }
3546 
3547 /**
3548  * Method: OrxCurSlk_set
3549  *
3550  * Set soft label text.
3551  *
3552  * @param text Soft label text.
3553  *
3554  * @param num Soft label number.
3555  *
3556  * @return Zero.
3557  **/
3558 RexxMethod3(int, // Return type
3559  OrxCurSlk_set, // Object_method name
3560  int, num,
3561  CSTRING, text,
3562  int, fmt)
3563 {
3564 
3565  return slk_set(num, text, fmt);
3566 }
3567 
3568 /**
3569  * Method: OrxCurSlk_touch
3570  *
3571  * Touch soft labels.
3572  *
3573  * @return Zero.
3574  **/
3575 RexxMethod0(int, // Return type
3576  OrxCurSlk_touch) // Object_method name
3577 {
3578 
3579  return slk_touch();
3580 }
3581 
3582 /**
3583  * Method: OrxCurStandend
3584  *
3585  * Turn off text attributes.
3586  *
3587  * @return Zero.
3588  **/
3589 RexxMethod1(int, // Return type
3590  OrxCurStandend, // Object_method name
3591  CSELF, cself) // Self
3592 {
3593 
3594  if (cself == NULL) {
3595  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
3596  context->WholeNumberToObject(1),
3597  context->NewStringFromAsciiz("Window"));
3598  return 0;
3599  }
3600  return wstandend((WINDOW *)cself);
3601 }
3602 
3603 /**
3604  * Method: OrxCurStandout
3605  *
3606  * Turn on text attributes.
3607  *
3608  * @return Zero.
3609  **/
3610 RexxMethod1(int, // Return type
3611  OrxCurStandout, // Object_method name
3612  CSELF, cself) // Self
3613 {
3614 
3615  if (cself == NULL) {
3616  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
3617  context->WholeNumberToObject(1),
3618  context->NewStringFromAsciiz("Window"));
3619  return 0;
3620  }
3621  return wstandout((WINDOW *)cself);
3622 }
3623 
3624 /**
3625  * Method: OrxCurStart_color
3626  *
3627  * Turn on using color attributes.
3628  *
3629  * @return Zero.
3630  **/
3631 RexxMethod0(int, // Return type
3632  OrxCurStart_color) // Object_method name
3633 {
3634 
3635  return start_color();
3636 }
3637 
3638 /**
3639  * Method: OrxCurSubpadprivate
3640  *
3641  * Create a subpad.
3642  *
3643  * @param nlines Number of lines.
3644  *
3645  * @param ncols Number of cols.
3646  *
3647  * @param begy Beginning Y line.
3648  *
3649  * @param begx Beginning X column.
3650  *
3651  * @return Zero.
3652  **/
3653 RexxMethod6(int, // Return type
3654  OrxCurSubpadprivate, // Object_method name
3655  RexxObjectPtr, pad,
3656  int, nlines,
3657  int, ncols,
3658  int, begy,
3659  int, begx,
3660  CSELF, cself) // Self
3661 {
3662 
3663  WINDOW *padptr = (WINDOW *) context->ObjectToCSelf(pad);
3664  WINDOW *ptr = subpad((WINDOW *)padptr, nlines, ncols, SUBTRACTONE(begy), SUBTRACTONE(begx));
3665  context->SetObjectVariable("CSELF", context->NewPointer(ptr));
3666  return 0;
3667 }
3668 
3669 /**
3670  * Method: OrxCurSubwinprivate
3671  *
3672  * Create a subwindow.
3673  *
3674  * @param nlines Number of lines.
3675  *
3676  * @param ncols Number of cols.
3677  *
3678  * @param begy Beginning Y line.
3679  *
3680  * @param begx Beginning X column.
3681  *
3682  * @return Zero.
3683  **/
3685  OrxCurSubwinprivate, // Object_method name
3686  int, nlines,
3687  int, ncols,
3688  int, begy,
3689  int, begx,
3690  CSELF, cself) // Self
3691 {
3692 
3693  WINDOW *ptr = subwin((WINDOW *)cself, nlines, ncols, SUBTRACTONE(begy), SUBTRACTONE(begx));
3694  return (RexxObjectPtr)context->NewPointer(ptr);
3695 }
3696 
3697 /**
3698  * Method: OrxCurSyncok
3699  *
3700  * Turn on/off aut touch for a window.
3701  *
3702  * @param bf On/off boolean.
3703  *
3704  * @return Zero.
3705  **/
3706 RexxMethod2(int, // Return type
3707  OrxCurSyncok, // Object_method name
3708  logical_t, bf,
3709  CSELF, cself) // Self
3710 {
3711 
3712  if (cself == NULL) {
3713  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
3714  context->WholeNumberToObject(1),
3715  context->NewStringFromAsciiz("Window"));
3716  return 0;
3717  }
3718  return syncok((WINDOW *)cself, bf);
3719 }
3720 
3721 /**
3722  * Method: OrxCurTabsize
3723  *
3724  * Return/set the tab size.
3725  *
3726  * @param sz New tab size.
3727  *
3728  * @return Zero.
3729  **/
3730 RexxMethod1(int, // Return type
3731  OrxCurTabsize, // Object_method name
3732  OPTIONAL_int, sz)
3733 {
3734  if (argumentExists(1)) {
3735  set_tabsize(sz);
3736  }
3737  return TABSIZE;
3738 }
3739 
3740 /**
3741  * Method: OrxCurTermattrs
3742  *
3743  * Return the which attributes the terminal is capable of
3744  * producing.
3745  *
3746  * @return Zero.
3747  **/
3748 RexxMethod0(int, // Return type
3749  OrxCurTermattrs) // Object_method name
3750 {
3751 
3752  return (int) termattrs();
3753 }
3754 
3755 /**
3756  * Method: OrxCurtermname
3757  *
3758  * Return the terminal name.
3759  *
3760  * @return Zero.
3761  **/
3763  OrxCurTermname) // Object_method name
3764 {
3765 
3766  return (RexxObjectPtr)context->NewStringFromAsciiz(termname());
3767 }
3768 
3769 /**
3770  * Method: OrxCurTimeout
3771  *
3772  * Set the timeout for text input.
3773  *
3774  * @param tmout Timeout value.
3775  *
3776  * @return Zero.
3777  **/
3778 RexxMethod1(int, // Return type
3779  OrxCurTimeout, // Object_method name
3780  int, tmout)
3781 {
3782 
3783  timeout(tmout);
3784  return 0;
3785 }
3786 
3787 /**
3788  * Method: OrxCurTouchline
3789  *
3790  * Mark one or more lines as changed.
3791  *
3792  * @param bf On/off boolean.
3793  *
3794  * @return Zero.
3795  **/
3796 RexxMethod3(int, // Return type
3797  OrxCurTouchline, // Object_method name
3798  int, start,
3799  int, cnt,
3800  CSELF, cself) // Self
3801 {
3802 
3803  if (cself == NULL) {
3804  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
3805  context->WholeNumberToObject(1),
3806  context->NewStringFromAsciiz("Window"));
3807  return 0;
3808  }
3809  return touchline((WINDOW *)cself, SUBTRACTONE(start), cnt);
3810 }
3811 
3812 /**
3813  * Method: OrxCurTouchwin
3814  *
3815  * Mark window as changed.
3816  *
3817  * @return Zero.
3818  **/
3819 RexxMethod1(int, // Return type
3820  OrxCurTouchwin, // Object_method name
3821  CSELF, cself) // Self
3822 {
3823 
3824  if (cself == NULL) {
3825  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
3826  context->WholeNumberToObject(1),
3827  context->NewStringFromAsciiz("Window"));
3828  return 0;
3829  }
3830  return touchwin((WINDOW *)cself);
3831 }
3832 
3833 /**
3834  * Method: OrxCurTypeahead
3835  *
3836  * Set the typeahead for text input.
3837  *
3838  * @param fd Typeahead value.
3839  *
3840  * @return Zero.
3841  **/
3842 RexxMethod1(int, // Return type
3843  OrxCurTypeahead, // Object_method name
3844  int, fd)
3845 {
3846 
3847  return typeahead(fd);
3848 }
3849 
3850 /**
3851  * Method: OrxCurUnctrl
3852  *
3853  * Convert a control code to a ^code sequence.
3854  *
3855  * @param ch Code to convert.
3856  *
3857  * @return Zero.
3858  **/
3860  OrxCurUnctrl, // Object_method name
3861  int, ch)
3862 {
3863 
3864  return (RexxObjectPtr)context->NewStringFromAsciiz(unctrl((chtype)ch));
3865 }
3866 
3867 /**
3868  * Method: OrxCurUngetch
3869  *
3870  * Put a character into the keyboard buffer.
3871  *
3872  * @param ch Character to insert.
3873  *
3874  * @return Zero.
3875  **/
3876 RexxMethod1(int, // Return type
3877  OrxCurUngetch, // Object_method name
3878  CSTRING, ch)
3879 {
3880 
3881  return ungetch((int)*ch);
3882 }
3883 
3884 /**
3885  * Method: OrxCurUntouchwin
3886  *
3887  * Unmark window as changed.
3888  *
3889  * @return Zero.
3890  **/
3891 RexxMethod1(int, // Return type
3892  OrxCurUntouchwin, // Object_method name
3893  CSELF, cself) // Self
3894 {
3895 
3896  if (cself == NULL) {
3897  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
3898  context->WholeNumberToObject(1),
3899  context->NewStringFromAsciiz("Window"));
3900  return 0;
3901  }
3902  return untouchwin((WINDOW *)cself);
3903 }
3904 
3905 /**
3906  * Method: OrxCurUse_default_colors
3907  *
3908  * Use the default terminal colors.
3909  *
3910  * @return Zero.
3911  **/
3912 RexxMethod0(int, // Return type
3913  OrxCurUse_default_colors) // Object_method name
3914 {
3915 
3916  return use_default_colors();
3917 }
3918 
3919 /**
3920  * Method: OrxCurUse_env
3921  *
3922  * Use the default terminal colors.
3923  *
3924  * @return Zero.
3925  **/
3926 RexxMethod1(int, // Return type
3927  OrxCurUse_env, // Object_method name
3928  logical_t, bf)
3929 {
3930 
3931  use_env(bf);
3932  return 0;
3933 }
3934 
3935 /**
3936  * Method: OrxCurVline
3937  *
3938  * Draw a vertical line.
3939  *
3940  * @param ch chtype.
3941  *
3942  * @param n Number of rows.
3943  *
3944  * @return Zero.
3945  **/
3946 RexxMethod3(int, // Return type
3947  OrxCurVline, // Object_method name
3948  int, ch,
3949  int, n,
3950  CSELF, cself) // Self
3951 {
3952 
3953  if (cself == NULL) {
3954  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
3955  context->WholeNumberToObject(1),
3956  context->NewStringFromAsciiz("Window"));
3957  return 0;
3958  }
3959  return wvline((WINDOW *)cself, (chtype)ch, n);
3960 }
3961 
3962 /**
3963  * Method: OrxCurMvvline
3964  *
3965  * Draw a vertical line after moving the cursor.
3966  *
3967  * @param y New Y cursor position.
3968  *
3969  * @param x New X cursor position.
3970  *
3971  * @param ch chtype.
3972  *
3973  * @param n Number of rows.
3974  *
3975  * @return Zero.
3976  **/
3977 RexxMethod5(int, // Return type
3978  OrxCurMvvline, // Object_method name
3979  int, y,
3980  int, x,
3981  int, ch,
3982  int, n,
3983  CSELF, cself) // Self
3984 {
3985 
3986  if (cself == NULL) {
3987  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
3988  context->WholeNumberToObject(1),
3989  context->NewStringFromAsciiz("Window"));
3990  return 0;
3991  }
3992  return mvwvline((WINDOW *)cself, SUBTRACTONE(y), SUBTRACTONE(x), (chtype)ch, n);
3993 }
3994 
3995 /**
3996  * Method: OrxCurWenclose
3997  *
3998  * Determine if a mouse click are within a window.
3999  *
4000  * @param y Y cursor screen position.
4001  *
4002  * @param x X cursor screen position.
4003  *
4004  * @return Zero.
4005  **/
4006 RexxMethod3(int, // Return type
4007  OrxCurWenclose, // Object_method name
4008  int, y,
4009  int, x,
4010  CSELF, cself) // Self
4011 {
4012 
4013  if (cself == NULL) {
4014  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
4015  context->WholeNumberToObject(1),
4016  context->NewStringFromAsciiz("Window"));
4017  return 0;
4018  }
4019  return wenclose((WINDOW *)cself, SUBTRACTONE(y), SUBTRACTONE(x));
4020 }
4021 
4022 /**
4023  * Method: OrxCurWnoutrefresh
4024  *
4025  * Copy modified text to the screen.
4026  *
4027  * @return Zero.
4028  **/
4029 RexxMethod1(int, // Return type
4030  OrxCurWnoutrefresh, // Object_method name
4031  CSELF, cself) // Self
4032 {
4033 
4034  if (cself == NULL) {
4035  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
4036  context->WholeNumberToObject(1),
4037  context->NewStringFromAsciiz("Window"));
4038  return 0;
4039  }
4040  return wnoutrefresh((WINDOW *)cself);
4041 }
4042 
4043 /**
4044  * Method: OrxCurWredrawln
4045  *
4046  * Redraw a line to the screen.
4047  *
4048  * @param beg Beginning line number.
4049  *
4050  * @param n Number of lines.
4051  *
4052  * @return Zero.
4053  **/
4054 RexxMethod3(int, // Return type
4055  OrxCurWredrawln, // Object_method name
4056  int, beg,
4057  int, n,
4058  CSELF, cself) // Self
4059 {
4060 
4061  if (cself == NULL) {
4062  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
4063  context->WholeNumberToObject(1),
4064  context->NewStringFromAsciiz("Window"));
4065  return 0;
4066  }
4067  return wredrawln((WINDOW *)cself, SUBTRACTONE(beg), n);
4068 }
4069 
4070 /**
4071  * Method: OrxCurWsyncdown
4072  *
4073  * Ensure subwindows are touched when the main window is
4074  * touched.
4075  *
4076  * @return Zero.
4077  **/
4078 RexxMethod1(int, // Return type
4079  OrxCurWsyncdown, // Object_method name
4080  CSELF, cself) // Self
4081 {
4082 
4083  if (cself == NULL) {
4084  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
4085  context->WholeNumberToObject(1),
4086  context->NewStringFromAsciiz("Window"));
4087  return 0;
4088  }
4089  wsyncdown((WINDOW *)cself);
4090  return 0;
4091 }
4092 
4093 /**
4094  * Method: OrxCurWsyncup
4095  *
4096  * Ensure parent windows are touched when the sub window is
4097  * touched.
4098  *
4099  * @return Zero.
4100  **/
4101 RexxMethod1(int, // Return type
4102  OrxCurWsyncup, // Object_method name
4103  CSELF, cself) // Self
4104 {
4105 
4106  if (cself == NULL) {
4107  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
4108  context->WholeNumberToObject(1),
4109  context->NewStringFromAsciiz("Window"));
4110  return 0;
4111  }
4112  wsyncup((WINDOW *)cself);
4113  return 0;
4114 }
4115 
4116 /**
4117  * Method: OrxCurWtouchln
4118  *
4119  * Mark one or more lines as changed.
4120  *
4121  * @param y Start line number.
4122  *
4123  * @param n Number of lines.
4124  *
4125  * @param bf Changed/Unchanged boolean.
4126  *
4127  * @return Zero.
4128  **/
4129 RexxMethod4(int, // Return type
4130  OrxCurWtouchln, // Object_method name
4131  int, y,
4132  int, n,
4133  logical_t, bf,
4134  CSELF, cself) // Self
4135 {
4136 
4137  if (cself == NULL) {
4138  context->RaiseException2(Rexx_Error_Incorrect_method_noclass,
4139  context->WholeNumberToObject(1),
4140  context->NewStringFromAsciiz("Window"));
4141  return 0;
4142  }
4143  return wtouchln((WINDOW *)cself, SUBTRACTONE(y), n, bf);
4144 }
4145 
4146 
4147 // build the actual function entry list
4150 };
4151 
4152 
4153 // build the actual method entry list
4155  REXX_METHOD(OrxCurVersion, OrxCurVersion),
4156  REXX_METHOD(OrxCurSetBase, OrxCurSetBase),
4157  REXX_METHOD(OrxCurInitscr, OrxCurInitscr),
4158  REXX_METHOD(OrxCurNewwin, OrxCurNewwin),
4159  REXX_METHOD(OrxCurNewwinfromptr, OrxCurNewwinfromptr),
4160  REXX_METHOD(OrxCurEndwin, OrxCurEndwin),
4161  REXX_METHOD(OrxCurRefresh, OrxCurRefresh),
4162  REXX_METHOD(OrxCurAddch, OrxCurAddch),
4163  REXX_METHOD(OrxCurMvaddch, OrxCurMvaddch),
4164  REXX_METHOD(OrxCurAddchstr, OrxCurAddchstr),
4165  REXX_METHOD(OrxCurMvaddchstr, OrxCurMvaddchstr),
4166  REXX_METHOD(OrxCurAddchnstr, OrxCurAddchnstr),
4167  REXX_METHOD(OrxCurMvaddchnstr, OrxCurMvaddchnstr),
4168  REXX_METHOD(OrxCurAddstr, OrxCurAddstr),
4169  REXX_METHOD(OrxCurMvaddstr, OrxCurMvaddstr),
4170  REXX_METHOD(OrxCurAddnstr, OrxCurAddnstr),
4171  REXX_METHOD(OrxCurMvaddnstr, OrxCurMvaddnstr),
4172  REXX_METHOD(OrxCurAssume_default_colors, OrxCurAssume_default_colors),
4173  REXX_METHOD(OrxCurAttroff, OrxCurAttroff),
4174  REXX_METHOD(OrxCurAttron, OrxCurAttron),
4175  REXX_METHOD(OrxCurAttrset, OrxCurAttrset),
4176  REXX_METHOD(OrxCurBaudrate, OrxCurBaudrate),
4177  REXX_METHOD(OrxCurBeep, OrxCurBeep),
4178  REXX_METHOD(OrxCurBkgd, OrxCurBkgd),
4179  REXX_METHOD(OrxCurBkgdset, OrxCurBkgdset),
4180  REXX_METHOD(OrxCurBorder, OrxCurBorder),
4181  REXX_METHOD(OrxCurAcs_map, OrxCurAcs_map),
4182  REXX_METHOD(OrxCurBox, OrxCurBox),
4183  REXX_METHOD(OrxCurCan_change_color, OrxCurCan_change_color),
4184  REXX_METHOD(OrxCurCbreak, OrxCurCbreak),
4185  REXX_METHOD(OrxCurNocbreak, OrxCurNocbreak),
4186  REXX_METHOD(OrxCurChgat, OrxCurChgat),
4187  REXX_METHOD(OrxCurMvchgat, OrxCurMvchgat),
4188  REXX_METHOD(OrxCurClear, OrxCurClear),
4189  REXX_METHOD(OrxCurClearok, OrxCurClearok),
4190  REXX_METHOD(OrxCurClrtobot, OrxCurClrtobot),
4191  REXX_METHOD(OrxCurClrtoeol, OrxCurClrtoeol),
4192  REXX_METHOD(OrxCurColor_set, OrxCurColor_set),
4193  REXX_METHOD(OrxCurColors, OrxCurColors),
4194  REXX_METHOD(OrxCurColor_pair, OrxCurColor_pair),
4195  REXX_METHOD(OrxCurColor_pairs, OrxCurColor_pairs),
4196  REXX_METHOD(OrxCurCols, OrxCurCols),
4197  REXX_METHOD(OrxCurCopywin, OrxCurCopywin),
4198  REXX_METHOD(OrxCurCurs_set, OrxCurCurs_set),
4199  REXX_METHOD(OrxCurCurses_version, OrxCurCurses_version),
4200  REXX_METHOD(OrxCurDelch, OrxCurDelch),
4201  REXX_METHOD(OrxCurDeleteln, OrxCurDeleteln),
4202  REXX_METHOD(OrxCurDelwin, OrxCurDelwin),
4203  REXX_METHOD(OrxCurDerwinprivate, OrxCurDerwinprivate),
4204  REXX_METHOD(OrxCurDupwinprivate, OrxCurDupwinprivate),
4205  REXX_METHOD(OrxCurDoupdate, OrxCurDoupdate),
4206  REXX_METHOD(OrxCurEcho, OrxCurEcho),
4207  REXX_METHOD(OrxCurNoecho, OrxCurNoecho),
4208  REXX_METHOD(OrxCurErase, OrxCurErase),
4209  REXX_METHOD(OrxCurErasechar, OrxCurErasechar),
4210  REXX_METHOD(OrxCurEchochar, OrxCurEchochar),
4211  REXX_METHOD(OrxCurFilter, OrxCurFilter),
4212  REXX_METHOD(OrxCurFlash, OrxCurFlash),
4213  REXX_METHOD(OrxCurFlushinp, OrxCurFlushinp),
4214  REXX_METHOD(OrxCurGetbegyx, OrxCurGetbegyx),
4215  REXX_METHOD(OrxCurGetbkgd, OrxCurGetbkgd),
4216  REXX_METHOD(OrxCurGetch, OrxCurGetch),
4217  REXX_METHOD(OrxCurMvgetch, OrxCurMvgetch),
4218  REXX_METHOD(OrxCurGetmaxyx, OrxCurGetmaxyx),
4219  REXX_METHOD(OrxCurGetparyx, OrxCurGetparyx),
4220  REXX_METHOD(OrxCurGetmouseprivate, OrxCurGetmouseprivate),
4221  REXX_METHOD(OrxCurGetstr, OrxCurGetstr),
4222  REXX_METHOD(OrxCurGetnstr, OrxCurGetnstr),
4223  REXX_METHOD(OrxCurMvgetstr, OrxCurMvgetstr),
4224  REXX_METHOD(OrxCurMvgetnstr, OrxCurMvgetnstr),
4225  REXX_METHOD(OrxCurGetwinprivate, OrxCurGetwinprivate),
4226  REXX_METHOD(OrxCurGetyx, OrxCurGetyx),
4227  REXX_METHOD(OrxCurHalfdelay, OrxCurHalfdelay),
4228  REXX_METHOD(OrxCurHas_colors, OrxCurHas_colors),
4229  REXX_METHOD(OrxCurHas_ic, OrxCurHas_ic),
4230  REXX_METHOD(OrxCurHas_il, OrxCurHas_il),
4231  REXX_METHOD(OrxCurHline, OrxCurHline),
4232  REXX_METHOD(OrxCurMvhline, OrxCurMvhline),
4233  REXX_METHOD(OrxCurIdcok, OrxCurIdcok),
4234  REXX_METHOD(OrxCurIdlok, OrxCurIdlok),
4235  REXX_METHOD(OrxCurImmedok, OrxCurImmedok),
4236  REXX_METHOD(OrxCurInch, OrxCurInch),
4237  REXX_METHOD(OrxCurMvinch, OrxCurMvinch),
4238  REXX_METHOD(OrxCurInchstr, OrxCurInchstr),
4239  REXX_METHOD(OrxCurMvinchstr, OrxCurMvinchstr),
4240  REXX_METHOD(OrxCurInchnstr, OrxCurInchstr),
4241  REXX_METHOD(OrxCurMvinchnstr, OrxCurMvinchnstr),
4242  REXX_METHOD(OrxCurInit_color, OrxCurInit_color),
4243  REXX_METHOD(OrxCurInit_pair, OrxCurInit_pair),
4244  REXX_METHOD(OrxCurInsch, OrxCurInsch),
4245  REXX_METHOD(OrxCurMvinsch, OrxCurMvinsch),
4246  REXX_METHOD(OrxCurInsdelln, OrxCurInsdelln),
4247  REXX_METHOD(OrxCurInsertln, OrxCurInsertln),
4248  REXX_METHOD(OrxCurInsstr, OrxCurInsstr),
4249  REXX_METHOD(OrxCurInsnstr, OrxCurInsnstr),
4250  REXX_METHOD(OrxCurMvinsstr, OrxCurMvinsstr),
4251  REXX_METHOD(OrxCurMvinsnstr, OrxCurMvinsnstr),
4252  REXX_METHOD(OrxCurInstr, OrxCurInstr),
4253  REXX_METHOD(OrxCurInnstr, OrxCurInnstr),
4254  REXX_METHOD(OrxCurMvinstr, OrxCurMvinstr),
4255  REXX_METHOD(OrxCurMvinnstr, OrxCurMvinnstr),
4256  REXX_METHOD(OrxCurIntrflush, OrxCurIntrflush),
4257  REXX_METHOD(OrxCurIsbitset, OrxCurIsbitset),
4258  REXX_METHOD(OrxCurIsendwin, OrxCurIsendwin),
4259  REXX_METHOD(OrxCurIs_linetouched, OrxCurIs_linetouched),
4260  REXX_METHOD(OrxCurIs_wintouched, OrxCurIs_wintouched),
4261  REXX_METHOD(OrxCurKeyname, OrxCurKeyname),
4262  REXX_METHOD(OrxCurKeypad, OrxCurKeypad),
4263  REXX_METHOD(OrxCurKillchar, OrxCurKillchar),
4264  REXX_METHOD(OrxCurLeaveok, OrxCurLeaveok),
4265  REXX_METHOD(OrxCurLines, OrxCurLines),
4266  REXX_METHOD(OrxCurLongname, OrxCurLongname),
4267  REXX_METHOD(OrxCurMeta, OrxCurMeta),
4268  REXX_METHOD(OrxCurMouse_trafo, OrxCurMouse_trafo),
4269  REXX_METHOD(OrxCurMousemask, OrxCurMousemask),
4270  REXX_METHOD(OrxCurMove, OrxCurMove),
4271  REXX_METHOD(OrxCurMvderwin, OrxCurMvderwin),
4272  REXX_METHOD(OrxCurMvwin, OrxCurMvwin),
4273  REXX_METHOD(OrxCurNapms, OrxCurNapms),
4274  REXX_METHOD(OrxCurNcurses_mouse_version, OrxCurNcurses_mouse_version),
4275  REXX_METHOD(OrxCurNcurses_version, OrxCurNcurses_version),
4276  REXX_METHOD(OrxCurNewpad, OrxCurNewpad),
4277  REXX_METHOD(OrxCurNl, OrxCurNl),
4278  REXX_METHOD(OrxCurNonl, OrxCurNonl),
4279  REXX_METHOD(OrxCurNodelay, OrxCurNodelay),
4280  REXX_METHOD(OrxCurNotimeout, OrxCurNotimeout),
4281  REXX_METHOD(OrxCurOverlay, OrxCurOverlay),
4282  REXX_METHOD(OrxCurOverwrite, OrxCurOverwrite),
4283  REXX_METHOD(OrxCurPair_content, OrxCurPair_content),
4284  REXX_METHOD(OrxCurPair_number, OrxCurPair_number),
4285  REXX_METHOD(OrxCurPechochar, OrxCurPechochar),
4286  REXX_METHOD(OrxCurPnoutrefresh, OrxCurPnoutrefresh),
4287  REXX_METHOD(OrxCurPrefresh, OrxCurPrefresh),
4288  REXX_METHOD(OrxCurPutwin, OrxCurPutwin),
4289  REXX_METHOD(OrxCurQiflush, OrxCurQiflush),
4290  REXX_METHOD(OrxCurNoqiflush, OrxCurNoqiflush),
4291  REXX_METHOD(OrxCurRaw, OrxCurRaw),
4292  REXX_METHOD(OrxCurNoraw, OrxCurNoraw),
4293  REXX_METHOD(OrxCurRedrawwin, OrxCurRedrawwin),
4294  REXX_METHOD(OrxCurScr_dump, OrxCurScr_dump),
4295  REXX_METHOD(OrxCurScr_restore, OrxCurScr_restore),
4296  REXX_METHOD(OrxCurScrl, OrxCurScrl),
4297  REXX_METHOD(OrxCurScroll, OrxCurScroll),
4298  REXX_METHOD(OrxCurScrollok, OrxCurScrollok),
4299  REXX_METHOD(OrxCurSetscrreg, OrxCurSetscrreg),
4300  REXX_METHOD(OrxCurSlk_attr, OrxCurSlk_attr),
4301  REXX_METHOD(OrxCurSlk_attroff, OrxCurSlk_attroff),
4302  REXX_METHOD(OrxCurSlk_attron, OrxCurSlk_attron),
4303  REXX_METHOD(OrxCurSlk_attrset, OrxCurSlk_attrset),
4304  REXX_METHOD(OrxCurSlk_clear, OrxCurSlk_clear),
4305  REXX_METHOD(OrxCurSlk_color, OrxCurSlk_color),
4306  REXX_METHOD(OrxCurSlk_init, OrxCurSlk_init),
4307  REXX_METHOD(OrxCurSlk_label, OrxCurSlk_label),
4308  REXX_METHOD(OrxCurSlk_noutrefresh, OrxCurSlk_noutrefresh),
4309  REXX_METHOD(OrxCurSlk_refresh, OrxCurSlk_refresh),
4310  REXX_METHOD(OrxCurSlk_restore, OrxCurSlk_restore),
4311  REXX_METHOD(OrxCurSlk_set, OrxCurSlk_set),
4312  REXX_METHOD(OrxCurSlk_touch, OrxCurSlk_touch),
4313  REXX_METHOD(OrxCurStandend, OrxCurStandend),
4314  REXX_METHOD(OrxCurStandout, OrxCurStandout),
4315  REXX_METHOD(OrxCurStart_color, OrxCurStart_color),
4316  REXX_METHOD(OrxCurSubwinprivate, OrxCurSubwinprivate),
4317  REXX_METHOD(OrxCurSubpadprivate, OrxCurSubpadprivate),
4318  REXX_METHOD(OrxCurSyncok, OrxCurSyncok),
4319  REXX_METHOD(OrxCurTabsize, OrxCurTabsize),
4320  REXX_METHOD(OrxCurTermattrs, OrxCurTermattrs),
4321  REXX_METHOD(OrxCurTermname, OrxCurTermname),
4322  REXX_METHOD(OrxCurTimeout, OrxCurTimeout),
4323  REXX_METHOD(OrxCurTouchline, OrxCurTouchline),
4324  REXX_METHOD(OrxCurTouchwin, OrxCurTouchwin),
4325  REXX_METHOD(OrxCurTypeahead, OrxCurTypeahead),
4326  REXX_METHOD(OrxCurUnctrl, OrxCurUnctrl),
4327  REXX_METHOD(OrxCurUngetch, OrxCurUngetch),
4328  REXX_METHOD(OrxCurUntouchwin, OrxCurUntouchwin),
4329  REXX_METHOD(OrxCurUse_default_colors, OrxCurUse_default_colors),
4330  REXX_METHOD(OrxCurUse_env, OrxCurUse_env),
4331  REXX_METHOD(OrxCurVline, OrxCurVline),
4332  REXX_METHOD(OrxCurMvvline, OrxCurMvvline),
4333  REXX_METHOD(OrxCurWenclose, OrxCurWenclose),
4334  REXX_METHOD(OrxCurWnoutrefresh, OrxCurWnoutrefresh),
4335  REXX_METHOD(OrxCurWredrawln, OrxCurWredrawln),
4336  REXX_METHOD(OrxCurWsyncdown, OrxCurWsyncdown),
4337  REXX_METHOD(OrxCurWsyncup, OrxCurWsyncup),
4338  REXX_METHOD(OrxCurWtouchln, OrxCurWtouchln),
4340 };
4341 
4342 
4345  REXX_INTERPRETER_4_0_0, // anything after 4.0.0 will work
4346  "orxncurses", // name of the package
4347  VERSTRING(VMAJOR,VMINOR,VREL), // package information
4348  NULL, // no load functions
4349  NULL, // no unload functions
4350  orxcur_routines, // the exported routines
4351  orxcur_methods // the exported methods
4352 };
4353 
4354 // package loading stub.
4356 
#define nl
#define argumentExists(i)
Definition: oorexxapi.h:3777
#define REXX_INTERPRETER_4_0_0
Definition: oorexxapi.h:216
void * CSELF
Definition: oorexxapi.h:4329
#define REXX_METHOD(n, e)
Definition: oorexxapi.h:211
#define REXX_LAST_ROUTINE()
Definition: oorexxapi.h:193
#define REXX_LAST_METHOD()
Definition: oorexxapi.h:212
#define STANDARD_PACKAGE_HEADER
Definition: oorexxapi.h:230
#define Rexx_Error_Incorrect_method_noclass
Definition: oorexxerrors.h:506
RexxMethod4(int, OrxCurNewwin, int, nlines, int, ncols, int, begin_y, int, begin_x)
Definition: orxncurses.cpp:153
RexxMethodEntry orxcur_methods[]
#define ADDONE(x)
Definition: orxncurses.cpp:65
RexxMethod6(int, OrxCurMvchgat, int, y, int, x, int, n, int, attr, int, color, CSELF, cself)
Definition: orxncurses.cpp:852
#define VERSTRING(major, minor, rel)
Definition: orxncurses.cpp:62
RexxMethod7(int, OrxCurPnoutrefresh, int, minrow, int, mincol, int, sminrow, int, smincol, int, smaxrow, int, smaxcol, CSELF, cself)
RexxMethod0(RexxObjectPtr, OrxCurVersion)
Definition: orxncurses.cpp:94
RexxMethod3(int, OrxCurAddchnstr, CSTRING, str, int, n, CSELF, cself)
Definition: orxncurses.cpp:340
RexxRoutineEntry orxcur_routines[]
RexxPackageEntry orxcur_package_entry
bool onebased
Definition: orxncurses.cpp:64
OOREXX_GET_PACKAGE(orxcur)
RexxMethod9(int, OrxCurBorder, int, ls, int, rs, int, ts, int, bs, int, tl, int, tr, int, bl, int, br, CSELF, cself)
Definition: orxncurses.cpp:696
RexxMethod1(logical_t, OrxCurSetBase, OPTIONAL_logical_t, base)
Definition: orxncurses.cpp:111
RexxMethod5(int, OrxCurMvaddchnstr, int, y, int, x, CSTRING, str, int, n, CSELF, cself)
Definition: orxncurses.cpp:372
#define SUBTRACTONE(x)
Definition: orxncurses.cpp:66
RexxMethod2(int, OrxCurAddch, CSTRING, str, CSELF, cself)
Definition: orxncurses.cpp:229
const char * CSTRING
Definition: rexx.h:78
size_t logical_t
Definition: rexx.h:231
struct _RexxBufferStringObject * RexxBufferStringObject
Definition: rexx.h:129
struct _RexxObjectPtr * RexxObjectPtr
Definition: rexx.h:127
void * POINTER
Definition: rexx.h:79
Definition: oorexxapi.h:198
Definition: oorexxapi.h:242
Definition: oorexxapi.h:177
int int32_t