version 1.27, 2014/04/20 16:46:05 |
version 1.32, 2014/12/24 15:38:55 |
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
*/ |
*/ |
#ifdef HAVE_CONFIG_H |
|
#include "config.h" |
#include "config.h" |
#endif |
|
|
|
|
#include <sys/types.h> |
|
|
#include <assert.h> |
#include <assert.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
Line 43 static void tbl_number(struct termp *, const struct tb |
|
Line 43 static void tbl_number(struct termp *, const struct tb |
|
const struct roffcol *); |
const struct roffcol *); |
static void tbl_hrule(struct termp *, const struct tbl_span *); |
static void tbl_hrule(struct termp *, const struct tbl_span *); |
static void tbl_vrule(struct termp *, const struct tbl_head *); |
static void tbl_vrule(struct termp *, const struct tbl_head *); |
|
static void tbl_word(struct termp *, const struct tbl_dat *); |
|
|
|
|
static size_t |
static size_t |
Line 90 term_tbl(struct termp *tp, const struct tbl_span *sp) |
|
Line 91 term_tbl(struct termp *tp, const struct tbl_span *sp) |
|
tp->tbl.slen = term_tbl_strlen; |
tp->tbl.slen = term_tbl_strlen; |
tp->tbl.arg = tp; |
tp->tbl.arg = tp; |
|
|
tblcalc(&tp->tbl, sp); |
tblcalc(&tp->tbl, sp, rmargin - tp->offset); |
} |
} |
|
|
/* Horizontal frame at the start of boxed tables. */ |
/* Horizontal frame at the start of boxed tables. */ |
Line 106 term_tbl(struct termp *tp, const struct tbl_span *sp) |
|
Line 107 term_tbl(struct termp *tp, const struct tbl_span *sp) |
|
/* Vertical frame at the start of each row. */ |
/* Vertical frame at the start of each row. */ |
|
|
if ((TBL_OPT_BOX | TBL_OPT_DBOX) & sp->opts->opts || |
if ((TBL_OPT_BOX | TBL_OPT_DBOX) & sp->opts->opts || |
sp->head->vert) |
(sp->head != NULL && sp->head->vert)) |
term_word(tp, TBL_SPAN_HORIZ == sp->pos || |
term_word(tp, TBL_SPAN_HORIZ == sp->pos || |
TBL_SPAN_DHORIZ == sp->pos ? "+" : "|"); |
TBL_SPAN_DHORIZ == sp->pos ? "+" : "|"); |
|
|
Line 378 tbl_literal(struct termp *tp, const struct tbl_dat *dp |
|
Line 379 tbl_literal(struct termp *tp, const struct tbl_dat *dp |
|
} |
} |
|
|
tbl_char(tp, ASCII_NBRSP, padl); |
tbl_char(tp, ASCII_NBRSP, padl); |
term_word(tp, dp->string); |
tbl_word(tp, dp); |
tbl_char(tp, ASCII_NBRSP, padr); |
tbl_char(tp, ASCII_NBRSP, padr); |
} |
} |
|
|
Line 416 tbl_number(struct termp *tp, const struct tbl_opts *op |
|
Line 417 tbl_number(struct termp *tp, const struct tbl_opts *op |
|
} else |
} else |
d = sz + psz; |
d = sz + psz; |
|
|
padl = col->decimal - d; |
if (col->decimal > d && col->width > sz) { |
|
padl = col->decimal - d; |
tbl_char(tp, ASCII_NBRSP, padl); |
if (padl + sz > col->width) |
term_word(tp, dp->string); |
padl = col->width - sz; |
|
tbl_char(tp, ASCII_NBRSP, padl); |
|
} else |
|
padl = 0; |
|
tbl_word(tp, dp); |
if (col->width > sz + padl) |
if (col->width > sz + padl) |
tbl_char(tp, ASCII_NBRSP, col->width - sz - padl); |
tbl_char(tp, ASCII_NBRSP, col->width - sz - padl); |
} |
} |
|
|
|
static void |
|
tbl_word(struct termp *tp, const struct tbl_dat *dp) |
|
{ |
|
const void *prev_font; |
|
|
|
prev_font = term_fontq(tp); |
|
if (dp->layout->flags & TBL_CELL_BOLD) |
|
term_fontpush(tp, TERMFONT_BOLD); |
|
else if (dp->layout->flags & TBL_CELL_ITALIC) |
|
term_fontpush(tp, TERMFONT_UNDER); |
|
|
|
term_word(tp, dp->string); |
|
|
|
term_fontpopq(tp, prev_font); |
|
} |