version 1.62, 2017/02/08 08:26:35 |
version 1.63, 2017/02/08 15:41:41 |
|
|
static void grid_string_cells_code(const struct grid_cell *, |
static void grid_string_cells_code(const struct grid_cell *, |
const struct grid_cell *, char *, size_t, int); |
const struct grid_cell *, char *, size_t, int); |
|
|
|
/* Store cell in entry. */ |
|
static void |
|
grid_store_cell(struct grid_cell_entry *gce, const struct grid_cell *gc, |
|
u_char c) |
|
{ |
|
gce->flags = gc->flags; |
|
|
|
gce->data.fg = gc->fg & 0xff; |
|
if (gc->fg & COLOUR_FLAG_256) |
|
gce->flags |= GRID_FLAG_FG256; |
|
|
|
gce->data.bg = gc->bg & 0xff; |
|
if (gc->bg & COLOUR_FLAG_256) |
|
gce->flags |= GRID_FLAG_BG256; |
|
|
|
gce->data.attr = gc->attr; |
|
gce->data.data = c; |
|
} |
|
|
/* Set cell as extended. */ |
/* Set cell as extended. */ |
static struct grid_cell * |
static struct grid_cell * |
grid_extended_cell(struct grid_line *gl, struct grid_cell_entry *gce, |
grid_extended_cell(struct grid_line *gl, struct grid_cell_entry *gce, |
|
|
grid_expand_line(gd, py, px + 1, 8); |
grid_expand_line(gd, py, px + 1, 8); |
|
|
gl = &gd->linedata[py]; |
gl = &gd->linedata[py]; |
gce = &gl->celldata[px]; |
|
|
|
if (px + 1 > gl->cellused) |
if (px + 1 > gl->cellused) |
gl->cellused = px + 1; |
gl->cellused = px + 1; |
|
|
|
gce = &gl->celldata[px]; |
extended = (gce->flags & GRID_FLAG_EXTENDED); |
extended = (gce->flags & GRID_FLAG_EXTENDED); |
if (!extended && (gc->data.size != 1 || gc->data.width != 1)) |
if (!extended && (gc->data.size != 1 || gc->data.width != 1)) |
extended = 1; |
extended = 1; |
|
|
extended = 1; |
extended = 1; |
if (!extended && (gc->bg & COLOUR_FLAG_RGB)) |
if (!extended && (gc->bg & COLOUR_FLAG_RGB)) |
extended = 1; |
extended = 1; |
if (extended) { |
if (extended) |
grid_extended_cell(gl, gce, gc); |
grid_extended_cell(gl, gce, gc); |
return; |
else |
} |
grid_store_cell(gce, gc, gc->data.data[0]); |
|
|
gce->flags = gc->flags; |
|
gce->data.attr = gc->attr; |
|
gce->data.fg = gc->fg & 0xff; |
|
if (gc->fg & COLOUR_FLAG_256) |
|
gce->flags |= GRID_FLAG_FG256; |
|
gce->data.bg = gc->bg & 0xff; |
|
if (gc->bg & COLOUR_FLAG_256) |
|
gce->flags |= GRID_FLAG_BG256; |
|
gce->data.data = gc->data.data[0]; |
|
} |
} |
|
|
/* Clear area. */ |
/* Clear area. */ |