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

📄 guicharp.lst

📁 Keil C下通过的UCGUI,UCGUI的移植源代码
💻 LST
字号:
C51 COMPILER V8.05a   GUICHARP                                                             04/11/2008 14:18:54 PAGE 1   


C51 COMPILER V8.05a, COMPILATION OF MODULE GUICHARP
OBJECT MODULE PLACED IN GUICharP.obj
COMPILER INVOKED BY: D:\Program Files\keil\C51\BIN\C51.EXE gui\Core\GUICharP.c LARGE BROWSE MDU_F120 DEBUG OBJECTEXTEND 
                    -PRINT(.\GUICharP.lst) OBJECT(GUICharP.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        : GUICharP.C
  16          Purpose     : Implementation of Proportional fonts
  17          ---------------------------END-OF-HEADER------------------------------
  18          */
  19          
  20          
  21          #include <stddef.h>           /* needed for definition of NULL */
  22          
  23          #include "gui\Core\GUI_Private.h"
  24           
  25          /*
  26                ***********************************************************
  27                *                                                         *
  28                *       Proprotional fonts                                *
  29                *                                                         *
  30                ***********************************************************
  31          */
  32          
  33          static const GUI_FONT_PROP* GUIPROP_FindChar(const GUI_FONT_PROP* pProp, U16P c) {
  34   1        for (; pProp; pProp=(GUI_FONT_PROP*) pProp->pNext) {
  35   2          if ((c>=pProp->First) && (c<=pProp->Last))
  36   2            break;
  37   2        }
  38   1        return pProp;
  39   1      }
  40          
  41          void GUIPROP_DispChar(U16P c) {
  42   1        int BytesPerLine;
  43   1        GUI_DRAWMODE DrawMode = GUI_Context.TextMode;
  44   1        const GUI_FONT_PROP* pProp = GUIPROP_FindChar(GUI_Context.pAFont->p.pProp, c);
  45   1        if (pProp) {
  46   2          GUI_DRAWMODE OldDrawMode;
  47   2          const GUI_CHARINFO* pCharInfo = pProp->paCharInfo+(c-pProp->First);
  48   2          BytesPerLine = pCharInfo->BytesPerLine;
  49   2          OldDrawMode  = LCD_SetDrawMode(DrawMode);
  50   2          LCD_DrawBitmap( GUI_Context.DispPosX, GUI_Context.DispPosY,
  51   2                             pCharInfo->XSize,
  52   2                                                                                               GUI_Context.pAFont->YSize,
  53   2                             GUI_Context.pAFont->XMag,
  54   2                                                                                               GUI_Context.pAFont->YMag,
C51 COMPILER V8.05a   GUICHARP                                                             04/11/2008 14:18:54 PAGE 2   

  55   2                             1,     /* Bits per Pixel */
  56   2                             BytesPerLine,
  57   2                             (U8 const *)pCharInfo->pData,
  58   2                             &LCD_BKCOLORINDEX
  59   2                             );
  60   2          /* Fill empty pixel lines */
  61   2          if (GUI_Context.pAFont->YDist > GUI_Context.pAFont->YSize) {
  62   3            int YMag = GUI_Context.pAFont->YMag;
  63   3            int YDist = GUI_Context.pAFont->YDist * YMag;
  64   3            int YSize = GUI_Context.pAFont->YSize * YMag;
  65   3            if (DrawMode != LCD_DRAWMODE_TRANS) {
  66   4              LCD_COLOR OldColor = GUI_GetColor();
  67   4              GUI_SetColor(GUI_GetBkColor());
  68   4              LCD_FillRect(GUI_Context.DispPosX, 
  69   4                           GUI_Context.DispPosY + YSize, 
  70   4                           GUI_Context.DispPosX + pCharInfo->XSize, 
  71   4                           GUI_Context.DispPosY + YDist);
  72   4              GUI_SetColor(OldColor);
  73   4            }
  74   3          }
  75   2          LCD_SetDrawMode(OldDrawMode); /* Restore draw mode */
  76   2          GUI_Context.DispPosX += pCharInfo->XDist;
  77   2        }
  78   1      }
  79          
  80          int GUIPROP_GetCharDistX(U16P c) {
  81   1        const GUI_FONT_PROP* pProp = GUIPROP_FindChar(GUI_Context.pAFont->p.pProp, c);
  82   1        return (pProp) ? (pProp->paCharInfo+(c-pProp->First))->XSize : 0;
  83   1      }
  84          
  85          void GUIPROP_GetFontInfo(void*pFont, GUI_FONTINFO* pfi) {
  86   1        GUI_USE_PARA(pFont);
  87   1        pfi->Flags = GUI_FONTINFO_FLAG_PROP;
  88   1      }
  89          
  90          char GUIPROP_IsInFont(void*pFont, U16 c) {
  91   1        const GUI_FONT_PROP* pProp = GUIPROP_FindChar(((GUI_FONT*)pFont)->p.pProp, c);
  92   1        return (pProp==NULL) ? 0 : 1;
  93   1      }
  94          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    824    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----      38
   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 + -