MiniGUI API Reference (MiniGUI-Standalone)  v5.0.0
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  uint32_t handle;
101 
107  int prime_fd;
108 
114  uint32_t name;
115 
120  uint32_t fb_id;
121 
123  uint32_t drm_format;
125  uint32_t bpp:8;
127  uint32_t cpp:8;
129  uint32_t dumb:1;
131  uint32_t scanout:1;
132 
134  uint32_t width;
136  uint32_t height;
138  uint32_t pitch;
139 
141  size_t size;
142 
148  off_t offset;
149 
157  uint8_t* buff;
159 
163 typedef struct _DrmDriverOps {
169  DrmDriver* (*create_driver) (int device_fd);
170 
176  void (*destroy_driver) (DrmDriver *driver);
177 
184  void (* flush_driver) (DrmDriver *driver);
185 
195  DrmSurfaceBuffer* (* create_buffer) (DrmDriver *driver,
196  uint32_t drm_format, uint32_t hdr_size,
197  uint32_t width, uint32_t height);
198 
209  DrmSurfaceBuffer* (* create_buffer_from_handle) (DrmDriver *driver,
210  uint32_t handle, size_t size);
211 
221  DrmSurfaceBuffer* (* create_buffer_from_name) (DrmDriver *driver,
222  uint32_t name);
223 
233  DrmSurfaceBuffer* (* create_buffer_from_prime_fd) (DrmDriver *driver,
234  int prime_fd, size_t size);
235 
247  uint8_t* (* map_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer,
248  int for_scanout);
249 
257  void (* unmap_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer);
258 
264  void (* destroy_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer);
265 
273  int (* clear_buffer) (DrmDriver *driver,
274  DrmSurfaceBuffer* dst_buf, const GAL_Rect* rc, uint32_t pixel_value);
275 
284  int (* check_blit) (DrmDriver *driver,
285  DrmSurfaceBuffer* src_buf, DrmSurfaceBuffer* dst_buf);
286 
295  int (* copy_blit) (DrmDriver *driver,
296  DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
297  DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
298  ColorLogicalOp logic_op);
299 
307  int (* alpha_blit) (DrmDriver *driver,
308  DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
309  DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
310  uint8_t alpha);
311 
319  int (* key_blit) (DrmDriver *driver,
320  DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
321  DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
322  uint32_t color_key);
323 
332  int (* alpha_key_blit) (DrmDriver *driver,
333  DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
334  DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
335  uint8_t alpha, uint32_t color_key);
336 
347  int (* alpha_pixel_blit) (DrmDriver *driver,
348  DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
349  DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
350  ColorBlendMethod blend_method);
351 
352 } DrmDriverOps;
353 
355 #define DRM_DRIVER_VERSION 1
356 
387 DrmDriverOps* __drm_ex_driver_get (const char* driver_name, int device_fd,
388  int* version);
389 
392 #endif /* _MGGAL_DRM */
393 
394 #ifdef _MGGAL_COMMLCD
395 
404 /* The pixel format defined by depth */
405 #define COMMLCD_PSEUDO_RGB332 1
406 #define COMMLCD_TRUE_RGB555 2
407 #define COMMLCD_TRUE_RGB565 3
408 #define COMMLCD_TRUE_RGB888 4
409 #define COMMLCD_TRUE_RGB0888 5
410 #define COMMLCD_TRUE_ARGB1555 6
411 #define COMMLCD_TRUE_ARGB8888 7
412 #define COMMLCD_TRUE_ABRG8888 8
413 
414 #define COMMLCD_UPDATE_NONE 0
415 #define COMMLCD_UPDATE_SYNC 1
416 #define COMMLCD_UPDATE_ASYNC 2
417 
421 struct commlcd_info {
423  int height;
424 
426  int width;
427 
429  int pitch;
430 
432  int bpp;
433 
445  int type;
446 
457 
462 };
463 
468 int __commlcd_drv_init (void);
469 
481 int __commlcd_drv_getinfo (struct commlcd_info *li,
482  int width, int height, int depth);
483 
489 int __commlcd_drv_release (void);
490 
504 int __commlcd_drv_setclut (int firstcolor, int ncolors, GAL_Color *colors);
505 
513 int __commlcd_drv_update (const RECT* rc_dirty);
514 
517 #endif /* _MGGAL_COMMLCD */
518 
519 #ifdef _MGIAL_COMM
520 
529 #define COMM_MOUSEINPUT 0x01
530 #define COMM_KBINPUT 0x02
531 
532 #define COMM_MOUSELBUTTON 0x01
533 #define COMM_MOUSERBUTTON 0x04
534 
539 int __comminput_init (void);
540 
551 int __comminput_ts_getdata (short *x, short *y, short *button);
552 
561 int __comminput_kb_getdata (short *key, short *status);
562 
575 int __comminput_wait_for_input (struct timeval *timeout);
576 
580 void __comminput_deinit (void);
581 
584 #endif /* _MGIAL_COMM */
585 
586 #ifdef __cplusplus
587 }
588 #endif /* __cplusplus */
589 
592 #endif /* GUI_EXSTUBS_H */
593 
int update_method
Definition: exstubs.h:456
uint32_t width
Definition: exstubs.h:134
uint32_t height
Definition: exstubs.h:136
int __commlcd_drv_init(void)
int __comminput_wait_for_input(struct timeval *timeout)
uint32_t drm_format
Definition: exstubs.h:123
Definition: common.h:936
uint32_t cpp
Definition: exstubs.h:127
ColorBlendMethod
Definition: gdi.h:5177
DrmDriverOps * __drm_ex_driver_get(const char *driver_name, int device_fd, int *version)
uint32_t dumb
Definition: exstubs.h:129
uint32_t name
Definition: exstubs.h:114
uint32_t handle
Definition: exstubs.h:100
int __comminput_init(void)
struct _DrmSurfaceBuffer DrmSurfaceBuffer
Uint8 * fb
Definition: exstubs.h:461
uint32_t pitch
Definition: exstubs.h:138
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:125
unsigned char Uint8
A type definition for an 8-bit unsigned character.
Definition: common.h:157
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)
uint32_t fb_id
Definition: exstubs.h:120
int height
Definition: exstubs.h:423
int __commlcd_drv_update(const RECT *rc_dirty)
ColorLogicalOp
Definition: gdi.h:5306
int __commlcd_drv_release(void)
uint8_t * buff
Definition: exstubs.h:157
uint32_t scanout
Definition: exstubs.h:131