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] ) {
88 memset( str, space_ch, (
size_t)(
slks->max_label_len) );
94 (
size_t)(
slks->max_label_len
99 (
size_t)(
slks->max_label_len
106 (
size_t)(
slks->max_label_len -
strlen(str)) );
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;
259 slks->spaces[0] = 2;
slks->spaces[1] = 4;
262 nblocks = 8; nmaj = 1; nmin = 6;
268 nblocks = 12; nmaj = 2; nmin = 9;
269 slks->spaces[0] = 3;
slks->spaces[1] = 7;
277 slks->max_label_len = available_width / nblocks;
279 ( available_width % nblocks ) / nmaj;
280 slks->num_spaces = nmaj;
281 slks->num_labels = nblocks;
299 return slks->fkeys[labnum].label;
308 unsigned int i, j, pos_x,
309 *next_space, *last_space;
320 next_space = &(
slks->spaces[0]);
321 last_space = &(
slks->spaces[
slks->num_spaces-1]);
323 for ( i = 0; i <
slks->num_labels ; i++ ) {
325 pos_x +=
slks->max_label_len;
327 if ( i == *next_space ) {
328 for ( j = 0; j <
slks->maj_space_len; j++, pos_x++ )
330 if ( next_space < last_space )
355 if ( (
unsigned short)labnum >=
slks->num_labels )
357 if ( (
unsigned short)
fmt >= 3 )
361 (
sizeof(
slks->fkeys[labnum].label) - 1));
#define NULL
NULL pointer (VOID *)
#define assert(condition)
Assert a condition at run-time.
static union @024010030001061367220137227263210031030210157031 opts
"cert<xxx>" option list
int wclrtoeol(WINDOW *win)
Clear a window to the end of the current line.
MuCurses cursor implementation specific header file.
static void _store_curs_pos(WINDOW *win, struct cursor_pos *pos)
Store cursor position for later restoration.
static void _restore_curs_pos(WINDOW *win, struct cursor_pos *pos)
Restore cursor position from encoded backup variable.
#define __unused
Declare a variable or data structure as unused.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
void * memset(void *dest, int character, size_t len) __nonnull
#define LINES(...)
Define inline lines.
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.
void _wputch(WINDOW *win, chtype ch, int wrap) __nonnull
Write a single character rendition to a window.
MuCurses core implementation specific header file.
static void _enter_slk(void)
static struct _softlabelkeys * slks
int slk_attr_off(const attr_t attrs, void *opts __unused)
Turn off soft function key attributes.
int slk_set(int labnum, const char *label, int fmt)
Configure specified soft key.
int slk_attr_set(const attr_t attrs, short colour_pair_number, void *opts __unused)
Set soft function key attributes.
int slk_attroff(const chtype attrs)
Turn off soft function key attributes.
int slk_clear(void)
Clear the soft function key labels from the screen.
attr_t slk_attr(void)
Return the attribute used for the soft function keys.
#define SLK_MAX_NUM_LABELS
#define SLK_MAX_LABEL_LEN
int slk_attrset(const chtype attrs)
Set soft function key attributes.
#define SLK_MAX_NUM_SPACES
int slk_colour(short colour_pair_number)
Set soft label colour pair.
static void _print_label(struct _softlabel sl)
static void _leave_slk(void)
int slk_attr_on(attr_t attrs, void *opts __unused)
Turn on soft function key attributes.
int slk_restore(void)
Restore soft function key labels to the screen.
char * slk_label(int labnum)
Return the label for the specified soft key.
int slk_init(int fmt)
Initialise the soft function keys.
int slk_attron(const chtype attrs)
Turn on soft function key attributes.
static void *__malloc calloc(size_t nmemb, size_t size)
Allocate cleared memory.
char * strcat(char *dest, const char *src)
Concatenate string.
size_t strlen(const char *src)
Get length of string.
char * strncpy(char *dest, const char *src, size_t max)
Copy string.
char label[SLK_MAX_LABEL_LEN]
unsigned int max_label_len
unsigned int spaces[SLK_MAX_NUM_SPACES]
struct cursor_pos saved_cursor
unsigned int maj_space_len
struct _softlabel fkeys[SLK_MAX_NUM_LABELS]
int ssize_t const char * fmt
int wattr_get(WINDOW *win, attr_t *attrs, short *pair, void *opts __unused)
Get attributes and colour pair information.
int wattrset(WINDOW *win, int attrs)
Set attributes in a window.
int wattr_set(WINDOW *win, attr_t attrs, short cpair, void *opts __unused)
Set attributes and colour pair information in a window.