mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
extract_clrs: drop redundant nilayer param
This commit is contained in:
parent
ae3ada45f3
commit
83976d7fd1
@ -456,7 +456,7 @@ block_on_input(tinfo* ti, const struct timespec* ts){
|
|||||||
return -1;
|
return -1;
|
||||||
#else
|
#else
|
||||||
struct pollfd pfd = {
|
struct pollfd pfd = {
|
||||||
.fd = ti->input->infd,
|
.fd = ti->input.infd,
|
||||||
.events = POLLIN,
|
.events = POLLIN,
|
||||||
.revents = 0,
|
.revents = 0,
|
||||||
};
|
};
|
||||||
@ -1690,7 +1690,8 @@ scan_for_clrs(ncinputlayer* ni){
|
|||||||
// appropriate. we can be interrupted by a new user context. we enter holding
|
// appropriate. we can be interrupted by a new user context. we enter holding
|
||||||
// the input lock, and leave holding the input lock, giving it up only while
|
// the input lock, and leave holding the input lock, giving it up only while
|
||||||
// blocking for readable action.
|
// blocking for readable action.
|
||||||
void ncinput_extract_clrs(tinfo* ti, ncinputlayer* ni){
|
void ncinput_extract_clrs(tinfo* ti){
|
||||||
|
ncinputlayer* ni = &ti->input;
|
||||||
do{
|
do{
|
||||||
if(ni->inputbuf_occupied){
|
if(ni->inputbuf_occupied){
|
||||||
scan_for_clrs(ni);
|
scan_for_clrs(ni);
|
||||||
|
@ -57,7 +57,7 @@ int cbreak_mode(struct tinfo* ti);
|
|||||||
// assuming the user context is not active, go through current data looking
|
// assuming the user context is not active, go through current data looking
|
||||||
// for a cursor location report. if we find none, block on input, and read if
|
// for a cursor location report. if we find none, block on input, and read if
|
||||||
// appropriate. we can be interrupted by a new user context.
|
// appropriate. we can be interrupted by a new user context.
|
||||||
void ncinput_extract_clrs(struct tinfo* ti, struct ncinputlayer* nilayer);
|
void ncinput_extract_clrs(struct tinfo* ti);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -987,7 +987,7 @@ int locate_cursor(tinfo* ti, int* cursor_y, int* cursor_x){
|
|||||||
}
|
}
|
||||||
// this can block. we must enter holding the input lock, and it will
|
// this can block. we must enter holding the input lock, and it will
|
||||||
// return to us holding the input lock.
|
// return to us holding the input lock.
|
||||||
ncinput_extract_clrs(&ti->input);
|
ncinput_extract_clrs(ti);
|
||||||
if( (clr = ti->input.creport_queue) ){
|
if( (clr = ti->input.creport_queue) ){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1004,7 +1004,7 @@ int locate_cursor(tinfo* ti, int* cursor_y, int* cursor_x){
|
|||||||
*cursor_x = tmp;
|
*cursor_x = tmp;
|
||||||
}
|
}
|
||||||
free(clr);
|
free(clr);
|
||||||
#endif
|
#else
|
||||||
CONSOLE_SCREEN_BUFFER_INFO conbuf;
|
CONSOLE_SCREEN_BUFFER_INFO conbuf;
|
||||||
if(!GetConsoleScreenBufferInfo(ti->outhandle, &conbuf)){
|
if(!GetConsoleScreenBufferInfo(ti->outhandle, &conbuf)){
|
||||||
logerror("couldn't get cursor info\n");
|
logerror("couldn't get cursor info\n");
|
||||||
@ -1013,5 +1013,6 @@ int locate_cursor(tinfo* ti, int* cursor_y, int* cursor_x){
|
|||||||
*cursor_y = conbuf.dwCursorPosition.Y;
|
*cursor_y = conbuf.dwCursorPosition.Y;
|
||||||
*cursor_x = conbuf.dwCursorPosition.X;
|
*cursor_x = conbuf.dwCursorPosition.X;
|
||||||
loginfo("got a report from y=%d x=%d\n", *cursor_y, *cursor_x);
|
loginfo("got a report from y=%d x=%d\n", *cursor_y, *cursor_x);
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user