Rev 8491 | Rev 8499 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8491 | Rev 8492 | ||
---|---|---|---|
Line 7... | Line 7... | ||
7 | dword pc; //paint color |
7 | dword pc; //paint color |
8 | int zoom; |
8 | int zoom; |
Line 9... | Line 9... | ||
9 | 9 | ||
10 | if (style.title) |
10 | if (style.title) |
11 | { |
11 | { |
12 | strncpy(#header, #line, sizeof(TWebBrowser.header)-1); |
12 | strncpy(#header, #linebuf, sizeof(TWebBrowser.header)-1); |
13 | strncat(#header, " - ", sizeof(TWebBrowser.header)-1); |
13 | strncat(#header, " - ", sizeof(TWebBrowser.header)-1); |
14 | strncat(#header, #version, sizeof(TWebBrowser.header)-1); |
14 | strncat(#header, #version, sizeof(TWebBrowser.header)-1); |
15 | line = 0; |
15 | linebuf = 0; |
16 | return; |
16 | return; |
17 | } |
17 | } |
18 | if (t_html) && (!t_body) { |
18 | if (t_html) && (!t_body) { |
19 | line = 0; |
19 | linebuf = 0; |
20 | return; |
20 | return; |
Line 21... | Line 21... | ||
21 | } |
21 | } |
22 | 22 | ||
23 | if (line) |
23 | if (linebuf) |
24 | { |
24 | { |
Line 25... | Line 25... | ||
25 | pw = strlen(#line) * list.font_w; |
25 | pw = strlen(#linebuf) * list.font_w; |
Line 26... | Line 26... | ||
26 | zoom = list.font_w / BASIC_CHAR_W; |
26 | zoom = list.font_w / BASIC_CHAR_W; |
Line 40... | Line 40... | ||
40 | } |
40 | } |
Line 41... | Line 41... | ||
41 | 41 | ||
42 | pc = text_colors.get_last(); |
42 | pc = text_colors.get_last(); |
Line 43... | Line 43... | ||
43 | if (link) && (pc == text_colors.get(0)) pc = link_color_default; |
43 | if (link) && (pc == text_colors.get(0)) pc = link_color_default; |
44 | 44 | ||
45 | canvas.WriteText(draw_x, draw_y, list.font_type, pc, #line, NULL); |
45 | canvas.WriteText(draw_x, draw_y, list.font_type, pc, #linebuf, NULL); |
46 | if (style.b) canvas.WriteText(draw_x+1, draw_y, list.font_type, pc, #line, NULL); |
46 | if (style.b) canvas.WriteText(draw_x+1, draw_y, list.font_type, pc, #linebuf, NULL); |
47 | if (style.s) canvas.DrawBar(draw_x, list.item_h / 2 - zoom + draw_y, pw, zoom, pc); |
47 | if (style.s) canvas.DrawBar(draw_x, list.item_h / 2 - zoom + draw_y, pw, zoom, pc); |
48 | if (style.u) canvas.DrawBar(draw_x, list.item_h - zoom - zoom + draw_y, pw, zoom, pc); |
48 | if (style.u) canvas.DrawBar(draw_x, list.item_h - zoom - zoom + draw_y, pw, zoom, pc); |
49 | if (link) { |
49 | if (link) { |
50 | if (line[0]==' ') && (line[1]==NULL) {} else { |
50 | if (linebuf[0]==' ') && (linebuf[1]==NULL) {} else { |
51 | canvas.DrawBar(draw_x, draw_y + list.item_h - calc(zoom*2)-1, pw, zoom, link_color_default); |
51 | canvas.DrawBar(draw_x, draw_y + list.item_h - calc(zoom*2)-1, pw, zoom, link_color_default); |
52 | links.add_text(draw_x, draw_y + list.y, pw, list.item_h - calc(zoom*2)-1, zoom); |
52 | links.add_text(draw_x, draw_y + list.y, pw, list.item_h - calc(zoom*2)-1, zoom); |
53 | } |
53 | } |
54 | } |
54 | } |
55 | draw_x += pw; |
55 | draw_x += pw; |
56 | if (debug_mode) debugln(#line); |
56 | if (debug_mode) debugln(#linebuf); |
57 | line = NULL; |
57 | linebuf = NULL; |
Line 58... | Line 58... | ||
58 | } |
58 | } |
59 | } |
59 | } |
60 | 60 | ||
61 | void TWebBrowser::RenderTextbuf() |
61 | void TWebBrowser::RenderTextbuf() |
62 | { |
62 | { |
Line 63... | Line 63... | ||
63 | int break_pos; |
63 | int break_pos; |
64 | char next_line[4096]; |
64 | char next_line[4096]; |
65 | int zoom = list.font_w / BASIC_CHAR_W; |
65 | int zoom = list.font_w / BASIC_CHAR_W; |
66 | 66 | ||
Line 67... | Line 67... | ||
67 | //Do we need a line break? |
67 | //Do we need a line break? |
68 | while (strlen(#line) * list.font_w + draw_x >= draw_w) { |
68 | while (strlen(#linebuf) * list.font_w + draw_x >= draw_w) { |
69 | //Yes, we do. Lets calculate where... |
69 | //Yes, we do. Lets calculate where... |
70 | break_pos = strrchr(#line, ' '); |
70 | break_pos = strrchr(#linebuf, ' '); |
71 | 71 | ||
72 | //Is a new line fits in the current line? |
72 | //Is a new line fits in the current line? |
73 | if (break_pos * list.font_w + draw_x > draw_w) { |
73 | if (break_pos * list.font_w + draw_x > draw_w) { |
74 | break_pos = draw_w - draw_x /list.font_w; |
74 | break_pos = draw_w - draw_x /list.font_w; |
75 | while(break_pos) && (line[break_pos]!=' ') break_pos--; |
75 | while(break_pos) && (linebuf[break_pos]!=' ') break_pos--; |
Line 76... | Line 76... | ||
76 | } |
76 | } |
77 | //Maybe a new line is too big for the whole new line? Then we have to split it |
77 | //Maybe a new line is too big for the whole new line? Then we have to split it |
Line 78... | Line 78... | ||
78 | if (!break_pos) && (style.tag_list.level*5 + strlen(#line) * zoom >= list.column_max) { |
78 | if (!break_pos) && (style.tag_list.level*5 + strlen(#linebuf) * zoom >= list.column_max) { |
Line 79... | Line 79... | ||
79 | break_pos = draw_w - draw_x / list.font_w; |
79 | break_pos = draw_w - draw_x / list.font_w; |
80 | } |
80 | } |
81 | 81 | ||
82 | strcpy(#next_line, #line + break_pos); |
82 | strcpy(#next_line, #linebuf + break_pos); |
83 | line[break_pos] = 0x00; |
83 | linebuf[break_pos] = 0x00; |