📄 guicharm.lst
字号:
C51 COMPILER V8.05a GUICHARM 04/11/2008 14:18:54 PAGE 1
C51 COMPILER V8.05a, COMPILATION OF MODULE GUICHARM
OBJECT MODULE PLACED IN GUICharM.obj
COMPILER INVOKED BY: D:\Program Files\keil\C51\BIN\C51.EXE gui\Core\GUICharM.c LARGE BROWSE MDU_F120 DEBUG OBJECTEXTEND
-PRINT(.\GUICharM.lst) OBJECT(GUICharM.obj)
line level source
1 /*
2 *********************************************************************************************************
3 * uC/GUI
4 * Universal graphic software for embedded applications
5 *
6 * (c) Copyright 2002, Micrium Inc., Weston, FL
7 * (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH
8 *
9 * 礐/GUI is protected by international copyright laws. Knowledge of the
10 * source code may not be used to write a similar product. This file may
11 * only be used in accordance with a license and should not be redistributed
12 * in any way. We appreciate your understanding and fairness.
13 *
14 ----------------------------------------------------------------------
15 File : GUIChar.C
16 Purpose : Implementation of memory devices
17 ----------------------------------------------------------------------
18 Version-Date---Author-Explanation
19 ----------------------------------------------------------------------
20 */
21
22 #include <stddef.h> /* needed for definition of NULL */
23
24 #include "gui\Core\GUI_Private.h"
25
26
27
28 /*
29 ***********************************************************
30 * *
31 * Monospaced Font *
32 * *
33 ***********************************************************
34
35 This is the routine that displays a character. It is used by all
36 other routines which display characters as a subroutine.
37
38 Parameters: c character to display
39 */
40
41
42 void GUIMONO_DispChar(U16P c) {
43 1 int c0, c1;
44 1 U8 * pd;
45 1 int x = GUI_Context.DispPosX;
46 1 int y = GUI_Context.DispPosY;
47 1 /* do some checking if drawing is actually necessary ... */
48 1 const GUI_FONT_MONO* pMono = GUI_Context.pAFont->p.pMono;
49 1 unsigned int FirstChar = pMono->FirstChar;
50 1 /* translate character into 2 characters to display : c0,c1
51 1 Check if regular character first. */
52 1 if ((c >= (U16P)FirstChar) &&(c <= (U16P)pMono->LastChar)) {
53 2 pd = (U8*)pMono->pData;
54 2 c0 = ((int)c) - FirstChar;
C51 COMPILER V8.05a GUICHARM 04/11/2008 14:18:54 PAGE 2
55 2 c1 = -1;
56 2 } else {
57 2 /* Check if character is in translation table */
58 2 GUI_FONT_TRANSINFO const* pti = pMono->pTrans;
59 2 pd = (U8*)pMono->pTransData;
60 2 if (pti) {
61 3 FirstChar = pti->FirstChar;
62 3 if ((c >= (U16P)FirstChar) && (c <= (U16P)pti->LastChar)) {
63 4 GUI_FONT_TRANSLIST const* ptl;
64 4 c -= pti->FirstChar;
65 4 ptl = pti->pList;
66 4 ptl += c;
67 4 c0 = ptl->c0;
68 4 c1 = ptl->c1;
69 4 } else {
70 4 c0 = c1 = -1;
71 4 }
72 3 } else {
73 3 c0 = c1 = -1;
74 3 }
75 2 }
76 1 /*
77 1 Draw first character if it is valid
78 1 */
79 1 if (c0!=-1) {
80 2 int BytesPerChar = GUI_Context.pAFont->YSize*pMono->BytesPerLine;
81 2 GUI_DRAWMODE DrawMode;
82 2 int XSize = pMono->XSize;
83 2 int YSize = GUI_Context.pAFont->YSize;
84 2 /* Select the right drawing mode */
85 2 DrawMode = GUI_Context.TextMode;
86 2 /* call drawing routine */
87 2 {
88 3 U8 OldMode = LCD_SetDrawMode(DrawMode);
89 3 LCD_DrawBitmap( x, y,
90 3 XSize, YSize,
91 3 GUI_Context.pAFont->XMag, GUI_Context.pAFont->YMag,
92 3 1, /* Bits per Pixel */
93 3 pMono->BytesPerLine,
94 3 pd + c0* BytesPerChar,
95 3 &LCD_BKCOLORINDEX
96 3 );
97 3 if (c1 != -1) {
98 4 LCD_SetDrawMode(DrawMode | LCD_DRAWMODE_TRANS);
99 4 LCD_DrawBitmap( x, y,
100 4 XSize, YSize,
101 4 GUI_Context.pAFont->XMag, GUI_Context.pAFont->YMag,
102 4 1, /* Bits per Pixel */
103 4 pMono->BytesPerLine,
104 4 pd + c1* BytesPerChar,
105 4 &LCD_BKCOLORINDEX
106 4 );
107 4 }
108 3 /* Fill empty pixel lines */
109 3 if (GUI_Context.pAFont->YDist > GUI_Context.pAFont->YSize) {
110 4 int YMag = GUI_Context.pAFont->YMag;
111 4 int YDist = GUI_Context.pAFont->YDist * YMag;
112 4 int YSize = GUI_Context.pAFont->YSize * YMag;
113 4 if (DrawMode != LCD_DRAWMODE_TRANS) {
114 5 LCD_SetDrawMode(DrawMode ^ LCD_DRAWMODE_REV); /* Reverse so we can fill with BkColor */
115 5 LCD_FillRect(x, y + YSize, x + XSize, y + YDist);
116 5 }
C51 COMPILER V8.05a GUICHARM 04/11/2008 14:18:54 PAGE 3
117 4 }
118 3 LCD_SetDrawMode(OldMode);
119 3 }
120 2 }
121 1 GUI_Context.DispPosX+=pMono->XDist;
122 1 }
123
124 int GUIMONO_GetCharDistX(U16P c) {
125 1 const GUI_FONT_MONO* pMono = GUI_Context.pAFont->p.pMono;
126 1 GUI_USE_PARA(c);
127 1 return pMono->XDist;
128 1 }
129
130 void GUIMONO_GetFontInfo(void* pFont, GUI_FONTINFO* pfi) {
131 1 GUI_USE_PARA(pFont);
132 1 pfi->Flags = GUI_FONTINFO_FLAG_MONO;
133 1 }
134
135 char GUIMONO_IsInFont(void* pFont, U16 c) {
136 1 const GUI_FONT_MONO* pMono = ((GUI_FONT*)pFont)->p.pMono;
137 1 unsigned int FirstChar = pMono->FirstChar;
138 1 /* Check if regular character first. */
139 1 if ((c >= (U16P)FirstChar) &&(c <= (U16P)pMono->LastChar)) {
140 2 return 1; /* Yes, we have it ! */
141 2 } else {
142 2 /* Check if character is in translation table */
143 2 GUI_FONT_TRANSINFO const* pti = pMono->pTrans;
144 2 if (pti) {
145 3 if ((c >= pti->FirstChar) && (c <= pti->LastChar)) {
146 4 return 1; /* Yes, we have it ! */
147 4 }
148 3 }
149 2 }
150 1 return 0; /* No, we can not display this character */
151 1 }
152
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 1317 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- 42
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -