Rev 5404 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5404 | Rev 5405 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /* |
1 | /* |
2 | SOFTWARE CENTER v2.1 |
2 | SOFTWARE CENTER v2.15 |
3 | */ |
3 | */ |
Line 4... | Line 4... | ||
4 | 4 | ||
5 | #define MEMSIZE 0x3E80 |
5 | #define MEMSIZE 0x3E80 |
6 | #include "..\lib\kolibri.h" |
6 | #include "..\lib\kolibri.h" |
7 | #include "..\lib\strings.h" |
7 | #include "..\lib\strings.h" |
8 | #include "..\lib\mem.h" |
8 | #include "..\lib\mem.h" |
9 | #include "..\lib\file_system.h" |
9 | #include "..\lib\file_system.h" |
10 | #include "..\lib\dll.h" |
10 | #include "..\lib\dll.h" |
11 | #include "..\lib\figures.h" |
- | |
12 | 11 | #include "..\lib\figures.h" |
|
13 | #include "..\lib\lib.obj\libio_lib.h" |
12 | #include "..\lib\lib.obj\libio_lib.h" |
14 | #include "..\lib\lib.obj\libimg_lib.h" |
13 | #include "..\lib\lib.obj\libimg_lib.h" |
Line -... | Line 14... | ||
- | 14 | #include "..\lib\lib.obj\libini.h" |
|
15 | #include "..\lib\lib.obj\libini.h" |
15 | |
16 | 16 | ||
17 | system_colors sc; |
17 | system_colors sc; |
Line 18... | Line 18... | ||
18 | proc_info Form; |
18 | proc_info Form; |
- | 19 | mouse m; |
|
- | 20 | ||
- | 21 | int item_id_need_to_run=-1, |
|
- | 22 | current_item_id; |
|
Line -... | Line 23... | ||
- | 23 | ||
- | 24 | int window_width, |
|
- | 25 | window_height; |
|
19 | mouse m; |
26 | |
- | 27 | int col_max, |
|
20 | 28 | cell_w, |
|
- | 29 | cell_h, |
|
- | 30 | list_pos, |
|
Line 21... | Line 31... | ||
21 | int item_id_need_to_run=-1, current_item_id; |
31 | list_top, |
22 | 32 | row, |
|
23 | int col_max, cell_w, cell_h, list_pos, list_top; |
- | |
24 | int row, col; |
- | |
Line 25... | Line 33... | ||
25 | 33 | col, |
|
Line -... | Line 34... | ||
- | 34 | default_icon; |
|
26 | char window_title[128]; |
35 | |
27 | char settings_ini_path[256] = "/sys/settings/"; |
36 | char window_title[128], |
28 | int window_width; |
37 | settings_ini_path[256] = "/sys/settings/"; |
29 | int window_height; |
38 | |
Line 61... | Line 70... | ||
61 | window_height = EAX; |
70 | window_height = EAX; |
62 | ini_get_int stdcall (#settings_ini_path, "Config", "cell_w", 66); |
71 | ini_get_int stdcall (#settings_ini_path, "Config", "cell_w", 66); |
63 | cell_w = EAX; |
72 | cell_w = EAX; |
64 | ini_get_int stdcall (#settings_ini_path, "Config", "cell_h", 64); |
73 | ini_get_int stdcall (#settings_ini_path, "Config", "cell_h", 64); |
65 | cell_h = EAX; |
74 | cell_h = EAX; |
- | 75 | ini_get_int stdcall (#settings_ini_path, "Config", "default_icon", 0); |
|
- | 76 | default_icon = EAX; |
|
66 | } |
77 | } |
Line 67... | Line 78... | ||
67 | 78 | ||
68 | 79 | ||
Line 124... | Line 135... | ||
124 | } |
135 | } |
Line 125... | Line 136... | ||
125 | 136 | ||
126 | 137 | ||
127 | byte draw_icons_from_section(dword key_value, key_name, sec_name, f_name) |
138 | byte draw_icons_from_section(dword key_value, key_name, sec_name, f_name) |
128 | { |
139 | { |
- | 140 | int tmp, |
|
Line 129... | Line 141... | ||
129 | int tmp; |
141 | icon_id, |
130 | int icon_id; |
142 | icon_char_pos; |
131 | 143 | ||
132 | if (col==col_max) { |
144 | if (col==col_max) { |
133 | row++; |
145 | row++; |
134 | col=0; |
146 | col=0; |
135 | } |
147 | } |
- | 148 | if (col==0) DrawBar(0, row * cell_h + list_pos, Form.cwidth, cell_h, LIST_BACKGROUND_COLOR); |
|
136 | if (col==0) DrawBar(0, row * cell_h + list_pos, Form.cwidth, cell_h, LIST_BACKGROUND_COLOR); |
149 | DefineButton(col*cell_w+6,row*cell_h + list_pos,cell_w,cell_h-5,current_item_id + 100 + BT_HIDE,0); |
- | 150 | tmp = cell_w/2; |
|
137 | DefineButton(col*cell_w+6,row*cell_h + list_pos,cell_w,cell_h-5,current_item_id + 100 + BT_HIDE,0); |
151 | |
138 | tmp = cell_w/2; |
152 | icon_char_pos = strchr(key_value, ','); |
139 | icon_id = atoi(key_value + strchr(key_value, ',')); |
153 | if (icon_char_pos) icon_id = atoi(key_value + icon_char_pos); else icon_id = default_icon; |
140 | img_draw stdcall(skin.image, col*cell_w+tmp-10, row*cell_h+5 + list_pos, 32, 32, 0, icon_id*32); |
154 | img_draw stdcall(skin.image, col*cell_w+tmp-10, row*cell_h+5 + list_pos, 32, 32, 0, icon_id*32); |
141 | WriteTextCenter(col*cell_w+7,row*cell_h+47 + list_pos,cell_w,0xD4D4d4,key_name); |
155 | WriteTextCenter(col*cell_w+7,row*cell_h+47 + list_pos,cell_w,0xDCDCDC,key_name); |
142 | WriteTextCenter(col*cell_w+6,row*cell_h+46 + list_pos,cell_w,0x000000,key_name); |
156 | WriteTextCenter(col*cell_w+6,row*cell_h+46 + list_pos,cell_w,0x000000,key_name); |
143 | current_item_id++; |
157 | current_item_id++; |