MiniGUI API Reference (MiniGUI-Processes)  v4.0.4
A mature and proven cross-platform GUI system for embedded and smart IoT devices
exstubs.h
Go to the documentation of this file.
1 //
3 // IMPORTANT NOTICE
4 //
5 // The following open source license statement does not apply to any
6 // entity in the Exception List published by FMSoft.
7 //
8 // For more information, please visit:
9 //
10 // https://www.fmsoft.cn/exception-list
11 //
13 
57 /*
58  * MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks,
59  * pSOS, ThreadX, NuCleus, OSE, and Win32.
60  */
61 
62 #ifndef GUI_EXSTUBS_H
63  #define GUI_EXSTUBS_H
64 
65 #include <stdint.h>
66 
75 #ifdef __cplusplus
76 extern "C" {
77 #endif /* __cplusplus */
78 
79 #ifdef _MGGAL_DRM
80 
91 struct _DrmDriver;
92 typedef struct _DrmDriver DrmDriver;
93 
98 typedef struct _DrmSurfaceBuffer {
100  int prime_fd;
102  uint32_t name;
104  uint32_t handle;
106  uint32_t id;
108  uint32_t width;
110  uint32_t height;
112  uint32_t pitch;
114  uint32_t drm_format;
115 
117  uint32_t bpp:8;
119  uint32_t cpp:8;
121  uint32_t foreign:1;
122 
124  unsigned long size;
126  uint8_t* pixels;
128 
133  COLOR_LOGICOP_CLEAR = 0,
134  COLOR_LOGICOP_NOR = 1,
135  COLOR_LOGICOP_AND_INVERTED = 2,
136  COLOR_LOGICOP_COPY_INVERTED = 3,
137  COLOR_LOGICOP_AND_REVERSE = 4,
138  COLOR_LOGICOP_INVERT = 5,
139  COLOR_LOGICOP_XOR = 6,
140  COLOR_LOGICOP_NAND = 7,
141  COLOR_LOGICOP_AND = 8,
142  COLOR_LOGICOP_EQUIV = 9,
143  COLOR_LOGICOP_NOOP = 10,
144  COLOR_LOGICOP_OR_INVERTED = 11,
145  COLOR_LOGICOP_COPY = 12,
146  COLOR_LOGICOP_OR_REVERSE = 13,
147  COLOR_LOGICOP_OR = 14,
148  COLOR_LOGICOP_SET = 15
149 };
150 
154 typedef struct _DrmDriverOps {
160  DrmDriver* (*create_driver) (int device_fd);
161 
167  void (*destroy_driver) (DrmDriver *driver);
168 
174  void (* flush_driver) (DrmDriver *driver);
175 
184  DrmSurfaceBuffer* (* create_buffer) (DrmDriver *driver,
185  uint32_t drm_format,
186  unsigned int width, unsigned int height);
187 
195  DrmSurfaceBuffer* (* create_buffer_from_handle) (DrmDriver *driver,
196  uint32_t handle, unsigned long size, uint32_t drm_format,
197  unsigned int width, unsigned int height, unsigned int pitch);
198 
206  DrmSurfaceBuffer* (* create_buffer_from_name) (DrmDriver *driver,
207  uint32_t name, uint32_t drm_format,
208  unsigned int width, unsigned int height, unsigned int pitch);
209 
217  DrmSurfaceBuffer* (* create_buffer_from_prime_fd) (DrmDriver *driver,
218  int prime_fd, unsigned long size, uint32_t drm_format,
219  unsigned int width, unsigned int height, unsigned int pitch);
220 
227  uint8_t* (* map_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer);
228 
234  void (* unmap_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer);
235 
241  void (* destroy_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer);
242 
250  int (* clear_buffer) (DrmDriver *driver,
251  DrmSurfaceBuffer* dst_buf, const GAL_Rect* rc, uint32_t pixel_value);
252 
261  int (* check_blit) (DrmDriver *driver,
262  DrmSurfaceBuffer* src_buf, DrmSurfaceBuffer* dst_buf);
263 
270  int (* copy_blit) (DrmDriver *driver,
271  DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
272  DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
273  enum DrmColorLogicOp logic_op);
274 
282  int (* alpha_blit) (DrmDriver *driver,
283  DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
284  DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc, uint8_t alpha);
285 
293  int (* key_blit) (DrmDriver *driver,
294  DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
295  DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc, uint32_t color_key);
296 
304  int (* alpha_key_blit) (DrmDriver *driver,
305  DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
306  DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
307  uint8_t alpha, uint32_t color_key);
308 
309 } DrmDriverOps;
310 
312 DrmDriverOps* __drm_ex_driver_get (const char* driver_name, int device_fd);
313 
316 #endif /* _MGGAL_DRM */
317 
318 #ifdef _MGGAL_COMMLCD
319 
328 /* The pixel format defined by depth */
329 #define COMMLCD_PSEUDO_RGB332 1
330 #define COMMLCD_TRUE_RGB555 2
331 #define COMMLCD_TRUE_RGB565 3
332 #define COMMLCD_TRUE_RGB888 4
333 #define COMMLCD_TRUE_RGB0888 5
334 #define COMMLCD_TRUE_ARGB1555 6
335 #define COMMLCD_TRUE_ARGB8888 7
336 #define COMMLCD_TRUE_ABRG8888 8
337 
338 #define COMMLCD_UPDATE_NONE 0
339 #define COMMLCD_UPDATE_SYNC 1
340 #define COMMLCD_UPDATE_ASYNC 2
341 
345 struct commlcd_info {
347  int height;
348 
350  int width;
351 
353  int pitch;
354 
356  int bpp;
357 
369  int type;
370 
381 
386 };
387 
392 int __commlcd_drv_init (void);
393 
405 int __commlcd_drv_getinfo (struct commlcd_info *li,
406  int width, int height, int depth);
407 
413 int __commlcd_drv_release (void);
414 
428 int __commlcd_drv_setclut (int firstcolor, int ncolors, GAL_Color *colors);
429 
437 int __commlcd_drv_update (const RECT* rc_dirty);
438 
441 #endif /* _MGGAL_COMMLCD */
442 
443 #ifdef _MGIAL_COMM
444 
453 #define COMM_MOUSEINPUT 0x01
454 #define COMM_KBINPUT 0x02
455 
456 #define COMM_MOUSELBUTTON 0x01
457 #define COMM_MOUSERBUTTON 0x04
458 
463 int __comminput_init (void);
464 
475 int __comminput_ts_getdata (short *x, short *y, short *button);
476 
485 int __comminput_kb_getdata (short *key, short *status);
486 
499 int __comminput_wait_for_input (struct timeval *timeout);
500 
504 void __comminput_deinit (void);
505 
508 #endif /* _MGIAL_COMM */
509 
510 #ifdef __cplusplus
511 }
512 #endif /* __cplusplus */
513 
516 #endif /* GUI_EXSTUBS_H */
517 
int update_method
Definition: exstubs.h:380
uint32_t foreign
Definition: exstubs.h:121
uint32_t width
Definition: exstubs.h:108
unsigned long size
Definition: exstubs.h:124
uint32_t height
Definition: exstubs.h:110
int __commlcd_drv_init(void)
DrmColorLogicOp
Definition: exstubs.h:132
int __comminput_wait_for_input(struct timeval *timeout)
uint32_t drm_format
Definition: exstubs.h:114
Definition: common.h:926
uint32_t cpp
Definition: exstubs.h:119
uint32_t name
Definition: exstubs.h:102
uint32_t handle
Definition: exstubs.h:104
uint8_t * pixels
Definition: exstubs.h:126
int __comminput_init(void)
struct _DrmSurfaceBuffer DrmSurfaceBuffer
Uint8 * fb
Definition: exstubs.h:385
uint32_t pitch
Definition: exstubs.h:112
int __commlcd_drv_setclut(int firstcolor, int ncolors, GAL_Color *colors)
struct _DrmDriverOps DrmDriverOps
int __comminput_kb_getdata(short *key, short *status)
uint32_t bpp
Definition: exstubs.h:117
unsigned char Uint8
A type definition for an 8-bit unsigned character.
Definition: common.h:154
DrmDriverOps * __drm_ex_driver_get(const char *driver_name, int device_fd)
void __comminput_deinit(void)
int __commlcd_drv_getinfo(struct commlcd_info *li, int width, int height, int depth)
int __comminput_ts_getdata(short *x, short *y, short *button)
int height
Definition: exstubs.h:347
int __commlcd_drv_update(const RECT *rc_dirty)
int __commlcd_drv_release(void)
uint32_t id
Definition: exstubs.h:106