# format_draw

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L690
- **Page:** https://libtmux.org/en/tmux/latest/reference/c-function-format_draw/

```c
void format_draw(struct screen_write_ctx *octx, const struct grid_cell *base, u_int available, const char *expanded, struct style_ranges *srs, int default_colours)
```

## Parameters

- `octx` (`struct screen_write_ctx *`)
- `base` (`const struct grid_cell *`)
- `available` (`u_int`)
- `expanded` (`const char *`)
- `srs` (`struct style_ranges *`)
- `default_colours` (`int`)

## Called by

- [`mode_tree_draw`](/en/tmux/latest/reference/c-function-mode_tree_draw/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L850)
- [`screen_redraw_make_pane_status`](/en/tmux/latest/reference/c-function-screen-redraw-c-screen_redraw_make_pane_status/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-redraw.c#L647)
- [`screen_write_box`](/en/tmux/latest/reference/c-function-screen_write_box/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L873)
- [`screen_write_menu`](/en/tmux/latest/reference/c-function-screen_write_menu/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/screen-write.c#L808)
- [`server_destroy_pane`](/en/tmux/latest/reference/c-function-server_destroy_pane/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/server-fn.c#L365)
- [`status_message_redraw`](/en/tmux/latest/reference/c-function-status_message_redraw/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/status.c#L655)
- [`status_prompt_redraw`](/en/tmux/latest/reference/c-function-status_prompt_redraw/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/status.c#L923)
- [`status_redraw`](/en/tmux/latest/reference/c-function-status_redraw/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/status.c#L441)
- [`window_copy_write_line`](/en/tmux/latest/reference/c-function-window-copy-c-window_copy_write_line/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-copy.c#L4972)
- [`window_tree_draw_label`](/en/tmux/latest/reference/c-function-window-tree-c-window_tree_draw_label/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L424)

## Calls

- [`format_draw_absolute_centre`](/en/tmux/latest/reference/c-function-format-draw-c-format_draw_absolute_centre/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L1025)
- [`format_draw_centre`](/en/tmux/latest/reference/c-function-format-draw-c-format_draw_centre/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L1011)
- [`format_draw_left`](/en/tmux/latest/reference/c-function-format-draw-c-format_draw_left/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L1004)
- [`format_draw_many`](/en/tmux/latest/reference/c-function-format-draw-c-format_draw_many/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L770)
- [`format_draw_none`](/en/tmux/latest/reference/c-function-format-draw-c-format_draw_none/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L999)
- [`format_draw_right`](/en/tmux/latest/reference/c-function-format-draw-c-format_draw_right/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L1018)
- [`format_free_range`](/en/tmux/latest/reference/c-function-format-draw-c-format_free_range/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L822)
- [`format_skip`](/en/tmux/latest/reference/c-function-format_skip/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L817)
- [`log_debug`](/en/tmux/latest/reference/c-function-log_debug/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L738)
- [`screen_free`](/en/tmux/latest/reference/c-function-screen_free/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L1080)
- [`screen_init`](/en/tmux/latest/reference/c-function-screen_init/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L746)
- [`screen_write_cell`](/en/tmux/latest/reference/c-function-screen_write_cell/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L783)
- [`screen_write_clearendofline`](/en/tmux/latest/reference/c-function-screen_write_clearendofline/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L748)
- [`screen_write_cursormove`](/en/tmux/latest/reference/c-function-screen_write_cursormove/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L1083)
- [`screen_write_putc`](/en/tmux/latest/reference/c-function-screen_write_putc/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L989)
- [`screen_write_start`](/en/tmux/latest/reference/c-function-screen_write_start/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L747)
- [`screen_write_stop`](/en/tmux/latest/reference/c-function-screen_write_stop/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L974)
- [`style_copy`](/en/tmux/latest/reference/c-function-style_copy/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L826)
- [`style_parse`](/en/tmux/latest/reference/c-function-style_parse/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L827)
- [`style_set`](/en/tmux/latest/reference/c-function-style_set/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L736)
- [`utf8_append`](/en/tmux/latest/reference/c-function-utf8_append/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L794)
- [`utf8_set`](/en/tmux/latest/reference/c-function-utf8_set/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L782)
- [`xcalloc`](/en/tmux/latest/reference/c-function-xcalloc/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L956)
- [`xstrndup`](/en/tmux/latest/reference/c-function-xstrndup/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format-draw.c#L825)

## Other function references

- [`format_is_type`](/en/tmux/latest/reference/c-function-format-draw-c-format_is_type/) (function)
- [`style_tostring`](/en/tmux/latest/reference/c-function-style_tostring/) (function)
- [`utf8_open`](/en/tmux/latest/reference/c-function-utf8_open/) (function)

## Referenced declarations

- [`style.align`](/en/tmux/latest/reference/c-struct-style-align/) (attribute)
- [`format_range.argument`](/en/tmux/latest/reference/c-struct-format_range-argument/) (attribute)
- [`style_range.argument`](/en/tmux/latest/reference/c-struct-style_range-argument/) (attribute)
- [`grid_cell.bg`](/en/tmux/latest/reference/c-struct-grid_cell-bg/) (attribute)
- [`screen.cx`](/en/tmux/latest/reference/c-struct-screen-cx/) (attribute)
- [`screen.cy`](/en/tmux/latest/reference/c-struct-screen-cy/) (attribute)
- [`grid_cell.data`](/en/tmux/latest/reference/c-struct-grid_cell-data/) (attribute)
- [`style.default_type`](/en/tmux/latest/reference/c-struct-style-default_type/) (attribute)
- [`format_range.end`](/en/tmux/latest/reference/c-struct-format_range-end/) (attribute)
- [`style_range.end`](/en/tmux/latest/reference/c-struct-style_range-end/) (attribute)
- [`style_range.entry`](/en/tmux/latest/reference/c-struct-style_range-entry/) (attribute)
- [`grid_cell.fg`](/en/tmux/latest/reference/c-struct-grid_cell-fg/) (attribute)
- [`style.fill`](/en/tmux/latest/reference/c-struct-style-fill/) (attribute)
- [`style.gc`](/en/tmux/latest/reference/c-struct-style-gc/) (attribute)
- [`grid_cell`](/en/tmux/latest/reference/c-struct-grid_cell/) (struct)
- [`grid_default_cell`](/en/tmux/latest/reference/c-variable-grid_default_cell/) (attribute)
- [`utf8_data.have`](/en/tmux/latest/reference/c-struct-utf8_data-have/) (attribute)
- [`style.ignore`](/en/tmux/latest/reference/c-struct-style-ignore/) (attribute)
- [`format_range.index`](/en/tmux/latest/reference/c-struct-format_range-index/) (attribute)
- [`style.list`](/en/tmux/latest/reference/c-struct-style-list/) (attribute)
- [`style.range_argument`](/en/tmux/latest/reference/c-struct-style-range_argument/) (attribute)
- [`style.range_string`](/en/tmux/latest/reference/c-struct-style-range_string/) (attribute)
- [`style.range_type`](/en/tmux/latest/reference/c-struct-style-range_type/) (attribute)
- [`format_range.s`](/en/tmux/latest/reference/c-struct-format_range-s/) (attribute)
- [`screen_write_ctx.s`](/en/tmux/latest/reference/c-struct-screen_write_ctx-s/) (attribute)
- [`screen_write_ctx`](/en/tmux/latest/reference/c-struct-screen_write_ctx/) (struct)
- [`format_range.start`](/en/tmux/latest/reference/c-struct-format_range-start/) (attribute)
- [`style_range.start`](/en/tmux/latest/reference/c-struct-style_range-start/) (attribute)
- [`format_range.string`](/en/tmux/latest/reference/c-struct-format_range-string/) (attribute)
- [`style_range.string`](/en/tmux/latest/reference/c-struct-style_range-string/) (attribute)
- [`STYLE_ALIGN_ABSOLUTE_CENTRE`](/en/tmux/latest/reference/c-enum-style_align-style_align_absolute_centre/) (constant)
- [`STYLE_ALIGN_CENTRE`](/en/tmux/latest/reference/c-enum-style_align-style_align_centre/) (constant)
- [`STYLE_ALIGN_DEFAULT`](/en/tmux/latest/reference/c-enum-style_align-style_align_default/) (constant)
- [`STYLE_ALIGN_LEFT`](/en/tmux/latest/reference/c-enum-style_align-style_align_left/) (constant)
- [`STYLE_ALIGN_RIGHT`](/en/tmux/latest/reference/c-enum-style_align-style_align_right/) (constant)
- [`STYLE_DEFAULT_BASE`](/en/tmux/latest/reference/c-enum-style_default_type-style_default_base/) (constant)
- [`STYLE_DEFAULT_POP`](/en/tmux/latest/reference/c-enum-style_default_type-style_default_pop/) (constant)
- [`STYLE_DEFAULT_PUSH`](/en/tmux/latest/reference/c-enum-style_default_type-style_default_push/) (constant)
- [`STYLE_DEFAULT_SET`](/en/tmux/latest/reference/c-enum-style_default_type-style_default_set/) (constant)
- [`STYLE_LIST_FOCUS`](/en/tmux/latest/reference/c-enum-style_list-style_list_focus/) (constant)
- [`STYLE_LIST_LEFT_MARKER`](/en/tmux/latest/reference/c-enum-style_list-style_list_left_marker/) (constant)
- [`STYLE_LIST_OFF`](/en/tmux/latest/reference/c-enum-style_list-style_list_off/) (constant)
- [`STYLE_LIST_ON`](/en/tmux/latest/reference/c-enum-style_list-style_list_on/) (constant)
- [`STYLE_LIST_RIGHT_MARKER`](/en/tmux/latest/reference/c-enum-style_list-style_list_right_marker/) (constant)
- [`STYLE_RANGE_CONTROL`](/en/tmux/latest/reference/c-enum-style_range_type-style_range_control/) (constant)
- [`STYLE_RANGE_LEFT`](/en/tmux/latest/reference/c-enum-style_range_type-style_range_left/) (constant)
- [`STYLE_RANGE_NONE`](/en/tmux/latest/reference/c-enum-style_range_type-style_range_none/) (constant)
- [`STYLE_RANGE_PANE`](/en/tmux/latest/reference/c-enum-style_range_type-style_range_pane/) (constant)
- [`STYLE_RANGE_RIGHT`](/en/tmux/latest/reference/c-enum-style_range_type-style_range_right/) (constant)
- [`STYLE_RANGE_SESSION`](/en/tmux/latest/reference/c-enum-style_range_type-style_range_session/) (constant)
- [`STYLE_RANGE_USER`](/en/tmux/latest/reference/c-enum-style_range_type-style_range_user/) (constant)
- [`STYLE_RANGE_WINDOW`](/en/tmux/latest/reference/c-enum-style_range_type-style_range_window/) (constant)
- [`style_ranges`](/en/tmux/latest/reference/c-struct-style_ranges/) (struct)
- [`format_range.type`](/en/tmux/latest/reference/c-struct-format_range-type/) (attribute)
- [`style_range.type`](/en/tmux/latest/reference/c-struct-style_range-type/) (attribute)
- [`UTF8_DONE`](/en/tmux/latest/reference/c-enum-utf8_state-utf8_done/) (constant)
- [`UTF8_MORE`](/en/tmux/latest/reference/c-enum-utf8_state-utf8_more/) (constant)
- [`utf8_data.width`](/en/tmux/latest/reference/c-struct-utf8_data-width/) (attribute)
