Subversion Repositories Kolibri OS

Rev

Rev 9620 | Rev 9810 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9620 Rev 9766
Line 2... Line 2...
2
#define KOLIBRI_DIALOG_H
2
#define KOLIBRI_DIALOG_H
Line 3... Line 3...
3
 
3
 
Line 4... Line 4...
4
#include 
4
#include 
5
 
5
 
Line 6... Line 6...
6
#define NOT_SUCCESS 0
6
#define NOT_SUCCESS 0
7
#define SUCCESS 1
7
#define SUCCESS     1
8
 
8
 
Line 9... Line 9...
9
char sz_com_area_name[]    = "FFFFFFFF_open_dialog";
9
char sz_com_area_name[] = "FFFFFFFF_open_dialog";
10
char sz_dir_default_path[] = "/sys";
10
char sz_dir_default_path[] = "/sys";
Line 11... Line 11...
11
char sz_start_path[]       = "/sys/File managers/opendial";
11
char sz_start_path[] = "/sys/File managers/opendial";
12
 
12
 
13
char cd_com_area_name[]    = "FFFFFFFF_color_dialog";
13
char cd_com_area_name[] = "FFFFFFFF_color_dialog";
14
char cd_start_path[]       = "/sys/colrdial";
14
char cd_start_path[] = "/sys/colrdial";
15
 
15
 
Line 16... Line 16...
16
enum open_dialog_mode {
16
enum open_dialog_mode {
17
    OPEN,
17
    OPEN,
18
    SAVE,
18
    SAVE,
19
    SELECT
19
    SELECT
Line 20... Line 20...
20
};
20
};
21
 
21
 
22
typedef struct {
22
typedef struct {
23
	unsigned int size;
23
    unsigned int size;
Line 39... Line 39...
39
    od_filter* filter_area;
39
    od_filter* filter_area;
40
    unsigned short x_size;
40
    unsigned short x_size;
41
    unsigned short x_start;
41
    unsigned short x_start;
42
    unsigned short y_size;
42
    unsigned short y_size;
43
    unsigned short y_start;
43
    unsigned short y_start;
44
}open_dialog __attribute__ ((__packed__));
44
} open_dialog __attribute__((__packed__));
Line 45... Line -...
45
 
-
 
46
 
45
 
47
typedef struct{
46
typedef struct {
48
    unsigned int type;
47
    unsigned int type;
49
    char* procinfo;
48
    char* procinfo;
50
    char* com_area_name;
49
    char* com_area_name;
51
    unsigned int com_area;
50
    unsigned int com_area;
Line 56... Line 55...
56
    unsigned short x_start;
55
    unsigned short x_start;
57
    unsigned short y_size;
56
    unsigned short y_size;
58
    unsigned short y_start;
57
    unsigned short y_start;
59
    unsigned int color_type;
58
    unsigned int color_type;
60
    unsigned int color;
59
    unsigned int color;
61
}color_dialog __attribute__ ((__packed__));
60
} color_dialog __attribute__((__packed__));
Line 62... Line 61...
62
 
61
 
Line 63... Line 62...
63
void fake_on_redraw(void) {}
62
void fake_on_redraw(void) { }
64
 
63
 
65
open_dialog* kolibri_new_open_dialog(unsigned int mode, unsigned short tlx, unsigned short tly, unsigned short x_size, unsigned short y_size)
64
open_dialog* kolibri_new_open_dialog(unsigned int mode, unsigned short tlx, unsigned short tly, unsigned short x_size, unsigned short y_size)
66
{
65
{
67
    open_dialog *new_opendialog = (open_dialog *)malloc(sizeof(open_dialog));
66
    open_dialog* new_opendialog = (open_dialog*)malloc(sizeof(open_dialog));
68
    od_filter *new_od_filter = (od_filter *)malloc(sizeof(od_filter));
67
    od_filter* new_od_filter = (od_filter*)malloc(sizeof(od_filter));
69
    char *plugin_path = (char *)calloc(4096, sizeof(char));
68
    char* plugin_path = (char*)calloc(4096, sizeof(char));
70
	char *openfile_path = (char *)calloc(4096, sizeof(char));
69
    char* openfile_path = (char*)calloc(4096, sizeof(char));
71
	char *proc_info = (char *)calloc(1024, sizeof(char));
70
    char* proc_info = (char*)calloc(1024, sizeof(char));
72
	char *filename_area = (char *)calloc(256, sizeof(char));
71
    char* filename_area = (char*)calloc(256, sizeof(char));
73
 
72
 
74
	new_od_filter -> size = 0;
73
    new_od_filter->size = 0;
75
	new_od_filter -> end = 0;
74
    new_od_filter->end = 0;
76
 
75
 
77
	new_opendialog -> mode = mode;
76
    new_opendialog->mode = mode;
78
	new_opendialog -> procinfo = proc_info;
77
    new_opendialog->procinfo = proc_info;
79
	new_opendialog -> com_area_name = sz_com_area_name;
78
    new_opendialog->com_area_name = sz_com_area_name;
80
	new_opendialog -> com_area = 0;
79
    new_opendialog->com_area = 0;
81
	new_opendialog -> opendir_path = plugin_path;
80
    new_opendialog->opendir_path = plugin_path;
82
	new_opendialog -> dir_default_path = sz_dir_default_path;
81
    new_opendialog->dir_default_path = sz_dir_default_path;
83
	new_opendialog -> start_path = sz_start_path;
82
    new_opendialog->start_path = sz_start_path;
84
	new_opendialog -> draw_window = &fake_on_redraw;
83
    new_opendialog->draw_window = &fake_on_redraw;
85
	new_opendialog -> status = 0;
84
    new_opendialog->status = 0;
86
	new_opendialog -> openfile_path = openfile_path;
85
    new_opendialog->openfile_path = openfile_path;
87
	new_opendialog -> filename_area = filename_area;
86
    new_opendialog->filename_area = filename_area;
88
	new_opendialog -> filter_area = new_od_filter;
87
    new_opendialog->filter_area = new_od_filter;
89
	new_opendialog -> x_size = x_size;
88
    new_opendialog->x_size = x_size;
90
	new_opendialog -> x_start = tlx;
89
    new_opendialog->x_start = tlx;
91
	new_opendialog -> y_size = y_size;
90
    new_opendialog->y_size = y_size;
92
	new_opendialog -> y_start = tly;
91
    new_opendialog->y_start = tly;
Line 93... Line 92...
93
	return new_opendialog;
92
    return new_opendialog;
Line 94... Line 93...
94
}
93
}
95
 
94
 
96
void cd_fake_on_redraw(void) {}
95
void cd_fake_on_redraw(void) { }
97
 
96
 
Line 98... Line 97...
98
color_dialog* kolibri_new_color_dialog(unsigned int type, unsigned short tlx, unsigned short tly, unsigned short x_size, unsigned short y_size)
97
color_dialog* kolibri_new_color_dialog(unsigned int type, unsigned short tlx, unsigned short tly, unsigned short x_size, unsigned short y_size)
99
{
98
{
100
    color_dialog *new_colordialog = (color_dialog *)malloc(sizeof(color_dialog));
99
    color_dialog* new_colordialog = (color_dialog*)malloc(sizeof(color_dialog));
101
    char *proc_info = (char *)calloc(1024, sizeof(char));
100
    char* proc_info = (char*)calloc(1024, sizeof(char));
102
 
101
 
103
	new_colordialog -> type = type;
102
    new_colordialog->type = type;
104
	new_colordialog -> procinfo = proc_info;
103
    new_colordialog->procinfo = proc_info;
105
	new_colordialog -> com_area_name = cd_com_area_name;
104
    new_colordialog->com_area_name = cd_com_area_name;
106
	new_colordialog -> com_area = 0;
105
    new_colordialog->com_area = 0;
107
	new_colordialog -> start_path = cd_start_path;
106
    new_colordialog->start_path = cd_start_path;
108
	new_colordialog -> draw_window = &cd_fake_on_redraw;
107
    new_colordialog->draw_window = &cd_fake_on_redraw;
109
	new_colordialog -> status = 0;
108
    new_colordialog->status = 0;
110
	new_colordialog -> x_size = x_size;
109
    new_colordialog->x_size = x_size;
111
	new_colordialog -> x_start = tlx;
110
    new_colordialog->x_start = tlx;
112
	new_colordialog -> y_size = y_size;
111
    new_colordialog->y_size = y_size;
Line 113... Line 112...
113
	new_colordialog -> y_start = tly;
112
    new_colordialog->y_start = tly;
Line 114... Line 113...
114
	new_colordialog -> color_type = 0;
113
    new_colordialog->color_type = 0;
115
	new_colordialog -> color = 0;
114
    new_colordialog->color = 0;
Line 116... Line 115...
116
	return new_colordialog;
115
    return new_colordialog;
117
}
116
}
Line 118... Line 117...
118
 
117