Subversion Repositories Kolibri OS

Rev

Rev 6456 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6456 Rev 6470
1
#ifndef KOLIBRI_PROGRESSBAR_H
1
#ifndef KOLIBRI_PROGRESSBAR_H
2
#define KOLIBRI_PROGRESSBAR_H
2
#define KOLIBRI_PROGRESSBAR_H
3
 
3
 
4
struct progress_bar {
4
typedef struct {
5
	unsigned int value; 
5
	unsigned int value;
6
    unsigned int left;
6
    unsigned int left;
7
    unsigned int top; 
7
    unsigned int top;
8
    unsigned int width; 
8
    unsigned int width;
9
    unsigned int height; 
9
    unsigned int height;
10
    unsigned int style; 
10
    unsigned int style;
11
    unsigned int min;
11
    unsigned int min;
12
    unsigned int max;
12
    unsigned int max;
13
    unsigned int back_color;
13
    unsigned int back_color;
14
    unsigned int progress_color;
14
    unsigned int progress_color;
15
    unsigned int frame_color;
15
    unsigned int frame_color;
16
};
16
} progressbar;
17
 
17
 
18
struct progress_bar* kolibri_new_progress_bar(unsigned int min_value, unsigned int max_value, unsigned int cur_value, unsigned int tlx, unsigned int tly, unsigned int sizex, unsigned int sizey)
18
progressbar* kolibri_new_progressbar(unsigned int min_value, unsigned int max_value, unsigned int cur_value, unsigned int tlx, unsigned int tly, unsigned int sizex, unsigned int sizey)
19
{
19
{
20
    struct progress_bar *new_progressbar = (struct progress_bar *)malloc(sizeof(struct progress_bar));
20
    progressbar *new_progressbar = (progressbar*)malloc(sizeof(progressbar));
21
    
21
 
22
    new_progressbar -> value = cur_value; 
22
    new_progressbar -> value = cur_value;
23
    new_progressbar -> left = tlx;
23
    new_progressbar -> left = tlx;
24
    new_progressbar -> top = tly; 
24
    new_progressbar -> top = tly;
25
    new_progressbar -> width = sizex; 
25
    new_progressbar -> width = sizex;
26
    new_progressbar -> height = sizey; 
26
    new_progressbar -> height = sizey;
27
    new_progressbar -> style = 1; 
27
    new_progressbar -> style = 1;
28
    new_progressbar -> min = min_value;
28
    new_progressbar -> min = min_value;
29
    new_progressbar -> max = max_value;
29
    new_progressbar -> max = max_value;
30
    new_progressbar -> back_color = 0xffffff;
30
    new_progressbar -> back_color = 0xffffff;   // white
31
    new_progressbar -> progress_color = 0x00ff00;
31
    new_progressbar -> progress_color = 0x00ff00; // green
32
    new_progressbar -> frame_color = 0x000000;
32
    new_progressbar -> frame_color = 0x000000; // black
33
    return new_progressbar;
33
    return new_progressbar;
34
}
34
}
35
 
35
 
36
extern void (*progressbar_draw)(struct progress_bar *) __attribute__((__stdcall__));
36
extern void (*progressbar_draw)(progressbar *) __attribute__((__stdcall__));
37
extern void (*progressbar_progress)(struct progress_bar *) __attribute__((__stdcall__));
37
extern void (*progressbar_progress)(progressbar *) __attribute__((__stdcall__));
38
 
38
 
39
#endif /* KOLIBRI_PROGRESSBAR_H */
39
#endif /* KOLIBRI_PROGRESSBAR_H */