| version 1.7, 2005/12/09 12:38:35 |
version 1.8, 2005/12/10 21:24:54 |
| Line 26 Cc_Win *_cc_clipboardmenu=NULL; |
|
| Line 26 Cc_Win *_cc_clipboardmenu=NULL; |
|
| GSList *_cc_topwinlist=NULL; |
GSList *_cc_topwinlist=NULL; |
| long _cc_oldattr; |
long _cc_oldattr; |
| CMAP *_cc_cmap=NULL; |
CMAP *_cc_cmap=NULL; |
| |
long _cc_fobvx=DEF_FOB_VX,_cc_fobvy=DEF_FOB_VY; |
| char *_cc_bitmap[BITMAPY]={ // nejake to logo do pozadia |
char *_cc_bitmap[BITMAPY]={ // nejake to logo do pozadia |
| "...............................................................................", |
"...............................................................................", |
| ".........................................oo.oo.................................", |
".........................................oo.oo.................................", |
| Line 52 char *_cc_bitmap[BITMAPY]={ // nejake to |
|
| Line 53 char *_cc_bitmap[BITMAPY]={ // nejake to |
|
| ".......................oo.......ooo.....oo.....oo..........oo.....oo....oo.....", |
".......................oo.......ooo.....oo.....oo..........oo.....oo....oo.....", |
| "......................oooo......oooo...oooo..oooo..........oooo..oooo...ooo....", |
"......................oooo......oooo...oooo..oooo..........oooo..oooo...ooo....", |
| "...............................................................................", |
"...............................................................................", |
| }; |
}; |
| |
|
| |
void _cc_fobsetnameedit(Cc_Win *win) |
| |
{ |
| |
TUFOB *tufob=(TUFOB*)win->user; |
| |
long i,len=strlen(tufob->filename); |
| |
char *name=tufob->filename+len-1; |
| |
for(i=len-1;(i>0)&&(*name!='/');i--)name--; |
| |
if(*name=='/')name++; |
| |
cc_set_text(tufob->nameedit,name); |
| |
} |
| |
|
| |
static int __cc_fobfileselector(const struct dirent *entry) |
| |
{ |
| |
|
| |
|
| |
return 1; |
| |
} |
| |
|
| |
static int __cc_fobfilecmp(const void *f1,const void *f2) |
| |
{ |
| |
|
| |
|
| |
return 1; |
| |
} |
| |
|
| |
void _cc_fobsetfilelist(Cc_Win *win,char *mask) |
| |
{ |
| |
TUFOB *tufob=(TUFOB*)win->user; |
| |
char *dir=cc_get_text(tufob->diskcombo); |
| |
GList *flist=NULL,*gl; |
| |
LIST *list=&tufob->filelist->extra->list; |
| |
struct dirent **namelist; |
| |
|
| |
chdir(dir); |
| |
if(scandir(dir,&namelist,__cc_fobfileselector,__cc_fobfilecmp)!=-1) |
| |
{ |
| |
flist=g_list_prepend(flist,"file.ext"); |
| |
|
| |
|
| |
|
| |
gl=list->lines; |
| |
while(gl!=NULL) |
| |
{ |
| |
free(gl->data); |
| |
gl=g_list_next(gl); |
| |
} |
| |
if(list->lines!=NULL)g_list_free(list->lines); |
| |
cc_set_list(tufob->filelist,flist); |
| |
} |
| |
} |
| |
|
| |
void _cc_fobsetdiskcombo(Cc_Win *win) |
| |
{ |
| |
TUFOB *tufob=(TUFOB*)win->user; |
| |
long i,len=strlen(tufob->filename); |
| |
char *name=tufob->filename+len-1; |
| |
for(i=len-1;(i>0)&&(*name!='/');i--)name--; |
| |
if(*name=='/') |
| |
{ |
| |
char text[i+2]; |
| |
text[i+1]='\0'; |
| |
while(i>=0){text[i]=tufob->filename[i];i--;} |
| |
cc_set_text(tufob->diskcombo,text); |
| |
} |
| |
} |
| |
|
| |
void _cc_fobdiskbuttonproc(Cc_Win *win) |
| |
{ |
| |
TUFOB *tufob=(TUFOB*)win->parent->user; |
| |
cc_set_focus(tufob->diskcombo); |
| |
} |
| |
|
| |
void _cc_fobnamebuttonproc(Cc_Win *win) |
| |
{ |
| |
TUFOB *tufob=(TUFOB*)win->parent->user; |
| |
cc_set_focus(tufob->nameedit); |
| |
} |
| |
|
| |
void _cc_fobmaskbuttonproc(Cc_Win *win) |
| |
{ |
| |
TUFOB *tufob=(TUFOB*)win->parent->user; |
| |
cc_set_focus(tufob->maskcombo); |
| |
} |
| |
|
| |
void _cc_fobopenbuttonproc(Cc_Win *win) |
| |
{ |
| |
TUFOB *tufob=(TUFOB*)win->parent->user; |
| |
|
| |
|
| |
|
| |
|
| |
|
| |
if(tufob->action!=NULL)tufob->action(win->parent,tufob->filename); |
| |
_cc_fobcloseproc(win->parent); |
| |
} |
| |
|
| |
void _cc_fobcancelbuttonproc(Cc_Win *win) |
| |
{ |
| |
_cc_fobcloseproc(win->parent); |
| |
} |
| |
|
| |
void _cc_fobsizeokproc(Cc_Win *win,long *x,long *y,long *vx,long *vy) |
| |
{ |
| |
if(*vx<MIN_FOB_VX)*vx=MIN_FOB_VX; |
| |
if(*vy<MIN_FOB_VY)*vy=MIN_FOB_VY; |
| |
} |
| |
|
| |
bool _cc_fobdialogacelproc(Cc_Win *win,long x,long y,unsigned short key) |
| |
{ |
| |
if(key==CC_KEY_ESC) |
| |
{ |
| |
_cc_fobcloseproc(win); |
| |
return true; |
| |
} |
| |
else if(key==CC_KEY_ENTER)key='o'; |
| |
return cc_send_message(win,x,y,key); |
| |
} |
| |
|
| |
void _cc_fobcloseproc(Cc_Win *sender) |
| |
{ |
| |
TUFOB *tufob=(TUFOB*)sender->user; |
| |
_cc_fobvx=sender->vx; |
| |
_cc_fobvy=sender->vy; |
| |
GList *disklines=tufob->diskcombo->extra->combo.list->extra->list.lines, |
| |
*masklines=tufob->maskcombo->extra->combo.list->extra->list.lines; |
| |
if(disklines!=NULL)g_list_free(disklines); |
| |
if(masklines!=NULL) |
| |
{ |
| |
GList *ls=masklines; |
| |
while(ls!=NULL) |
| |
{ |
| |
free(ls->data); |
| |
ls=g_list_next(ls); |
| |
} |
| |
g_list_free(masklines); |
| |
} |
| |
if(tufob->mmlines!=NULL) |
| |
{ |
| |
GList *ls=tufob->mmlines; |
| |
while(ls!=NULL) |
| |
{ |
| |
free(ls->data); |
| |
ls=g_list_next(ls); |
| |
} |
| |
g_list_free(tufob->mmlines); |
| |
} |
| |
free(tufob); |
| |
cc_delete_win(sender); |
| |
} |
| |
|
| void _cc_fobdiskcombochangeproc(Cc_Win *win) |
void _cc_fobdiskcombochangeproc(Cc_Win *win) |
| { |
{ |
| Line 72 void _cc_fobfilelistdblclkproc(Cc_Win *w |
|
| Line 221 void _cc_fobfilelistdblclkproc(Cc_Win *w |
|
| bool _cc_fobfilelistacelproc(Cc_Win *win,long x,long y,unsigned short key) |
bool _cc_fobfilelistacelproc(Cc_Win *win,long x,long y,unsigned short key) |
| { |
{ |
| |
|
| |
|
| |
|
| return cc_send_message(win,x,y,key); |
return cc_send_message(win,x,y,key); |
| } |
} |
| |
|
| Line 101 bool _cc_cbpaintacelproc(Cc_Win *win,lon |
|
| Line 252 bool _cc_cbpaintacelproc(Cc_Win *win,lon |
|
| |
|
| bool _cc_cbdialogacelproc(Cc_Win *win,long x,long y,unsigned short key) |
bool _cc_cbdialogacelproc(Cc_Win *win,long x,long y,unsigned short key) |
| { |
{ |
| if(key==CC_KEY_ESC)((TUCB*)(win->user))->i=-1; |
if(key==CC_KEY_ESC) |
| |
{ |
| |
free(win->user); |
| |
cc_delete_win(win); |
| |
return true; |
| |
} |
| return cc_send_message(win,x,y,key); |
return cc_send_message(win,x,y,key); |
| } |
} |
| |
|
| void _cc_cbcloseproc(Cc_Win *sender) |
void _cc_cbcloseproc(Cc_Win *sender) |
| { |
{ |
| ((TUCB*)(sender->user))->i=-1; |
free(sender->user); |
| |
cc_delete_win(sender); |
| } |
} |
| |
|
| void _cc_cbpushproc(Cc_Win *sender) |
void _cc_cbpushproc(Cc_Win *sender) |
| { |
{ |
| ((TUCB*)(sender->parent->user))->i=(long)sender->user; |
if((bool)sender->user) |
| |
{ |
| |
TUCB *tucb=(TUCB*)sender->parent->user; |
| |
if(tucb->action!=NULL) |
| |
tucb->action(sender->parent,tucb->combo->extra->combo.activeline); |
| |
} |
| |
free(sender->parent->user); |
| |
cc_delete_win(sender->parent); |
| } |
} |
| |
|
| bool _cc_mbdialogacelproc(Cc_Win *win,long x,long y,unsigned short key) |
bool _cc_mbdialogacelproc(Cc_Win *win,long x,long y,unsigned short key) |
| Line 120 bool _cc_mbdialogacelproc(Cc_Win *win,lo |
|
| Line 284 bool _cc_mbdialogacelproc(Cc_Win *win,lo |
|
| if(key==CC_KEY_ESC) |
if(key==CC_KEY_ESC) |
| { |
{ |
| TUMB *tumb=(TUMB*)win->user; |
TUMB *tumb=(TUMB*)win->user; |
| tumb->action(win,CC_MB_CANCEL); |
if(tumb->action!=NULL)tumb->action(win,CC_MB_CANCEL); |
| free(tumb->st); |
free(tumb->st); |
| free(tumb); |
free(tumb); |
| cc_delete_win(win); |
cc_delete_win(win); |
| Line 132 bool _cc_mbdialogacelproc(Cc_Win *win,lo |
|
| Line 296 bool _cc_mbdialogacelproc(Cc_Win *win,lo |
|
| void _cc_mbcloseproc(Cc_Win *sender) |
void _cc_mbcloseproc(Cc_Win *sender) |
| { |
{ |
| TUMB *tumb=(TUMB*)sender->user; |
TUMB *tumb=(TUMB*)sender->user; |
| tumb->action(sender,CC_MB_CANCEL); |
if(tumb->action!=NULL)tumb->action(sender,CC_MB_CANCEL); |
| free(tumb->st); |
free(tumb->st); |
| free(tumb); |
free(tumb); |
| cc_delete_win(sender); |
cc_delete_win(sender); |
| Line 141 void _cc_mbcloseproc(Cc_Win *sender) |
|
| Line 305 void _cc_mbcloseproc(Cc_Win *sender) |
|
| void _cc_mbpushproc(Cc_Win *sender) |
void _cc_mbpushproc(Cc_Win *sender) |
| { |
{ |
| TUMB *tumb=(TUMB*)sender->parent->user; |
TUMB *tumb=(TUMB*)sender->parent->user; |
| tumb->action(sender->parent,(long)sender->user); |
if(tumb->action!=NULL)tumb->action(sender->parent,(long)sender->user); |
| free(tumb->st); |
free(tumb->st); |
| free(tumb); |
free(tumb); |
| cc_delete_win(sender->parent); |
cc_delete_win(sender->parent); |
| Line 979 void _cc_redrawclientwin(Cc_Win *win) |
|
| Line 1143 void _cc_redrawclientwin(Cc_Win *win) |
|
| data++; |
data++; |
| } |
} |
| } |
} |
| |
refresh(); |
| _cc_doneredraw(); |
_cc_doneredraw(); |
| } |
} |
| |
|
| int _cc_redraw() |
int _cc_redraw() |
| { |
{ |
| Cc_Win *win; |
Cc_Win *win; |
| long x,y,px,py,a1,a2; |
long x,y,px,py,a1,a2; |
| short c1,c2; |
short c1,c2; |
| GSList *sl; |
GSList *sl; |
| |
curs_set(0); |
| |
move(0,0); |
| if(_cc_hlvisible) |
if(_cc_hlvisible) |
| { |
{ |
| c1=CC_C_BLUE;c1<<=3;c1+=CC_C_WHITE; |
c1=CC_C_BLUE;c1<<=3;c1+=CC_C_WHITE; |
| Line 1031 int _cc_redraw() |
|
| Line 1198 int _cc_redraw() |
|
| _cc_fillback(&_cc_mainwin,a1); |
_cc_fillback(&_cc_mainwin,a1); |
| } |
} |
| _cc_mrefresh(&_cc_mainwin); |
_cc_mrefresh(&_cc_mainwin); |
| _cc_doneredraw(); |
|
| refresh(); |
refresh(); |
| |
_cc_doneredraw(); |
| return OK; |
return OK; |
| } |
} |
| |
|