MiniGUI API Reference (MiniGUI-Standalone)  v4.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 
73 #ifdef __cplusplus
74 extern "C" {
75 #endif /* __cplusplus */
76 
77 #ifdef _MGGAL_DRI
78 
79 #include <stdint.h>
80 
85 struct _DriDriver;
86 typedef struct _DriDriver DriDriver;
87 
92 typedef struct _DriSurfaceBuffer {
93  uint32_t buff_id;
94  uint32_t width;
95  uint32_t height;
96  uint32_t pitch;
97 
98  uint32_t drm_format;
99  //uint32_t depth:8;
100  uint16_t bpp:8;
101  uint16_t cpp:8;
102 
103  uint8_t* pixels;
105 
110  COLOR_LOGICOP_CLEAR = 0,
111  COLOR_LOGICOP_NOR = 1,
112  COLOR_LOGICOP_AND_INVERTED = 2,
113  COLOR_LOGICOP_COPY_INVERTED = 3,
114  COLOR_LOGICOP_AND_REVERSE = 4,
115  COLOR_LOGICOP_INVERT = 5,
116  COLOR_LOGICOP_XOR = 6,
117  COLOR_LOGICOP_NAND = 7,
118  COLOR_LOGICOP_AND = 8,
119  COLOR_LOGICOP_EQUIV = 9,
120  COLOR_LOGICOP_NOOP = 10,
121  COLOR_LOGICOP_OR_INVERTED = 11,
122  COLOR_LOGICOP_COPY = 12,
123  COLOR_LOGICOP_OR_REVERSE = 13,
124  COLOR_LOGICOP_OR = 14,
125  COLOR_LOGICOP_SET = 15
126 };
127 
128 typedef struct _DriDriverOps {
134  DriDriver* (*create_driver) (int device_fd);
135 
141  void (*destroy_driver) (DriDriver *driver);
142 
148  void (* flush_driver) (DriDriver *driver);
149 
158  uint32_t (* create_buffer) (DriDriver *driver,
159  uint32_t drm_format,
160  unsigned int width, unsigned int height,
161  unsigned int *pitch);
162 
163  BOOL (* fetch_buffer) (DriDriver *driver,
164  uint32_t buffer_id,
165  unsigned int *width, unsigned int *height,
166  unsigned int *pitch);
167 
174  DriSurfaceBuffer* (* map_buffer) (DriDriver *driver,
175  uint32_t buffer_id);
176 
182  void (* unmap_buffer) (DriDriver *driver, DriSurfaceBuffer* buffer);
183 
189  void (* destroy_buffer) (DriDriver *driver, uint32_t buffer_id);
190 
198  int (* clear_buffer) (DriDriver *driver,
199  DriSurfaceBuffer* dst_buf, const GAL_Rect* rc, uint32_t pixel_value);
200 
209  int (* check_blit) (DriDriver *driver,
210  DriSurfaceBuffer* src_buf, DriSurfaceBuffer* dst_buf);
211 
218  int (* copy_blit) (DriDriver *driver,
219  DriSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
220  DriSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
221  enum DriColorLogicOp logic_op);
222 
230  int (* alpha_blit) (DriDriver *driver,
231  DriSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
232  DriSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc, uint8_t alpha);
233 
241  int (* key_blit) (DriDriver *driver,
242  DriSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
243  DriSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc, uint32_t color_key);
244 
252  int (* alpha_key_blit) (DriDriver *driver,
253  DriSurfaceBuffer* src_buf, const GAL_Rect* src_rc,
254  DriSurfaceBuffer* dst_buf, const GAL_Rect* dst_rc,
255  uint8_t alpha, uint32_t color_key);
256 
257 } DriDriverOps;
258 
260 DriDriverOps* __dri_ex_driver_get (const char* driver_name);
261 
262 #endif /* _MGGAL_DRI */
263 
264 #ifdef _MGGAL_COMMLCD
265 
266 /* external stubs for COMMLCD NEWGAL engine */
267 
268 /* The pixel format defined by depth */
269 #define COMMLCD_PSEUDO_RGB332 1
270 #define COMMLCD_TRUE_RGB555 2
271 #define COMMLCD_TRUE_RGB565 3
272 #define COMMLCD_TRUE_RGB888 4
273 #define COMMLCD_TRUE_RGB0888 5
274 #define COMMLCD_TRUE_ARGB1555 6
275 #define COMMLCD_TRUE_ARGB8888 7
276 #define COMMLCD_TRUE_ABRG8888 8
277 
278 #define COMMLCD_UPDATE_NONE 0
279 #define COMMLCD_UPDATE_SYNC 1
280 #define COMMLCD_UPDATE_ASYNC 2
281 
282 struct commlcd_info {
283  int height; // vertical resolution of the screen
284  int width; // horinzontal resolution of the screen
285  int pitch; // Length of one scan line in bytes
286  int bpp; // Depth (bits-per-pixel)
287  int type; // Pixel type
288  int update_method; // Update method: none, asynchronously, or synchronously.
289  Uint8* fb; // Frame buffer
290 };
291 
292 int __commlcd_drv_init (void);
293 int __commlcd_drv_getinfo (struct commlcd_info *li,
294  int width, int height, int depth);
295 int __commlcd_drv_release (void);
296 int __commlcd_drv_setclut (int firstcolor, int ncolors, GAL_Color *colors);
297 int __commlcd_drv_update (const RECT* rc_dirty);
298 
299 #endif /* _MGGAL_COMMLCD */
300 
301 #ifdef _MGIAL_COMM
302 
303 /* external stubs for COMM IAL engine */
304 
305 #define COMM_MOUSEINPUT 0x01
306 #define COMM_KBINPUT 0x02
307 
308 #define COMM_MOUSELBUTTON 0x01
309 #define COMM_MOUSERBUTTON 0x04
310 
311 int __comminput_init (void);
312 int __comminput_ts_getdata (short *x, short *y, short *button);
313 int __comminput_kb_getdata (short *key, short *status);
314 int __comminput_wait_for_input (struct timeval *timeout);
315 void __comminput_deinit (void);
316 
317 #endif /* _MGIAL_COMM */
318 
319 #ifdef __cplusplus
320 }
321 #endif /* __cplusplus */
322 
325 #endif /* GUI_EXSTUBS_H */
326 
int BOOL
A type definition for boolean value.
Definition: common.h:338
struct _DriSurfaceBuffer DriSurfaceBuffer
Definition: common.h:925
DriColorLogicOp
Definition: exstubs.h:109
unsigned char Uint8
A type definition for an 8-bit unsigned character.
Definition: common.h:154
DriDriverOps * __dri_ex_driver_get(const char *driver_name)