Rev 8443 | Rev 8451 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8443 | Rev 8444 | ||
---|---|---|---|
Line 163... | Line 163... | ||
163 | cur_encoding = custom_encoding; |
163 | cur_encoding = custom_encoding; |
164 | bufpointer = ChangeCharset(cur_encoding, "CP866", bufpointer); |
164 | bufpointer = ChangeCharset(cur_encoding, "CP866", bufpointer); |
165 | } |
165 | } |
166 | } |
166 | } |
167 | //============================================================================================ |
167 | //============================================================================================ |
168 | void TWebBrowser::AddCharToTheLine(unsigned char _char) |
- | |
169 | { |
- | |
170 | dword line_len; |
- | |
171 | if (_char<=15) _char=' '; |
- | |
172 | line_len = strlen(#line); |
- | |
173 | if (!style.pre) && (_char == ' ') |
- | |
174 | { |
- | |
175 | if (line[line_len-1]==' ') return; //no double spaces |
- | |
176 | if (!stolbec) && (!line) return; //no paces at the beginning of the line |
- | |
177 | if (link) && (line_len==0) return; |
- | |
178 | } |
- | |
179 | if (line_len < sizeof(line)) chrcat(#line, _char); |
- | |
180 | CheckForLineBreak(); |
- | |
181 | } |
- | |
182 | //============================================================================================ |
- | |
183 | void TWebBrowser::ParseHtml(dword _bufpointer, _bufsize){ |
168 | void TWebBrowser::ParseHtml(dword _bufpointer, _bufsize){ |
184 | char unicode_symbol[10]; |
169 | char unicode_symbol[10]; |
185 | dword j; |
170 | dword j; |
186 | int tab_len; |
171 | int tab_len; |
187 | dword bufpos; |
172 | dword bufpos; |
Line 280... | Line 265... | ||
280 | strncpy(#header, #version, sizeof(TWebBrowser.header)-1); |
265 | strncpy(#header, #version, sizeof(TWebBrowser.header)-1); |
281 | DrawTitle(#header); |
266 | DrawTitle(#header); |
282 | } |
267 | } |
283 | } |
268 | } |
284 | //============================================================================================ |
269 | //============================================================================================ |
- | 270 | void TWebBrowser::AddCharToTheLine(unsigned char _char) |
|
- | 271 | { |
|
- | 272 | dword line_len; |
|
- | 273 | if (_char<=15) _char=' '; |
|
- | 274 | line_len = strlen(#line); |
|
- | 275 | if (!style.pre) && (_char == ' ') |
|
- | 276 | { |
|
- | 277 | if (line[line_len-1]==' ') return; //no double spaces |
|
- | 278 | if (!stolbec) && (!line) return; //no paces at the beginning of the line |
|
- | 279 | if (link) && (line_len==0) return; |
|
- | 280 | } |
|
- | 281 | if (line_len < sizeof(line)) chrcat(#line, _char); |
|
- | 282 | CheckForLineBreak(); |
|
- | 283 | } |
|
- | 284 | //============================================================================================ |
|
285 | bool TWebBrowser::CheckForLineBreak() |
285 | bool TWebBrowser::CheckForLineBreak() |
286 | { |
286 | { |
287 | int line_break_pos; |
287 | int line_break_pos; |
288 | char new_line_text[4096]; |
288 | char new_line_text[4096]; |
289 | //Do we need a line break? |
289 | //Do we need a line break? |
Line 307... | Line 307... | ||
307 | strcpy(#line, #new_line_text); |
307 | strcpy(#line, #new_line_text); |
308 | NewLine(); |
308 | NewLine(); |
309 | return true; |
309 | return true; |
310 | } |
310 | } |
311 | //============================================================================================ |
311 | //============================================================================================ |
312 | void TWebBrowser::ChangeEncoding(int _new_encoding) |
- | |
313 | { |
- | |
314 | if (cur_encoding == _new_encoding) return; |
- | |
315 | cur_encoding = _new_encoding; |
- | |
316 | bufpointer = ChangeCharset(cur_encoding, "CP866", bufpointer); |
- | |
317 | if (header) { |
- | |
318 | ChangeCharset(cur_encoding, "CP866", #header); |
- | |
319 | DrawTitle(#header); |
- | |
320 | } |
- | |
321 | } |
- | |
322 | //============================================================================================ |
- | |
323 | void TWebBrowser::NewLine() |
312 | void TWebBrowser::NewLine() |
324 | { |
313 | { |
325 | static int empty_line=0; |
314 | static int empty_line=0; |
Line 326... | Line 315... | ||
326 | 315 | ||
Line 340... | Line 329... | ||
340 | draw_y += list.item_h; |
329 | draw_y += list.item_h; |
341 | if (style.blq) stolbec = 6; else stolbec = 0; |
330 | if (style.blq) stolbec = 6; else stolbec = 0; |
342 | stolbec += style.tag_list.level * 5; |
331 | stolbec += style.tag_list.level * 5; |
343 | } |
332 | } |
344 | //============================================================================================ |
333 | //============================================================================================ |
- | 334 | void TWebBrowser::ChangeEncoding(int _new_encoding) |
|
- | 335 | { |
|
- | 336 | if (cur_encoding == _new_encoding) return; |
|
- | 337 | cur_encoding = _new_encoding; |
|
- | 338 | bufpointer = ChangeCharset(cur_encoding, "CP866", bufpointer); |
|
- | 339 | if (header) { |
|
- | 340 | ChangeCharset(cur_encoding, "CP866", #header); |
|
- | 341 | DrawTitle(#header); |
|
- | 342 | } |
|
- | 343 | } |
|
- | 344 | //============================================================================================ |
|
345 | scroll_bar scroll_wv = |
345 | scroll_bar scroll_wv = |
346 | { 15,NULL,NULL,NULL,0,2,NULL, |
346 | { 15,NULL,NULL,NULL,0,2,NULL, |
347 | 0,0,0xeeeeee,0xBBBbbb,0xeeeeee}; |
347 | 0,0,0xeeeeee,0xBBBbbb,0xeeeeee}; |
Line 348... | Line 348... | ||
348 | 348 |