Rev 6482 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
6470 | siemargl | 1 | #ifndef KOLIBRI_SCROLLBAR_H |
2 | #define KOLIBRI_SCROLLBAR_H |
||
3 | |||
4 | typedef struct { |
||
5 | // uint16_t xsize; |
||
6 | // uint16_t xpos; |
||
7 | // uint16_t ysize; |
||
8 | // uint16_t ypos; |
||
9 | uint32_t x_w; |
||
10 | uint32_t y_h; |
||
11 | uint32_t btn_height; |
||
12 | uint32_t type; |
||
13 | uint32_t max_area; |
||
14 | uint32_t cur_area; |
||
15 | uint32_t position; |
||
16 | uint32_t back_color; |
||
17 | uint32_t front_color; |
||
18 | uint32_t line_color; |
||
19 | uint32_t redraw; |
||
20 | uint16_t delta; |
||
21 | uint16_t delta2; |
||
22 | uint16_t r_size_x; |
||
23 | uint16_t r_start_x; |
||
24 | uint16_t r_size_y; |
||
25 | uint16_t r_start_y; |
||
26 | uint32_t m_pos; |
||
27 | uint32_t m_pos2; |
||
28 | uint32_t m_keys; |
||
29 | uint32_t run_size; |
||
30 | uint32_t position2; |
||
31 | uint32_t work_size; |
||
32 | uint32_t all_redraw; |
||
33 | uint32_t ar_offset; |
||
34 | } scrollbar; |
||
35 | |||
36 | scrollbar* kolibri_new_scrollbar(uint32_t x_w, uint32_t y_h, uint32_t btn_height, uint32_t max_area, |
||
37 | uint32_t cur_area, uint32_t position, uint32_t back_color, uint32_t front_color, uint32_t line_color) |
||
38 | { |
||
39 | scrollbar *sb = (scrollbar *)calloc(1, sizeof(scrollbar)); |
||
40 | |||
41 | sb->x_w = x_w; |
||
42 | sb->y_h = y_h; |
||
43 | sb->btn_height = btn_height; |
||
44 | sb->type = 1; |
||
45 | sb->max_area = max_area; |
||
46 | sb->cur_area = cur_area; |
||
47 | sb->position = position; |
||
48 | sb->line_color = 0; //line_color; // 0 |
||
49 | sb->back_color = 0xeeeeee; // back_color; // 0xeeeeee |
||
50 | sb->front_color = 0xbbddff; //front_color; // 0xbbddff |
||
51 | sb->ar_offset = max_area / 30; // temporary step 3% |
||
52 | sb->all_redraw = 1; |
||
53 | return sb; |
||
54 | }; |
||
55 | |||
56 | //use_optionbox_driver |
||
57 | |||
58 | extern void (*scrollbar_h_draw)(scrollbar*) __attribute__((__stdcall__)); |
||
59 | extern void (*scrollbar_h_mouse)(scrollbar*) __attribute__((__stdcall__)); |
||
60 | extern void (*scrollbar_v_draw)(scrollbar*) __attribute__((__stdcall__)); |
||
61 | extern void (*scrollbar_v_mouse)(scrollbar*) __attribute__((__stdcall__)); |
||
62 | |||
63 | #endif /* KOLIBRI_SCROLLBAR_H */ |