Rev 6392 | Rev 6457 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
6392 | punk_joker | 1 | #ifndef KOLIBRI_OPENDIALOG_H |
2 | #define KOLIBRI_OPENDIALOG_H |
||
3 | |||
4 | char sz_com_area_name[] = "FFFFFFFF_open_dialog"; |
||
5 | char sz_dir_default_path[] = "/rd/1"; |
||
6 | char sz_start_path[] = "/rd/1/File managers/opendial"; |
||
7 | |||
8 | struct open_dialog { |
||
9 | unsigned int mode; |
||
10 | unsigned int procinfo; |
||
11 | unsigned int com_area_name; |
||
12 | unsigned int com_area; |
||
13 | unsigned int opendir_path; |
||
14 | unsigned int dir_default_path; |
||
15 | unsigned int start_path; |
||
16 | unsigned int draw_window; |
||
17 | unsigned int status; |
||
18 | unsigned int openfile_path; |
||
19 | unsigned int filename_area; |
||
20 | unsigned int filter_area; |
||
21 | unsigned short x_size; |
||
22 | unsigned short x_start; |
||
23 | unsigned short y_size; |
||
24 | unsigned short y_start; |
||
25 | }; |
||
26 | |||
27 | struct od_filter { |
||
28 | unsigned int size; |
||
29 | unsigned char end; |
||
30 | }; |
||
31 | |||
32 | void fake_on_redraw(void) {} |
||
33 | |||
34 | struct open_dialog* kolibri_new_open_dialog(unsigned int mode, unsigned short tlx, unsigned short tly, unsigned short x_size, unsigned short y_size) |
||
35 | { |
||
36 | struct open_dialog *new_opendialog = (struct open_dialog *)malloc(sizeof(struct open_dialog)); |
||
37 | struct od_filter *new_od_filter = (struct od_filter *)malloc(sizeof(struct od_filter)); |
||
38 | char *plugin_path = (char *)calloc(4096, sizeof(char)); |
||
39 | char *openfile_path = (char *)calloc(4096, sizeof(char)); |
||
40 | char *proc_info = (char *)calloc(1024, sizeof(char)); |
||
41 | char *filename_area = (char *)calloc(256, sizeof(char)); |
||
42 | |||
43 | new_od_filter -> size = 0; |
||
44 | new_od_filter -> end = 0; |
||
45 | |||
46 | new_opendialog -> mode = mode; |
||
47 | new_opendialog -> procinfo = proc_info; |
||
48 | new_opendialog -> com_area_name = &sz_com_area_name; |
||
49 | new_opendialog -> com_area = 0; |
||
50 | new_opendialog -> opendir_path = plugin_path; |
||
51 | new_opendialog -> dir_default_path = &sz_dir_default_path; |
||
52 | new_opendialog -> start_path = &sz_start_path; |
||
53 | new_opendialog -> draw_window = &fake_on_redraw; |
||
54 | new_opendialog -> status = 0; |
||
55 | new_opendialog -> openfile_path = openfile_path; |
||
56 | new_opendialog -> filename_area = filename_area; |
||
57 | new_opendialog -> filter_area = new_od_filter; |
||
58 | new_opendialog -> x_size = x_size; |
||
59 | new_opendialog -> x_start = tlx; |
||
60 | new_opendialog -> y_size = y_size; |
||
61 | new_opendialog -> y_start = tly; |
||
62 | return new_opendialog; |
||
63 | } |
||
64 | |||
65 | extern void (*OpenDialog_init)(struct open_dialog *) __attribute__((__stdcall__)); |
||
66 | extern void (*OpenDialog_start)(struct open_dialog *) __attribute__((__stdcall__)); |
||
67 | #endif /* KOLIBRI_OPENDIALOG_H */ |