欢迎来到虫虫下载站 | 资源下载 资源专辑 关于我们
虫虫下载站

display.c

是一个手机功能的模拟程序
C
第 1 页 / 共 5 页
字号:
/* 2003-12-14, Robert.Chen, Add api to support subLCD */
//08/09/2002,zhonghz,display multi-font
//08/02/2002,zhonghz,0x80 for unicode,set in_Attrib to dspl_txtattr_unimode,else
//           set in_Attrib to dspl_txtattr_asciimode
/*********************************************************************
Date        Modification                                                 
  ------------------------                                                 
  04/08/2002   zy add dspl_DrawRect() and change some color setting    
*********************************************************************/

//08/01/2000 zy add dspl_colorTextOut() this function could display color text
//6.19 chenjun add a function dspl_set_pen_size(),
//but, cause ZYM has changed the function dspl_draw_point(),
//which delete the module draw point with gc's pensize bigger than 1 pixel,
//this function didn't work in drawing.All draw use the pen_size of 1 pixel now.
//maybe we should consider a new method to support coarse line and point. 
/*
+-------------------------------------------------------------------+
| PROJECT: GSM-PS                     $Workfile:: display.c        $|
| $Author: zhq $ CONDAT AG            $Revision: 1.6 $|
| CREATED: 18.03.1999                 $Modtime:: 21.02.00 11:33    $|
+-------------------------------------------------------------------+

   MODULE  : DRV_DSPL

   PURPOSE : This Module defines the G23 display driver.

   The driver has three parts:

   1. The interface according the display driver specification
      (dspl_....)
   2. A workaround for the original graphic driver of TI.
      (src_...)
      This was necessary, because the original TI driver leads
      to unexspected lines in the display.
   3. A simulation of the TI driver functions for Windows.
      (LCD_...)

   Additional the support of an external display is integrated
   (dspl_SendDisplayReq).

04/12/2001 GW - Updated to use TI driver V5.3.1

   $Log: display.c,v $
   Revision 1.6  2004/08/05 09:31:16  zhq
   zhq, 2004/08/05, add this for use use block fresh in r2d_refresh.

   Revision 1.5  2004/07/29 09:10:06  jhxu
   no message

   Revision 1.4  2004/07/27 06:42:06  zhenggl
   no message

   Revision 1.3  2004/07/27 05:43:39  zhenggl
   no message

   Revision 1.2  2004/07/26 10:57:15  jhxu
   no message

   Revision 1.1.1.1  2004/06/19 06:00:46  root
   The baseline of M288 project

   Revision 1.4  2004/06/04 08:03:01  sunsj
   Fix some bug

   Revision 1.3  2004/05/24 08:38:00  sunsj
   get rid of the redefined macro

   Revision 1.2  2004/05/11 10:01:42  sunsj
   Modify font type

   Revision 1.1.1.1  2004/05/10 02:33:45  root
   zhq, 2004/05/10, import base on M188A_102X80 project
   tag "M188B_128X160_20040509_BASE".

   Revision 1.1.1.1  2004/04/19 08:33:10  root
   This is the base release version for M188A

   Revision 1.7  2004/04/08 03:13:06  sunsj
   Change chinese char width from 12 to 13

   Revision 1.6  2004/03/25 06:02:53  sunsj
   Add some font char

   Revision 1.5  2004/03/19 09:04:54  huyl
   no message

   Revision 1.4  2004/03/10 08:52:09  sunsj
   Add 0~9 small font

   Revision 1.3  2004/02/03 02:58:33  huyl
   talcon modify 2004/02/03

   Revision 1.2  2004/01/13 07:33:18  sunsj
   modify unicode text display

   Revision 1.1.1.1  2004/01/06 03:15:58  root
   this is the baseline for M188_102X80A project

   Revision 1.2  2004/01/04 09:34:40  sunsj
   Add font switch

   Revision 1.1.1.1  2004/01/03 07:44:50  root
   this is the baseline of M188_102X80A project

   Revision 1.3  2003/12/27 02:32:38  huyl
   add function dspl_SetScreenType,dspl_GetScreenType()
       add function pointer
            pdspl_BitBlt ,  pset_font_type,  pdspl_Enable,  pdspl_TextOut_Cmode_Center,
         pdspl_colorTextOut  ,
         pdspl_ClearAll   ,  pdspl_Clear
       使之适应内外屏处理

   Revision 1.2  2003/12/26 01:57:47  zhenggl
   no message

* 24   28/10/2003  sunsj **************************************
       modify the auto width char display.
  *************************************************************

* 23   07.03.2002  13:00 zhangzg
* One argument, UBYTE in_Attrib has been added to the functions of displaying text, including
      scrText_Invert, scrText_Invert_Unicode, scrText, scrText_Unicode. These function will call
      scrTxtPoint, instead of scrPoint! scrTxtPoint is a new added function.
* The purpose of these modifications is to support transparent displaying of text and future extending   
  
      
* 22   06.12.2002  14:55 gan chunhui
* Function all function on display has been modified. The old display[][] array is 
*     not used again, scrpoint is modified to call the R2D_DrawPoint();
   
 *
 * 21    22.02.00 14:55 Fk
 * Function 'scrMobUpdate()' considers size of variable 'display[][]'
 * correctly
|
| 20    21.02.00 9:24 Le
| MMI_DISPLAY_REQ size corrected for PALLOC_SDU
 *
 * 19    14.02.00 12:37 Kk
 * adaption for tap test on pc. needed scrInit in dspl_init for
 * initialization of glob vars
|
| 18    11.02.00 14:24 Le
 *
 * 16    10.02.00 14:21 Slo
|
| 15    26.01.00 12:13 Le
| scrclear not available under windows
 *
 * 14    25.01.00 18:20 Be
|
| 13    6.01.00 9:20 Le
| Improvements for MMI tests
 *
 * 12    24.11.99 17:52 Be
|
| 11    18.11.99 14:45 Le
 *
 * 10    13.10.99 16:09 Pz
 * Adapted to new frame
 *
 * 9     2.08.99 19:03 Be
 * added ADC support
 *
 * 8     6.07.99 12:54 Es
 *
 * 7     18.05.99 9:47 Kk
 *
 * 6     4.05.99 13:42 Kk
 *
 * 4     14.04.99 17:33 Es
 *
 * 3     14.04.99 15:48 Sab
|
| 2     14.04.99 9:52 Le
|
| 1     1.04.99 11:26 Le

*/
#ifndef _INNOVATION_EMULATOR_

    #ifndef DRV_DSPL_C
        #define DRV_DSPL_C
    #endif
/*==== INCLUDES ===================================================*/
    #define ENTITY_CST

    #include <string.h>
    #if defined (WIN32)
        #include <stdio.h>
    #endif

    #if defined (NEW_FRAME)
        #include "typedefs.h"
        #include "gdi.h"
//        #include "dspl.h"
        #include "font_bitmaps.h"
        #include "vsi.h"
        #include "custom.h"
        #include "gsm.h"
        #include "prim.h"
        #include "p_mmi.h"
        #include "tok.h"
        #include "cst.h"
        #include "os.h"

    #else

        #include "stddefs.h"
        #include "gdi.h"
  //      #include "dspl.h"
        #include "font_bitmaps.h"
        #include "custom.h"
        #include "gsm.h"
        #include "prim.h"
        #include "p_mmi.h"
        #include "vsi.h"
        #include "tok.h"
        #include "cst.h"
    #endif

#else // _INNOVATION_EMULATOR_


    #ifndef DRV_DSPL_C
        #define DRV_DSPL_C
    #endif

    #define ENTITY_MFW

    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>

    #if defined (NEW_FRAME)

        #include "typedefs.h"
        #include "vsi.h"
        #include "pei.h"
        #include "custom.h"
        #include "gsm.h"

    #else

        #include "stddefs.h"
        #include "custom.h"
        #include "gsm.h"
        #include "vsi.h"

    #endif

extern T_HANDLE mmi_handle;

    #include <string.h>
    #if defined (MY_WIN32)
        #include <stdio.h>
    #endif

    #if defined (NEW_FRAME)
        #include "typedefs.h"
        #include "gdi.h"        
        #include "font_bitmaps.h"
    //    #include "dspl.h"
        #include "vsi.h"
        #include "custom.h"
        #include "gsm.h"
        #include "p_mmi.h"
        #include "tok.h"
        #include "os.h"

    #else

        #include "stddefs.h"
        #include "gdi.h"        
        #include "font_bitmaps.h"
      //  #include "dspl.h"
        #include "custom.h"
        #include "gsm.h"
        #include "prim.h"
        #include "p_mmi.h"
        #include "vsi.h"
        #include "tok.h"
        #include "cst.h"
    #endif

#endif // _INNOVATION_EMULATOR_


#include "rvf_api.h"
#include "r2d.h"
#include "dspl.h"

//#include "rvf_api.h"
//#include "r2d.h"

#include "uni16x16.h"
#include "wstring.h"  //xsf add for wstrlen() 2003.03.10

//#define TDTRACE 1
//#include "../bmi/mmiutilapi.h"

/*==== EXPORT =====================================================*/
#define ENCODE_OFFSET 24

//#define EASY_TEXT_ENABLED

#ifndef _SIMULATION_

//#if (defined(_TARGET_) && (BOARD!=41))
    #if (defined(_TARGET_) )
        #define R2D_ENABLED
    #endif

#endif

#if (defined(_INNOVATION_EMULATOR_))
    #ifndef R2D_ENABLED
        #define R2D_ENABLED
    #endif
#endif

/*==== VARIABLES ==================================================*/
static int 	 	scrX, scrY;			/* display size */
GLOBAL UBYTE	extDisplay = 0;     /* external display ? */
GLOBAL UBYTE	dspl_char_type;
GLOBAL UBYTE	dspl_font_type;
/* Robert.Chen add, for sub LCD, 2003-12-14 */
#if R2D_SUBLCD_SUPPORT
static int 		sub_scrX, sub_scrY;
GLOBAL UBYTE	dspl_sub_char_type;
GLOBAL UBYTE	dspl_sub_font_type;
#endif


int bitmap_num = 0;

GLOBAL dspl_DevCaps displayData;
/* Robert.Chen add, for sub LCD, 2003-12-14 */
#if R2D_SUBLCD_SUPPORT
GLOBAL dspl_DevCaps sub_displayData;
#endif

#if defined (NEW_FRAME)
EXTERN T_HANDLE       hCommL1;
#else
EXTERN T_VSI_CHANDLE  hCommL1;
#endif

int scrEnabled = 0;              /* screen update enable */
static int txtInvert = 0;        /* Text invert */
/* Robert.Chen add, for sub LCD, 2003-12-14 */
#if R2D_SUBLCD_SUPPORT
int sub_scrEnabled = 0;              /* sub screen update enable */
#endif

/* Definiton for multi-font infomation */
typedef struct UNIFONTTYPEtag
{
    int font_w;     /* font width */
    int font_h;     /* font height */ 	
    int font_s;     /* font size */
    int font_e;     /* the max char for a font lib table */
    char *ascfont;  /* ascii char font lib */
    char *uni0_256; /* uni 0~256 char font lib */
    char *uni_cjk;  /* uni cjk font lib */
    _UniSym_   *uni_sym;  /* uni sym font lib */
    _Uni12X12_ *uni_12x12;/* uni12x12 font lib */
    char * charwidth;     /* char width, sunsj031013 */
    char * elementmap;
} FONTINFO;

static FONTINFO *fontinfo;
/* Robert.Chen add, for sub LCD, 2003-12-14 */
#if R2D_SUBLCD_SUPPORT
#define R2D_MAINLCD		1
#define R2D_SUBLCD		0
static FONTINFO *sub_fontinfo;
#endif

/*==== FUNCTIONS ==================================================*/
/*
 * send to external Display
 */
//extern int wstrlen(char * txt);
//extern void wstrcpy(char * intxt, char * outtxt);
LOCAL void dspl_SendDisplayReq (USHORT x, USHORT y, char *text);
GLOBAL void kbd_test (UBYTE key);

⌨️ 快捷键说明

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