annotate Modules/_cursesmodule.c @ 3216:d00a79ebb027 legacy-trunk

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