forked from KolibriOS/kolibrios
59d92b4ec3
git-svn-id: svn://kolibrios.org@6589 a494cfbc-eb01-0410-851d-a64ba20cac60
107 lines
4.0 KiB
C
107 lines
4.0 KiB
C
#ifndef KOLIBRI_TREELIST_H
|
|
#define KOLIBRI_TREELIST_H
|
|
|
|
/*
|
|
el_focus dd tedit0
|
|
mouse_dd dd 0
|
|
tree1 tree_list 264,count_of_dir_list_files+2, tl_key_no_edit+tl_draw_par_line+tl_list_box_mode,\
|
|
16,16, 0x8080ff,0x0000ff,0xffffff, 0,70,TED_PANEL_WIDTH-17,120, 0,0,0, el_focus,\
|
|
ws_dir_lbox,0
|
|
|
|
tree3 tree_list MAX_COLOR_WORD_LEN,3,tl_key_no_edit,\
|
|
16,16, 0x8080ff,0x0000ff,0xffffff, 5,30,300,160, 16, 0,0, el_focus, w_scr_t3,0
|
|
|
|
tree_file_struct:
|
|
dd 1
|
|
dd 0,0,count_of_dir_list_files
|
|
dd dir_mem
|
|
db 0
|
|
dd file_name ;sys_path
|
|
*/
|
|
/*
|
|
;struct TreeList
|
|
; type dw ? ;+ 0 òèï ýëåìåíòà, èëè èíäåêñ èêîíêè äëÿ óçëà
|
|
; lev db ? ;+ 2 óðîâåíü ýëåìåíòà
|
|
; clo db ? ;+ 3 ôëàã çàêðûòèÿ, èëè îòêðûòèÿ (èìååò ñìûñë äëÿ ðîäèòåëüñêîãî óçëà)
|
|
; perv dd ? ;+ 4 èíäåêñ ïðåäûäóùåãî ýëåìåíòà
|
|
; next dd ? ;+ 8 èíäåêñ ïîñëåäóþùåãî ýëåìåíòà
|
|
; tc dd ? ;+12 âðåì. ñîçäàíèÿ
|
|
; td dd ? ;+16 âðåì. óäàëåíèÿ
|
|
;ends
|
|
|
|
struc tree_list info_size,info_max_count,style, img_cx,img_cy,\
|
|
col_bkg,col_zag,col_txt, box_l,box_t,box_w,box_h, capt_cy,info_capt_offs,\
|
|
info_capt_len,el_focus, p_scroll,on_press {
|
|
.box_left dd box_l
|
|
.box_top dd box_t
|
|
.box_width dd box_w
|
|
.box_height dd box_h
|
|
.data_info dd 0
|
|
.info_size dw info_size
|
|
.info_max_count dd info_max_count
|
|
.style dd style
|
|
.data_nodes dd 0
|
|
.data_img dd 0
|
|
.img_cx dw img_cx
|
|
.img_cy dw img_cy
|
|
.data_img_sys dd 0
|
|
.ch_tim dd 0
|
|
.tim_undo dd 0
|
|
.cur_pos dd 0
|
|
.col_bkg dd col_bkg
|
|
.col_zag dd col_zag
|
|
.col_txt dd col_txt
|
|
.capt_cy dw capt_cy
|
|
.info_capt_offs dw info_capt_offs
|
|
.info_capt_len dw info_capt_len
|
|
.el_focus dd el_focus
|
|
.p_scroll dd p_scroll
|
|
.on_press dd on_press
|
|
}
|
|
*/
|
|
// êîíñòàíòû ñòèëÿ
|
|
enum tl_style {
|
|
TL_KEY_NO_EDIT = 1, // ýëåìåíò íåëüçÿ ðåäàêòèðîâàòü íà êëàâèàòóðå (èçìåíÿòü óðîâíè, óäàëÿòü)
|
|
TL_DRAW_PAR_LINE = 2, // ðèñîâàòü ëèíèè ê ðîäèòåëüñêîìó óçëó
|
|
TL_LISTBOX_MODE = 4 //ñòèëü íå îòîáðàæàåò óðîâíè (êàê â ListBox âñå îäíîãî óðîâíÿ)
|
|
};
|
|
|
|
typedef struct __attribute__ ((__packed__)) {
|
|
uint32_t left;
|
|
uint32_t top;
|
|
uint32_t width;
|
|
uint32_t height;
|
|
void *data_info; // óêàçàòåëü íà îñíîâíûå äàíûå
|
|
uint16_t info_size; // ðàçìåð äàííûõ âûäåëÿåìûõ äëÿ êàæäîãî óçëà (ïîëüçîâàòåëüñüêèå äàííûå + òåêñò äëÿ ïîäïèñè)
|
|
uint32_t info_max_count; // ìàêñèìàëüíîå êîëè÷åñòâî óçëîâ, êîòîðûå ìîæíî äîáàâèòü â ýëåìåíò
|
|
uint32_t style; // ñòèëè ýëåìåíòà
|
|
void *data_nodes; // óêàçàòåëü íà ñòðóêòóðû óçëîâ
|
|
void *data_img; // óêàçàòåëü íà èçîáðàæåíèÿ ñ èêîíêàìè óçëîâ
|
|
uint16_t img_cx; // øèðèíà èêîíîê
|
|
uint16_t img_cy; // âûñîòà èêîíîê
|
|
void *data_img_sys;//óêàçàòåëü íà ñèñòåìíûå èçîáðàæåíèÿ (ñòðåëêè, ïëþñèêè)
|
|
uint32_t ch_tim; // êîëè÷åñòâî èçìåíåíèé â ôàéëå
|
|
uint32_t tim_undo; // êîëè÷åñòâî îòìåíåííûõ äåéñòâèé
|
|
uint32_t cur_pos; // ïîçèöèÿ êóðñîðà
|
|
color_t col_bkg; // öâåò ôîíà
|
|
color_t tl_col_zag; // öâåò çàãîëîâêà
|
|
color_t tl_col_txt; // öâåò òåêñòà
|
|
uint16_t capt_cy; // âûñîòà ïîäïèñè
|
|
uint16_t info_capt_offs;//ñäâèã äëÿ íà÷àëà òåêñòà (ïîäïèñè óçëà)
|
|
uint16_t info_capt_len;//äëèíà òåêñòà ïîäïèñè óçëà (åñëè = 0 òî äî êîíöà ñòðóêòóðû)
|
|
void *el_focus; // óêàçàòåëü íà ñòðóêòóðó ýëåìåíòà â ôîêóñå
|
|
void *p_scroll; // óêàçàòåëü íà ñòðóêòóðó ñêðîëëèíãà
|
|
void *on_press; // +84 óêàçàòåëü íà ôóíêöèþ, êîòîðàÿ âûçûâàåòñÿ ïðè íàæàòèè Enter
|
|
} treelist;
|
|
|
|
/*
|
|
;êîíñòàíòû äëÿ ôóíêöèé
|
|
tl_err_save_memory_size equ 10b ;íå õâàòàåò ïàìÿòè äëÿ ñîõðàíåíèÿ ýëåìåíòà
|
|
tl_err_load_caption equ 1b ;â ïàìÿòè íåò çàãîëîâêà 'tree'
|
|
tl_err_load_info_size equ 100b ;íå ñîâïàäàåò ðàçìåð èíôîðìàöèîííîé ñòðóêòóðû ïðè îòêðûòèè
|
|
tl_load_mode_add equ 0x20000 ;îïöèÿ ñ÷èòûâàíèÿ â ðåæèìå äîáàâëåíèÿ èíôîðìàöèè
|
|
tl_save_load_heder_size equ 26 ;ðàçìåð çàãîëîâêà äëÿ çàïèñè/÷òåíèÿ ýëåìåíòîâ
|
|
*/
|
|
|
|
#endif //KOLIBRI_TREELIST_H
|