/programs/cmm/vfc/if.h |
---|
File deleted |
/programs/cmm/vfc/build.bat |
---|
File deleted |
/programs/cmm/vfc/Tupfile.lua |
---|
File deleted |
/programs/cmm/vfc/vfc_gui.h |
---|
File deleted |
\ No newline at end of file |
/programs/cmm/vfc/32user32.h |
---|
File deleted |
\ No newline at end of file |
/programs/cmm/vfc/objects.h |
---|
File deleted |
/programs/cmm/vfc/vfc.c |
---|
File deleted |
/programs/cmm/Calypte/Calypte.c |
---|
312,7 → 312,7 |
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); |
/programs/cmm/Calypte/include/properties.h |
---|
81,7 → 81,7 |
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); |
} |
/programs/cmm/aelia/aelia.c |
---|
405,7 → 405,7 |
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; |
/programs/cmm/app_plus/app_plus.c |
---|
92,7 → 92,7 |
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); |
/programs/cmm/dicty/dicty.c |
---|
75,7 → 75,7 |
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; } |
/programs/cmm/diff/Tupfile.lua |
---|
0,0 → 1,6 |
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("diff.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "diff.com") |
/programs/cmm/diff/build.bat |
---|
0,0 → 1,5 |
@del diff |
@c-- diff.c |
@move diff.com diff |
@del warning.txt |
@pause |
/programs/cmm/diff/diff.c |
---|
0,0 → 1,209 |
//visual text comparer |
//by den po - jdp@bk.ru |
#define MEMSIZE 4096 * 60 |
#include "../lib/io.h" |
#include "../lib/strings.h" |
#include "../lib/obj/console.h" |
IO io1, io2; |
#define MAX_PATH 260 |
#include "32user32.h" |
#include "objects.h" |
#include "diff_gui.h" |
#define mincmpstrings 2 |
#define maxcmpstrings 10 |
#define maxcmpoffset 100 |
char window_title[] = "Kolibri Diff tool (Visual Text Comparer)"; |
char* srcfilename; |
char* dstfilename; |
dword srcfile; |
dword dstfile; |
dword srcfilesize; |
dword dstfilesize; |
TCollection srcfilelines; //file lines |
TCollection dstfilelines; |
TCollection srcfilenums; //lines numbers |
TCollection dstfilenums; |
struct TSimpleCollection:TSortedCollection |
{ |
TSimpleCollection(); |
int Compare( int Key1, Key2 ); |
}; |
int TSimpleCollection::Compare( int Key1, Key2 ){ |
return Key1-Key2; |
} |
TSimpleCollection::TSimpleCollection():TSortedCollection(1000,1000); |
{ |
comparemethod=#Compare; |
} |
TSimpleCollection diffs; //list of differing strings |
dword srcfilelinks; //pointer to the previos line with the same first symbol |
dword dstfilelinks; // |
getstrings(dword srcfile,srcfilesize,srcfilelines){ |
ECX=srcfilesize; |
ESI=srcfile; |
WHILE(ECX){ |
$push ECX,ESI |
EAX=srcfilelines; |
EAX.TCollection.Insert(ESI); |
$pop ESI,ECX |
WHILE(ECX){ |
$cld $lodsb ECX--; |
if(AL==0x0D)||(AL==0x0A)DSBYTE[ESI-1]=0; |
if(AL==0x0D)&&(DSBYTE[ESI]==0x0A){$lodsb;ECX--;} |
if(AL==0x0D)||(AL==0x0A)BREAK; |
} |
} |
} |
#include "if.h" |
bool getparam() |
{ |
int i, param_len = strlen(#param); |
if (param[0]=='"') { |
for (i=1; i<param_len; i++) if (param[i]=='"') param[i]=NULL; |
srcfilename = #param + 1; |
dstfilename = #param + strlen(#param) + 3; |
return true; |
} |
notify("'Wrong params specified. Use next format:\nAPPPATH \"PARAM1\" \"PARAM2\"' -E"); |
return false; |
} |
main(){ |
if (param[0]) getparam(); |
if (!srcfilename) || (!dstfilename) gui(); else console(); |
} |
console() { |
int i; |
int p; |
int bs,bd,bsc,bdc,bsp,bdp; |
int cache[256]; |
char s1; |
int s2; |
srcfile = io1.read(srcfilename); |
dstfile = io2.read(dstfilename); |
srcfilesize = io1.FILES_SIZE; |
dstfilesize = io2.FILES_SIZE; |
if (!srcfile) die("'First file not found' -E"); |
if (!dstfile) die("'Second file not found' -E"); |
srcfilelines.TCollection(srcfilesize/40,8192); |
dstfilelines.TCollection(dstfilesize/40,8192); |
//fill line pointers |
getstrings(srcfile,srcfilesize,#srcfilelines); |
getstrings(dstfile,dstfilesize,#dstfilelines); |
srcfilenums.TCollection(srcfilelines.Count,1000); |
dstfilenums.TCollection(dstfilelines.Count,1000); |
srcfilelinks=malloc(srcfilelines.Count*4); |
dstfilelinks=malloc(dstfilelines.Count*4); |
//fill links on the next strings with the same first symbols |
FillMemory(#cache,sizeof(cache),-1); i=srcfilelines.Count; |
WHILE(i){ |
i--; |
EBX=srcfilelines.At(i); EBX=DSBYTE[EBX]; |
DSDWORD[i<<2+srcfilelinks]=cache[EBX*4]; |
cache[EBX*4]=i; |
} |
FillMemory(#cache,sizeof(cache),-1); i=dstfilelines.Count; |
WHILE(i){ |
i--; |
EBX=dstfilelines.At(i); EBX=DSBYTE[EBX]; |
DSDWORD[i<<2+dstfilelinks]=cache[EBX*4]; |
cache[EBX*4]=i; |
} |
diffs.TSimpleCollection(); |
while( bsp < srcfilelines.Count ) || ( bdp < dstfilelines.Count ) |
{ |
//////////////////////////////////////////////////////// |
bsc=0; |
p=dstfilelines.At(bdp);//current dst position |
s1=DSBYTE[p]; |
bs=bsp+1;//found src line, bsc - number of matched |
while( bs != -1 )//no next line starting with the same symbols |
&&(bs-bsp<=maxcmpoffset)//check for 100 lines depth |
&&(bs<srcfilelines.Count) |
{ |
s2=srcfilelines.At(bs); |
if(!strcmp(p,s2)) |
{//line found |
bsc=1; |
WHILE(bsc<maxcmpstrings)//counting number of matching lines |
&&(bdp+bsc<dstfilelines.Count) |
&&(bs+bsc<srcfilelines.Count) |
&&(!strcmp(dstfilelines.At(bdp+bsc),srcfilelines.At(bs+bsc)))bsc++; |
BREAK; |
} |
if(DSBYTE[s2]==s1)bs=DSDWORD[bs<<2+srcfilelinks];else bs++; |
} |
bdc=0; |
p=srcfilelines.At(bsp);//current src position |
s1=DSBYTE[p]; |
bd=bdp+1;//found dst line, bsc - number of matched |
while( bd != -1 )//no next line starting with the same symbols |
&&(bd-bdp<=maxcmpoffset)//check for 100 lines depth |
&&(bd<dstfilelines.Count) |
{ |
s2=dstfilelines.At(bd); |
if(!strcmp(p,s2)) |
{ |
bdc=1; |
WHILE(bdc<maxcmpstrings)//counting number of matching lines |
&&(bsp+bdc<srcfilelines.Count) |
&&(bd+bdc<dstfilelines.Count) |
&&(!strcmp(srcfilelines.At(bsp+bdc),dstfilelines.At(bd+bdc)))bdc++; |
BREAK; |
} |
if(DSBYTE[s2]==s1)bd=DSDWORD[bd<<2+dstfilelinks];else bd++; |
} |
if(bsc<bdc) |
if(bd-bdp<bdc) |
||(bdc>=mincmpstrings) |
{ |
WHILE(bdp<bd){ |
diffs.Insert(srcfilenums.Count); |
srcfilenums.Insert(-1); dstfilenums.Insert(bdp); bdp++; |
} |
continue; |
} |
if(strcmp(srcfilelines.At(bsp),dstfilelines.At(bdp)))diffs.Insert(srcfilenums.Count); |
//lines are equal |
srcfilenums.Insert(bsp); bsp++; |
dstfilenums.Insert(bdp); bdp++; |
CONTINUE; |
} |
free(srcfilelinks); |
free(dstfilelinks); |
if(!diffs.Count) |
notify("'Nothing to compare' -E"); |
else ifinit(); |
diffs.DeleteAll(); delete diffs; |
dstfilenums.DeleteAll(); delete dstfilenums; |
srcfilenums.DeleteAll(); delete srcfilenums; |
dstfilelines.DeleteAll(); delete dstfilelines; |
srcfilelines.DeleteAll(); delete srcfilelines; |
free(dstfile); |
free(srcfile); |
} |
/programs/cmm/diff/diff_gui.h |
---|
0,0 → 1,108 |
#include "../lib/gui.h" |
#include "../lib/obj/box_lib.h" |
#include "../lib/obj/proc_lib.h" |
#include "../lib/patterns/simple_open_dialog.h" |
char default_dir[] = "/rd/1"; |
od_filter filter2 = {0,0}; |
int mouse_dd1, mouse_dd2; |
char src_box_text[4096]; |
char dst_box_text[4096]; |
edit_box src_box = {340,20,35,0xffffff,0x94AECE,0xFFFfff,0xffffff,0x10000000,sizeof(src_box_text),#src_box_text,#mouse_dd1, 10b}; |
edit_box dst_box = {340,20,95,0xffffff,0x94AECE,0xFFFfff,0xffffff,0x10000000,sizeof(dst_box_text),#dst_box_text,#mouse_dd2, 0b}; |
#define BID_EXIT_PRC 01 |
#define BID_SRC_OPEN 10 |
#define BID_DST_OPEN 11 |
#define BID_COMPARE 12 |
proc_info Form; |
void gui() |
{ |
word btn; |
char run_param[4096]; |
load_dll(boxlib, #box_lib_init,0); |
load_dll(Proc_lib, #OpenDialog_init,0); |
OpenDialog_init stdcall (#o_dialog); |
SetEventMask(0x27); |
debugln("GUI"); |
loop() switch(WaitEvent()) |
{ |
case evMouse: |
edit_box_mouse stdcall (#src_box); |
edit_box_mouse stdcall (#dst_box); |
break; |
case evButton: |
btn = GetButtonID(); |
switch (btn) |
{ |
case BID_EXIT_PRC: |
ExitProcess(); |
case BID_SRC_OPEN: |
OpenDialog_start stdcall (#o_dialog); |
if (o_dialog.status) { |
strcpy(#src_box_text, #openfile_path); |
src_box.size = src_box.pos |
= src_box.shift = src_box.shift_old = strlen(#src_box_text); |
} |
break; |
case BID_DST_OPEN: |
OpenDialog_start stdcall (#o_dialog); |
if (o_dialog.status) { |
strcpy(#dst_box_text, #openfile_path); |
dst_box.size = dst_box.pos |
= dst_box.shift = dst_box.shift_old = strlen(#dst_box_text); |
} |
break; |
case BID_COMPARE: |
sprintf(#run_param, "\"%s\" \"%s\"", #src_box_text, #dst_box_text); |
io.run(I_Path, #run_param); |
break; |
} |
break; |
case evKey: |
GetKeys(); |
if (key_scancode == SCAN_CODE_ESC) ExitProcess(); |
if (key_scancode == SCAN_CODE_TAB) { |
if ( src_box.flags & 10b ) { |
src_box.flags -= 10b; |
dst_box.flags += 10b; |
} else { |
src_box.flags += 10b; |
dst_box.flags -= 10b; |
} |
edit_box_draw stdcall (#src_box); |
edit_box_draw stdcall (#dst_box); |
} |
EAX = key_editbox; |
edit_box_key stdcall (#src_box); |
EAX = key_editbox; |
edit_box_key stdcall (#dst_box); |
break; |
case evReDraw: |
draw_window(); |
break; |
} |
} |
void draw_window() |
{ |
system.color.get(); |
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:"); |
WriteText(dst_box.left-2, dst_box.top-21, 0x90, system.color.work_text, "Second file:"); |
DrawEditBox(#src_box); |
DrawEditBox(#dst_box); |
DrawStandartCaptButton(src_box.left + src_box.width + 15, src_box.top-3, BID_SRC_OPEN, "..."); |
DrawStandartCaptButton(dst_box.left + dst_box.width + 15, dst_box.top-3, BID_DST_OPEN, "..."); |
DrawStandartCaptButton(dst_box.left - 2, dst_box.top + 40, BID_COMPARE, "Compare"); |
} |
/programs/cmm/diff/32user32.h |
---|
0,0 → 1,154 |
:static int __wsprintfproc; |
:static int cdecl __wsprintf(int buff,mask,...){ |
char buffer[MAX_PATH]; |
char bufnum[32]; |
int bufferlen; |
int param; |
int length; |
int pad; |
struct _wsprintf_mf{ |
int precision; |
int width; |
int minus ; |
int plus ; |
int diez ; |
int zero ; |
byte upcase ; |
byte _signed;// |
}mf; |
$push EBX,ESI,EDI; |
param=#mask[sizeof(mask)]; |
length=0; |
EDX=mask; |
EBX=buff; |
for(;;){ |
mf=0; |
mf.precision=0x7FFF; |
REPEATSMALL: |
if(!DSCHAR[EDX]){ |
AL=0; |
$call __wsprintfproc; |
$pop EDI,ESI,EBX; |
return length; |
} |
if(DSCHAR[EDX]!='%'){ |
WRITECHAR: AL=DSCHAR[EDX];$call __wsprintfproc; EDX++;GOTO REPEATSMALL; |
} |
GETMASK: |
EDX++; |
SWITCH(DSCHAR[EDX]){ |
CASE '-': mf.minus++;goto GETMASK; |
CASE '+': mf.plus ++;goto GETMASK; |
CASE '#': mf.diez ++;goto GETMASK; |
CASE '0': mf.zero ++;EDX++; |
} |
WHILE(DSCHAR[EDX]>='0')&&(DSCHAR[EDX]<='9'){ |
$push EDX;mf.width=mf.width*10+DSCHAR[EDX]-'0';$pop EDX;EDX++; |
} |
if(DSCHAR[EDX]=='.'){ |
mf.precision=0; |
GETPRECISION: |
EDX++; |
if(DSCHAR[EDX]>='0') |
&&(DSCHAR[EDX]<='9'){ |
$push EDX;mf.precision=mf.precision*10+DSCHAR[EDX]-'0';$pop EDX; |
GOTO GETPRECISION; |
} |
} |
if(DSCHAR[EDX]=='l'){ |
EDX++; |
} |
if(DSCHAR[EDX]=='h'){ |
EDX++; |
} |
if(DSCHAR[EDX]<'a'){mf.upcase=1;} |
SWITCH(DSCHAR[EDX]|0x20){ |
CASE 'c': buffer=DSCHAR[param];bufferlen=1;goto FORMAT; |
CASE 's': if(!DSDWORD[param])DSDWORD[param]="(null)";//?????? |
FOR(bufferlen=0;bufferlen<mf.precision;bufferlen++){ |
AL=DSCHAR[DSDWORD[param]+bufferlen]; |
if(!AL)BREAK; |
buffer[bufferlen]=AL; |
} |
goto FORMAT; |
} |
//á ᨬ¢®«ì묨 ¯®ª®ç¨«¨. ⥯¥àì ç¨á«®¢ë¥ |
if(mf.precision==0x7FFF){mf.precision=mf.width;} |
if(!mf.precision)mf.precision=1; |
if(DSCHAR[EDX]|0x20=='x'){ |
$push EDX; |
EDI=0;//cnt |
EDX=DSDWORD[param]; |
WHILE(EDX){ |
AL=DL&0xF+0x30;if(AL>'9'){AL+='A'-'9'-1;if(!mf.upcase)AL|=0x20;} |
bufnum[EDI]=AL;EDI++;EDX>>=4; |
} |
$pop EDX; |
WHILE(EDI<mf.precision){bufnum[EDI]='0';EDI++;} |
if(mf.diez){bufnum[EDI]=DSCHAR[EDX];EDI++;bufnum[EDI]='0';EDI++;} |
FOR(bufferlen=0;EDI;bufferlen++){ |
EDI--;buffer[bufferlen]=bufnum[EDI]; |
} |
goto FORMAT; |
} |
switch(DSCHAR[EDX]){ |
CASE 'i': |
CASE 'd': $push EDX;EDX=DSDWORD[param]; |
if(int EDX<0){-EDX;mf._signed++;} |
GOTO WRITEINT; |
CASE 'u': $push EDX;mf.plus=0;EDX=DSDWORD[param]; |
WRITEINT: |
EDI=0;//cnt |
WHILE(EDX){ |
EAX=0;EDX><EAX;EAX/=10;EDX><EAX;bufnum[EDI]=AL+'0';EDI++; |
} |
WHILE(EDI<mf.precision){bufnum[EDI]='0';EDI++;} |
if(mf._signed){bufnum[EDI]='-';EDI++;} |
ELSE |
if(mf.plus){bufnum[EDI]='+';EDI++;} |
FOR(bufferlen=0;EDI;bufferlen++){ |
EDI--;buffer[bufferlen]=bufnum[EDI]; |
} |
$pop EDX; |
FORMAT: |
EDX++; |
param+=sizeof(int); |
pad=mf.width-bufferlen;if(pad<0)pad=0; |
if(!mf.minus)$call FRM; |
FOR(EDI=0;EDI<bufferlen;EDI++){AL=buffer[EDI];$call __wsprintfproc;} |
if(mf.minus)$call FRM; |
BREAK; |
default: |
goto WRITECHAR; |
} |
}//for(;;) |
FRM: WHILE(pad){AL=' ';$call __wsprintfproc;pad--;}$ret; |
} |
:int cdecl wsprintf(...)inline{ |
__wsprintfproc=#WSP; |
goto __wsprintf; |
WSP: DSCHAR[EBX]=AL;EBX++;$ret; |
} |
:void FillMemory(int dest,len,byt){ |
EDI = dest; |
ECX = len; |
AL = byt; |
$cld $rep $stosb |
} |
//#define CopyMemory memmov |
:void CopyMemory(int dest,src,len){ |
EDI = dest; |
ESI = src; |
ECX = len; |
$cld $rep $movsb |
} |
/programs/cmm/diff/if.h |
---|
0,0 → 1,181 |
int verthoriz=0; |
int shownums=1; |
char str[MAX_PATH]; |
word attr[MAX_PATH]; |
printstrat(int x,y,size,_text,_attr) |
{ |
int i; |
for (i=0; i<size; i++) |
{ |
con_set_flags stdcall (ESBYTE[i*2+_attr]); |
con_set_cursor_pos stdcall (x+i,y); |
con_write_string stdcall (_text+i, 1); |
} |
} |
drawline(int x,y,width,linex,s1,s2,ln) |
{ |
int i; |
int s1l; |
int s2l; |
int c1,c2; |
char temp[10]; |
int x2,width2; |
s1l=-1; |
s2l=-1; |
if(s1!=-1)s1l=strlen(s1); |
if(s2!=-1)s2l=strlen(s2); |
FillMemory(#attr,width*2,0x1F); |
str[0]='º'; str[x+width-1]='º'; |
if(s1==-1) |
{ |
FillMemory(#str[1],width-2,'ú'); |
FillMemory(#attr[2],width-2*2,7); |
}else{//áâப ¯à¨áãâáâ¢ã¥â |
x2=1; |
width2=width; |
if(shownums) |
{ |
wsprintf(#temp,"%6d",ln+1); |
for(i=0;i<6;i++) |
{ |
str[i+1]=temp[i]; |
attr[i+1]=0x19; |
} |
str[7]='³'; |
x2+=7; |
width2-=7; |
} |
if(s1>0)&&(s2>0)&&(!strcmp(s1,s2)) |
{//áâப¨ ᮢ¯ ¤ îâ |
for(i=0;i<width2-2;i++) |
if(i+linex<s1l)str[x2+i]=DSBYTE[s1+i+linex];else str[x2+i]=' '; |
}else |
{ |
for(i=0;i<width2-2;i++) |
{ |
if(i+linex<s1l)c1=DSBYTE[s1+i+linex]; else c1=' '; |
if(i+linex<s2l)c2=DSBYTE[s2+i+linex]; else c2=' '; |
str[x2+i]=c1; |
if(c1==c2)attr[x2+i]=0x4F;else attr[x2+i]=0x4E; |
} |
} |
} |
printstrat(x,y,width,#str,#attr); |
} |
drawborder(dword x1,y1,xs1,ys1,fname,line) |
char temp[MAX_PATH]; |
int titlelen; |
{ |
int i,j; |
FillMemory(#str,xs1,'Í'); |
FillMemory(#attr,xs1*2,0x1F); |
str[0]='È'; str[xs1-1]='¼'; |
printstrat(x1,y1+ys1-1,xs1,#str,#attr); //¨¦ïï áâà®çª |
str[0]='É'; str[xs1-1]='»'; |
titlelen=xs1-4; |
if(!shownums)titlelen-=8; |
if(strlen(fname)>titlelen)wsprintf(#temp," ...%s ",strlen(fname)+fname-titlelen+3); |
else wsprintf(#temp," %s ",fname); |
for(i=0;temp[i];i++){ str[i+1]=temp[i]; attr[i+1]=0x1E; } |
if(!shownums) |
{ |
wsprintf(#temp,"[%6d]",line); |
CopyMemory(xs1-9+#str,#temp,8); |
FillMemory(xs1-8*2+#attr,12,0x19); |
} |
printstrat(x1,y1,xs1,#str,#attr); |
} |
printpanel(dword line,linex ,x1,y1,xs1,ys1 ,x2,y2,xs2,ys2) |
{ |
int i,j; |
int s,d,sl,dl; |
int line1,line2; |
for(j=line;j<srcfilenums.Count;j++){ s=srcfilenums.At(j); if(s!=-1)BREAK; } |
if(s==-1)s=srcfilelines.Count-1; |
drawborder(x1,y1,xs1,ys1,srcfilename,s+1); |
for(j=line;j<dstfilenums.Count;j++){ d=dstfilenums.At(j); if(d!=-1)BREAK; } |
if(d==-1)d=dstfilelines.Count-1; |
drawborder(x2,y2,xs2,ys2,dstfilename,d+1); |
for(j=0;j<ys1-2;j++) |
{ |
if(j+line<srcfilenums.Count)s=srcfilenums.At(j+line); else s=-1; |
line1=s; |
if(s!=-1)s=srcfilelines.At(s); |
if(j+line<dstfilenums.Count)d=dstfilenums.At(j+line); else d=-1; |
line2=d; |
if(d!=-1)d=dstfilelines.At(d); |
drawline(x1,y1+j+1,xs1,linex,s,d,line1); |
drawline(x2,y2+j+1,xs2,linex,d,s,line2); |
} |
} |
ifinit() |
int linenum=0; |
int linex=0; |
int ys; |
int sbi_x, sbi_y; |
{ |
load_dll(libConsole, #con_init, 0); |
con_init stdcall (122, 40, 122, 800, #window_title); |
linenum=diffs.At(0); |
sbi_x = 122; |
sbi_y = 800; |
sbi_y--; |
ys=sbi_y-2; |
if(linenum+ys>srcfilenums.Count)linenum=srcfilenums.Count-ys; |
if(linenum<0) linenum=0; |
@redraw: |
if(!verthoriz) |
{ |
printpanel(linenum,linex |
,0,0 |
,sbi_x/2 ,sbi_y |
,sbi_x/2 ,0 |
,sbi_x/2 ,sbi_y |
); |
ys=sbi_y-2; |
} |
else |
{ |
printpanel(linenum,linex |
,0,0 |
,sbi_x ,sbi_y/2 |
,0 ,sbi_y/2 |
,sbi_x ,sbi_y/2 |
); |
if(sbi_y&1) |
{ |
FillMemory(#str,sbi_x,'°'); |
FillMemory(#attr,sbi_x*2,0); |
printstrat(0,sbi_y-1,sbi_x,#str,#attr); |
} |
ys=sbi_y/2-2; |
} |
if (!ys) goto redraw; |
else { |
con_set_cursor_pos stdcall (2,0); |
ExitProcess(); |
} |
} |
/programs/cmm/diff/objects.h |
---|
0,0 → 1,182 |
struct TCollection{ |
int Count;//itemcunt |
int Delta;//increase buffer Delta |
int Items;//pointer to array of item pointers |
int Limit;//currently allocated size (in elements) of Items list |
TCollection( int ALimit,ADelta ); |
~TCollection( void ); |
int At( int Index ); |
void AtDelete( int Index ); |
void AtFree( int Index ); |
void AtInsert( int Index, Item ); |
void DeleteAll( void ); |
void Free( int Item ); |
void FreeAll( void ); |
void FreeItem( int Item ); |
void Insert( int Item ); |
void SetLimit( int ALimit ); |
}; |
:int TCollection::At( int Index ) |
{ |
return DSDWORD[ Index*sizeof(int)+Items ]; |
} |
:void TCollection::AtDelete( int Index ) |
{ |
// if(Index<0)||(Index>=Count){/*Error(coIndexError);*/return;} |
ECX = Count-Index-1; |
EDI = Index*sizeof(int)+Items; ESI = EDI+4; $cld; $rep;$movsd; |
Count --; |
} |
:void TCollection::AtFree( int Index ) |
{ |
int Item = At( Index); |
AtDelete( Index ); |
FreeItem( Item ); |
} |
:void TCollection::AtInsert( int Index, Item ) |
{ |
$pushfd |
IF( Count == Limit ) |
{ |
SetLimit( Count+Delta ); |
} |
ECX = Count-Index; |
EDI = Count*sizeof(int)+Items; |
ESI = EDI-4; $std $rep $movsd $cld |
DSDWORD[ EDI ] = Item; |
Count ++; |
$popfd |
} |
:void TCollection::DeleteAll() |
{ |
Count=0; |
} |
:void TCollection::Free( int Item ) |
{ |
Delete( Item ); |
FreeItem( Item ); |
} |
:void TCollection::FreeAll( void ) |
{ |
int I; |
FOR( I = 0; I < Count; I ++ )FreeItem( At(I) ); |
Count = 0; |
} |
:void TCollection::FreeItem( int Item ) |
{ |
IF( Item )free( Item );//+++Dispose(PObject(Item), Done); |
} |
:void TCollection::Insert( int Item ) |
{ |
AtInsert( Count, Item ); |
} |
:void TCollection::SetLimit( int ALimit ) |
{ |
int AItems; |
IF( ALimit < Count )ALimit = Count; |
IF( ALimit != Limit ) |
{ |
IF( !ALimit ) AItems = 0; |
ELSE |
{ |
AItems = malloc(ALimit*sizeof(int) ); |
IF( Count )&&( Items ) |
{ |
CopyMemory( AItems, Items, Limit*sizeof(int) ); |
} |
} |
IF( Limit )free( Items ); |
Items = AItems; |
Limit = ALimit; |
} |
} |
:TCollection::TCollection( int ALimit, ADelta ) |
{ |
Items = 0; |
Count = 0; |
Limit = 0; |
Delta = ADelta; |
SetLimit( ALimit ); |
return this; |
} |
:TCollection::~TCollection( void ) |
{ |
FreeAll(); |
SetLimit(0); |
} |
struct TSortedCollection:TCollection |
{ |
int comparemethod; |
int Duplicates; |
TSortedCollection( int ALimit, ADelta ); |
int Compare( int Key1, Key2 ); |
void Insert( int Item ); |
int Search( int Key, Index ); |
}; |
:int TSortedCollection::Compare( int Key1, Key2 ) |
{ |
strcmp( Key1, Key2 ); |
} |
:TSortedCollection::TSortedCollection( int ALimit, ADelta ) |
:TCollection( ALimit, ADelta ); |
{ |
comparemethod=#Compare; |
return this; |
} |
:void TSortedCollection::Insert( int Item ) |
{ |
int i; |
IF( !Search(/*KeyOf(*/Item/*)*/,#i) ) || ( Duplicates )AtInsert( i, Item ); |
} |
:int TSortedCollection::Search( int Key, Index ) |
{ |
int L, H, I, C; |
int S; |
S = 0; |
L = 0; |
H = Count-1; |
WHILE( L <= H ) |
{ |
I = L+H >> 1; |
ECX = I*sizeof(int)+Items; |
comparemethod( this, /*KeyOf(*/DSDWORD[ECX]/*)*/, Key ); |
C = EAX; |
IF( C < 0 ){ L = I+1; } |
ELSE |
{ |
H = I-1; |
IF( !C ){ |
S = 1; |
IF( !Duplicates )L = I; |
} |
} |
} |
DSDWORD[ Index ]=L; |
return S; |
} |
/programs/cmm/drvinst/drvinst.c |
---|
193,7 → 193,7 |
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; } |
/programs/cmm/eolite/include/about.h |
---|
34,7 → 34,7 |
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; |
/programs/cmm/eolite/include/progress_dialog.h |
---|
35,7 → 35,7 |
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); |
/programs/cmm/eolite/include/properties.h |
---|
345,7 → 345,7 |
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; |
/programs/cmm/eolite/include/settings.h |
---|
91,7 → 91,7 |
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(); |
} |
} |
/programs/cmm/examples/menu.c |
---|
59,7 → 59,7 |
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"); |
/programs/cmm/examples/rgb.c |
---|
45,7 → 45,7 |
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"); |
/programs/cmm/examples/window.c |
---|
29,7 → 29,7 |
{ |
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; i<io.dir.count; i++) |
{ |
/programs/cmm/experimental/easyshot/easyshot.c |
---|
54,7 → 54,7 |
case evReDraw: |
sc.get(); |
DefineAndDrawWindow(b_screen_width/4, b_screen_height/4, s_screen_width + 9, s_screen_height + GetSkinHeight() + 45,0x74, 0, "EasyShot v0.2",0); |
DefineAndDrawWindow(b_screen_width/4, b_screen_height/4, s_screen_width + 9, s_screen_height + skin_height + 45,0x74, 0, "EasyShot v0.2",0); |
GetProcessInfo(#Form, SelfInfo); |
if (Form.status_window>2) break; |
DrawBar(0, 0, Form.cwidth, 41, sc.work); |
/programs/cmm/kf_font_viewer/font_viewer.c |
---|
33,7 → 33,7 |
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: |
/programs/cmm/lib/kolibri.h |
---|
331,7 → 331,7 |
//------------------------------------------------------------------------------ |
: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; |
338,11 → 338,11 |
$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 |
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; |
/programs/cmm/liza/liza.c |
---|
117,7 → 117,7 |
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 |
/programs/cmm/panels_cfg/panels_cfg.c |
---|
143,7 → 143,7 |
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; |
/programs/cmm/process/process.c |
---|
99,7 → 99,7 |
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; } |
/programs/cmm/software_widget/software_widget.c |
---|
92,7 → 92,7 |
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(); |
/programs/cmm/template/template.c |
---|
32,6 → 32,6 |
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); |
} |
/programs/cmm/textreader/textreader.c |
---|
259,7 → 259,7 |
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; |