source: svn/newcon3bcm2_21bu/dst/dmw/src/include/GFN_Base.h @ 76

Last change on this file since 76 was 76, checked in by megakiss, 10 years ago

1W 대기전력을 만족시키기 위하여 POWEROFF시 튜너를 Standby 상태로 함

  • Property svn:executable set to *
File size: 7.9 KB
Line 
1/******************************************************************************
2
3Copyright (c) 2004 Digital STREAM Technology Inc. All Rights Reserved
4
5FILE NAME
6
7        GFN_Base.h
8
9VERSION
10
11        Version 0.4
12
13DESCRIPTION
14
15        This file is header file for Font Manager module in Graphics Lib.
16
17AUTHOR
18
19        S/W 3 team                      Jongki-Jeong
20
21HISTORY
22
23        NAME                    DATE                            REMARKS
24
25        Jong-ki Jeong           05-25-2004                      Created initial version 0.01
26        Jong-ki Jeong           05-25-2004              add gfn_open_page_print
27                                                                                        add gfn_open_page_uprint
28                                                                                        add gfn_close_page_print
29                                                                                        add gfn_get_page_info
30                                                                                add gfn_page_move_down
31                                                                                add gfn_page_move_up
32                                                                                add GFN_INSIDE
33        Jinsook Kim                     06-24-2004              modify GFN_INSIDE ¿¡ UT_FC fc Ãß°¡
34        Jinsook Kim                     06-25-2004              Updated version : 0.01->0.1
35        Jinsook Kim                     08-18-2004              Updated version : 0.1->0.2
36        Jinsook Kim                     09-17-2004              modify FN_CACHE [jum3, jum1 ¿¡ ´ëÇÑ member Ãß°¡]
37        Jong-ki Jeong           03-14-2005              font mode, user font °ü·Ã ±¸Á¶Ã¼ ¹× ÇÔ¼öÃß°¡
38        Jinsook Kim                     03-30-2005              Updated version : 0.2->0.3
39        Jinsook Kim                     04-21-2005              Updated version : 0.3->0.4
40
41REMARK
42
43
44***************************************************************************/
45                                                                                                                                               
46#ifndef  GFN_BASE_H
47#define  GFN_BASE_H
48
49#include "GFN_Service.h"
50#include "JUNGLE/JungleSupport.h"
51
52#ifdef __cplusplus
53extern "C" {
54#endif
55
56typedef struct {
57       
58        UINT8   ascii_w[128-32+1];      //min ascii 32 , max ascii 128
59        UINT8   ascii_h[128-32+1];
60        UINT8   ofs_y[128-32+1];
61        SINT32  max_char_h;
62        SINT32  max_char_w;
63        SINT32  min_ofs_y;
64        SINT32  line_height;
65        SINT32  jum3_width;             //[...]ÀÇ ÃѱæÀÌ
66        SINT32  jum3_height;    //[...]ÀÇ ³ôÀÌ
67        SINT32  jum1_width;             //[.]ÀÇ ³ÐÀÌ
68        SINT32  jum1_hor_pitch; //[.]ÀÇ horizontal pitch
69        SINT32  jum1_ox;                //[.]ÀÇ image.bbox.ox
70       
71}FN_CACHE;                                      //size ¿¡ ´ëÇÑ cache
72
73typedef struct {
74        UINT16  *data;
75        SINT16  sx;
76        SINT16  sy;
77}FN_LINE_DATA;
78
79
80typedef enum {
81        FN_PAGE_NONE    =       0,              // virtual port °¡ »ç¿ëµÇÁö¾Ê´Â»óÅÂÀÓ
82        FN_PAGE_INIT    =       1,
83        FN_PAGE_USING   =       2,     
84}FN_PAGE_STAT;
85
86typedef enum {
87        FN_PAGE_NORMAL  =       0,
88        FN_PAGE_AROUND  =       1,
89}FN_PAGE_TYPE;
90
91
92#define  GFN_CACHE(cv)  (&(((GFN_INSIDE *)(cv)->font_inside)->cache[(cv)->font_mode%GFN_NUM_MODE]))
93
94
95typedef struct {
96        FN_CACHE                cache[GFN_NUM_MODE];                            //size ¸¦ ´ã°í ÀÖ´Â cache
97/*
98#define MIN_CHAR_WIDTH  10
99#define MAX_CHAR_WIDTH  44
100        SINT8                   max_char_width[MAX_CHAR_WIDTH-MIN_CHAR_WIDTH+1];
101        SINT8                   max_char_height[MAX_CHAR_WIDTH-MIN_CHAR_WIDTH+1];
102        SINT8                   max_char_jum3_size[MAX_CHAR_WIDTH-MIN_CHAR_WIDTH+1];
103*/     
104        SINT32                  last_x;                         //canvas ¿¡ ±ÛÀÚ¸¦ ¾´ÈÄ ´ÙÀ½ x ÁÂÇ¥ 
105
106/* GFN_OpenVirPrint µîÀÇ ÇÔ¼ö³»¿¡¼­ »ç¿ë */     
107        GFN_FONT_ATTR   bak_attr;
108        GFN_FONT_ATTR   page_font_attr;
109        FN_LINE_DATA    *line_datas;            //¶óÀεéÀÇ text ¹è¿­
110
111        FN_PAGE_STAT    page_text_used;                 //»ç¿ëµÇ°íÀÖ´Â ¿©ºÎ PAge ÇÔ¼ö¸¦ »ç¿ëÇÑµÚ Ç×»ó NONE À¸·Î clear µÈ´Ù.
112        FN_PAGE_STAT    page_text_used_backup;  //»ç¿ëµÇ°íÀÖ´Â ¿©ºÎ     
113       
114        FN_PAGE_TYPE    type;                           //page scroll À» ¾î¶²½ÄÀ¸·Î Áö¿øÇϴ°¡
115        GRP_RECT                page_text_r;            //page pixel Å©±â¿Í ½ÃÀÛ ÁÂÇ¥
116        SINT32                  text_total_line;        //total ¶óÀÎ ¼ö
117       
118        SINT32                  top_line_index;         //page ¿¡¼­ Á¦ÀÏ Ã¹¶óÀÎ
119        SINT32                  line_per_page;          //page ´ç line ¼ö
120        SINT32                  curr_pos_index;         //ÇöÀç Ä¿¼­°¡ ÀÖ´Ù°í °¡Á¤ÇßÀ»¶§ pos index
121        UINT16                  *alloc_string;          //ascii code µéÀ» unicode ·Î º¯È¯ÇÑ pointer
122       
123
124        UT_FC                   fc;                                                             
125}GFN_INSIDE;                                                    //³»ºÎ¾È¿¡¼­ »ç¿ëµÇ´Â ROOTINE
126
127/********************* debug ºÎºÐ ********************************/
128//int g_Trace_FontDebug=3;
129//4=value check, 3=enter/exit, 2=warning, 1=error
130//int gfn_printf(int level, char *fmt, ...) ;
131int gfn_printf(char *fmt, ...) ; 
132
133/******* jungle engine ********************************************************/
134void    JG_init( void ) ;
135void    JG_free (CANVAS *cv) ;
136void    JG_get_max_char_size(CANVAS *cv, SINT32 *max_width ,SINT32 *max_height) ;
137void    JG_set_attr(CANVAS *cv ) ;
138void    JG_get_uchar_size(CANVAS *cv, SINT32 *width, SINT32 *height, SINT32 *ofs_y, UINT16 ch) ;
139SINT32  JG_put_char(CANVAS      *cv, SINT32 pos_x, SINT32 pos_y, UINT16 ch) ;
140SINT32  JG_get_real_char_size(CANVAS *cv, SINT32 *char_x, SINT32 *char_y, SINT32 *char_w, SINT32 *char_h, UINT16 ch) ;
141void    JG_open(CANVAS *cv) ;
142
143/******* user bitmap font *****************************************************/
144void    BIT_get_max_char_size(CANVAS *cv , SINT32 *max_width ,SINT32 *max_height ) ;
145void    BIT_set_attr(CANVAS *cv ) ;
146void    BIT_get_uchar_size(CANVAS *cv,SINT32 *width, SINT32 *height, SINT32 *ofs_y, UINT16      ch) ;
147SINT32  BIT_font_register( CANVAS *cv , void *finfo_ptr ) ;
148SINT32  BIT_get_real_char_size(CANVAS *cv,SINT32 *char_x, SINT32 *char_y, SINT32 *char_w, SINT32 *char_h, UINT16 ch) ;
149SINT32  BIT_put_char(CANVAS *cv, SINT32 sx, SINT32 sy, UINT16 ch) ;
150void    BIT_free(CANVAS *cv) ;
151
152/******* dst bitmap font ******************************************************/
153void    DST_get_max_char_size(CANVAS *cv , SINT32 *max_width ,SINT32 *max_height ) ;
154void    DST_set_attr(CANVAS *cv) ;
155void    DST_get_uchar_size(CANVAS *cv,SINT32 *width, SINT32 *height, SINT32 *ofs_y, UINT16      ch) ;
156SINT32  DST_font_register(CANVAS *cv, void *dst_hfinfo_ptr, void *user_efinfo_ptr) ;
157SINT32  DST_put_char(CANVAS *cv, SINT32 sx, SINT32 sy, UINT16 ch) ;
158void    DST_free(CANVAS *cv) ;
159
160/******* common functions *****************************************************/
161void    make_multi_string(SINT8 *string) ;
162SINT32  get_num_line(SINT8 *string) ;
163SINT32  get_line_string(SINT8 *src_string, SINT8 *tar_string, int line_num) ;
164SINT32  line_str_len(SINT8 *src_string) ;
165
166int     u_get_line_string(UINT16 *src_string, UINT16 *tar_string, int line_num) ;
167int     u_get_num_line(UINT16 *string) ;
168int     u_line_str_len(UINT16 *src_string) ;
169int     u_strcpy(UINT16 *tar, UINT16 *src) ;
170int     u_strlen(UINT16 *usp) ;
171
172void    gfn_init(CANVAS *cv, UINT32 font_nation) ;
173void    gfn_set_font_nation(CANVAS *cv, GRP_NATION f_nation) ;
174void    gfn_set_attr(CANVAS     *cv) ;
175void    gfn_get_max_char_size(CANVAS *cv, SINT32 *max_width, SINT32 *max_height ) ;
176SINT32  gfn_get_real_char_size(CANVAS *cv, SINT32 *char_x, SINT32 *char_y, SINT32 *char_w, SINT32 *char_h, UINT16 ch) ;
177SINT32  gfn_put_uchar(CANVAS    *cv, SINT32     sx, SINT32      sy, UINT16      ch) ;
178void    gfn_free(CANVAS *cv);
179void    gfn_get_uchar_size(     CANVAS  *cv,  SINT32 *width , SINT32 *height, SINT32 *ofs_y,UINT16 ch) ;
180
181SINT32  gfn_put_string(CANVAS *cv, SINT32 x, SINT32 y, SINT32 w, SINT32 h,      SINT8 *str) ;
182SINT32  gfn_put_ustring(CANVAS *cv, SINT32 x, SINT32 y, SINT32 w, SINT32 h, UINT16 *unicode) ;
183SINT32  gfn_put_string_xy(CANVAS *cv,SINT32 *sx,SINT32 *sy, SINT8 *string) ;
184SINT32  gfn_put_ustring_xy(CANVAS *cv,SINT32 *sx,SINT32 *sy, UINT16 *unicode, SINT32 max_len,SINT32 str_w) ;
185
186SINT32  gfn_get_ustr_size(CANVAS *cv,SINT32 *w, SINT32 *h, UINT16 *unicode, SINT32 *ofs_y, SINT32 max_len ) ;
187void    gfn_get_str_size(CANVAS *cv,SINT32 *w, SINT32 *h, SINT8 *string ) ;
188SINT32  gfn_put_line_ustring(CANVAS *cv, SINT32 *sx,  SINT32 *sy, SINT32 width, UINT16 *str_ptr, SINT32 max_len) ;
189SINT32  gfn_put_line_string(CANVAS *cv, SINT32 *sx,  SINT32 *sy, SINT32 width,SINT8 *string, SINT32 max_len) ;
190
191void    gfn_open_page_print(CANVAS *cv, SINT32 sx, SINT32 sy,   SINT32 w, SINT32 h ,SINT8 *str ) ;
192void    gfn_open_page_uprint(CANVAS *cv, SINT32 sx, SINT32 sy, SINT32 w, SINT32 h ,UINT16 *str ) ;
193void    gfn_page_move_down(CANVAS *cv ) ;
194void    gfn_page_move_up(CANVAS *cv ) ;
195void    gfn_get_page_info(CANVAS *cv, int *total_line ,int *line_per_page, int *top_index,int *curr_pos_index) ;
196void    gfn_close_page_print(CANVAS *cv) ;
197void    gfn_reset_cache(CANVAS *cv) ;
198SINT32  gfn_get_line_height(CANVAS *cv) ;
199
200int     KSX2Unicode(unsigned char *in_str, unsigned short *out_str, char bConvert) ;
201int     Ascii2Unicode(unsigned char     *in_str, unsigned short *out_str) ;
202
203#ifdef __cplusplus
204} 
205#endif
206
207#endif
208//-----------------------------------------end of file
Note: See TracBrowser for help on using the repository browser.