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)
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   ) 

chtype getbkgd ( WINDOW win  )  [inline]

Get the background rendition attributes for a window.

Parameters:
*win subject window
Return values:
ch chtype rendition representation

Definition at line 17 of file winattrs.c.

References _curses_window::attrs.

00017                                       {
00018         return win->attrs;
00019 }

int wattroff ( WINDOW win,
int  attrs 
)

Turn off attributes in a window.

Parameters:
win subject window
attrs attributes to enable
Return values:
rc return status code

Definition at line 28 of file winattrs.c.

References _curses_window::attrs, and OK.

Referenced by attroff(), and wattr_off().

00028                                         {
00029         win->attrs &= ~attrs;
00030         return OK;
00031 }

int wattron ( WINDOW win,
int  attrs 
)

Turn on attributes in a window.

Parameters:
win subject window
attrs attributes to enable
Return values:
rc return status code

Definition at line 40 of file winattrs.c.

References _curses_window::attrs, and OK.

Referenced by attron(), and wattr_on().

00040                                        {
00041         win->attrs |= attrs;
00042         return OK;
00043 }

int wattrset ( WINDOW win,
int  attrs 
)

Set attributes in a window.

Parameters:
win subject window
attrs attributes to enable
Return values:
rc return 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().

00052                                         {
00053         win->attrs = ( attrs | ( win->attrs & A_COLOR ) );
00054         return OK;
00055 }

int wattr_get ( WINDOW win,
attr_t attrs,
short *  pair,
void *opts  __unused 
)

Get attributes and colour pair information.

Parameters:
*win window to obtain information from
*attrs address in which to store attributes
*pair address in which to store colour pair
*opts undefined (for future implementation)
Return values:
rc return 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().

00067                                       {
00068         *attrs = win->attrs & A_ATTRIBUTES;
00069         *pair = PAIR_NUMBER ( win->attrs );
00070         return OK;
00071 }

int wattr_off ( WINDOW win,
attr_t  attrs,
void *opts  __unused 
)

Turn off attributes in a window.

Parameters:
*win subject window
attrs attributes to toggle
*opts undefined (for future implementation)
Return values:
rc return status code

Definition at line 81 of file winattrs.c.

References OK, and wattroff().

Referenced by attr_off().

00082                                       {
00083         wattroff( win, attrs );
00084         return OK;
00085 }

int wattr_on ( WINDOW win,
attr_t  attrs,
void *opts  __unused 
)

Turn on attributes in a window.

Parameters:
*win subject window
attrs attributes to toggle
*opts undefined (for future implementation)
Return values:
rc return status code

Definition at line 95 of file winattrs.c.

References OK, and wattron().

Referenced by attr_on().

00096                                      {
00097         wattron( win, attrs );
00098         return OK;
00099 }

int wattr_set ( WINDOW win,
attr_t  attrs,
short  cpair,
void *opts  __unused 
)

Set attributes and colour pair information in a window.

Parameters:
*win subject window
attrs attributes to set
cpair colour pair to set
*opts undefined (for future implementation)
Return values:
rc return status code

Definition at line 110 of file winattrs.c.

References COLOUR_PAIR, OK, and wattrset().

Referenced by _leave_slk(), and attr_set().

00111                                       {
00112         wattrset( win, attrs | COLOUR_PAIR ( cpair ) );
00113         return OK;
00114 }

int wcolour_set ( WINDOW win,
short  colour_pair_number,
void *opts  __unused 
)

Set colour pair for a window.

Parameters:
*win subject window
colour_pair_number colour pair integer
*opts undefined (for future implementation)
Return values:
rc return 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().

00125                                         {
00126         if ( ( unsigned short )colour_pair_number > COLOUR_PAIRS )
00127                 return ERR;
00128 
00129         win->attrs = ( ( win->attrs & A_ATTRIBUTES ) |
00130                        COLOUR_PAIR ( colour_pair_number ) );
00131         return OK;
00132 }


Generated on Tue Apr 6 20:01:47 2010 for gPXE by  doxygen 1.5.7.1