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
6c62c9d1
Commit
6c62c9d1
authored
Dec 21, 2000
by
Andrew M. Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Another patch from Thomas Gellekum: add .overlay() and .overwrite()
window methods
parent
f163ea37
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
3 deletions
+81
-3
Modules/_cursesmodule.c
Modules/_cursesmodule.c
+81
-3
No files found.
Modules/_cursesmodule.c
View file @
6c62c9d1
...
...
@@ -39,12 +39,12 @@ A number of SysV or ncurses functions don't have wrappers yet; if you need
a given function, add it and send a patch. Here's a list of currently
unsupported functions:
addchnstr addchstr chgat color_set
copywin
define_key
addchnstr addchstr chgat color_set define_key
del_curterm delscreen dupwin inchnstr inchstr innstr keyok
mcprint mvaddchnstr mvaddchstr mvchgat mvcur mvinchnstr
mvinchstr mvinnstr mmvwaddchnstr mvwaddchstr mvwchgat
mvwgetnstr mvwinchnstr mvwinchstr mvwinnstr newterm
overlay overwrite
resizeterm restartterm ripoffline scr_dump
resizeterm restartterm ripoffline scr_dump
scr_init scr_restore scr_set scrl set_curterm set_term setterm
tgetent tgetflag tgetnum tgetstr tgoto timeout tputs
use_default_colors vidattr vidputs waddchnstr waddchstr wchgat
...
...
@@ -1081,6 +1081,82 @@ PyCursesWindow_NoOutRefresh(PyCursesWindowObject *self, PyObject *args)
}
}
static
PyObject
*
PyCursesWindow_Overlay
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
{
PyCursesWindowObject
*
temp
;
int
use_copywin
=
FALSE
;
int
sminrow
,
smincol
,
dminrow
,
dmincol
,
dmaxrow
,
dmaxcol
;
int
rtn
;
switch
(
ARG_COUNT
(
args
))
{
case
1
:
if
(
!
PyArg_ParseTuple
(
args
,
"O!;window object"
,
&
PyCursesWindow_Type
,
&
temp
))
return
NULL
;
break
;
case
7
:
if
(
!
PyArg_ParseTuple
(
args
,
"(O!iiiiii);window object, int, int, int, int, int, int"
,
&
PyCursesWindow_Type
,
&
temp
,
&
sminrow
,
&
smincol
,
&
dminrow
,
&
dmincol
,
&
dmaxrow
,
&
dmaxcol
))
return
NULL
;
use_copywin
=
TRUE
;
break
;
default:
PyErr_SetString
(
PyExc_TypeError
,
"overlay requires one or seven arguments"
);
return
NULL
;
}
if
(
use_copywin
==
TRUE
)
{
rtn
=
copywin
(
self
->
win
,
temp
->
win
,
sminrow
,
smincol
,
dminrow
,
dmincol
,
dmaxrow
,
dmaxcol
,
TRUE
);
return
PyCursesCheckERR
(
rtn
,
"copywin"
);
}
else
{
rtn
=
overlay
(
self
->
win
,
temp
->
win
);
return
PyCursesCheckERR
(
rtn
,
"overlay"
);
}
}
static
PyObject
*
PyCursesWindow_Overwrite
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
{
PyCursesWindowObject
*
temp
;
int
use_copywin
=
FALSE
;
int
sminrow
,
smincol
,
dminrow
,
dmincol
,
dmaxrow
,
dmaxcol
;
int
rtn
;
switch
(
ARG_COUNT
(
args
))
{
case
1
:
if
(
!
PyArg_ParseTuple
(
args
,
"O!;window object"
,
&
PyCursesWindow_Type
,
&
temp
))
return
NULL
;
break
;
case
7
:
if
(
!
PyArg_ParseTuple
(
args
,
"(O!iiiiii);window object, int, int, int, int, int, int"
,
&
PyCursesWindow_Type
,
&
temp
,
&
sminrow
,
&
smincol
,
&
dminrow
,
&
dmincol
,
&
dmaxrow
,
&
dmaxcol
))
return
NULL
;
use_copywin
=
TRUE
;
break
;
default:
PyErr_SetString
(
PyExc_TypeError
,
"overwrite requires one or seven arguments"
);
return
NULL
;
}
if
(
use_copywin
==
TRUE
)
{
rtn
=
copywin
(
self
->
win
,
temp
->
win
,
sminrow
,
smincol
,
dminrow
,
dmincol
,
dmaxrow
,
dmaxcol
,
FALSE
);
return
PyCursesCheckERR
(
rtn
,
"copywin"
);
}
else
{
rtn
=
overwrite
(
self
->
win
,
temp
->
win
);
return
PyCursesCheckERR
(
rtn
,
"overwrite"
);
}
}
static
PyObject
*
PyCursesWindow_PutWin
(
PyCursesWindowObject
*
self
,
PyObject
*
args
)
{
...
...
@@ -1323,7 +1399,9 @@ static PyMethodDef PyCursesWindow_Methods[] = {
{
"notimeout"
,
(
PyCFunction
)
PyCursesWindow_notimeout
},
{
"noutrefresh"
,
(
PyCFunction
)
PyCursesWindow_NoOutRefresh
},
/* Backward compatibility alias -- remove in Python 2.1 */
{
"nooutrefresh"
,
(
PyCFunction
)
PyCursesWindow_NoOutRefresh
},
{
"nooutrefresh"
,
(
PyCFunction
)
PyCursesWindow_NoOutRefresh
},
{
"overlay"
,
(
PyCFunction
)
PyCursesWindow_Overlay
,
METH_VARARGS
},
{
"overwrite"
,
(
PyCFunction
)
PyCursesWindow_Overwrite
,
METH_VARARGS
},
{
"putwin"
,
(
PyCFunction
)
PyCursesWindow_PutWin
},
{
"redrawln"
,
(
PyCFunction
)
PyCursesWindow_RedrawLine
},
{
"redrawwin"
,
(
PyCFunction
)
PyCursesWindow_redrawwin
},
...
...
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