Welcome to the EyeBot  Version 7 - RPi1
A Controller For Various Hardware IO
Macros | Functions | Variables
lcd.h File Reference

Header file for the LCD functions. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <X11/Xlib.h>
#include <X11/keysym.h>
#include <jpeglib.h>
#include <jerror.h>
#include <X11/Xutil.h>
#include <X11/Xresource.h>
#include "types.h"
#include <stdarg.h>
#include "system.h"
#include "globals.h"
#include "key.h"
#include "listmenu.h"
#include <math.h>

Go to the source code of this file.

Macros

#define _GNU_SOURCE
 
#define HELVETICA   0
 
#define TIMES   1
 
#define COURIER   2
 
#define NORMAL   0
 
#define BOLD   1
 
#define ITALICS   2
 
#define MIN(a, b)   (((a)<(b))?(a):(b))
 
#define MAX(a, b)   (((a)>(b))?(a):(b))
 
#define LCD_MAX_LIST_ITEM   MAX(1,(gLCDHandle->height/(gLCDHandle->fontHeight*2))-2)
 
#define LCD_WHITE   getColor("white")
 
#define LCD_SILVER   getColor("light gray")
 
#define LCD_LIGHTGRAY   getColor("light gray")
 
#define LCD_LIGHTGREY   getColor("light grey")
 
#define LCD_GRAY   getColor("gray")
 
#define LCD_DARKGRAY   getColor("dark gray")
 
#define LCD_DARKGREY   getColor("dark grey")
 
#define LCD_BLACK   getColor("black")
 
#define LCD_BLUE   getColor("blue")
 
#define LCD_NAVY   getColor("navy")
 
#define LCD_AQUA   getColor("aquamarine")
 
#define LCD_CYAN   getColor("cyan")
 
#define LCD_TEAL   getColor("dark cyan")
 
#define LCD_FUCHSIA   getColor("magenta")
 
#define LCD_MAGENTA   getColor("magenta")
 
#define LCD_PURPLE   getColor("purple")
 
#define LCD_RED   getColor("red")
 
#define LCD_MAROON   getColor("maroon")
 
#define LCD_YELLOW   getColor("yellow")
 
#define LCD_OLIVE   getColor("dark olive green")
 
#define LCD_LIME   getColor("lime green")
 
#define LCD_GREEN   getColor("green")
 
#define RED   0xFF00000
 
#define GREEN   0x00FF00
 
#define BLUE   0x0000FF
 
#define WHITE   0xFFFFFF
 
#define GRAY   0x808080
 
#define BLACK   0x000000
 
#define SILVER   0xC0C0C0
 
#define LIGHTGRAY   0xD3D3D3
 
#define DARKGRAY   0xA9A9A9
 
#define NAVY   0x000080
 
#define CYAN   0x00EEEE
 
#define TEAL   0x008080
 
#define MAGENTA   0xFF00FF
 
#define PURPLE   0x800080
 
#define MAROON   0x800000
 
#define YELLOW   0xFFFF00
 
#define OLIVE   0x9ACD32
 
#define ORANGE   0xFFA500
 
#define LCD_BGCOL_TRANSPARENT   0x01
 
#define LCD_BGCOL_NOTRANSPARENT   0x10
 
#define LCD_BGCOL_INVERSE   0x02
 
#define LCD_BGCOL_NOINVERSE   0x20
 
#define LCD_FGCOL_INVERSE   0x04
 
#define LCD_FGCOL_NOINVERSE   0x40
 
#define LCD_AUTOREFRESH   0x0001
 
#define LCD_NOAUTOREFRESH   0x0100
 
#define LCD_SCROLLING   0x0002
 
#define LCD_NOSCROLLING   0x0200
 
#define LCD_LINEFEED   0x0004
 
#define LCD_NOLINEFEED   0x0400
 
#define LCD_SHOWMENU   0x0008
 
#define LCD_HIDEMENU   0x0800
 
#define LCD_LISTMENU   0x0010
 
#define LCD_CLASSICMENU   0x1000
 
#define LCD_FB_ROTATE   0x0080
 
#define LCD_FB_NOROTATION   0x8000
 
#define FONTDEFAULT   "6x13"
 
#define FONTBOLD   "6x13bold"
 

Functions

int LCDDrawFrame (int x1, int y1, int x2, int y2, XColor color)
 Draw a bordered frame. 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...
 
XColor getColor (char *colorName)
 Return the XColor color from the color name. More...
 
XColor InvertColor (XColor color)
 Invert a RGB color. More...
 
int LCDNeedRefresh (void)
 Indicate if the LCD need to be refreshed. 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 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...
 
int LCDPixelInvert (int x, int y)
 Bit-invert the color of the pixel at (x,y) coordinate. 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...
 
int LCDCircle (int x1, int y1, int size, COLOR col, int fill)
 Draws a circle. More...
 
int LCDCircleInvert (int x1, int y1, int size)
 Inverts the pixels inside of the given circle. 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 LCDRect (int x1, int y1, int x2, int y2, COLOR col)
 A wrapper for LCDDrawFrame. 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 LCDPrintf (const char *format,...)
 Print formatted string to LCD and refresh LCD. Cursor position is updated. More...
 
int LCDPrintfFont (EYEFONT eyeFont, 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...
 
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 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 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 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 LCDPutImageGrey (int xpos, int ypos, int xsize, int ysize, BYTE *data)
 Place a Grey image (24bpp) at (xpos,ypos) position on the LCD screen. More...
 
int LCDPutImageJPG (int xpos, int ypos, int xsize, int ysize, char *path)
 
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 *g)
 Draws a grey image to the LCD. More...
 
int LCDSetFontRaw (char *fontAlias)
 Sets the font using alias in Xlib. More...
 
int LCDSetFont (int font, int variation)
 Sets the font using fontName and variation. More...
 
int LCDSetFontSize (int fontsize)
 Sets the font size. More...
 
int LCDGetSize (int *x, int *y)
 Get LCD resolution in pixels. More...
 

Variables

int LCD_INITIAL
 
int IM_TYPE
 
int IM_LEFT
 
int IM_TOP
 
int IM_WIDTH
 
int IM_LENGTH
 

Detailed Description

Header file for the LCD functions.

Author
Marcus Pham & Remi KEAT Using some functions by George Peter Staplin 2003 Georg.nosp@m.ePS@.nosp@m.XMiss.nosp@m.ion..nosp@m.com

Function Documentation

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