Rev 6864 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6864 | Rev 6865 | ||
---|---|---|---|
Line 2... | Line 2... | ||
2 | #include |
2 | #include |
3 | #include |
3 | #include |
4 | #include FT_FREETYPE_H |
4 | #include FT_FREETYPE_H |
5 | #include FT_GLYPH_H |
5 | #include FT_GLYPH_H |
6 | #include "winlib.h" |
6 | #include "winlib.h" |
7 | #include "draw2.h" |
- | |
Line 8... | Line 7... | ||
8 | 7 | ||
9 | int init_fontlib(); |
8 | int init_fontlib(); |
10 | font_t *create_font(FT_Face face, int size); |
9 | font_t *create_font(FT_Face face, int size); |
11 | int get_font_height(font_t *font); |
10 | int get_font_height(font_t *font); |
Line 85... | Line 84... | ||
85 | static void txv_redraw(tview_t *txv) |
84 | static void txv_redraw(tview_t *txv) |
86 | { |
85 | { |
87 | rect_t rc; |
86 | rect_t rc; |
88 | int i; |
87 | int i; |
Line -... | Line 88... | ||
- | 88 | ||
- | 89 | rc.l = 0; |
|
- | 90 | rc.t = 0; |
|
- | 91 | rc.r = txv->w; |
|
- | 92 | rc.b = txv->h; |
|
89 | 93 | ||
Line 90... | Line 94... | ||
90 | draw_rect(txv->ctx, 0, 0, txv->w, txv->h, 0xFFFFFFFF); |
94 | px_fill_rect(txv->ctx, &rc, 0xFFFFFFFF); |
91 | 95 | ||
92 | rc.l = txv->margins.l; |
96 | rc.l = txv->margins.l; |
93 | rc.t = txv->margins.t; |
97 | rc.t = txv->margins.t; |
Line 160... | Line 164... | ||
160 | if(txv->endline < txv->lines) |
164 | if(txv->endline < txv->lines) |
161 | { |
165 | { |
162 | dst = txv->margins.t; |
166 | dst = txv->margins.t; |
163 | src = dst + txv->line_height; |
167 | src = dst + txv->line_height; |
164 | rows = txv->line_height * (txv->pagesize-1); |
168 | rows = txv->line_height * (txv->pagesize-1); |
165 | scroll_ctx(txv->ctx, dst, src, rows ); |
169 | scroll_context(txv->ctx, dst, src, rows ); |
Line 166... | Line 170... | ||
166 | 170 | ||
167 | rc.l = txv->margins.l; |
171 | rc.l = txv->margins.l; |
168 | rc.t = txv->margins.t + rows; |
172 | rc.t = txv->margins.t + rows; |
169 | rc.r = txv->w - txv->margins.r; |
173 | rc.r = txv->w - txv->margins.r; |
Line 170... | Line 174... | ||
170 | rc.b = rc.t + txv->line_height; |
174 | rc.b = rc.t + txv->line_height; |
Line 171... | Line 175... | ||
171 | 175 | ||
172 | draw_rect(txv->ctx, rc.l, rc.t, rc.r - rc.l, txv->line_height, 0xFFFFFFFF); |
176 | px_fill_rect(txv->ctx, &rc, 0xFFFFFFFF); |
Line 173... | Line 177... | ||
173 | 177 | ||
Line 179... | Line 183... | ||
179 | 183 | ||
180 | if( txv->tail && (txv->endline < txv->lines)) |
184 | if( txv->tail && (txv->endline < txv->lines)) |
181 | { |
185 | { |
182 | rc.t+= txv->line_height; |
186 | rc.t+= txv->line_height; |
183 | rc.b+= txv->line_height; |
187 | rc.b+= txv->line_height; |
184 | draw_rect(txv->ctx, rc.l, rc.t, rc.r - rc.l, txv->line_height, 0xFFFFFFFF); |
188 | px_fill_rect(txv->ctx, &rc, 0xFFFFFFFF); |
185 | draw_text_ext(txv->ctx, txv->font, txv->line[txv->endline], |
189 | draw_text_ext(txv->ctx, txv->font, txv->line[txv->endline], |
186 | txv->line[txv->endline+1]-txv->line[txv->endline], &rc, 0xFF000000); |
190 | txv->line[txv->endline+1]-txv->line[txv->endline], &rc, 0xFF000000); |
187 | } |
191 | } |
188 | return 1; |
192 | return 1; |
Line 200... | Line 204... | ||
200 | { |
204 | { |
201 | rows = txv->tail + txv->line_height * (txv->pagesize-1); |
205 | rows = txv->tail + txv->line_height * (txv->pagesize-1); |
202 | src = txv->margins.t; |
206 | src = txv->margins.t; |
203 | dst = src + txv->line_height; |
207 | dst = src + txv->line_height; |
Line 204... | Line 208... | ||
204 | 208 | ||
Line 205... | Line 209... | ||
205 | scroll_ctx(txv->ctx, dst, src, rows); |
209 | scroll_context(txv->ctx, dst, src, rows); |
206 | 210 | ||
207 | rc.l = txv->margins.l; |
211 | rc.l = txv->margins.l; |
208 | rc.t = txv->margins.t; |
212 | rc.t = txv->margins.t; |
Line 209... | Line 213... | ||
209 | rc.r = txv->w - txv->margins.r; |
213 | rc.r = txv->w - txv->margins.r; |
Line 210... | Line 214... | ||
210 | rc.b = rc.t + txv->line_height; |
214 | rc.b = rc.t + txv->line_height; |
211 | 215 | ||
Line 212... | Line 216... | ||
212 | draw_rect(txv->ctx, rc.l, rc.t, rc.r - rc.l, txv->line_height, 0xFFFFFFFF); |
216 | px_fill_rect(txv->ctx, &rc, 0xFFFFFFFF); |