Rev 6457 | Rev 6589 | 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"; |
||
6524 | siemargl | 6 | char sz_start_path[] = "/rd/1/File managers/opendial"; |
7 | |||
8 | enum open_dialog_mode { |
||
9 | OPEN, |
||
10 | SAVE, |
||
11 | SELECT |
||
12 | }; |
||
6392 | punk_joker | 13 | |
6457 | punk_joker | 14 | typedef struct { |
6524 | siemargl | 15 | unsigned int size; |
16 | unsigned char end; |
||
17 | }od_filter; |
||
18 | |||
19 | typedef struct { |
||
6392 | punk_joker | 20 | unsigned int mode; |
6524 | siemargl | 21 | char* procinfo; |
22 | char* com_area_name; |
||
6392 | punk_joker | 23 | unsigned int com_area; |
6524 | siemargl | 24 | char* opendir_path; |
25 | char* dir_default_path; |
||
26 | char* start_path; |
||
27 | void (*draw_window)(); |
||
6392 | punk_joker | 28 | unsigned int status; |
6524 | siemargl | 29 | char* openfile_path; |
30 | char* filename_area; |
||
31 | od_filter* filter_area; |
||
6392 | punk_joker | 32 | unsigned short x_size; |
33 | unsigned short x_start; |
||
34 | unsigned short y_size; |
||
35 | unsigned short y_start; |
||
6457 | punk_joker | 36 | }open_dialog; |
6392 | punk_joker | 37 | |
38 | void fake_on_redraw(void) {} |
||
39 | |||
6524 | siemargl | 40 | open_dialog* kolibri_new_open_dialog(unsigned int mode, unsigned short tlx, unsigned short tly, unsigned short x_size, unsigned short y_size) |
6392 | punk_joker | 41 | { |
6457 | punk_joker | 42 | open_dialog *new_opendialog = (open_dialog *)malloc(sizeof(open_dialog)); |
43 | od_filter *new_od_filter = (od_filter *)malloc(sizeof(od_filter)); |
||
6392 | punk_joker | 44 | char *plugin_path = (char *)calloc(4096, sizeof(char)); |
45 | char *openfile_path = (char *)calloc(4096, sizeof(char)); |
||
46 | char *proc_info = (char *)calloc(1024, sizeof(char)); |
||
47 | char *filename_area = (char *)calloc(256, sizeof(char)); |
||
6524 | siemargl | 48 | |
6392 | punk_joker | 49 | new_od_filter -> size = 0; |
50 | new_od_filter -> end = 0; |
||
6524 | siemargl | 51 | |
6392 | punk_joker | 52 | new_opendialog -> mode = mode; |
53 | new_opendialog -> procinfo = proc_info; |
||
6524 | siemargl | 54 | new_opendialog -> com_area_name = sz_com_area_name; |
6392 | punk_joker | 55 | new_opendialog -> com_area = 0; |
56 | new_opendialog -> opendir_path = plugin_path; |
||
6524 | siemargl | 57 | new_opendialog -> dir_default_path = sz_dir_default_path; |
58 | new_opendialog -> start_path = sz_start_path; |
||
6392 | punk_joker | 59 | new_opendialog -> draw_window = &fake_on_redraw; |
60 | new_opendialog -> status = 0; |
||
61 | new_opendialog -> openfile_path = openfile_path; |
||
62 | new_opendialog -> filename_area = filename_area; |
||
63 | new_opendialog -> filter_area = new_od_filter; |
||
64 | new_opendialog -> x_size = x_size; |
||
65 | new_opendialog -> x_start = tlx; |
||
66 | new_opendialog -> y_size = y_size; |
||
67 | new_opendialog -> y_start = tly; |
||
68 | return new_opendialog; |
||
69 | } |
||
70 | |||
6524 | siemargl | 71 | extern void kolibri_proclib_init(); |
6457 | punk_joker | 72 | extern void (*OpenDialog_init)(open_dialog *) __attribute__((__stdcall__)); |
73 | extern void (*OpenDialog_start)(open_dialog *) __attribute__((__stdcall__)); |
||
6392 | punk_joker | 74 | #endif /* KOLIBRI_OPENDIALOG_H */ |