📄 gdi.h
字号:
/************************************************************************** (C)Copyright Cheertek Inc. 2002-2003, D300, all right reserved. Product : WinAV Firmware Date : 2003.01.08. Author : Cheertek (D300 BrianCheng) Purpose : Graphic Device Interface Module The moudle provides BMP OSD graphic functions Sources : gdi.h/ gdi.c/ gdiex.c------------------------------------------------------------ Update Date : Name : Cheertek (D300 Briancheng) Description : ??? Item Source ---------------------------------------- ------------------- . ****************************************************************************/#ifndef __GDI_H__#define __GDI_H__#ifdef AP_FRAMEWORK#ifndef GDI_WITHOUT_OS#define GDI_WITHOUT_OS#endif#ifndef GDI_STANDALONE_LIBRARY#define GDI_STANDALONE_LIBRARY#endif#ifndef GDI_NO_PRINTF#define GDI_NO_PRINTF#endif#endif// Micky2.16p, for simple AP/*#ifndef GDI_STANDALONE_LIBRARY#include "initial.h" // for including MainVideoInfo#endif*///#define NO_GDI#define TRADITION 0 // Use the traditional 2-bit font table#define SPLIT_2_1_BIT 1 // Use the two seperated font table, 2-bit and 1-bit#define CREATE_DYNAMICALLY 2 // Dynamically copy font from FLASH to font table in DRAM/*--CoCo2.37p#include "OSDString/fontindx_2bit.def"#if (FONT_TABLE_METHOD != TRADITION)#include "OSDString/fontindx_1bit.def"#endif*///Alan2.16, for double height and width of teletext#ifdef SUPPORT_STB//#include "STB/usrif/Fontindx_TELETEXT.def"#include "STB/usrif/Fontindx_TELETEXT_LATIN.def"#include "STB/usrif/Fontindx_TELETEXT_MOSAICS.def"#endif//Alan2.00// The following number, 8, is gotten from // each char has 32(W) * FONT_HEIGHT * 2(bits) / 8 byte in 2 bit mode#define OSD_2BIT_CHAR_SIZE (8 * OSD_FONT_HEIGHT)#define OSD_1BIT_CHAR_SIZE (4 * OSD_FONT_HEIGHT)#ifdef SUPPORT_CHAR_SUBPICTURE // Brian1.10//Alan1.10 for support char-based subpicture//Aron,2.77-909P, Port Damon's code to files to support Unicode DIR/FILE name & external subtitle.#if defined(ISO_8859_2_FONT) || defined(CP_1250_FONT)#include "OSDString/ISO_8859_2_FontIndx.def"#endif#ifdef ISO_8859_7_FONT#include "OSDString/ISO_8859_7_FontIndx.def"#endif// Damon2.51, for Hebrew#ifdef ISO_8859_8_FONT#include "OSDString/ISO_8859_8_FontIndx.def"#endif#ifdef ISO_8859_9_FONT#include "OSDString/ISO_8859_9_FontIndx.def"#endif#ifdef ISO_8859_15_FONT#include "OSDString/ISO_8859_15_FontIndx.def"#endif#ifdef CP_1251_FONT#include "OSDString/CP_1251_FontIndx.def"#endif//Aron,2.77-909P, Port Damon's code to files to support Unicode DIR/FILE name & external subtitle.#ifdef SUPPORT_UNICODE_CODING#include "OSDString/UNICODE_FontIndx.def"#endif#endif#ifdef SUPPORT_STB#include "OSDString/6937_FontIndx.def"#endif//#include "colordef.h"//////////////////////////////////////////////////////////// Move from COLORDEF.H code ///////////////////////// Because include colordef.h in gdi.h will make colordef.h include miss in some PC environment when happen Src_235a string. So move to // gdi.h to avoid this problem.//Define the mix ratio for general UI#define GDI_GENERAL_MIX_RATIO 24//The starting palette index for special UIs that it will exist with other UI together, ex. normal display, common dialog box.#define GDI_SPECIAL_PALETTE_INDEX_START 1//define the starting palette index for normal display#define GDI_ND_PALETTE_INDEX_START 1#if (DRAM_CONFIGURATION_TYPE_DVD == DRAM_SIZE_16)//define the number of palettes for normal display#define GDI_ND_PALETTE_NUM 11#else//define the number of palettes for normal display#define GDI_ND_PALETTE_NUM 13#endif //(DRAM_CONFIGURATION_TYPE_DVD == DRAM_SIZE_16)//define the starting palette index for OSD dynamic normal display#define GDI_DYNAMIC_ND_PALETTE_INDEX_START 2//define the number of palettes for OSD dynamic normal display#define GDI_DYNAMIC_ND_PALETTE_NUM 2//define the starting palette index for GDI low-level function#define GDI_LOW_LEVEL_FUNCTION_PALETTE_INDEX_START (GDI_ND_PALETTE_INDEX_START+GDI_ND_PALETTE_NUM)//define the number of palettes for GDI low-level functions like scroll bar#define GDI_LOW_LEVEL_FUNCTION_PALETTE_NUM 4//define the starting palette index for common dialog box.#define GDI_COMMON_DIALOG_PALETTE_INDEX_START (GDI_LOW_LEVEL_FUNCTION_PALETTE_INDEX_START+GDI_LOW_LEVEL_FUNCTION_PALETTE_NUM)//define the number of palettes for common dialog box#define GDI_COMMON_DIALOG_PALETTE_NUM 11//define the starting palette index for general UI.//Note: General UI should refer to this define to define its starting palette index #define GDI_GENERAL_UI_PALETTE_INDEX_START (GDI_COMMON_DIALOG_PALETTE_INDEX_START+GDI_COMMON_DIALOG_PALETTE_NUM) //30#define GDI_GENERAL_UI_PALETTE_RESERVE_NUM 25//Define the starting palette index for the background of main menu#define GDI_MAIN_MENU_PALETTE_INDEX_START 56//define the number of palettes for the background of main menu#define GDI_MAIN_MENU_PALETTE_RESERVE_NUM 40//Define the starting palette index for toolbar#define GDI_TOOLBAR_PALETTE_INDEX_START (GDI_MAIN_MENU_PALETTE_INDEX_START+GDI_MAIN_MENU_PALETTE_RESERVE_NUM)//define the number of palettes for toolbar#define GDI_TOOLBAR_PALETTE_NUM 8//Define the starting palette index for menu#define GDI_MENU_COMPONENT_PALETTE_INDEX_START (GDI_TOOLBAR_PALETTE_INDEX_START+GDI_TOOLBAR_PALETTE_NUM)//define the number of palettes for menu#define GDI_MENU_COMPONENT_NUM 8//Define the starting palette index for dialog component#define GDI_DIALOG_COMPONENT_PALETTE_INDEX_START (GDI_MENU_COMPONENT_PALETTE_INDEX_START+GDI_MENU_COMPONENT_NUM)//define the number of palettes for dialog component#define GDI_DIALOG_COMPONENT_PALETTE_NUM 40//Define the starting palette index for PIN dialog#define GDI_PIN_DIALOG_PALETTE_INDEX_START (GDI_DIALOG_COMPONENT_PALETTE_INDEX_START+GDI_DIALOG_COMPONENT_PALETTE_NUM)//define the number of palettes for PIN dialog#define GDI_PIN_DIALOG_PALETTE_NUM 3//define the starting palette index for bitmaps//Note: palette index 95~254 is for bitmap palette usage#define GDI_BITMAP_PALETTE_INDEX_START 155//The palette index for "transparent"#define PAL_ENTRY_COLOR_TRANSPARENT 0// or this flag to indicate that the value is YUV, not RGB#define GDI_VALUE_YUV 0x5A000000/////////////////////////////////////////////////////////// Move from COLORDEF.H code ////////////////////////*typedef struct tagRECT_{ WORD wLeft; WORD wTop; WORD wRight; WORD wBottom;} RECT, *PRECT;*///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////#define SET_RECT(P,LEFT,TOP,RIGHT,BOTTOM)\ {\ P.wLeft=LEFT;\ P.wTop=TOP;\ P.wRight=RIGHT;\ P.wBottom=BOTTOM;\ }#define GDI_FILL_RECT(LEFT,TOP,RIGHT,BOTTOM,COLOR)\ {\ __GDIParm.u.RectParm.rect.wLeft=(WORD)(LEFT);\ __GDIParm.u.RectParm.rect.wTop=(WORD)(TOP);\ __GDIParm.u.RectParm.rect.wRight=(WORD)(RIGHT);\ __GDIParm.u.RectParm.rect.wBottom=(WORD)(BOTTOM);\ __GDIParm.u.RectParm.bColor=(BYTE)(COLOR);\ }#define GDI_BITMAP_COPY(LEFT,TOP,RIGHT,BOTTOM,X,Y,SRC,DEST)\ {\ __GDIParm.u.BitmapCopy.SrcRect.wLeft=LEFT;\ __GDIParm.u.BitmapCopy.SrcRect.wTop=TOP;\ __GDIParm.u.BitmapCopy.SrcRect.wRight=RIGHT;\ __GDIParm.u.BitmapCopy.SrcRect.wBottom=BOTTOM;\ __GDIParm.u.BitmapCopy.wDestX = X;\ __GDIParm.u.BitmapCopy.wDestY = Y;\ __GDIParm.u.BitmapCopy.bSrcRegion = SRC;\ __GDIParm.u.BitmapCopy.bDestRegion = DEST;\ }#define GDI_DRAW_FRAME(LEFT,TOP,RIGHT,BOTTOM,COL_BRIGHT,COL_DARK,COL_CENTER,STYLE,THICKNESS)\ {\ __GDIParm.u.Frame.rect.wLeft=LEFT;\ __GDIParm.u.Frame.rect.wTop=TOP;\ __GDIParm.u.Frame.rect.wRight=RIGHT;\ __GDIParm.u.Frame.rect.wBottom=BOTTOM;\ __GDIParm.u.Frame.bColorBright = COL_BRIGHT;\ __GDIParm.u.Frame.bColorDark = COL_DARK;\ __GDIParm.u.Frame.bColorCenter = COL_CENTER;\ __GDIParm.u.Frame.bStyle = STYLE;\ __GDIParm.u.Frame.bThickness = THICKNESS;\ }#define GDI_DRAW_SCROLL_BAR(LEFT,TOP,RIGHT,BOTTOM,START,DISPLAY)\ {\ __GDIParm.u.ScrollBar.rect.wLeft=LEFT;\ __GDIParm.u.ScrollBar.rect.wTop=TOP;\ __GDIParm.u.ScrollBar.rect.wRight=RIGHT;\ __GDIParm.u.ScrollBar.rect.wBottom=BOTTOM;\ __GDIParm.u.ScrollBar.wStartPoint=START;\ __GDIParm.u.ScrollBar.wDisplay=DISPLAY;\ }#define GDI_DRAW_VOLUME_BAR(LEFT,TOP,RIGHT,BOTTOM,BAR_COLOR,BG_COLOR,VOLUME,ORIENTION)\ {\ __GDIParm.u.VolumeBar.rect.wLeft = LEFT;\ __GDIParm.u.VolumeBar.rect.wTop = TOP;\ __GDIParm.u.VolumeBar.rect.wRight = RIGHT;\ __GDIParm.u.VolumeBar.rect.wBottom = BOTTOM;\ __GDIParm.u.VolumeBar.bBarColor = BAR_COLOR;\ __GDIParm.u.VolumeBar.bBgColor = BG_COLOR;\ __GDIParm.u.VolumeBar.wVolume = VOLUME;\ __GDIParm.u.VolumeBar.bOriention = ORIENTION;\ }#define GDI_DRAW_BUTTON(LEFT,TOP,RIGHT,BOTTOM,ID,STYLE)\ {\ __GDIParm.u.Button.rect.wLeft = (WORD)(LEFT);\ __GDIParm.u.Button.rect.wTop = (WORD)(TOP);\ __GDIParm.u.Button.rect.wRight = (WORD)(RIGHT);\ __GDIParm.u.Button.rect.wBottom = (WORD)(BOTTOM);\ __GDIParm.u.Button.bButtonId = (BYTE)(ID);\ __GDIParm.u.Button.bStyle = (BYTE)(STYLE);\ }#define GDI_SET_CURRENT_REGION(ID)\ {\ __bCurrentRegionId = ID;\ }#define GDI_GET_CHAR_WIDTH(C) GDI_GetCharWidth(C)#define GDI_SHADING_OPERATION 0x80 // or this bit in bArc to indicate it is a shading opertaion#define GDI_FillRect_909 GDI_FillRect #define GDI_DrawString_909 GDI_DrawString#define GDI_GetStringHeight_909 GDI_GetStringHeight#define GDI_GetStringWidth_909 GDI_GetStringWidth#define GDI_DrawFrame_909 GDI_DrawFrame#define GDI_DrawVolumeBar_909 GDI_DrawVolumeBar#define GDI_DrawScrollBar_909 GDI_DrawScrollBar// define the number of font, palette and region used in this module//DMP1.21, add one region for RDS display.#ifndef SUPPORT_RADIO_RDS#define NUMBER_OF_REGION 4 #else#define NUMBER_OF_REGION 5 #endif #define NUMBER_OF_IMAGE 1 #define TEXT_BG_COLOR 0#define TEXT_FG_COLOR 1#define TEXT_SHADOW_COLOR_1 2#define TEXT_SHADOW_COLOR_2 3#define H2D // define this will diable pixel horizontal duplication// The maximum length of a text string, not including the first length value#ifdef SUPPORT_CT909S // Brian1.50#define GDI_STRING_LENGTH 14#else#define GDI_STRING_LENGTH 20#endif#define ORIENTION_VERTICAL 0#define ORIENTION_HORIZONTAL 1// Frame style// bit 0: 1:push, 0:pop// bit 1: 1:solid, 0: empty// bit 2: 1:double, 0: single#define FRAME_PUSH_SOLID 0x03#define FRAME_POP_SOLID 0x02#define FRAME_DOUBLE_SOLID 0x06#define FRAME_PUSH 0x01#define FRAME_POP 0x00#define FRAME_DOUBLE 0x04// Button style// bit 0~1: 00:normal, 01:disabled, 10:selected// bit 2: 1:with text, 0: without text#define BUTTON_NORMAL 0x00
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -