16 #define MIN_SPACE_SIZE 2 18 #define SLK_MAX_LABEL_LEN 8 20 #define SLK_MAX_NUM_LABELS 12 22 #define SLK_MAX_NUM_SPACES 2 84 memset ( str, 0,
sizeof ( str ) );
87 if ( !
sl.label[0] ) {
196 if ( (
unsigned short )colour_pair_number >
COLORS )
226 if ( (
unsigned short )colour_pair_number >
COLORS )
242 unsigned short nmaj, nmin, nblocks, available_width;
244 if ( (
unsigned)
fmt > 3 ) {
258 nblocks = 8; nmaj = 2; nmin = 5;
262 nblocks = 8; nmaj = 1; nmin = 6;
268 nblocks = 12; nmaj = 2; nmin = 9;
279 ( available_width % nblocks ) / nmaj;
308 unsigned int i, j, pos_x,
309 *next_space, *last_space;
327 if ( i == *next_space ) {
330 if ( next_space < last_space )
357 if ( (
unsigned short)
fmt >= 3 )
unsigned int maj_space_len
int slk_attroff(const chtype attrs)
Turn off soft function key attributes.
int slk_attr_on(attr_t attrs, void *opts __unused)
Turn on soft function key attributes.
int wmove(WINDOW *win, int y, int x) __nonnull
Move a window's cursor to the specified position.
void _wputstr(WINDOW *win, const char *str, int wrap, int n) __nonnull
Write a standard c-style string to a window.
int wattrset(WINDOW *win, int attrs)
Set attributes in a window.
struct _softlabel fkeys[SLK_MAX_NUM_LABELS]
int slk_restore(void)
Restore soft function key labels to the screen.
#define SLK_MAX_NUM_LABELS
MuCurses cursor implementation specific header file.
static void _leave_slk(void)
int wattr_get(WINDOW *win, attr_t *attrs, short *pair, void *opts __unused)
Get attributes and colour pair information.
int slk_set(int labnum, const char *label, int fmt)
Configure specified soft key.
char label[SLK_MAX_LABEL_LEN]
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#define LINES(...)
Define inline lines.
MuCurses core implementation specific header file.
char * strncpy(char *dest, const char *src, size_t max)
Copy string.
unsigned int max_label_len
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
#define __unused
Declare a variable or data structure as unused.
static void *__malloc calloc(size_t nmemb, size_t size)
Allocate cleared memory.
int slk_attr_off(const attr_t attrs, void *opts __unused)
Turn off soft function key attributes.
static void _print_label(struct _softlabel sl)
uint32_t attrs
Extended attributes (optional)
static struct _softlabelkeys * slks
int slk_colour(short colour_pair_number)
Set soft label colour pair.
static void _enter_slk(void)
unsigned int spaces[SLK_MAX_NUM_SPACES]
size_t strlen(const char *src)
Get length of string.
int wclrtoeol(WINDOW *win)
Clear a window to the end of the current line.
void _wputch(WINDOW *win, chtype ch, int wrap) __nonnull
Write a single character rendition to a window.
int slk_init(int fmt)
Initialise the soft function keys.
int slk_clear(void)
Clear the soft function key labels from the screen.
int slk_attron(const chtype attrs)
Turn on soft function key attributes.
struct cursor_pos saved_cursor
int slk_attr_set(const attr_t attrs, short colour_pair_number, void *opts __unused)
Set soft function key attributes.
int ssize_t const char * fmt
static void _restore_curs_pos(WINDOW *win, struct cursor_pos *pos)
Restore cursor position from encoded backup variable.
attr_t slk_attr(void)
Return the attribute used for the soft function keys.
int wattr_set(WINDOW *win, attr_t attrs, short cpair, void *opts __unused)
Set attributes and colour pair information in a window.
static void _store_curs_pos(WINDOW *win, struct cursor_pos *pos)
Store cursor position for later restoration.
char * strcat(char *dest, const char *src)
Concatenate string.
#define SLK_MAX_NUM_SPACES
static union @438 opts
"cert<xxx>" option list
#define NULL
NULL pointer (VOID *)
char * slk_label(int labnum)
Return the label for the specified soft key.
#define SLK_MAX_LABEL_LEN
int slk_attrset(const chtype attrs)
Set soft function key attributes.
void * memset(void *dest, int character, size_t len) __nonnull