FreeCalypso > hg > tcs211-l1-reconst
comparison chipsetsw/drivers/drv_app/r2d/r2d_fonts.c @ 0:509db1a7b7b8
initial import: leo2moko-r1
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 01 Jun 2015 03:24:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:509db1a7b7b8 |
---|---|
1 /** | |
2 | |
3 @file: r2d_fonts.c | |
4 | |
5 @author Christophe Favergeon | |
6 | |
7 @version 0.5 | |
8 | |
9 Purpose: Font file including all fonts definition which are LCD | |
10 dependen | |
11 | |
12 */ | |
13 | |
14 /* | |
15 | |
16 Date Modification | |
17 ------------------------------------ | |
18 06/02/2001 Create | |
19 10/18/2001 Version 0.5 for first integration with Riviera database | |
20 | |
21 | |
22 (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved | |
23 */ | |
24 | |
25 #include "rv/general.h" | |
26 | |
27 #include "rvm/rvm_gen.h" | |
28 #include "rvm/rvm_ext_priorities.h" | |
29 #include "rvf/rvf_api.h" | |
30 | |
31 #include "r2d/r2d_config.h" | |
32 #include "r2d/r2d.h" | |
33 #include "r2d/r2d_i.h" | |
34 | |
35 | |
36 extern T_R2D_FONT_DESCRIPTION *r2d_g_font_configuration; | |
37 | |
38 #define r2d_new_font(name) T_R2D_FRAMEBUFFER* r2d_g_font_framebuffer_##name=NULL; \ | |
39 INT32 *r2d_g_font_metrics_##name=(INT32*)r2d_font_metric_##name+R2D_METRIC_START | |
40 | |
41 #define r2d_init_font_field(field,name) { \ | |
42 r2d_g_font_configuration[field].table=(INT32*)r2d_font_ptree_##name; \ | |
43 r2d_g_font_configuration[field].metrics=r2d_g_font_metrics_##name; \ | |
44 r2d_g_font_configuration[field].framebuffer=(T_R2D_FRAMEBUFFER_PTR)r2d_g_font_framebuffer_##name; \ | |
45 r2d_g_font_configuration[field].compute_bold=FALSE; \ | |
46 } | |
47 | |
48 #define r2d_init_font_field_without_bold(field,name) { \ | |
49 r2d_g_font_configuration[field].table=(INT32*)r2d_font_ptree_##name; \ | |
50 r2d_g_font_configuration[field].metrics=r2d_g_font_metrics_##name; \ | |
51 r2d_g_font_configuration[field].framebuffer=(T_R2D_FRAMEBUFFER_PTR)r2d_g_font_framebuffer_##name; \ | |
52 r2d_g_font_configuration[field].compute_bold=TRUE; \ | |
53 } | |
54 | |
55 #define r2d_clean_font(name) \ | |
56 rvf_free_buf((void*)(r2d_g_font_framebuffer_##name->mutex));\ | |
57 rvf_free_buf((void*)(r2d_g_font_framebuffer_##name));\ | |
58 r2d_g_font_framebuffer_##name=NULL; | |
59 | |
60 #if (R2D_REFRESH == R2D_VERTICAL) | |
61 #define r2d_init_font(name) \ | |
62 h=r2d_font_metric_##name[0]; \ | |
63 v=r2d_font_metric_##name[1]; \ | |
64 words=r2d_font_metric_##name[2]; \ | |
65 rvf_get_buf(r2d_mb_id, sizeof(T_R2D_FRAMEBUFFER), \ | |
66 (T_RVF_BUFFER**)&r2d_g_font_framebuffer_##name);\ | |
67 if (r2d_g_font_framebuffer_##name==NULL)\ | |
68 ret_err=R2D_MEMORY_ERR;\ | |
69 else\ | |
70 {\ | |
71 length=h*words; \ | |
72 r2d_g_font_framebuffer_##name->p_memory_words=(UINT32*)r2d_font_bitmap_##name; \ | |
73 r2d_g_font_framebuffer_##name->refcount=-1; \ | |
74 r2d_g_font_framebuffer_##name->kind=R2D_LCD_KIND; \ | |
75 r2d_g_font_framebuffer_##name->p_frame_buffer_end=r2d_g_font_framebuffer_##name->p_memory_words+length; \ | |
76 r2d_g_font_framebuffer_##name->width=h; \ | |
77 r2d_g_font_framebuffer_##name->height=v; \ | |
78 rvf_get_buf(r2d_mb_id, sizeof(T_RVF_MUTEX), \ | |
79 (T_RVF_BUFFER**)&(r2d_g_font_framebuffer_##name->mutex));\ | |
80 if (r2d_g_font_framebuffer_##name->mutex!=NULL)\ | |
81 {\ | |
82 T_RVF_RET err;\ | |
83 err=rvf_initialize_mutex(r2d_g_font_framebuffer_##name->mutex);\ | |
84 if (err!=RVF_OK)\ | |
85 {\ | |
86 ret_err=R2D_MEMORY_ERR;\ | |
87 rvf_free_buf((void*)(r2d_g_font_framebuffer_##name->mutex));\ | |
88 rvf_free_buf((void*)(r2d_g_font_framebuffer_##name));\ | |
89 r2d_g_font_framebuffer_##name=NULL;\ | |
90 }\ | |
91 }\ | |
92 else\ | |
93 {\ | |
94 ret_err=R2D_MEMORY_ERR;\ | |
95 rvf_free_buf((void*)(r2d_g_font_framebuffer_##name));\ | |
96 r2d_g_font_framebuffer_##name=NULL;\ | |
97 }\ | |
98 } | |
99 #else | |
100 #define r2d_init_font(name) h=r2d_font_metric_##name[0]; \ | |
101 v=r2d_font_metric_##name[1]; \ | |
102 words=r2d_font_metric_##name[2]; \ | |
103 rvf_get_buf(r2d_mb_id, sizeof(T_R2D_FRAMEBUFFER), \ | |
104 (T_RVF_BUFFER**)&r2d_g_font_framebuffer_##name);\ | |
105 if (r2d_g_font_framebuffer_##name==NULL)\ | |
106 ret_err=R2D_MEMORY_ERR;\ | |
107 else\ | |
108 {\ | |
109 length=v*words; \ | |
110 r2d_g_font_framebuffer_##name->p_memory_words=(UINT32*)r2d_font_bitmap_##name; \ | |
111 r2d_g_font_framebuffer_##name->refcount=-1; \ | |
112 r2d_g_font_framebuffer_##name->kind=R2D_LCD_KIND; \ | |
113 r2d_g_font_framebuffer_##name->p_frame_buffer_end=r2d_g_font_framebuffer_##name->p_memory_words+length; \ | |
114 r2d_g_font_framebuffer_##name->width=h; \ | |
115 r2d_g_font_framebuffer_##name->height=v; \ | |
116 rvf_get_buf(r2d_mb_id, sizeof(T_RVF_MUTEX), \ | |
117 (T_RVF_BUFFER**)&(r2d_g_font_framebuffer_##name->mutex));\ | |
118 if (r2d_g_font_framebuffer_##name->mutex!=NULL)\ | |
119 {\ | |
120 T_RVF_RET err;\ | |
121 err=rvf_initialize_mutex(r2d_g_font_framebuffer_##name->mutex);\ | |
122 if (err!=RVF_OK)\ | |
123 {\ | |
124 ret_err=R2D_MEMORY_ERR;\ | |
125 rvf_free_buf((void*)(r2d_g_font_framebuffer_##name->mutex));\ | |
126 rvf_free_buf((void*)(r2d_g_font_framebuffer_##name));\ | |
127 r2d_g_font_framebuffer_##name=NULL;\ | |
128 }\ | |
129 }\ | |
130 else\ | |
131 {\ | |
132 ret_err=R2D_MEMORY_ERR;\ | |
133 rvf_free_buf((void*)(r2d_g_font_framebuffer_##name));\ | |
134 r2d_g_font_framebuffer_##name=NULL;\ | |
135 }\ | |
136 } | |
137 #endif | |
138 | |
139 #if (R2D_EMBEDDED_LCD == R2D_SIMPLE_LCD) | |
140 #include "lcds/simple/r2d_font_init_i.c" | |
141 #endif | |
142 | |
143 #if (R2D_EMBEDDED_LCD == R2D_PC_COLOR_LCD) | |
144 #include "lcds/colorpc/r2d_font_init_i.c" | |
145 #endif | |
146 | |
147 #if (R2D_EMBEDDED_LCD == R2D_PC_CSAMPLE) | |
148 #include "lcds/pc_csample/r2d_font_init_i.c" | |
149 #endif | |
150 | |
151 #if (R2D_EMBEDDED_LCD == R2D_PC_DSAMPLE) | |
152 #include "lcds/pc_dsample/r2d_font_init_i.c" | |
153 #endif | |
154 | |
155 #if (R2D_EMBEDDED_LCD == R2D_MIRRORED_LCD) | |
156 #include "lcds/mirrored/r2d_font_init_i.c" | |
157 #endif | |
158 | |
159 #if (R2D_EMBEDDED_LCD == R2D_CUSTOMER_LCD) | |
160 #include "lcds/customer/r2d_font_init_i.c" | |
161 | |
162 #endif | |
163 | |
164 #if (R2D_EMBEDDED_LCD == R2D_HORIZONTAL_LCD) | |
165 #include "lcds/horizontal/r2d_font_init_i.c" | |
166 #endif | |
167 | |
168 #if (R2D_EMBEDDED_LCD == R2D_BOARD_COLOR_LCD) | |
169 #include "lcds/colorboard/r2d_font_init_i.c" | |
170 #endif | |
171 | |
172 #if (R2D_EMBEDDED_LCD == R2D_BOARD_DSAMPLE) | |
173 #include "lcds/d_sample/r2d_font_init_i.c" | |
174 #endif | |
175 | |
176 #if (R2D_EMBEDDED_LCD == R2D_BOARD_BW_DSAMPLE) | |
177 #include "lcds/bw_d_sample/r2d_font_init_i.c" | |
178 #endif | |
179 |