Subversion Repositories Kolibri OS

Rev

Rev 6560 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6535 siemargl 1
#ifndef KOLIBRI_FILEBROWSE_H
2
#define KOLIBRI_FILEBROWSE_H
3
 
4
typedef struct {
5
	uint32_t type;
6
	uint32_t x_w;  // 10, 400
7
	uint32_t y_h; // 45, 550
8
	uint32_t icon_size_xy;  // x_y (16, 16)
9
	uint16_t line_size_x;
10
	uint16_t line_size_y;  // 18 or 17  - высота линии
11
	uint16_t type_size_x;
12
	uint16_t size_size_x;
13
	uint16_t date_size_x;
14
	uint16_t attributes_size_x;
15
	uint32_t icon_assoc_area;
16
	uint32_t icon_raw_area;   // z_icons.png
17
	uint32_t icon_resolution_raw;  // ...
18
	uint32_t palette_raw;      // ...
19
	uint32_t directory_path_area;
20
	uint32_t file_name_area;
21
	uint32_t select_flag;
22
	color_t background_color;  // 0xffffff
23
	color_t select_color; // 0xbbddff
24
    color_t select_text_color;
25
    color_t text_color;
26
    color_t reduct_text_color; // 0xff0000
27
    color_t marked_text_color;
28
    uint32_t max_panel_line;            // // moved to scrollbar->cur_area, - максимальное число строк в окне
29
	uint32_t select_panel_counter;  // 1 if focused
30
	uint32_t folder_block;   //  количество блоков данных входа каталога (БДВК) ????? format BDVK == bdfe,, // moved to scrollbar->max_area
31
	uint32_t start_draw_line;       // moved to scrollbar->position and back
32
	uint16_t start_draw_cursor_line;
33
    void* folder_data;      // ??? format 32 byte - header, +4 = number, +32 - bdvk[], size of rec(bdvk cp866) = 304byte
34
    uint32_t temp_counter;
35
    uint32_t file_name_length;
36
    uint32_t marked_file;
37
    uint32_t extension_size;
38
    uint32_t extension_start;
39
    void* type_table; //dd features_table ; +122   ? table format
40
    char* ini_file_start;   // icons.ini
41
    char* ini_file_end;     // start + filesize
42
    uint32_t draw_scroll_bar;  // 1 = need redraw sb after key()
43
    uint32_t font_size_xy;  // x_y	(6, 9)
44
    uint32_t mouse_keys;
45
    uint32_t mouse_keys_old;
46
    uint32_t mouse_pos;
47
    uint32_t mouse_keys_delta;
48
    uint32_t mouse_key_delay; // 50
49
    uint32_t mouse_keys_tick;
50
    uint16_t start_draw_cursor_line_2;
51
    uint32_t all_redraw;         // 1 - force draw, 2 - ????
52
    uint32_t selected_BDVK_adress;
53
    uint16_t key_action;   // fill before key(), 1..12, wiki
54
    uint16_t key_action_num; // fill before key()  fn2 >> 8
55
    char* name_temp_area 		dd name_temp_area ;+180
56
    uint32_t max_name_temp_size;
57
    uint32_t display_name_max_length;
58
    uint32_t draw_panel_selection_flag;
59
    uint32_t mouse_pos_old;
60
    uint32_t marked_counter;
61
    char* keymap_pointer 		dd keymap_area ;+204
62
 
63
 
64
} file_browser;
65
/*
66
features_table:
67
.type_table:
68
	db ' '
69
;---------------------------------------------------------------------
70
.size_table:
71
	db '1023b '
72
;---------------------------------------------------------------------
73
.date_table:
74
	db '00.00.00 00:00 '
75
;---------------------------------------------------------------------
76
.year_table:
77
	db '    '
78
 
79
name_temp_area:
80
	rb 256
81
 
82
keymap_area:
83
	rb 128
84
 
85
inline frame* kolibri_filebrowser(frame* f, uint32_t x_w, uint32_t y_h, color_t ext_col, color_t int_col, char *text, uint32_t text_position, color_t font_color, color_t font_bgcolor)
86
{
87
    f->type = 0;
88
    f->x_w = x_w;
89
    f->y_h = y_h;
90
    f->ext_col = ext_col;
91
    f->int_col = int_col;
92
    f->draw_text_flag = text != NULL;
93
    f->text_pointer = text;
94
    f->text_position = text_position;
95
    f->font_number = 0;  // 0 == font 6x9, 1==8x16
96
    f->font_size_y = 9;
97
    f->font_color = font_color | 0x80000000;
98
    f->font_bg_color = font_bgcolor;
99
 
100
    return f;
101
}
102
 
103
inline frame* kolibri_new_frame(uint32_t x_w, uint32_t y_h, color_t ext_col, color_t int_col, char *text, uint32_t text_position, color_t font_color, color_t font_bgcolor)
104
{
105
    frame *new_frame = (frame *)malloc(sizeof(frame));
106
    return kolibri_frame(new_frame, x_w, y_h, ext_col, int_col, text, text_position, font_color, font_bgcolor);
107
}
108
 
109
inline frame* kolibri_frame_def(frame* f, uint32_t x_w, uint32_t y_h, char *text)
110
{
111
    return kolibri_frame(f, x_w, y_h, 0x00FCFCFC, 0x00DCDCDC, text, TOP, kolibri_color_table.color_work_text, kolibri_color_table.color_work_area);
112
}
113
 
114
inline frame* kolibri_new_frame_def(uint32_t x_w, uint32_t y_h, char *text)
115
{
116
    return kolibri_new_frame(x_w, y_h, 0x00FCFCFC, 0x00DCDCDC, text, TOP, kolibri_color_table.color_work_text, kolibri_color_table.color_work_area);
117
}
118
 
119
inline void gui_add_frame(kolibri_window *wnd, frame* f)
120
{
121
    kolibri_window_add_element(wnd, KOLIBRI_FRAME, f);
122
}
123
 
124
FileBrowser_draw - рисование элемента
125
FileBrowser_mouse - эта функция должна вызываться при вводе информации с мыши
126
FileBrowser_key
127
 
128
extern void (*frame_draw)(frame *) __attribute__((__stdcall__));
129
/*
130
#endif /* KOLIBRI_FILEBROWSE_H */