C-Menu 0.2.9
A User Interface Toolkit
Loading...
Searching...
No Matches
dwin.c File Reference

Window support for C-Menu - EXPERIMENTAL. More...

#include "cm.h"
#include "ui_backend.h"
#include <errno.h>
#include <fcntl.h>
#include <iso646.h>
#include <math.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <termios.h>
#include <unistd.h>
#include <wchar.h>
Include dependency graph for dwin.c:

Go to the source code of this file.

Typedefs

typedef enum Cells cells_t

Enumerations

enum  Cells {
  _DEFAULT , _FILL_CHAR , _BRKTL , _BRKTR ,
  _NT , _NT_REV , _NT_HL , _NT_HL_REV ,
  _BOX , _IND , _CMDLN , _TITLE ,
  _LN , _RAN , _CHK , _LS ,
  _RS , _TS , _BS , _TL ,
  _TR , _HO , _VE , _BL ,
  _BR , _LT , _RT , _TT ,
  _BT , _CR , _SP , _DEFAULT ,
  _FILL_CHAR , _BRKTL , _BRKTR , _NT ,
  _NT_REV , _NT_HL , _NT_HL_REV , _BOX ,
  _IND , _CMDLN , _TITLE , _LN ,
  _RAN , _CHK , _LS , _RS ,
  _TS , _BS , _TL , _TR ,
  _HO , _VE , _BL , _BR ,
  _LT , _RT , _TT , _BT ,
  _CR , _SP
}
enum  Cells {
  _DEFAULT , _FILL_CHAR , _BRKTL , _BRKTR ,
  _NT , _NT_REV , _NT_HL , _NT_HL_REV ,
  _BOX , _IND , _CMDLN , _TITLE ,
  _LN , _RAN , _CHK , _LS ,
  _RS , _TS , _BS , _TL ,
  _TR , _HO , _VE , _BL ,
  _BR , _LT , _RT , _TT ,
  _BT , _CR , _SP , _DEFAULT ,
  _FILL_CHAR , _BRKTL , _BRKTR , _NT ,
  _NT_REV , _NT_HL , _NT_HL_REV , _BOX ,
  _IND , _CMDLN , _TITLE , _LN ,
  _RAN , _CHK , _LS , _RS ,
  _TS , _BS , _TL , _TR ,
  _HO , _VE , _BL , _BR ,
  _LT , _RT , _TT , _BT ,
  _CR , _SP
}

Functions

void abend (int ec, char *s)
 Abnormal program termination.
bool action_disposition (char *title, char *action_str)
 Display a simple action disposition message window or print to stderr.
void activate_all_chyron_keys (Chyron *chyron)
 Deactivate chyron key.
void activate_chyron_key (Chyron *chyron, uint k)
 Activate chyron key.
int answer_yn (char *msg0, char *msg1, char *msg2, char *msg3)
 Accept a single letter answer.
void apply_gamma (RGB *rgb)
 Apply gamma correction to RGB color.
int assign_chyron_win (Chyron *chyron, UiSurface *sfc, uint win, char *y)
int border_draw (UiSurface *sfc)
int border_title (UiSurface *sfc, char *title)
 Draw a box with a title around the specified window.
int border_ysplit (UiSurface *sfc, uint y)
 Draw a box with a separator line around the specified window.
int border_ysplit_text (UiSurface *sfc, char *text, uint separator_line)
 Draw a box with a separator line and text around the specified window.
int cm_surface_destroy (UiSurface *sfc)
 Destroy the most recently created surface.
void compile_chyron (Chyron *chyron)
 construct the chyron string from the chyron structure
void deactivate_all_chyron_keys (Chyron *chyron)
 Deactivate all chyron keys.
void deactivate_chyron_key (Chyron *chyron, uint k)
 Deactivate chyron key.
Chyrondestroy_chyron (Chyron *chyron)
 Destroy Chyron structure.
void destroy_curses ()
 Gracefully shut down NCurses and restore terminal settings.
void display_chyron (UiSurface *sfc, uint w, Chyron *chyron, uint line, uint col)
 Display chyron on the specified line and column of the surface.
int display_error (char *msg0, char *msg1, char *msg2, char *msg3)
 Display an error message window or print to stderr.
int get_chyron_key (Chyron *chyron, uint x)
 Get keycode from chyron.
bool init_clr_palette (SIO *sio)
 Initialize color palette based on SIO settings.
void initialize_cells (SIO *sio)
 Initialize local color variables and color pairs based on SIO settings.
bool is_set_chyron_key (Chyron *chyron, uint k)
 Check if function key label is set.
void mbc_to_wc (wchar_t wc[2], const char mbc)
uint mbstr_to_cellstr (UiCell *cmplx_buf, const char *str, const UiCell *cell_base, uint *p, const uint atmost)
 Convert multibyte string to complex character array.
wchar_t * mbstr_to_wcstr (const char *mb_str)
Chyronnew_chyron ()
 Create and initialize Chyron structure.
int Perror (char *emsg_str)
 Display a simple error message window or print to stderr.
uint rgb_to_xterm256_idx (RGB *rgb)
 Convert RGB color to XTerm 256 color index.
void set_chyron_key (Chyron *chyron, uint k, char *s, uint kc)
 Set chyron key with default color pair (cp_nt_rev).
void set_chyron_key_cb (Chyron *chyron, uint k, char *s, uint kc, UiCell cell_base)
 Set chyron key with color pair (cp).
int surface_box_win_new (uint wlines, uint wcols, uint wbegy, uint wbegx, char *wtitle)
int surface_split_box_win_new (uint wlines, uint wcols, uint split_y, uint split_x, uint wbegy, uint wbegx, char *wtitle)
void unset_chyron_key (Chyron *chyron, uint k)
 Unset chyron key.
RGB xterm256_idx_to_rgb (uint idx)
 Convert XTerm 256 color index to RGB.

Variables

double BLUE_GAMMA = 1.2
uint16_t box_attr
UiCell cell_bl
UiCell cell_box
UiCell cell_br
UiCell cell_brktl
UiCell cell_brktr
UiCell cell_bs
UiCell cell_bt
UiCell cell_chk
UiCell cell_cmdln
UiCell cell_cr
UiCell cell_default
UiCell cell_fill_char
UiCell cell_ho
UiCell cell_ind
UiCell cell_ln
UiCell cell_ls
UiCell cell_lt
UiCell cell_nt
UiCell cell_nt_hl
UiCell cell_nt_hl_rev
UiCell cell_nt_rev
UiCell cell_ran
UiCell cell_rs
UiCell cell_rt
UiCell cell_sp
UiCell cell_title
UiCell cell_tl
UiCell cell_tr
UiCell cell_ts
UiCell cell_tt
UiCell cell_ve
int click_x
int click_y
unsigned int cmd_key
char const colors_text [][10]
 Color names for .minitrc overrides.
ushort cp_blue
ushort cp_box
ushort cp_brackets
ushort cp_cmdln
ushort cp_default
ushort cp_fill_char
ushort cp_green
ushort cp_ind
ushort cp_ln
ushort cp_nt
ushort cp_nt_hl
ushort cp_nt_hl_rev
ushort cp_nt_rev
ushort cp_red
ushort cp_title
ushort cp_yellow
char em0 [MAXLEN]
char em1 [MAXLEN]
char em2 [MAXLEN]
char em3 [MAXLEN]
int exit_code
bool f_sigwench = false
char fn [MAXLEN]
double GRAY_GAMMA = 1.2
double GREEN_GAMMA = 1.2
uint m_begx = -1
uint m_begy = -1
uint m_cols
uint m_lines
uint mouse_support
int pipe_in
int pipe_out
double RED_GAMMA = 1.2
uint src_line
char * src_name
int stderr_fd
int stdin_fd
int stdout_fd
int tty_fd
uint16_t win_attr

Detailed Description

Window support for C-Menu - EXPERIMENTAL.

This file contains functions for managing NCurses windows and color settings for the Chyron structure for function key labels and mouse click handling. This file is a work in progress and may be subject to change as the C-Menu project evolves. Generally, don't try to use it yet unless you want complete the half-done code modifications.

Author
Bill Waller Copyright (c) 2025 MIT License billx.nosp@m.wall.nosp@m.er@gm.nosp@m.ail..nosp@m.com
Date
2026-02-09

Definition in file dwin.c.

Typedef Documentation

◆ cells_t

typedef enum Cells cells_t

Enumeration Type Documentation

◆ Cells [1/2]

enum Cells
Enumerator
_DEFAULT 
_FILL_CHAR 
_BRKTL 
_BRKTR 
_NT 
_NT_REV 
_NT_HL 
_NT_HL_REV 
_BOX 
_IND 
_CMDLN 
_TITLE 
_LN 
_RAN 
_CHK 
_LS 
_RS 
_TS 
_BS 
_TL 
_TR 
_HO 
_VE 
_BL 
_BR 
_LT 
_RT 
_TT 
_BT 
_CR 
_SP 
_DEFAULT 
_FILL_CHAR 
_BRKTL 
_BRKTR 
_NT 
_NT_REV 
_NT_HL 
_NT_HL_REV 
_BOX 
_IND 
_CMDLN 
_TITLE 
_LN 
_RAN 
_CHK 
_LS 
_RS 
_TS 
_BS 
_TL 
_TR 
_HO 
_VE 
_BL 
_BR 
_LT 
_RT 
_TT 
_BT 
_CR 
_SP 

Definition at line 56 of file dwin.c.

56 {
59 _BRKTL,
60 _BRKTR,
61 _NT,
62 _NT_REV,
63 _NT_HL,
65 _BOX,
66 _IND,
67 _CMDLN,
68 _TITLE,
69 _LN,
70 _RAN,
71 _CHK,
72 _LS,
73 _RS,
74 _TS,
75 _BS,
76 _TL,
77 _TR,
78 _HO,
79 _VE,
80 _BL,
81 _BR,
82 _LT,
83 _RT,
84 _TT,
85 _BT,
86 _CR,
87 _SP
88} cells_t;
@ _FILL_CHAR
Definition dwin.c:58
@ _BRKTL
Definition dwin.c:59
@ _CMDLN
Definition dwin.c:67
@ _BT
Definition dwin.c:85
@ _NT_HL
Definition dwin.c:63
@ _NT_HL_REV
Definition dwin.c:64
@ _IND
Definition dwin.c:66
@ _SP
Definition dwin.c:87
@ _BS
Definition dwin.c:75
@ _RAN
Definition dwin.c:70
@ _BRKTR
Definition dwin.c:60
@ _NT
Definition dwin.c:61
@ _TITLE
Definition dwin.c:68
@ _BL
Definition dwin.c:80
@ _VE
Definition dwin.c:79
@ _HO
Definition dwin.c:78
@ _LN
Definition dwin.c:69
@ _TT
Definition dwin.c:84
@ _CR
Definition dwin.c:86
@ _CHK
Definition dwin.c:71
@ _TS
Definition dwin.c:74
@ _TR
Definition dwin.c:77
@ _LS
Definition dwin.c:72
@ _NT_REV
Definition dwin.c:62
@ _BOX
Definition dwin.c:65
@ _DEFAULT
Definition dwin.c:57
@ _BR
Definition dwin.c:81
@ _TL
Definition dwin.c:76
@ _RT
Definition dwin.c:83
@ _RS
Definition dwin.c:73
@ _LT
Definition dwin.c:82
enum Cells cells_t

◆ Cells [2/2]

enum Cells
Enumerator
_DEFAULT 
_FILL_CHAR 
_BRKTL 
_BRKTR 
_NT 
_NT_REV 
_NT_HL 
_NT_HL_REV 
_BOX 
_IND 
_CMDLN 
_TITLE 
_LN 
_RAN 
_CHK 
_LS 
_RS 
_TS 
_BS 
_TL 
_TR 
_HO 
_VE 
_BL 
_BR 
_LT 
_RT 
_TT 
_BT 
_CR 
_SP 
_DEFAULT 
_FILL_CHAR 
_BRKTL 
_BRKTR 
_NT 
_NT_REV 
_NT_HL 
_NT_HL_REV 
_BOX 
_IND 
_CMDLN 
_TITLE 
_LN 
_RAN 
_CHK 
_LS 
_RS 
_TS 
_BS 
_TL 
_TR 
_HO 
_VE 
_BL 
_BR 
_LT 
_RT 
_TT 
_BT 
_CR 
_SP 

Definition at line 56 of file dwin.c.

56 {
59 _BRKTL,
60 _BRKTR,
61 _NT,
62 _NT_REV,
63 _NT_HL,
65 _BOX,
66 _IND,
67 _CMDLN,
68 _TITLE,
69 _LN,
70 _RAN,
71 _CHK,
72 _LS,
73 _RS,
74 _TS,
75 _BS,
76 _TL,
77 _TR,
78 _HO,
79 _VE,
80 _BL,
81 _BR,
82 _LT,
83 _RT,
84 _TT,
85 _BT,
86 _CR,
87 _SP
88} cells_t;

Function Documentation

◆ apply_gamma()

void apply_gamma ( RGB * rgb)

Apply gamma correction to RGB color.

apply_gamma

Parameters
rgbPointer to RGB color

This function modifies the RGB color in place. It applies gamma correction to the RGB color based on the gamma values set in the SIO struct. If the color is a shade of gray, it applies the gray gamma correction. Otherwise, it applies the individual red, green, and blue gamma corrections.

Definition at line 307 of file dwin.c.

307 {
308 if (rgb->r == rgb->g && rgb->r == rgb->b) {
309 if (GRAY_GAMMA > 0.0f && GRAY_GAMMA != 1.0f) {
310 rgb->r = (int)(pow((rgb->r / 255.0f), 1.0f / GRAY_GAMMA) * 255.0f);
311 rgb->g = rgb->r;
312 rgb->b = rgb->r;
313 }
314 return;
315 }
316 if (rgb->r != 0 && RED_GAMMA > 0.0f && RED_GAMMA != 1.0f)
317 rgb->r = (int)(pow((rgb->r / 255.0f), 1.0f / RED_GAMMA) * 255.0f);
318 if (rgb->g != 0 && GREEN_GAMMA > 0.0f && GREEN_GAMMA != 1.0f)
319 rgb->g = (int)(pow((rgb->g / 255.0f), 1.0f / GREEN_GAMMA) * 255.0f);
320 if (rgb->b != 0 && BLUE_GAMMA > 0.0f && BLUE_GAMMA != 1.0f)
321 rgb->b = (int)(pow((rgb->b / 255.0f), 1.0f / BLUE_GAMMA) * 255.0f);
322}
double BLUE_GAMMA
Definition dwin.c:125
double GRAY_GAMMA
Definition dwin.c:122
double RED_GAMMA
Definition dwin.c:123
double GREEN_GAMMA
Definition dwin.c:124

References BLUE_GAMMA, GRAY_GAMMA, GREEN_GAMMA, and RED_GAMMA.

Referenced by ui_add_color_rgb(), ui_chg_color(), and ui_init_color_hex().

Here is the caller graph for this function:

◆ assign_chyron_win()

int assign_chyron_win ( Chyron * chyron,
UiSurface * sfc,
uint win,
char * y )

Definition at line 962 of file dwin.c.

962 {
963 bool a_toi_error = false;
964 if (!sfc)
965 return -1;
966 chyron->sfc = sfc;
967 chyron->win = win;
968 if (*y == '-')
969 chyron->y = ui_getmaxy(sfc, win) - 1;
970 else {
971 chyron->y = a_toi(y, &a_toi_error);
972 if (a_toi_error)
973 return -1;
974 chyron->y = min(chyron->y, ui_getmaxy(sfc, win) - 1);
975 }
976 return 0;
977}
#define min(x, y)
min macro evaluates two expressions, returning least result
Definition cm.h:91
int ui_getmaxy(UiSurface *s, uint w)
Definition ui_ncurses.c:681
int a_toi(char *, bool *)
a safer alternative to atoi() for converting ASCII strings to integers.
Definition futil.c:762
uint y
Definition cm.h:394
UiSurface * sfc
Definition cm.h:392
uint win
Definition cm.h:393

References a_toi(), Chyron::sfc, ui_getmaxy(), Chyron::win, and Chyron::y.

Referenced by open_pick_win().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ border_draw()

int border_draw ( UiSurface * sfc)

Definition at line 581 of file dwin.c.

581 {
582 uint maxy = ui_getmaxy(sfc, BOX);
583 uint maxx = ui_getmaxx(sfc, BOX);
584 uint y = 0;
585 uint x = 0;
586 ui_mvwadd_wchnstr(sfc, BOX, y, x++, &cell_tl, 1);
587 ui_render();
588 for (x = 1; x < maxx - 1; x++)
589 ui_mvwadd_wchnstr(sfc, BOX, y, x, &cell_ho, 1);
590 ui_render();
591 ui_mvwadd_wchnstr(sfc, BOX, y, maxx - 1, &cell_tr, 1);
592 ui_render();
593 for (y = 1; y < maxy - 1; y++) {
594 ui_mvwadd_wchnstr(sfc, BOX, y, 0, &cell_ve, 1);
595 ui_render();
596 ui_mvwadd_wchnstr(sfc, BOX, y, maxx - 1, &cell_ve, 1);
597 ui_render();
598 }
599 ui_mvwadd_wchnstr(sfc, BOX, y, 0, &cell_bl, 1);
600 for (x = 1; x < maxx - 1; x++)
601 ui_mvwadd_wchnstr(sfc, BOX, y, x, &cell_ho, 1);
602 ui_mvwadd_wchnstr(sfc, BOX, y, maxx - 1, &cell_br, 1);
603 ui_render();
604 return 0;
605}
int ui_getmaxx(UiSurface *s, uint w)
Definition ui_ncurses.c:686
void ui_render()
Definition ui_ncurses.c:800
int ui_mvwadd_wchnstr(UiSurface *s, uint w, uint y, uint x, const UiCell *cell, uint m)
UiCell cell_ve
Definition dwin.c:112
UiCell cell_tr
Definition dwin.c:110
UiCell cell_br
Definition dwin.c:114
UiCell cell_tl
Definition dwin.c:109
UiCell cell_ho
Definition dwin.c:111
UiCell cell_bl
Definition dwin.c:113

References BOX, cell_bl, cell_br, cell_ho, cell_tl, cell_tr, cell_ve, ui_getmaxx(), ui_getmaxy(), ui_mvwadd_wchnstr(), and ui_render().

Referenced by ui_box_surface_new(), and ui_box_surface_new().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_clr_palette()

bool init_clr_palette ( SIO * sio)

Initialize color palette based on SIO settings.

init_clr_palette

Parameters
sioPointer to SIO struct with color settings
Returns
true if successful, false if error

This function initializes the xterm256 color cube and applies any color overrides specified in the SIO struct. The color strings in the SIO struct are expected to be six-digit HTML style hex color codes (e.g., "#RRGGBB"). If a color override is specified for any of the standard colors, it is applied using the ui_add_color_hex function.

Definition at line 333 of file dwin.c.

333 {
335 ui_chg_color(CLR_RED, &sio->red);
338 ui_chg_color(CLR_BLUE, &sio->blue);
340 ui_chg_color(CLR_CYAN, &sio->cyan);
343 ui_chg_color(CLR_BRED, &sio->bred);
351 ui_chg_color(CLR_FG, &sio->fg);
352 ui_chg_color(CLR_BG, &sio->bg);
373 return true;
374}
@ CLR_FILL_CHAR_BG
Definition cm.h:193
@ CLR_BOX_BG
Definition cm.h:187
@ CLR_FILL_CHAR_FG
Definition cm.h:192
@ CLR_FG
Definition cm.h:184
@ CLR_RED
Definition cm.h:168
@ CLR_NT_FG
Definition cm.h:198
@ CLR_BRACKETS_FG
Definition cm.h:190
@ CLR_YELLOW
Definition cm.h:170
@ CLR_IND_FG
Definition cm.h:188
@ CLR_BCYAN
Definition cm.h:181
@ CLR_WHITE
Definition cm.h:174
@ CLR_MAGENTA
Definition cm.h:172
@ CLR_BRACKETS_BG
Definition cm.h:191
@ CLR_NT_REV_BG
Definition cm.h:201
@ CLR_BLACK
Definition cm.h:167
@ CLR_BWHITE
Definition cm.h:182
@ CLR_LN_BG
Definition cm.h:195
@ CLR_NT_HL_REV_BG
Definition cm.h:205
@ CLR_BBLACK
Definition cm.h:175
@ CLR_LN_FG
Definition cm.h:194
@ CLR_NT_HL_FG
Definition cm.h:202
@ CLR_BBLUE
Definition cm.h:179
@ CLR_BGREEN
Definition cm.h:177
@ CLR_BYELLOW
Definition cm.h:178
@ CLR_BMAGENTA
Definition cm.h:180
@ CLR_BORANGE
Definition cm.h:183
@ CLR_NT_HL_BG
Definition cm.h:203
@ CLR_NT_HL_REV_FG
Definition cm.h:204
@ CLR_BG
Definition cm.h:185
@ CLR_BOX_FG
Definition cm.h:186
@ CLR_NT_BG
Definition cm.h:199
@ CLR_TITLE_BG
Definition cm.h:207
@ CLR_BRED
Definition cm.h:176
@ CLR_NCOLORS
Definition cm.h:208
@ CLR_BLUE
Definition cm.h:171
@ CLR_IND_BG
Definition cm.h:189
@ CLR_GREEN
Definition cm.h:169
@ CLR_NT_REV_FG
Definition cm.h:200
@ CLR_CYAN
Definition cm.h:173
uint ui_color_cnt
Definition ui_ncurses.c:33
int ui_chg_color(uint16_t color_idx, uint32_t *color)
Definition ui_ncurses.c:206
uint32_t ln_bg
Definition cm.h:723
uint32_t magenta
Definition cm.h:698
uint32_t nt_hl_rev_fg
Definition cm.h:732
uint32_t bgreen
Definition cm.h:704
uint32_t green
Definition cm.h:695
uint32_t nt_fg
Definition cm.h:726
uint32_t yellow
Definition cm.h:696
uint32_t fill_char_fg
Definition cm.h:720
uint32_t box_fg
Definition cm.h:714
uint32_t ln_fg
Definition cm.h:722
uint32_t ind_bg
Definition cm.h:717
uint32_t bmagenta
Definition cm.h:707
uint32_t ind_fg
Definition cm.h:716
uint32_t byellow
Definition cm.h:705
uint32_t bblue
Definition cm.h:706
uint32_t borange
Definition cm.h:710
uint32_t title_bg
Definition cm.h:735
uint32_t fg
Definition cm.h:712
uint32_t cyan
Definition cm.h:699
uint32_t bblack
Definition cm.h:702
uint32_t red
Definition cm.h:694
uint32_t nt_hl_rev_bg
Definition cm.h:733
uint32_t bred
Definition cm.h:703
uint32_t fill_char_bg
Definition cm.h:721
uint32_t black
Definition cm.h:693
uint32_t nt_rev_bg
Definition cm.h:729
uint32_t brackets_bg
Definition cm.h:719
uint32_t bcyan
Definition cm.h:708
uint32_t nt_bg
Definition cm.h:727
uint32_t blue
Definition cm.h:697
uint32_t brackets_fg
Definition cm.h:718
uint32_t white
Definition cm.h:700
uint32_t box_bg
Definition cm.h:715
uint32_t nt_hl_fg
Definition cm.h:730
uint32_t bwhite
Definition cm.h:709
uint32_t nt_rev_fg
Definition cm.h:728
uint32_t nt_hl_bg
Definition cm.h:731
uint32_t bg
Definition cm.h:713

References SIO::bblack, SIO::bblue, SIO::bcyan, SIO::bg, SIO::bgreen, SIO::black, SIO::blue, SIO::bmagenta, SIO::borange, SIO::box_bg, SIO::box_fg, SIO::brackets_bg, SIO::brackets_fg, SIO::bred, SIO::bwhite, SIO::byellow, CLR_BBLACK, CLR_BBLUE, CLR_BCYAN, CLR_BG, CLR_BGREEN, CLR_BLACK, CLR_BLUE, CLR_BMAGENTA, CLR_BORANGE, CLR_BOX_BG, CLR_BOX_FG, CLR_BRACKETS_BG, CLR_BRACKETS_FG, CLR_BRED, CLR_BWHITE, CLR_BYELLOW, CLR_CYAN, CLR_FG, CLR_FILL_CHAR_BG, CLR_FILL_CHAR_FG, CLR_GREEN, CLR_IND_BG, CLR_IND_FG, CLR_LN_BG, CLR_LN_FG, CLR_MAGENTA, CLR_NCOLORS, CLR_NT_BG, CLR_NT_FG, CLR_NT_HL_BG, CLR_NT_HL_FG, CLR_NT_HL_REV_BG, CLR_NT_HL_REV_FG, CLR_NT_REV_BG, CLR_NT_REV_FG, CLR_RED, CLR_TITLE_BG, CLR_WHITE, CLR_YELLOW, SIO::cyan, SIO::fg, SIO::fill_char_bg, SIO::fill_char_fg, SIO::green, SIO::ind_bg, SIO::ind_fg, SIO::ln_bg, SIO::ln_fg, SIO::magenta, SIO::nt_bg, SIO::nt_fg, SIO::nt_hl_bg, SIO::nt_hl_fg, SIO::nt_hl_rev_bg, SIO::nt_hl_rev_fg, SIO::nt_rev_bg, SIO::nt_rev_fg, SIO::red, SIO::title_bg, ui_chg_color(), ui_color_cnt, SIO::white, and SIO::yellow.

Referenced by initialize_cells().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize_cells()

void initialize_cells ( SIO * sio)

Initialize local color variables and color pairs based on SIO settings.

Parameters
sioPointer to SIO struct with color settings

This function initializes local color variables and color pairs based on the settings in the SIO struct. It applies gamma correction to colors and sets up cchar_t variables for use in NCurses functions. The color pair indices are stored in global variables for easy reference throughout the code when applying colors to various parts of the interface using NCurses functions that accept color pair indices.

gamma correction values

These are read from ~/.minitrc

used when initializing colors

Definition at line 177 of file dwin.c.

177 {
181 RED_GAMMA = sio->red_gamma;
183 BLUE_GAMMA = sio->blue_gamma;
184 GRAY_GAMMA = sio->gray_gamma;
185 init_clr_palette(sio);
186 //
187 // Standardized color pairs
188 //
189 // strcpy(sio->nt_bg, "#0000ff");
190 // strcpy(sio->box_bg, "#00ff00");
207 //
208 // Standardized UiCells
209 //
212
213 mbstate_t mbstate;
214 memset(&mbstate, 0, sizeof(mbstate));
215 wchar_t brktl = sio->brackets[0];
216 cell_brktl = ui_cell_from_ucp(&brktl, &sio->brackets_fg, &sio->brackets_bg);
217 wchar_t brktr = sio->brackets[1];
218 cell_brktr = ui_cell_from_ucp(&brktr, &sio->brackets_fg, &sio->brackets_bg);
219 cell_nt = ui_cell_from_ucp(bw_sp, &sio->nt_fg, &sio->nt_bg);
226 cell_ln = ui_cell_from_ucp(bw_sp, &sio->ln_fg, &sio->ln_bg);
230 cell_tl = ui_cell_from_ucp(&bw_tl, &sio->box_fg, &sio->box_bg);
231 cell_tr = ui_cell_from_ucp(&bw_tr, &sio->box_fg, &sio->box_bg);
232 cell_bl = ui_cell_from_ucp(&bw_bl, &sio->box_fg, &sio->box_bg);
233 cell_br = ui_cell_from_ucp(&bw_br, &sio->box_fg, &sio->box_bg);
234 cell_ho = ui_cell_from_ucp(&bw_ho, &sio->box_fg, &sio->box_bg);
235 cell_ve = ui_cell_from_ucp(&bw_ve, &sio->box_fg, &sio->box_bg);
236 cell_lt = ui_cell_from_ucp(&bw_lt, &sio->box_fg, &sio->box_bg);
237 cell_rt = ui_cell_from_ucp(&bw_rt, &sio->box_fg, &sio->box_bg);
238 cell_tt = ui_cell_from_ucp(&bw_tt, &sio->box_fg, &sio->box_bg);
239 cell_bt = ui_cell_from_ucp(&bw_bt, &sio->box_fg, &sio->box_bg);
240 cell_cr = ui_cell_from_ucp(&bw_cr, &sio->box_fg, &sio->box_bg);
241 cell_sp = ui_cell_from_ucp(bw_sp, &sio->box_fg, &sio->box_bg);
242}
@ CLR_CMDLN_BG
Definition cm.h:197
@ CLR_TITLE_FG
Definition cm.h:206
@ CLR_CMDLN_FG
Definition cm.h:196
#define bw_ho
Definition ui_backend.h:213
const wchar_t * bw_sp
Definition ui_ncurses.c:52
const wchar_t * bw_ran
Definition ui_ncurses.c:57
#define bw_tr
Definition ui_backend.h:221
const wchar_t * bw_chk
Definition ui_ncurses.c:59
#define bw_lt
Definition ui_backend.h:215
#define bw_br
Definition ui_backend.h:223
uint ui_add_pair(uint fg, uint bg)
Definition ui_ncurses.c:105
#define bw_bl
Definition ui_backend.h:222
UiCell ui_cell_from_ucp(const wchar_t *ucp, const uint32_t *fg, const uint32_t *bg)
Definition ui_ncurses.c:239
#define bw_tt
Definition ui_backend.h:217
#define bw_cr
Definition ui_backend.h:219
#define bw_bt
Definition ui_backend.h:218
#define bw_ve
Definition ui_backend.h:214
#define bw_rt
Definition ui_backend.h:216
#define bw_tl
Definition ui_backend.h:220
UiCell cell_sp
Definition dwin.c:120
ushort cp_nt
Definition dwin.c:151
UiCell cell_nt
Definition dwin.c:94
UiCell cell_nt_hl_rev
Definition dwin.c:97
UiCell cell_bt
Definition dwin.c:118
ushort cp_green
Definition dwin.c:160
ushort cp_red
Definition dwin.c:159
ushort cp_box
Definition dwin.c:147
ushort cp_blue
Definition dwin.c:162
UiCell cell_ln
Definition dwin.c:102
ushort cp_nt_hl
Definition dwin.c:153
ushort cp_cmdln
Definition dwin.c:149
ushort cp_fill_char
Definition dwin.c:157
UiCell cell_tt
Definition dwin.c:117
ushort cp_brackets
Definition dwin.c:158
ushort cp_yellow
Definition dwin.c:161
bool init_clr_palette(SIO *sio)
Initialize color palette based on SIO settings.
Definition dwin.c:333
UiCell cell_default
Definition dwin.c:90
ushort cp_nt_hl_rev
Definition dwin.c:154
ushort cp_default
Definition dwin.c:156
UiCell cell_nt_hl
Definition dwin.c:96
ushort cp_nt_rev
Definition dwin.c:152
ushort cp_ln
Definition dwin.c:155
ushort cp_title
Definition dwin.c:150
UiCell cell_lt
Definition dwin.c:115
UiCell cell_brktl
Definition dwin.c:92
UiCell cell_cr
Definition dwin.c:119
UiCell cell_title
Definition dwin.c:101
UiCell cell_ind
Definition dwin.c:99
UiCell cell_ran
Definition dwin.c:103
UiCell cell_cmdln
Definition dwin.c:100
UiCell cell_brktr
Definition dwin.c:93
ushort cp_ind
Definition dwin.c:148
UiCell cell_fill_char
Definition dwin.c:91
UiCell cell_box
Definition dwin.c:98
UiCell cell_rt
Definition dwin.c:116
UiCell cell_chk
Definition dwin.c:104
UiCell cell_nt_rev
Definition dwin.c:95
uint32_t ran_bg
Definition cm.h:737
double green_gamma
Definition cm.h:690
double blue_gamma
Definition cm.h:691
char brackets[3]
Definition cm.h:750
uint32_t cmdln_bg
Definition cm.h:725
uint32_t cmdln_fg
Definition cm.h:724
uint32_t ran_fg
Definition cm.h:736
double red_gamma
Definition cm.h:689
uint32_t title_fg
Definition cm.h:734
double gray_gamma
Definition cm.h:692

References BLUE_GAMMA, SIO::blue_gamma, SIO::box_bg, SIO::box_fg, SIO::brackets, SIO::brackets_bg, SIO::brackets_fg, bw_chk, bw_ran, bw_sp, cell_bl, cell_box, cell_br, cell_brktl, cell_brktr, cell_bt, cell_chk, cell_cmdln, cell_cr, cell_default, cell_fill_char, cell_ho, cell_ind, cell_ln, cell_lt, cell_nt, cell_nt_hl, cell_nt_hl_rev, cell_nt_rev, cell_ran, cell_rt, cell_sp, cell_title, cell_tl, cell_tr, cell_tt, cell_ve, CLR_BG, CLR_BLUE, CLR_BOX_BG, CLR_BOX_FG, CLR_BRACKETS_BG, CLR_BRACKETS_FG, CLR_CMDLN_BG, CLR_CMDLN_FG, CLR_FG, CLR_FILL_CHAR_BG, CLR_FILL_CHAR_FG, CLR_GREEN, CLR_IND_BG, CLR_IND_FG, CLR_LN_BG, CLR_LN_FG, CLR_NT_BG, CLR_NT_FG, CLR_NT_HL_BG, CLR_NT_HL_FG, CLR_NT_HL_REV_BG, CLR_NT_HL_REV_FG, CLR_NT_REV_BG, CLR_NT_REV_FG, CLR_RED, CLR_TITLE_BG, CLR_TITLE_FG, CLR_YELLOW, SIO::cmdln_bg, SIO::cmdln_fg, cp_blue, cp_box, cp_brackets, cp_cmdln, cp_default, cp_fill_char, cp_green, cp_ind, cp_ln, cp_nt, cp_nt_hl, cp_nt_hl_rev, cp_nt_rev, cp_red, cp_title, cp_yellow, SIO::fill_char_bg, SIO::fill_char_fg, GRAY_GAMMA, SIO::gray_gamma, GREEN_GAMMA, SIO::green_gamma, SIO::ind_bg, SIO::ind_fg, init_clr_palette(), SIO::ln_bg, SIO::ln_fg, SIO::nt_bg, SIO::nt_fg, SIO::nt_hl_bg, SIO::nt_hl_fg, SIO::nt_hl_rev_bg, SIO::nt_hl_rev_fg, SIO::nt_rev_bg, SIO::nt_rev_fg, SIO::ran_bg, SIO::ran_fg, RED_GAMMA, SIO::red_gamma, SIO::title_bg, SIO::title_fg, ui_add_pair(), and ui_cell_from_ucp().

Referenced by main(), and read_theme().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mbc_to_wc()

void mbc_to_wc ( wchar_t wc[2],
const char mbc )

Definition at line 393 of file dwin.c.

393 {
394 wc[0] = wc[1] = L'\0';
395 mbstate_t state = {0};
396 size_t len = mbrtowc(wc, &mbc, MB_CUR_MAX, &state);
397 if (len <= 0) {
398 wc[0] = L'?';
399 wc[1] = L'\0';
400 len = 1;
401 }
402}

◆ mbstr_to_wcstr()

wchar_t * mbstr_to_wcstr ( const char * mb_str)

Definition at line 404 of file dwin.c.

404 {
405 const char *src_ptr = mb_str;
406 mbstate_t state = {0};
407 size_t wc_count = mbsrtowcs(NULL, &src_ptr, 0, &state);
408 if (wc_count == (size_t)-1)
409 return nullptr;
410 src_ptr = mb_str;
411 wmemset((wchar_t *)&state, 0, sizeof(state) / sizeof(wchar_t));
412 wchar_t *wc_str = malloc((wc_count + 1) * sizeof(wchar_t));
413 if (!wc_str)
414 return nullptr;
415 mbsrtowcs(wc_str, &src_ptr, wc_count + 1, &state);
416 return wc_str;
417}

Referenced by border_title(), and border_ysplit_text().

Here is the caller graph for this function:

◆ rgb_to_xterm256_idx()

uint rgb_to_xterm256_idx ( RGB * rgb)

Convert RGB color to XTerm 256 color index.

rgb_to_xterm256_idx

Parameters
rgbRGB color
Returns
XTerm 256 color index

This function converts an RGB color to the nearest XTerm 256 color index. It first checks if the color is a shade of gray, and if so, it uses the gray ramp. Otherwise, it calculates the nearest color in the 6x6x6 color cube.

Definition at line 252 of file dwin.c.

252 {
253 if (rgb->r == rgb->g && rgb->g == rgb->b) {
254 if (rgb->r < 8)
255 return 16;
256 if (rgb->r > 248)
257 return 231;
258 return ((rgb->r - 8) / 10) + 231;
259 } else {
260 uint r_index = (rgb->r < 45) ? 0 : (rgb->r - 60) / 40 + 1;
261 uint g_index = (rgb->g < 45) ? 0 : (rgb->g - 60) / 40 + 1;
262 uint b_index = (rgb->b < 45) ? 0 : (rgb->b - 60) / 40 + 1;
263 return 16 + (36 * r_index) + (6 * g_index) + b_index;
264 }
265}

◆ surface_box_win_new()

int surface_box_win_new ( uint wlines,
uint wcols,
uint wbegy,
uint wbegx,
char * wtitle )

Definition at line 521 of file dwin.c.

521 {
522 if (sfc_ptr >= SFC_MAX) {
523 Perror("Maximum number of surfaces (%d) exceeded");
524 exit(EXIT_FAILURE);
525 }
526 uint maxy, maxx;
527 ui_get_screen_size(&maxy, &maxx);
528 wlines = min(wlines, maxy - 2);
529 wcols = min(wcols, maxx - 2);
530 sfc_ptr++;
531 // -------------------> UAL_win_box <-------------------
532 ui_surface[sfc_ptr] = ui_box_surface_new(nullptr, 0, wlines, wcols, wbegy, wbegx, wtitle);
534 ui_surface_addwin(sfc, WIN, BOX, wlines, wcols, 1, 1);
535 ui_render();
536 return 0;
537}
UiSurface * ui_surface[UI_SFC_MAX]
Definition ui_ncurses.c:28
void ui_get_screen_size(uint *lines, uint *cols)
Definition ui_ncurses.c:692
int sfc_ptr
Definition nckeys.c:47
UiSurface * ui_box_surface_new(UiSurface *parent, uint p, uint lines, uint cols, uint y, uint x, char *title)
Definition ui_ncurses.c:453
#define SFC_MAX
Definition ui_backend.h:25
int ui_surface_addwin(UiSurface *s, uint w, uint p, uint lines, uint cols, uint y, uint x)
Definition ui_ncurses.c:523
int Perror(char *emsg_str)
Display a simple error message window or print to stderr.
Definition dwin.c:841
A drawable surface in the NotCurses backend.

References BOX, Perror(), sfc_ptr, ui_box_surface_new(), ui_get_screen_size(), ui_render(), ui_surface, ui_surface_addwin(), and WIN.

Referenced by action_disposition(), answer_yn(), display_error(), display_form(), menu_engine(), Perror(), and popup_ckeys().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ surface_split_box_win_new()

int surface_split_box_win_new ( uint wlines,
uint wcols,
uint split_y,
uint split_x,
uint wbegy,
uint wbegx,
char * wtitle )

Definition at line 539 of file dwin.c.

539 {
540 if (sfc_ptr >= SFC_MAX) {
541 Perror("Maximum number of surfaces (%d) exceeded");
542 exit(EXIT_FAILURE);
543 }
544 if (sfc_ptr >= SFC_MAX) {
545 Perror("Maximum number of surfaces (%d) exceeded");
546 exit(EXIT_FAILURE);
547 }
548 uint maxy, maxx;
549 ui_get_screen_size(&maxy, &maxx);
550 wlines = min(wlines, maxy - 2);
551 wcols = min(wcols, maxx - 2);
552 split_x = min(split_x, maxx - 2); // not implemented yet
553 uint split_wlines = min(wlines + split_y + 1, maxy - 2);
554 wcols = min(wcols, maxx - 2);
555 sfc_ptr++;
556 // -------------------> surface_new <-------------------
557 ui_surface[sfc_ptr] = ui_box_surface_new(nullptr, 0, split_wlines, wcols, wbegy, wbegx, wtitle);
559
560 ui_surface_addwin(sfc, WIN, BOX, wlines, wcols, 1, 1);
561 ui_render();
562
563 border_ysplit(sfc, wlines + 1);
564 ui_render();
565 ui_surface_addwin(sfc, WIN2, BOX, 2, wcols, wlines + 2, 1);
566 ui_curs_set(0);
567 return 0;
568}
int ui_curs_set(int visibility)
Definition ui_ncurses.c:737
int border_ysplit(UiSurface *sfc, uint y)
Draw a box with a separator line around the specified window.
Definition dwin.c:617

References border_ysplit(), BOX, Perror(), sfc_ptr, ui_box_surface_new(), ui_curs_set(), ui_get_screen_size(), ui_render(), ui_surface, ui_surface_addwin(), WIN, and WIN2.

Referenced by open_pick_win().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xterm256_idx_to_rgb()

RGB xterm256_idx_to_rgb ( uint idx)

Convert XTerm 256 color index to RGB.

xterm256_idx_to_rgb

Parameters
idxXTerm 256 color index
Returns
RGB color

This function converts an XTerm 256 color index to an RGB color. It first checks if the index is in the standard 16 colors, then checks if it's in the 6x6x6 color cube, and finally checks if it's in the gray ramp.

Convert XTerm 256 color index to RGB

Parameters
idx- XTerm 256 color index
Returns
RGB struct

Definition at line 274 of file dwin.c.

274 {
278 RGB rgb;
279 if (idx > 255)
280 idx = 255;
281 rgb.r = rgb.g = rgb.b = 0;
282 if (idx < 16) {
283 rgb.r = std_color[idx].r;
284 rgb.g = std_color[idx].g;
285 rgb.b = std_color[idx].b;
286 } else if (idx >= 16 && idx <= 231) {
287 idx -= 16;
288 rgb.r = (idx / 36) % 6 * 51;
289 rgb.g = (idx / 6) % 6 * 51;
290 rgb.b = (idx % 6) * 51;
291 } else if (idx >= 232 && idx <= 255) {
292 uint gray = (idx - 232) * 11;
293 rgb.r = rgb.g = rgb.b = gray;
294 }
295 return rgb;
296}
STDRGB std_color[]
Definition ui_ncurses.c:62

References STDRGB::b, STDRGB::g, STDRGB::r, and std_color.

Referenced by parse_ansi(), and parse_ansi_str().

Here is the caller graph for this function:

Variable Documentation

◆ BLUE_GAMMA

double BLUE_GAMMA = 1.2

Definition at line 125 of file dwin.c.

Referenced by apply_gamma(), and initialize_cells().

◆ box_attr

uint16_t box_attr

Definition at line 131 of file dwin.c.

◆ cell_bl

UiCell cell_bl

Definition at line 113 of file dwin.c.

Referenced by border_draw(), and initialize_cells().

◆ cell_box

UiCell cell_box

Definition at line 98 of file dwin.c.

Referenced by border_title(), initialize_cells(), ui_bkgd(), and ui_box_surface_new().

◆ cell_br

UiCell cell_br

Definition at line 114 of file dwin.c.

Referenced by border_draw(), and initialize_cells().

◆ cell_brktl

UiCell cell_brktl

Definition at line 92 of file dwin.c.

Referenced by display_form(), and initialize_cells().

◆ cell_brktr

UiCell cell_brktr

Definition at line 93 of file dwin.c.

Referenced by display_form(), and initialize_cells().

◆ cell_bs

UiCell cell_bs

Definition at line 108 of file dwin.c.

◆ cell_bt

UiCell cell_bt

Definition at line 118 of file dwin.c.

Referenced by initialize_cells().

◆ cell_chk

◆ cell_cmdln

UiCell cell_cmdln

Definition at line 100 of file dwin.c.

Referenced by initialize_cells().

◆ cell_cr

UiCell cell_cr

Definition at line 119 of file dwin.c.

Referenced by initialize_cells().

◆ cell_default

UiCell cell_default

Definition at line 90 of file dwin.c.

Referenced by initialize_cells().

◆ cell_fill_char

UiCell cell_fill_char

Definition at line 91 of file dwin.c.

Referenced by form_display_fields(), and initialize_cells().

◆ cell_ho

UiCell cell_ho

◆ cell_ind

UiCell cell_ind

Definition at line 99 of file dwin.c.

Referenced by initialize_cells().

◆ cell_ln

UiCell cell_ln

Definition at line 102 of file dwin.c.

Referenced by init_view_boxwin(), init_view_full_screen(), and initialize_cells().

◆ cell_ls

UiCell cell_ls

Definition at line 105 of file dwin.c.

◆ cell_lt

UiCell cell_lt

Definition at line 115 of file dwin.c.

Referenced by border_title(), border_ysplit(), border_ysplit_text(), and initialize_cells().

◆ cell_nt

◆ cell_nt_hl

UiCell cell_nt_hl

Definition at line 96 of file dwin.c.

Referenced by border_ysplit_text(), initialize_cells(), menu_cmd_processor(), and menu_engine().

◆ cell_nt_hl_rev

UiCell cell_nt_hl_rev

Definition at line 97 of file dwin.c.

Referenced by field_editor(), form_engine(), initialize_cells(), menu_cmd_processor(), and picker().

◆ cell_nt_rev

◆ cell_ran

UiCell cell_ran

Definition at line 103 of file dwin.c.

Referenced by get_cmd_arg(), get_cmd_char(), initialize_cells(), and picker().

◆ cell_rs

UiCell cell_rs

Definition at line 106 of file dwin.c.

◆ cell_rt

UiCell cell_rt

Definition at line 116 of file dwin.c.

Referenced by border_title(), border_ysplit(), border_ysplit_text(), and initialize_cells().

◆ cell_sp

◆ cell_title

UiCell cell_title

Definition at line 101 of file dwin.c.

Referenced by border_title(), and initialize_cells().

◆ cell_tl

UiCell cell_tl

Definition at line 109 of file dwin.c.

Referenced by border_draw(), border_title(), and initialize_cells().

◆ cell_tr

UiCell cell_tr

Definition at line 110 of file dwin.c.

Referenced by border_draw(), and initialize_cells().

◆ cell_ts

UiCell cell_ts

Definition at line 107 of file dwin.c.

◆ cell_tt

UiCell cell_tt

Definition at line 117 of file dwin.c.

Referenced by initialize_cells().

◆ cell_ve

UiCell cell_ve

Definition at line 112 of file dwin.c.

Referenced by border_draw(), and initialize_cells().

◆ click_x

int click_x

the x coordinate of a mouse click

Definition at line 45 of file dwin.c.

Referenced by cf_accept(), field_editor(), form_post(), and form_process().

◆ click_y

int click_y

the y coordinate of a mouse click

Definition at line 44 of file dwin.c.

Referenced by cf_accept(), field_editor(), form_post(), and form_process().

◆ cmd_key

unsigned int cmd_key

Definition at line 128 of file dwin.c.

Referenced by action_disposition(), answer_yn(), and display_error().

◆ colors_text

char const colors_text
Initial value:
= {
"black", "red", "green", "yellow", "blue", "magenta", "cyan",
"white", "orange", "bg", "abg", "bblack", "bred", "bgreen",
"byellow", "bblue", "bcyan", "bmagenta", "bwhite", "borange", ""}

Color names for .minitrc overrides.

colors_text

These names are used in .minitrc to specify color overrides The order of these names corresponds to the ColorsEnum values

Definition at line 51 of file dwin.c.

51 {
52 "black", "red", "green", "yellow", "blue", "magenta", "cyan",
53 "white", "orange", "bg", "abg", "bblack", "bred", "bgreen",
54 "byellow", "bblue", "bcyan", "bmagenta", "bwhite", "borange", ""};

◆ cp_blue

ushort cp_blue

blue background color pair index

Definition at line 162 of file dwin.c.

Referenced by initialize_cells().

◆ cp_box

ushort cp_box

box color pair index

Definition at line 147 of file dwin.c.

Referenced by initialize_cells().

◆ cp_brackets

ushort cp_brackets

color pair index for field brackets

Definition at line 158 of file dwin.c.

Referenced by initialize_cells().

◆ cp_cmdln

ushort cp_cmdln

Definition at line 149 of file dwin.c.

Referenced by initialize_cells().

◆ cp_default

ushort cp_default

default color pair index

Definition at line 156 of file dwin.c.

Referenced by initialize_cells().

◆ cp_fill_char

ushort cp_fill_char

fill character color pair index

Definition at line 157 of file dwin.c.

Referenced by initialize_cells().

◆ cp_green

ushort cp_green

green background color pair index

Definition at line 160 of file dwin.c.

Referenced by initialize_cells().

◆ cp_ind

ushort cp_ind

indicator color pair index

Definition at line 148 of file dwin.c.

Referenced by initialize_cells().

◆ cp_ln

ushort cp_ln

Definition at line 155 of file dwin.c.

Referenced by initialize_cells().

◆ cp_nt

ushort cp_nt

normal color pair index

Definition at line 151 of file dwin.c.

Referenced by fmt_line(), initialize_cells(), and mbstr_to_cc().

◆ cp_nt_hl

ushort cp_nt_hl

highlight color pair index

Definition at line 153 of file dwin.c.

Referenced by initialize_cells().

◆ cp_nt_hl_rev

ushort cp_nt_hl_rev

highlight reverse color pair index

Definition at line 154 of file dwin.c.

Referenced by initialize_cells().

◆ cp_nt_rev

ushort cp_nt_rev

reverse color pair index

Definition at line 152 of file dwin.c.

Referenced by initialize_cells().

◆ cp_red

ushort cp_red

red background color pair index

Definition at line 159 of file dwin.c.

Referenced by initialize_cells().

◆ cp_title

ushort cp_title

title color pair index

Definition at line 150 of file dwin.c.

Referenced by initialize_cells().

◆ cp_yellow

ushort cp_yellow

yellow background color pair index

Definition at line 161 of file dwin.c.

Referenced by initialize_cells().

◆ em0

◆ em1

◆ em2

◆ em3

char em3

error message string for error messages

Definition at line 145 of file dwin.c.

Referenced by verify_dir(), and verify_file().

◆ exit_code

int exit_code

the exit code for the program, for error messages and other output

Definition at line 127 of file dwin.c.

◆ f_sigwench

bool f_sigwench = false

Definition at line 129 of file dwin.c.

◆ fn

char fn

function name for error messages

Definition at line 141 of file dwin.c.

Referenced by verify_dir(), and verify_file().

◆ GRAY_GAMMA

double GRAY_GAMMA = 1.2

Gamma correction. Set in .minitrc

Definition at line 122 of file dwin.c.

Referenced by apply_gamma(), and initialize_cells().

◆ GREEN_GAMMA

double GREEN_GAMMA = 1.2

Definition at line 124 of file dwin.c.

Referenced by apply_gamma(), and initialize_cells().

◆ m_begx

uint m_begx = -1

Definition at line 135 of file dwin.c.

◆ m_begy

uint m_begy = -1

Definition at line 134 of file dwin.c.

◆ m_cols

uint m_cols

Definition at line 133 of file dwin.c.

◆ m_lines

uint m_lines

Definition at line 132 of file dwin.c.

◆ mouse_support

uint mouse_support

Definition at line 136 of file dwin.c.

◆ pipe_in

int pipe_in

Definition at line 164 of file dwin.c.

◆ pipe_out

int pipe_out

Definition at line 164 of file dwin.c.

◆ RED_GAMMA

double RED_GAMMA = 1.2

Definition at line 123 of file dwin.c.

Referenced by apply_gamma(), and initialize_cells().

◆ src_line

uint src_line

the line number of the source file being processed, for error messages

Definition at line 139 of file dwin.c.

Referenced by verify_dir(), and verify_file().

◆ src_name

char * src_name

the name of the source file being processed, for error messages

Definition at line 140 of file dwin.c.

Referenced by verify_dir(), and verify_file().

◆ stderr_fd

int stderr_fd

the file descriptor for the terminal, for error messages and other output

Definition at line 164 of file dwin.c.

◆ stdin_fd

int stdin_fd

the file descriptor for the terminal, for error messages

Definition at line 137 of file dwin.c.

◆ stdout_fd

int stdout_fd

the file descriptor for the terminal, for error messages

Definition at line 138 of file dwin.c.

◆ tty_fd

int tty_fd

Definition at line 164 of file dwin.c.

◆ win_attr

uint16_t win_attr

Ncurses attributes for the current window, such as color pair, bold, etc.

Definition at line 130 of file dwin.c.