2016-04-11 18:14:42 +02:00
|
|
|
#ifndef KOLIBRI_OPENDIALOG_H
|
|
|
|
#define KOLIBRI_OPENDIALOG_H
|
|
|
|
|
|
|
|
char sz_com_area_name[] = "FFFFFFFF_open_dialog";
|
|
|
|
char sz_dir_default_path[] = "/rd/1";
|
2016-09-19 13:17:21 +02:00
|
|
|
char sz_start_path[] = "/rd/1/File managers/opendial";
|
|
|
|
|
|
|
|
enum open_dialog_mode {
|
|
|
|
OPEN,
|
|
|
|
SAVE,
|
|
|
|
SELECT
|
|
|
|
};
|
2016-04-11 18:14:42 +02:00
|
|
|
|
2016-09-19 13:17:21 +02:00
|
|
|
typedef struct {
|
|
|
|
unsigned int size;
|
|
|
|
unsigned char end;
|
|
|
|
}od_filter;
|
|
|
|
|
2016-06-30 18:10:04 +02:00
|
|
|
typedef struct {
|
2016-04-11 18:14:42 +02:00
|
|
|
unsigned int mode;
|
2016-09-19 13:17:21 +02:00
|
|
|
char* procinfo;
|
|
|
|
char* com_area_name;
|
2016-04-11 18:14:42 +02:00
|
|
|
unsigned int com_area;
|
2016-09-19 13:17:21 +02:00
|
|
|
char* opendir_path;
|
|
|
|
char* dir_default_path;
|
|
|
|
char* start_path;
|
|
|
|
void (*draw_window)();
|
2016-04-11 18:14:42 +02:00
|
|
|
unsigned int status;
|
2016-09-19 13:17:21 +02:00
|
|
|
char* openfile_path;
|
|
|
|
char* filename_area;
|
|
|
|
od_filter* filter_area;
|
2016-04-11 18:14:42 +02:00
|
|
|
unsigned short x_size;
|
|
|
|
unsigned short x_start;
|
|
|
|
unsigned short y_size;
|
|
|
|
unsigned short y_start;
|
2016-06-30 18:10:04 +02:00
|
|
|
}open_dialog;
|
2016-04-11 18:14:42 +02:00
|
|
|
|
|
|
|
void fake_on_redraw(void) {}
|
|
|
|
|
2016-09-19 13:17:21 +02:00
|
|
|
open_dialog* kolibri_new_open_dialog(unsigned int mode, unsigned short tlx, unsigned short tly, unsigned short x_size, unsigned short y_size)
|
2016-04-11 18:14:42 +02:00
|
|
|
{
|
2016-06-30 18:10:04 +02:00
|
|
|
open_dialog *new_opendialog = (open_dialog *)malloc(sizeof(open_dialog));
|
|
|
|
od_filter *new_od_filter = (od_filter *)malloc(sizeof(od_filter));
|
2016-04-11 18:14:42 +02:00
|
|
|
char *plugin_path = (char *)calloc(4096, sizeof(char));
|
|
|
|
char *openfile_path = (char *)calloc(4096, sizeof(char));
|
|
|
|
char *proc_info = (char *)calloc(1024, sizeof(char));
|
|
|
|
char *filename_area = (char *)calloc(256, sizeof(char));
|
2016-09-19 13:17:21 +02:00
|
|
|
|
2016-04-11 18:14:42 +02:00
|
|
|
new_od_filter -> size = 0;
|
|
|
|
new_od_filter -> end = 0;
|
2016-09-19 13:17:21 +02:00
|
|
|
|
2016-04-11 18:14:42 +02:00
|
|
|
new_opendialog -> mode = mode;
|
|
|
|
new_opendialog -> procinfo = proc_info;
|
2016-09-19 13:17:21 +02:00
|
|
|
new_opendialog -> com_area_name = sz_com_area_name;
|
2016-04-11 18:14:42 +02:00
|
|
|
new_opendialog -> com_area = 0;
|
|
|
|
new_opendialog -> opendir_path = plugin_path;
|
2016-09-19 13:17:21 +02:00
|
|
|
new_opendialog -> dir_default_path = sz_dir_default_path;
|
|
|
|
new_opendialog -> start_path = sz_start_path;
|
2016-04-11 18:14:42 +02:00
|
|
|
new_opendialog -> draw_window = &fake_on_redraw;
|
|
|
|
new_opendialog -> status = 0;
|
|
|
|
new_opendialog -> openfile_path = openfile_path;
|
|
|
|
new_opendialog -> filename_area = filename_area;
|
|
|
|
new_opendialog -> filter_area = new_od_filter;
|
|
|
|
new_opendialog -> x_size = x_size;
|
|
|
|
new_opendialog -> x_start = tlx;
|
|
|
|
new_opendialog -> y_size = y_size;
|
|
|
|
new_opendialog -> y_start = tly;
|
|
|
|
return new_opendialog;
|
|
|
|
}
|
|
|
|
|
2016-09-19 13:17:21 +02:00
|
|
|
extern void kolibri_proclib_init();
|
2016-06-30 18:10:04 +02:00
|
|
|
extern void (*OpenDialog_init)(open_dialog *) __attribute__((__stdcall__));
|
|
|
|
extern void (*OpenDialog_start)(open_dialog *) __attribute__((__stdcall__));
|
2016-04-11 18:14:42 +02:00
|
|
|
#endif /* KOLIBRI_OPENDIALOG_H */
|