annotate Modules/_cursesmodule.c @ 10072:ecebcd84df37 legacy-trunk

put the preferences file in a folder called "Python" inside the prefs folder, just like the IDE does -- jvr
author Just van Rossum <just@lettererror.com>
date Tue, 02 Feb 1999 15:49:03 +0000
parents eaf93d5bb46c
children 1c7c2dd1beb1
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()
9771
eaf93d5bb46c Patch by Charles Waldman to implement an optional nlines argument to
Guido van Rossum <guido@python.org>
parents: 9719
diff changeset
125 scroll(nlines)
1858
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
126 None touchwin()
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
127 None touchline(start,count)
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
128 IntObject getch(y,x)
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
129 getch()
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
130 StringObject getstr(y,x)
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
131 getstr()
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
132 IntObject inch(y,x)
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
133 inch()
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
134 None clearok(int) int=0 or int=1
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
135 None idlok(int) int=0 or int=1
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
136 None leaveok(int) int=0 or int=1
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
137 None scrollok(int) int=0 or int=1
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
138 None setscrreg(top,bottom)
2358
4c43cbdcd524 bump version, add __version__ back in
Guido van Rossum <guido@python.org>
parents: 2357
diff changeset
139 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
140 None nodelay(int) int=0 or int=1
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
141 None notimeout(int) int=0 or int=1
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
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
144
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
145 /* curses module */
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
146
1888
be956b1efb97 * various modules: #include "Python.h" and remove most remporary
Guido van Rossum <guido@python.org>
parents: 1867
diff changeset
147 #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
148
3417
e1df90205a33 Include ncurses.h where needed
Guido van Rossum <guido@python.org>
parents: 2569
diff changeset
149 #ifdef HAVE_NCURSES_H
e1df90205a33 Include ncurses.h where needed
Guido van Rossum <guido@python.org>
parents: 2569
diff changeset
150 /* 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
151 #include <ncurses.h>
e1df90205a33 Include ncurses.h where needed
Guido van Rossum <guido@python.org>
parents: 2569
diff changeset
152 #else
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
153 #include <curses.h>
3417
e1df90205a33 Include ncurses.h where needed
Guido van Rossum <guido@python.org>
parents: 2569
diff changeset
154 #endif
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
155
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
156 typedef struct {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
157 PyObject_HEAD
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
158 SCREEN *scr;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
159 } PyCursesScreenObject;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
160
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
161 typedef struct {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
162 PyObject_HEAD
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
163 WINDOW *win;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
164 WINDOW *parent;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
165 } PyCursesWindowObject;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
166
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
167 typedef struct {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
168 PyObject_HEAD
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
169 WINDOW *pad;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
170 } PyCursesPadObject;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
171
4600
d36250aefb82 Keep gcc -Wall happy.
Guido van Rossum <guido@python.org>
parents: 3417
diff changeset
172 #if 0
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
173 staticforward PyTypeObject PyCursesScreen_Type;
4600
d36250aefb82 Keep gcc -Wall happy.
Guido van Rossum <guido@python.org>
parents: 3417
diff changeset
174 #endif
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
175 staticforward PyTypeObject PyCursesWindow_Type;
4600
d36250aefb82 Keep gcc -Wall happy.
Guido van Rossum <guido@python.org>
parents: 3417
diff changeset
176 #if 0
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
177 staticforward PyTypeObject PyCursesPad_Type;
4600
d36250aefb82 Keep gcc -Wall happy.
Guido van Rossum <guido@python.org>
parents: 3417
diff changeset
178 #endif
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
179
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
180 #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
181 #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
182 #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
183
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
184 /* Defines */
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
185 static PyObject *PyCursesError; /* For exception curses.error */
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
186
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
187 /* Catch-all error messages */
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
188 static char *catchall_ERR = "curses function returned ERR";
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
189 static char *catchall_NULL = "curses function returned NULL";
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
190
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
191 /* 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
192 static int initialised = FALSE;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
193
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
194 #define ARG_COUNT(X) \
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
195 (((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
196
1858
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
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
199 Change Log:
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
200
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
201 Version 1.2: 95/02/23 (Steve Clift)
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
202 Fixed several potential core-dumping bugs.
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
203 Reworked arg parsing where variable arg lists are used.
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
204 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
205 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
206 Added keypad() to window method list.
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
207 Added border(), hline() and vline() window methods.
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
208
1859
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
209 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
210 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
211 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
212 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
213 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
214 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
215 crash on SGI
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
216
1858
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
217 Version 1.0: 94/08/30:
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
218 This is the first release of this software.
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
219 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
220
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
221 ******************************************************************/
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
222
9283
0a6ed384af06 Make the version variable static (it has no business being exported).
Guido van Rossum <guido@python.org>
parents: 6367
diff changeset
223 static char *PyCursesVersion = "1.2";
1858
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
224
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
225 /*
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
226 * 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
227 * or raise an exception as appropriate.
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
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
230 static PyObject *
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
231 PyCursesCheckERR(code, fname)
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
232 int code;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
233 char *fname;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
234 {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
235 char buf[100];
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
236
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
237 if (code != ERR) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
238 Py_INCREF(Py_None);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
239 return Py_None;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
240 } else {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
241 if (fname == NULL) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
242 PyErr_SetString(PyCursesError, catchall_ERR);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
243 } else {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
244 strcpy(buf, fname);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
245 strcat(buf, "() returned ERR");
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
246 PyErr_SetString(PyCursesError, buf);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
247 }
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
248 return NULL;
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
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
252
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
253 static int
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
254 PyCursesInitialised()
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
255 {
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
256 if (initialised == TRUE)
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
257 return 1;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
258 else {
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
259 PyErr_SetString(PyCursesError, "must call initscr() first");
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
260 return 0;
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
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
264
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
265 /* ------------- SCREEN routines --------------- */
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
266
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
267 #ifdef NOT_YET
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
268 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
269 PyCursesScreen_New(arg)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
270 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
271 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
272 char *term_type;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
273 PyFileObject *in_fo;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
274 PyFileObject *out_fo;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
275 PyCursesScreenObject *xp;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
276 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
277 if (xp == NULL)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
278 return NULL;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
279 return (PyObject *)xp;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
280 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
281 #endif
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
282
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
283
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
284 /* ------------- WINDOW routines --------------- */
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
285
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
286 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
287 PyCursesWindow_New(win)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
288 WINDOW *win;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
289 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
290 PyCursesWindowObject *wo;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
291
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
292 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
293 if (wo == NULL)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
294 return NULL;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
295 wo->win = win;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
296 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
297 return (PyObject *)wo;
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
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
300 static void
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
301 PyCursesWindow_Dealloc(wo)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
302 PyCursesWindowObject *wo;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
303 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
304 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
305 delwin(wo->win);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
306 PyMem_DEL(wo);
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
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
309 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
310 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
311 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
312 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
313 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
314 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
315 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
316 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
317 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
318
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
319 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
320 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
321 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
322 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
323 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
324 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
325 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
326 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
327 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
328
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
329 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
330 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
331 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
332 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
333 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
334 int x, y;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
335 if (!PyArg_Parse(arg,"(ii);y,x", &y, &x))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
336 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
337 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
338 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
339
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
340 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
341 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
342 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
343 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
344 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
345 int x, y;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
346 if (!PyArg_Parse(arg,"(ii);y,x", &y, &x))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
347 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
348 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
349 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
350
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
351 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
352 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
353 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
354 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
355 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
356 WINDOW *win;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
357 PyCursesWindowObject *rtn_win;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
358 int nlines, ncols, begin_y, begin_x;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
359
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
360 nlines = 0;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
361 ncols = 0;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
362 switch (ARG_COUNT(arg)) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
363 case 2:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
364 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
365 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
366 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
367 case 4:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
368 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
369 &nlines,&ncols,&begin_y,&begin_x))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
370 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
371 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
372 default:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
373 PyErr_SetString(PyExc_TypeError, "subwin requires 2 or 4 arguments");
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
374 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
375 }
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
376 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
377 if (win == NULL) {
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
378 PyErr_SetString(PyCursesError, catchall_NULL);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
379 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
380 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
381 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
382 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
383 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
384 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
385
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
386 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
387 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
388 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
389 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
390 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
391 int rtn;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
392 int x, y;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
393 int ch;
4600
d36250aefb82 Keep gcc -Wall happy.
Guido van Rossum <guido@python.org>
parents: 3417
diff changeset
394 int attr, attr_old = 0;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
395 int use_xy = FALSE, use_attr = FALSE;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
396
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
397 switch (ARG_COUNT(arg)) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
398 case 1:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
399 if (!PyArg_Parse(arg, "i;ch", &ch))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
400 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
401 break;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
402 case 2:
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
403 if (!PyArg_Parse(arg,"(ii);ch,attr", &ch, &attr))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
404 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
405 use_attr = TRUE;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
406 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
407 case 3:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
408 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
409 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
410 use_xy = TRUE;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
411 break;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
412 case 4:
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
413 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
414 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
415 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
416 break;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
417 default:
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
418 PyErr_SetString(PyExc_TypeError, "addch requires 1 to 4 arguments");
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
419 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
420 }
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
421
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
422 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
423 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
424 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
425 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
426 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
427 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
428 else
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
429 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
430 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
431 wattrset(self->win,attr_old);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
432
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
433 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
434 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
435
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
436 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
437 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
438 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
439 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
440 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
441 int rtn;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
442 int x, y;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
443 int ch;
4600
d36250aefb82 Keep gcc -Wall happy.
Guido van Rossum <guido@python.org>
parents: 3417
diff changeset
444 int attr, attr_old = 0;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
445 int use_xy = TRUE, use_attr = FALSE;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
446
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
447 switch (ARG_COUNT(arg)) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
448 case 1:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
449 if (!PyArg_Parse(arg, "i;ch", &ch))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
450 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
451 break;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
452 case 2:
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
453 if (!PyArg_Parse(arg,"(ii);ch,attr", &ch, &attr))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
454 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
455 use_attr = TRUE;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
456 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
457 case 3:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
458 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
459 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
460 use_xy = TRUE;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
461 break;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
462 case 4:
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
463 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
464 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
465 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
466 break;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
467 default:
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
468 PyErr_SetString(PyExc_TypeError, "insch requires 1 to 4 arguments");
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
469 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
470 }
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
471
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
472 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
473 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
474 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
475 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
476 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
477 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
478 else
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
479 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
480 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
481 wattrset(self->win,attr_old);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
482
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
483 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
484 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
485
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
486 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
487 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
488 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
489 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
490 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
491 int rtn;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
492 int x, y;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
493
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
494 switch (ARG_COUNT(arg)) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
495 case 0:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
496 rtn = wdelch(self->win);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
497 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
498 case 2:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
499 if (!PyArg_Parse(arg,"(ii);y,x", &y, &x))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
500 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
501 rtn = mvwdelch(self->win,y,x);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
502 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
503 default:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
504 PyErr_SetString(PyExc_TypeError, "delch requires 0 or 2 arguments");
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
505 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
506 }
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
507
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
508 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
509 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
510
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
511 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
512 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
513 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
514 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
515 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
516 int rtn;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
517 int ch;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
518 int attr, attr_old;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
519
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
520 switch (ARG_COUNT(arg)) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
521 case 1:
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
522 if (!PyArg_Parse(arg,"i;ch", &ch))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
523 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
524 rtn = wechochar(self->win,ch);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
525 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
526 case 2:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
527 if (!PyArg_Parse(arg,"(ii);ch,attr", &ch, &attr))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
528 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
529 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
530 wattrset(self->win,attr);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
531 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
532 wattrset(self->win,attr_old);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
533 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
534 default:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
535 PyErr_SetString(PyExc_TypeError, "echochar requires 1 or 2 arguments");
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
536 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
537 }
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
538
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
539 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
540 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
541
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
542 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
543 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
544 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
545 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
546 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
547 int rtn;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
548 int x, y;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
549 char *str;
4600
d36250aefb82 Keep gcc -Wall happy.
Guido van Rossum <guido@python.org>
parents: 3417
diff changeset
550 int attr, attr_old = 0;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
551 int use_xy = FALSE, use_attr = FALSE;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
552
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
553 switch (ARG_COUNT(arg)) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
554 case 1:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
555 if (!PyArg_Parse(arg,"s;str", &str))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
556 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
557 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
558 case 2:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
559 if (!PyArg_Parse(arg,"(si);str,attr", &str, &attr))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
560 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
561 use_attr = TRUE;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
562 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
563 case 3:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
564 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
565 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
566 use_xy = TRUE;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
567 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
568 case 4:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
569 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
570 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
571 use_xy = use_attr = TRUE;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
572 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
573 default:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
574 PyErr_SetString(PyExc_TypeError, "addstr requires 1 to 4 arguments");
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
575 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
576 }
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
577
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
578 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
579 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
580 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
581 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
582 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
583 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
584 else
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
585 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
586 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
587 wattrset(self->win,attr_old);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
588
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
589 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
590 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
591
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
592 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
593 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
594 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
595 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
596 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
597 int ch;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
598 if (!PyArg_Parse(arg,"i;attr", &ch))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
599 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
600 wattron(self->win,ch);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
601 Py_INCREF(Py_None);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
602 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
603 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
604
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
605 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
606 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
607 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
608 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
609 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
610 int ch;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
611 if (!PyArg_Parse(arg,"i;attr", &ch))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
612 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
613 wattroff(self->win,ch);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
614 Py_INCREF(Py_None);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
615 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
616 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
617
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
618 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
619 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
620 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
621 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
622 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
623 int ch;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
624 if (!PyArg_Parse(arg,"i;attr", &ch))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
625 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
626 wattrset(self->win,ch);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
627 Py_INCREF(Py_None);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
628 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
629 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
630
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
631 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
632 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
633 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
634 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
635 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
636 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
637 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
638 wstandend(self->win);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
639 Py_INCREF(Py_None);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
640 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
641 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
642
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
643 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
644 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
645 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
646 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
647 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
648 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
649 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
650 wstandout(self->win);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
651 Py_INCREF(Py_None);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
652 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
653 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
654
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
655 static PyObject *
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
656 PyCursesWindow_Border(self, args)
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
657 PyCursesWindowObject *self;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
658 PyObject *args;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
659 {
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
660 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
661 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
662 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
663 &ls, &rs, &ts, &bs, &tl, &tr, &bl, &br))
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
664 return NULL;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
665 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
666 Py_INCREF(Py_None);
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
667 return Py_None;
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
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
670 static PyObject *
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
671 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
672 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
673 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
674 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
675 int ch1=0,ch2=0;
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
676 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
677 PyErr_Clear();
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
678 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
679 return NULL;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
680 }
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
681 box(self->win,ch1,ch2);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
682 Py_INCREF(Py_None);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
683 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
684 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
685
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
686 static PyObject *
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
687 PyCursesWindow_Hline(self, args)
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
688 PyCursesWindowObject *self;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
689 PyObject *args;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
690 {
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
691 int ch, n, x, y, code = OK;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
692 switch (ARG_COUNT(args)) {
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
693 case 2:
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
694 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
695 return NULL;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
696 break;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
697 case 4:
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
698 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
699 return NULL;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
700 code = wmove(self->win, y, x);
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
701 break;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
702 default:
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
703 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
704 return NULL;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
705 }
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
706 if (code != ERR)
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
707 whline(self->win, ch, n);
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
708 return PyCursesCheckERR(code, "wmove");
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
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
711 static PyObject *
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
712 PyCursesWindow_Vline(self, args)
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
713 PyCursesWindowObject *self;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
714 PyObject *args;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
715 {
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
716 int ch, n, x, y, code = OK;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
717 switch (ARG_COUNT(args)) {
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
718 case 2:
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
719 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
720 return NULL;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
721 break;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
722 case 4:
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
723 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
724 return NULL;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
725 code = wmove(self->win, y, x);
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
726 break;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
727 default:
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
728 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
729 return NULL;
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
730 }
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
731 if (code != ERR)
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
732 wvline(self->win, ch, n);
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
733 return PyCursesCheckERR(code, "wmove");
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
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
736 static PyObject *
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
737 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
738 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
739 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
740 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
741 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
742 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
743 werase(self->win);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
744 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
745 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
746 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
747
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
748 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
749 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
750 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
751 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
752 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
753 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
754 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
755 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
756 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
757
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
758 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
759 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
760 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
761 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
762 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
763 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
764 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
765 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
766 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
767
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
768 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
769 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
770 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
771 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
772 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
773 int x, y;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
774 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
775 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
776 getyx(self->win,y,x);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
777 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
778 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
779
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
780 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
781 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
782 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
783 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
784 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
785 int x, y;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
786 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
787 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
788 getbegyx(self->win,y,x);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
789 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
790 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
791
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
792 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
793 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
794 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
795 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
796 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
797 int x, y;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
798 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
799 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
800 getmaxyx(self->win,y,x);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
801 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
802 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
803
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
804 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
805 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
806 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
807 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
808 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
809 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
810 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
811 wclear(self->win);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
812 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
813 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
814 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
815
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
816 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
817 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
818 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
819 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
820 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
821 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
822 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
823 wclrtobot(self->win);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
824 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
825 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
826 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
827
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
828 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
829 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
830 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
831 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
832 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
833 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
834 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
835 wclrtoeol(self->win);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
836 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
837 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
838 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
839
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
840 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
841 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
842 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
843 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
844 {
9771
eaf93d5bb46c Patch by Charles Waldman to implement an optional nlines argument to
Guido van Rossum <guido@python.org>
parents: 9719
diff changeset
845 int nlines;
eaf93d5bb46c Patch by Charles Waldman to implement an optional nlines argument to
Guido van Rossum <guido@python.org>
parents: 9719
diff changeset
846 int use_nlines = FALSE;
eaf93d5bb46c Patch by Charles Waldman to implement an optional nlines argument to
Guido van Rossum <guido@python.org>
parents: 9719
diff changeset
847 switch (ARG_COUNT(arg)) {
eaf93d5bb46c Patch by Charles Waldman to implement an optional nlines argument to
Guido van Rossum <guido@python.org>
parents: 9719
diff changeset
848 case 0:
eaf93d5bb46c Patch by Charles Waldman to implement an optional nlines argument to
Guido van Rossum <guido@python.org>
parents: 9719
diff changeset
849 break;
eaf93d5bb46c Patch by Charles Waldman to implement an optional nlines argument to
Guido van Rossum <guido@python.org>
parents: 9719
diff changeset
850 case 1:
eaf93d5bb46c Patch by Charles Waldman to implement an optional nlines argument to
Guido van Rossum <guido@python.org>
parents: 9719
diff changeset
851 if (!PyArg_Parse(arg, "i;nlines", &nlines))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
852 return NULL;
9771
eaf93d5bb46c Patch by Charles Waldman to implement an optional nlines argument to
Guido van Rossum <guido@python.org>
parents: 9719
diff changeset
853 use_nlines = TRUE;
eaf93d5bb46c Patch by Charles Waldman to implement an optional nlines argument to
Guido van Rossum <guido@python.org>
parents: 9719
diff changeset
854 break;
eaf93d5bb46c Patch by Charles Waldman to implement an optional nlines argument to
Guido van Rossum <guido@python.org>
parents: 9719
diff changeset
855 default:
eaf93d5bb46c Patch by Charles Waldman to implement an optional nlines argument to
Guido van Rossum <guido@python.org>
parents: 9719
diff changeset
856 PyErr_SetString(PyExc_TypeError, "scroll requires 0 or 1 arguments");
eaf93d5bb46c Patch by Charles Waldman to implement an optional nlines argument to
Guido van Rossum <guido@python.org>
parents: 9719
diff changeset
857 return NULL;
eaf93d5bb46c Patch by Charles Waldman to implement an optional nlines argument to
Guido van Rossum <guido@python.org>
parents: 9719
diff changeset
858 }
eaf93d5bb46c Patch by Charles Waldman to implement an optional nlines argument to
Guido van Rossum <guido@python.org>
parents: 9719
diff changeset
859 if (use_nlines)
eaf93d5bb46c Patch by Charles Waldman to implement an optional nlines argument to
Guido van Rossum <guido@python.org>
parents: 9719
diff changeset
860 return PyCursesCheckERR(wscrl(self->win, nlines), "scroll");
eaf93d5bb46c Patch by Charles Waldman to implement an optional nlines argument to
Guido van Rossum <guido@python.org>
parents: 9719
diff changeset
861 else
eaf93d5bb46c Patch by Charles Waldman to implement an optional nlines argument to
Guido van Rossum <guido@python.org>
parents: 9719
diff changeset
862 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
863 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
864
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
865 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
866 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
867 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
868 PyObject * arg;
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 if (!PyArg_NoArgs(arg))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
871 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
872 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
873 }
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 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
876 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
877 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
878 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
879 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
880 int st, cnt;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
881 if (!PyArg_Parse(arg,"(ii);start,count",&st,&cnt))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
882 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
883 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
884 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
885
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
886 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
887 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
888 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
889 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
890 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
891 int x, y;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
892 int rtn;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
893
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
894 switch (ARG_COUNT(arg)) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
895 case 0:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
896 rtn = wgetch(self->win);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
897 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
898 case 2:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
899 if (!PyArg_Parse(arg,"(ii);y,x",&y,&x))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
900 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
901 rtn = mvwgetch(self->win,y,x);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
902 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
903 default:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
904 PyErr_SetString(PyExc_TypeError, "getch requires 0 or 2 arguments");
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
905 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
906 }
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
907
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
908 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
909 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
910
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
911 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
912 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
913 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
914 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
915 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
916 int x, y;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
917 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
918 int rtn2;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
919
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
920 switch (ARG_COUNT(arg)) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
921 case 0:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
922 rtn2 = wgetstr(self->win,rtn);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
923 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
924 case 2:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
925 if (!PyArg_Parse(arg,"(ii);y,x",&y,&x))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
926 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
927 rtn2 = mvwgetstr(self->win,y,x,rtn);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
928 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
929 default:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
930 PyErr_SetString(PyExc_TypeError, "getstr requires 0 or 2 arguments");
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
931 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
932 }
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
933
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
934 if (rtn2 == ERR)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
935 rtn[0] = 0;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
936 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
937 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
938
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
939 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
940 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
941 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
942 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
943 {
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
944 int x, y, rtn;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
945
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
946 switch (ARG_COUNT(arg)) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
947 case 0:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
948 rtn = winch(self->win);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
949 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
950 case 2:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
951 if (!PyArg_Parse(arg,"(ii);y,x",&y,&x))
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
952 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
953 rtn = mvwinch(self->win,y,x);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
954 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
955 default:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
956 PyErr_SetString(PyExc_TypeError, "inch requires 0 or 2 arguments");
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
957 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
958 }
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
959
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
960 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
961 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
962
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
963 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
964 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
965 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
966 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
967 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
968 int val;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
969 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
970 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
971 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
972 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
973 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
974 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
975
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
976 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
977 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
978 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
979 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
980 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
981 int val;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
982 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
983 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
984 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
985 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
986 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
987 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
988
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
989 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
990 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
991 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
992 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
993 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
994 int val;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
995 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
996 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
997 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
998 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
999 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
1000 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1001
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1002 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1003 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
1004 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1005 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1006 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1007 int val;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1008 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
1009 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1010 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
1011 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1012 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
1013 }
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 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1016 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
1017 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1018 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1019 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1020 int x, y;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1021 if (!PyArg_Parse(arg,"(ii);top, bottom",&y,&x))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1022 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1023 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
1024 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1025
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1026 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1027 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
1028 PyCursesWindowObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1029 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1030 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1031 int ch;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1032 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
1033 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1034 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
1035 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1036 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
1037 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1038
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1039 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1040 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
1041 PyCursesWindowObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1042 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1043 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1044 int ch;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1045 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
1046 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1047 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
1048 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1049 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
1050 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1051
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1052 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1053 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
1054 PyCursesWindowObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1055 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1056 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1057 int ch;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1058 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
1059 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1060 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
1061 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1062 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
1063 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1064
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1065 static PyMethodDef PyCursesWindow_Methods[] = {
2569
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1066 {"refresh", (PyCFunction)PyCursesWindow_Refresh},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1067 {"nooutrefresh", (PyCFunction)PyCursesWindow_NoOutRefresh},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1068 {"mvwin", (PyCFunction)PyCursesWindow_MoveWin},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1069 {"move", (PyCFunction)PyCursesWindow_Move},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1070 {"subwin", (PyCFunction)PyCursesWindow_SubWin},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1071 {"addch", (PyCFunction)PyCursesWindow_AddCh},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1072 {"insch", (PyCFunction)PyCursesWindow_InsCh},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1073 {"delch", (PyCFunction)PyCursesWindow_DelCh},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1074 {"echochar", (PyCFunction)PyCursesWindow_EchoChar},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1075 {"addstr", (PyCFunction)PyCursesWindow_AddStr},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1076 {"attron", (PyCFunction)PyCursesWindow_AttrOn},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1077 {"attroff", (PyCFunction)PyCursesWindow_AttrOff},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1078 {"attrset", (PyCFunction)PyCursesWindow_AttrSet},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1079 {"standend", (PyCFunction)PyCursesWindow_StandEnd},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1080 {"standout", (PyCFunction)PyCursesWindow_StandOut},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1081 {"border", (PyCFunction)PyCursesWindow_Border, METH_VARARGS},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1082 {"box", (PyCFunction)PyCursesWindow_Box},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1083 {"hline", (PyCFunction)PyCursesWindow_Hline},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1084 {"vline", (PyCFunction)PyCursesWindow_Vline},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1085 {"erase", (PyCFunction)PyCursesWindow_Erase},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1086 {"deleteln", (PyCFunction)PyCursesWindow_DeleteLine},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1087 {"insertln", (PyCFunction)PyCursesWindow_InsertLine},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1088 {"getyx", (PyCFunction)PyCursesWindow_GetYX},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1089 {"getbegyx", (PyCFunction)PyCursesWindow_GetBegYX},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1090 {"getmaxyx", (PyCFunction)PyCursesWindow_GetMaxYX},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1091 {"clear", (PyCFunction)PyCursesWindow_Clear},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1092 {"clrtobot", (PyCFunction)PyCursesWindow_ClearToBottom},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1093 {"clrtoeol", (PyCFunction)PyCursesWindow_ClearToEOL},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1094 {"scroll", (PyCFunction)PyCursesWindow_Scroll},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1095 {"touchwin", (PyCFunction)PyCursesWindow_TouchWin},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1096 {"touchline", (PyCFunction)PyCursesWindow_TouchLine},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1097 {"getch", (PyCFunction)PyCursesWindow_GetCh},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1098 {"getstr", (PyCFunction)PyCursesWindow_GetStr},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1099 {"inch", (PyCFunction)PyCursesWindow_InCh},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1100 {"clearok", (PyCFunction)PyCursesWindow_ClearOk},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1101 {"idlok", (PyCFunction)PyCursesWindow_IdlOk},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1102 {"leaveok", (PyCFunction)PyCursesWindow_LeaveOk},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1103 {"scrollok", (PyCFunction)PyCursesWindow_ScrollOk},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1104 {"setscrreg", (PyCFunction)PyCursesWindow_SetScrollRegion},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1105 {"keypad", (PyCFunction)PyCursesWindow_KeyPad},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1106 {"nodelay", (PyCFunction)PyCursesWindow_NoDelay},
7a3733732901 Added some (method) casts.
Sjoerd Mullender <sjoerd@acm.org>
parents: 2423
diff changeset
1107 {"notimeout", (PyCFunction)PyCursesWindow_NoTimeout},
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1108 {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
1109 };
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 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1112 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
1113 PyCursesWindowObject *self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1114 char *name;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1115 {
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
1116 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
1117 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1118
2357
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 /* --------------- PAD routines ---------------- */
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1121
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1122 #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
1123 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1124 PyCursesPad_New(pad)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1125 WINDOW *pad;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1126 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1127 PyCursesPadObject *po;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1128 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
1129 if (po == NULL)
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1130 return NULL;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1131 po->pad = pad;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1132 return (PyObject *)po;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1133 }
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1134 #endif
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1135
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1136
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1137 /* -------------------------------------------------------*/
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1138
4600
d36250aefb82 Keep gcc -Wall happy.
Guido van Rossum <guido@python.org>
parents: 3417
diff changeset
1139 #if 0
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1140 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
1141 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
1142 0, /*ob_size*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1143 "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
1144 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
1145 0, /*tp_itemsize*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1146 /* methods */
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1147 (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
1148 0, /*tp_print*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1149 (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
1150 (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
1151 0, /*tp_compare*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1152 0, /*tp_repr*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1153 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
1154 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
1155 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
1156 0, /*tp_hash*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1157 };
4600
d36250aefb82 Keep gcc -Wall happy.
Guido van Rossum <guido@python.org>
parents: 3417
diff changeset
1158 #endif
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1159
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1160 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
1161 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
1162 0, /*ob_size*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1163 "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
1164 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
1165 0, /*tp_itemsize*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1166 /* methods */
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1167 (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
1168 0, /*tp_print*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1169 (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
1170 (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
1171 0, /*tp_compare*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1172 0, /*tp_repr*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1173 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
1174 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
1175 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
1176 0, /*tp_hash*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1177 };
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1178
4600
d36250aefb82 Keep gcc -Wall happy.
Guido van Rossum <guido@python.org>
parents: 3417
diff changeset
1179 #if 0
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1180 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
1181 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
1182 0, /*ob_size*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1183 "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
1184 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
1185 0, /*tp_itemsize*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1186 /* methods */
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1187 (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
1188 0, /*tp_print*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1189 (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
1190 (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
1191 0, /*tp_compare*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1192 0, /*tp_repr*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1193 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
1194 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
1195 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
1196 0, /*tp_hash*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1197 };
4600
d36250aefb82 Keep gcc -Wall happy.
Guido van Rossum <guido@python.org>
parents: 3417
diff changeset
1198 #endif
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1199
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1200
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1201 /* -------------------------------------------------------*/
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1202
1867
758c1374f303 Setup.in: added tkinter; rearranged the definition of PYTHONPATH so
Guido van Rossum <guido@python.org>
parents: 1859
diff changeset
1203 static PyObject *ModDict;
758c1374f303 Setup.in: added tkinter; rearranged the definition of PYTHONPATH so
Guido van Rossum <guido@python.org>
parents: 1859
diff changeset
1204
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1205 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1206 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
1207 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1208 PyObject * args;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1209 {
1859
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
1210 WINDOW *win;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1211 if (!PyArg_NoArgs(args))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1212 return NULL;
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1213 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
1214 wrefresh(stdscr);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1215 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
1216 }
1859
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
1217
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
1218 win = initscr();
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1219 if (win == NULL) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1220 PyErr_SetString(PyCursesError, catchall_NULL);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1221 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1222 }
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1223
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1224 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
1225
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
1226 /* 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
1227 /* 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
1228 #define SetDictInt(string,ch) \
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1229 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
1230
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
1231 /* Here are some graphic symbols you can use */
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1232 SetDictInt("ACS_ULCORNER",(ACS_ULCORNER));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1233 SetDictInt("ACS_ULCORNER",(ACS_ULCORNER));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1234 SetDictInt("ACS_LLCORNER",(ACS_LLCORNER));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1235 SetDictInt("ACS_URCORNER",(ACS_URCORNER));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1236 SetDictInt("ACS_LRCORNER",(ACS_LRCORNER));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1237 SetDictInt("ACS_RTEE", (ACS_RTEE));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1238 SetDictInt("ACS_LTEE", (ACS_LTEE));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1239 SetDictInt("ACS_BTEE", (ACS_BTEE));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1240 SetDictInt("ACS_TTEE", (ACS_TTEE));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1241 SetDictInt("ACS_HLINE", (ACS_HLINE));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1242 SetDictInt("ACS_VLINE", (ACS_VLINE));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1243 SetDictInt("ACS_PLUS", (ACS_PLUS));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1244 SetDictInt("ACS_S1", (ACS_S1));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1245 SetDictInt("ACS_S9", (ACS_S9));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1246 SetDictInt("ACS_DIAMOND", (ACS_DIAMOND));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1247 SetDictInt("ACS_CKBOARD", (ACS_CKBOARD));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1248 SetDictInt("ACS_DEGREE", (ACS_DEGREE));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1249 SetDictInt("ACS_PLMINUS", (ACS_PLMINUS));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1250 SetDictInt("ACS_BULLET", (ACS_BULLET));
9719
3519de440f89 Chris Herborth discovered a typo in the arrow key symbols.
Guido van Rossum <guido@python.org>
parents: 9588
diff changeset
1251 SetDictInt("ACS_LARROW", (ACS_LARROW));
3519de440f89 Chris Herborth discovered a typo in the arrow key symbols.
Guido van Rossum <guido@python.org>
parents: 9588
diff changeset
1252 SetDictInt("ACS_RARROW", (ACS_RARROW));
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1253 SetDictInt("ACS_DARROW", (ACS_DARROW));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1254 SetDictInt("ACS_UARROW", (ACS_UARROW));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1255 SetDictInt("ACS_BOARD", (ACS_BOARD));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1256 SetDictInt("ACS_LANTERN", (ACS_LANTERN));
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1257 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
1258
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
1259 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
1260 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1261
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1262 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1263 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
1264 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1265 PyObject * args;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1266 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1267 if (!PyArg_NoArgs(args) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1268 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1269 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
1270 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1271
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1272 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1273 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
1274 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1275 PyObject * args;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1276 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1277 if (!PyArg_NoArgs(args))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1278 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1279 if (isendwin() == FALSE) {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1280 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
1281 return Py_False;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1282 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1283 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
1284 return Py_True;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1285 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1286
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1287 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1288 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
1289 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1290 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1291 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1292 if (!PyArg_NoArgs(arg) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1293 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1294 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
1295 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1296
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1297 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1298 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
1299 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1300 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1301 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1302 WINDOW *win;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1303 int nlines, ncols, begin_y, begin_x;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1304
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1305 if (!PyCursesInitialised())
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1306 return NULL;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1307 nlines = ncols = 0;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1308 switch (ARG_COUNT(arg)) {
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1309 case 2:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1310 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
1311 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1312 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1313 case 4:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1314 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
1315 &nlines,&ncols,&begin_y,&begin_x))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1316 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1317 break;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1318 default:
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1319 PyErr_SetString(PyExc_TypeError, "newwin requires 2 or 4 arguments");
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1320 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1321 }
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1322
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1323 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
1324 if (win == NULL) {
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1325 PyErr_SetString(PyCursesError, catchall_NULL);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1326 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1327 }
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1328
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1329 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
1330 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1331
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1332 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1333 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
1334 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1335 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1336 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1337 if (!PyArg_NoArgs(arg) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1338 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1339 beep();
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1340 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1341 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
1342 }
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 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1345 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
1346 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1347 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1348 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1349 if (!PyArg_NoArgs(arg) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1350 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1351 flash();
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1352 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1353 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
1354 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1355
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1356 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1357 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
1358 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1359 PyObject * arg;
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 int ch;
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1362 if (!PyArg_Parse(arg,"i;integer",&ch) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1363 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1364 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
1365 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1366
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1367 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1368 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
1369 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1370 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1371 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1372 if (!PyArg_NoArgs(arg) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1373 return NULL;
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1374 flushinp();
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1375 Py_INCREF(Py_None);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1376 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
1377 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1378
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1379 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1380 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
1381 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1382 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1383 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1384 if (!PyArg_NoArgs(arg) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1385 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1386 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
1387 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1388
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1389 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1390 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
1391 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1392 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1393 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1394 if (!PyArg_NoArgs(arg) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1395 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1396 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
1397 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1398
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1399 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1400 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
1401 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1402 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1403 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1404 if (!PyArg_NoArgs(arg) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1405 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1406 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
1407 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1408
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1409 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1410 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
1411 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1412 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1413 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1414 if (!PyArg_NoArgs(arg) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1415 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1416 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
1417 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1418
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1419 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1420 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
1421 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1422 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1423 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1424 if (!PyArg_NoArgs(arg) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1425 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1426 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
1427 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1428
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1429 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1430 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
1431 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1432 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1433 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1434 if (!PyArg_NoArgs(arg) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1435 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1436 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
1437 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1438
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1439 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1440 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
1441 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1442 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1443 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1444 if (!PyArg_NoArgs(arg) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1445 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1446 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
1447 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1448
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1449 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1450 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
1451 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1452 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1453 {
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1454 if (!PyArg_NoArgs(arg) || !PyCursesInitialised())
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1455 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1456 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
1457 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1458
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1459 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1460 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
1461 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1462 PyObject * arg;
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 int ch;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1465 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
1466 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1467 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
1468 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1469
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1470 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1471 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
1472 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1473 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1474 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1475 int ch;
2423
73eeff4d43f8 more fixes by Steve Clift
Guido van Rossum <guido@python.org>
parents: 2358
diff changeset
1476 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
1477 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1478 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
1479 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1480
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1481 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1482 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
1483 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1484 PyObject * arg;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1485 {
5459
c5d7b6fcee03 Avoid warning from gcc on Linux about dropping const.
Guido van Rossum <guido@python.org>
parents: 4600
diff changeset
1486 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
1487 int ch;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1488 if (!PyArg_Parse(arg,"i",&ch))
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1489 return NULL;
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1490 knp = keyname(ch);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1491 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
1492 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1493
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1494 #ifdef NOT_YET
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1495 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1496 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
1497 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1498 PyObject * args;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1499 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1500 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1501
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1502 static PyObject *
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1503 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
1504 PyObject * self;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1505 PyObject * args;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1506 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1507 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1508 #endif
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1509
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1510 /* 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
1511
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1512 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
1513 {"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
1514 {"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
1515 {"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
1516 {"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
1517 {"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
1518 {"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
1519 {"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
1520 {"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
1521 {"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
1522 {"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
1523 {"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
1524 {"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
1525 {"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
1526 {"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
1527 {"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
1528 {"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
1529 {"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
1530 {"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
1531 {"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
1532 {"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
1533 #ifdef NOT_YET
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1534 {"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
1535 {"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
1536 #endif
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1537 {NULL, NULL} /* sentinel */
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1538 };
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1539
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1540 /* 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
1541
9588
38023a425e48 Add DL_EXPORT() to all modules that could possibly be used
Guido van Rossum <guido@python.org>
parents: 9283
diff changeset
1542 DL_EXPORT(void)
1859
54fdc9a95f48 Lance's release 1.1 -- fixes some problems with 1.0
Guido van Rossum <guido@python.org>
parents: 1858
diff changeset
1543 initcurses()
1855
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1544 {
2358
4c43cbdcd524 bump version, add __version__ back in
Guido van Rossum <guido@python.org>
parents: 2357
diff changeset
1545 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
1546
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1547 /* 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
1548 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
1549
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1550 /* 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
1551 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
1552 ModDict = d; /* For PyCurses_InitScr */
1858
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
1553
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1554 /* For exception curses.error */
6367
2c29b8982643 Apply two changes, systematically:
Guido van Rossum <guido@python.org>
parents: 5459
diff changeset
1555 PyCursesError = PyErr_NewException("curses.error", NULL, NULL);
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1556 PyDict_SetItemString(d, "error", PyCursesError);
1858
0b08196e9ff6 Release 1.0 by Lance
Guido van Rossum <guido@python.org>
parents: 1855
diff changeset
1557
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1558 /* Make the version available */
2358
4c43cbdcd524 bump version, add __version__ back in
Guido van Rossum <guido@python.org>
parents: 2357
diff changeset
1559 v = PyString_FromString(PyCursesVersion);
4c43cbdcd524 bump version, add __version__ back in
Guido van Rossum <guido@python.org>
parents: 2357
diff changeset
1560 PyDict_SetItemString(d, "version", v);
4c43cbdcd524 bump version, add __version__ back in
Guido van Rossum <guido@python.org>
parents: 2357
diff changeset
1561 PyDict_SetItemString(d, "__version__", v);
4c43cbdcd524 bump version, add __version__ back in
Guido van Rossum <guido@python.org>
parents: 2357
diff changeset
1562 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
1563
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1564 /* 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
1565 SetDictInt("A_NORMAL", A_NORMAL);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1566 SetDictInt("A_STANDOUT", A_STANDOUT);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1567 SetDictInt("A_UNDERLINE", A_UNDERLINE);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1568 SetDictInt("A_REVERSE", A_REVERSE);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1569 SetDictInt("A_BLINK", A_BLINK);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1570 SetDictInt("A_DIM", A_DIM);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1571 SetDictInt("A_BOLD", A_BOLD);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1572 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
1573
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1574 /* 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
1575 {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1576 int key;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1577 char *key_n;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1578 char *key_n2;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1579 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
1580 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
1581 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
1582 continue;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1583 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
1584 char *p1, *p2;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1585 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
1586 p1 = key_n;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1587 p2 = key_n2;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1588 while (*p1) {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1589 if (*p1 != '(' && *p1 != ')') {
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1590 *p2 = *p1;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1591 p2++;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1592 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1593 p1++;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1594 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1595 *p2 = (char)0;
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1596 } else
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1597 key_n2 = key_n;
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1598 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
1599 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
1600 free(key_n2);
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1601 }
2357
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1602 SetDictInt("KEY_MIN", KEY_MIN);
1740fd76fc33 Steve Clifts version
Guido van Rossum <guido@python.org>
parents: 2296
diff changeset
1603 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
1604 }
9dbdb83d4178 Lance has converted his modules to the new naming conventions, and
Guido van Rossum <guido@python.org>
parents:
diff changeset
1605 }