Rev 6738 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6738 | Rev 6783 | ||
---|---|---|---|
Line 44... | Line 44... | ||
44 | dword link_color_inactive; |
44 | dword link_color_inactive; |
45 | dword link_color_active; |
45 | dword link_color_active; |
46 | dword bg_color; |
46 | dword bg_color; |
47 | dword block_bg_color; |
47 | |
48 | 48 | int stroka; |
|
49 | int stroka; |
- | |
Line 50... | Line 49... | ||
50 | int stolbec; |
49 | int stolbec; |
51 | int tab_len; |
50 | int tab_len; |
52 | int anchor_line_num; |
51 | int anchor_line_num; |
53 | 52 | ||
Line 123... | Line 122... | ||
123 | style.align = ALIGN_LEFT; |
122 | style.align = ALIGN_LEFT; |
124 | link_color_inactive = 0x0000FF; |
123 | link_color_inactive = 0x0000FF; |
125 | link_color_active = 0xFF0000; |
124 | link_color_active = 0xFF0000; |
126 | bg_color = block_bg_color = 0xFFFFFF; |
125 | bg_color = 0xFFFFFF; |
127 | DrawBuf.Fill(bg_color); |
126 | DrawBuf.Fill(bg_color); |
128 | PageLinks.Clear(); |
127 | PageLinks.Clear(); |
129 | strcpy(#header, #version); |
128 | strcpy(#header, #version); |
130 | stroka = -list.first; |
129 | stroka = -list.first; |
131 | stolbec = 0; |
130 | stolbec = 0; |
132 | line = 0; |
131 | line = 0; |
133 | //for plaint text use CP866 for other UTF |
132 | //for plaint text use CP866 for other UTF |
134 | if (strstri(bufpointer, "html")) |
133 | if (strstri(bufpointer, "html")!=-1) |
135 | { |
134 | { |
136 | style.pre = 0; |
135 | debugln(" found"); |
137 | cur_encoding = CH_NULL; |
136 | style.pre = false; |
- | 137 | cur_encoding = CH_NULL; |
|
138 | } |
138 | } |
139 | else |
139 | else |
140 | { |
140 | { |
141 | style.pre = 1; |
141 | debugln("no "); |
142 | cur_encoding = CH_NULL; |
142 | style.pre = true; |
- | 143 | cur_encoding = CH_NULL; |
|
143 | } |
144 | } |
144 | for (bufpos=bufpointer ; (bufpos < bufpointer+bufsize) && (ESBYTE[bufpos]!=0) ; bufpos++;) |
145 | for (bufpos=bufpointer ; (bufpos < bufpointer+bufsize) && (ESBYTE[bufpos]!=0) ; bufpos++;) |
145 | { |
146 | { |
146 | if (ignor_text) && (ESBYTE[bufpos]!='<') continue; |
147 | if (ignor_text) && (ESBYTE[bufpos]!='<') continue; |
147 | bukva = ESBYTE[bufpos]; |
148 | bukva = ESBYTE[bufpos]; |
148 | switch (bukva) |
149 | switch (bukva) |
Line 151... | Line 152... | ||
151 | if (style.pre) |
152 | if (style.pre) |
152 | { |
153 | { |
153 | DrawStyle(); |
154 | DrawStyle(); |
154 | NewLine(); |
155 | line = NULL; |
155 | break; |
156 | NewLine(); |
- | 157 | break; |
|
156 | } |
158 | } |
157 | case '\9': |
159 | goto DEFAULT_MARK; |
158 | if (style.pre) //otherwise go to 0x0d |
160 | case '\9': |
- | 161 | if (style.pre) //otherwise go to 0x0d |
|
159 | { |
162 | { |
160 | tab_len = strlen(#line) % 4; |
163 | tab_len = strlen(#line) % 4; |
161 | if (!tab_len) tab_len = 4; |
164 | if (!tab_len) tab_len = 4; |
162 | for (j=0; j |
165 | for (j=0; j |
163 | break; |
166 | break; |
Line 287... | Line 290... | ||
287 | if (isattr("text=")) text_colors[0]=GetColor(#val); |
290 | if (isattr("text=")) text_colors[0]=GetColor(#val); |
288 | if (isattr("bgcolor=")) |
291 | if (isattr("bgcolor=")) |
289 | { |
292 | { |
290 | bg_color = block_bg_color = GetColor(#val); |
293 | bg_color = GetColor(#val); |
291 | DrawBuf.Fill(bg_color); |
294 | DrawBuf.Fill(bg_color); |
292 | } |
295 | } |
293 | } while(GetNextParam()); |
296 | } while(GetNextParam()); |
294 | if (opened) && (cur_encoding==CH_NULL) debugln("Document has no information about encoding, UTF will be used"); |
297 | if (opened) && (cur_encoding==CH_NULL) debugln("Document has no information about encoding, UTF will be used"); |
295 | return; |
298 | return; |
296 | } |
299 | } |
297 | if (istag("a")) { |
300 | if (istag("a")) { |
Line 327... | Line 330... | ||
327 | else if (text_color_index > 0) text_color_index--; |
330 | else if (text_color_index > 0) text_color_index--; |
328 | return; |
331 | return; |
329 | } |
332 | } |
330 | if (istag("bg")) { |
333 | if (istag("div")) || (istag("header")) || (istag("article")) || (istag("footer")) { |
331 | if (opened) {block_bg_color=GetColor(#val); NewLine();} |
334 | IF(oldtag[0] != 'h') NewLine(); |
332 | if (!opened) block_bg_color=bg_color; |
- | |
333 | } |
- | |
334 | if (istag("div")) || (istag("header")) || (istag("article")) || (istag("footer")) { |
- | |
335 | IF(oldtag[0] != 'h') NewLine(); |
- | |
336 | return; |
335 | return; |
337 | } |
336 | } |
338 | if (istag("p")) { |
337 | if (istag("p")) { |
339 | IF(oldtag[0] == 'h') return; |
338 | IF(oldtag[0] == 'h') return; |
340 | NewLine(); |
339 | NewLine(); |
Line 465... | Line 464... | ||
465 | onleft = list.x + 5; |
464 | onleft = list.x + 5; |
Line 466... | Line 465... | ||
466 | ontop = stroka * list.item_h + list.y + 5; |
465 | ontop = stroka * list.item_h + list.y + 5; |
467 | if (t_html) && (!t_body) return; |
466 | if (t_html) && (!t_body) return; |
468 | if (block_bg_color!=bg_color) DrawBuf.DrawBar(0, stroka+1*list.item_h+5, DrawBuf.bufw, list.item_h, block_bg_color); |
467 | if (stroka * list.item_h + 5 >= 0) && ( stroka + 1 * list.item_h + 5 < list.h) && (!anchor) |
469 | if (stroka * list.item_h + 5 >= 0) && ( stroka + 1 * list.item_h + 5 < list.h) && (!anchor) |
- | |
470 | { |
468 | { |
471 | if (style.align == ALIGN_CENTER) && (DrawBuf.zoom==1) DrawBuf.AlignCenter(onleft,ontop,list.w,list.item_h,stolbec * list.font_w); |
469 | if (style.align == ALIGN_CENTER) && (DrawBuf.zoom==1) DrawBuf.AlignCenter(onleft,ontop,list.w,list.item_h,stolbec * list.font_w); |
472 | if (style.align == ALIGN_RIGHT) && (DrawBuf.zoom==1) DrawBuf.AlignRight(onleft,ontop,list.w,list.item_h,stolbec * list.font_w); |
470 | if (style.align == ALIGN_RIGHT) && (DrawBuf.zoom==1) DrawBuf.AlignRight(onleft,ontop,list.w,list.item_h,stolbec * list.font_w); |
473 | } |
471 | } |
474 | stroka++; |
472 | stroka++; |