iPXE
Functions
winattrs.c File Reference

MuCurses window attribute functions. More...

#include <curses.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
chtype getbkgd (WINDOW *win)
 Get the background rendition attributes for a window.
int wattroff (WINDOW *win, int attrs)
 Turn off attributes in a window.
int wattron (WINDOW *win, int attrs)
 Turn on attributes in a window.
int wattrset (WINDOW *win, int attrs)
 Set attributes in a window.
int wattr_get (WINDOW *win, attr_t *attrs, short *pair, void *opts __unused)
 Get attributes and colour pair information.
int wattr_off (WINDOW *win, attr_t attrs, void *opts __unused)
 Turn off attributes in a window.
int wattr_on (WINDOW *win, attr_t attrs, void *opts __unused)
 Turn on 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.
int wcolour_set (WINDOW *win, short colour_pair_number, void *opts __unused)
 Set colour pair for a window.

Detailed Description

MuCurses window attribute functions.

Definition in file winattrs.c.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
chtype getbkgd ( WINDOW win) [inline]

Get the background rendition attributes for a window.

Parameters:
*winsubject window
Return values:
chchtype rendition representation

Definition at line 17 of file winattrs.c.

References _curses_window::attrs.

                                      {
        return win->attrs;
}
int wattroff ( WINDOW win,
int  attrs 
)

Turn off attributes in a window.

Parameters:
winsubject window
attrsattributes to enable
Return values:
rcreturn status code

Definition at line 28 of file winattrs.c.

References _curses_window::attrs, and OK.

Referenced by attroff(), and wattr_off().

                                        {
        win->attrs &= ~attrs;
        return OK;
}
int wattron ( WINDOW win,
int  attrs 
)

Turn on attributes in a window.

Parameters:
winsubject window
attrsattributes to enable
Return values:
rcreturn status code

Definition at line 40 of file winattrs.c.

References attrs, _curses_window::attrs, and OK.

Referenced by attron(), and wattr_on().

                                       {
        win->attrs |= attrs;
        return OK;
}
int wattrset ( WINDOW win,
int  attrs 
)

Set attributes in a window.

Parameters:
winsubject window
attrsattributes to enable
Return values:
rcreturn status code

Definition at line 52 of file winattrs.c.

References A_COLOR, _curses_window::attrs, and OK.

Referenced by _enter_slk(), attrset(), bkgdset(), wattr_set(), wbkgdset(), wstandend(), and wstandout().

                                        {
        win->attrs = ( attrs | ( win->attrs & A_COLOR ) );
        return OK;
}
int wattr_get ( WINDOW win,
attr_t attrs,
short *  pair,
void *opts  __unused 
)

Get attributes and colour pair information.

Parameters:
*winwindow to obtain information from
*attrsaddress in which to store attributes
*pairaddress in which to store colour pair
*optsundefined (for future implementation)
Return values:
rcreturn status cude

Definition at line 66 of file winattrs.c.

References A_ATTRIBUTES, _curses_window::attrs, OK, and PAIR_NUMBER.

Referenced by _enter_slk(), and attr_get().

                                      {
        *attrs = win->attrs & A_ATTRIBUTES;
        *pair = PAIR_NUMBER ( win->attrs );
        return OK;
}
int wattr_off ( WINDOW win,
attr_t  attrs,
void *opts  __unused 
)

Turn off attributes in a window.

Parameters:
*winsubject window
attrsattributes to toggle
*optsundefined (for future implementation)
Return values:
rcreturn status code

Definition at line 81 of file winattrs.c.

References OK, and wattroff().

Referenced by attr_off().

                                      {
        wattroff( win, attrs );
        return OK;
}
int wattr_on ( WINDOW win,
attr_t  attrs,
void *opts  __unused 
)

Turn on attributes in a window.

Parameters:
*winsubject window
attrsattributes to toggle
*optsundefined (for future implementation)
Return values:
rcreturn status code

Definition at line 95 of file winattrs.c.

References OK, and wattron().

Referenced by attr_on().

                                     {
        wattron( win, attrs );
        return OK;
}
int wattr_set ( WINDOW win,
attr_t  attrs,
short  cpair,
void *opts  __unused 
)

Set attributes and colour pair information in a window.

Parameters:
*winsubject window
attrsattributes to set
cpaircolour pair to set
*optsundefined (for future implementation)
Return values:
rcreturn status code

Definition at line 110 of file winattrs.c.

References COLOUR_PAIR, OK, and wattrset().

Referenced by _leave_slk(), and attr_set().

                                      {
        wattrset( win, attrs | COLOUR_PAIR ( cpair ) );
        return OK;
}
int wcolour_set ( WINDOW win,
short  colour_pair_number,
void *opts  __unused 
)

Set colour pair for a window.

Parameters:
*winsubject window
colour_pair_numbercolour pair integer
*optsundefined (for future implementation)
Return values:
rcreturn status code

Definition at line 124 of file winattrs.c.

References A_ATTRIBUTES, _curses_window::attrs, COLOUR_PAIR, COLOUR_PAIRS, ERR, and OK.

Referenced by colour_set().

                                        {
        if ( ( unsigned short )colour_pair_number > COLOUR_PAIRS )
                return ERR;

        win->attrs = ( ( win->attrs & A_ATTRIBUTES ) |
                       COLOUR_PAIR ( colour_pair_number ) );
        return OK;
}