Changeset View
Standalone View
source/blender/editors/space_file/space_file.c
| Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | static SpaceLink *file_new(const ScrArea *UNUSED(area), const Scene *UNUSED(scene)) | ||||
| /* header */ | /* header */ | ||||
| ar = MEM_callocN(sizeof(ARegion), "header for file"); | ar = MEM_callocN(sizeof(ARegion), "header for file"); | ||||
| BLI_addtail(&sfile->regionbase, ar); | BLI_addtail(&sfile->regionbase, ar); | ||||
| ar->regiontype = RGN_TYPE_HEADER; | ar->regiontype = RGN_TYPE_HEADER; | ||||
| /* Ignore user preference "USER_HEADER_BOTTOM" here (always show top for new types). */ | /* Ignore user preference "USER_HEADER_BOTTOM" here (always show top for new types). */ | ||||
| ar->alignment = RGN_ALIGN_TOP; | ar->alignment = RGN_ALIGN_TOP; | ||||
| /* ui list region */ | |||||
| ar = MEM_callocN(sizeof(ARegion), "ui region for file"); | |||||
| BLI_addtail(&sfile->regionbase, ar); | |||||
| ar->regiontype = RGN_TYPE_UI; | |||||
| ar->alignment = RGN_ALIGN_TOP; | |||||
| ar->flag |= RGN_FLAG_DYNAMIC_SIZE; | |||||
| /* Tools region */ | /* Tools region */ | ||||
| ar = MEM_callocN(sizeof(ARegion), "tools region for file"); | ar = MEM_callocN(sizeof(ARegion), "tools region for file"); | ||||
| BLI_addtail(&sfile->regionbase, ar); | BLI_addtail(&sfile->regionbase, ar); | ||||
| ar->regiontype = RGN_TYPE_TOOLS; | ar->regiontype = RGN_TYPE_TOOLS; | ||||
| ar->alignment = RGN_ALIGN_LEFT; | ar->alignment = RGN_ALIGN_LEFT; | ||||
| /* Tools region (lower split region) */ | |||||
| ar = MEM_callocN(sizeof(ARegion), "lower tools region for file"); | |||||
| BLI_addtail(&sfile->regionbase, ar); | |||||
| ar->regiontype = RGN_TYPE_TOOLS; | |||||
| ar->alignment = RGN_ALIGN_BOTTOM | RGN_SPLIT_PREV; | |||||
| ar->flag |= RGN_FLAG_DYNAMIC_SIZE; | |||||
| /* Execute region */ | |||||
| ar = MEM_callocN(sizeof(ARegion), "execute region for file"); | |||||
| BLI_addtail(&sfile->regionbase, ar); | |||||
| ar->regiontype = RGN_TYPE_EXECUTE; | |||||
| ar->alignment = RGN_ALIGN_BOTTOM; | |||||
| ar->flag |= RGN_FLAG_DYNAMIC_SIZE; | |||||
| /* Tool props region is added as needed. */ | |||||
| #if 0 | |||||
| /* Tool props (aka operator) region */ | /* Tool props (aka operator) region */ | ||||
| ar = MEM_callocN(sizeof(ARegion), "tool props region for file"); | ar = MEM_callocN(sizeof(ARegion), "tool props region for file"); | ||||
| BLI_addtail(&sfile->regionbase, ar); | BLI_addtail(&sfile->regionbase, ar); | ||||
| ar->regiontype = RGN_TYPE_TOOL_PROPS; | ar->regiontype = RGN_TYPE_TOOL_PROPS; | ||||
| ar->alignment = RGN_ALIGN_BOTTOM | RGN_SPLIT_PREV; | ar->alignment = RGN_ALIGN_RIGHT; | ||||
| #endif | |||||
| /* ui list region */ | |||||
| ar = MEM_callocN(sizeof(ARegion), "ui region for file"); | |||||
| BLI_addtail(&sfile->regionbase, ar); | |||||
| ar->regiontype = RGN_TYPE_UI; | |||||
| ar->alignment = RGN_ALIGN_TOP; | |||||
| /* main region */ | /* main region */ | ||||
| ar = MEM_callocN(sizeof(ARegion), "main region for file"); | ar = MEM_callocN(sizeof(ARegion), "main region for file"); | ||||
| BLI_addtail(&sfile->regionbase, ar); | BLI_addtail(&sfile->regionbase, ar); | ||||
| ar->regiontype = RGN_TYPE_WINDOW; | ar->regiontype = RGN_TYPE_WINDOW; | ||||
| ar->v2d.scroll = (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM); | ar->v2d.scroll = (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM); | ||||
| ar->v2d.align = (V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_POS_Y); | ar->v2d.align = (V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_POS_Y); | ||||
| ar->v2d.keepzoom = (V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y | V2D_LIMITZOOM | V2D_KEEPASPECT); | ar->v2d.keepzoom = (V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y | V2D_LIMITZOOM | V2D_KEEPASPECT); | ||||
| ▲ Show 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | if (sfileo->layout) { | ||||
| sfilen->layout = MEM_dupallocN(sfileo->layout); | sfilen->layout = MEM_dupallocN(sfileo->layout); | ||||
| } | } | ||||
| return (SpaceLink *)sfilen; | return (SpaceLink *)sfilen; | ||||
| } | } | ||||
| static void file_refresh(const bContext *C, ScrArea *sa) | static void file_refresh(const bContext *C, ScrArea *sa) | ||||
| { | { | ||||
| wmWindowManager *wm = CTX_wm_manager(C); | wmWindowManager *wm = CTX_wm_manager(C); | ||||
| wmWindow *win = CTX_wm_window(C); | |||||
| SpaceFile *sfile = CTX_wm_space_file(C); | SpaceFile *sfile = CTX_wm_space_file(C); | ||||
| FileSelectParams *params = ED_fileselect_get_params(sfile); | FileSelectParams *params = ED_fileselect_get_params(sfile); | ||||
| struct FSMenu *fsmenu = ED_fsmenu_get(); | struct FSMenu *fsmenu = ED_fsmenu_get(); | ||||
| if (!sfile->folders_prev) { | if (!sfile->folders_prev) { | ||||
| sfile->folders_prev = folderlist_new(); | sfile->folders_prev = folderlist_new(); | ||||
| } | } | ||||
| if (!sfile->files) { | if (!sfile->files) { | ||||
| sfile->files = filelist_new(params->type); | sfile->files = filelist_new(params->type); | ||||
| params->highlight_file = -1; /* added this so it opens nicer (ton) */ | params->highlight_file = -1; /* added this so it opens nicer (ton) */ | ||||
| } | } | ||||
| filelist_setdir(sfile->files, params->dir); | filelist_setdir(sfile->files, params->dir); | ||||
| filelist_setrecursion(sfile->files, params->recursion_level); | filelist_setrecursion(sfile->files, params->recursion_level); | ||||
| filelist_setsorting(sfile->files, params->sort); | filelist_setsorting(sfile->files, params->sort, params->flag & FILE_SORT_INVERT); | ||||
| filelist_setfilter_options(sfile->files, | filelist_setfilter_options( | ||||
| sfile->files, | |||||
| (params->flag & FILE_FILTER) != 0, | (params->flag & FILE_FILTER) != 0, | ||||
| (params->flag & FILE_HIDE_DOT) != 0, | (params->flag & FILE_HIDE_DOT) != 0, | ||||
| false, /* TODO hide_parent, should be controllable? */ | true, /* Just always hide parent, prefer to not add an extra user option for this. */ | ||||
| params->filter, | params->filter, | ||||
| params->filter_id, | params->filter_id, | ||||
| params->filter_glob, | params->filter_glob, | ||||
| params->filter_search); | params->filter_search); | ||||
| /* Update the active indices of bookmarks & co. */ | /* Update the active indices of bookmarks & co. */ | ||||
| sfile->systemnr = fsmenu_get_active_indices(fsmenu, FS_CATEGORY_SYSTEM, params->dir); | sfile->systemnr = fsmenu_get_active_indices(fsmenu, FS_CATEGORY_SYSTEM, params->dir); | ||||
| sfile->system_bookmarknr = fsmenu_get_active_indices( | sfile->system_bookmarknr = fsmenu_get_active_indices( | ||||
| fsmenu, FS_CATEGORY_SYSTEM_BOOKMARKS, params->dir); | fsmenu, FS_CATEGORY_SYSTEM_BOOKMARKS, params->dir); | ||||
| sfile->bookmarknr = fsmenu_get_active_indices(fsmenu, FS_CATEGORY_BOOKMARKS, params->dir); | sfile->bookmarknr = fsmenu_get_active_indices(fsmenu, FS_CATEGORY_BOOKMARKS, params->dir); | ||||
| sfile->recentnr = fsmenu_get_active_indices(fsmenu, FS_CATEGORY_RECENT, params->dir); | sfile->recentnr = fsmenu_get_active_indices(fsmenu, FS_CATEGORY_RECENT, params->dir); | ||||
| Show All 12 Lines | static void file_refresh(const bContext *C, ScrArea *sa) | ||||
| filelist_filter(sfile->files); | filelist_filter(sfile->files); | ||||
| if (params->display == FILE_IMGDISPLAY) { | if (params->display == FILE_IMGDISPLAY) { | ||||
| filelist_cache_previews_set(sfile->files, true); | filelist_cache_previews_set(sfile->files, true); | ||||
| } | } | ||||
| else { | else { | ||||
| filelist_cache_previews_set(sfile->files, false); | filelist_cache_previews_set(sfile->files, false); | ||||
| if (sfile->previews_timer) { | if (sfile->previews_timer) { | ||||
| WM_event_remove_timer_notifier(wm, CTX_wm_window(C), sfile->previews_timer); | WM_event_remove_timer_notifier(wm, win, sfile->previews_timer); | ||||
| sfile->previews_timer = NULL; | sfile->previews_timer = NULL; | ||||
| } | } | ||||
| } | } | ||||
| if (params->rename_flag != 0) { | if (params->rename_flag != 0) { | ||||
| file_params_renamefile_activate(sfile, params); | file_params_renamefile_activate(sfile, params); | ||||
| } | } | ||||
| if (sfile->layout) { | if (sfile->layout) { | ||||
| sfile->layout->dirty = true; | sfile->layout->dirty = true; | ||||
| } | } | ||||
| /* Might be called with NULL sa, see file_main_region_draw() below. */ | /* Might be called with NULL sa, see file_main_region_draw() below. */ | ||||
| if (sa && BKE_area_find_region_type(sa, RGN_TYPE_TOOLS) == NULL) { | if (sa && BKE_area_find_region_type(sa, RGN_TYPE_TOOLS) == NULL) { | ||||
| /* Create TOOLS/TOOL_PROPS regions. */ | /* Create TOOLS region. */ | ||||
| file_tools_region(sa); | file_tools_region(sa); | ||||
| ED_area_initialize(wm, CTX_wm_window(C), sa); | ED_area_initialize(wm, win, sa); | ||||
| } | |||||
| if (sa && sfile->op && BKE_area_find_region_type(sa, RGN_TYPE_TOOL_PROPS) == NULL) { | |||||
| /* Create TOOL_PROPS region. */ | |||||
| ARegion *region_props = file_tool_props_region(sa); | |||||
| if (params->flag & FILE_HIDE_TOOL_PROPS) { | |||||
| region_props->flag |= RGN_FLAG_HIDDEN; | |||||
| } | |||||
| ED_area_initialize(wm, win, sa); | |||||
| } | } | ||||
| ED_area_tag_redraw(sa); | ED_area_tag_redraw(sa); | ||||
| } | } | ||||
| static void file_listener(wmWindow *UNUSED(win), | static void file_listener(wmWindow *UNUSED(win), | ||||
| ScrArea *sa, | ScrArea *sa, | ||||
| wmNotifier *wmn, | wmNotifier *wmn, | ||||
| ▲ Show 20 Lines • Show All 117 Lines • ▼ Show 20 Lines | static void file_main_region_draw(const bContext *C, ARegion *ar) | ||||
| /* Allow dynamically sliders to be set, saves notifiers etc. */ | /* Allow dynamically sliders to be set, saves notifiers etc. */ | ||||
| if (params->display == FILE_IMGDISPLAY) { | if (params->display == FILE_IMGDISPLAY) { | ||||
| v2d->scroll = V2D_SCROLL_RIGHT; | v2d->scroll = V2D_SCROLL_RIGHT; | ||||
| v2d->keepofs &= ~V2D_LOCKOFS_Y; | v2d->keepofs &= ~V2D_LOCKOFS_Y; | ||||
| v2d->keepofs |= V2D_LOCKOFS_X; | v2d->keepofs |= V2D_LOCKOFS_X; | ||||
| } | } | ||||
| else if (params->display == FILE_VERTICALDISPLAY) { | |||||
| v2d->scroll = V2D_SCROLL_RIGHT; | |||||
| v2d->keepofs &= ~V2D_LOCKOFS_Y; | |||||
| v2d->keepofs |= V2D_LOCKOFS_X; | |||||
| } | |||||
| else { | else { | ||||
| v2d->scroll = V2D_SCROLL_BOTTOM; | v2d->scroll = V2D_SCROLL_BOTTOM; | ||||
| v2d->keepofs &= ~V2D_LOCKOFS_X; | v2d->keepofs &= ~V2D_LOCKOFS_X; | ||||
| v2d->keepofs |= V2D_LOCKOFS_Y; | v2d->keepofs |= V2D_LOCKOFS_Y; | ||||
| /* XXX this happens on scaling down Screen (like from startup.blend) */ | /* XXX this happens on scaling down Screen (like from startup.blend) */ | ||||
| /* view2d has no type specific for filewindow case, which doesn't scroll vertically */ | /* view2d has no type specific for filewindow case, which doesn't scroll vertically */ | ||||
| if (v2d->cur.ymax < 0) { | if (v2d->cur.ymax < 0) { | ||||
| Show All 17 Lines | static void file_main_region_draw(const bContext *C, ARegion *ar) | ||||
| } | } | ||||
| file_draw_list(C, ar); | file_draw_list(C, ar); | ||||
| /* reset view matrix */ | /* reset view matrix */ | ||||
| UI_view2d_view_restore(C); | UI_view2d_view_restore(C); | ||||
| /* scrollers */ | /* scrollers */ | ||||
| scrollers = UI_view2d_scrollers_calc(v2d, NULL); | rcti view_rect; | ||||
| ED_fileselect_layout_maskrect(sfile->layout, v2d, &view_rect); | |||||
| scrollers = UI_view2d_scrollers_calc(v2d, &view_rect); | |||||
| UI_view2d_scrollers_draw(v2d, scrollers); | UI_view2d_scrollers_draw(v2d, scrollers); | ||||
| UI_view2d_scrollers_free(scrollers); | UI_view2d_scrollers_free(scrollers); | ||||
| } | } | ||||
| static void file_operatortypes(void) | static void file_operatortypes(void) | ||||
| { | { | ||||
| WM_operatortype_append(FILE_OT_select); | WM_operatortype_append(FILE_OT_select); | ||||
| WM_operatortype_append(FILE_OT_select_walk); | WM_operatortype_append(FILE_OT_select_walk); | ||||
| WM_operatortype_append(FILE_OT_select_all); | WM_operatortype_append(FILE_OT_select_all); | ||||
| WM_operatortype_append(FILE_OT_select_box); | WM_operatortype_append(FILE_OT_select_box); | ||||
| WM_operatortype_append(FILE_OT_select_bookmark); | WM_operatortype_append(FILE_OT_select_bookmark); | ||||
| WM_operatortype_append(FILE_OT_highlight); | WM_operatortype_append(FILE_OT_highlight); | ||||
| WM_operatortype_append(FILE_OT_sort_column_ui_context); | |||||
| WM_operatortype_append(FILE_OT_execute); | WM_operatortype_append(FILE_OT_execute); | ||||
| WM_operatortype_append(FILE_OT_cancel); | WM_operatortype_append(FILE_OT_cancel); | ||||
| WM_operatortype_append(FILE_OT_parent); | WM_operatortype_append(FILE_OT_parent); | ||||
| WM_operatortype_append(FILE_OT_previous); | WM_operatortype_append(FILE_OT_previous); | ||||
| WM_operatortype_append(FILE_OT_next); | WM_operatortype_append(FILE_OT_next); | ||||
| WM_operatortype_append(FILE_OT_refresh); | WM_operatortype_append(FILE_OT_refresh); | ||||
| WM_operatortype_append(FILE_OT_bookmark_toggle); | WM_operatortype_append(FILE_OT_bookmark_toggle); | ||||
| WM_operatortype_append(FILE_OT_bookmark_add); | WM_operatortype_append(FILE_OT_bookmark_add); | ||||
| ▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | static void file_header_region_draw(const bContext *C, ARegion *ar) | ||||
| ED_region_header(C, ar); | ED_region_header(C, ar); | ||||
| } | } | ||||
| /* add handlers, stuff you only do once or on area/region changes */ | /* add handlers, stuff you only do once or on area/region changes */ | ||||
| static void file_ui_region_init(wmWindowManager *wm, ARegion *ar) | static void file_ui_region_init(wmWindowManager *wm, ARegion *ar) | ||||
| { | { | ||||
| wmKeyMap *keymap; | wmKeyMap *keymap; | ||||
| UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy); | ED_region_panels_init(wm, ar); | ||||
| ar->v2d.keepzoom |= V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y; | |||||
| /* own keymap */ | /* own keymap */ | ||||
| keymap = WM_keymap_ensure(wm->defaultconf, "File Browser", SPACE_FILE, 0); | keymap = WM_keymap_ensure(wm->defaultconf, "File Browser", SPACE_FILE, 0); | ||||
| WM_event_add_keymap_handler_v2d_mask(&ar->handlers, keymap); | WM_event_add_keymap_handler_v2d_mask(&ar->handlers, keymap); | ||||
| keymap = WM_keymap_ensure(wm->defaultconf, "File Browser Buttons", SPACE_FILE, 0); | keymap = WM_keymap_ensure(wm->defaultconf, "File Browser Buttons", SPACE_FILE, 0); | ||||
| WM_event_add_keymap_handler_v2d_mask(&ar->handlers, keymap); | WM_event_add_keymap_handler_v2d_mask(&ar->handlers, keymap); | ||||
| } | } | ||||
| static void file_ui_region_draw(const bContext *C, ARegion *ar) | static void file_ui_region_draw(const bContext *C, ARegion *ar) | ||||
| { | { | ||||
| float col[3]; | ED_region_panels(C, ar); | ||||
| /* clear */ | } | ||||
| UI_GetThemeColor3fv(TH_BACK, col); | |||||
| GPU_clear_color(col[0], col[1], col[2], 0.0); | |||||
| GPU_clear(GPU_COLOR_BIT); | |||||
| /* scrolling here is just annoying, disable it */ | |||||
| ar->v2d.cur.ymax = BLI_rctf_size_y(&ar->v2d.cur); | |||||
| ar->v2d.cur.ymin = 0; | |||||
| /* set view2d view matrix for scrolling (without scrollers) */ | |||||
| UI_view2d_view_ortho(&ar->v2d); | |||||
| file_draw_buttons(C, ar); | static void file_execution_region_init(wmWindowManager *wm, ARegion *ar) | ||||
| { | |||||
| ED_region_panels_init(wm, ar); | |||||
| ar->v2d.keepzoom |= V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y; | |||||
| } | |||||
| UI_view2d_view_restore(C); | static void file_execution_region_draw(const bContext *C, ARegion *ar) | ||||
| { | |||||
| ED_region_panels(C, ar); | |||||
| } | } | ||||
mont29: Those kind of ifdef'd blocks should be cleaned up I think? | |||||
| static void file_ui_region_listener(wmWindow *UNUSED(win), | static void file_ui_region_listener(wmWindow *UNUSED(win), | ||||
| ScrArea *UNUSED(sa), | ScrArea *UNUSED(sa), | ||||
| ARegion *ar, | ARegion *ar, | ||||
| wmNotifier *wmn, | wmNotifier *wmn, | ||||
| const Scene *UNUSED(scene)) | const Scene *UNUSED(scene)) | ||||
| { | { | ||||
| /* context changes */ | /* context changes */ | ||||
| switch (wmn->category) { | switch (wmn->category) { | ||||
| ▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | void ED_spacetype_file(void) | ||||
| art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D | ED_KEYMAP_HEADER; | art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D | ED_KEYMAP_HEADER; | ||||
| art->init = file_header_region_init; | art->init = file_header_region_init; | ||||
| art->draw = file_header_region_draw; | art->draw = file_header_region_draw; | ||||
| // art->listener = file_header_region_listener; | // art->listener = file_header_region_listener; | ||||
| BLI_addhead(&st->regiontypes, art); | BLI_addhead(&st->regiontypes, art); | ||||
| /* regions: ui */ | /* regions: ui */ | ||||
| art = MEM_callocN(sizeof(ARegionType), "spacetype file region"); | art = MEM_callocN(sizeof(ARegionType), "spacetype file region"); | ||||
| art->regionid = RGN_TYPE_UI; | art->regionid = RGN_TYPE_UI; | ||||
| art->prefsizey = 60; | |||||
| art->keymapflag = ED_KEYMAP_UI; | art->keymapflag = ED_KEYMAP_UI; | ||||
Done Inline ActionsWhat is the reason for this? I don't see much immediate use for categories, but it's not obvious to me why they would need to be explicitly disabled. There should at least be a comment explaining the reason. brecht: What is the reason for this? I don't see much immediate use for categories, but it's not… | |||||
Done Inline ActionsThis is using the UI region, which expects bl_category to be set. If not, it prints a warning to the console, if it is set, the tabs are drawn. I think a region-type flag to explicitly disable categories where they don't make sense is reasonable. Severin: This is using the `UI` region, which expects `bl_category` to be set. If not, it prints a… | |||||
Done Inline ActionsI think category tabs only appear when there are active panels for multiple categories? At least in the video sequencer it seems to be work this way. Without a strip it shows no tabs, and once you add a strip they appear. brecht: I think category tabs only appear when there are active panels for multiple categories?
At… | |||||
Done Inline ActionsYes but I didn't want to add a dummy bl_category to multiple rather unrelated panels and like said the explicitly disabling categories here seemed reasonable. Severin: Yes but I didn't want to add a dummy `bl_category` to multiple rather unrelated panels and like… | |||||
| art->listener = file_ui_region_listener; | art->listener = file_ui_region_listener; | ||||
| art->init = file_ui_region_init; | art->init = file_ui_region_init; | ||||
| art->draw = file_ui_region_draw; | art->draw = file_ui_region_draw; | ||||
| BLI_addhead(&st->regiontypes, art); | BLI_addhead(&st->regiontypes, art); | ||||
| /* regions: execution */ | |||||
| art = MEM_callocN(sizeof(ARegionType), "spacetype file region"); | |||||
| art->regionid = RGN_TYPE_EXECUTE; | |||||
| art->keymapflag = ED_KEYMAP_UI; | |||||
| art->listener = file_ui_region_listener; | |||||
| art->init = file_execution_region_init; | |||||
| art->draw = file_execution_region_draw; | |||||
| BLI_addhead(&st->regiontypes, art); | |||||
| /* regions: channels (directories) */ | /* regions: channels (directories) */ | ||||
| art = MEM_callocN(sizeof(ARegionType), "spacetype file region"); | art = MEM_callocN(sizeof(ARegionType), "spacetype file region"); | ||||
| art->regionid = RGN_TYPE_TOOLS; | art->regionid = RGN_TYPE_TOOLS; | ||||
| art->prefsizex = 240; | art->prefsizex = 240; | ||||
| art->prefsizey = 60; | art->prefsizey = 60; | ||||
| art->keymapflag = ED_KEYMAP_UI; | art->keymapflag = ED_KEYMAP_UI; | ||||
| art->listener = file_tools_region_listener; | art->listener = file_tools_region_listener; | ||||
| art->init = file_tools_region_init; | art->init = file_tools_region_init; | ||||
| art->draw = file_tools_region_draw; | art->draw = file_tools_region_draw; | ||||
| BLI_addhead(&st->regiontypes, art); | BLI_addhead(&st->regiontypes, art); | ||||
| /* regions: tool properties */ | /* regions: tool properties */ | ||||
| art = MEM_callocN(sizeof(ARegionType), "spacetype file operator region"); | art = MEM_callocN(sizeof(ARegionType), "spacetype file operator region"); | ||||
| art->regionid = RGN_TYPE_TOOL_PROPS; | art->regionid = RGN_TYPE_TOOL_PROPS; | ||||
| art->prefsizex = 0; | art->prefsizex = 240; | ||||
| art->prefsizey = 360; | art->prefsizey = 60; | ||||
| art->keymapflag = ED_KEYMAP_UI; | art->keymapflag = ED_KEYMAP_UI; | ||||
| art->listener = file_tools_region_listener; | art->listener = file_tools_region_listener; | ||||
| art->init = file_tools_region_init; | art->init = file_tools_region_init; | ||||
| art->draw = file_tools_region_draw; | art->draw = file_tools_region_draw; | ||||
| BLI_addhead(&st->regiontypes, art); | BLI_addhead(&st->regiontypes, art); | ||||
| file_panels_register(art); | file_panels_register(art); | ||||
| BKE_spacetype_register(st); | BKE_spacetype_register(st); | ||||
| Show All 36 Lines | |||||
Those kind of ifdef'd blocks should be cleaned up I think?