MiniGUI API Reference (MiniGUI-Threads)  v5.0.6
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 
_DrmDriverOps::alpha_pixel_blit
int(* alpha_pixel_blit)(DrmDriver *driver, DrmSurfaceBuffer *src_buf, const GAL_Rect *src_rc, DrmSurfaceBuffer *dst_buf, const GAL_Rect *dst_rc, ColorBlendMethod blend_method)
Definition: exstubs.h:347
__comminput_kb_getdata
int __comminput_kb_getdata(short *key, short *status)
_DrmDriverOps::alpha_blit
int(* alpha_blit)(DrmDriver *driver, DrmSurfaceBuffer *src_buf, const GAL_Rect *src_rc, DrmSurfaceBuffer *dst_buf, const GAL_Rect *dst_rc, uint8_t alpha)
Definition: exstubs.h:307
_GAL_Rect
Definition: common.h:1163
_DrmDriverOps::check_blit
int(* check_blit)(DrmDriver *driver, DrmSurfaceBuffer *src_buf, DrmSurfaceBuffer *dst_buf)
Definition: exstubs.h:284
_DrmDriverOps
Definition: exstubs.h:163
_DrmSurfaceBuffer::prime_fd
int prime_fd
Definition: exstubs.h:107
commlcd_info::update_method
int update_method
Definition: exstubs.h:456
_DrmDriverOps::destroy_buffer
void(* destroy_buffer)(DrmDriver *driver, DrmSurfaceBuffer *buffer)
Definition: exstubs.h:264
_DrmDriverOps::unmap_buffer
void(* unmap_buffer)(DrmDriver *driver, DrmSurfaceBuffer *buffer)
Definition: exstubs.h:257
_DrmSurfaceBuffer::bpp
uint32_t bpp
Definition: exstubs.h:125
_DrmSurfaceBuffer::cpp
uint32_t cpp
Definition: exstubs.h:127
_DrmSurfaceBuffer::size
size_t size
Definition: exstubs.h:141
_RECT
Definition: common.h:936
ColorBlendMethod
ColorBlendMethod
Definition: gdi.h:5171
__drm_ex_driver_get
DrmDriverOps * __drm_ex_driver_get(const char *driver_name, int device_fd, int *version)
commlcd_info::pitch
int pitch
Definition: exstubs.h:429
__commlcd_drv_getinfo
int __commlcd_drv_getinfo(struct commlcd_info *li, int width, int height, int depth)
_DrmSurfaceBuffer::buff
uint8_t * buff
Definition: exstubs.h:157
_DrmSurfaceBuffer::height
uint32_t height
Definition: exstubs.h:136
commlcd_info::fb
Uint8 * fb
Definition: exstubs.h:461
Uint8
unsigned char Uint8
A type definition for an 8-bit unsigned character.
Definition: common.h:157
DrmDriverOps
struct _DrmDriverOps DrmDriverOps
_DrmSurfaceBuffer::dumb
uint32_t dumb
Definition: exstubs.h:129
commlcd_info::width
int width
Definition: exstubs.h:426
__commlcd_drv_update
int __commlcd_drv_update(const RECT *rc_dirty)
__commlcd_drv_setclut
int __commlcd_drv_setclut(int firstcolor, int ncolors, GAL_Color *colors)
__comminput_ts_getdata
int __comminput_ts_getdata(short *x, short *y, short *button)
_DrmDriverOps::key_blit
int(* key_blit)(DrmDriver *driver, DrmSurfaceBuffer *src_buf, const GAL_Rect *src_rc, DrmSurfaceBuffer *dst_buf, const GAL_Rect *dst_rc, uint32_t color_key)
Definition: exstubs.h:319
_DrmSurfaceBuffer::offset
off_t offset
Definition: exstubs.h:148
_DrmSurfaceBuffer::scanout
uint32_t scanout
Definition: exstubs.h:131
commlcd_info::height
int height
Definition: exstubs.h:423
_GAL_Color
Definition: common.h:1123
__comminput_init
int __comminput_init(void)
_DrmDriverOps::clear_buffer
int(* clear_buffer)(DrmDriver *driver, DrmSurfaceBuffer *dst_buf, const GAL_Rect *rc, uint32_t pixel_value)
Definition: exstubs.h:273
_DrmSurfaceBuffer::fb_id
uint32_t fb_id
Definition: exstubs.h:120
_DrmDriverOps::flush_driver
void(* flush_driver)(DrmDriver *driver)
Definition: exstubs.h:184
commlcd_info::bpp
int bpp
Definition: exstubs.h:432
_DrmSurfaceBuffer::drm_format
uint32_t drm_format
Definition: exstubs.h:123
_DrmDriverOps::destroy_driver
void(* destroy_driver)(DrmDriver *driver)
Definition: exstubs.h:176
_DrmSurfaceBuffer::width
uint32_t width
Definition: exstubs.h:134
commlcd_info::type
int type
Definition: exstubs.h:445
_DrmSurfaceBuffer
Definition: exstubs.h:98
__comminput_wait_for_input
int __comminput_wait_for_input(struct timeval *timeout)
DrmSurfaceBuffer
struct _DrmSurfaceBuffer DrmSurfaceBuffer
commlcd_info
Definition: exstubs.h:421
__commlcd_drv_release
int __commlcd_drv_release(void)
__commlcd_drv_init
int __commlcd_drv_init(void)
_DrmSurfaceBuffer::name
uint32_t name
Definition: exstubs.h:114
__comminput_deinit
void __comminput_deinit(void)
_DrmSurfaceBuffer::pitch
uint32_t pitch
Definition: exstubs.h:138
_DrmDriverOps::copy_blit
int(* copy_blit)(DrmDriver *driver, DrmSurfaceBuffer *src_buf, const GAL_Rect *src_rc, DrmSurfaceBuffer *dst_buf, const GAL_Rect *dst_rc, ColorLogicalOp logic_op)
Definition: exstubs.h:295
_DrmDriverOps::alpha_key_blit
int(* alpha_key_blit)(DrmDriver *driver, DrmSurfaceBuffer *src_buf, const GAL_Rect *src_rc, DrmSurfaceBuffer *dst_buf, const GAL_Rect *dst_rc, uint8_t alpha, uint32_t color_key)
Definition: exstubs.h:332
ColorLogicalOp
ColorLogicalOp
Definition: gdi.h:5310
_DrmSurfaceBuffer::handle
uint32_t handle
Definition: exstubs.h:100