annotate Modules/_cursesmodule.c @ 7278:59d2761ba1cf legacy-trunk

Remove obsolete pagenumbering / pagestyle cruft.
author Fred Drake <fdrake@acm.org>
date Fri, 13 Feb 1998 07:08:56 +0000
parents 2c29b8982643
children 0a6ed384af06
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1 /***********************************************************
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
2 Copyright 1994 by Lance Ellinghouse,
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
3 Cathedral City, California Republic, United States of America.
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
4
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
5 All Rights Reserved
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
6
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
7 Permission to use, copy, modify, and distribute this software and its
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
8 documentation for any purpose and without fee is hereby granted,
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
9 provided that the above copyright notice appear in all copies and that
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
10 both that copyright notice and this permission notice appear in
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
11 supporting documentation, and that the name of Lance Ellinghouse
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
12 not be used in advertising or publicity pertaining to distribution
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
13 of the software without specific, written prior permission.
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
14
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
15 LANCE ELLINGHOUSE DISCLAIMS ALL WARRANTIES WITH REGARD TO
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
16 THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
17 FITNESS, IN NO EVENT SHALL LANCE ELLINGHOUSE BE LIABLE FOR ANY SPECIAL,
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
18 INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
19 FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
20 NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
21 WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
22
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
23 ******************************************************************/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
24
1858
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
25 /******************************************************************
1859
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
26 This is a curses implementation. I have tried to be as complete
1858
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
27 as possible. If there are functions you need that are not included,
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
28 please let me know and/or send me some diffs.
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
29
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
30 There are 3 basic types exported by this module:
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
31 1) Screen - This is not currently used
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
32 2) Window - This is the basic type. This is equivalent to "WINDOW *".
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
33 3) Pad - This is similar to Window, but works with Pads as defined
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
34 in curses.
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
35
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
36 Most of the routines can be looked up using the curses man page.
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
37
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
38 Here is a list of the currently supported methods and attributes
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
39 in the curses module:
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
40
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
41 Return Value Func/Attr Description
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
42 --------------------------------------------------------------------------
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
43 StringObject version A string representing the current
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
44 version of this module.
1858
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
45 WindowObject initscr() This initializes the screen for use
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
46 None endwin() Closes down the screen and returns
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
47 things as they were before calling
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
48 initscr()
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
49 True/FalseObject isendwin() Has endwin() been called?
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
50 None doupdate() Updates screen
1858
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
51 WindowObject newwin(nlines,ncols,begin_y,begin_x)
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
52 newwin(begin_y,begin_x)
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
53 newwin() creates and returns
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
54 a new window.
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
55 None beep() Beep the screen if possible
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
56 None flash() Flash the screen if possible
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
57 None ungetch(int) Push the int back so next getch()
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
58 will return it.
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
59 Note: argument is an INT, not a CHAR
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
60 None flushinp() Flush all input buffers
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
61 None cbreak() Enter cbreak mode
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
62 None nocbreak() Leave cbreak mode
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
63 None echo() Enter echo mode
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
64 None noecho() Leave echo mode
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
65 None nl() Enter nl mode
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
66 None nonl() Leave nl mode
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
67 None raw() Enter raw mode
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
68 None noraw() Leave raw mode
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
69 None intrflush(int) Set or reset interruptable flush
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
70 mode, int=1 if set, 0 if notset.
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
71 None meta(int) Allow 8 bit or 7 bit chars.
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
72 int=1 is 8 bit, int=0 is 7 bit
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
73 StringObject keyname(int) return the text representation
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
74 of a KEY_ value. (see below)
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
75
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
76 Here is a list of the currently supported methods and attributes
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
77 in the WindowObject:
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
78
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
79 Return Value Func/Attr Description
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
80 --------------------------------------------------------------------------
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
81 None refresh() Do refresh
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
82 None nooutrefresh() Mark for refresh but wait
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
83 None mvwin(new_y,new_x) Move Window
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
84 None move(new_y,new_x) Move Cursor
1858
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
85 WindowObject subwin(nlines,ncols,begin_y,begin_x)
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
86 subwin(begin_y,begin_x)
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
87 None addch(y,x,ch,attr)
1858
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
88 addch(y,x,ch)
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
89 addch(ch,attr)
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
90 addch(ch)
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
91 None insch(y,x,ch,attr)
1858
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
92 insch(y,x,ch)
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
93 insch(ch,attr)
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
94 insch(ch)
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
95 None delch(y,x)
1858
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
96 delch()
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
97 None echochar(ch,attr)
1858
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
98 echochar(ch)
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
99 None addstr(y,x,str,attr)
1858
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
100 addstr(y,x,str)
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
101 addstr(str,attr)
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
102 addstr(str)
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
103 None attron(attr)
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
104 None attroff(attr)
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
105 None attrset(sttr)
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
106 None standend()
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
107 None standout()
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
108 None border(ls,rs,ts,bs,tl,tr,bl,br) (accepts 0-8 INT args)
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
109 None box(vertch,horch) vertch and horch are INTS
1858
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
110 box()
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
111 None hline(y,x,ch,n)
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
112 hline(ch,n)
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
113 None vline(y,x,ch,n)
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
114 vline(ch,n)
1858
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
115 None erase()
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
116 None deleteln()
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
117 None insertln()
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
118 (y,x) getyx()
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
119 (y,x) getbegyx()
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
120 (y,x) getmaxyx()
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
121 None clear()
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
122 None clrtobot()
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
123 None clrtoeol()
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
124 None scroll()
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
125 None touchwin()
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
126 None touchline(start,count)
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
127 IntObject getch(y,x)
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
128 getch()
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
129 StringObject getstr(y,x)
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
130 getstr()
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
131 IntObject inch(y,x)
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
132 inch()
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
133 None clearok(int) int=0 or int=1
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
134 None idlok(int) int=0 or int=1
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
135 None leaveok(int) int=0 or int=1
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
136 None scrollok(int) int=0 or int=1
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
137 None setscrreg(top,bottom)
2358
4c43cbdcd524 bump version, add __version__ back in
Guido van Rossum <guido@python.org>
parents: 2357
diff changeset
138 None keypad(int) int=0 or int=1
1858
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
139 None nodelay(int) int=0 or int=1
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
140 None notimeout(int) int=0 or int=1
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
141 ******************************************************************/
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
142
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
143
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
144 /* curses module */
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
145
1888
be956b1efb97 * various modules: #include "Python.h" and remove most remporary
Guido van Rossum <guido@python.org>
parents: 1867
diff changeset
146 #include "Python.h"
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
147
3417
e1df90205a33 Include ncurses.h where needed
Guido van Rossum <guido@python.org>
parents: 2569
diff changeset
148 #ifdef HAVE_NCURSES_H
e1df90205a33 Include ncurses.h where needed
Guido van Rossum <guido@python.org>
parents: 2569
diff changeset
149 /* Now let's hope there aren't systems that have a broken ncurses.h */
e1df90205a33 Include ncurses.h where needed
Guido van Rossum <guido@python.org>
parents: 2569
diff changeset
150 #include <ncurses.h>
e1df90205a33 Include ncurses.h where needed
Guido van Rossum <guido@python.org>
parents: 2569
diff changeset
151 #else
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
152 #include <curses.h>
3417
e1df90205a33 Include ncurses.h where needed
Guido van Rossum <guido@python.org>
parents: 2569
diff changeset
153 #endif
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
154
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
155 typedef struct {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
156 PyObject_HEAD
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
157 SCREEN *scr;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
158 } PyCursesScreenObject;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
159
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
160 typedef struct {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
161 PyObject_HEAD
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
162 WINDOW *win;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
163 WINDOW *parent;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
164 } PyCursesWindowObject;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
165
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
166 typedef struct {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
167 PyObject_HEAD
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
168 WINDOW *pad;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
169 } PyCursesPadObject;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
170
4600
d36250aefb82 Keep gcc -Wall happy.
Guido van Rossum <guido@python.org>
parents: 3417
diff changeset
171 #if 0
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
172 staticforward PyTypeObject PyCursesScreen_Type;
4600
d36250aefb82 Keep gcc -Wall happy.
Guido van Rossum <guido@python.org>
parents: 3417
diff changeset
173 #endif
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
174 staticforward PyTypeObject PyCursesWindow_Type;
4600
d36250aefb82 Keep gcc -Wall happy.
Guido van Rossum <guido@python.org>
parents: 3417
diff changeset
175 #if 0
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
176 staticforward PyTypeObject PyCursesPad_Type;
4600
d36250aefb82 Keep gcc -Wall happy.
Guido van Rossum <guido@python.org>
parents: 3417
diff changeset
177 #endif
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
178
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
179 #define PyCursesScreen_Check(v) ((v)->ob_type == &PyCursesScreen_Type)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
180 #define PyCursesWindow_Check(v) ((v)->ob_type == &PyCursesWindow_Type)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
181 #define PyCursesPad_Check(v) ((v)->ob_type == &PyCursesPad_Type)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
182
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
183 /* Defines */
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
184 static PyObject *PyCursesError; /* For exception curses.error */
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
185
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
186 /* Catch-all error messages */
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
187 static char *catchall_ERR = "curses function returned ERR";
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
188 static char *catchall_NULL = "curses function returned NULL";
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
189
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
190 /* Tells whether initscr() has been called to initialise curses */
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
191 static int initialised = FALSE;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
192
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
193 #define ARG_COUNT(X) \
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
194 (((X) == NULL) ? 0 : (PyTuple_Check(X) ? PyTuple_Size(X) : 1))
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
195
1858
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
196 /******************************************************************
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
197
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
198 Change Log:
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
199
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
200 Version 1.2: 95/02/23 (Steve Clift)
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
201 Fixed several potential core-dumping bugs.
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
202 Reworked arg parsing where variable arg lists are used.
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
203 Generate exceptions when ERR or NULL is returned by curses functions.
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
204 Changed return types to match SysV Curses manual descriptions.
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
205 Added keypad() to window method list.
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
206 Added border(), hline() and vline() window methods.
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
207
1859
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
208 Version 1.1: 94/08/31:
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
209 Minor fixes given by Guido.
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
210 Changed 'ncurses' to 'curses'
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
211 Changed '__version__' to 'version'
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
212 Added PyErr_Clear() where needed
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
213 Moved ACS_* attribute initialization to PyCurses_InitScr() to fix
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
214 crash on SGI
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
215
1858
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
216 Version 1.0: 94/08/30:
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
217 This is the first release of this software.
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
218 Released to the Internet via python-list@cwi.nl
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
219
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
220 ******************************************************************/
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
221
2358
4c43cbdcd524 bump version, add __version__ back in
Guido van Rossum <guido@python.org>
parents: 2357
diff changeset
222 char *PyCursesVersion = "1.2";
1858
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
223
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
224 /*
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
225 * Check the return code from a curses function and return None
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
226 * or raise an exception as appropriate.
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
227 */
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
228
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
229 static PyObject *
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
230 PyCursesCheckERR(code, fname)
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
231 int code;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
232 char *fname;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
233 {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
234 char buf[100];
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
235
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
236 if (code != ERR) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
237 Py_INCREF(Py_None);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
238 return Py_None;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
239 } else {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
240 if (fname == NULL) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
241 PyErr_SetString(PyCursesError, catchall_ERR);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
242 } else {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
243 strcpy(buf, fname);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
244 strcat(buf, "() returned ERR");
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
245 PyErr_SetString(PyCursesError, buf);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
246 }
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
247 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
248 }
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
249 }
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
250
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
251
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
252 static int
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
253 PyCursesInitialised()
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
254 {
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
255 if (initialised == TRUE)
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
256 return 1;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
257 else {
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
258 PyErr_SetString(PyCursesError, "must call initscr() first");
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
259 return 0;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
260 }
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
261 }
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
262
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
263
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
264 /* ------------- SCREEN routines --------------- */
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
265
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
266 #ifdef NOT_YET
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
267 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
268 PyCursesScreen_New(arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
269 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
270 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
271 char *term_type;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
272 PyFileObject *in_fo;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
273 PyFileObject *out_fo;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
274 PyCursesScreenObject *xp;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
275 xp = PyObject_NEW(PyCursesScreenObject, &PyCursesScreen_Type);
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
276 if (xp == NULL)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
277 return NULL;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
278 return (PyObject *)xp;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
279 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
280 #endif
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
281
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
282
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
283 /* ------------- WINDOW routines --------------- */
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
284
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
285 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
286 PyCursesWindow_New(win)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
287 WINDOW *win;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
288 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
289 PyCursesWindowObject *wo;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
290
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
291 wo = PyObject_NEW(PyCursesWindowObject, &PyCursesWindow_Type);
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
292 if (wo == NULL)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
293 return NULL;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
294 wo->win = win;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
295 wo->parent = (WINDOW *)NULL;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
296 return (PyObject *)wo;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
297 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
298
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
299 static void
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
300 PyCursesWindow_Dealloc(wo)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
301 PyCursesWindowObject *wo;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
302 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
303 if (wo->win != stdscr)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
304 delwin(wo->win);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
305 PyMem_DEL(wo);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
306 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
307
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
308 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
309 PyCursesWindow_Refresh(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
310 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
311 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
312 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
313 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
314 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
315 return PyCursesCheckERR(wrefresh(self->win), "wrefresh");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
316 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
317
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
318 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
319 PyCursesWindow_NoOutRefresh(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
320 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
321 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
322 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
323 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
324 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
325 return PyCursesCheckERR(wnoutrefresh(self->win), "wnoutrefresh");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
326 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
327
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
328 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
329 PyCursesWindow_MoveWin(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
330 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
331 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
332 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
333 int x, y;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
334 if (!PyArg_Parse(arg,"(ii);y,x", &y, &x))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
335 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
336 return PyCursesCheckERR(mvwin(self->win,y,x), "mvwin");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
337 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
338
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
339 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
340 PyCursesWindow_Move(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
341 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
342 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
343 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
344 int x, y;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
345 if (!PyArg_Parse(arg,"(ii);y,x", &y, &x))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
346 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
347 return PyCursesCheckERR(wmove(self->win,y,x), "wmove");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
348 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
349
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
350 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
351 PyCursesWindow_SubWin(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
352 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
353 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
354 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
355 WINDOW *win;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
356 PyCursesWindowObject *rtn_win;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
357 int nlines, ncols, begin_y, begin_x;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
358
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
359 nlines = 0;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
360 ncols = 0;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
361 switch (ARG_COUNT(arg)) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
362 case 2:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
363 if (!PyArg_Parse(arg,"(ii);begin_y,begin_x",&begin_y,&begin_x))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
364 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
365 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
366 case 4:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
367 if (!PyArg_Parse(arg, "(iiii);nlines,ncols,begin_y,begin_x",
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
368 &nlines,&ncols,&begin_y,&begin_x))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
369 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
370 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
371 default:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
372 PyErr_SetString(PyExc_TypeError, "subwin requires 2 or 4 arguments");
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
373 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
374 }
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
375 win = subwin(self->win,nlines,ncols,begin_y,begin_x);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
376 if (win == NULL) {
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
377 PyErr_SetString(PyCursesError, catchall_NULL);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
378 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
379 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
380 rtn_win = (PyCursesWindowObject *)PyCursesWindow_New(win);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
381 rtn_win->parent = self->win;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
382 return (PyObject *)rtn_win;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
383 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
384
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
385 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
386 PyCursesWindow_AddCh(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
387 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
388 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
389 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
390 int rtn;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
391 int x, y;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
392 int ch;
4600
d36250aefb82 Keep gcc -Wall happy.
Guido van Rossum <guido@python.org>
parents: 3417
diff changeset
393 int attr, attr_old = 0;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
394 int use_xy = FALSE, use_attr = FALSE;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
395
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
396 switch (ARG_COUNT(arg)) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
397 case 1:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
398 if (!PyArg_Parse(arg, "i;ch", &ch))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
399 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
400 break;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
401 case 2:
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
402 if (!PyArg_Parse(arg,"(ii);ch,attr", &ch, &attr))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
403 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
404 use_attr = TRUE;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
405 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
406 case 3:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
407 if (!PyArg_Parse(arg,"(iii);y,x,ch", &y, &x, &ch))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
408 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
409 use_xy = TRUE;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
410 break;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
411 case 4:
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
412 if (!PyArg_Parse(arg,"(iiii);y,x,ch,attr", &y, &x, &ch, &attr))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
413 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
414 use_xy = use_attr = TRUE;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
415 break;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
416 default:
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
417 PyErr_SetString(PyExc_TypeError, "addch requires 1 to 4 arguments");
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
418 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
419 }
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
420
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
421 if (use_attr == TRUE) {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
422 attr_old = getattrs(self->win);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
423 wattrset(self->win,attr);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
424 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
425 if (use_xy == TRUE)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
426 rtn = mvwaddch(self->win,y,x,ch);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
427 else
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
428 rtn = waddch(self->win,ch);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
429 if (use_attr == TRUE)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
430 wattrset(self->win,attr_old);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
431
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
432 return PyCursesCheckERR(rtn, "[mv]waddch");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
433 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
434
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
435 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
436 PyCursesWindow_InsCh(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
437 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
438 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
439 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
440 int rtn;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
441 int x, y;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
442 int ch;
4600
d36250aefb82 Keep gcc -Wall happy.
Guido van Rossum <guido@python.org>
parents: 3417
diff changeset
443 int attr, attr_old = 0;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
444 int use_xy = TRUE, use_attr = FALSE;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
445
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
446 switch (ARG_COUNT(arg)) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
447 case 1:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
448 if (!PyArg_Parse(arg, "i;ch", &ch))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
449 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
450 break;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
451 case 2:
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
452 if (!PyArg_Parse(arg,"(ii);ch,attr", &ch, &attr))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
453 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
454 use_attr = TRUE;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
455 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
456 case 3:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
457 if (!PyArg_Parse(arg,"(iii);y,x,ch", &y, &x, &ch))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
458 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
459 use_xy = TRUE;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
460 break;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
461 case 4:
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
462 if (!PyArg_Parse(arg,"(iiii);y,x,ch,attr", &y, &x, &ch, &attr))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
463 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
464 use_xy = use_attr = TRUE;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
465 break;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
466 default:
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
467 PyErr_SetString(PyExc_TypeError, "insch requires 1 to 4 arguments");
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
468 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
469 }
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
470
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
471 if (use_attr == TRUE) {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
472 attr_old = getattrs(self->win);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
473 wattrset(self->win,attr);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
474 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
475 if (use_xy == TRUE)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
476 rtn = mvwinsch(self->win,y,x,ch);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
477 else
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
478 rtn = winsch(self->win,ch);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
479 if (use_attr == TRUE)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
480 wattrset(self->win,attr_old);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
481
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
482 return PyCursesCheckERR(rtn, "[mv]winsch");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
483 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
484
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
485 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
486 PyCursesWindow_DelCh(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
487 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
488 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
489 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
490 int rtn;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
491 int x, y;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
492
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
493 switch (ARG_COUNT(arg)) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
494 case 0:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
495 rtn = wdelch(self->win);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
496 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
497 case 2:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
498 if (!PyArg_Parse(arg,"(ii);y,x", &y, &x))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
499 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
500 rtn = mvwdelch(self->win,y,x);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
501 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
502 default:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
503 PyErr_SetString(PyExc_TypeError, "delch requires 0 or 2 arguments");
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
504 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
505 }
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
506
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
507 return PyCursesCheckERR(rtn, "[mv]wdelch");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
508 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
509
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
510 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
511 PyCursesWindow_EchoChar(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
512 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
513 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
514 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
515 int rtn;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
516 int ch;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
517 int attr, attr_old;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
518
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
519 switch (ARG_COUNT(arg)) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
520 case 1:
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
521 if (!PyArg_Parse(arg,"i;ch", &ch))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
522 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
523 rtn = wechochar(self->win,ch);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
524 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
525 case 2:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
526 if (!PyArg_Parse(arg,"(ii);ch,attr", &ch, &attr))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
527 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
528 attr_old = getattrs(self->win);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
529 wattrset(self->win,attr);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
530 rtn = wechochar(self->win,ch);
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
531 wattrset(self->win,attr_old);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
532 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
533 default:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
534 PyErr_SetString(PyExc_TypeError, "echochar requires 1 or 2 arguments");
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
535 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
536 }
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
537
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
538 return PyCursesCheckERR(rtn, "wechochar");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
539 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
540
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
541 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
542 PyCursesWindow_AddStr(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
543 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
544 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
545 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
546 int rtn;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
547 int x, y;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
548 char *str;
4600
d36250aefb82 Keep gcc -Wall happy.
Guido van Rossum <guido@python.org>
parents: 3417
diff changeset
549 int attr, attr_old = 0;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
550 int use_xy = FALSE, use_attr = FALSE;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
551
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
552 switch (ARG_COUNT(arg)) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
553 case 1:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
554 if (!PyArg_Parse(arg,"s;str", &str))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
555 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
556 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
557 case 2:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
558 if (!PyArg_Parse(arg,"(si);str,attr", &str, &attr))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
559 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
560 use_attr = TRUE;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
561 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
562 case 3:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
563 if (!PyArg_Parse(arg,"(iis);y,x,str", &y, &x, &str))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
564 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
565 use_xy = TRUE;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
566 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
567 case 4:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
568 if (!PyArg_Parse(arg,"(iisi);y,x,str,attr", &y, &x, &str, &attr))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
569 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
570 use_xy = use_attr = TRUE;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
571 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
572 default:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
573 PyErr_SetString(PyExc_TypeError, "addstr requires 1 to 4 arguments");
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
574 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
575 }
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
576
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
577 if (use_attr == TRUE) {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
578 attr_old = getattrs(self->win);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
579 wattrset(self->win,attr);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
580 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
581 if (use_xy == TRUE)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
582 rtn = mvwaddstr(self->win,y,x,str);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
583 else
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
584 rtn = waddstr(self->win,str);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
585 if (use_attr == TRUE)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
586 wattrset(self->win,attr_old);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
587
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
588 return PyCursesCheckERR(rtn, "[mv]waddstr");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
589 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
590
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
591 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
592 PyCursesWindow_AttrOn(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
593 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
594 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
595 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
596 int ch;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
597 if (!PyArg_Parse(arg,"i;attr", &ch))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
598 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
599 wattron(self->win,ch);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
600 Py_INCREF(Py_None);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
601 return Py_None;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
602 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
603
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
604 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
605 PyCursesWindow_AttrOff(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
606 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
607 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
608 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
609 int ch;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
610 if (!PyArg_Parse(arg,"i;attr", &ch))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
611 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
612 wattroff(self->win,ch);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
613 Py_INCREF(Py_None);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
614 return Py_None;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
615 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
616
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
617 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
618 PyCursesWindow_AttrSet(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
619 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
620 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
621 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
622 int ch;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
623 if (!PyArg_Parse(arg,"i;attr", &ch))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
624 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
625 wattrset(self->win,ch);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
626 Py_INCREF(Py_None);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
627 return Py_None;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
628 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
629
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
630 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
631 PyCursesWindow_StandEnd(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
632 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
633 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
634 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
635 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
636 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
637 wstandend(self->win);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
638 Py_INCREF(Py_None);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
639 return Py_None;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
640 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
641
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
642 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
643 PyCursesWindow_StandOut(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
644 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
645 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
646 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
647 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
648 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
649 wstandout(self->win);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
650 Py_INCREF(Py_None);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
651 return Py_None;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
652 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
653
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
654 static PyObject *
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
655 PyCursesWindow_Border(self, args)
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
656 PyCursesWindowObject *self;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
657 PyObject *args;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
658 {
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
659 int ls, rs, ts, bs, tl, tr, bl, br;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
660 ls = rs = ts = bs = tl = tr = bl = br = 0;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
661 if (!PyArg_ParseTuple(args,"|iiiiiiii;ls,rs,ts,bs,tl,tr,bl,br",
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
662 &ls, &rs, &ts, &bs, &tl, &tr, &bl, &br))
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
663 return NULL;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
664 wborder(self->win, ls, rs, ts, bs, tl, tr, bl, br);
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
665 Py_INCREF(Py_None);
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
666 return Py_None;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
667 }
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
668
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
669 static PyObject *
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
670 PyCursesWindow_Box(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
671 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
672 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
673 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
674 int ch1=0,ch2=0;
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
675 if (!PyArg_NoArgs(arg)) {
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
676 PyErr_Clear();
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
677 if (!PyArg_Parse(arg,"(ii);vertch,horch", &ch1, &ch2))
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
678 return NULL;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
679 }
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
680 box(self->win,ch1,ch2);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
681 Py_INCREF(Py_None);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
682 return Py_None;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
683 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
684
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
685 static PyObject *
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
686 PyCursesWindow_Hline(self, args)
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
687 PyCursesWindowObject *self;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
688 PyObject *args;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
689 {
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
690 int ch, n, x, y, code = OK;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
691 switch (ARG_COUNT(args)) {
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
692 case 2:
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
693 if (!PyArg_Parse(args, "(ii);ch,n", &ch, &n))
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
694 return NULL;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
695 break;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
696 case 4:
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
697 if (!PyArg_Parse(args, "(iiii);y,x,ch,n", &y, &x, &ch, &n))
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
698 return NULL;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
699 code = wmove(self->win, y, x);
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
700 break;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
701 default:
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
702 PyErr_SetString(PyExc_TypeError, "hline requires 2 or 4 arguments");
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
703 return NULL;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
704 }
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
705 if (code != ERR)
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
706 whline(self->win, ch, n);
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
707 return PyCursesCheckERR(code, "wmove");
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
708 }
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
709
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
710 static PyObject *
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
711 PyCursesWindow_Vline(self, args)
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
712 PyCursesWindowObject *self;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
713 PyObject *args;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
714 {
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
715 int ch, n, x, y, code = OK;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
716 switch (ARG_COUNT(args)) {
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
717 case 2:
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
718 if (!PyArg_Parse(args, "(ii);ch,n", &ch, &n))
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
719 return NULL;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
720 break;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
721 case 4:
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
722 if (!PyArg_Parse(args, "(iiii);y,x,ch,n", &y, &x, &ch, &n))
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
723 return NULL;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
724 code = wmove(self->win, y, x);
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
725 break;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
726 default:
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
727 PyErr_SetString(PyExc_TypeError, "vline requires 2 or 4 arguments");
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
728 return NULL;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
729 }
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
730 if (code != ERR)
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
731 wvline(self->win, ch, n);
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
732 return PyCursesCheckERR(code, "wmove");
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
733 }
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
734
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
735 static PyObject *
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
736 PyCursesWindow_Erase(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
737 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
738 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
739 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
740 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
741 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
742 werase(self->win);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
743 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
744 return Py_None;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
745 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
746
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
747 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
748 PyCursesWindow_DeleteLine(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
749 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
750 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
751 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
752 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
753 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
754 return PyCursesCheckERR(wdeleteln(self->win), "wdeleteln");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
755 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
756
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
757 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
758 PyCursesWindow_InsertLine(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
759 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
760 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
761 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
762 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
763 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
764 return PyCursesCheckERR(winsertln(self->win), "winsertln");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
765 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
766
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
767 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
768 PyCursesWindow_GetYX(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
769 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
770 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
771 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
772 int x, y;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
773 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
774 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
775 getyx(self->win,y,x);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
776 return Py_BuildValue("(ii)", y, x);
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
777 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
778
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
779 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
780 PyCursesWindow_GetBegYX(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
781 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
782 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
783 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
784 int x, y;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
785 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
786 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
787 getbegyx(self->win,y,x);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
788 return Py_BuildValue("(ii)", y, x);
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
789 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
790
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
791 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
792 PyCursesWindow_GetMaxYX(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
793 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
794 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
795 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
796 int x, y;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
797 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
798 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
799 getmaxyx(self->win,y,x);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
800 return Py_BuildValue("(ii)", y, x);
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
801 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
802
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
803 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
804 PyCursesWindow_Clear(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
805 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
806 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
807 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
808 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
809 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
810 wclear(self->win);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
811 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
812 return Py_None;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
813 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
814
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
815 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
816 PyCursesWindow_ClearToBottom(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
817 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
818 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
819 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
820 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
821 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
822 wclrtobot(self->win);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
823 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
824 return Py_None;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
825 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
826
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
827 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
828 PyCursesWindow_ClearToEOL(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
829 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
830 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
831 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
832 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
833 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
834 wclrtoeol(self->win);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
835 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
836 return Py_None;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
837 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
838
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
839 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
840 PyCursesWindow_Scroll(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
841 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
842 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
843 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
844 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
845 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
846 return PyCursesCheckERR(scroll(self->win), "scroll");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
847 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
848
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
849 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
850 PyCursesWindow_TouchWin(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
851 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
852 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
853 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
854 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
855 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
856 return PyCursesCheckERR(touchwin(self->win), "touchwin");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
857 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
858
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
859 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
860 PyCursesWindow_TouchLine(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
861 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
862 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
863 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
864 int st, cnt;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
865 if (!PyArg_Parse(arg,"(ii);start,count",&st,&cnt))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
866 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
867 return PyCursesCheckERR(touchline(self->win,st,cnt), "touchline");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
868 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
869
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
870 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
871 PyCursesWindow_GetCh(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
872 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
873 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
874 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
875 int x, y;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
876 int rtn;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
877
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
878 switch (ARG_COUNT(arg)) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
879 case 0:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
880 rtn = wgetch(self->win);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
881 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
882 case 2:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
883 if (!PyArg_Parse(arg,"(ii);y,x",&y,&x))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
884 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
885 rtn = mvwgetch(self->win,y,x);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
886 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
887 default:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
888 PyErr_SetString(PyExc_TypeError, "getch requires 0 or 2 arguments");
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
889 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
890 }
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
891
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
892 return PyInt_FromLong((long) rtn);
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
893 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
894
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
895 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
896 PyCursesWindow_GetStr(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
897 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
898 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
899 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
900 int x, y;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
901 char rtn[1024]; /* This should be big enough.. I hope */
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
902 int rtn2;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
903
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
904 switch (ARG_COUNT(arg)) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
905 case 0:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
906 rtn2 = wgetstr(self->win,rtn);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
907 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
908 case 2:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
909 if (!PyArg_Parse(arg,"(ii);y,x",&y,&x))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
910 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
911 rtn2 = mvwgetstr(self->win,y,x,rtn);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
912 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
913 default:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
914 PyErr_SetString(PyExc_TypeError, "getstr requires 0 or 2 arguments");
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
915 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
916 }
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
917
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
918 if (rtn2 == ERR)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
919 rtn[0] = 0;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
920 return PyString_FromString(rtn);
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
921 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
922
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
923 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
924 PyCursesWindow_InCh(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
925 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
926 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
927 {
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
928 int x, y, rtn;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
929
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
930 switch (ARG_COUNT(arg)) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
931 case 0:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
932 rtn = winch(self->win);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
933 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
934 case 2:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
935 if (!PyArg_Parse(arg,"(ii);y,x",&y,&x))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
936 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
937 rtn = mvwinch(self->win,y,x);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
938 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
939 default:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
940 PyErr_SetString(PyExc_TypeError, "inch requires 0 or 2 arguments");
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
941 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
942 }
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
943
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
944 return PyInt_FromLong((long) rtn);
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
945 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
946
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
947 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
948 PyCursesWindow_ClearOk(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
949 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
950 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
951 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
952 int val;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
953 if (!PyArg_Parse(arg,"i;True(1) or False(0)",&val))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
954 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
955 clearok(self->win,val);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
956 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
957 return Py_None;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
958 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
959
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
960 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
961 PyCursesWindow_IdlOk(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
962 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
963 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
964 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
965 int val;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
966 if (!PyArg_Parse(arg,"i;True(1) or False(0)",&val))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
967 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
968 idlok(self->win,val);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
969 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
970 return Py_None;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
971 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
972
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
973 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
974 PyCursesWindow_LeaveOk(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
975 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
976 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
977 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
978 int val;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
979 if (!PyArg_Parse(arg,"i;True(1) or False(0)",&val))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
980 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
981 leaveok(self->win,val);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
982 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
983 return Py_None;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
984 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
985
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
986 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
987 PyCursesWindow_ScrollOk(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
988 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
989 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
990 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
991 int val;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
992 if (!PyArg_Parse(arg,"i;True(1) or False(0)",&val))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
993 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
994 scrollok(self->win,val);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
995 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
996 return Py_None;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
997 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
998
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
999 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1000 PyCursesWindow_SetScrollRegion(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1001 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1002 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1003 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1004 int x, y;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1005 if (!PyArg_Parse(arg,"(ii);top, bottom",&y,&x))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1006 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1007 return PyCursesCheckERR(wsetscrreg(self->win,y,x), "wsetscrreg");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1008 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1009
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1010 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1011 PyCursesWindow_KeyPad(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1012 PyCursesWindowObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1013 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1014 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1015 int ch;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1016 if (!PyArg_Parse(arg,"i;True(1), False(0)",&ch))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1017 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1018 keypad(self->win,ch);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1019 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1020 return Py_None;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1021 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1022
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1023 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1024 PyCursesWindow_NoDelay(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1025 PyCursesWindowObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1026 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1027 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1028 int ch;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1029 if (!PyArg_Parse(arg,"i;True(1), False(0)",&ch))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1030 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1031 nodelay(self->win,ch);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1032 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1033 return Py_None;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1034 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1035
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1036 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1037 PyCursesWindow_NoTimeout(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1038 PyCursesWindowObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1039 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1040 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1041 int ch;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1042 if (!PyArg_Parse(arg,"i;True(1), False(0)",&ch))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1043 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1044 notimeout(self->win,ch);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1045 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1046 return Py_None;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1047 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1048
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1049 static PyMethodDef PyCursesWindow_Methods[] = {
2569
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1050 {"refresh", (PyCFunction)PyCursesWindow_Refresh},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1051 {"nooutrefresh", (PyCFunction)PyCursesWindow_NoOutRefresh},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1052 {"mvwin", (PyCFunction)PyCursesWindow_MoveWin},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1053 {"move", (PyCFunction)PyCursesWindow_Move},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1054 {"subwin", (PyCFunction)PyCursesWindow_SubWin},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1055 {"addch", (PyCFunction)PyCursesWindow_AddCh},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1056 {"insch", (PyCFunction)PyCursesWindow_InsCh},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1057 {"delch", (PyCFunction)PyCursesWindow_DelCh},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1058 {"echochar", (PyCFunction)PyCursesWindow_EchoChar},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1059 {"addstr", (PyCFunction)PyCursesWindow_AddStr},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1060 {"attron", (PyCFunction)PyCursesWindow_AttrOn},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1061 {"attroff", (PyCFunction)PyCursesWindow_AttrOff},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1062 {"attrset", (PyCFunction)PyCursesWindow_AttrSet},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1063 {"standend", (PyCFunction)PyCursesWindow_StandEnd},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1064 {"standout", (PyCFunction)PyCursesWindow_StandOut},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1065 {"border", (PyCFunction)PyCursesWindow_Border, METH_VARARGS},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1066 {"box", (PyCFunction)PyCursesWindow_Box},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1067 {"hline", (PyCFunction)PyCursesWindow_Hline},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1068 {"vline", (PyCFunction)PyCursesWindow_Vline},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1069 {"erase", (PyCFunction)PyCursesWindow_Erase},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1070 {"deleteln", (PyCFunction)PyCursesWindow_DeleteLine},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1071 {"insertln", (PyCFunction)PyCursesWindow_InsertLine},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1072 {"getyx", (PyCFunction)PyCursesWindow_GetYX},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1073 {"getbegyx", (PyCFunction)PyCursesWindow_GetBegYX},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1074 {"getmaxyx", (PyCFunction)PyCursesWindow_GetMaxYX},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1075 {"clear", (PyCFunction)PyCursesWindow_Clear},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1076 {"clrtobot", (PyCFunction)PyCursesWindow_ClearToBottom},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1077 {"clrtoeol", (PyCFunction)PyCursesWindow_ClearToEOL},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1078 {"scroll", (PyCFunction)PyCursesWindow_Scroll},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1079 {"touchwin", (PyCFunction)PyCursesWindow_TouchWin},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1080 {"touchline", (PyCFunction)PyCursesWindow_TouchLine},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1081 {"getch", (PyCFunction)PyCursesWindow_GetCh},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1082 {"getstr", (PyCFunction)PyCursesWindow_GetStr},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1083 {"inch", (PyCFunction)PyCursesWindow_InCh},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1084 {"clearok", (PyCFunction)PyCursesWindow_ClearOk},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1085 {"idlok", (PyCFunction)PyCursesWindow_IdlOk},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1086 {"leaveok", (PyCFunction)PyCursesWindow_LeaveOk},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1087 {"scrollok", (PyCFunction)PyCursesWindow_ScrollOk},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1088 {"setscrreg", (PyCFunction)PyCursesWindow_SetScrollRegion},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1089 {"keypad", (PyCFunction)PyCursesWindow_KeyPad},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1090 {"nodelay", (PyCFunction)PyCursesWindow_NoDelay},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1091 {"notimeout", (PyCFunction)PyCursesWindow_NoTimeout},
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1092 {NULL, NULL} /* sentinel */
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1093 };
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1094
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1095 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1096 PyCursesWindow_GetAttr(self, name)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1097 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1098 char *name;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1099 {
2123
fd5ab7e828fc cosmetic changes so these modules will work with the strict new naming scheme
Guido van Rossum <guido@python.org>
parents: 1888
diff changeset
1100 return Py_FindMethod(PyCursesWindow_Methods, (PyObject *)self, name);
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1101 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1102
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1103
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1104 /* --------------- PAD routines ---------------- */
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1105
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1106 #ifdef NOT_YET
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1107 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1108 PyCursesPad_New(pad)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1109 WINDOW *pad;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1110 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1111 PyCursesPadObject *po;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1112 po = PyObject_NEW(PyCursesPadObject, &PyCursesPad_Type);
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1113 if (po == NULL)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1114 return NULL;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1115 po->pad = pad;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1116 return (PyObject *)po;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1117 }
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1118 #endif
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1119
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1120
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1121 /* -------------------------------------------------------*/
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1122
4600
d36250aefb82 Keep gcc -Wall happy.
Guido van Rossum <guido@python.org>
parents: 3417
diff changeset
1123 #if 0
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1124 static PyTypeObject PyCursesScreen_Type = {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1125 PyObject_HEAD_INIT(&PyType_Type)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1126 0, /*ob_size*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1127 "curses screen", /*tp_name*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1128 sizeof(PyCursesScreenObject), /*tp_basicsize*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1129 0, /*tp_itemsize*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1130 /* methods */
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1131 (destructor)0 /*PyCursesScreen_Dealloc*/, /*tp_dealloc*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1132 0, /*tp_print*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1133 (getattrfunc)0, /*tp_getattr*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1134 (setattrfunc)0, /*tp_setattr*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1135 0, /*tp_compare*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1136 0, /*tp_repr*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1137 0, /*tp_as_number*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1138 0, /*tp_as_sequence*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1139 0, /*tp_as_mapping*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1140 0, /*tp_hash*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1141 };
4600
d36250aefb82 Keep gcc -Wall happy.
Guido van Rossum <guido@python.org>
parents: 3417
diff changeset
1142 #endif
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1143
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1144 static PyTypeObject PyCursesWindow_Type = {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1145 PyObject_HEAD_INIT(&PyType_Type)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1146 0, /*ob_size*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1147 "curses window", /*tp_name*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1148 sizeof(PyCursesWindowObject), /*tp_basicsize*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1149 0, /*tp_itemsize*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1150 /* methods */
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1151 (destructor)PyCursesWindow_Dealloc, /*tp_dealloc*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1152 0, /*tp_print*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1153 (getattrfunc)PyCursesWindow_GetAttr, /*tp_getattr*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1154 (setattrfunc)0, /*tp_setattr*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1155 0, /*tp_compare*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1156 0, /*tp_repr*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1157 0, /*tp_as_number*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1158 0, /*tp_as_sequence*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1159 0, /*tp_as_mapping*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1160 0, /*tp_hash*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1161 };
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1162
4600
d36250aefb82 Keep gcc -Wall happy.
Guido van Rossum <guido@python.org>
parents: 3417
diff changeset
1163 #if 0
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1164 static PyTypeObject PyCursesPad_Type = {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1165 PyObject_HEAD_INIT(&PyType_Type)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1166 0, /*ob_size*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1167 "curses pad", /*tp_name*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1168 sizeof(PyCursesPadObject), /*tp_basicsize*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1169 0, /*tp_itemsize*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1170 /* methods */
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1171 (destructor)0 /*PyCursesPad_Dealloc*/, /*tp_dealloc*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1172 0, /*tp_print*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1173 (getattrfunc)0, /*tp_getattr*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1174 (setattrfunc)0, /*tp_setattr*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1175 0, /*tp_compare*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1176 0, /*tp_repr*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1177 0, /*tp_as_number*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1178 0, /*tp_as_sequence*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1179 0, /*tp_as_mapping*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1180 0, /*tp_hash*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1181 };
4600
d36250aefb82 Keep gcc -Wall happy.
Guido van Rossum <guido@python.org>
parents: 3417
diff changeset
1182 #endif
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1183
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1184
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1185 /* -------------------------------------------------------*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1186
1867
758c1374f303 Setup.in: added tkinter; rearranged the definition of PYTHONPATH so
Guido van Rossum <guido@python.org>
parents: 1859
diff changeset
1187 static PyObject *ModDict;
758c1374f303 Setup.in: added tkinter; rearranged the definition of PYTHONPATH so
Guido van Rossum <guido@python.org>
parents: 1859
diff changeset
1188
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1189 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1190 PyCurses_InitScr(self, args)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1191 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1192 PyObject * args;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1193 {
1859
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
1194 WINDOW *win;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1195 if (!PyArg_NoArgs(args))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1196 return NULL;
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1197 if (initialised == TRUE) {
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1198 wrefresh(stdscr);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1199 return (PyObject *)PyCursesWindow_New(stdscr);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1200 }
1859
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
1201
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
1202 win = initscr();
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1203 if (win == NULL) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1204 PyErr_SetString(PyCursesError, catchall_NULL);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1205 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1206 }
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1207
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1208 initialised = TRUE;
1859
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
1209
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
1210 /* This was moved from initcurses() because core dumped on SGI */
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1211 /* Also, they are probably not defined until you've called initscr() */
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1212 #define SetDictInt(string,ch) \
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1213 PyDict_SetItemString(ModDict,string,PyInt_FromLong((long) (ch)));
1859
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
1214
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
1215 /* Here are some graphic symbols you can use */
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1216 SetDictInt("ACS_ULCORNER",(ACS_ULCORNER));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1217 SetDictInt("ACS_ULCORNER",(ACS_ULCORNER));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1218 SetDictInt("ACS_LLCORNER",(ACS_LLCORNER));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1219 SetDictInt("ACS_URCORNER",(ACS_URCORNER));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1220 SetDictInt("ACS_LRCORNER",(ACS_LRCORNER));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1221 SetDictInt("ACS_RTEE", (ACS_RTEE));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1222 SetDictInt("ACS_LTEE", (ACS_LTEE));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1223 SetDictInt("ACS_BTEE", (ACS_BTEE));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1224 SetDictInt("ACS_TTEE", (ACS_TTEE));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1225 SetDictInt("ACS_HLINE", (ACS_HLINE));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1226 SetDictInt("ACS_VLINE", (ACS_VLINE));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1227 SetDictInt("ACS_PLUS", (ACS_PLUS));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1228 SetDictInt("ACS_S1", (ACS_S1));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1229 SetDictInt("ACS_S9", (ACS_S9));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1230 SetDictInt("ACS_DIAMOND", (ACS_DIAMOND));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1231 SetDictInt("ACS_CKBOARD", (ACS_CKBOARD));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1232 SetDictInt("ACS_DEGREE", (ACS_DEGREE));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1233 SetDictInt("ACS_PLMINUS", (ACS_PLMINUS));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1234 SetDictInt("ACS_BULLET", (ACS_BULLET));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1235 SetDictInt("ACS_LARROW", (ACS_RARROW));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1236 SetDictInt("ACS_DARROW", (ACS_DARROW));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1237 SetDictInt("ACS_UARROW", (ACS_UARROW));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1238 SetDictInt("ACS_BOARD", (ACS_BOARD));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1239 SetDictInt("ACS_LANTERN", (ACS_LANTERN));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1240 SetDictInt("ACS_BLOCK", (ACS_BLOCK));
1859
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
1241
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
1242 return (PyObject *)PyCursesWindow_New(win);
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1243 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1244
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1245 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1246 PyCurses_EndWin(self, args)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1247 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1248 PyObject * args;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1249 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1250 if (!PyArg_NoArgs(args) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1251 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1252 return PyCursesCheckERR(endwin(), "endwin");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1253 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1254
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1255 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1256 PyCurses_IsEndWin(self, args)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1257 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1258 PyObject * args;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1259 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1260 if (!PyArg_NoArgs(args))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1261 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1262 if (isendwin() == FALSE) {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1263 Py_INCREF(Py_False);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1264 return Py_False;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1265 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1266 Py_INCREF(Py_True);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1267 return Py_True;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1268 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1269
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1270 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1271 PyCurses_DoUpdate(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1272 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1273 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1274 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1275 if (!PyArg_NoArgs(arg) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1276 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1277 return PyCursesCheckERR(doupdate(), "doupdate");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1278 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1279
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1280 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1281 PyCurses_NewWindow(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1282 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1283 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1284 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1285 WINDOW *win;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1286 int nlines, ncols, begin_y, begin_x;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1287
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1288 if (!PyCursesInitialised())
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1289 return NULL;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1290 nlines = ncols = 0;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1291 switch (ARG_COUNT(arg)) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1292 case 2:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1293 if (!PyArg_Parse(arg,"(ii);begin)_y,begin_x",&begin_y,&begin_x))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1294 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1295 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1296 case 4:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1297 if (!PyArg_Parse(arg, "(iiii);nlines,ncols,begin_y,begin_x",
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1298 &nlines,&ncols,&begin_y,&begin_x))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1299 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1300 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1301 default:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1302 PyErr_SetString(PyExc_TypeError, "newwin requires 2 or 4 arguments");
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1303 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1304 }
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1305
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1306 win = newwin(nlines,ncols,begin_y,begin_x);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1307 if (win == NULL) {
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1308 PyErr_SetString(PyCursesError, catchall_NULL);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1309 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1310 }
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1311
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1312 return (PyObject *)PyCursesWindow_New(win);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1313 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1314
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1315 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1316 PyCurses_Beep(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1317 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1318 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1319 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1320 if (!PyArg_NoArgs(arg) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1321 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1322 beep();
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1323 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1324 return Py_None;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1325 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1326
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1327 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1328 PyCurses_Flash(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1329 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1330 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1331 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1332 if (!PyArg_NoArgs(arg) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1333 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1334 flash();
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1335 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1336 return Py_None;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1337 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1338
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1339 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1340 PyCurses_UngetCh(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1341 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1342 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1343 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1344 int ch;
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1345 if (!PyArg_Parse(arg,"i;integer",&ch) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1346 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1347 return PyCursesCheckERR(ungetch(ch), "ungetch");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1348 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1349
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1350 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1351 PyCurses_FlushInp(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1352 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1353 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1354 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1355 if (!PyArg_NoArgs(arg) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1356 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1357 flushinp();
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1358 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1359 return Py_None;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1360 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1361
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1362 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1363 PyCurses_CBreak(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1364 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1365 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1366 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1367 if (!PyArg_NoArgs(arg) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1368 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1369 return PyCursesCheckERR(cbreak(), "cbreak");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1370 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1371
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1372 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1373 PyCurses_NoCBreak(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1374 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1375 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1376 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1377 if (!PyArg_NoArgs(arg) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1378 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1379 return PyCursesCheckERR(nocbreak(), "nocbreak");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1380 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1381
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1382 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1383 PyCurses_Echo(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1384 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1385 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1386 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1387 if (!PyArg_NoArgs(arg) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1388 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1389 return PyCursesCheckERR(echo(), "echo");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1390 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1391
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1392 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1393 PyCurses_NoEcho(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1394 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1395 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1396 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1397 if (!PyArg_NoArgs(arg) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1398 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1399 return PyCursesCheckERR(noecho(), "noecho");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1400 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1401
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1402 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1403 PyCurses_Nl(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1404 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1405 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1406 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1407 if (!PyArg_NoArgs(arg) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1408 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1409 return PyCursesCheckERR(nl(), "nl");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1410 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1411
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1412 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1413 PyCurses_NoNl(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1414 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1415 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1416 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1417 if (!PyArg_NoArgs(arg) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1418 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1419 return PyCursesCheckERR(nonl(), "nonl");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1420 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1421
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1422 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1423 PyCurses_Raw(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1424 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1425 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1426 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1427 if (!PyArg_NoArgs(arg) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1428 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1429 return PyCursesCheckERR(raw(), "raw");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1430 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1431
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1432 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1433 PyCurses_NoRaw(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1434 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1435 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1436 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1437 if (!PyArg_NoArgs(arg) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1438 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1439 return PyCursesCheckERR(noraw(), "noraw");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1440 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1441
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1442 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1443 PyCurses_IntrFlush(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1444 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1445 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1446 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1447 int ch;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1448 if (!PyArg_Parse(arg,"i;True(1), False(0)",&ch))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1449 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1450 return PyCursesCheckERR(intrflush(NULL,ch), "intrflush");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1451 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1452
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1453 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1454 PyCurses_Meta(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1455 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1456 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1457 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1458 int ch;
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1459 if (!PyArg_Parse(arg,"i;True(1), False(0)",&ch) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1460 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1461 return PyCursesCheckERR(meta(stdscr, ch), "meta");
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1462 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1463
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1464 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1465 PyCurses_KeyName(self,arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1466 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1467 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1468 {
5459
c5d7b6fcee03 Avoid warning from gcc on Linux about dropping const.
Guido van Rossum <guido@python.org>
parents: 4600
diff changeset
1469 const char *knp;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1470 int ch;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1471 if (!PyArg_Parse(arg,"i",&ch))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1472 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1473 knp = keyname(ch);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1474 return PyString_FromString((knp == NULL) ? "" : knp);
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1475 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1476
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1477 #ifdef NOT_YET
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1478 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1479 PyCurses_NewTerm(self, args)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1480 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1481 PyObject * args;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1482 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1483 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1484
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1485 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1486 PyCurses_SetTerm(self, args)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1487 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1488 PyObject * args;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1489 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1490 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1491 #endif
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1492
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1493 /* List of functions defined in the module */
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1494
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1495 static PyMethodDef PyCurses_methods[] = {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1496 {"initscr", (PyCFunction)PyCurses_InitScr},
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1497 {"endwin", (PyCFunction)PyCurses_EndWin},
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1498 {"isendwin", (PyCFunction)PyCurses_IsEndWin},
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1499 {"doupdate", (PyCFunction)PyCurses_DoUpdate},
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1500 {"newwin", (PyCFunction)PyCurses_NewWindow},
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1501 {"beep", (PyCFunction)PyCurses_Beep},
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1502 {"flash", (PyCFunction)PyCurses_Flash},
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1503 {"ungetch", (PyCFunction)PyCurses_UngetCh},
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1504 {"flushinp", (PyCFunction)PyCurses_FlushInp},
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1505 {"cbreak", (PyCFunction)PyCurses_CBreak},
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1506 {"nocbreak", (PyCFunction)PyCurses_NoCBreak},
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1507 {"echo", (PyCFunction)PyCurses_Echo},
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1508 {"noecho", (PyCFunction)PyCurses_NoEcho},
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1509 {"nl", (PyCFunction)PyCurses_Nl},
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1510 {"nonl", (PyCFunction)PyCurses_NoNl},
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1511 {"raw", (PyCFunction)PyCurses_Raw},
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1512 {"noraw", (PyCFunction)PyCurses_NoRaw},
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1513 {"intrflush", (PyCFunction)PyCurses_IntrFlush},
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1514 {"meta", (PyCFunction)PyCurses_Meta},
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1515 {"keyname", (PyCFunction)PyCurses_KeyName},
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1516 #ifdef NOT_YET
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1517 {"newterm", (PyCFunction)PyCurses_NewTerm},
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1518 {"set_term", (PyCFunction)PyCurses_SetTerm},
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1519 #endif
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1520 {NULL, NULL} /* sentinel */
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1521 };
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1522
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1523 /* Initialization function for the module */
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1524
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1525 void
1859
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
1526 initcurses()
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1527 {
2358
4c43cbdcd524 bump version, add __version__ back in
Guido van Rossum <guido@python.org>
parents: 2357
diff changeset
1528 PyObject *m, *d, *v;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1529
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1530 /* Create the module and add the functions */
1859
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
1531 m = Py_InitModule("curses", PyCurses_methods);
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1532
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1533 /* Add some symbolic constants to the module */
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1534 d = PyModule_GetDict(m);
1867
758c1374f303 Setup.in: added tkinter; rearranged the definition of PYTHONPATH so
Guido van Rossum <guido@python.org>
parents: 1859
diff changeset
1535 ModDict = d; /* For PyCurses_InitScr */
1858
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
1536
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1537 /* For exception curses.error */
6367
2c29b8982643 Apply two changes, systematically:
Guido van Rossum <guido@python.org>
parents: 5459
diff changeset
1538 PyCursesError = PyErr_NewException("curses.error", NULL, NULL);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1539 PyDict_SetItemString(d, "error", PyCursesError);
1858
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
1540
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1541 /* Make the version available */
2358
4c43cbdcd524 bump version, add __version__ back in
Guido van Rossum <guido@python.org>
parents: 2357
diff changeset
1542 v = PyString_FromString(PyCursesVersion);
4c43cbdcd524 bump version, add __version__ back in
Guido van Rossum <guido@python.org>
parents: 2357
diff changeset
1543 PyDict_SetItemString(d, "version", v);
4c43cbdcd524 bump version, add __version__ back in
Guido van Rossum <guido@python.org>
parents: 2357
diff changeset
1544 PyDict_SetItemString(d, "__version__", v);
4c43cbdcd524 bump version, add __version__ back in
Guido van Rossum <guido@python.org>
parents: 2357
diff changeset
1545 Py_DECREF(v);
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1546
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1547 /* Here are some attributes you can add to chars to print */
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1548 SetDictInt("A_NORMAL", A_NORMAL);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1549 SetDictInt("A_STANDOUT", A_STANDOUT);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1550 SetDictInt("A_UNDERLINE", A_UNDERLINE);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1551 SetDictInt("A_REVERSE", A_REVERSE);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1552 SetDictInt("A_BLINK", A_BLINK);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1553 SetDictInt("A_DIM", A_DIM);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1554 SetDictInt("A_BOLD", A_BOLD);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1555 SetDictInt("A_ALTCHARSET", A_ALTCHARSET);
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1556
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1557 /* Now set everything up for KEY_ variables */
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1558 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1559 int key;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1560 char *key_n;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1561 char *key_n2;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1562 for (key=KEY_MIN;key < KEY_MAX; key++) {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1563 key_n = (char *)keyname(key);
2296
f17d6e6b40da clear errors between failing calls to PyArg_Parse
Guido van Rossum <guido@python.org>
parents: 2123
diff changeset
1564 if (key_n == NULL || strcmp(key_n,"UNKNOWN KEY")==0)
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1565 continue;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1566 if (strncmp(key_n,"KEY_F(",6)==0) {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1567 char *p1, *p2;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1568 key_n2 = malloc(strlen(key_n)+1);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1569 p1 = key_n;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1570 p2 = key_n2;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1571 while (*p1) {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1572 if (*p1 != '(' && *p1 != ')') {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1573 *p2 = *p1;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1574 p2++;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1575 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1576 p1++;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1577 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1578 *p2 = (char)0;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1579 } else
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1580 key_n2 = key_n;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1581 PyDict_SetItemString(d,key_n2,PyInt_FromLong((long) key));
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1582 if (key_n2 != key_n)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1583 free(key_n2);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1584 }
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1585 SetDictInt("KEY_MIN", KEY_MIN);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1586 SetDictInt("KEY_MAX", KEY_MAX);
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1587 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1588 }