... | ... | @@ -166,7 +166,7 @@ The arguments of this function have the following meanings: |
|
|
|
|
|
`GAL_Color` is a structure defined in MiniGUI header:
|
|
|
|
|
|
```
|
|
|
```C
|
|
|
typedef struct _GAL_Color
|
|
|
{
|
|
|
/**
|
... | ... | @@ -197,7 +197,7 @@ be called frequently or periodically. |
|
|
In our sample, this method saves the whole frame buffer content to Windows
|
|
|
bitmap files by calling MiniGUI function:
|
|
|
|
|
|
```
|
|
|
```C
|
|
|
int __commlcd_drv_update (const RECT* rc_dirty)
|
|
|
{
|
|
|
char filename [PATH_MAX + 1];
|
... | ... | @@ -269,7 +269,7 @@ the resource allocated or created by the engine. |
|
|
|
|
|
In our sample, it destroys the anonymous memory map and returns zero:
|
|
|
|
|
|
```
|
|
|
```C
|
|
|
int __commlcd_drv_release (void)
|
|
|
{
|
|
|
munmap (sg_fb, FB_SIZE);
|
... | ... | @@ -286,7 +286,7 @@ MiniGUI will call `__comminput_init` function to initialize the engine. |
|
|
|
|
|
You can open your input devices in the function:
|
|
|
|
|
|
```
|
|
|
```C
|
|
|
#define POWER_EVENT_DEV "/dev/input/event0"
|
|
|
#define KB_EVENT_DEV "/dev/input/event1"
|
|
|
#define TP_EVENT_DEV "/dev/input/event5"
|
... | ... | @@ -359,7 +359,7 @@ and/or a keyboard event. The sample implementation of `__comminput_wait_for_inpu |
|
|
uses the system call `select` to check the file descriptors opened by
|
|
|
`__comminput_init`, and return a suitable value to MiniGUI:
|
|
|
|
|
|
```
|
|
|
```C
|
|
|
int __comminput_wait_for_input (struct timeval *timeout)
|
|
|
{
|
|
|
fd_set rfds;
|
... | ... | @@ -402,7 +402,7 @@ If there is a keyboard event (the return value of `__comminput_wait_for_input` |
|
|
has the bit `COMM_KBINPUT` set), MiniGUI will call `__comminput_kb_getdata`
|
|
|
immediately to get the real keyboard event data:
|
|
|
|
|
|
```
|
|
|
```C
|
|
|
int __comminput_kb_getdata (short *key, short *status)
|
|
|
{
|
|
|
...
|
... | ... | @@ -423,7 +423,7 @@ If there is a mouse event (the return value of `__comminput_wait_for_input` |
|
|
has the bit `COMM_MOUSEINPUT` set), MiniGUI will call `__comminput_ts_getdata`
|
|
|
immediately to get the real keyboard event data:
|
|
|
|
|
|
```
|
|
|
```C
|
|
|
int __comminput_ts_getdata (short *x, short *y, short *button)
|
|
|
{
|
|
|
...
|
... | ... | @@ -445,7 +445,7 @@ the resource allocated or created by the Comm IAL engine. |
|
|
|
|
|
In our sample, it just closes the file descriptors:
|
|
|
|
|
|
```
|
|
|
```C
|
|
|
void __comminput_deinit (void)
|
|
|
{
|
|
|
close (sg_tp_event_fd);
|
... | ... | |