Rev 7210 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7210 | Rev 7738 | ||
---|---|---|---|
Line 48... | Line 48... | ||
48 | 48 | ||
Line 49... | Line 49... | ||
49 | int draw_y; |
49 | int draw_y; |
50 | int stolbec; |
50 | int stolbec; |
51 | int tab_len; |
51 | int tab_len; |
52 | int anchor_y; |
- | |
Line 53... | Line 52... | ||
53 | 52 | ||
54 | int body_magrin=5; |
53 | int body_magrin=5; |
Line 55... | Line 54... | ||
55 | int basic_line_h=22; |
54 | int basic_line_h=22; |
Line 64... | Line 63... | ||
64 | char val[4096]; |
63 | char val[4096]; |
65 | 64 | ||
Line 66... | Line 65... | ||
66 | #include "..\TWB\absolute_url.h" |
65 | #include "..\TWB\absolute_url.h" |
67 | #include "..\TWB\links.h" |
66 | #include "..\TWB\links.h" |
- | 67 | #include "..\TWB\anchors.h" |
|
68 | #include "..\TWB\colors.h" |
68 | #include "..\TWB\colors.h" |
69 | #include "..\TWB\unicode_tags.h" |
69 | #include "..\TWB\unicode_tags.h" |
70 | #include "..\TWB\img_cache.h" |
70 | #include "..\TWB\img_cache.h" |
71 | #include "..\TWB\parce_tag.h" |
71 | #include "..\TWB\parce_tag.h" |
Line 89... | Line 89... | ||
89 | start_x = stolbec * list.font_w + body_magrin + list.x; |
89 | start_x = stolbec * list.font_w + body_magrin + list.x; |
90 | stolbec_len = strlen(#line) * zoom; |
90 | stolbec_len = strlen(#line) * zoom; |
91 | line_length = stolbec_len * list.font_w; |
91 | line_length = stolbec_len * list.font_w; |
92 | 92 | ||
Line 93... | Line 93... | ||
93 | WriteBufText(start_x, draw_y, list.font_type, text_colors[text_color_index], #line, buf_data); |
93 | DrawBuf.WriteText(start_x, draw_y, list.font_type, text_colors[text_color_index], #line); |
94 | if (style.b) WriteBufText(start_x+1, draw_y, list.font_type, text_colors[text_color_index], #line, buf_data); |
94 | if (style.b) DrawBuf.WriteText(start_x+1, draw_y, list.font_type, text_colors[text_color_index], #line); |
95 | if (style.s) DrawBuf.DrawBar(start_x, list.item_h / 2 - zoom + draw_y, line_length, zoom, text_colors[text_color_index]); |
95 | if (style.s) DrawBuf.DrawBar(start_x, list.item_h / 2 - zoom + draw_y, line_length, zoom, text_colors[text_color_index]); |
96 | if (style.u) DrawBuf.DrawBar(start_x, list.item_h - zoom - zoom + draw_y, line_length, zoom, text_colors[text_color_index]); |
96 | if (style.u) DrawBuf.DrawBar(start_x, list.item_h - zoom - zoom + draw_y, line_length, zoom, text_colors[text_color_index]); |
97 | if (link) { |
97 | if (link) { |
98 | DrawBuf.DrawBar(start_x, draw_y + list.item_h - calc(zoom*2), line_length, zoom, text_colors[text_color_index]); |
98 | DrawBuf.DrawBar(start_x, draw_y + list.item_h - calc(zoom*2), line_length, zoom, text_colors[text_color_index]); |
99 | PageLinks.AddText(start_x, draw_y + list.y, line_length, list.item_h - calc(zoom*2), UNDERLINE, zoom); //TODO: set bigger underline_h for style.h |
99 | PageLinks.AddText(start_x, draw_y + list.y, line_length, list.item_h - calc(zoom*2), UNDERLINE, zoom); //TODO: set bigger underline_h for style.h |
Line 119... | Line 119... | ||
119 | style.align = ALIGN_LEFT; |
119 | style.align = ALIGN_LEFT; |
120 | link_color_inactive = 0x0000FF; |
120 | link_color_inactive = 0x0000FF; |
121 | link_color_active = 0xFF0000; |
121 | link_color_active = 0xFF0000; |
122 | bg_color = 0xFFFFFF; |
122 | bg_color = 0xFFFFFF; |
123 | DrawBuf.Fill(bg_color); |
123 | DrawBuf.Fill(0, bg_color); |
124 | PageLinks.Clear(); |
124 | PageLinks.Clear(); |
125 | strcpy(#header, #version); |
125 | strcpy(#header, #version); |
126 | draw_y = body_magrin; |
126 | draw_y = body_magrin; |
127 | stolbec = 0; |
127 | stolbec = 0; |
128 | line = 0; |
128 | line = 0; |
129 | zoom = 1; |
129 | zoom = 1; |
Line 273... | Line 273... | ||
273 | if (opened) strcat(#line, " \""); |
273 | if (opened) strcat(#line, " \""); |
274 | if (!opened) strcat(#line, "\" "); |
274 | if (!opened) strcat(#line, "\" "); |
275 | return; |
275 | return; |
276 | } |
276 | } |
277 | //if (isattr("id=")) || (isattr("name=")) { //very bad: if the tag is not the last it wound work |
277 | if (isattr("id=")) || (isattr("name=")) { // TO FIX: works only if the param is the last |
278 | //add anchor |
278 | anchors.add(#val, draw_y); |
279 | //} |
279 | } |
280 | if (istag("body")) { |
280 | if (istag("body")) { |
281 | t_body = opened; |
281 | t_body = opened; |
282 | do{ |
282 | do{ |
283 | if (isattr("link=")) link_color_inactive = GetColor(#val); |
283 | if (isattr("link=")) link_color_inactive = GetColor(#val); |
284 | if (isattr("alink=")) link_color_active = GetColor(#val); |
284 | if (isattr("alink=")) link_color_active = GetColor(#val); |
285 | if (isattr("text=")) text_colors[0]=GetColor(#val); |
285 | if (isattr("text=")) text_colors[0]=GetColor(#val); |
286 | if (isattr("bgcolor=")) |
286 | if (isattr("bgcolor=")) |
287 | { |
287 | { |
288 | bg_color = GetColor(#val); |
288 | bg_color = GetColor(#val); |
289 | DrawBuf.Fill(bg_color); |
289 | DrawBuf.Fill(0, bg_color); |
290 | } |
290 | } |
291 | } while(GetNextParam()); |
291 | } while(GetNextParam()); |
292 | if (opened) && (cur_encoding==CH_NULL) { |
292 | if (opened) && (cur_encoding==CH_NULL) { |
293 | cur_encoding = CH_UTF8; |
293 | cur_encoding = CH_UTF8; |
294 | debugln("Document has no information about encoding, UTF will be used"); |
294 | debugln("Document has no information about encoding, UTF will be used"); |
295 | } |
295 | } |