20 #include <X11/keysym.h>
24 #include <X11/Xutil.h>
25 #include <X11/Xresource.h>
26 #include <X11/keysym.h>
47 #define MIN(a,b) (((a)<(b))?(a):(b))
48 #define MAX(a,b) (((a)>(b))?(a):(b))
50 #define LCD_MAX_LIST_ITEM MAX(1,(gLCDHandle->height/(gLCDHandle->fontHeight*2))-2)
53 #define LCD_WHITE getColor("white")
54 #define LCD_SILVER getColor("light gray")
55 #define LCD_LIGHTGRAY getColor("light gray")
56 #define LCD_LIGHTGREY getColor("light grey")
57 #define LCD_GRAY getColor("gray")
58 #define LCD_DARKGRAY getColor("dark gray")
59 #define LCD_DARKGREY getColor("dark grey")
60 #define LCD_BLACK getColor("black")
61 #define LCD_BLUE getColor("blue")
62 #define LCD_NAVY getColor("navy")
63 #define LCD_AQUA getColor("aquamarine")
64 #define LCD_CYAN getColor("cyan")
65 #define LCD_TEAL getColor("dark cyan")
66 #define LCD_FUCHSIA getColor("magenta")
67 #define LCD_MAGENTA getColor("magenta")
68 #define LCD_PURPLE getColor("purple")
69 #define LCD_RED getColor("red")
70 #define LCD_MAROON getColor("maroon")
71 #define LCD_YELLOW getColor("yellow")
72 #define LCD_OLIVE getColor("dark olive green")
73 #define LCD_LIME getColor("lime green")
74 #define LCD_GREEN getColor("green")
78 #define GREEN 0x00FF00
80 #define WHITE 0xFFFFFF
82 #define BLACK 0x000000
83 #define SILVER 0xC0C0C0
84 #define LIGHTGRAY 0xD3D3D3
85 #define DARKGRAY 0xA9A9A9
89 #define MAGENTA 0xFF00FF
90 #define PURPLE 0x800080
91 #define MAROON 0x800000
92 #define YELLOW 0xFFFF00
93 #define OLIVE 0x9ACD32
94 #define ORANGE 0xFFA500
97 #define LCD_BGCOL_TRANSPARENT 0x01
98 #define LCD_BGCOL_NOTRANSPARENT 0x10
100 #define LCD_BGCOL_INVERSE 0x02
101 #define LCD_BGCOL_NOINVERSE 0x20
103 #define LCD_FGCOL_INVERSE 0x04
104 #define LCD_FGCOL_NOINVERSE 0x40
107 #define LCD_AUTOREFRESH 0x0001
108 #define LCD_NOAUTOREFRESH 0x0100
110 #define LCD_SCROLLING 0x0002
111 #define LCD_NOSCROLLING 0x0200
113 #define LCD_LINEFEED 0x0004
114 #define LCD_NOLINEFEED 0x0400
116 #define LCD_SHOWMENU 0x0008
117 #define LCD_HIDEMENU 0x0800
119 #define LCD_LISTMENU 0x0010
120 #define LCD_CLASSICMENU 0x1000
122 #define LCD_FB_ROTATE 0x0080
123 #define LCD_FB_NOROTATION 0x8000
130 #define FONTDEFAULT "6x13"
131 #define FONTBOLD "6x13bold"
142 int LCDDrawFrame(
int x1,
int y1,
int x2,
int y2, XColor color);
154 int LCDMenu(
char *string1,
char *string2,
char *string3,
char *string4);
157 int LCDMenuIRaw(
int pos,
char *
string, XColor fgcol, XColor bgcol,
void* userp);
158 int LCDMenuI(
int pos,
char *
string, COLOR fg, COLOR bg);
174 int LCDAreaRaw(
int x1,
int y1,
int x2,
int y2, XColor color);
175 int LCDArea(
int x1,
int y1,
int x2,
int y2, COLOR col,
int fill);
178 int LCDPixel(
int x,
int y, COLOR col);
183 int LCDLineRaw(
int x1,
int y1,
int x2,
int y2, XColor color);
184 int LCDLine(
int x1,
int y1,
int x2,
int y2, COLOR col);
189 int LCDCircle(
int x1,
int y1,
int size, COLOR col,
int fill);
192 int LCDFrame(
int x1,
int y1,
int x2,
int y2, XColor color);
193 int LCDRect(
int x1,
int y1,
int x2,
int y2, COLOR col);
195 int LCDTextColor(XColor fgcol, XColor bgcol,
char colorflags);
200 int LCDSetPrintf(
int row,
int column,
const char *format, ...);
206 RECT LCDTextBar(
int row,
int column,
int length,
int fill, XColor color);
217 int LCDPutImageRGB(
int xpos,
int ypos,
int xsize,
int ysize, BYTE* data);
218 int LCDPutImageGrey(
int xpos,
int ypos,
int xsize,
int ysize, BYTE* data);
220 int LCDPutImageJPG(
int xpos,
int ypos,
int xsize,
int ysize,
char *path);
int LCDArea(int x1, int y1, int x2, int y2, COLOR col, int fill)
A wrapper for LCDAreaRaw.
Definition: lcd.c:623
int LCDTextColor(XColor fgcol, XColor bgcol, char colorflags)
Set the default color for text (including background) and related flags (e.g. for transparent backgro...
Definition: lcd.c:676
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.
Definition: lcd.c:1782
int LCDSetMode(HWORD mode)
Update the internal mode flag bits.
Definition: lcd.c:364
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 coor...
Definition: lcd.c:650
Defines types used for the EyeBot 7.
int LCDRect(int x1, int y1, int x2, int y2, COLOR col)
A wrapper for LCDDrawFrame.
Definition: lcd.c:76
int LCDLineRaw(int x1, int y1, int x2, int y2, XColor color)
Draw a color line from (x1,y1) to (x2,y2).
Definition: lcd.c:1277
int LCDDrawFrame(int x1, int y1, int x2, int y2, XColor color)
Draw a bordered frame.
Definition: lcd.c:56
int LCDSetFontSize(int fontsize)
Sets the font size.
Definition: lcd.c:808
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 ke...
Definition: lcd.c:458
int LCDGetFBInfo(FBINFO *pinfo)
Get display information and save to structure pointed by pinfo. Cursor info needs LCDInit() for texts...
Definition: lcd.c:1522
Structure defining the Framebuffer info for the LCD.
Definition: types.h:138
Structure defining a menu item.
Definition: types.h:222
Structure defining a menu.
Definition: types.h:232
int LCDSetPos(int row, int column)
Set the text cursor position to (row, column).
Definition: lcd.c:1085
int LCDList(LIST_MENU *menulist)
Setup the list menu display and update appropriate info in the LIST_MENU structure pointed by menulis...
Definition: lcd.c:516
int LCDImageStart(int t, int x, int y, int xs, int ys)
Sets the parameters for subsequent image draws.
Definition: lcd.c:1811
XColor LCDGetPixel(int x, int y)
Get the RGB color value of the pixel at (x,y) coordinate.
Definition: lcd.c:1156
int LCDPrintf(const char *format,...)
Print formatted string to LCD and refresh LCD. Cursor position is updated.
Definition: lcd.c:896
Header file for global variables.
int LCDSetPixel(int x, int y, XColor color)
Sets the color of the pixel at (x,y) coordinate to color.
Definition: lcd.c:1120
int LCDImageGray(BYTE *g)
Draws a grey image to the LCD.
Definition: lcd.c:1845
int LCDInit()
Initialize the LCD.
Definition: lcd.c:216
int LCDDrawList(void)
Draw the list.
Definition: lcd.c:146
int LCDLine(int x1, int y1, int x2, int y2, COLOR col)
A wrapper for LCDLineRaw.
Definition: lcd.c:1297
Structure defining a LCD fontcolour/name.
Definition: types.h:435
int LCDNeedRefresh(void)
Indicate if the LCD need to be refreshed.
Definition: lcd.c:1400
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...
Definition: lcd.c:1316
int LCDResetMode(HWORD mode)
Reset the internal mode flag bits to a previously saved mode.
Definition: lcd.c:410
int LCDListScrollUp(void)
Scrolls the list display up. Menu index is not altered. If the active menu item goes out of focus...
Definition: lcd.c:1575
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...
Definition: lcd.c:1341
int LCDCircleInvert(int x1, int y1, int size)
Inverts the pixels inside of the given circle.
Definition: lcd.c:1251
int LCDPixelInvert(int x, int y)
Bit-invert the color of the pixel at (x,y) coordinate.
Definition: lcd.c:1207
int LCDSetFont(int font, int variation)
Sets the font using fontName and variation.
Definition: lcd.c:739
int LCDGetPos(int *row, int *column)
Get the text cursor position.
Definition: lcd.c:1102
int LCDImage(BYTE *img)
Draws a colour (RGB) image to the LCD.
Definition: lcd.c:1830
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.
Definition: lcd.c:1545
int LCDRefresh(void)
Refresh the screen (i.e write display buffers to the framebuffer device). Refreshes the menu...
Definition: lcd.c:1460
MENU_ITEM * LCDMenuItem(int index)
Return the menuitem at a given position.
Definition: lcd.c:501
int LCDDrawMenu(void)
Draw the menu.
Definition: lcd.c:93
LIST_MENU * LCDGetList(void)
Get the currently active list menu.
Definition: lcd.c:551
int LCDSetPrintfFont(int row, int column, EYEFONT eyeFont, const char *format,...)
LCDPrintf with text position and text colour specified.
Definition: lcd.c:1029
int LCDListIndex(int index)
Set the list index.
Definition: lcd.c:1559
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.
Definition: lcd.c:584
int LCDPixel(int x, int y, COLOR col)
A wrapper for LCDSet Pixel.
Definition: lcd.c:1138
int LCDRelease()
Release the LCD.
Definition: lcd.c:1437
int LCDSetFontRaw(char *fontAlias)
Sets the font using alias in Xlib.
Definition: lcd.c:714
int LCDClear(void)
Clear the LCD display and all display buffers ie. turn it black.
Definition: lcd.c:345
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).
Definition: lcd.c:1369
Header file for system functions.
int LCDGetSize(int *x, int *y)
Get LCD resolution in pixels.
Definition: lcd.c:1859
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.
Definition: lcd.c:1738
int LCDSetList(LIST_MENU *menulist)
Unlike LCDList(), this will blindly assign menulist to the mainlist for display. Doesn't update anyth...
Definition: lcd.c:535
RECT * LCDListBox(int pos)
Get the frame info of a specific list item in form of a RECT structure.
Definition: lcd.c:565
HWORD LCDGetMode(void)
Get the internal mode flag bits.
Definition: lcd.c:395
Structure representing a rectangle.
Definition: types.h:277
int LCDSetColor(COLOR fg, COLOR bg)
A wrapper for LCDTextColor.
Definition: lcd.c:695
Header file for the key functions.
int LCDPrintfFont(EYEFONT eyeFont, const char *format,...)
Print formatted string to LCD and refresh LCD. Cursor position is updated.
Definition: lcd.c:833
int LCDMenuI(int pos, char *string, COLOR fg, COLOR bg)
A wrapper for LCDMenuIRaw.
Definition: lcd.c:481
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...
Definition: lcd.c:430
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 coo...
Definition: lcd.c:603
int LCDSetPrintf(int row, int column, const char *format,...)
LCDPrintf with text position specified.
Definition: lcd.c:965
int LCDListScrollDown(void)
Scrolls the list display down. Menu index is not altered. If the active menu item goes out of focus...
Definition: lcd.c:1599
XColor InvertColor(XColor color)
Invert a RGB color.
Definition: lcd.c:1187
XColor getColor(char *colorName)
Return the XColor color from the color name.
Definition: lcd.c:26
int LCDCircle(int x1, int y1, int size, COLOR col, int fill)
Draws a circle.
Definition: lcd.c:1226