⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gui.h

📁 ucOS 的商业版本源代码及相关开发的一些资料
💻 H
📖 第 1 页 / 共 3 页
字号:
/*
*********************************************************************************************************
*                                                uC/GUI
*                        Universal graphic software for embedded applications
*
*                       (c) Copyright 2002, Micrium Inc., Weston, FL
*                       (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH
*
*              礐/GUI is protected by international copyright laws. Knowledge of the
*              source code may not be used to write a similar product. This file may
*              only be used in accordance with a license and should not be redistributed
*              in any way. We appreciate your understanding and fairness.
*
* File    : GUI.H
* Purpose : Include file for 2DGL incl. character related routines.
*
*
* Version-Date---Author-Explanation
*
* 1.00.00 020517 RS     First release
*
*
* Known problems or limitations with current version
*
*    None.
*
*
* Open issues
*
*    None
*
*
* Attention : Do not modify this file ! If you do, you will not
*             be able do update to a later version of uC/GUI!
*
*********************************************************************************************************
*/

#ifndef  GUI_H
#define  GUI_H
#define __EMWIN_GSC__   /* Allow "C" to find out that 礐/GUI is used */

#if defined(__cplusplus)
extern "C" {     /* Make sure we have C-declarations in C++ programs */
#endif

#include "GUITYPE.H"
#include "GUICONF.H"
#if GUI_WINSUPPORT
  #include "WM.h"
#endif

#define GUI_VERSION 31408


/**********************************************************************
*
*                        Defaults for config switches
*
***********************************************************************
*/

#ifndef GUI_SUPPORT_TOUCH
  #define GUI_SUPPORT_TOUCH   0
#endif

#ifndef GUI_SUPPORT_MEMDEV
  #define GUI_SUPPORT_MEMDEV  0
#endif

#ifndef GUI_SUPPORT_CURSOR
  #define GUI_SUPPORT_CURSOR  1
#endif

#ifndef GUI_OS
  #define GUI_OS              0
#endif

#ifndef GUI_DEFAULT_FONT
  #define GUI_DEFAULT_FONT    &GUI_Font6x8
#endif

#ifndef GUI_DEFAULT_BKCOLOR
  #define GUI_DEFAULT_BKCOLOR GUI_BLACK
#endif

#ifndef GUI_DEFAULT_COLOR
  #define GUI_DEFAULT_COLOR   GUI_WHITE
#endif

#ifndef GUI_SUPPORT_UNICODE
  #define GUI_SUPPORT_UNICODE 1
#endif

/* In order to avoid warnings for undefined parameters */
#ifndef GUI_USE_PARA
  #define GUI_USE_PARA(para) para=para;
#endif

/* GUI_FLASH allows to put constants into a special memory area
   For most CPUs, this is not necessary hence the default is "".
   (This makes sense for CPUs like ATMEL AT90 or 8051, where
   default pointers are unable to reach ROM/FLASH memory in some
   memory models)
*/
#ifndef GUI_FLASH
  #define GUI_FLASH
#endif

#ifndef GUI_FAR
  #define GUI_FAR
#endif

/* Default for types */
#ifndef GUI_TIMER_TIME
  #define GUI_TIMER_TIME int  /* default is to use 16 bits for 16 bit CPUs,
	                           32 bits on 32 bit CPUs for timing */
#endif

#ifndef GUI_COMPATIBLE_MODE
  #define GUI_COMPATIBLE_MODE 1
#endif

/************************************************************
*
*                    GUI_ID_...
*
*************************************************************
These ID values are basically meant to be used with widgets

*/
#define GUI_ID_OK                1
#define GUI_ID_CANCEL            2
#define GUI_ID_YES               3
#define GUI_ID_NO                4
#define GUI_ID_CLOSE             5
#define GUI_ID_HELP              6

#define GUI_ID_BACKSPACE         8
#define GUI_ID_INSERT            0x2d
#define GUI_ID_DELETE            0x2E
#define GUI_ID_ESCAPE            0x1b
#define GUI_ID_ENTER             0x0d
#define GUI_ID_KEY_USER          512

#define GUI_ID_LEFT              0x25
#define GUI_ID_UP                0x26
#define GUI_ID_RIGHT             0x27
#define GUI_ID_DOWN              0x28
#define GUI_ID_ADD               0x6B
#define GUI_ID_SUBTRACT          0x6D

#define GUI_MB_OK                20
#define GUI_MB_WARNING           21

/*********************************************************************
*
*               Constants  needed for GL
*
**********************************************************************
*/

/*      *********************************
        *
        *      Linestyles
        *
        *********************************
*/

#define GUI_LS_SOLID        (0)
#define GUI_LS_DASH         (1)
#define GUI_LS_DOT          (2)
#define GUI_LS_DASHDOT      (3)
#define GUI_LS_DASHDOTDOT   (4)


/*      *********************************
        *
        *      Pen shapes
        *
        *********************************
*/

#define GUI_PS_ROUND        (0)
#define GUI_PS_FLAT         (1)
#define GUI_PS_SQUARE       (2)



/*      *********************************
        *
        *      Standard colors
        *
        *********************************
*/


#define GUI_BLACK        0x000000
#define GUI_BLUE         0xFF0000
#define GUI_GREEN        0x00ff00
#define GUI_CYAN         0xffff00
#define GUI_RED          0x0000FF
#define GUI_MAGENTA      0x8b008b
#define GUI_BROWN        0x2a2aa5
#define GUI_DARKGRAY     0x404040
#define GUI_GRAY         0x808080
#define GUI_LIGHTGRAY    0xd3d3d3
#define GUI_LIGHTBLUE    0xff8080
#define GUI_LIGHTGREEN   0x80ff80
#define GUI_LIGHTCYAN    0x80ffff
#define GUI_LIGHTRED     0x8080ff
#define GUI_LIGHTMAGENTA 0xff80ff
#define GUI_YELLOW       0x00ffff
#define GUI_WHITE        0xffffff

/*      *********************************
        *
        *      Coordinates
        *
        *********************************
*/
#define GUI_COORD_X 0
#define GUI_COORD_Y 1

/*      *********************************
        *
        *      UNICODE support macros
        *
        *********************************
*/
#define GUI_UC_STARTCHAR     0x1a
#define GUI_UC_ENDCHAR       0xe2
#define GUI_UC_STARTSTRING   "\x1a"
#define GUI_UC_ENDSTRING     "\xe2"
#define GUI_UC_START         GUI_UC_STARTSTRING
#define GUI_UC_END           GUI_UC_ENDSTRING
#define GUI_UC_NL            "\xe0\x0a"


/*********************************************************************
*
*            Standard Fonts supplied with emWin
*
**********************************************************************

Note: The external declarations for the fonts are now also included in
      this file.
*/


/* Proportional fonts */
extern const GUI_FONT GUI_Font8_ASCII,        GUI_Font8_1;
extern const GUI_FONT GUI_Font10S_ASCII,      GUI_Font10S_1;
extern const GUI_FONT GUI_Font10_ASCII,       GUI_Font10_1;
extern const GUI_FONT GUI_Font13_ASCII,       GUI_Font13_1;
extern const GUI_FONT GUI_Font13B_ASCII,      GUI_Font13B_1;
extern const GUI_FONT GUI_Font13H_ASCII,      GUI_Font13H_1;
extern const GUI_FONT GUI_Font13HB_ASCII,     GUI_Font13HB_1;
extern const GUI_FONT GUI_Font16_ASCII,       GUI_Font16_1,       GUI_Font16_HK,    GUI_Font16_1HK;
extern const GUI_FONT GUI_Font16B_ASCII,      GUI_Font16B_1;
extern const GUI_FONT GUI_Font24_ASCII,       GUI_Font24_1;
extern const GUI_FONT GUI_Font24B_ASCII,      GUI_Font24B_1;
extern const GUI_FONT GUI_Font32_ASCII,       GUI_Font32_1;
extern const GUI_FONT GUI_Font32B_ASCII,      GUI_Font32B_1;

/* Monospaced */
extern const GUI_FONT GUI_Font4x6;
extern const GUI_FONT GUI_Font6x8,            GUI_Font6x9;
extern const GUI_FONT GUI_Font8x8,            GUI_Font8x9;
extern const GUI_FONT GUI_Font8x10_ASCII;
extern const GUI_FONT GUI_Font8x12_ASCII;
extern const GUI_FONT GUI_Font8x13_ASCII,     GUI_Font8x13_1;
extern const GUI_FONT GUI_Font8x15B_ASCII,    GUI_Font8x15B_1;
extern const GUI_FONT GUI_Font8x16,           GUI_Font8x17,       GUI_Font8x18;
extern const GUI_FONT GUI_Font8x16x1x2,       GUI_Font8x16x2x2,   GUI_Font8x16x3x3;

/* Digits */
extern const GUI_FONT GUI_FontD24x32;
extern const GUI_FONT GUI_FontD32;

/* Comic fonts */
extern const GUI_FONT GUI_FontComic18B_ASCII, GUI_FontComic18B_1;
extern const GUI_FONT GUI_FontComic24B_ASCII, GUI_FontComic24B_1;


/*
      *********************************
      *                               *
      * Text and drawing mode defines *
      *                               *
      *********************************

These defines come in two flavors: the long version (.._DRAWMODE_..)
and the short ones (.._DM_..). They are identical, feel free to use
which ever one you like best.

*/

#define GUI_DRAWMODE_NORMAL  LCD_DRAWMODE_NORMAL
#define GUI_DRAWMODE_XOR     LCD_DRAWMODE_XOR
#define GUI_DRAWMODE_TRANS   LCD_DRAWMODE_TRANS
#define GUI_DRAWMODE_REV     LCD_DRAWMODE_REV
#define GUI_DM_NORMAL        LCD_DRAWMODE_NORMAL
#define GUI_DM_XOR           LCD_DRAWMODE_XOR
#define GUI_DM_TRANS         LCD_DRAWMODE_TRANS
#define GUI_DM_REV           LCD_DRAWMODE_REV

#define GUI_TEXTMODE_NORMAL  LCD_DRAWMODE_NORMAL
#define GUI_TEXTMODE_XOR     LCD_DRAWMODE_XOR
#define GUI_TEXTMODE_TRANS   LCD_DRAWMODE_TRANS
#define GUI_TEXTMODE_REV     LCD_DRAWMODE_REV
#define GUI_TM_NORMAL        LCD_DRAWMODE_NORMAL
#define GUI_TM_XOR           LCD_DRAWMODE_XOR
#define GUI_TM_TRANS         LCD_DRAWMODE_TRANS
#define GUI_TM_REV           LCD_DRAWMODE_REV

/* Text alignment flags, horizontal */
#define GUI_TA_HORIZONTAL  (3<<0)
#define GUI_TA_LEFT        (0<<0)
#define GUI_TA_RIGHT	     (1<<0)
#define GUI_TA_CENTER	     (2<<0)
#define GUI_TA_HCENTER	   GUI_TA_CENTER  /* easier to remember :-)  */

/* Text alignment flags, vertical */
#define GUI_TA_VERTICAL   (3<<2)
#define GUI_TA_TOP	      (0<<2)
#define GUI_TA_BOTTOM	    (1<<2)
#define GUI_TA_BASELINE   (2<<2)
#define GUI_TA_VCENTER    (3<<2)

/*    *********************************
      *
      *     Min/Max coordinates
      *
      *********************************
*/
/* Define minimum and maximum coordinates in x and y */
#define GUI_XMIN -4095
#define GUI_XMAX  4095
#define GUI_YMIN -4095
#define GUI_YMAX  4095

/*********************************************************************
*
*             General routines
*
**********************************************************************
*/
int  GUI_Init(void);
void GUI_SetDefault(void);
GUI_DRAWMODE GUI_SetDrawMode(GUI_DRAWMODE dm);
const char * GUI_GetVersionString(void);

/*********************************************************************
*
*           Rectangle helper functions
*
***********************************************************************
*/

void GUI_MoveRect(GUI_RECT *pRect, int x, int y);
int  GUI_RectsIntersect(const GUI_RECT* pr0, const GUI_RECT* pr1);
void GUI_MergeRect(GUI_RECT* pDest, const GUI_RECT* pr0, const GUI_RECT* pr1);
int  GUI__IntersectRects(GUI_RECT* pDest, const GUI_RECT* pr0, const GUI_RECT* pr1);


/*********************************************************************
*
*      Get / Set Attributes
*
**********************************************************************
*/
 
GUI_COLOR GUI_GetBkColor     (void);
GUI_COLOR GUI_GetColor       (void);
int       GUI_GetBkColorIndex(void);
int       GUI_GetColorIndex  (void);
U8        GUI_GetPenSize     (void);
U8        GUI_GetLineStyle   (void);
U8        GUI_GetFillStyle   (void);

void      GUI_SetBkColor   (GUI_COLOR);
void      GUI_SetColor     (GUI_COLOR);
void      GUI_SetBkColorIndex(int Index);
void      GUI_SetColorIndex(int Index);

U8        GUI_SetPenSize   (U8 Size);
U8        GUI_SetPenShape  (U8 Shape);
U8        GUI_SetLineStyle (U8 Style);
U8        GUI_SetFillStyle (U8 Style);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -