Welcome to the EyeBot  Version 7 - RPi1
A Controller For Various Hardware IO
Functions
lcd.c File Reference

Defines functions to interact with the LCD screen. More...

#include "lcd.h"

Functions

XColor getColor (char *colorName)
 Return the XColor color from the color name. More...
 
XColor RGBtoXCol (COLOR rgb)
 Convcerts an RGB colour to XColor. More...
 
int LCDDrawFrame (int x1, int y1, int x2, int y2, XColor color)
 Draw a bordered frame. More...
 
int LCDRect (int x1, int y1, int x2, int y2, COLOR col)
 A wrapper for LCDDrawFrame. More...
 
int LCDDrawMenu (void)
 Draw the menu. More...
 
int LCDDrawList (void)
 Draw the list. More...
 
int LCDInit ()
 Initialize the LCD. More...
 
int LCDClear (void)
 Clear the LCD display and all display buffers ie. turn it black. More...
 
int LCDSetMode (HWORD mode)
 Update the internal mode flag bits. More...
 
HWORD LCDGetMode (void)
 Get the internal mode flag bits. More...
 
int LCDResetMode (HWORD mode)
 Reset the internal mode flag bits to a previously saved mode. More...
 
int LCDMenu (char *string1, char *string2, char *string3, char *string4)
 Set menu entries in KEY_CLASSIC mode (4-buttons). Also sets the LCD_SHOWMENU flag and refresh the LCD. More...
 
int LCDMenuIRaw (int pos, char *string, XColor fgcol, XColor bgcol, void *userp)
 Set specific menu entry in KEY_CLASSIC mode (index given by pos). Color customization for specific key is now possible (fgcol/bgcol). A user-specific data can be linked to the menu using userp pointer. Will also set the LCD_SHOWMENU flag and refresh the LCD. More...
 
int LCDMenuI (int pos, char *string, COLOR fg, COLOR bg)
 A wrapper for LCDMenuIRaw. More...
 
MENU_ITEMLCDMenuItem (int index)
 Return the menuitem at a given position. More...
 
int LCDList (LIST_MENU *menulist)
 Setup the list menu display and update appropriate info in the LIST_MENU structure pointed by menulist (e.g. scroll, count). Will also set the LCD_LISTMENU flag and refresh the LCD. More...
 
int LCDSetList (LIST_MENU *menulist)
 Unlike LCDList(), this will blindly assign menulist to the mainlist for display. Doesn't update anything in the menulist structure, nor modify any internal flags. Useful to maintain multiple lists for menu display. More...
 
LIST_MENULCDGetList (void)
 Get the currently active list menu. More...
 
RECTLCDListBox (int pos)
 Get the frame info of a specific list item in form of a RECT structure. More...
 
MENU_ITEMLCDListActiveItem (void)
 Get the selected menuitem in the list menu – using index & start variable in LIST_MENU. Will return 0x0 (NUL) if no item is currently selected. More...
 
int LCDAreaRaw (int x1, int y1, int x2, int y2, XColor color)
 Draw a color-filled rectangle with (x1,y1) as top-left coordinate and (x2,y2) as the bottom-right coordinate. More...
 
int LCDArea (int x1, int y1, int x2, int y2, COLOR col, int fill)
 A wrapper for LCDAreaRaw. More...
 
int LCDFrame (int x1, int y1, int x2, int y2, XColor color)
 Draw a color rectangle frame with (x1,y1) as top-left coordinate and (x2,y2) as the bottom-right coordinate. More...
 
int LCDTextColor (XColor fgcol, XColor bgcol, char colorflags)
 Set the default color for text (including background) and related flags (e.g. for transparent background). More...
 
int LCDSetColor (COLOR fg, COLOR bg)
 A wrapper for LCDTextColor. More...
 
int LCDSetFontRaw (char *fontAlias)
 Sets the font using alias in Xlib. More...
 
int LCDSetFont (int fontName, int variation)
 Sets the font using fontName and variation. More...
 
int LCDSetFontSize (int fontsize)
 Sets the font size. More...
 
int LCDPrintfFont (EYEFONT eyeFont, const char *format,...)
 Print formatted string to LCD and refresh LCD. Cursor position is updated. More...
 
int LCDPrintf (const char *format,...)
 Print formatted string to LCD and refresh LCD. Cursor position is updated. More...
 
int LCDSetPrintf (int row, int column, const char *format,...)
 LCDPrintf with text position specified. More...
 
int LCDSetPrintfFont (int row, int column, EYEFONT eyeFont, const char *format,...)
 LCDPrintf with text position and text colour specified. More...
 
int LCDSetPos (int row, int column)
 Set the text cursor position to (row, column). More...
 
int LCDGetPos (int *row, int *column)
 Get the text cursor position. More...
 
int LCDSetPixel (int x, int y, XColor color)
 Sets the color of the pixel at (x,y) coordinate to color. More...
 
int LCDPixel (int x, int y, COLOR col)
 A wrapper for LCDSet Pixel. More...
 
XColor LCDGetPixel (int x, int y)
 Get the RGB color value of the pixel at (x,y) coordinate. More...
 
XColor InvertColor (XColor color)
 Invert a RGB color. More...
 
int LCDPixelInvert (int x, int y)
 Bit-invert the color of the pixel at (x,y) coordinate. More...
 
int LCDCircle (int x1, int y1, int size, COLOR col, int fill)
 Draws a circle. More...
 
int LCDCircleInvert (int x1, int y1, int r)
 Inverts the pixels inside of the given circle. More...
 
int LCDLineRaw (int x1, int y1, int x2, int y2, XColor color)
 Draw a color line from (x1,y1) to (x2,y2). More...
 
int LCDLine (int x1, int y1, int x2, int y2, COLOR col)
 A wrapper for LCDLineRaw. More...
 
int LCDLineInvert (int x1, int y1, int x2, int y2)
 Draw a line from (x1,y1) to (x2,y2). The line pixels will invert the color of existing pixels. More...
 
int LCDAreaInvert (int x1, int y1, int x2, int y2)
 Draw a rectangle with (x1,y1) as top-left coordinate and (x2,y2) as the bottom-right coordinate. The pixels in the specified area will invert the color of existing pixels. More...
 
RECT LCDTextBar (int row, int column, int length, int fill, XColor color)
 Draw a textbar for text starting at position (row, column) until (row, column+length). The textbar will take about 25%-50% of text height & width to draw its frame. The fill parameter will define how much of the text bar should be 'filled' with color (like a progress bar). More...
 
int LCDNeedRefresh (void)
 Indicate if the LCD need to be refreshed. More...
 
int LCDRelease ()
 Release the LCD. More...
 
int LCDRefresh (void)
 Refresh the screen (i.e write display buffers to the framebuffer device). Refreshes the menu. More...
 
int LCDRefresh2 (void)
 Refresh the screen (i.e write display buffers to the framebuffer device). Does not refresh the menu. More...
 
int LCDRefresh3 (void)
 Refresh the screen (i.e write display buffers to the framebuffer device). Does not refresh the menu or the listmenu. More...
 
int LCDGetFBInfo (FBINFO *pinfo)
 Get display information and save to structure pointed by pinfo. Cursor info needs LCDInit() for textsize. More...
 
int LCDListCount (void)
 Get the number of list items supported by the current display (text) configuration. This includes the item for title bar - thus, different from count variable in LIST_MENU as updated by an LCDList() call. More...
 
int LCDListIndex (int index)
 Set the list index. More...
 
int LCDListScrollUp (void)
 Scrolls the list display up. Menu index is not altered. If the active menu item goes out of focus, the index becomes negative (no item selected). More...
 
int LCDListScrollDown (void)
 Scrolls the list display down. Menu index is not altered. If the active menu item goes out of focus, the index becomes negative (no item selected). More...
 
int get_byte_order (void)
 
XImage * create_image_from_buffer (Display *dis, int screen, u_char *buf, int width, int height)
 
int LCDPutImageRGB (int xpos, int ypos, int xsize, int ysize, BYTE *data)
 Place a RGB color image (24bpp) at (xpos,ypos) position on the LCD screen. More...
 
int convertGrey (BYTE *greyimage, BYTE *newImage)
 Converts a color image to grey. More...
 
int LCDPutImageGrey (int xpos, int ypos, int xsize, int ysize, BYTE *image)
 Place a Grey image (24bpp) at (xpos,ypos) position on the LCD screen. More...
 
int LCDImageStart (int t, int x, int y, int xs, int ys)
 Sets the parameters for subsequent image draws. More...
 
int LCDImage (BYTE *img)
 Draws a colour (RGB) image to the LCD. More...
 
int LCDImageGray (BYTE *greyImage)
 Draws a grey image to the LCD. More...
 
int LCDGetSize (int *x, int *y)
 Get LCD resolution in pixels. More...
 

Detailed Description

Defines functions to interact with the LCD screen.

Defines functions to connect wirelessly between Eyebots.

Author
Marcus Pham & Remi KEAT
Marcus Pham

Function Documentation

int convertGrey ( BYTE *  greyimage,
BYTE *  newImage 
)

Converts a color image to grey.

Parameters
greyimage: the input image
newImagethe output image
Returns
int retVal : always 0
int get_byte_order ( void  )

Starting the Printing Image functions

XColor getColor ( char *  colorName)

Return the XColor color from the color name.

Parameters
char*colorName
Returns
XColor color
XColor InvertColor ( XColor  color)

Invert a RGB color.

Parameters
XColorcolor : RGB color value
Returns
XColor color : RGB color value
int LCDArea ( int  x1,
int  y1,
int  x2,
int  y2,
COLOR  col,
int  fill 
)

A wrapper for LCDAreaRaw.

Parameters
intx1 : X-coordinate of top-left pixel
inty1 : Y-coordinate of top-left pixel
intx2 : X-coordinate of bottom-right pixel
inty2 : Y-coordinate of bottom-right pixel
XColorcolor : RGB fill color value
Returns
int retVal : always 0
int LCDAreaInvert ( int  x1,
int  y1,
int  x2,
int  y2 
)

Draw a rectangle with (x1,y1) as top-left coordinate and (x2,y2) as the bottom-right coordinate. The pixels in the specified area will invert the color of existing pixels.

Parameters
intx1 : X-coordinate of top-left pixel
inty1 : Y-coordinate of top-left pixel
intx2 : X-coordinate of bottom-right pixel
inty2 : Y-coordinate of bottom-right pixel
Returns
int retVal : always 0
int LCDAreaRaw ( int  x1,
int  y1,
int  x2,
int  y2,
XColor  color 
)

Draw a color-filled rectangle with (x1,y1) as top-left coordinate and (x2,y2) as the bottom-right coordinate.

Parameters
intx1 : X-coordinate of top-left pixel
inty1 : Y-coordinate of top-left pixel
intx2 : X-coordinate of bottom-right pixel
inty2 : Y-coordinate of bottom-right pixel
XColorcolor : RGB fill color value
Returns
int retVal : always 0
int LCDCircle ( int  x1,
int  y1,
int  size,
COLOR  col,
int  fill 
)

Draws a circle.

Parameters
intx1 : X-coordinate of the centre
inty1 : Y-coordinate of the centre
intsize : radius of the circle
COLORcol: the color of the circle
intfill : fill(1) or no fill(0)
Returns
int retVal : always 0
int LCDCircleInvert ( int  x1,
int  y1,
int  r 
)

Inverts the pixels inside of the given circle.

Parameters
intx1 : X-coordinate of the centre
inty1 : Y-coordinate of the centre
intr the radius of the circle
Returns
int retVal : always 0
int LCDClear ( void  )

Clear the LCD display and all display buffers ie. turn it black.

Returns
int retVal : always 0
int LCDDrawFrame ( int  x1,
int  y1,
int  x2,
int  y2,
XColor  color 
)

Draw a bordered frame.

Parameters
intx1 : X-coordinate of top-left pixel
inty1 : Y-coordinate of top-left pixel
intx2 : X-coordinate of bottom-right pixel
inty2 : Y-coordinate of bottom-right pixel
Returns
int retVal : always 0
int LCDDrawList ( void  )

Draw the list.

Returns
int retVal : always 0
int LCDDrawMenu ( void  )

Draw the menu.

Returns
int retVal : always 0
int LCDFrame ( int  x1,
int  y1,
int  x2,
int  y2,
XColor  color 
)

Draw a color rectangle frame with (x1,y1) as top-left coordinate and (x2,y2) as the bottom-right coordinate.

Parameters
intx1 : X-coordinate of top-left pixel
inty1 : Y-coordinate of top-left pixel
intx2 : X-coordinate of bottom-right pixel
inty2 : Y-coordinate of bottom-right pixel
XColorcolor : RGB fill color value
Returns
int retVal : always 0
int LCDGetFBInfo ( FBINFO pinfo)

Get display information and save to structure pointed by pinfo. Cursor info needs LCDInit() for textsize.

Parameters
FBINFO*pinfo : Pointer to storage for screen & cursor info
Returns
int retVal
0 on success
Negative value on failure
LIST_MENU* LCDGetList ( void  )

Get the currently active list menu.

Returns
LIST_MENU* retListMenu : Pointer to LIST_MENU structure
HWORD LCDGetMode ( void  )

Get the internal mode flag bits.

Returns
HWORD mode : Current mode flag bits
XColor LCDGetPixel ( int  x,
int  y 
)

Get the RGB color value of the pixel at (x,y) coordinate.

Parameters
intx : X-coordinate of the pixel
inty : Y-coordinate of the pixel
Returns
XColor color : RGB color value
int LCDGetPos ( int *  row,
int *  column 
)

Get the text cursor position.

Parameters
int*row : Pointer to cursor row index
int*column : Pointer to cursor column index
Returns
int retVal : always 0
int LCDGetSize ( int *  x,
int *  y 
)

Get LCD resolution in pixels.

Parameters
x: Where to store the width of the LCD
y: Where to store the height of the LCD
Returns
int retVal : always 0
int LCDImage ( BYTE *  img)

Draws a colour (RGB) image to the LCD.

Parameters
img: A pointer to the BYTE buffer of the image
Returns
int retVal : always 0
int LCDImageGray ( BYTE *  greyImage)

Draws a grey image to the LCD.

Parameters
img: A pointer to the BYTE buffer of the image
Returns
int retVal : always 0
int LCDImageStart ( int  t,
int  x,
int  y,
int  xs,
int  ys 
)

Sets the parameters for subsequent image draws.

Parameters
intt : the image type
intx : x-coordinate of top-left image position
inty : y-coordinate of top-left image position
intxs : Image width
intys : Image height
Returns
int retVal : always 0
int LCDInit ( )

Initialize the LCD.

Returns
int retVal : always 0, if already initilialised return 1
int LCDLine ( int  x1,
int  y1,
int  x2,
int  y2,
COLOR  col 
)

A wrapper for LCDLineRaw.

Parameters
intx1 : X-coordinate of first pixel
inty1 : Y-coordinate of first pixel
intx2 : X-coordinate of second pixel
inty2 : Y-coordinate of second pixel
col: RGB color value for the pixel
Returns
int retVal : always 0
int LCDLineInvert ( int  x1,
int  y1,
int  x2,
int  y2 
)

Draw a line from (x1,y1) to (x2,y2). The line pixels will invert the color of existing pixels.

Parameters
intx1 : X-coordinate of first pixel
inty1 : Y-coordinate of first pixel
intx2 : X-coordinate of second pixel
inty2 : Y-coordinate of second pixel
Returns
int retVal : always 0
int LCDLineRaw ( int  x1,
int  y1,
int  x2,
int  y2,
XColor  color 
)

Draw a color line from (x1,y1) to (x2,y2).

Parameters
intx1 : X-coordinate of first pixel
inty1 : Y-coordinate of first pixel
intx2 : X-coordinate of second pixel
inty2 : Y-coordinate of second pixel
XColorcolor : RGB color value for the pixel
Returns
int retVal : always 0
int LCDList ( LIST_MENU menulist)

Setup the list menu display and update appropriate info in the LIST_MENU structure pointed by menulist (e.g. scroll, count). Will also set the LCD_LISTMENU flag and refresh the LCD.

Parameters
LIST_MENU*menulist : Listmenu to be used for display
Returns
int retVal : always 0
MENU_ITEM* LCDListActiveItem ( void  )

Get the selected menuitem in the list menu – using index & start variable in LIST_MENU. Will return 0x0 (NUL) if no item is currently selected.

Returns
MENU_ITEM* retMenuItem : Pointer to a MENU_ITEM structure
RECT* LCDListBox ( int  pos)

Get the frame info of a specific list item in form of a RECT structure.

Parameters
intpos : Index of list item
Returns
RECT* retMenuRect : Pointer to a RECT structure
int LCDListCount ( void  )

Get the number of list items supported by the current display (text) configuration. This includes the item for title bar - thus, different from count variable in LIST_MENU as updated by an LCDList() call.

Returns
int listCount : Number of list items (including title box)
int LCDListIndex ( int  index)

Set the list index.

Parameters
intindex : List index
Returns
int retVal : List index
int LCDListScrollDown ( void  )

Scrolls the list display down. Menu index is not altered. If the active menu item goes out of focus, the index becomes negative (no item selected).

Returns
int retVal : always 0
int LCDListScrollUp ( void  )

Scrolls the list display up. Menu index is not altered. If the active menu item goes out of focus, the index becomes negative (no item selected).

Returns
int retVal : always 0
int LCDMenu ( char *  string1,
char *  string2,
char *  string3,
char *  string4 
)

Set menu entries in KEY_CLASSIC mode (4-buttons). Also sets the LCD_SHOWMENU flag and refresh the LCD.

Parameters
char*string1 : Menu entry for KEY1 in classic mode
char*string2 : Menu entry for KEY2 in classic mode
char*string3 : Menu entry for KEY3 in classic mode
char*string4 : Menu entry for KEY4 in classic mode
Returns
int retVal : always 0
int LCDMenuI ( int  pos,
char *  string,
COLOR  fg,
COLOR  bg 
)

A wrapper for LCDMenuIRaw.

Parameters
intpos : Select menu entry in classic mode (from 1->4)
char*string : Menu entry for the key at specified index
XColorfgcol : Textcolor for the menu
XColorbgcol : Background color for the menu
void*userp : A general purpose pointer for user-specific data
Returns
int retVal : always 0
int LCDMenuIRaw ( int  pos,
char *  string,
XColor  fgcol,
XColor  bgcol,
void *  userp 
)

Set specific menu entry in KEY_CLASSIC mode (index given by pos). Color customization for specific key is now possible (fgcol/bgcol). A user-specific data can be linked to the menu using userp pointer. Will also set the LCD_SHOWMENU flag and refresh the LCD.

Parameters
intpos : Select menu entry in classic mode
char*string : Menu entry for the key at specified index
XColorfgcol : Textcolor for the menu
XColorbgcol : Background color for the menu
void*userp : A general purpose pointer for user-specific data
Returns
int retVal : always 0
MENU_ITEM* LCDMenuItem ( int  index)

Return the menuitem at a given position.

Parameters
intindex : position of the menuitem (from 1->4)
Returns
MENU_ITEM* menuItem
int LCDNeedRefresh ( void  )

Indicate if the LCD need to be refreshed.

Returns
int retVal : non-null value indicate that the LCD need to be refreshed
int LCDPixel ( int  x,
int  y,
COLOR  col 
)

A wrapper for LCDSet Pixel.

Parameters
intx : X-coordinate of the pixel
inty : Y-coordinate of the pixel
col: RGB color value for the pixel
Returns
int retVal : always 0
int LCDPixelInvert ( int  x,
int  y 
)

Bit-invert the color of the pixel at (x,y) coordinate.

Parameters
intx : X-coordinate of the pixel
inty : Y-coordinate of the pixel
Returns
int retVal : always 0
int LCDPrintf ( const char *  format,
  ... 
)

Print formatted string to LCD and refresh LCD. Cursor position is updated.

Parameters
constchar* format : Formatted string
Returns
int retVal : always 0
int LCDPrintfFont ( EYEFONT  eyeFont,
const char *  format,
  ... 
)

Print formatted string to LCD and refresh LCD. Cursor position is updated.

Parameters
constchar* format : Formatted string
Returns
int retVal : always 0
int LCDPutImageGrey ( int  xpos,
int  ypos,
int  xsize,
int  ysize,
BYTE *  image 
)

Place a Grey image (24bpp) at (xpos,ypos) position on the LCD screen.

Parameters
intxpos : X-coordinate of top-left image position
intypos : Y-coordinate of top-left image position
intxsize : Image width
intysize : Image height
BYTE*data : Pointer to image data (24-bit per pixel)
Returns
int retVal : always 0
int LCDPutImageRGB ( int  xpos,
int  ypos,
int  xsize,
int  ysize,
BYTE *  data 
)

Place a RGB color image (24bpp) at (xpos,ypos) position on the LCD screen.

Parameters
intxpos : X-coordinate of top-left image position
intypos : Y-coordinate of top-left image position
intxsize : Image width
intysize : Image height
BYTE*data : Pointer to image data (24-bit per pixel)
Returns
int retVal : always 0
int LCDRect ( int  x1,
int  y1,
int  x2,
int  y2,
COLOR  col 
)

A wrapper for LCDDrawFrame.

Parameters
intx1 : X-coordinate of top-left pixel
inty1 : Y-coordinate of top-left pixel
intx2 : X-coordinate of bottom-right pixel
inty2 : Y-coordinate of bottom-right pixel
Returns
int retVal : always 0
int LCDRefresh ( void  )

Refresh the screen (i.e write display buffers to the framebuffer device). Refreshes the menu.

Returns
int retVal : always 0
int LCDRefresh2 ( void  )

Refresh the screen (i.e write display buffers to the framebuffer device). Does not refresh the menu.

Returns
int retVal : always 0
int LCDRefresh3 ( void  )

Refresh the screen (i.e write display buffers to the framebuffer device). Does not refresh the menu or the listmenu.

Returns
int retVal : always 0
int LCDRelease ( )

Release the LCD.

Returns
int retVal : always 0
int LCDResetMode ( HWORD  mode)

Reset the internal mode flag bits to a previously saved mode.

Parameters
HWORDmode : Mode flag - bit XORed
Returns
int retVal : always 0
int LCDSetColor ( COLOR  fg,
COLOR  bg 
)

A wrapper for LCDTextColor.

Parameters
fg: Default color for text
bg: Default color for text background
Returns
0 always
int LCDSetFont ( int  fontName,
int  variation 
)

Sets the font using fontName and variation.

Parameters
intfontNmae the type of font
intvariation the variation (NORMAL/BOLD)
Returns
0 always
int LCDSetFontRaw ( char *  fontAlias)

Sets the font using alias in Xlib.

Parameters
fontAliasthe alias for the font
Returns
0 always
int LCDSetFontSize ( int  fontsize)

Sets the font size.

Parameters
intfontsize the size of font
Returns
0 aon success, 1 for invalid fontsize
int LCDSetList ( LIST_MENU menulist)

Unlike LCDList(), this will blindly assign menulist to the mainlist for display. Doesn't update anything in the menulist structure, nor modify any internal flags. Useful to maintain multiple lists for menu display.

Parameters
LIST_MENU*menulist : Listmenu to be used for display
Returns
int retVal : always 0
int LCDSetMode ( HWORD  mode)

Update the internal mode flag bits.

Parameters
HWORDmode : LCD Mode flag
Returns
int retVal : always 0
int LCDSetPixel ( int  x,
int  y,
XColor  color 
)

Sets the color of the pixel at (x,y) coordinate to color.

Parameters
intx : X-coordinate of the pixel
inty : Y-coordinate of the pixel
XColorcolor : color value for the pixel
Returns
int retVal : always 0
int LCDSetPos ( int  row,
int  column 
)

Set the text cursor position to (row, column).

Parameters
introw : Text cursor row index
intcolumn : Text cursor column index
Returns
int retVal : always 0
int LCDSetPrintf ( int  row,
int  column,
const char *  format,
  ... 
)

LCDPrintf with text position specified.

Parameters
introw : Cursor position
intcolumn : Cursor position
constchar* format : Formatted string
Returns
int retVal : always 0
int LCDSetPrintfFont ( int  row,
int  column,
EYEFONT  eyeFont,
const char *  format,
  ... 
)

LCDPrintf with text position and text colour specified.

Parameters
introw : Cursor position
intcolumn : Cursor position
XColorcolour : the colour of the text
constchar* format : Formatted string
Returns
int retVal : always 0
RECT LCDTextBar ( int  row,
int  column,
int  length,
int  fill,
XColor  color 
)

Draw a textbar for text starting at position (row, column) until (row, column+length). The textbar will take about 25%-50% of text height & width to draw its frame. The fill parameter will define how much of the text bar should be 'filled' with color (like a progress bar).

Parameters
introw : Start text cursor position
intcolumn : Start text cursor position
intlength : Text length of the bar
intfill : Percentage of textbar to be filled
XColorcolor : Fill color for the textbar
Returns
RECT rect : RECT structure for the textbar's frame
int LCDTextColor ( XColor  fgcol,
XColor  bgcol,
char  colorflags 
)

Set the default color for text (including background) and related flags (e.g. for transparent background).

Parameters
XColorfgcol : Default color for text
XColorbgcol : Default color for text background
charcolorflags : Mode flag for text color

Valid value for colorflags :

  • LCD_BGCOL_TRANSPARENT
  • LCD_BGCOL_INVERSE
  • LCD_FGCOL_INVERSE
  • LCD_BGCOL_NOTRANSPARE
  • LCD_BGCOL_NOINVERSE
  • LCD_FGCOL_NOINVERSE
Returns
int retVal : always 0
XColor RGBtoXCol ( COLOR  rgb)

Convcerts an RGB colour to XColor.

Parameters
rgbthe COLOR object
Returns
col the XColor equivalent