diff --git a/programs/cmm/textreader/prepare_page.h b/programs/cmm/textreader/prepare_page.h index 1c3201d2a7..196a0427c6 100644 --- a/programs/cmm/textreader/prepare_page.h +++ b/programs/cmm/textreader/prepare_page.h @@ -1,20 +1,21 @@ -void PreparePage() -{ - char line[4096]=0; - char char_width[255]; - dword line_start; - byte ch; - dword bufoff, buflen; - dword line_length=30; - dword stroka_y = 5; - dword stroka=0; - int i, srch_pos; +char char_width[255]; + +enum { + COUNT_BUF_HEIGHT, + DRAW_BUF +}; + +void Parcer(byte mode) +{ +dword bufoff, buflen; +byte ch; +char line[4096]=0; +int srch_pos; +dword stroka=0; +dword stroka_y=5; +dword line_length=30; +dword line_start=io.buffer_data; - label.changeSIZE(); - list.w = Form.cwidth-scroll.size_x-1; - //get font chars width, need to increase performance - for (i=0; i<256; i++) char_width[i] = label.symbol_size(i); - //get font buffer height buflen = strlen(io.buffer_data) + io.buffer_data; for (bufoff=io.buffer_data; bufoff=list.w) || (ch==10) - { - //set word break - srch_pos = bufoff; - loop() - { - if (__isWhite(ESBYTE[srch_pos])) { bufoff=srch_pos+1; break; } //normal word-break - if (srch_pos == line_start) break; //no white space found in whole line - srch_pos--; - } - i = bufoff-line_start; - strlcpy(#line, line_start, i); - label.write_buf(8,stroka_y,list.w,label.size.height, 0xFFFFFF, 0, label.size.pt, #line); - stroka_y += list.item_h; - line_start = bufoff; - line_length = 30; - } - } - label.write_buf(8,stroka_y,list.w,label.size.height, 0xFFFFFF, 0, label.size.pt, line_start); + //draw result label.apply_smooth(); DrawPage(); } diff --git a/programs/cmm/textreader/textreader.c b/programs/cmm/textreader/textreader.c index f1bf19cb6f..5a7a5a70ba 100644 --- a/programs/cmm/textreader/textreader.c +++ b/programs/cmm/textreader/textreader.c @@ -18,7 +18,7 @@ #define DEFAULT_EDITOR "/sys/tinypad" #define INTRO_TEXT "This is a plain Text Reader.\nTry to open some text file." -#define VERSION "Text Reader v1.06" +#define VERSION "Text Reader v1.1" #define ABOUT "Idea: Leency, punk_joker Code: Leency, Veliant, KolibriOS Team