From 2cfdddd8c62c44751cfc10d51e1354f19c4ec364 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Wed, 23 Nov 2016 11:37:13 +0000 Subject: [PATCH] fix DefineAndDrawWindow(), rename vfc to diff git-svn-id: svn://kolibrios.org@6746 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/Calypte/Calypte.c | 2 +- programs/cmm/Calypte/include/properties.h | 2 +- programs/cmm/aelia/aelia.c | 2 +- programs/cmm/app_plus/app_plus.c | 2 +- programs/cmm/dicty/dicty.c | 2 +- programs/cmm/{vfc => diff}/32user32.h | 0 programs/cmm/{vfc => diff}/Tupfile.lua | 2 +- programs/cmm/diff/build.bat | 5 +++++ programs/cmm/{vfc/vfc.c => diff/diff.c} | 4 ++-- programs/cmm/{vfc/vfc_gui.h => diff/diff_gui.h} | 4 +++- programs/cmm/{vfc => diff}/if.h | 0 programs/cmm/{vfc => diff}/objects.h | 0 programs/cmm/drvinst/drvinst.c | 2 +- programs/cmm/eolite/include/about.h | 2 +- programs/cmm/eolite/include/progress_dialog.h | 2 +- programs/cmm/eolite/include/properties.h | 2 +- programs/cmm/eolite/include/settings.h | 2 +- programs/cmm/examples/menu.c | 2 +- programs/cmm/examples/rgb.c | 2 +- programs/cmm/examples/window.c | 2 +- programs/cmm/experimental/easyshot/easyshot.c | 2 +- programs/cmm/kf_font_viewer/font_viewer.c | 2 +- programs/cmm/lib/kolibri.h | 14 +++++++------- programs/cmm/liza/liza.c | 2 +- programs/cmm/panels_cfg/panels_cfg.c | 2 +- programs/cmm/process/process.c | 2 +- programs/cmm/software_widget/software_widget.c | 2 +- programs/cmm/template/template.c | 2 +- programs/cmm/textreader/textreader.c | 2 +- programs/cmm/vfc/build.bat | 5 ----- 30 files changed, 39 insertions(+), 37 deletions(-) rename programs/cmm/{vfc => diff}/32user32.h (100%) rename programs/cmm/{vfc => diff}/Tupfile.lua (63%) create mode 100644 programs/cmm/diff/build.bat rename programs/cmm/{vfc/vfc.c => diff/diff.c} (94%) rename programs/cmm/{vfc/vfc_gui.h => diff/diff_gui.h} (94%) rename programs/cmm/{vfc => diff}/if.h (100%) rename programs/cmm/{vfc => diff}/objects.h (100%) delete mode 100644 programs/cmm/vfc/build.bat diff --git a/programs/cmm/Calypte/Calypte.c b/programs/cmm/Calypte/Calypte.c index fcb87ffebc..e3eef0bbb5 100644 --- a/programs/cmm/Calypte/Calypte.c +++ b/programs/cmm/Calypte/Calypte.c @@ -312,7 +312,7 @@ void main() void draw_window() { system.color.get(); - DefineAndDrawWindow(GetScreenWidth()-WIN_W/2,GetScreenHeight()-WIN_H/2,WIN_W,WIN_H,0x73,0xFFFFFF,#win_title); + DefineAndDrawWindow(GetScreenWidth()-WIN_W/2,GetScreenHeight()-WIN_H/2,WIN_W,WIN_H,0x73,0xFFFFFF,#win_title,0); GetProcessInfo(#Form, SelfInfo); DrawBar(0, 0, Form.cwidth, TOPPANELH, system.color.work); DrawBar(0, Form.cheight-BOTPANELH, Form.cwidth, BOTPANELH, system.color.work); diff --git a/programs/cmm/Calypte/include/properties.h b/programs/cmm/Calypte/include/properties.h index dd6b0460ec..6988a83654 100644 --- a/programs/cmm/Calypte/include/properties.h +++ b/programs/cmm/Calypte/include/properties.h @@ -81,7 +81,7 @@ void properties_dialog() break; case evReDraw: - DefineAndDrawWindow(Form.left + 150,150,270,285+skin_height,0x34,system.color.work,WINDOW_TITLE_PROPERTIES); + DefineAndDrawWindow(Form.left + 150,150,270,285+skin_height,0x34,system.color.work,WINDOW_TITLE_PROPERTIES,0; GetProcessInfo(#settings_form, SelfInfo); DrawCaptButton(settings_form.cwidth-70-13, settings_form.cheight-34, 70, 22, 10, 0x288FBD, 0xFFFfff, BTN_CLOSE); } diff --git a/programs/cmm/aelia/aelia.c b/programs/cmm/aelia/aelia.c index cefcde6b9b..148b9c8e68 100644 --- a/programs/cmm/aelia/aelia.c +++ b/programs/cmm/aelia/aelia.c @@ -405,7 +405,7 @@ void EventShowDownloader() void draw_window() { - DefineAndDrawWindow(Form.left,Form.top,Form.width,Form.height,0x73,0,#title); + DefineAndDrawWindow(Form.left,Form.top,Form.width,Form.height,0x73,0,#title,0); GetProcessInfo(#Form, SelfInfo); if (Form.status_window>2) return; diff --git a/programs/cmm/app_plus/app_plus.c b/programs/cmm/app_plus/app_plus.c index 609a7f9779..e6d6512ab9 100644 --- a/programs/cmm/app_plus/app_plus.c +++ b/programs/cmm/app_plus/app_plus.c @@ -92,7 +92,7 @@ void draw_window() dword x=30; y.n=0; system.color.get(); - DefineAndDrawWindow(screen.width-570/2, 100, 570, 280+skin_height, 0x34, system.color.work, WINDOW_TITLE_TEXT); + DefineAndDrawWindow(screen.width-570/2, 100, 570, 280+skin_height, 0x34, system.color.work, WINDOW_TITLE_TEXT,0); GetProcessInfo(#Form, SelfInfo); WriteTextB(x+2,y.inc(20)+2,0x81,MixColors(system.color.work, 0xB92234,220),CONTENT_HEADER_TEXT); WriteTextB(x,y.n,0x81,0xB92234,CONTENT_HEADER_TEXT); diff --git a/programs/cmm/dicty/dicty.c b/programs/cmm/dicty/dicty.c index 75d63c8358..d317fe3439 100644 --- a/programs/cmm/dicty/dicty.c +++ b/programs/cmm/dicty/dicty.c @@ -75,7 +75,7 @@ void main() case evReDraw: system.color.get(); - DefineAndDrawWindow(215,120,500,350,0x73,system.color.work,WINDOW_TITLE); + DefineAndDrawWindow(215,120,500,350,0x73,system.color.work,WINDOW_TITLE,0); GetProcessInfo(#Form, SelfInfo); if (Form.status_window>2) break; if (Form.height<140) { MoveSize(OLD,OLD,OLD,140); break; } diff --git a/programs/cmm/vfc/32user32.h b/programs/cmm/diff/32user32.h similarity index 100% rename from programs/cmm/vfc/32user32.h rename to programs/cmm/diff/32user32.h diff --git a/programs/cmm/vfc/Tupfile.lua b/programs/cmm/diff/Tupfile.lua similarity index 63% rename from programs/cmm/vfc/Tupfile.lua rename to programs/cmm/diff/Tupfile.lua index 30afdd0a95..750c144a47 100644 --- a/programs/cmm/vfc/Tupfile.lua +++ b/programs/cmm/diff/Tupfile.lua @@ -3,4 +3,4 @@ if tup.getconfig("LANG") == "ru" then C_LANG = "LANG_RUS" else C_LANG = "LANG_ENG" -- this includes default case without config end -tup.rule("vfc.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "vfc.com") +tup.rule("diff.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "diff.com") diff --git a/programs/cmm/diff/build.bat b/programs/cmm/diff/build.bat new file mode 100644 index 0000000000..5bd5777976 --- /dev/null +++ b/programs/cmm/diff/build.bat @@ -0,0 +1,5 @@ +@del diff +@c-- diff.c +@move diff.com diff +@del warning.txt +@pause diff --git a/programs/cmm/vfc/vfc.c b/programs/cmm/diff/diff.c similarity index 94% rename from programs/cmm/vfc/vfc.c rename to programs/cmm/diff/diff.c index 8c1a2e659a..99398582de 100644 --- a/programs/cmm/vfc/vfc.c +++ b/programs/cmm/diff/diff.c @@ -11,13 +11,13 @@ IO io1, io2; #include "32user32.h" #include "objects.h" -#include "vfc_gui.h" +#include "diff_gui.h" #define mincmpstrings 2 #define maxcmpstrings 10 #define maxcmpoffset 100 -char window_title[] = "Visual Text Comparer (Diff tool)"; +char window_title[] = "Kolibri Diff tool (Visual Text Comparer)"; char* srcfilename; char* dstfilename; diff --git a/programs/cmm/vfc/vfc_gui.h b/programs/cmm/diff/diff_gui.h similarity index 94% rename from programs/cmm/vfc/vfc_gui.h rename to programs/cmm/diff/diff_gui.h index 262170a4dc..07a546000e 100644 --- a/programs/cmm/vfc/vfc_gui.h +++ b/programs/cmm/diff/diff_gui.h @@ -28,6 +28,8 @@ void gui() OpenDialog_init stdcall (#o_dialog); SetEventMask(0x27); + debugln("GUI"); + loop() switch(WaitEvent()) { case evMouse: @@ -93,7 +95,7 @@ void gui() void draw_window() { system.color.get(); - DefineAndDrawWindow(215, 100, 450, 195 + skin_height, 0x34, system.color.work, #window_title); + DefineAndDrawWindow(215, 100, 450, 195 + skin_height, 0x34, system.color.work, #window_title,0); GetProcessInfo(#Form, SelfInfo); WriteText(src_box.left-2, src_box.top-21, 0x90, system.color.work_text, "First file:"); diff --git a/programs/cmm/vfc/if.h b/programs/cmm/diff/if.h similarity index 100% rename from programs/cmm/vfc/if.h rename to programs/cmm/diff/if.h diff --git a/programs/cmm/vfc/objects.h b/programs/cmm/diff/objects.h similarity index 100% rename from programs/cmm/vfc/objects.h rename to programs/cmm/diff/objects.h diff --git a/programs/cmm/drvinst/drvinst.c b/programs/cmm/drvinst/drvinst.c index 5b1f070a96..35e90fa88f 100644 --- a/programs/cmm/drvinst/drvinst.c +++ b/programs/cmm/drvinst/drvinst.c @@ -193,7 +193,7 @@ void GetCurrentSectionData() void Event_DrawWindow() { system.color.get(); - DefineAndDrawWindow(215, 100, 600, 400, 0x33, system.color.work, WINDOW_TITLE); + DefineAndDrawWindow(215, 100, 600, 400, 0x33, system.color.work, WINDOW_TITLE,0); GetProcessInfo(#Form, SelfInfo); if (Form.status_window>2) return; if (Form.width < 450) { MoveSize(OLD,OLD,450,OLD); return; } diff --git a/programs/cmm/eolite/include/about.h b/programs/cmm/eolite/include/about.h index 465843feff..780a6eb6ce 100644 --- a/programs/cmm/eolite/include/about.h +++ b/programs/cmm/eolite/include/about.h @@ -34,7 +34,7 @@ void about_dialog() break; case evReDraw: - DefineAndDrawWindow(Form.left+Form.width/2,Form.top+Form.height/2-114,310,300+GetSkinHeight(),0x34,system.color.work,NULL); + DefineAndDrawWindow(Form.left+Form.width/2,Form.top+Form.height/2-114,310,300+GetSkinHeight(),0x34,system.color.work,NULL,0); GetProcessInfo(#about_form, SelfInfo); if (about_form.status_window>2) break; logo_pal[0] = system.color.work; diff --git a/programs/cmm/eolite/include/progress_dialog.h b/programs/cmm/eolite/include/progress_dialog.h index cf3f863199..3c2b7885cb 100644 --- a/programs/cmm/eolite/include/progress_dialog.h +++ b/programs/cmm/eolite/include/progress_dialog.h @@ -35,7 +35,7 @@ void DisplayOperationForm() title = T_DELETE_WINDOW_TITLE; message = T_DELETE_WINDOW_TEXT; } - DefineAndDrawWindow(Form.left+Form.width-200,Form.top+90,WIN_DIALOG_W,skin_height+WIN_DIALOG_H,0x34,system.color.work,title); + DefineAndDrawWindow(Form.left+Form.width-200,Form.top+90,WIN_DIALOG_W,skin_height+WIN_DIALOG_H,0x34,system.color.work,title,0); GetProcessInfo(#Dialog_Form, SelfInfo); WriteText(45, 11, 0x90, system.color.work_text, message); DrawFlatButton(Dialog_Form.cwidth - 105, copy_bar.top-2 , T_CANCEL_PASTE, T_ABORT_WINDOW_BUTTON); diff --git a/programs/cmm/eolite/include/properties.h b/programs/cmm/eolite/include/properties.h index 27db7895f6..3d47f980e7 100644 --- a/programs/cmm/eolite/include/properties.h +++ b/programs/cmm/eolite/include/properties.h @@ -345,7 +345,7 @@ void properties_dialog() void DrawPropertiesWindow() { - DefineAndDrawWindow(Form.left + 150,150,305,360+skin_height,0x34,system.color.work,WINDOW_TITLE_PROPERTIES); + DefineAndDrawWindow(Form.left + 150,150,305,360+skin_height,0x34,system.color.work,WINDOW_TITLE_PROPERTIES,0); if ( !asm test path_to_file_ed.flags, 2) { path_to_file_ed.blur_border_color = system.color.work; diff --git a/programs/cmm/eolite/include/settings.h b/programs/cmm/eolite/include/settings.h index 7498302c2a..c099742ca0 100644 --- a/programs/cmm/eolite/include/settings.h +++ b/programs/cmm/eolite/include/settings.h @@ -91,7 +91,7 @@ void settings_dialog() break; case evReDraw: - DefineAndDrawWindow(Form.cwidth-300/2+Form.left, Form.cheight-292/2+Form.top, 376, 370+skin_height,0x34,system.color.work,TITLE_SETT); + DefineAndDrawWindow(Form.cwidth-300/2+Form.left, Form.cheight-292/2+Form.top, 376, 370+skin_height,0x34,system.color.work,TITLE_SETT,0); DrawSettingsCheckBoxes(); } } diff --git a/programs/cmm/examples/menu.c b/programs/cmm/examples/menu.c index a393a3721c..3c8b84f52b 100644 --- a/programs/cmm/examples/menu.c +++ b/programs/cmm/examples/menu.c @@ -59,7 +59,7 @@ void main() if (menu.list.cur_y) { if (menu.list.cur_y > butv.id) && (menu.list.cur_y < buta.id) category = menu.list.cur_y - butv.id; } - DefineAndDrawWindow(215,100,350,300,0x34,0xFFFFFF,"Window header"); + DefineAndDrawWindow(215,100,350,300,0x34,0xFFFFFF,"Window header",0); GetProcessInfo(#Form, SelfInfo); WriteText(10,110,0x80,0,#param); DrawCaptButton(butv.x, butv.y, butv.w, butv.h, butv.id, 0xCCCccc, 0x000000, "Vegetables"); diff --git a/programs/cmm/examples/rgb.c b/programs/cmm/examples/rgb.c index 8f2179a4b4..b36f9010a4 100644 --- a/programs/cmm/examples/rgb.c +++ b/programs/cmm/examples/rgb.c @@ -45,7 +45,7 @@ byte id; break; case evReDraw: system.color.get(); - DefineAndDrawWindow(screen.width-fw/2,screen.height-fh/2,fw,fh+skin_height,0x33,0xE0DFE3,"Rainbow (rgb test)"); + DefineAndDrawWindow(screen.width-fw/2,screen.height-fh/2,fw,fh+skin_height,0x33,0xE0DFE3,"Rainbow (rgb test)",0); _PutImage(0,0,256,256,#image); DrawCaptButton(280,20, 110,30,DRAW1_BTN,system.color.work_button,system.color.work_button_text,"Draw 1"); DrawCaptButton(280,60, 110,30,DRAW2_BTN,system.color.work_button,system.color.work_button_text,"Draw 2"); diff --git a/programs/cmm/examples/window.c b/programs/cmm/examples/window.c index 69e7a0bc04..87d9a29d3b 100644 --- a/programs/cmm/examples/window.c +++ b/programs/cmm/examples/window.c @@ -29,7 +29,7 @@ void draw_window() { proc_info Form; int i; - DefineAndDrawWindow(215,100,350,300,0x34,0xFFFFFF,"Window header"); + DefineAndDrawWindow(215,100,350,300,0x34,0xFFFFFF,"Window header",0); GetProcessInfo(#Form, SelfInfo); for (i=0; i2) break; DrawBar(0, 0, Form.cwidth, 41, sc.work); diff --git a/programs/cmm/kf_font_viewer/font_viewer.c b/programs/cmm/kf_font_viewer/font_viewer.c index e8e839d89b..ec03c6b173 100644 --- a/programs/cmm/kf_font_viewer/font_viewer.c +++ b/programs/cmm/kf_font_viewer/font_viewer.c @@ -33,7 +33,7 @@ void main() goto _DRAW_WINDOW_CONTENT; case evReDraw: system.color.get(); - DefineAndDrawWindow(215,100,500,320+skin_height,0x74,0xFFFFFF,#title); + DefineAndDrawWindow(215,100,500,320+skin_height,0x74,0xFFFFFF,#title,0); GetProcessInfo(#Form, SelfInfo); if (Form.status_window>2) break; _DRAW_WINDOW_CONTENT: diff --git a/programs/cmm/lib/kolibri.h b/programs/cmm/lib/kolibri.h index 6e27f04b75..c878878794 100644 --- a/programs/cmm/lib/kolibri.h +++ b/programs/cmm/lib/kolibri.h @@ -331,18 +331,18 @@ inline fastcall int TestBit( EAX, CL) //------------------------------------------------------------------------------ -:void DefineAndDrawWindow(dword x, y, size_w, size_h, byte WindowType,dword WindowAreaColor, bgcolor, title) +:void DefineAndDrawWindow(dword _x, _y, _w, _h, _window_type, _bgcolor, _title, _flags) { EAX = 12; // function 12:tell os about windowdraw EBX = 1; $int 0x40 $xor EAX,EAX - EBX = x << 16 + size_w; - ECX = y << 16 + size_h; - EDX = WindowType << 24 | WindowAreaColor; - EDI = bgcolor; - ESI = title; + EBX = _x << 16 + _w; + ECX = _y << 16 + _h; + EDX = _window_type << 24 | _bgcolor; + EDI = _title; + ESI = _flags; $int 0x40 @@ -510,7 +510,7 @@ inline fastcall dword GetStartTime() loop()switch(WaitEvent()) { case evReDraw: - DefineAndDrawWindow(X_EventRedrawWindow,Y_EventRedrawWindow,100,1,1,0x34,0xFFFFFF,""); + DefineAndDrawWindow(X_EventRedrawWindow,Y_EventRedrawWindow,100,1,1,0x34,0xFFFFFF,"",0); pause(10); ExitProcess(); break; diff --git a/programs/cmm/liza/liza.c b/programs/cmm/liza/liza.c index eaaa5b5060..1651149cd7 100644 --- a/programs/cmm/liza/liza.c +++ b/programs/cmm/liza/liza.c @@ -117,7 +117,7 @@ void main() { int DefineWindow(dword wtitle) { system.color.get(); - DefineAndDrawWindow(GetScreenWidth()-WIN_W/2,GetScreenHeight()-WIN_H/2, WIN_W, WIN_H, 0x73,system.color.work); + DefineAndDrawWindow(GetScreenWidth()-WIN_W/2,GetScreenHeight()-WIN_H/2, WIN_W, WIN_H, 0x73,system.color.work, 0,0); DrawTitle(wtitle); GetProcessInfo(#Form, SelfInfo); if (Form.status_window>2) return 0; //rolled_up diff --git a/programs/cmm/panels_cfg/panels_cfg.c b/programs/cmm/panels_cfg/panels_cfg.c index 3b299f7916..e80574fe5d 100644 --- a/programs/cmm/panels_cfg/panels_cfg.c +++ b/programs/cmm/panels_cfg/panels_cfg.c @@ -143,7 +143,7 @@ void main() case evReDraw: system.color.get(); - DefineAndDrawWindow(130, 150, 465, 398+GetSkinHeight(),0x34,system.color.work,WINDOW_TITLE); + DefineAndDrawWindow(130, 150, 465, 398+GetSkinHeight(),0x34,system.color.work,WINDOW_TITLE,0); GetProcessInfo(#Form, SelfInfo); if (Form.status_window>2) break; taskbar_frame.size_x = docky_frame.size_x = - taskbar_frame.start_x * 2 + Form.cwidth; diff --git a/programs/cmm/process/process.c b/programs/cmm/process/process.c index a8897340cd..bb73657ff9 100644 --- a/programs/cmm/process/process.c +++ b/programs/cmm/process/process.c @@ -99,7 +99,7 @@ void main() break; case evReDraw: system.color.get(); - DefineAndDrawWindow(screen.width-400/2,screen.height-450/2,400,454,0x73,0,T_WINDOW_TITLE); + DefineAndDrawWindow(screen.width-400/2,screen.height-450/2,400,454,0x73,0,T_WINDOW_TITLE,0); GetProcessInfo(#Form, SelfInfo); if (Form.status_window>2) break; if (Form.width < 300) { MoveSize(OLD,OLD,300,OLD); break; } diff --git a/programs/cmm/software_widget/software_widget.c b/programs/cmm/software_widget/software_widget.c index 1abc9cb68f..728bc7efbc 100644 --- a/programs/cmm/software_widget/software_widget.c +++ b/programs/cmm/software_widget/software_widget.c @@ -92,7 +92,7 @@ void main() case evReDraw: system.color.get(); - DefineAndDrawWindow(GetScreenWidth()-window_width/2,GetScreenHeight()-window_height/2,window_width,window_height,0x74,system.color.work,""); + DefineAndDrawWindow(screen.width-window_width/2,screen.height-window_height/2,window_width,window_height,0x74,system.color.work,"",0); GetProcessInfo(#Form, SelfInfo); if (Form.status_window>2) { DrawTitle(#window_title); break; } else DrawTitle(""); draw_top_bar(); diff --git a/programs/cmm/template/template.c b/programs/cmm/template/template.c index 7386739ba2..18a6661693 100644 --- a/programs/cmm/template/template.c +++ b/programs/cmm/template/template.c @@ -32,6 +32,6 @@ void main() void draw_window() { - DefineAndDrawWindow(215, 100, 350, 300, 0x34, 0xEEEeee, "Window title"); + DefineAndDrawWindow(215, 100, 350, 300, 0x34, 0xEEEeee, "Window title",0); GetProcessInfo(#Form, SelfInfo); } diff --git a/programs/cmm/textreader/textreader.c b/programs/cmm/textreader/textreader.c index cb8afffe3e..3262bd424c 100644 --- a/programs/cmm/textreader/textreader.c +++ b/programs/cmm/textreader/textreader.c @@ -259,7 +259,7 @@ void OpenFile(dword f_path) void draw_window() { - DefineAndDrawWindow(Form.left,Form.top,Form.width,Form.height,0x73,0,#title); + DefineAndDrawWindow(Form.left,Form.top,Form.width,Form.height,0x73,0,#title,0); GetProcessInfo(#Form, SelfInfo); if (Form.status_window>2) return; diff --git a/programs/cmm/vfc/build.bat b/programs/cmm/vfc/build.bat deleted file mode 100644 index 8c50e2e82b..0000000000 --- a/programs/cmm/vfc/build.bat +++ /dev/null @@ -1,5 +0,0 @@ -@del vfc -@c-- vfc.c -@move vfc.com vfc -@del warning.txt -@pause