source: svn/newcon3bcm2_21bu/dst/dmw/src/cc/cc_display.c

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

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

  • Property svn:executable set to *
File size: 15.6 KB
Line 
1
2#include "cc_config.h"
3#include "cc_type.h"
4#include "cc_def.h"
5#include "cc_private.h"
6
7
8#if 0
9__GRAPHIC_BASE__() {}
10#endif
11
12
13
14
15static UINT16 p_resolution_table[eDCC_R_NUM][2]=
16{
17        {720, 480}, {1280, 720}, {1920, 1080}, {960, 540}
18};
19
20static UINT16 p_font_size_table[eDCC_R_NUM][3]=
21{
22        CC_F_480,
23        CC_F_720,
24        CC_F_1080,
25        CC_F_540
26};
27
28static UINT16 p_font_size_table_kor[eDCC_R_NUM][3]=
29{
30        CC_F_480_KOR,
31        CC_F_720_KOR,
32        CC_F_1080_KOR,
33        CC_F_540_KOR
34};
35
36
37static struct {
38        UINT8 service;
39        BOOL is_cc_wide;
40        BOOL is_src_wide;
41        BOOL is_korean;
42        UINT8 resolution;
43        tDCC_PenAttr font_attr;
44        tDCC_ColorMap color_map;
45        int scroll_slice;
46        int scroll_delay;
47} p_display_info;
48
49#define INFO(i) p_display_info.i
50
51
52static void p_get_safe_area(tDCC_RECT *rect)
53{
54        UINT8 r=INFO(resolution);
55       
56        if(INFO(service)>=eDCC_S_CC1 && INFO(service)<=eDCC_S_T4) {
57                rect->x=SAFE_AREA_LX_608*p_resolution_table[r][0]/100;
58                rect->y=SAFE_AREA_TY_608*p_resolution_table[r][1]/100;
59                rect->w=p_resolution_table[r][0]-(SAFE_AREA_RX_608*p_resolution_table[r][0]/100)-rect->x;
60                rect->h=p_resolution_table[r][1]-(SAFE_AREA_BY_608*p_resolution_table[r][1]/100)-rect->y;
61        }
62        else if(INFO(is_korean)==0) {
63                rect->x=SAFE_AREA_LX*p_resolution_table[r][0]/100;
64                rect->y=SAFE_AREA_TY*p_resolution_table[r][1]/100;
65                rect->w=p_resolution_table[r][0]-(SAFE_AREA_RX*p_resolution_table[r][0]/100)-rect->x;
66                rect->h=p_resolution_table[r][1]-(SAFE_AREA_BY*p_resolution_table[r][1]/100)-rect->y;
67        }
68        else {
69                rect->x=SAFE_AREA_LX_KOR*p_resolution_table[r][0]/100;
70                rect->y=SAFE_AREA_TY_KOR*p_resolution_table[r][1]/100;
71                rect->w=p_resolution_table[r][0]-(SAFE_AREA_RX_KOR*p_resolution_table[r][0]/100)-rect->x;
72                rect->h=p_resolution_table[r][1]-(SAFE_AREA_BY_KOR*p_resolution_table[r][1]/100)-rect->y;
73        }
74       
75        if(!INFO(is_cc_wide) && INFO(is_src_wide)) {
76                //width¸¦ Á¶ÀýÇØ¾ß ÇÔ.
77#if 0
78                if(INFO(service)>=eDCC_S_CS1 && INFO(service)<=eDCC_S_CS6) {
79                        rect->x+=(rect->w*SAFE_AREA_WIDE_NORMAL_GAP)/100;
80                        rect->w-=(rect->w*SAFE_AREA_WIDE_NORMAL_GAP*2)/100;
81                }
82#else
83                //608µµ µ¿ÀÏÇÏ°Ô Àû¿ëµÇ¾î¾ß ÇÒ °Í °°À½.
84                rect->x+=(rect->w*SAFE_AREA_WIDE_NORMAL_GAP)/100;
85                rect->w-=(rect->w*SAFE_AREA_WIDE_NORMAL_GAP*2)/100;
86#endif
87        }
88}
89
90static int p_get_font_size(UINT8 size)
91{
92        CCPRINT("fsize", "p_get_font_size(size(%d), resolution(%d)\n", size, INFO(resolution));
93        CCPRINT("fsize", "return %d\n", p_font_size_table[INFO(resolution)][size]);
94       
95        if(INFO(is_korean))
96                return p_font_size_table_kor[INFO(resolution)][size];
97               
98        return p_font_size_table[INFO(resolution)][size];
99}
100
101static UINT8 p_get_color(UINT8 c, UINT8 o)
102{
103        UINT8 ret=0;
104        UINT8 *color_map=(UINT8 *)&INFO(color_map);
105               
106        if(o==eDCC_O_SOLID)
107                ret = c;
108        else if(o==eDCC_O_FLASH)
109#if ENABLE_FLASH               
110                ret = eDCC_C_NONE;
111#else
112                ret = c;
113#endif
114        else if(o==eDCC_O_TRANSLUCENT)
115                ret = c | 0x8;
116        else if(o==eDCC_O_TRANSPARENT)
117                ret = eDCC_C_TRANSPARENT;
118       
119        return color_map[ret];
120}
121
122static void p_set_font_attr(tDCC_PenAttr *pattr)
123{
124        tDCC_PenAttr *pfa=pattr;
125       
126        if(!pfa) pfa=&INFO(font_attr);
127        else memcpy(&INFO(font_attr), pfa, sizeof(INFO(font_attr)));
128               
129        if(INFO(service)>=eDCC_S_CC1 && INFO(service)<=eDCC_S_T4) 
130                DCCDDI_SetFontAttr(p_get_font_size(pfa->s), pfa->i, /*pfa->u*/0, 3, pfa->et, pfa->p16);
131        else
132                DCCDDI_SetFontAttr(p_get_font_size(pfa->s), pfa->i, /*pfa->u*/0, pfa->fs, pfa->et, pfa->p16);
133}
134
135
136void DCCGrp_Init(BOOL is_cc_wide, BOOL is_src_wide, BOOL is_korean, 
137        int resolution, tDCC_ColorMap *color_map)
138{
139        if(resolution>=eDCC_R_NUM) resolution=eDCC_R_480;
140       
141        INFO(is_cc_wide)=is_cc_wide;
142        INFO(is_src_wide)=is_src_wide;
143        INFO(is_korean)=is_korean;
144        INFO(resolution)=resolution;
145       
146        INFO(scroll_slice)=CC_SCROLL_SLICE1;   
147        INFO(scroll_delay)=CC_SCROLL_DELAY1;
148       
149        if(color_map) {
150                memcpy(&INFO(color_map), color_map, sizeof(INFO(color_map)));
151        }
152       
153}
154
155
156void DCCGrp_SetService(UINT8 service)
157{
158        CCPRINT("grp_set", "Set Service : %d\n", service);
159        INFO(service)=service;
160}
161
162void DCCGrp_SetKorean(BOOL is_korean)
163{
164        CCPRINT("grp_set", "Set korean : %d\n", is_korean);
165        INFO(is_korean)=is_korean;
166}
167
168void DCCGrp_Start()
169{
170        CCPRINT("grp_set", "grp start : %d\n");
171        DCCDDI_GraphicStart(INFO(resolution));
172}
173
174
175void DCCGrp_Stop()
176{
177        CCPRINT("grp_set", "grp stop : %d\n");
178        DCCDDI_GraphicStop();   
179}
180
181
182void DCCGrp_DrawBox(int x, int y, int w, int h, int color)
183{
184        tDCC_RECT r_safe;
185       
186        CCPRINT("grp_xy", "draw_box(%d,%d,%d,%d,%d)\n", x, y, w, h, color);
187       
188        p_get_safe_area(&r_safe);
189       
190        if(w>r_safe.w) w=r_safe.w;
191        if(h>r_safe.h) h=r_safe.h;
192       
193        if(p_get_color(color, eDCC_O_SOLID)!=INFO(color_map).no)
194                DCCDDI_DrawBox(r_safe.x+x, r_safe.y+y, w, h, p_get_color(color, eDCC_O_SOLID));
195}
196
197void DCCGrp_EraseBox(int x, int y, int w, int h)
198{
199        DCCGrp_DrawBox(x, y, w, h, eDCC_C_TRANSPARENT);
200}
201
202void DCCGrp_ClearScreen()
203{
204        DCCGrp_EraseBox(0, 0, p_resolution_table[INFO(resolution)][0], p_resolution_table[INFO(resolution)][1]);
205}
206
207
208
209
210void DCCGrp_ScrollUp(int x, int y, int w, int h, int height, int bg_color)
211{
212        tDCC_RECT r_safe;
213        int i;
214       
215        CCPRINT("grp_scroll", "scroll_up(%d,%d,%d,%d,%d(height),%d(bg_color))\n", x, y, w, h, height, bg_color);
216       
217        p_get_safe_area(&r_safe);
218       
219        if(x+w>r_safe.w) w=r_safe.w-x;
220        if(y+h>r_safe.h) h=r_safe.h-y;
221
222        for(i=0; i<=height-INFO(scroll_slice); i+=INFO(scroll_slice)) {
223                DCCDDI_BLT(r_safe.x+x, r_safe.y+y-height+INFO(scroll_slice), w, h+height-INFO(scroll_slice)-i, -1*INFO(scroll_slice));
224                DCCDDI_DrawBox(r_safe.x+x, r_safe.y+y-i+h-INFO(scroll_slice), w, INFO(scroll_slice), 
225                        p_get_color(bg_color, eDCC_O_SOLID));
226               
227                DCCDDI_Delay(INFO(scroll_delay));
228        }
229       
230        if(i<height) {
231                DCCDDI_BLT(r_safe.x+x, r_safe.y+y-i, w, h, i-height);
232                DCCDDI_DrawBox(r_safe.x+x, r_safe.y+y+h-(height-i), w, height-i, 
233                        p_get_color(bg_color, eDCC_O_SOLID));
234        }       
235
236        //DCCDDI_BLT(r_safe.x+x, r_safe.y+y, w, h, -1*height);
237}
238
239void DCCGrp_ScrollDown(int x, int y, int w, int h, int height, int bg_color)
240{
241        tDCC_RECT r_safe;
242        int i;
243       
244        CCPRINT("grp_scroll", "scroll_down(%d,%d,%d,%d,%d(height),%d(bg_color))\n", x, y, w, h, height, bg_color);
245       
246        p_get_safe_area(&r_safe);
247       
248        if(x+w>r_safe.w) w=r_safe.w-x;
249        if(y+h>r_safe.h) h=r_safe.h-y;
250               
251        for(i=0; i<=height-INFO(scroll_slice); i+=INFO(scroll_slice)) {
252                DCCDDI_BLT(r_safe.x+x, r_safe.y+y+i, w, h+height-INFO(scroll_slice)-i, INFO(scroll_slice));
253                DCCDDI_DrawBox(r_safe.x+x, r_safe.y+y+i, w, INFO(scroll_slice), 
254                        p_get_color(bg_color, eDCC_O_SOLID));
255                DCCDDI_Delay(INFO(scroll_delay));
256        }
257       
258        if(i<height) {
259                DCCDDI_BLT(r_safe.x+x, r_safe.y+y+i, w, h, height-i);
260                DCCDDI_DrawBox(r_safe.x+x, r_safe.y+y+i, w, height-i, 
261                        p_get_color(bg_color, eDCC_O_SOLID));
262        }
263               
264        //DCCDDI_BLT(r_safe.x+x, r_safe.y+y, w, h, height);
265}
266
267void DCCGrp_SetScrollSpeed(int delay, int slice)
268{
269        INFO(scroll_slice)=slice;       
270        INFO(scroll_delay)=delay;
271}
272
273//draw mode: 0->±ÛÀÚ ¾Õ µÚ 3pixelÀ» ´õ ±×¸², 1->¾Õ 3, 2->µÚ 3, 3->Ãß°¡·Î ¾È±×¸².
274int DCCGrp_PrintCh(int x, int y, UINT16 ch, int draw_mode)
275{
276        tDCC_RECT r_safe;
277        int c_font, c_back, c_edge, size;
278        int ch_width, ch_height;
279       
280        p_get_safe_area(&r_safe);
281       
282        ch_width=DCCGrp_GetChWidth(ch);
283        ch_height=DCCGrp_GetMaxFontHeight(INFO(font_attr).s);
284       
285        if(x<0 || y<0 || x+ch_width>r_safe.w || y+ch_height>r_safe.h) {
286                void get_cc_info(void);
287                void get_def_win(void);
288               
289                CCPRINT("error", "!! print pos is bad(%d,%d), safe(%d,%d,%d,%d)\n", 
290                        x, y, r_safe.x, r_safe.y, r_safe.w, r_safe.h);
291               
292                get_cc_info();         
293                get_def_win();
294               
295                //OS_Delay(OS_GetTicksPerSecond()*60*60*24);
296               
297                return 0;
298        }
299       
300        c_font=p_get_color(INFO(font_attr).fc, INFO(font_attr).fo);
301        c_back=p_get_color(INFO(font_attr).bc, INFO(font_attr).bo);
302        c_edge=p_get_color(INFO(font_attr).ec, INFO(font_attr).fo);
303       
304        CCPRINT("grp_ch", "print_ch(char(0x%x) xy(%d,%d), w(%d), color(f:%d,b:%d,e:%d), fs(%d)\n", 
305                ch, x, y, ch_width, c_font, c_back, c_edge, INFO(font_attr).fs);
306       
307        if(c_back!=INFO(color_map).no && ch!=DCC_TRP_CODE) { //0x120À̸é trp·Î ó¸®ÇÔ.
308               
309                switch(draw_mode) {
310                        case ePRIV_CH_DRAW_TYPE_ALL:
311                                DCCDDI_DrawBox(r_safe.x+x-CC_CH_DRAW_ADDING_WIDTH, r_safe.y+y, 
312                                        ch_width+2*CC_CH_DRAW_ADDING_WIDTH, ch_height, c_back);
313                                break;
314                        case ePRIV_CH_DRAW_TYPE_LEFT:
315                                DCCDDI_DrawBox(r_safe.x+x-CC_CH_DRAW_ADDING_WIDTH, r_safe.y+y, 
316                                        ch_width+CC_CH_DRAW_ADDING_WIDTH, ch_height, c_back);
317                                break;
318                        case ePRIV_CH_DRAW_TYPE_RIGHT:
319                                DCCDDI_DrawBox(r_safe.x+x, r_safe.y+y, 
320                                        ch_width+CC_CH_DRAW_ADDING_WIDTH, ch_height, c_back);
321                                break;
322                        case ePRIV_CH_DRAW_TYPE_NONE:
323                                DCCDDI_DrawBox(r_safe.x+x, r_safe.y+y, ch_width, ch_height, c_back);
324                                break;
325                }
326        }
327       
328        size=p_get_font_size(INFO(font_attr).s);
329
330#if 0   
331        p_set_font_attr(NULL);
332#endif
333
334        //y°ª º¸Á¤ÇÔ.
335        y+=(ch_height-size)/2+FONT_ALING_ADJ;
336       
337        if(c_font!=INFO(color_map).no && ch!=DCC_TRP_CODE) {
338               
339                int newx=x+(ch_width-DCCDDI_GetChWidth(ch))/2;
340               
341                if(INFO(font_attr).i) {
342                        if(INFO(font_attr).fs==eDCC_FS_CASUAL || INFO(font_attr).fs==eDCC_FS_CURSIVE)
343                                newx-=ch_height/4;
344                        else if(INFO(font_attr).fs==eDCC_FS_SMALLCAPITAL)
345                                newx-=ch_height/10;
346                }
347                //casual italicÀÎ °æ¿ì(jungle¿¡¼­) ¸¹ÀÌ ¾ÕÂÊÀ¸·Î ´ç°ÜÁà¾ß ÇÔ.
348               
349                        //italic ó¸® ¶§¹®¿¡ ¿ìÃøÀ¸·Î 1¸¸Å­ ´õ À̵¿ÇÔ->italicÀÏ °æ¿ì width¸¦ ´õ Ű¿ì´Â °É·Î º¯°æ.
350                DCCDDI_PrintCh(r_safe.x+newx, r_safe.y+y, ch, c_font, c_edge);
351        }
352       
353        if(INFO(font_attr).u && ch != 0x20 && c_font!=INFO(color_map).no && ch!=DCC_TRP_CODE) {
354                DCCDDI_DrawHLine(r_safe.x+x, r_safe.y+y+ch_height*8/10, 
355                        ch_width, c_font);
356        }
357       
358        CCPRINT("grp_xy", "print_ch(char(0x%x) xy(%d,%d), w(%d), color(f:%d,b:%d,e:%d), fs(%d)\n", 
359                ch, x, y, ch_width, c_font, c_back, c_edge, INFO(font_attr).fs);
360       
361        return ch_width;
362}
363
364int DCCGrp_GetChWidth(UINT16 ch)
365{
366        int ch_width;
367        //analogÀÏ °æ¿ì
368        if(INFO(service)>=eDCC_S_CC1 && INFO(service)<=eDCC_S_T4) {
369                tDCC_RECT r_safe;
370                p_get_safe_area(&r_safe);
371               
372                return r_safe.w/(DCC_608_WIN_WIDTH+1);
373        }
374       
375        //0x520Àº transparentÀÓ. °ø¹é°ú °°ÀÌ °£ÁÖÇÔ.
376        if(ch==DCC_TRP_CODE) ch=0x20;
377               
378        ch_width=DCCDDI_GetChWidth(ch);
379       
380        ch_width=ch_width*FONT_WIDTH_FACTOR/10;
381       
382        //italicÀº ch_width¸¦ Á» Ű¿ö¾ß ÇÔ.
383        if(INFO(font_attr).i) {
384                if(INFO(font_attr).fs==eDCC_FS_CASUAL/* || INFO(font_attr).fs==eDCC_FS_CURSIVE*/)
385                        ch_width=ch_width*12/10;
386                else
387                        ch_width=ch_width*11/10; //ÀÏ¹Ý italicÀÎ °æ¿ì ¾à 1.1¹è¸¦ ´õÇØÁÜ.
388        }
389       
390        return ch_width;
391}
392
393int DCCGrp_GetStrWidth(UINT16 *str)
394{
395        int i, sum;
396       
397        for(i=0, sum=0; str[i]; i++)
398                sum+=DCCGrp_GetChWidth(str[i]);
399       
400        return sum;
401}
402
403int DCCGrp_GetStrNWidth(UINT16 *str, int n)
404{
405        int i, sum;
406       
407        for(i=0, sum=0; str[i] && i<n; i++)
408                sum+=DCCGrp_GetChWidth(str[i]);
409       
410        return sum;
411}
412
413
414void DCCGrp_SetFontAttr(tDCC_PenAttr *pattr)
415{
416        if(memcmp(&INFO(font_attr), pattr, sizeof(INFO(font_attr)))==0) return;
417               
418        memcpy(&INFO(font_attr), pattr, sizeof(INFO(font_attr)));
419       
420        p_set_font_attr(NULL);
421                        //underlineÀº display¿¡¼­ ó¸®ÇÔ.
422}
423
424
425tDCC_PenAttr *DCCGrp_GetFontAttr()
426{
427        return &INFO(font_attr);
428}
429
430int DCCGrp_GetMaxFontWidth(UINT8 size, BOOL bhalf) 
431{
432        int max_w = 0;
433        int i;
434        int t_w;
435        //¾Æ·¡´Â ÀûÀýÇÑ ºñÀ²·Î ´ëüÇÏ´Â °ÍÀÌ ÁÁÀ½.
436        //480 ¸ðµå:
437        //      ¿øÄ¢ÀûÀ¸·Î´Â font size°¡ 17À» ³Ñ¾î°¡¸é ¹®Á¦ ÀÖÀ½. 17*32=544.
438        //ÇÑ±Û CC¸¦ À§Çؼ­ bhalf Ãß°¡ÇÔ. bhalf°¡ trueÀÌ¸é ¹ÝÀÚ, falseÀ̸é ÀüÀÚÀÓ.
439        //ÀüÀÚ´Â 'W'»çÀÌÁ ±âÁØÀ¸·Î ±×´ë·Î ³Ñ±â°í ¹ÝÀÚÀÇ °æ¿ì´Â ÀüÀÚÀÇ 60% »çÀÌÁ ³Ñ±è.
440#if 0   
441
442        for (i = 0x20; i < 0x80; i++)
443        {
444                t_w = DCCGrp_GetChWidth(i);
445                if (max_w < t_w)
446                        max_w = t_w;
447        }
448
449        if (INFO(is_korean))
450                return max_w;   //ÇѱÛÀº edge ¾øÀ½, font style ¾øÀ½
451        return max_w * 12 / 10; //¾à 1.2¹è¸¦ ÇØ ÁÜ -> edge, font styleÀÌ Áß°£¿¡ º¯ÇÒ ¼ö ÀÖÀ½
452#else
453
454        //±æÀÌ¿¡ ¿µÇâÀ» ÁÙ ¼ö ÀÖ´Â º¯¼ö´Â font style, size, italic, edgeÀÓ
455        //±×·±µ¥, font style Áö¿ø ¾ÈÇÔ. edge Áö¿ø ¾ÈÇÔÀ̱⠶§¹®¿¡, size¿Í italic¸¸ °í·ÁÇÔ.
456        static struct {
457                UINT8 size;
458                UINT8 max_ch_with;
459                UINT8 italic;
460        } font_buf[6];
461       
462        int num_font=6; // 2012.11.02 megakiss ¹ÌÁÖÇâ ÆùÆ® °¹¼ö´Â 6°³ÀÓ
463        int ret_val;
464       
465        INFO(font_attr).s=size;
466
467        p_set_font_attr(NULL);
468       
469#if 0   
470        for(i=0; i<num_font; i++) {
471                if(INFO(font_attr).s==font_buf[i].size && INFO(font_attr).i==font_buf[i].italic) {
472                        return bhalf?font_buf[i].max_ch_with*3/5:font_buf[i].max_ch_with;
473                }
474        }
475#endif
476       
477        //±¹³»ÇâÀÎ °æ¿ì´Â ´ëÇ¥ ±Û²ÃÀ» Çϳª ¼±ÅÃÇØ¼­ ±× ±Û²ÃÀ» ±âÁØÀ¸·Î ÇÔ.
478        //³ª´®°íµñÀº ÀÌ ¼öÁØÀ¸·Î ÇØµµ µÉ µí.->w±âÁØ 10% ´õ Å« °ªÀ» ¼±ÅÃÇÔ.
479#if USE_KOR_CC
480        ret_val=DCCGrp_GetChWidth('W')*11/10;
481#else //italic,edge µîÀ» °í·ÁÇϸé Å©°Ô Àâ¾Æ³õ´Â°Ô ÁÁÀ½.
482        ret_val=DCCGrp_GetChWidth('W')*13/10;
483#endif
484
485        if(num_font<6) {
486                font_buf[num_font].size=size;
487                font_buf[num_font].max_ch_with=ret_val;
488                font_buf[num_font].italic=INFO(font_attr).i;
489                num_font++;
490        }
491       
492        return bhalf?ret_val*3/5:ret_val;
493#endif
494}
495
496int DCCGrp_GetMaxFontHeight(UINT8 size)
497{
498        //¼¼·Î 15ÁÙÀ» ±âÁØÀ¸·Î Çϱ⠶§¹®¿¡
499        //safe area¸¦ 15·Î ³ª´« °ªÀ» ¸®ÅÏÇϵµ·Ï ÇÔ
500        //tDCC_RECT r_safe;
501        int height;
502       
503        if(INFO(service)>=eDCC_S_CC1 && INFO(service)<=eDCC_S_T4) {
504                tDCC_RECT r_safe;
505                p_get_safe_area(&r_safe);
506               
507                return r_safe.h/(DCC_608_WIN_HEIGHT+1);
508        }
509
510#if 0
511        p_get_safe_area(&r_safe);
512        height=r_safe.h/MAX_NUM_ROW;
513#elif 1
514
515        height=p_get_font_size(size)*FONT_HEIGHT_FACTOR/10; //¾à 1.2¹èÀÇ Å©±â.
516#else
517
518        INFO(font_attr).s=size;
519               
520        p_set_font_attr(NULL);
521       
522        height=DCCDDI_GetChHeight('j');
523#endif
524
525        return height;
526}
527
528int DCCGrp_GetScrPosX(int cc_pos_x)
529{
530        //anchor horizontal·Î À§Ä¡¸¦ ¸®ÅÏÇÔ
531        //anchor horizontalÀº 0-99ÀÇ °ªÀ» °¡Áü
532        tDCC_RECT r_safe;
533       
534        p_get_safe_area(&r_safe);
535       
536        return r_safe.w*cc_pos_x/100;
537}
538
539int DCCGrp_GetScrPosY(int cc_pos_y)
540{
541        //anchor horizontal·Î À§Ä¡¸¦ ¸®ÅÏÇÔ
542        //anchor horizontalÀº 0-99ÀÇ °ªÀ» °¡Áü
543        tDCC_RECT r_safe;
544       
545        p_get_safe_area(&r_safe);
546       
547        return r_safe.h*cc_pos_y/100;
548}
549
550void DCCGrp_AdjustRect(tDCC_RECT *rect)
551{
552        tDCC_RECT r_safe;
553       
554        p_get_safe_area(&r_safe);
555       
556        if(rect->w<0) rect->w=0;
557        if(rect->h<0) rect->h=0;
558        if(rect->w>r_safe.w) rect->w=r_safe.w;
559        if(rect->h>r_safe.h) rect->h=r_safe.h;
560                //ÃÖ¼ÒÇÑ w, h´Â 0ÀÌ µÇ¾î¼­´Â ¾ÈµÊ. safe areaº¸´Ù´Â ÀÛ¾Æ¾ß ÇÔ.
561
562#if USE_WIN_RECT_ADJ==1 //Å©±â °íÁ¤. ÁÂÇ¥ À̵¿
563       
564        if(rect->x<0) rect->x=0;
565        if(rect->y<0) rect->y=0;
566        if(rect->x+rect->w>r_safe.w) rect->x=r_safe.w-rect->w;
567        if(rect->y+rect->h>r_safe.h) rect->y=r_safe.h-rect->h;
568       
569#elif USE_WIN_RECT_ADJ==2 //Å©±â º¯°æ. ÁÂÇ¥ °íÁ¤
570
571        if(rect->x<0) {rect->w+=rect->x; rect->x=0;}
572        if(rect->y<0) {rect->h+=rect->y; rect->y=0;}
573        if(rect->x+rect->w>r_safe.w) rect->w=r_safe.w-rect->x;
574        if(rect->y+rect->h>r_safe.h) rect->h=r_safe.h-rect->y;
575#elif USE_WIN_RECT_ADJ==3 //°¡·Î´Â Å©±â º¯°æ/ÁÂÇ¥ °íÁ¤, ¼¼·Î´Â Å©±â °íÁ¤/ÁÂÇ¥ À̵¿
576        if(rect->x<0) {rect->w+=rect->x; rect->x=0;}
577        if(rect->x+rect->w>r_safe.w) rect->w=r_safe.w-rect->x;
578       
579        if(rect->y<0) rect->y=0;
580        if(rect->y+rect->h>r_safe.h) rect->y=r_safe.h-rect->h;
581#endif
582
583}
584
585
586#if 0
587__WINDOW_DRAW__() {}
588#endif
589
590
591
592void cc_grp_info()
593{
594        tDCC_PenAttr *pattr=&INFO(font_attr);
595       
596        printf("cc_wide(%d), src_wide(%d), korean(%d), resolution(%d)\n", 
597                INFO(is_cc_wide), INFO(is_src_wide), INFO(is_korean), INFO(resolution));
598       
599        printf("Pen Attr...\n");
600        printf("s(%d),fs(%d),tt(%d), o(%d), u(%d), i(%d), et(%d)\n",
601                pattr->s, pattr->fs, pattr->tt, pattr->o, pattr->u, pattr->i, pattr->et);
602        printf("fc(%d), fo(%d), bc(%d), bo(%d), ec(%d)\n",
603                pattr->fc, pattr->fo, pattr->bc, pattr->bo, pattr->ec);
604}
605       
606
607void cc_safe_area()
608{
609        tDCC_RECT r_safe;
610       
611        p_get_safe_area(&r_safe);
612       
613        printf("------------------------------------------\n");
614        printf("safe area(%d,%d,%d,%d)\n", r_safe.x, r_safe.y, r_safe.w, r_safe.h);
615        printf("------------------------------------------\n");
616}
617       
618       
619
Note: See TracBrowser for help on using the repository browser.