Keymaps now have a poll() function, rather than adding/removing
[blender.git] / source / blender / editors / space_file / space_file.c
1 /**
2  * $Id:
3  *
4  * ***** BEGIN GPL LICENSE BLOCK *****
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version. 
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software Foundation,
18  * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19  *
20  * The Original Code is Copyright (C) 2008 Blender Foundation.
21  * All rights reserved.
22  *
23  * 
24  * Contributor(s): Blender Foundation
25  *
26  * ***** END GPL LICENSE BLOCK *****
27  */
28
29 #include <string.h>
30 #include <stdio.h>
31
32 #include "DNA_object_types.h"
33 #include "DNA_space_types.h"
34 #include "DNA_scene_types.h"
35 #include "DNA_screen_types.h"
36
37 #include "RNA_access.h"
38
39 #include "MEM_guardedalloc.h"
40
41 #include "BIF_gl.h"
42
43 #include "BLO_readfile.h"
44
45 #include "BLI_blenlib.h"
46 #include "BLI_arithb.h"
47 #include "BLI_rand.h"
48 #include "BLI_storage_types.h"
49
50 #include "BKE_colortools.h"
51 #include "BKE_context.h"
52 #include "BKE_screen.h"
53
54 #include "ED_space_api.h"
55 #include "ED_screen.h"
56 #include "ED_fileselect.h"
57
58 #include "IMB_imbuf_types.h"
59 #include "IMB_thumbs.h"
60
61 #include "WM_api.h"
62 #include "WM_types.h"
63
64 #include "UI_interface.h"
65 #include "UI_resources.h"
66 #include "UI_view2d.h"
67
68
69 #include "ED_markers.h"
70 #include "ED_fileselect.h"
71
72 #include "file_intern.h"        // own include
73 #include "fsmenu.h"
74 #include "filelist.h"
75
76 /* ******************** default callbacks for file space ***************** */
77
78 static SpaceLink *file_new(const bContext *C)
79 {
80         ARegion *ar;
81         SpaceFile *sfile;
82         
83         sfile= MEM_callocN(sizeof(SpaceFile), "initfile");
84         sfile->spacetype= SPACE_FILE;
85
86         /* header */
87         ar= MEM_callocN(sizeof(ARegion), "header for file");
88         BLI_addtail(&sfile->regionbase, ar);
89         ar->regiontype= RGN_TYPE_HEADER;
90         ar->alignment= RGN_ALIGN_TOP;
91
92         /* channel list region */
93         ar= MEM_callocN(sizeof(ARegion), "channel area for file");
94         BLI_addtail(&sfile->regionbase, ar);
95         ar->regiontype= RGN_TYPE_CHANNELS;
96         ar->alignment= RGN_ALIGN_LEFT;  
97
98         /* ui list region */
99         ar= MEM_callocN(sizeof(ARegion), "ui area for file");
100         BLI_addtail(&sfile->regionbase, ar);
101         ar->regiontype= RGN_TYPE_UI;
102         ar->alignment= RGN_ALIGN_TOP;
103
104         /* main area */
105         ar= MEM_callocN(sizeof(ARegion), "main area for file");
106         BLI_addtail(&sfile->regionbase, ar);
107         ar->regiontype= RGN_TYPE_WINDOW;
108         ar->v2d.scroll = (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM);
109         ar->v2d.align = (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_POS_Y);
110         ar->v2d.keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_LIMITZOOM|V2D_KEEPASPECT);
111         ar->v2d.keeptot= V2D_KEEPTOT_STRICT;
112         ar->v2d.minzoom= ar->v2d.maxzoom= 1.0f;
113
114         return (SpaceLink *)sfile;
115 }
116
117 /* not spacelink itself */
118 static void file_free(SpaceLink *sl)
119 {       
120         SpaceFile *sfile= (SpaceFile *) sl;
121         
122         if(sfile->files) {
123                 filelist_freelib(sfile->files);
124                 filelist_free(sfile->files);
125                 MEM_freeN(sfile->files);
126                 sfile->files= NULL;
127         }
128
129         if(sfile->folders_prev) {
130                 folderlist_free(sfile->folders_prev);
131                 MEM_freeN(sfile->folders_prev);
132                 sfile->folders_prev= NULL;
133         }
134
135         if(sfile->folders_next) {
136                 folderlist_free(sfile->folders_next);
137                 MEM_freeN(sfile->folders_next);
138                 sfile->folders_next= NULL;
139         }
140
141         if (sfile->params) {
142                 if(sfile->params->pupmenu)
143                         MEM_freeN(sfile->params->pupmenu);
144                 MEM_freeN(sfile->params);
145                 sfile->params= NULL;
146         }
147
148         if (sfile->layout) {
149                 MEM_freeN(sfile->layout);
150                 sfile->layout = NULL;
151         }
152 }
153
154
155 /* spacetype; init callback, area size changes, screen set, etc */
156 static void file_init(struct wmWindowManager *wm, ScrArea *sa)
157 {
158         SpaceFile *sfile= (SpaceFile*)sa->spacedata.first;
159         if(sfile->params) {
160                 MEM_freeN(sfile->params);
161                 sfile->params = 0;
162                 ED_fileselect_set_params(sfile);
163                 if (sfile->files) {
164                         filelist_free(sfile->files);
165                         MEM_freeN(sfile->files);
166                         sfile->files= NULL;
167                 }
168         }
169         printf("file_init\n");
170 }
171
172
173 static SpaceLink *file_duplicate(SpaceLink *sl)
174 {
175         SpaceFile *sfileo= (SpaceFile*)sl;
176         SpaceFile *sfilen= MEM_dupallocN(sl);
177         
178         /* clear or remove stuff from old */
179         sfilen->op = NULL; /* file window doesn't own operators */
180
181         if (sfileo->params)
182                 sfilen->files = filelist_new(sfileo->params->type);
183         if(sfileo->folders_prev)
184                 sfilen->folders_prev = MEM_dupallocN(sfileo->folders_prev);
185
186         if(sfileo->folders_next)
187                 sfilen->folders_next = MEM_dupallocN(sfileo->folders_next);
188
189         if(sfileo->params) {
190                 sfilen->params= MEM_dupallocN(sfileo->params);
191                 file_change_dir(sfilen);
192         }
193         if (sfileo->layout) {
194                 sfilen->layout= MEM_dupallocN(sfileo->layout);
195         }
196         return (SpaceLink *)sfilen;
197 }
198
199 static void file_refresh(const bContext *C, ScrArea *sa)
200 {
201         SpaceFile *sfile= CTX_wm_space_file(C);
202         FileSelectParams *params = ED_fileselect_get_params(sfile);
203
204         if (!sfile->folders_prev)
205                 sfile->folders_prev = folderlist_new();
206         if (!sfile->files) {
207                 sfile->files = filelist_new(params->type);
208                 file_change_dir(sfile);
209                 params->active_file = -1; // added this so it opens nicer (ton)
210         }
211         filelist_hidedot(sfile->files, params->flag & FILE_HIDE_DOT);
212         filelist_setfilter(sfile->files, params->flag & FILE_FILTER ? params->filter : 0);      
213         if (filelist_empty(sfile->files))
214         {
215                 filelist_readdir(sfile->files);
216         }
217         if(params->sort!=FILE_SORT_NONE) filelist_sort(sfile->files, params->sort);             
218         
219         if (params->renamefile[0] != '\0') {
220                 int idx = filelist_find(sfile->files, params->renamefile);
221                 if (idx >= 0) {
222                         struct direntry *file= filelist_file(sfile->files, idx);
223                         if (file) {
224                                 file->flags |= EDITING;
225                         }
226                 }
227                 params->renamefile[0] = '\0';
228         }
229         if (sfile->layout) sfile->layout->dirty= 1;
230
231 }
232
233 static void file_listener(ScrArea *sa, wmNotifier *wmn)
234 {
235         SpaceFile* sfile = (SpaceFile*)sa->spacedata.first;
236
237         /* context changes */
238         switch(wmn->category) {
239                 case NC_SPACE:
240                         switch (wmn->data) {
241                                 case ND_SPACE_FILE_LIST:
242                                         if (sfile->files) filelist_free(sfile->files);
243                                         ED_area_tag_refresh(sa);
244                                         ED_area_tag_redraw(sa);
245                                         break;
246                                 case ND_SPACE_FILE_PARAMS:
247                                         ED_area_tag_refresh(sa);
248                                         ED_area_tag_redraw(sa);
249                                         break;
250                         }
251                         break;
252         }
253 }
254
255 /* add handlers, stuff you only do once or on area/region changes */
256 static void file_main_area_init(wmWindowManager *wm, ARegion *ar)
257 {
258         wmKeyMap *keymap;
259         
260         UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy);
261         
262         /* own keymaps */
263         keymap= WM_keymap_find(wm, "File", SPACE_FILE, 0);
264         WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
265
266         keymap= WM_keymap_find(wm, "FileMain", SPACE_FILE, 0);
267         WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
268                                                            
269
270 }
271
272 static void file_main_area_listener(ARegion *ar, wmNotifier *wmn)
273 {
274         /* context changes */
275         switch(wmn->category) {
276                 case NC_SPACE:
277                         switch (wmn->data) {
278                                 case ND_SPACE_FILE_LIST:
279                                         ED_region_tag_redraw(ar);
280                                         break;
281                                 case ND_SPACE_FILE_PARAMS:
282                                         ED_region_tag_redraw(ar);
283                                         break;
284                         }
285                         break;
286         }
287 }
288
289 static void file_main_area_draw(const bContext *C, ARegion *ar)
290 {
291         /* draw entirely, view changes should be handled here */
292         SpaceFile *sfile= CTX_wm_space_file(C);
293         FileSelectParams *params = ED_fileselect_get_params(sfile);
294         FileLayout *layout=NULL;
295
296         View2D *v2d= &ar->v2d;
297         View2DScrollers *scrollers;
298         float col[3];
299
300         /* Needed, because filelist is not initialized on loading */
301         if (!sfile->files || filelist_empty(sfile->files))
302                 file_refresh(C, NULL);
303
304         layout = ED_fileselect_get_layout(sfile, ar);
305
306         /* clear and setup matrix */
307         UI_GetThemeColor3fv(TH_BACK, col);
308         glClearColor(col[0], col[1], col[2], 0.0);
309         glClear(GL_COLOR_BUFFER_BIT);
310         
311         /* Allow dynamically sliders to be set, saves notifiers etc. */
312         if (layout && (layout->flag == FILE_LAYOUT_VER)) {
313                 v2d->scroll = V2D_SCROLL_RIGHT;
314                 v2d->keepofs &= ~V2D_LOCKOFS_Y;
315                 v2d->keepofs |= V2D_LOCKOFS_X;
316         }
317         else {
318                 v2d->scroll = V2D_SCROLL_BOTTOM;
319                 v2d->keepofs &= ~V2D_LOCKOFS_X;
320                 v2d->keepofs |= V2D_LOCKOFS_Y;
321         }
322         /* v2d has initialized flag, so this call will only set the mask correct */
323         UI_view2d_region_reinit(v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy);
324
325         /* sets tile/border settings in sfile */
326         file_calc_previews(C, ar);
327
328         /* set view */
329         UI_view2d_view_ortho(C, v2d);
330         
331         /* on first read, find active file */
332         if (params->active_file == -1) {
333                 wmEvent *event= CTX_wm_window(C)->eventstate;
334                 file_hilight_set(sfile, ar, event->x, event->y);
335         }
336         
337         file_draw_list(C, ar);
338         
339         /* reset view matrix */
340         UI_view2d_view_restore(C);
341         
342         /* scrollers */
343         scrollers= UI_view2d_scrollers_calc(C, v2d, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
344         UI_view2d_scrollers_draw(C, v2d, scrollers);
345         UI_view2d_scrollers_free(scrollers);
346
347 }
348
349 void file_operatortypes(void)
350 {
351         WM_operatortype_append(FILE_OT_select);
352         WM_operatortype_append(FILE_OT_select_all_toggle);
353         WM_operatortype_append(FILE_OT_select_border);
354         WM_operatortype_append(FILE_OT_select_bookmark);
355         WM_operatortype_append(FILE_OT_loadimages);
356         WM_operatortype_append(FILE_OT_highlight);
357         WM_operatortype_append(FILE_OT_execute);
358         WM_operatortype_append(FILE_OT_cancel);
359         WM_operatortype_append(FILE_OT_parent);
360         WM_operatortype_append(FILE_OT_previous);
361         WM_operatortype_append(FILE_OT_next);
362         WM_operatortype_append(FILE_OT_refresh);
363         WM_operatortype_append(FILE_OT_bookmark_toggle);
364         WM_operatortype_append(FILE_OT_add_bookmark);
365         WM_operatortype_append(FILE_OT_delete_bookmark);
366         WM_operatortype_append(FILE_OT_hidedot);
367         WM_operatortype_append(FILE_OT_filenum);
368         WM_operatortype_append(FILE_OT_directory_new);
369         WM_operatortype_append(FILE_OT_delete);
370         WM_operatortype_append(FILE_OT_rename);
371 }
372
373 /* NOTE: do not add .blend file reading on this level */
374 void file_keymap(struct wmWindowManager *wm)
375 {
376         wmKeymapItem *kmi;
377         /* keys for all areas */
378         wmKeyMap *keymap= WM_keymap_find(wm, "File", SPACE_FILE, 0);
379         WM_keymap_add_item(keymap, "FILE_OT_bookmark_toggle", NKEY, KM_PRESS, 0, 0);
380         WM_keymap_add_item(keymap, "FILE_OT_parent", PKEY, KM_PRESS, 0, 0);
381         WM_keymap_add_item(keymap, "FILE_OT_add_bookmark", BKEY, KM_PRESS, KM_CTRL, 0);
382         WM_keymap_add_item(keymap, "FILE_OT_hidedot", HKEY, KM_PRESS, 0, 0);
383         WM_keymap_add_item(keymap, "FILE_OT_previous", BACKSPACEKEY, KM_PRESS, 0, 0);
384         WM_keymap_add_item(keymap, "FILE_OT_next", BACKSPACEKEY, KM_PRESS, KM_SHIFT, 0);
385         WM_keymap_add_item(keymap, "FILE_OT_directory_new", IKEY, KM_PRESS, 0, 0);  /* XXX needs button */
386         WM_keymap_add_item(keymap, "FILE_OT_delete", XKEY, KM_PRESS, 0, 0);
387
388         /* keys for main area */
389         keymap= WM_keymap_find(wm, "FileMain", SPACE_FILE, 0);
390         WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_PRESS, 0, 0);
391         WM_keymap_add_item(keymap, "FILE_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0);
392         WM_keymap_add_item(keymap, "FILE_OT_select_border", BKEY, KM_PRESS, 0, 0);
393         WM_keymap_add_item(keymap, "FILE_OT_rename", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
394         WM_keymap_add_item(keymap, "FILE_OT_highlight", MOUSEMOVE, KM_ANY, 0, 0);
395         WM_keymap_add_item(keymap, "FILE_OT_loadimages", TIMER1, KM_ANY, KM_ANY, 0);
396         kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, 0, 0);
397         RNA_int_set(kmi->ptr, "increment", 1);
398         kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, KM_SHIFT, 0);
399         RNA_int_set(kmi->ptr, "increment", 10);
400         kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
401         RNA_int_set(kmi->ptr, "increment", 100);
402         kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, 0,0);
403         RNA_int_set(kmi->ptr, "increment", -1);
404         kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, KM_SHIFT, 0);
405         RNA_int_set(kmi->ptr, "increment", -10);
406         kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, KM_CTRL, 0);
407         RNA_int_set(kmi->ptr, "increment",-100);
408         
409         /* keys for button area (top) */
410         keymap= WM_keymap_find(wm, "FileButtons", SPACE_FILE, 0);
411         WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, 0, 0);
412         kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, 0, 0);
413         RNA_int_set(kmi->ptr, "increment", 1);
414         kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, KM_SHIFT, 0);
415         RNA_int_set(kmi->ptr, "increment", 10);
416         kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
417         RNA_int_set(kmi->ptr, "increment", 100);
418         kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, 0, 0);
419         RNA_int_set(kmi->ptr, "increment", -1);
420         kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, KM_SHIFT,0);
421         RNA_int_set(kmi->ptr, "increment", -10);
422         kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, KM_CTRL,0);
423         RNA_int_set(kmi->ptr, "increment",-100);
424 }
425
426
427 static void file_channel_area_init(wmWindowManager *wm, ARegion *ar)
428 {
429         wmKeyMap *keymap;
430
431         ED_region_panels_init(wm, ar);
432
433         /* own keymaps */
434         keymap= WM_keymap_find(wm, "File", SPACE_FILE, 0);      
435         WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
436 }
437
438 static void file_channel_area_draw(const bContext *C, ARegion *ar)
439 {
440         ED_region_panels(C, ar, 1, NULL, -1);
441 }
442
443 static void file_channel_area_listener(ARegion *ar, wmNotifier *wmn)
444 {
445         /* context changes */
446         switch(wmn->category) {
447                 
448         }
449 }
450
451 /* add handlers, stuff you only do once or on area/region changes */
452 static void file_header_area_init(wmWindowManager *wm, ARegion *ar)
453 {
454         ED_region_header_init(ar);
455 }
456
457 static void file_header_area_draw(const bContext *C, ARegion *ar)
458 {
459         ED_region_header(C, ar);
460 }
461
462 /* add handlers, stuff you only do once or on area/region changes */
463 static void file_ui_area_init(wmWindowManager *wm, ARegion *ar)
464 {
465         wmKeyMap *keymap;
466
467         UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
468
469         /* own keymap */
470         keymap= WM_keymap_find(wm, "File", SPACE_FILE, 0);
471         WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
472
473         keymap= WM_keymap_find(wm, "FileButtons", SPACE_FILE, 0);
474         WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
475 }
476
477 static void file_ui_area_draw(const bContext *C, ARegion *ar)
478 {
479         float col[3];
480         /* clear */
481         UI_GetThemeColor3fv(TH_PANEL, col);
482         glClearColor(col[0], col[1], col[2], 0.0);
483         glClear(GL_COLOR_BUFFER_BIT);
484
485         /* set view2d view matrix for scrolling (without scrollers) */
486         UI_view2d_view_ortho(C, &ar->v2d);
487
488         file_draw_buttons(C, ar);
489
490         UI_view2d_view_restore(C);
491 }
492
493 static void file_ui_area_listener(ARegion *ar, wmNotifier *wmn)
494 {
495         /* context changes */
496         switch(wmn->category) {
497                 case NC_SPACE:
498                         switch (wmn->data) {
499                                 case ND_SPACE_FILE_LIST:
500                                         ED_region_tag_redraw(ar);
501                                         break;
502                         }
503                         break;
504         }
505 }
506
507 /* only called once, from space/spacetypes.c */
508 void ED_spacetype_file(void)
509 {
510         SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype file");
511         ARegionType *art;
512         
513         st->spaceid= SPACE_FILE;
514         
515         st->new= file_new;
516         st->free= file_free;
517         st->init= file_init;
518         st->duplicate= file_duplicate;
519         st->refresh= file_refresh;
520         st->listener= file_listener;
521         st->operatortypes= file_operatortypes;
522         st->keymap= file_keymap;
523         
524         /* regions: main window */
525         art= MEM_callocN(sizeof(ARegionType), "spacetype file region");
526         art->regionid = RGN_TYPE_WINDOW;
527         art->init= file_main_area_init;
528         art->draw= file_main_area_draw;
529         art->listener= file_main_area_listener;
530         art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
531         BLI_addhead(&st->regiontypes, art);
532         
533         /* regions: header */
534         art= MEM_callocN(sizeof(ARegionType), "spacetype file region");
535         art->regionid = RGN_TYPE_HEADER;
536         art->minsizey= HEADERY;
537         art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
538         art->init= file_header_area_init;
539         art->draw= file_header_area_draw;
540         // art->listener= file_header_area_listener;
541         BLI_addhead(&st->regiontypes, art);
542         
543         /* regions: ui */
544         art= MEM_callocN(sizeof(ARegionType), "spacetype file region");
545         art->regionid = RGN_TYPE_UI;
546         art->minsizey= 60;
547         art->keymapflag= ED_KEYMAP_UI;
548         art->listener= file_ui_area_listener;
549         art->init= file_ui_area_init;
550         art->draw= file_ui_area_draw;
551         BLI_addhead(&st->regiontypes, art);
552
553         /* regions: channels (directories) */
554         art= MEM_callocN(sizeof(ARegionType), "spacetype file region");
555         art->regionid = RGN_TYPE_CHANNELS;
556         art->minsizex= 240;
557         art->keymapflag= ED_KEYMAP_UI;
558         art->listener= file_channel_area_listener;
559         art->init= file_channel_area_init;
560         art->draw= file_channel_area_draw;
561         BLI_addhead(&st->regiontypes, art);
562         file_panels_register(art);
563
564         BKE_spacetype_register(st);
565
566 }
567
568 void ED_file_init(void)
569 {
570         char name[FILE_MAX];
571         BLI_make_file_string("/", name, BLI_gethome(), ".Bfs");
572         fsmenu_read_file(fsmenu_get(), name);
573         filelist_init_icons();
574         IMB_thumb_makedirs();
575 }
576
577 void ED_file_exit(void)
578 {
579         fsmenu_free(fsmenu_get());
580         filelist_free_icons();
581 }