| 1 | /* |
|---|
| 2 | * TOIlet The Other Implementation’s letters |
|---|
| 3 | * Copyright (c) 2006 Sam Hocevar <sam@zoy.org> |
|---|
| 4 | * All Rights Reserved |
|---|
| 5 | * |
|---|
| 6 | * $Id$ |
|---|
| 7 | * |
|---|
| 8 | * This program is free software. It comes without any warranty, to |
|---|
| 9 | * the extent permitted by applicable law. You can redistribute it |
|---|
| 10 | * and/or modify it under the terms of the Do What The Fuck You Want |
|---|
| 11 | * To Public License, Version 2, as published by Sam Hocevar. See |
|---|
| 12 | * http://sam.zoy.org/wtfpl/COPYING for more details. |
|---|
| 13 | */ |
|---|
| 14 | |
|---|
| 15 | /* |
|---|
| 16 | * This header defines global variables. |
|---|
| 17 | */ |
|---|
| 18 | |
|---|
| 19 | struct toilet_context |
|---|
| 20 | { |
|---|
| 21 | char const *export; |
|---|
| 22 | char const *font; |
|---|
| 23 | char const *dir; |
|---|
| 24 | |
|---|
| 25 | unsigned int term_width; |
|---|
| 26 | |
|---|
| 27 | cucul_canvas_t *cv; |
|---|
| 28 | cucul_canvas_t *torender; |
|---|
| 29 | unsigned int w, h, ew, eh, x, y, lines; |
|---|
| 30 | |
|---|
| 31 | /* Render methods */ |
|---|
| 32 | int (*feed)(struct toilet_context *, uint32_t, uint32_t); |
|---|
| 33 | int (*flush)(struct toilet_context *); |
|---|
| 34 | int (*end)(struct toilet_context *); |
|---|
| 35 | |
|---|
| 36 | /* Used by the FIGlet driver */ |
|---|
| 37 | enum { H_DEFAULT, H_KERN, H_SMUSH, H_NONE, H_OVERLAP } hmode; |
|---|
| 38 | unsigned int hsmushrule; |
|---|
| 39 | unsigned long int hardblank; |
|---|
| 40 | unsigned int height, baseline, max_length; |
|---|
| 41 | int old_layout; |
|---|
| 42 | unsigned int print_direction, full_layout, codetag_count; |
|---|
| 43 | unsigned int glyphs; |
|---|
| 44 | cucul_canvas_t *fontcv, *charcv; |
|---|
| 45 | int *left, *right; /* Unused yet */ |
|---|
| 46 | unsigned int *lookup; |
|---|
| 47 | |
|---|
| 48 | /* Render filters */ |
|---|
| 49 | void (**filters)(struct toilet_context *); |
|---|
| 50 | unsigned int nfilters; |
|---|
| 51 | }; |
|---|
| 52 | |
|---|
| 53 | typedef struct toilet_context context_t; |
|---|
| 54 | |
|---|