Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
fbea2f3e
Commit
fbea2f3e
authored
Aug 31, 1994
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Release 1.0 by Lance
parent
7522f030
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
131 additions
and
1 deletion
+131
-1
Modules/_cursesmodule.c
Modules/_cursesmodule.c
+131
-1
No files found.
Modules/_cursesmodule.c
View file @
fbea2f3e
...
@@ -22,6 +22,120 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
...
@@ -22,6 +22,120 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
******************************************************************/
/******************************************************************
This is a curses implimentation. I have tried to be as complete
as possible. If there are functions you need that are not included,
please let me know and/or send me some diffs.
There are 3 basic types exported by this module:
1) Screen - This is not currently used
2) Window - This is the basic type. This is equivalent to "WINDOW *".
3) Pad - This is similar to Window, but works with Pads as defined
in curses.
Most of the routines can be looked up using the curses man page.
Here is a list of the currently supported methods and attributes
in the curses module:
Return Value Func/Attr Description
--------------------------------------------------------------------------
StringObject __version__ This returns a string representing
the current version of this module
WindowObject initscr() This initializes the screen for use
None endwin() Closes down the screen and returns
things as they were before calling
initscr()
True/FalseObject isendwin() Has endwin() been called?
IntObject doupdate() Updates screen and returns number
of bytes written to screen
WindowObject newwin(nlines,ncols,begin_y,begin_x)
newwin(begin_y,begin_x)
newwin() creates and returns
a new window.
None beep() Beep the screen if possible
None flash() Flash the screen if possible
None ungetch(int) Push the int back so next getch()
will return it.
Note: argument is an INT, not a CHAR
None flushinp() Flush all input buffers
None cbreak() Enter cbreak mode
None nocbreak() Leave cbreak mode
None echo() Enter echo mode
None noecho() Leave echo mode
None nl() Enter nl mode
None nonl() Leave nl mode
None raw() Enter raw mode
None noraw() Leave raw mode
None intrflush(int) Set or reset interruptable flush
mode, int=1 if set, 0 if notset.
None meta(int) Allow 8 bit or 7 bit chars.
int=1 is 8 bit, int=0 is 7 bit
StringObject keyname(int) return the text representation
of a KEY_ value. (see below)
Here is a list of the currently supported methods and attributes
in the WindowObject:
Return Value Func/Attr Description
--------------------------------------------------------------------------
IntObject refresh() Do refresh
IntObject nooutrefresh() Mark for refresh but wait
True/False mvwin(new_y,new_x) Move Window
True/False move(new_y,new_x) Move Cursor
WindowObject subwin(nlines,ncols,begin_y,begin_x)
subwin(begin_y,begin_x)
True/False addch(y,x,ch,attr)
addch(y,x,ch)
addch(ch,attr)
addch(ch)
True/False insch(y,x,ch,attr)
insch(y,x,ch)
insch(ch,attr)
insch(ch)
True/False delch(y,x)
delch()
True/False echochar(ch,attr)
echochar(ch)
True/False addstr(y,x,str,attr)
addstr(y,x,str)
addstr(str,attr)
addstr(str)
True/False attron(attr)
True/False attroff(attr)
True/False attrset(sttr)
True/False standend()
True/False standout()
True/False box(vertch,horch) vertch and horch are INTS
box()
None erase()
None deleteln()
None insertln()
(y,x) getyx()
(y,x) getbegyx()
(y,x) getmaxyx()
None clear()
None clrtobot()
None clrtoeol()
None scroll()
None touchwin()
None touchline(start,count)
IntObject getch(y,x)
getch()
StringObject getstr(y,x)
getstr()
IntObject inch(y,x)
inch()
None clearok(int) int=0 or int=1
None idlok(int) int=0 or int=1
None leaveok(int) int=0 or int=1
None scrollok(int) int=0 or int=1
None setscrreg(top,bottom)
None nodelay(int) int=0 or int=1
None notimeout(int) int=0 or int=1
******************************************************************/
/* curses module */
/* curses module */
#include "allobjects.h"
#include "allobjects.h"
...
@@ -60,6 +174,17 @@ staticforward PyTypeObject PyCursesPad_Type;
...
@@ -60,6 +174,17 @@ staticforward PyTypeObject PyCursesPad_Type;
PyObject
*
PyCurses_OK
;
PyObject
*
PyCurses_OK
;
PyObject
*
PyCurses_ERR
;
PyObject
*
PyCurses_ERR
;
/******************************************************************
Change Log:
Version 1.0: 94/08/30:
This is the first release of this software.
Released to the Internet via python-list@cwi.nl
******************************************************************/
char
*
PyCursesVersion
=
"1.0 first release"
/* ------------- SCREEN routines --------------- */
/* ------------- SCREEN routines --------------- */
#ifdef NOT_YET
#ifdef NOT_YET
static
PyObject
*
static
PyObject
*
...
@@ -1203,7 +1328,7 @@ static PyMethodDef PyCurses_methods[] = {
...
@@ -1203,7 +1328,7 @@ static PyMethodDef PyCurses_methods[] = {
/* Initialization function for the module */
/* Initialization function for the module */
void
void
initcurses
()
init
n
curses
()
{
{
PyObject
*
m
,
*
d
,
*
x
;
PyObject
*
m
,
*
d
,
*
x
;
...
@@ -1216,6 +1341,11 @@ initcurses()
...
@@ -1216,6 +1341,11 @@ initcurses()
Py_INCREF
(
PyCurses_ERR
);
Py_INCREF
(
PyCurses_ERR
);
/* Add some symbolic constants to the module */
/* Add some symbolic constants to the module */
d
=
PyModule_GetDict
(
m
);
d
=
PyModule_GetDict
(
m
);
/* Make the version available */
PyDict_SetItemString
(
d
,
"__version__"
,
PyString_FromString
(
PyCursesVersion
));
/* Here are some defines */
/* Here are some defines */
PyDict_SetItemString
(
d
,
"OK"
,
PyCurses_OK
);
PyDict_SetItemString
(
d
,
"OK"
,
PyCurses_OK
);
PyDict_SetItemString
(
d
,
"ERR"
,
PyCurses_ERR
);
PyDict_SetItemString
(
d
,
"ERR"
,
PyCurses_ERR
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment