Rev 7978 | Rev 9445 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7978 | Rev 7995 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #define MEMSIZE 4096*20 |
1 | #define MEMSIZE 1024*80 |
Line 2... | Line 2... | ||
2 | 2 | ||
3 | //===================================================// |
3 | //===================================================// |
4 | // // |
4 | // // |
5 | // LIB // |
5 | // LIB // |
Line 28... | Line 28... | ||
28 | int proc_list[256]; |
28 | int proc_list[256]; |
29 | collection attached=0; |
29 | collection attached=0; |
Line 30... | Line 30... | ||
30 | 30 | ||
Line -... | Line 31... | ||
- | 31 | llist list; |
|
- | 32 | ||
31 | llist list; |
33 | _ini ini = { "/sys/settings/appicons.ini", "icons"}; |
32 | 34 | ||
Line 33... | Line 35... | ||
33 | proc_info Form; |
35 | proc_info Form; |
34 | proc_info Process; |
36 | proc_info Process; |
Line 62... | Line 64... | ||
62 | int btn; |
64 | int btn; |
63 | load_dll(libio, #libio_init,1); |
65 | load_dll(libio, #libio_init,1); |
64 | load_dll(libimg, #libimg_init,1); |
66 | load_dll(libimg, #libimg_init,1); |
65 | load_dll(libini, #lib_init,1); |
67 | load_dll(libini, #lib_init,1); |
Line 66... | Line -... | ||
66 | - | ||
67 | skin.load("/sys/icons32.png"); |
- | |
68 | skin.replace_color(0x00000000, COLOR_BG); |
- | |
69 | 68 | ||
70 | ini_get_int stdcall ("/sys/appicons.ini", "taskbar", "attachement", ATTACHEMENT_BOTTOM); |
69 | ini_get_int stdcall ("/sys/appicons.ini", "taskbar", "attachement", ATTACHEMENT_BOTTOM); |
Line 71... | Line 70... | ||
71 | attachement = EAX; |
70 | attachement = EAX; |
72 | 71 | ||
Line 73... | Line 72... | ||
73 | SetAttachement(); |
72 | SetAttachement(); |
74 | GetAttachedItems(); |
73 | GetAttachedItems(); |
75 | 74 | ||
76 | GetProcessInfo(#Form, SelfInfo); |
- | |
77 | SetWindowLayerBehaviour(-1, ZPOS_DESKTOP); |
- | |
78 | SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER); |
75 | GetProcessInfo(#Form, SelfInfo); |
79 | loop() |
- | |
80 | { |
76 | SetWindowLayerBehaviour(-1, ZPOS_DESKTOP); |
81 | WaitEventTimeout(50); |
77 | SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER); |
82 | switch(EAX & 0xFF) |
78 | loop() switch(@WaitEventTimeout(50)) |
83 | { |
79 | { |
84 | case evMouse: |
80 | case evMouse: |
Line 93... | Line 89... | ||
93 | RunProgram(#program_path, NULL); |
89 | RunProgram(#program_path, NULL); |
94 | ExitProcess(); |
90 | ExitProcess(); |
95 | } |
91 | } |
96 | break; |
92 | break; |
97 | case evButton: |
93 | case evButton: |
98 | btn = GetButtonID(); |
94 | btn = @GetButtonID(); |
99 | btn -= 100; |
95 | btn -= 100; |
100 | if (btn < attached.count) RunProgram(attached.get(btn), NULL); |
96 | if (btn < attached.count) RunProgram(attached.get(btn), NULL); |
101 | else EventSetActiveProcess(btn); |
97 | else EventSetActiveProcess(btn); |
102 | break; |
98 | break; |
103 | case evReDraw: |
99 | case evReDraw: |
Line 105... | Line 101... | ||
105 | list.SetSizes(0, 0, Form.width+1, Form.height+2, CELLH); |
101 | list.SetSizes(0, 0, Form.width+1, Form.height+2, CELLH); |
106 | default: |
102 | default: |
107 | DrawProcessList(); |
103 | DrawProcessList(); |
108 | } |
104 | } |
109 | } |
105 | } |
110 | } |
- | |
Line 111... | Line 106... | ||
111 | 106 | ||
112 | 107 | ||
113 | void GetProcessList() |
108 | void GetProcessList() |
Line 156... | Line 151... | ||
156 | 151 | ||
157 | for (i=0; i |
152 | for (i=0; i |
158 | { |
153 | { |
159 | if (proc_list[i+list.first]==0) { |
154 | if (proc_list[i+list.first]==0) { |
160 | status_color = COLOR_BG; |
- | |
161 | ini_get_int stdcall ( |
- | |
162 | "/sys/appicons.ini", |
- | |
163 | "icons", |
155 | status_color = COLOR_BG; |
164 | attached.get(i+list.first)+strrchr(attached.get(i+list.first),'/'), |
- | |
165 | 0 |
- | |
166 | ); |
- | |
167 | icon_n = EAX; |
156 | icon_n = ini.GetInt(attached.get(i+list.first)+strrchr(attached.get(i+list.first),'/'), 2); |
168 | } |
157 | } |
169 | else { |
158 | else { |
170 | GetProcessInfo(#Process, proc_list[i+list.first]); |
159 | GetProcessInfo(#Process, proc_list[i+list.first]); |
171 | strlwr(#Process.name); |
160 | strlwr(#Process.name); |
172 | ini_get_int stdcall ("/sys/appicons.ini", "icons", #Process.name, 0); |
- | |
173 | icon_n = EAX; |
161 | icon_n = ini.GetInt(#Process.name, 2); |
174 | if (CheckActiveProcess(Process.ID)) && (Process.status_window!=2) { |
162 | if (CheckActiveProcess(Process.ID)) && (Process.status_window!=2) { |
175 | current_process_id = Process.ID; |
163 | current_process_id = Process.ID; |
176 | status_color = COLOR_ACTIVE; |
164 | status_color = COLOR_ACTIVE; |
177 | } |
165 | } |
178 | else { |
166 | else { |
179 | status_color = COLOR_OPENED; |
167 | status_color = COLOR_OPENED; |
180 | } |
168 | } |
181 | } |
169 | } |
182 | DrawWideRectangle(posx, posy, 40, 40, CELL_PADDING, COLOR_BG); |
170 | DrawWideRectangle(posx, posy, 40, 40, CELL_PADDING, COLOR_BG); |
183 | DefineButton(posx, posy, CELLW-1, CELLH, 100+i+BT_HIDE+BT_NOFRAME, NULL); |
171 | DefineButton(posx, posy, CELLW-1, CELLH, 100+i+BT_HIDE+BT_NOFRAME, NULL); |
Line 184... | Line 172... | ||
184 | img_draw stdcall(skin.image, posx+CELL_PADDING, posy+CELL_PADDING, 32, 32, 0, 32*icon_n); |
172 | DrawIcon32(posx+CELL_PADDING, posy+CELL_PADDING, COLOR_BG, icon_n); |
185 | 173 | ||
186 | if (ATTACHEMENT_BOTTOM==attachement) DrawBar(posx, posy+CELLH-ACTIVE_SIZE, CELLW, ACTIVE_SIZE, status_color); |
174 | if (ATTACHEMENT_BOTTOM==attachement) DrawBar(posx, posy+CELLH-ACTIVE_SIZE, CELLW, ACTIVE_SIZE, status_color); |
187 | if (ATTACHEMENT_LEFT ==attachement) DrawBar(posx, posy, ACTIVE_SIZE, CELLH, status_color); |
175 | if (ATTACHEMENT_LEFT ==attachement) DrawBar(posx, posy, ACTIVE_SIZE, CELLH, status_color); |
Line 229... | Line 217... | ||
229 | } |
217 | } |
Line 230... | Line 218... | ||
230 | 218 | ||
231 | void GetAttachedItems() |
219 | void GetAttachedItems() |
232 | { |
220 | { |
233 | attached.drop(); |
221 | attached.drop(); |
234 | ini_enum_keys stdcall ("/sys/appicons.ini", "attached", #draw_icons_from_section); |
222 | ini_enum_keys stdcall ("/sys/settings/appicons.ini", "attached", #draw_icons_from_section); |
235 | } |
223 | } |
236 | //===================================================// |
224 | //===================================================// |
237 | // // |
225 | // // |
238 | // EVENTS // |
226 | // EVENTS // |