Subversion Repositories Kolibri OS

Rev

Rev 6456 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6456 Rev 6470
Line 1... Line 1...
1
#ifndef KOLIBRI_PROGRESSBAR_H
1
#ifndef KOLIBRI_PROGRESSBAR_H
2
#define KOLIBRI_PROGRESSBAR_H
2
#define KOLIBRI_PROGRESSBAR_H
Line 3... Line 3...
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;
Line 11... Line 11...
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;
Line 17... Line 17...
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
{
Line 20... Line 20...
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
Line 33... Line 33...
33
    return new_progressbar;
33
    return new_progressbar;
34
}
34
}
Line 35... Line 35...
35
 
35