MiniGUI API Reference (MiniGUI-Processes)  v4.0.7
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 
165 typedef enum {
194 
195  COLOR_BLEND_PD_FIRST = COLOR_BLEND_PD_SRC_OVER,
196  COLOR_BLEND_PD_LAST = COLOR_BLEND_PD_MODULATE,
197 
258 
259  COLOR_BLEND_SP_FIRST = COLOR_BLEND_SP_NORMAL,
260  COLOR_BLEND_SP_LAST = COLOR_BLEND_SP_EXCLUSION,
261 
286 
287  COLOR_BLEND_NS_FIRST = COLOR_BLEND_NS_HUE,
288  COLOR_BLEND_NS_LAST = COLOR_BLEND_NS_LUMINOSITY,
290 
294 typedef enum {
295  COLOR_LOGICOP_CLEAR = 0,
296  COLOR_LOGICOP_NOR,
297  COLOR_LOGICOP_AND_INVERTED,
298  COLOR_LOGICOP_COPY_INVERTED,
299  COLOR_LOGICOP_AND_REVERSE,
300  COLOR_LOGICOP_INVERT,
301  COLOR_LOGICOP_XOR,
302  COLOR_LOGICOP_NAND,
303  COLOR_LOGICOP_AND,
304  COLOR_LOGICOP_EQUIV,
305  COLOR_LOGICOP_NOOP0,
306  COLOR_LOGICOP_OR_INVERTED1,
307  COLOR_LOGICOP_COPY,
308  COLOR_LOGICOP_OR_REVERSE,
309  COLOR_LOGICOP_OR,
310  COLOR_LOGICOP_SET,
312 
316 typedef struct _DrmDriverOps {
322  DrmDriver* (*create_driver) (int device_fd);
323 
329  void (*destroy_driver) (DrmDriver *driver);
330 
337  void (* flush_driver) (DrmDriver *driver);
338 
348  DrmSurfaceBuffer* (* create_buffer) (DrmDriver *driver,
349  uint32_t drm_format, uint32_t hdr_size,
350  uint32_t width, uint32_t height);
351 
362  DrmSurfaceBuffer* (* create_buffer_from_handle) (DrmDriver *driver,
363  uint32_t handle, size_t size);
364 
374  DrmSurfaceBuffer* (* create_buffer_from_name) (DrmDriver *driver,
375  uint32_t name);
376 
386  DrmSurfaceBuffer* (* create_buffer_from_prime_fd) (DrmDriver *driver,
387  int prime_fd, size_t size);
388 
400  uint8_t* (* map_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer,
401  int for_scanout);
402 
410  void (* unmap_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer);
411 
417  void (* destroy_buffer) (DrmDriver *driver, DrmSurfaceBuffer* buffer);
418 
426  int (* clear_buffer) (DrmDriver *driver,
427  DrmSurfaceBuffer* dst_buf, const GAL_Rect* rc, uint32_t pixel_value);
428 
437  int (* check_blit) (DrmDriver *driver,
438  DrmSurfaceBuffer* src_buf, DrmSurfaceBuffer* dst_buf);
439 
448  int (* copy_blit) (DrmDriver *driver,
449  DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
450  DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
451  ColorLogicalOp logic_op);
452 
460  int (* alpha_blit) (DrmDriver *driver,
461  DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
462  DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
463  uint8_t alpha);
464 
472  int (* key_blit) (DrmDriver *driver,
473  DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
474  DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
475  uint32_t color_key);
476 
485  int (* alpha_key_blit) (DrmDriver *driver,
486  DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
487  DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
488  uint8_t alpha, uint32_t color_key);
489 
500  int (* alpha_pixel_blit) (DrmDriver *driver,
501  DrmSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
502  DrmSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
503  ColorBlendMethod blend_method);
504 
505 } DrmDriverOps;
506 
508 #define DRM_DRIVER_VERSION 1
509 
540 DrmDriverOps* __drm_ex_driver_get (const char* driver_name, int device_fd,
541  int* version);
542 
545 #endif /* _MGGAL_DRM */
546 
547 #ifdef _MGGAL_COMMLCD
548 
557 /* The pixel format defined by depth */
558 #define COMMLCD_PSEUDO_RGB332 1
559 #define COMMLCD_TRUE_RGB555 2
560 #define COMMLCD_TRUE_RGB565 3
561 #define COMMLCD_TRUE_RGB888 4
562 #define COMMLCD_TRUE_RGB0888 5
563 #define COMMLCD_TRUE_ARGB1555 6
564 #define COMMLCD_TRUE_ARGB8888 7
565 #define COMMLCD_TRUE_ABRG8888 8
566 
567 #define COMMLCD_UPDATE_NONE 0
568 #define COMMLCD_UPDATE_SYNC 1
569 #define COMMLCD_UPDATE_ASYNC 2
570 
574 struct commlcd_info {
576  int height;
577 
579  int width;
580 
582  int pitch;
583 
585  int bpp;
586 
598  int type;
599 
610 
615 };
616 
621 int __commlcd_drv_init (void);
622 
634 int __commlcd_drv_getinfo (struct commlcd_info *li,
635  int width, int height, int depth);
636 
642 int __commlcd_drv_release (void);
643 
657 int __commlcd_drv_setclut (int firstcolor, int ncolors, GAL_Color *colors);
658 
666 int __commlcd_drv_update (const RECT* rc_dirty);
667 
670 #endif /* _MGGAL_COMMLCD */
671 
672 #ifdef _MGIAL_COMM
673 
682 #define COMM_MOUSEINPUT 0x01
683 #define COMM_KBINPUT 0x02
684 
685 #define COMM_MOUSELBUTTON 0x01
686 #define COMM_MOUSERBUTTON 0x04
687 
692 int __comminput_init (void);
693 
704 int __comminput_ts_getdata (short *x, short *y, short *button);
705 
714 int __comminput_kb_getdata (short *key, short *status);
715 
728 int __comminput_wait_for_input (struct timeval *timeout);
729 
733 void __comminput_deinit (void);
734 
737 #endif /* _MGIAL_COMM */
738 
739 #ifdef __cplusplus
740 }
741 #endif /* __cplusplus */
742 
745 #endif /* GUI_EXSTUBS_H */
746 
int update_method
Definition: exstubs.h:609
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:926
uint32_t cpp
Definition: exstubs.h:127
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:614
uint32_t pitch
Definition: exstubs.h:138
int __commlcd_drv_setclut(int firstcolor, int ncolors, GAL_Color *colors)
struct _DrmDriverOps DrmDriverOps
ColorLogicalOp
Definition: exstubs.h:294
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:154
ColorBlendMethod
Definition: exstubs.h:165
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:576
int __commlcd_drv_update(const RECT *rc_dirty)
int __commlcd_drv_release(void)
uint8_t * buff
Definition: exstubs.h:157
uint32_t scanout
Definition: exstubs.h:131