Rev 7310 | Rev 7312 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
7202 | leency | 1 | //Leency, Veliant, Punk_Joker, PavelYakov & KolibriOS Team 2008-2018 |
3363 | leency | 2 | //GNU GPL licence. |
3 | |||
4022 | leency | 4 | #ifndef AUTOBUILD |
5 | #include "lang.h--" |
||
6 | #endif |
||
7 | |||
3363 | leency | 8 | //libraries |
7220 | leency | 9 | #define MEMSIZE 1024 * 720 |
7054 | leency | 10 | #include "../lib/clipboard.h" |
11 | #include "../lib/strings.h" |
||
12 | #include "../lib/mem.h" |
||
7219 | leency | 13 | #include "../lib/fs.h" |
7054 | leency | 14 | #include "../lib/gui.h" |
15 | #include "../lib/list_box.h" |
||
16 | #include "../lib/random.h" |
||
17 | #include "../lib/kfont.h" |
||
18 | #include "../lib/collection.h" |
||
19 | #include "../lib/menu.h" |
||
20 | #include "../lib/copyf.h" |
||
5834 | pavelyakov | 21 | |
7054 | leency | 22 | #include "../lib/obj/libini.h" |
23 | #include "../lib/obj/box_lib.h" |
||
7230 | leency | 24 | #include "../lib/obj/libimg.h" |
7054 | leency | 25 | |
26 | #include "../lib/patterns/history.h" |
||
27 | |||
3363 | leency | 28 | //images |
7054 | leency | 29 | #include "imgs/left_p.txt" |
3363 | leency | 30 | |
6278 | leency | 31 | //Button IDs |
32 | enum { |
||
33 | POPUP_BTN1 = 201, |
||
6289 | leency | 34 | POPUP_BTN2 = 202, |
35 | BREADCRUMB_ID = 300 |
||
6278 | leency | 36 | }; |
3444 | leency | 37 | |
6278 | leency | 38 | //NewElement options |
39 | enum { |
||
40 | CREATE_FILE=1, |
||
41 | CREATE_FOLDER, |
||
42 | RENAME_ITEM |
||
43 | }; |
||
44 | |||
45 | //OpenDir options |
||
46 | enum { |
||
47 | ONLY_SHOW, |
||
48 | WITH_REDRAW, |
||
49 | ONLY_OPEN |
||
50 | }; |
||
51 | |||
6949 | leency | 52 | dword col_padding, col_selec, col_lpanel, col_work, col_graph, col_list_line=0xDDD7CF; |
3363 | leency | 53 | |
3434 | leency | 54 | int toolbar_buttons_x[7]={9,46,85,134,167,203}; |
3363 | leency | 55 | |
4136 | punk_joker | 56 | byte active_about=0; |
4070 | punk_joker | 57 | word about_window; |
5416 | punk_joker | 58 | word settings_window; |
5753 | leency | 59 | byte active_settings=0; |
5606 | pavelyakov | 60 | dword _not_draw = false; |
4136 | punk_joker | 61 | byte menu_call_mouse=0; |
6403 | punk_joker | 62 | byte exif_load=0; |
4136 | punk_joker | 63 | |
5733 | leency | 64 | byte del_active=0; |
65 | byte new_element_active=0; |
||
5698 | leency | 66 | |
5733 | leency | 67 | llist files, files_active, files_inactive; |
3434 | leency | 68 | |
5694 | leency | 69 | byte list_full_redraw; |
70 | |||
5698 | leency | 71 | dword buf; |
72 | dword file_mas[6898]; |
||
73 | int selected_count; |
||
6406 | punk_joker | 74 | int count_dir; |
5698 | leency | 75 | |
3434 | leency | 76 | byte |
3363 | leency | 77 | path[4096], |
78 | file_path[4096], |
||
3404 | leency | 79 | file_name[256], |
5555 | punk_joker | 80 | new_element_name[256], |
5698 | leency | 81 | temp[4096], |
3441 | leency | 82 | itdir; |
3363 | leency | 83 | |
5719 | leency | 84 | char active_path[4096], inactive_path[4096]; |
5698 | leency | 85 | |
7202 | leency | 86 | dword eolite_ini_path[4096]; |
87 | _ini ini; |
||
5441 | leency | 88 | |
5698 | leency | 89 | char scroll_used=false; |
5695 | leency | 90 | |
5804 | punk_joker | 91 | dword menu_stak,about_stak,properties_stak,settings_stak,copy_stak,delete_stak; |
5608 | leency | 92 | |
3363 | leency | 93 | proc_info Form; |
7252 | leency | 94 | int sc_slider_h; |
3434 | leency | 95 | int j, i; |
4028 | leency | 96 | int action_buf; |
4863 | leency | 97 | int rand_n; |
3363 | leency | 98 | |
6291 | leency | 99 | char sort_num=2; |
7244 | leency | 100 | int active_panel=1; |
5549 | punk_joker | 101 | |
7054 | leency | 102 | libimg_image icons16_default; |
103 | libimg_image icons16_selected; |
||
104 | |||
7242 | leency | 105 | libimg_image icons32_default; |
106 | libimg_image icons32_selected; |
||
7197 | leency | 107 | |
6564 | leency | 108 | #define STATUS_BAR_H 16; |
109 | int status_bar_h = 0; |
||
110 | |||
7197 | leency | 111 | int icon_size = 16; |
112 | |||
7252 | leency | 113 | edit_box new_file_ed = {200,213,180,0xFFFFFF,0x94AECE,0xFFFFFF,0xFFFFFF,0x10000000, |
114 | 248,#new_element_name,0,100000000000010b,6,0}; |
||
7004 | leency | 115 | PathShow_data FileShow = {0, 56,215, 8, 100, 1, 0, 0x0, 0xFFFfff, #file_name, #temp, 0}; |
5694 | leency | 116 | byte cmd_free=0; |
5698 | leency | 117 | #include "include\translations.h" |
5804 | punk_joker | 118 | #include "include\fs.h" |
5834 | pavelyakov | 119 | |
5748 | leency | 120 | #include "include\settings.h" |
5804 | punk_joker | 121 | #include "include\progress_dialog.h" |
4042 | leency | 122 | #include "include\copy.h" |
5435 | leency | 123 | #include "include\gui.h" |
3363 | leency | 124 | #include "include\sorting.h" |
4042 | leency | 125 | #include "include\icons.h" |
3363 | leency | 126 | #include "include\left_panel.h" |
4042 | leency | 127 | #include "include\menu.h" |
6278 | leency | 128 | #include "include\delete.h" |
4042 | leency | 129 | #include "include\about.h" |
5447 | punk_joker | 130 | #include "include\properties.h" |
6289 | leency | 131 | #include "include\breadcrumbs.h" |
3363 | leency | 132 | |
133 | void main() |
||
134 | { |
||
7311 | pavelyakov | 135 | dword files_y = 0; |
6289 | leency | 136 | dword id; |
5834 | pavelyakov | 137 | byte count_sl = 0; |
5748 | leency | 138 | signed x_old, y_old, dif_x, dif_y, adif_x, adif_y; |
6735 | leency | 139 | char stats; |
4863 | leency | 140 | rand_n = random(40); |
5651 | pavelyakov | 141 | |
5626 | leency | 142 | load_dll(boxlib, #box_lib_init,0); |
5991 | leency | 143 | load_dll(libini, #lib_init,1); |
7054 | leency | 144 | load_dll(libio, #libio_init,1); |
145 | load_dll(libimg, #libimg_init,1); |
||
5834 | pavelyakov | 146 | |
5441 | leency | 147 | LoadIniSettings(); |
6034 | leency | 148 | SystemDiscs.Get(); |
4076 | leency | 149 | SetAppColors(); |
7041 | leency | 150 | |
7054 | leency | 151 | Libimg_LoadImage(#icons16_default, "/sys/icons16.png"); |
152 | Libimg_LoadImage(#icons16_selected, "/sys/icons16.png"); |
||
7203 | leency | 153 | Libimg_ReplaceColor(icons16_selected.image, icons16_selected.w, icons16_selected.h, 0xffFFFfff, col_selec); |
154 | Libimg_ReplaceColor(icons16_selected.image, icons16_selected.w, icons16_selected.h, 0xffCACBD6, MixColors(col_selec, 0, 200)); |
||
7054 | leency | 155 | |
7041 | leency | 156 | //-p just show file/folder properties dialog |
157 | if (param) && (param[0]=='-') && (param[1]=='p') |
||
158 | { |
||
159 | strcpy(#file_path, #param + 3); |
||
160 | strcpy(#file_name, #param + strrchr(#param, '/')); |
||
161 | properties_dialog(); |
||
162 | ExitProcess(); |
||
163 | } |
||
164 | |||
3363 | leency | 165 | if (param) |
166 | { |
||
7245 | leency | 167 | if (strlen(#param)>1) && (param[strlen(#param)-1]=='/') param[strlen(#param)-1]=NULL; //no "/" at the end |
6930 | leency | 168 | |
169 | if (dir_exists(#param)==true) |
||
170 | { |
||
171 | strcpy(#path, #param); |
||
172 | } |
||
173 | else |
||
174 | { |
||
175 | notify(T_NOTIFY_APP_PARAM_WRONG); |
||
176 | } |
||
7041 | leency | 177 | } |
5833 | pavelyakov | 178 | |
5733 | leency | 179 | Open_Dir(#path,ONLY_OPEN); |
5719 | leency | 180 | strcpy(#inactive_path, #path); |
5733 | leency | 181 | llist_copy(#files_inactive, #files); |
7051 | leency | 182 | SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER); |