diff --git a/programs/cmm/txtread/Tupfile.lua b/programs/cmm/txtread/Tupfile.lua deleted file mode 100644 index c3a3587099..0000000000 --- a/programs/cmm/txtread/Tupfile.lua +++ /dev/null @@ -1,6 +0,0 @@ -if tup.getconfig("NO_CMM") ~= "" then return end -if tup.getconfig("LANG") == "ru" -then C_LANG = "LANG_RUS" -else C_LANG = "LANG_ENG" -- this includes default case without config -end -tup.rule("txtread.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "txtread.com") diff --git a/programs/cmm/txtread/compile.bat b/programs/cmm/txtread/compile.bat deleted file mode 100644 index 200b8de136..0000000000 --- a/programs/cmm/txtread/compile.bat +++ /dev/null @@ -1,5 +0,0 @@ -@C-- "txtread.c" -@del "txtread" -@rename "txtread.com" "txtread" -@del warning.txt -@pause diff --git a/programs/cmm/txtread/data.h b/programs/cmm/txtread/data.h deleted file mode 100644 index 75423ff1f3..0000000000 --- a/programs/cmm/txtread/data.h +++ /dev/null @@ -1,88 +0,0 @@ -//===================================================// -// // -// TRANSLATIONS // -// // -//===================================================// - -#ifdef LANG_RUS - -#define INTRO_TEXT "Это простой просмотрщик текста.\nПопробуйте открыть какой-нибудь текстовый файл." -#define VERSION "Text Reader v1.41" -#define ABOUT "Идея: Leency, punk_joker -Код: Leency, Veliant, KolibriOS Team - -Горячие клавиши: -Ctrl+O - открыть файл -Ctrl+I - показать информацию о файле -Ctrl+Плюс - увеличить шрифт -Ctrl+Минус - уменьшить шрифт -Ctrl+Tab - выбрать кодировку текста -Ctrl+E - открыть файл в другой программе - -Поиск: -Ctrl+F - открыть панель поиска -F3 - искать далее -Esc - скрыть панель поиска - -Нажмите любую клавишу..." - -char color_scheme_names[] = -"Черный на белом -Черный на сером |RtfRead -Черный на льне |Horst -Черный на холсте |Pocket -Черный на желтом |Fb2Read -Серый на темном1 |Godot -Серый на темном2 |Monokai"; - -#else - -#define INTRO_TEXT "This is a plain Text Reader.\nTry to open some text file." -#define VERSION "Text Reader v1.41" -#define ABOUT "Idea: Leency, punk_joker -Code: Leency, Veliant, KolibriOS Team - -Hotkeys: -Ctrl+O - open file -Ctrl+I - show file properties -Ctrl+Up - bigger font -Ctrl+Down - smaller font -Ctrl+Tab - select charset -Ctrl+E - reopen current file in another app - -Search: -Ctrl+F - open search -F3 - search next -Esc - hide search bar - -Press any key..." - -char color_scheme_names[] = -"Black & White -Black & Grey |RtfRead -Black & Linen |Horst -Black & Antique |Pocket -Black & Lemon |Fb2Read -Grey & DarkGrey |Godot -Grey & DarkGrey |Monokai"; - -#endif - -//===================================================// -// // -// DATA // -// // -//===================================================// - -dword color_schemes[] = { -0xFFFfff, 0, -0xF0F0F0, 0, -0xFDF6E3, 0x101A21, -0xFCF0DA, 0x171501, -0xF0F0C7, 0, -0x282C34, 0xABB2BF, -0x282923, 0xD8D8D2 -}; - -char default_dir[] = "/rd/1"; -od_filter filter2 = { 8, "TXT\0\0" }; \ No newline at end of file diff --git a/programs/cmm/txtread/ini.h b/programs/cmm/txtread/ini.h deleted file mode 100644 index 02c3d97bc3..0000000000 --- a/programs/cmm/txtread/ini.h +++ /dev/null @@ -1,23 +0,0 @@ -_ini ini = { "/sys/settings/app.ini", "Txtread" }; - -void LoadIniSettings() -{ - kfont.size.pt = ini.GetInt("FontSize", 13); - encoding = ini.GetInt("Encoding", CH_AUTO); - curcol_scheme = ini.GetInt("ColorScheme", 2); - Form.left = ini.GetInt("WinX", 150); - Form.top = ini.GetInt("WinY", 50); - Form.width = ini.GetInt("WinW", 640); - Form.height = ini.GetInt("WinH", 560); -} - -void SaveIniSettings() -{ - ini.SetInt("FontSize", kfont.size.pt); - ini.SetInt("Encoding", encoding); - ini.SetInt("ColorScheme", curcol_scheme); - ini.SetInt("WinX", Form.left); - ini.SetInt("WinY", Form.top); - ini.SetInt("WinW", Form.width); - ini.SetInt("WinH", Form.height); -} \ No newline at end of file diff --git a/programs/cmm/txtread/prepare_page.h b/programs/cmm/txtread/prepare_page.h deleted file mode 100644 index b1f3024307..0000000000 --- a/programs/cmm/txtread/prepare_page.h +++ /dev/null @@ -1,86 +0,0 @@ -void ParseAndPaint() -{ - dword start_time = GetStartTime(); - search.clear(); - Parse(); - Paint(); - debugln("\nTextRead statistics in miliseconds..."); - debugval("Page generate time", GetStartTime() - start_time); - if (list.count > list.visible * 10) DrawPage(); - start_time = GetStartTime(); - kfont.ApplySmooth(); - debugval("Smooth", GetStartTime() - start_time); - DrawPage(); -} - - -#define DRAW_PADDING 12 - -void Parse() -{ -dword bufoff, buflen; -byte ch; -char line[4096]=0; -int srch_pos; -dword stroka_y=DRAW_PADDING-3; -dword line_length=30; -dword line_start=io.buffer_data; - - list.count=0; - buflen = strlen(io.buffer_data) + io.buffer_data; - for (bufoff=io.buffer_data; bufoff=list.w) || (ch==10) { - 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--; - } - list.count++; - strlcpy(#line, line_start, bufoff-line_start); - search.add(stroka_y, #line); - stroka_y += list.item_h; - line_start = bufoff; - line_length = 30; - } - } - list.count+=2; - list.visible = list.h / list.item_h; - if (list.count < list.visible) list.count = list.visible; - kfont.size.height = list.count+1*list.item_h; - kfont.raw_size = 0; - search.add(stroka_y, line_start); -} - -void Paint() -{ - int i; - int cur_pos; - dword cur_line; - for ( i=0; i < search.lines.count; i++) - { - cur_pos = atoi(search.pos.get(i)); - cur_line = search.lines.get(i); - kfont.WriteIntoBuffer(DRAW_PADDING, cur_pos, list.w, - kfont.size.height, bg_color, text_color, kfont.size.pt, cur_line); - } -} - -:void PaintVisible() -{ - int i; - dword cur_pos; - dword cur_line; - for ( i=0; i < list.visible; i++) - { - cur_pos = atoi(search.pos.get(i + list.first)); - cur_line = search.lines.get(i + list.first); - kfont.WriteIntoBuffer(DRAW_PADDING, cur_pos, list.w, - kfont.size.height, bg_color, text_color, kfont.size.pt, cur_line); - } - kfont.ApplySmooth(); -} \ No newline at end of file diff --git a/programs/cmm/txtread/search.h b/programs/cmm/txtread/search.h deleted file mode 100644 index 5bb9feece7..0000000000 --- a/programs/cmm/txtread/search.h +++ /dev/null @@ -1,156 +0,0 @@ - -#include "../lib/collection.h" - -#define SEARCH_H 34 - - -struct SEARCH -{ - bool visible; - int found_count; - collection lines; - collection pos; - void show(); - void hide(); - bool draw(); - void draw_found(); - int height(); - bool edit_key(); - bool edit_mouse(); - void add(); - void clear(); - int find_next(); - int highlight(); -} search; - -char search_text[64]; -char found_text[64]; -edit_box search_box = {250, 10, NULL, 0xffffff, -0x94AECE, 0xffffff, 0xffffff,0x10000000,sizeof(search_text)-1,#search_text}; - - -void SEARCH::show() -{ - visible = true; - search_box.flags = ed_focus; - draw_window(); -} - -void SEARCH::hide() -{ - visible = false; - draw_window(); -} - -int SEARCH::height() -{ - return visible * SEARCH_H; -} - -bool SEARCH::edit_key() -{ - if (visible) && (search_box.flags & ed_focus) { - EAX = key_editbox; - edit_box_key stdcall(#search_box); - return true; - } - return false; -} - -bool SEARCH::edit_mouse() -{ - if (visible) { - edit_box_mouse stdcall(#search_box); - if (search_box.flags & ed_focus) return true; - } - return false; -} - -void SEARCH::draw_found() -{ - char matches[30]; - strcpy(#matches, "Matches: "); - strcat(#matches, itoa(found_count)); - strcat(#matches, " "); - WriteTextWithBg(search_box.left+search_box.width+14+110, search_box.top+3, 0xD0, sc.work_text, #matches, sc.work); -} - -bool SEARCH::draw(dword _btn_find, _btn_hide, _y) -{ - if (!visible) return false; - DrawBar(0, _y, Form.cwidth, 1, sc.work_graph); - DrawBar(0, _y+1, Form.cwidth, SEARCH_H-1, sc.work); - - search_box.top = _y + 6; - search_box.width = math.min(Form.width - 200, 250); - - DrawRectangle(search_box.left-1, search_box.top-1, search_box.width+2, 23,sc.work_graph); - - edit_box_draw stdcall(#search_box); - - DrawCaptButton(search_box.left+search_box.width+14, search_box.top-1, 90, - TOOLBAR_ICON_HEIGHT+1, _btn_find, sc.work_light, sc.work_text, "Find next"); - - draw_found(); - - DefineHiddenButton(Form.cwidth-26, search_box.top-1, TOOLBAR_ICON_HEIGHT+1, - TOOLBAR_ICON_HEIGHT+1, _btn_hide); - WriteText(Form.cwidth-26+7, search_box.top+2, 0x81, sc.work_graph, "x"); - return true; -} - -void SEARCH::clear() -{ - pos.drop(); - lines.drop(); - visible = false; - found_text[0] = '\0'; - found_count = 0; -} - -void SEARCH::add(dword _pos, _line) -{ - pos.add(itoa(_pos)); - lines.add(_line); -} - -int SEARCH::find_next(int _cur_pos, _bg_color) -{ - int i; - if (!search_text[0]) return false; - - strcpy(#found_text, #search_text); - highlight(0xFF0000, _bg_color); - draw_found(); - - for (i=_cur_pos+1; i0) draw_bar(dword _x, _y+1, _w, _h-1, _color); -} \ No newline at end of file diff --git a/programs/cmm/txtread/toolbar.png b/programs/cmm/txtread/toolbar.png deleted file mode 100644 index ee255f9b7e..0000000000 Binary files a/programs/cmm/txtread/toolbar.png and /dev/null differ diff --git a/programs/cmm/txtread/txtread.c b/programs/cmm/txtread/txtread.c deleted file mode 100644 index 8ab889d518..0000000000 --- a/programs/cmm/txtread/txtread.c +++ /dev/null @@ -1,499 +0,0 @@ -#define MEMSIZE 1024*80 - -//===================================================// -// // -// LIB // -// // -//===================================================// - -#include "../lib/io.h" -#include "../lib/gui.h" -#include "../lib/list_box.h" -#include "../lib/kfont.h" - -#include "../lib/obj/box_lib.h" -#include "../lib/obj/libini.h" -#include "../lib/obj/libimg.h" -#include "../lib/obj/iconv.h" -#include "../lib/obj/proc_lib.h" - -#include "../lib/patterns/simple_open_dialog.h" - -//===================================================// -// // -// INTERNAL INCLUDES // -// // -//===================================================// - -proc_info Form; -llist list; - -#define TOOLBAR_H 34 -#define TOOLBAR_ICON_WIDTH 24 -#define TOOLBAR_ICON_HEIGHT 22 - -dword bg_color; -dword text_color; - -#include "search.h" -#include "prepare_page.h" -#include "data.h" - -int encoding; -int curcol_scheme; - -#include "ini.h" - -//===================================================// -// // -// DATA // -// // -//===================================================// - -scroll_bar scroll = { 15,200,398,44,0,2,115,15,0,0xeeeeee,0xBBBbbb,0xeeeeee,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1}; - -char title[4196]; - -bool help_opened = false; - -int charsets_mx, - reopenin_mx, - colscheme_mx, - search_mx; - -enum { - OPEN_FILE, - MAGNIFY_MINUS, - MAGNIFY_PLUS, - CHANGE_CHARSET, - REOPEN_IN_APP, - SHOW_INFO, - SHOW_FILE_PROPERTIES, - COLOR_SCHEME, - SEARCH_BTN, - BTN_FIND_NEXT, - BTN_FIND_CLOSE -}; - -dword menu_id; - -//===================================================// -// // -// CODE // -// // -//===================================================// - -void InitDlls() -{ - load_dll(boxlib, #box_lib_init, 0); - load_dll(libio, #libio_init, 1); - load_dll(libimg, #libimg_init, 1); - load_dll(libini, #lib_init, 1); - load_dll(iconv_lib, #iconv_open, 0); - load_dll(Proc_lib, #OpenDialog_init,0); -} - -void main() -{ - InitDlls(); - OpenDialog_init stdcall (#o_dialog); - if (param) strcpy(#openfile_path, #param); - LoadIniSettings(); - EventSetColorScheme(curcol_scheme); - kfont.init(DEFAULT_FONT); - Libimg_LoadImage(#skin, abspath("toolbar.png")); - LoadFile(#param); - list.no_selection = true; - SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER); - loop() - { - switch(WaitEvent()) - { - case evMouse: - HandleMouseEvent(); - break; - case evKey: - HandleKeyEvent(); - break; - case evButton: - HandleButtonEvent(); - break; - case evReDraw: - if (CheckActiveProcess(Form.ID)) EventMenuClick(); - draw_window(); - } - } -} - -//===================================================// -// // -// EVENT HANDLERS // -// // -//===================================================// - -void HandleButtonEvent() -{ - int btn = GetButtonID(); - if (btn==1) { - SaveIniSettings(); - ExitProcess(); - } - switch(btn-10) - { - case OPEN_FILE: - EventOpenDialog(); - break; - case SHOW_FILE_PROPERTIES: - EventShowFileProperties(); - break; - case MAGNIFY_PLUS: - EventMagnifyPlus(); - break; - case MAGNIFY_MINUS: - EventMagnifyMinus(); - break; - case CHANGE_CHARSET: - EventShowCharsetsList(); - break; - case REOPEN_IN_APP: - EventShowReopenMenu(); - break; - case COLOR_SCHEME: - EventShowColorSchemesList(); - break; - case SHOW_INFO: - EventShowInfo(); - break; - case SEARCH_BTN: - if (search.visible) { - search.hide(); - } else { - search.show(); - } - break; - case BTN_FIND_NEXT: - EventSearchNext(); - break; - case BTN_FIND_CLOSE: - search.hide(); - break; - } -} - -void HandleKeyEvent() -{ - int new_y; - if (help_opened) { - help_opened = false; - DrawPage(); - return; - } - GetKeys(); - if (key_modifier & KEY_LCTRL) || (key_modifier & KEY_RCTRL) { - switch (key_scancode) - { - case SCAN_CODE_KEY_O: - EventOpenDialog(); - return; - case SCAN_CODE_KEY_I: - EventShowFileProperties(); - return; - case SCAN_CODE_PLUS: - case SCAN_CODE_UP: - EventMagnifyPlus(); - return; - case SCAN_CODE_DOWN: - case SCAN_CODE_MINUS: - EventMagnifyMinus(); - return; - case SCAN_CODE_KEY_E: - EventShowReopenMenu(); - return; - case SCAN_CODE_TAB: - EventShowCharsetsList(); - return; - case SCAN_CODE_KEY_F: - search.show(); - return; - case SCAN_CODE_HOME: - list.KeyHome(); - DrawPage(); - } - } - switch (key_scancode) - { - case SCAN_CODE_F1: - EventShowInfo(); - return; - case SCAN_CODE_ESC: - search.hide(); - return; - case SCAN_CODE_ENTER: - if (! search_box.flags & ed_focus) return; - case SCAN_CODE_F3: - EventSearchNext(); - return; - } - if (!search.edit_key()) { - if (list.ProcessKey(key_scancode)) DrawPage(); - } -} - -void HandleMouseEvent() -{ - mouse.get(); - list.wheel_size = 7; - if (list.MouseScroll(mouse.vert)) { - DrawPage(); - return; - } - scrollbar_v_mouse (#scroll); - if (list.first != scroll.position) { - list.first = scroll.position; - DrawPage(); - } - search.edit_mouse(); -} - -//===================================================// -// // -// EVENTS // -// // -//===================================================// - -bool EventSearchNext() -{ - int new_y = search.find_next(list.first, bg_color); - if (new_y) { - list.first = new_y / list.item_h; - list.CheckDoesValuesOkey(); - DrawPage(); - } -} - -void EventOpenDialog() -{ - OpenDialog_start stdcall (#o_dialog); - if (o_dialog.status) { - LoadFile(#openfile_path); - search.clear(); - ParseAndPaint(); - } -} - -void EventShowFileProperties() -{ - char ss_param[4096]; - if (!param) return; - strcpy(#ss_param, "-p "); - strcpy(#ss_param+3, #param); - RunProgram("/sys/File managers/Eolite", #ss_param); -} - -void EventMagnifyPlus() -{ - kfont.size.pt++; - if(!kfont.changeSIZE()) - kfont.size.pt--; - else - ParseAndPaint(); -} - -void EventMagnifyMinus() -{ - kfont.size.pt--; - if(!kfont.changeSIZE()) - kfont.size.pt++; - else - ParseAndPaint(); -} - -void EventShowCharsetsList() -{ - menu_id = CHANGE_CHARSET; - open_lmenu(Form.left+5 + charsets_mx, Form.top+29+skin_height, MENU_ALIGN_TOP_LEFT, - encoding+1, "UTF-8\nKOI8-RU\nCP1251\nCP1252\nISO8859-5\nCP866\nAUTO"); -} - -void EventShowReopenMenu() -{ - menu_id = REOPEN_IN_APP; - open_lmenu(Form.left+5 + reopenin_mx, Form.top+29+skin_height, MENU_ALIGN_TOP_LEFT, 0, - "Tinypad\nTextEdit\nWebView\nFB2Read\nHexView\nOther"); -} - -void EventShowColorSchemesList() -{ - menu_id = COLOR_SCHEME; - open_lmenu(Form.left+2 + colscheme_mx + 26, - Form.top+29+skin_height, MENU_ALIGN_TOP_RIGHT, - curcol_scheme+1, #color_scheme_names); -} - -void EventSetColorScheme(dword _setn) -{ - curcol_scheme = _setn; - bg_color = color_schemes[curcol_scheme*2]; - text_color = color_schemes[curcol_scheme*2+1]; - if (list.count) ParseAndPaint(); -} - -void EventShowInfo() { - help_opened = true; - DrawBar(list.x, list.y, list.w, list.h, bg_color); - WriteText(list.x + 10, list.y + 10, 10000001b, text_color, VERSION); - WriteTextLines(list.x + 10, list.y+40, 10010000b, text_color, ABOUT, 20); -} - -void EventChangeCharset(dword id) -{ - encoding = id; - LoadFile(#openfile_path); - ParseAndPaint(); - draw_window(); -} - -void EventOpenFileInAnotherProgram(dword _id) -{ - dword app; - byte open_param[4096]; - switch(_id) { - case 0: app = "/sys/tinypad"; break; - case 1: app = "/sys/develop/t_edit"; break; - case 2: app = "/sys/network/webview"; break; - case 3: app = "/sys/fb2read"; break; - case 4: app = "/sys/develop/heed"; break; - case 5: open_param[0]='~'; - strcpy(#open_param+1,#param); - RunProgram("/sys/@open", #open_param); - return; - } - RunProgram(app, #param); -} - -void EventMenuClick() -{ - dword click_id = get_menu_click(); - - if (click_id) && (menu_id) - { - if (menu_id == CHANGE_CHARSET) EventChangeCharset(click_id-1); - else if (menu_id == REOPEN_IN_APP) EventOpenFileInAnotherProgram(click_id-1); - else if (menu_id == COLOR_SCHEME) EventSetColorScheme(click_id-1); - else notify("'Error: wrong menu number'E"); - } - menu_id = NULL; -} - -//===================================================// -// // -// DRAWS AND OTHER FUNCS // -// // -//===================================================// - -void LoadFile(dword f_path) -{ - int tmp; - if (ESBYTE[f_path]) { - strcpy(#param, f_path); - if (!io.read(#param)) goto NO_DATA; - strcpy(#title, #param); - strcat(#title, " - Text Reader"); - } - else { - NO_DATA: - if (list.count) return; - io.buffer_data = INTRO_TEXT; - strcpy(#title, "Text Reader"); - } - - // Autodetecting encoding - if (encoding==CH_AUTO) { - if (strstr(io.buffer_data, "\208\190")) ChangeCharset(CH_UTF8, "CP866", io.buffer_data); - else if (chrnum(io.buffer_data, '\246')>5) || (strstr(io.buffer_data, "яЁ")) ChangeCharset(CH_CP1251, "CP866", io.buffer_data); - } else { - if (encoding!=CH_CP866) ChangeCharset(encoding, "CP866", io.buffer_data); - } - - list.ClearList(); -} - -int DrawToolbarButton(char image_id, int x) -{ - DrawOvalBorder(x, 5, TOOLBAR_ICON_WIDTH, TOOLBAR_ICON_HEIGHT, sc.work_graph, - sc.work_graph,sc.work_graph, sc.work_dark); - img_draw stdcall(skin.image, x+1, 5+1, TOOLBAR_ICON_WIDTH, TOOLBAR_ICON_HEIGHT, TOOLBAR_ICON_WIDTH*image_id, 0); - - if (menu_id) && (menu_id == image_id) { - DrawRectangle3D(x+1, 6, TOOLBAR_ICON_WIDTH-1, TOOLBAR_ICON_HEIGHT-1, 0xCCCccc, 0xF8FCF8); - PutShadow(x+1, 6, TOOLBAR_ICON_WIDTH, TOOLBAR_ICON_HEIGHT, true, 2); - } - DefineHiddenButton(x+1, 6, TOOLBAR_ICON_WIDTH, TOOLBAR_ICON_HEIGHT, 10+image_id); - return x; -} - -void draw_window() -{ - #define BUTTONS_GAP 5 - #define BLOCKS_GAP 18 - #define TOOLBAR_BUTTON_WIDTH 26 - incn x; - int old_w; - DefineAndDrawWindow(Form.left,Form.top,Form.width,Form.height,0x73,0,#title,0); - GetProcessInfo(#Form, SelfInfo); - sc.get(); - if (Form.status_window>2) return; - - if (Form.width < 340) { MoveSize(OLD,OLD,340,OLD); return; } - if (Form.height < 200) { MoveSize(OLD,OLD,OLD,200); return; } - - DrawBar(0, 0, Form.cwidth, TOOLBAR_H - 1, sc.work); - DrawBar(0, TOOLBAR_H - 1, Form.cwidth, 1, sc.work_graph); - - x.n = 0; - DrawToolbarButton(OPEN_FILE, x.inc(8)); - DrawToolbarButton(SHOW_FILE_PROPERTIES, x.inc(TOOLBAR_BUTTON_WIDTH + BUTTONS_GAP)); - - DrawToolbarButton(MAGNIFY_MINUS, x.inc(TOOLBAR_BUTTON_WIDTH + BLOCKS_GAP)); - DrawToolbarButton(MAGNIFY_PLUS, x.inc(TOOLBAR_BUTTON_WIDTH - 1)); - - search_mx = DrawToolbarButton(SEARCH_BTN, x.inc(TOOLBAR_BUTTON_WIDTH + BLOCKS_GAP)); - charsets_mx = DrawToolbarButton(CHANGE_CHARSET, x.inc(TOOLBAR_BUTTON_WIDTH + BUTTONS_GAP)); - reopenin_mx = DrawToolbarButton(REOPEN_IN_APP, x.inc(TOOLBAR_BUTTON_WIDTH + BUTTONS_GAP)); - - x.n = Form.cwidth - 34; - DrawToolbarButton(SHOW_INFO, x.n); - colscheme_mx = DrawToolbarButton(COLOR_SCHEME, x.inc(-TOOLBAR_BUTTON_WIDTH - BUTTONS_GAP)); - - if (search.draw(BTN_FIND_NEXT+10, BTN_FIND_CLOSE+10, Form.cheight - SEARCH_H)) { - DrawRectangle3D(search_mx+1, 6, TOOLBAR_ICON_WIDTH-1, - TOOLBAR_ICON_HEIGHT-1, 0xCCCccc, 0xF8FCF8); - } - - old_w = list.w; - - list.SetSizes(0, TOOLBAR_H, Form.cwidth-scroll.size_x-1, - Form.cheight-TOOLBAR_H-search.height(), math.round(kfont.size.pt * 1.4)); - - if ((Form.cwidth-scroll.size_x-1 == old_w) && (list.count)) { - DrawPage(); - } else { - ParseAndPaint(); - } - - DrawRectangle(scroll.start_x, scroll.start_y, scroll.size_x, scroll.size_y-1, scroll.bckg_col); -} - -void DrawPage() -{ - kfont.ShowBufferPart(list.x, list.y, list.w, list.h, list.first*list.item_h*list.w); - - scroll.max_area = list.count; - scroll.cur_area = list.visible; - scroll.position = list.first; - scroll.all_redraw = 0; - scroll.start_x = list.x + list.w; - scroll.start_y = list.y; - scroll.size_y = list.h; - scrollbar_v_draw(#scroll); -} diff --git a/programs/demos/cubeline/trunk/main.cpp b/programs/demos/cubeline/trunk/main.cpp index 4c18e744c9..241c9bcc6b 100644 --- a/programs/demos/cubeline/trunk/main.cpp +++ b/programs/demos/cubeline/trunk/main.cpp @@ -29,10 +29,7 @@ static struct { #define KEY_ESC 1 #define KEY_F 33 -static char title1[] = "TinyGL in KolibriOS"; -static char title2[] = "F full screen"; -static char title3[] = "ESC - exit"; -static char fps[] = "FPS:"; +static char title[50] = "Cubeline / F full screen / FPS:"; static unsigned char FullScreen = 0; static unsigned char skin = 3; @@ -164,22 +161,15 @@ static void disabletgl() static void Title() { - __menuet__write_text(300,8,0x10ffffff,fps,strlen(fps)); - __menuet__write_text(8,8,0x10ffffff,title1,strlen(title1)); - __menuet__write_text(180,8,0x00ffffff,title2,strlen(title2)); - __menuet__write_text(600,8,0x00ffffff,title3,strlen(title3)); + SysCall(71,1,title); } static void draw_window(void) { - // start redraw - __menuet__window_redraw(1); - // define&draw window - __menuet__define_window(win.x,win.y,win.dx,win.dy,TYPEWIN(0,0,0,1,skin,0,0,0),0,0); - // end redraw - __menuet__window_redraw(2); - // display string - Title(); + __menuet__window_redraw(1); // start redraw + __menuet__define_window(win.x,win.y,win.dx,win.dy,TYPEWIN(0,0,0,1,skin,0,0,0),0,0); + __menuet__window_redraw(2); // end redraw + Title(); } int main(void) diff --git a/programs/demos/bgitest/trunk/FONTS/BOLD.CHR b/programs/other/outdated/bgitest/trunk/FONTS/BOLD.CHR similarity index 100% rename from programs/demos/bgitest/trunk/FONTS/BOLD.CHR rename to programs/other/outdated/bgitest/trunk/FONTS/BOLD.CHR diff --git a/programs/demos/bgitest/trunk/FONTS/EURO.CHR b/programs/other/outdated/bgitest/trunk/FONTS/EURO.CHR similarity index 100% rename from programs/demos/bgitest/trunk/FONTS/EURO.CHR rename to programs/other/outdated/bgitest/trunk/FONTS/EURO.CHR diff --git a/programs/demos/bgitest/trunk/FONTS/GOTH.CHR b/programs/other/outdated/bgitest/trunk/FONTS/GOTH.CHR similarity index 100% rename from programs/demos/bgitest/trunk/FONTS/GOTH.CHR rename to programs/other/outdated/bgitest/trunk/FONTS/GOTH.CHR diff --git a/programs/demos/bgitest/trunk/FONTS/LCOM.CHR b/programs/other/outdated/bgitest/trunk/FONTS/LCOM.CHR similarity index 100% rename from programs/demos/bgitest/trunk/FONTS/LCOM.CHR rename to programs/other/outdated/bgitest/trunk/FONTS/LCOM.CHR diff --git a/programs/demos/bgitest/trunk/FONTS/LITT.CHR b/programs/other/outdated/bgitest/trunk/FONTS/LITT.CHR similarity index 100% rename from programs/demos/bgitest/trunk/FONTS/LITT.CHR rename to programs/other/outdated/bgitest/trunk/FONTS/LITT.CHR diff --git a/programs/demos/bgitest/trunk/FONTS/SANS.CHR b/programs/other/outdated/bgitest/trunk/FONTS/SANS.CHR similarity index 100% rename from programs/demos/bgitest/trunk/FONTS/SANS.CHR rename to programs/other/outdated/bgitest/trunk/FONTS/SANS.CHR diff --git a/programs/demos/bgitest/trunk/FONTS/SCRI.CHR b/programs/other/outdated/bgitest/trunk/FONTS/SCRI.CHR similarity index 100% rename from programs/demos/bgitest/trunk/FONTS/SCRI.CHR rename to programs/other/outdated/bgitest/trunk/FONTS/SCRI.CHR diff --git a/programs/demos/bgitest/trunk/FONTS/SIMP.CHR b/programs/other/outdated/bgitest/trunk/FONTS/SIMP.CHR similarity index 100% rename from programs/demos/bgitest/trunk/FONTS/SIMP.CHR rename to programs/other/outdated/bgitest/trunk/FONTS/SIMP.CHR diff --git a/programs/demos/bgitest/trunk/FONTS/SMAL.CHR b/programs/other/outdated/bgitest/trunk/FONTS/SMAL.CHR similarity index 100% rename from programs/demos/bgitest/trunk/FONTS/SMAL.CHR rename to programs/other/outdated/bgitest/trunk/FONTS/SMAL.CHR diff --git a/programs/demos/bgitest/trunk/FONTS/TRIP.CHR b/programs/other/outdated/bgitest/trunk/FONTS/TRIP.CHR similarity index 100% rename from programs/demos/bgitest/trunk/FONTS/TRIP.CHR rename to programs/other/outdated/bgitest/trunk/FONTS/TRIP.CHR diff --git a/programs/demos/bgitest/trunk/FONTS/TSCR.CHR b/programs/other/outdated/bgitest/trunk/FONTS/TSCR.CHR similarity index 100% rename from programs/demos/bgitest/trunk/FONTS/TSCR.CHR rename to programs/other/outdated/bgitest/trunk/FONTS/TSCR.CHR diff --git a/programs/demos/bgitest/trunk/Tupfile.lua b/programs/other/outdated/bgitest/trunk/Tupfile.lua similarity index 100% rename from programs/demos/bgitest/trunk/Tupfile.lua rename to programs/other/outdated/bgitest/trunk/Tupfile.lua diff --git a/programs/demos/bgitest/trunk/bgifont.inc b/programs/other/outdated/bgitest/trunk/bgifont.inc similarity index 100% rename from programs/demos/bgitest/trunk/bgifont.inc rename to programs/other/outdated/bgitest/trunk/bgifont.inc diff --git a/programs/demos/bgitest/trunk/bgitest.asm b/programs/other/outdated/bgitest/trunk/bgitest.asm similarity index 99% rename from programs/demos/bgitest/trunk/bgitest.asm rename to programs/other/outdated/bgitest/trunk/bgitest.asm index 4f98dd2dd1..ef24644825 100644 --- a/programs/demos/bgitest/trunk/bgitest.asm +++ b/programs/other/outdated/bgitest/trunk/bgitest.asm @@ -69,7 +69,7 @@ use32 not1strun dd 0x0 include 'lang.inc' -include '..\..\..\macros.inc' +include '..\..\..\..\macros.inc' ;include 'debug.inc' include 'bgifont.inc' diff --git a/programs/demos/bgitest/trunk/build_en.bat b/programs/other/outdated/bgitest/trunk/build_en.bat similarity index 100% rename from programs/demos/bgitest/trunk/build_en.bat rename to programs/other/outdated/bgitest/trunk/build_en.bat diff --git a/programs/demos/bgitest/trunk/build_ru.bat b/programs/other/outdated/bgitest/trunk/build_ru.bat similarity index 100% rename from programs/demos/bgitest/trunk/build_ru.bat rename to programs/other/outdated/bgitest/trunk/build_ru.bat diff --git a/programs/demos/bgitest/trunk/read_eng.txt b/programs/other/outdated/bgitest/trunk/read_eng.txt similarity index 100% rename from programs/demos/bgitest/trunk/read_eng.txt rename to programs/other/outdated/bgitest/trunk/read_eng.txt diff --git a/programs/demos/bgitest/trunk/read_rus.txt b/programs/other/outdated/bgitest/trunk/read_rus.txt similarity index 100% rename from programs/demos/bgitest/trunk/read_rus.txt rename to programs/other/outdated/bgitest/trunk/read_rus.txt