mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-10-31 15:20:13 +00:00
inline ncplane_putsimple_yx()
This commit is contained in:
parent
37b4d96794
commit
4a6ab358ba
@ -863,7 +863,14 @@ ncplane_putc(struct ncplane* n, const cell* c){
|
|||||||
// Replace the cell at the specified coordinates with the provided 7-bit char
|
// Replace the cell at the specified coordinates with the provided 7-bit char
|
||||||
// 'c'. Advance the cursor by 1. On success, returns 1. On failure, returns -1.
|
// 'c'. Advance the cursor by 1. On success, returns 1. On failure, returns -1.
|
||||||
// This works whether the underlying char is signed or unsigned.
|
// This works whether the underlying char is signed or unsigned.
|
||||||
int ncplane_putsimple_yx(struct ncplane* n, int y, int x, char c);
|
static inline int
|
||||||
|
ncplane_putsimple_yx(struct ncplane* n, int y, int x, char c){
|
||||||
|
cell ce = CELL_INITIALIZER(c, ncplane_attr(n), ncplane_channels(n));
|
||||||
|
if(!cell_simple_p(&ce)){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return ncplane_putc_yx(n, y, x, &ce);
|
||||||
|
}
|
||||||
|
|
||||||
// Call ncplane_putsimple_yx() at the current cursor location.
|
// Call ncplane_putsimple_yx() at the current cursor location.
|
||||||
static inline int
|
static inline int
|
||||||
|
@ -18,7 +18,8 @@ ncplane_putc(struct ncplane* n, const cell* c);**
|
|||||||
**static inline int
|
**static inline int
|
||||||
ncplane_putsimple(struct ncplane* n, char c);**
|
ncplane_putsimple(struct ncplane* n, char c);**
|
||||||
|
|
||||||
**int ncplane_putsimple_yx(struct ncplane* n, int y, int x, char c);**
|
**static inline int
|
||||||
|
ncplane_putsimple_yx(struct ncplane* n, int y, int x, char c);**
|
||||||
|
|
||||||
**int ncplane_putsimple_stainable(struct ncplane* n, char c);**
|
**int ncplane_putsimple_stainable(struct ncplane* n, char c);**
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1336,7 +1336,6 @@ int ncplane_putc_yx(ncplane* n, int y, int x, const cell* c){
|
|||||||
// FIXME if new n->y >= n->leny, scroll everything up a line and reset n->y
|
// FIXME if new n->y >= n->leny, scroll everything up a line and reset n->y
|
||||||
}
|
}
|
||||||
if(ncplane_cursor_move_yx(n, y, x)){
|
if(ncplane_cursor_move_yx(n, y, x)){
|
||||||
fprintf(stderr, "CAN'T MOVE TO %d/%d (real: %d/%d)\n", y, x, n->y, n->x);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
// A wide character obliterates anything to its immediate right (and marks
|
// A wide character obliterates anything to its immediate right (and marks
|
||||||
@ -1380,14 +1379,6 @@ fprintf(stderr, "CAN'T MOVE TO %d/%d (real: %d/%d)\n", y, x, n->y, n->x);
|
|||||||
return cols;
|
return cols;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ncplane_putsimple_yx(struct ncplane* n, int y, int x, char c){
|
|
||||||
cell ce = CELL_INITIALIZER(c, ncplane_attr(n), ncplane_channels(n));
|
|
||||||
if(!cell_simple_p(&ce)){
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return ncplane_putc_yx(n, y, x, &ce);
|
|
||||||
}
|
|
||||||
|
|
||||||
int ncplane_putegc_yx(struct ncplane* n, int y, int x, const char* gclust, int* sbytes){
|
int ncplane_putegc_yx(struct ncplane* n, int y, int x, const char* gclust, int* sbytes){
|
||||||
cell c = CELL_TRIVIAL_INITIALIZER;
|
cell c = CELL_TRIVIAL_INITIALIZER;
|
||||||
int primed = cell_prime(n, &c, gclust, n->attrword, n->channels);
|
int primed = cell_prime(n, &c, gclust, n->attrword, n->channels);
|
||||||
|
Loading…
Reference in New Issue
Block a user