|
ELinks 0.19.1
|
Public terminal drawing API. More...
#include "elinks.h"#include "bfu/dialog.h"#include "config/options.h"#include "intl/charsets.h"#include "terminal/color.h"#include "terminal/draw.h"#include "terminal/screen.h"#include "terminal/terminal.h"#include "util/color.h"#include "util/box.h"
Macros | |
| #define | check_range(term, x, y) |
| Makes sure that x and y are within the dimensions of the terminal. | |
| #define | clear_screen_char_color(schar) |
Functions | |
| NONSTATIC_INLINE struct screen_char * | get_char (struct terminal *term, int x, int y) |
| Extracts a char from the screen. | |
| void | draw_border_cross (struct terminal *term, int x, int y, enum border_cross_direction dir, struct color_pair *color) |
| Sets the cross position of two borders. | |
| void | draw_border_char (struct terminal *term, int x, int y, border_char_T border, struct color_pair *color) |
| Sets the data to border and of a screen position. | |
| void | draw_char_color (struct terminal *term, int x, int y, struct color_pair *color) |
| Sets the color of a screen position. | |
| void | draw_char_data (struct terminal *term, int x, int y, unicode_val_T data) |
| Sets the data of a screen position. | |
| void | draw_space (struct terminal *term, int x, int y, struct screen_char *color) |
| void | draw_line (struct terminal *term, int x, int y, int l, struct screen_char *line) |
| Draws length chars from line on the screen. | |
| void | draw_border (struct terminal *term, struct el_box *box, struct color_pair *color, int width) |
| Draw borders. | |
| void | fix_dwchar_around_box (struct terminal *term, struct el_box *box, int border, int shadow_width, int shadow_height) |
| Checks cells left and right to the box for broken double-width chars. | |
| void | draw_char (struct terminal *term, int x, int y, unicode_val_T data, int attr, struct color_pair *color) |
| Draws a char. | |
| void | draw_box (struct terminal *term, struct el_box *box, unicode_val_T data, int attr, struct color_pair *color) |
| Draws area defined by box using the same colors and attributes. | |
| void | draw_shadow (struct terminal *term, struct el_box *box, struct color_pair *color, int width, int height) |
| Draws a shadow of width and height with color color around box. | |
| static void | draw_text_utf8 (struct terminal *term, int x, int y, const char *text2, int length, int attr, struct color_pair *color) |
| void | draw_text (struct terminal *term, int x, int y, const char *text, int length, int attr, struct color_pair *color) |
| Draws length chars from text. | |
| void | draw_dlg_text (struct dialog_data *dlg_data, int x, int y, const char *text, int length, int attr, struct color_pair *color) |
| Draws text for dialogs. | |
| void | set_cursor (struct terminal *term, int x, int y, int blockable) |
| Updates the terminals cursor position. | |
| void | set_dlg_cursor (struct terminal *term, struct dialog_data *dlg_data, int x, int y, int blockable) |
| void | clear_terminal (struct terminal *term) |
| Blanks the screen. | |
Public terminal drawing API.
Frontend for the screen image in memory.
| #define check_range | ( | term, | |
| x, | |||
| y ) |
Makes sure that x and y are within the dimensions of the terminal.
| #define clear_screen_char_color | ( | schar | ) |
| void clear_terminal | ( | struct terminal * | term | ) |
Blanks the screen.
| void draw_border | ( | struct terminal * | term, |
| struct el_box * | box, | ||
| struct color_pair * | color, | ||
| int | width ) |
Draw borders.
| void draw_border_char | ( | struct terminal * | term, |
| int | x, | ||
| int | y, | ||
| border_char_T | border, | ||
| struct color_pair * | color ) |
Sets the data to border and of a screen position.
| void draw_border_cross | ( | struct terminal * | term, |
| int | x, | ||
| int | y, | ||
| enum border_cross_direction | dir, | ||
| struct color_pair * | color ) |
Sets the cross position of two borders.
| void draw_box | ( | struct terminal * | term, |
| struct el_box * | box, | ||
| unicode_val_T | data, | ||
| int | attr, | ||
| struct color_pair * | color ) |
Draws area defined by box using the same colors and attributes.
| void draw_char | ( | struct terminal * | term, |
| int | x, | ||
| int | y, | ||
| unicode_val_T | data, | ||
| int | attr, | ||
| struct color_pair * | color ) |
Draws a char.
| void draw_char_color | ( | struct terminal * | term, |
| int | x, | ||
| int | y, | ||
| struct color_pair * | color ) |
Sets the color of a screen position.
| void draw_char_data | ( | struct terminal * | term, |
| int | x, | ||
| int | y, | ||
| unicode_val_T | data ) |
Sets the data of a screen position.
The data parameter here is like screen_char.data: UCS-4 if the charset of the terminal is UTF-8 (possible only if CONFIG_UTF8 is defined), and a byte otherwise.
| void draw_dlg_text | ( | struct dialog_data * | dlg_data, |
| int | x, | ||
| int | y, | ||
| const char * | text, | ||
| int | length, | ||
| int | attr, | ||
| struct color_pair * | color ) |
Draws text for dialogs.
| void draw_line | ( | struct terminal * | term, |
| int | x, | ||
| int | y, | ||
| int | l, | ||
| struct screen_char * | line ) |
Draws length chars from line on the screen.
Used by viewer to copy over a document. When doing frame drawing x can be different than 0.
| void draw_shadow | ( | struct terminal * | term, |
| struct el_box * | box, | ||
| struct color_pair * | color, | ||
| int | width, | ||
| int | height ) |
Draws a shadow of width and height with color color around box.
| void draw_space | ( | struct terminal * | term, |
| int | x, | ||
| int | y, | ||
| struct screen_char * | color ) |
| void draw_text | ( | struct terminal * | term, |
| int | x, | ||
| int | y, | ||
| const char * | text, | ||
| int | length, | ||
| int | attr, | ||
| struct color_pair * | color ) |
Draws length chars from text.
|
static |
| void fix_dwchar_around_box | ( | struct terminal * | term, |
| struct el_box * | box, | ||
| int | border, | ||
| int | shadow_width, | ||
| int | shadow_height ) |
Checks cells left and right to the box for broken double-width chars.
Replace it with UCS_ORPHAN_CELL.
* 1+---+3 * 1|box|##4 * 1| |##4 * 1| |##4 * 1+---+##4 * 2#####4 * 1,2,3,4 - needs to be checked, # - shadow , +,-,| - border *
| NONSTATIC_INLINE struct screen_char * get_char | ( | struct terminal * | term, |
| int | x, | ||
| int | y ) |
Extracts a char from the screen.
| void set_cursor | ( | struct terminal * | term, |
| int | x, | ||
| int | y, | ||
| int | blockable ) |
Updates the terminals cursor position.
When blockable is set the block_cursor terminal option decides whether the cursor should be put at the bottom right corner of the screen.
| void set_dlg_cursor | ( | struct terminal * | term, |
| struct dialog_data * | dlg_data, | ||
| int | x, | ||
| int | y, | ||
| int | blockable ) |