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