Revision: 18366 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18366 Author: elubie Date: 2009-01-06 15:42:54 +0100 (Tue, 06 Jan 2009)
Log Message: ----------- 2.5 - Start of filebrowser. - basic drawing of list and thumbnail view (switchable through 'favourits' icon in header) - selection of files and directories (bookmarks) works with the RMB (right mouse button) - load operator for files still unstable (no check for correct file type) and incomplete. (WM_operator_free missing) immediate TODOS: - fix load file operator - finish drawing of buttons in header - drawing of detailed list with all file info. - finish selection and execute operators (LMB and MMB execute) later todos: - parent dir - keymap for all the shortcuts - append/link and databrowse - ... Modified Paths: -------------- branches/blender2.5/blender/projectfiles_vc9/blender/editors/ED_editors.vcproj branches/blender2.5/blender/source/blender/blenloader/BLO_readfile.h branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c branches/blender2.5/blender/source/blender/editors/include/ED_datafiles.h branches/blender2.5/blender/source/blender/editors/include/ED_space_api.h branches/blender2.5/blender/source/blender/editors/include/UI_interface_icons.h branches/blender2.5/blender/source/blender/editors/interface/interface_icons.c branches/blender2.5/blender/source/blender/editors/screen/area.c branches/blender2.5/blender/source/blender/editors/screen/screen_intern.h branches/blender2.5/blender/source/blender/editors/space_file/file_header.c branches/blender2.5/blender/source/blender/editors/space_file/file_intern.h branches/blender2.5/blender/source/blender/editors/space_file/filelist.c branches/blender2.5/blender/source/blender/editors/space_file/filesel.c branches/blender2.5/blender/source/blender/editors/space_file/fsmenu.c branches/blender2.5/blender/source/blender/editors/space_file/fsmenu.h branches/blender2.5/blender/source/blender/editors/space_file/space_file.c branches/blender2.5/blender/source/blender/makesdna/DNA_screen_types.h branches/blender2.5/blender/source/blender/makesdna/DNA_space_types.h branches/blender2.5/blender/source/blender/windowmanager/intern/wm_init_exit.c branches/blender2.5/blender/source/blender/windowmanager/intern/wm_operators.c Added Paths: ----------- branches/blender2.5/blender/source/blender/editors/datafiles/prvicons.c branches/blender2.5/blender/source/blender/editors/include/ED_fileselect.h branches/blender2.5/blender/source/blender/editors/space_file/file_draw.c branches/blender2.5/blender/source/blender/editors/space_file/file_ops.c Property Changed: ---------------- branches/blender2.5/blender/source/blender/editors/space_file/file_intern.h Modified: branches/blender2.5/blender/projectfiles_vc9/blender/editors/ED_editors.vcproj =================================================================== --- branches/blender2.5/blender/projectfiles_vc9/blender/editors/ED_editors.vcproj 2009-01-06 12:30:44 UTC (rev 18365) +++ branches/blender2.5/blender/projectfiles_vc9/blender/editors/ED_editors.vcproj 2009-01-06 14:42:54 UTC (rev 18366) @@ -202,6 +202,10 @@ > </File> <File + RelativePath="..\..\..\source\blender\editors\include\ED_fileselect.h" + > + </File> + <File RelativePath="..\..\..\source\blender\editors\include\ED_interface.h" > </File> @@ -299,6 +303,10 @@ > </File> <File + RelativePath="..\..\..\source\blender\editors\datafiles\prvicons.c" + > + </File> + <File RelativePath="..\..\..\source\blender\editors\datafiles\splash.jpg.c" > </File> @@ -599,6 +607,10 @@ Name="space_file" > <File + RelativePath="..\..\..\source\blender\editors\space_file\file_draw.c" + > + </File> + <File RelativePath="..\..\..\source\blender\editors\space_file\file_header.c" > </File> @@ -607,6 +619,10 @@ > </File> <File + RelativePath="..\..\..\source\blender\editors\space_file\file_ops.c" + > + </File> + <File RelativePath="..\..\..\source\blender\editors\space_file\filelist.c" > </File> Modified: branches/blender2.5/blender/source/blender/blenloader/BLO_readfile.h =================================================================== --- branches/blender2.5/blender/source/blender/blenloader/BLO_readfile.h 2009-01-06 12:30:44 UTC (rev 18365) +++ branches/blender2.5/blender/source/blender/blenloader/BLO_readfile.h 2009-01-06 14:42:54 UTC (rev 18366) @@ -200,8 +200,7 @@ char *BLO_gethome(void); int BLO_has_bfile_extension(char *str); -void BLO_library_append(struct SpaceFile *sfile, char *dir, int idcode, struct Main *mainvar, struct Scene *scene, struct ReportList *reports); -void BLO_library_append_(BlendHandle **libfiledata, struct direntry* filelist, int totfile, +void BLO_library_append(BlendHandle **libfiledata, struct direntry* filelist, int totfile, char *dir, char* file, short flag, int idcode, struct Main *mainvar, struct Scene *scene, struct ReportList *reports); void BLO_script_library_append(BlendHandle **bh, char *dir, char *name, int idcode, short flag, struct Main *mainvar, struct Scene *scene, struct ReportList *reports); Modified: branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c =================================================================== --- branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c 2009-01-06 12:30:44 UTC (rev 18365) +++ branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c 2009-01-06 14:42:54 UTC (rev 18366) @@ -3942,11 +3942,11 @@ else if(sl->spacetype==SPACE_FILE) { SpaceFile *sfile= (SpaceFile *)sl; - sfile->filelist= NULL; - sfile->libfiledata= NULL; - sfile->returnfunc= NULL; + sfile->params= NULL; + sfile->op= NULL; + /* sfile->returnfunc= NULL; sfile->menup= NULL; - sfile->pupmenu= NULL; + sfile->pupmenu= NULL; */ /* XXX removed */ } else if(sl->spacetype==SPACE_IMASEL) { SpaceImaSel *simasel= (SpaceImaSel *)sl; @@ -4143,10 +4143,15 @@ //XXX if (sbuts->ri) sbuts->ri->curtile = 0; } else if(sl->spacetype==SPACE_FILE) { + SpaceFile *sfile= (SpaceFile *)sl; + sfile->params = NULL; + sfile->op = NULL; + /* XXX needs checking - best solve in filesel itself if(sfile->libfiledata) BLO_blendhandle_close(sfile->libfiledata); sfile->libfiledata= 0; + */ } else if(sl->spacetype==SPACE_IMASEL) { SpaceImaSel *simasel= (SpaceImaSel *)sl; @@ -5191,6 +5196,13 @@ ar->v2d.scroll= V2D_SCROLL_BOTTOM; ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL; break; + case SPACE_FILE: + ar= MEM_callocN(sizeof(ARegion), "area region from do_versions"); + BLI_addtail(lb, ar); + ar->regiontype= RGN_TYPE_CHANNELS; + ar->alignment= RGN_ALIGN_LEFT; + ar->v2d.scroll= V2D_SCROLL_RIGHT; + break; } } /* main region */ @@ -5319,6 +5331,19 @@ ar->v2d.keepzoom |= V2D_KEEPASPECT; break; } + case SPACE_FILE: + { + SpaceFile *sfile= (SpaceFile *)sl; + ar->v2d.tot.xmin = ar->v2d.tot.ymin = 0; + ar->v2d.tot.xmax = ar->winx; + ar->v2d.tot.ymax = ar->winy; + ar->v2d.cur = ar->v2d.tot; + ar->regiontype= RGN_TYPE_WINDOW; + ar->v2d.scroll = (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM_O); + ar->v2d.align = (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_POS_Y); + ar->v2d.keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPZOOM|V2D_KEEPASPECT); + break; + } //case SPACE_XXX: // FIXME... add other ones // memcpy(&ar->v2d, &((SpaceXxx *)sl)->v2d, sizeof(View2D)); // break; @@ -8454,7 +8479,7 @@ for(ma= main->mat.first; ma; ma= ma->id.next) { if(ma->nodetree && strlen(ma->nodetree->id.name)==0) strcpy(ma->nodetree->id.name, "NTShader Nodetree"); - } + } /* and composit trees */ for(sce= main->scene.first; sce; sce= sce->id.next) { if(sce->nodetree && strlen(sce->nodetree->id.name)==0) @@ -9601,14 +9626,7 @@ } /* append to scene */ -/* dir is a full path */ -void BLO_library_append(SpaceFile *sfile, char *dir, int idcode, Main *mainvar, Scene *scene, ReportList *reports) -{ - BLO_library_append_(&sfile->libfiledata, sfile->filelist, sfile->totfile, - dir, sfile->file, sfile->flag, idcode, mainvar, scene, reports); -} - -void BLO_library_append_(BlendHandle** bh, struct direntry* filelist, int totfile, +void BLO_library_append(BlendHandle** bh, struct direntry* filelist, int totfile, char *dir, char* file, short flag, int idcode, Main *mainvar, Scene *scene, ReportList *reports) { FileData *fd= (FileData*)(*bh); Copied: branches/blender2.5/blender/source/blender/editors/datafiles/prvicons.c (from rev 17996, trunk/blender/source/blender/src/prvicons.c) =================================================================== --- branches/blender2.5/blender/source/blender/editors/datafiles/prvicons.c (rev 0) +++ branches/blender2.5/blender/source/blender/editors/datafiles/prvicons.c 2009-01-06 14:42:54 UTC (rev 18366) @@ -0,0 +1,436 @@ +/* DataToC output of file <prvicons> */ + +int datatoc_prvicons_size= 13732; +char datatoc_prvicons[]= { +137, 80, 78, 71, + 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0,192, 0, 0, 0,192, 8, 6, 0, 0, 0, 82,220,108, 7, 0, 0, 0, + 6, 98, 75, 71, 68, 0, 0, 0, 0, 0, 0,249, 67,187,127, 0, 0, 0, 9,112, 72, 89,115, 0, 0, 11, 19, 0, 0, 11, 19, 1, + 0,154,156, 24, 0, 0, 0, 7,116, 73, 77, 69, 7,215, 8, 27, 17, 57, 33, 43,142, 73,203, 0, 0, 0, 29,116, 69, 88,116, 67, +111,109,109,101,110,116, 0, 67,114,101, 97,116,101,100, 32,119,105,116,104, 32, 84,104,101, 32, 71, 73, 77, 80,239,100, 37,110, + 0, 0, 32, 0, 73, 68, 65, 84,120,218,237,125,121,124, 84,213,249,254,115,238,189, 51,147,201,158, 12, 73, 72,216, 3,200, 98, + 88, 69, 66, 38, 65, 16, 20,165, 40,213,162, 32, 45,138,203, 79,176,223, 42,180,110, 72,235,190, 97, 91, 91, 21,181,149,182, 90, + 20, 42, 10, 66, 80,164, 34, 59,146, 5,194, 30, 18, 8, 75, 2,201,144,144,201, 62, 73,102,189,247,158,243,251, 35,235, 36, 51, +217,200,100, 38,229, 62,159,207,124,146,123,239,153, 59,207, 61,247,125,207,121,223,247,156,243, 30, 64,129, 2, 5, 10, 20, 40, + 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, + 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80, +160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, + 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, + 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,208, 18, 36, 41, 41,105, +180, 32, 8,143, 16, 66, 72,119,223,156, 49, 22, 46,203,242,112,198,216,203, 41, 41, 41,251, 60,241, 0,189,157,191, 2,239, 43, +192, 61, 49, 49, 49, 27,230,204,153,227,215,157, 55,206,206,206,198,169, 83,167, 16, 25, 25, 9,131,193, 64, 37, 73,154,150,146, +146,146,226, 1, 5,232,213,252, 21,120, 23, 2, 0, 68, 71, 71,219, 23, 46, 92,216,109, 2,180,105,211, 38, 24, 12, 6, 60,250, +232,163,224, 56, 14, 7, 15, 30,228, 50, 51, 51, 15, 36, 38, 38, 38,164,166,166,102,116,247, 67,244,118,254, 10,188, 7,174,187, +111, 40, 73, 18,214,175, 95,143, 5, 11, 22,160,111,223,190,240,247,247, 71, 98, 98, 34,226,226,226, 56,149, 74,149,174,215,235, + 39,250,114,133,244,118,254, 10,188,172, 0, 6,131, 1,193,193,193,136,136,136,128, 32, 8,208,106,181,208,106,181,208,235,245, + 24, 57,114, 36,167, 86,171, 51,244,122,125,156,175, 86, 72,111,231,175,192,203, 10, 80, 88, 88, 8,157, 78,215,120,172,209,104, + 26,133, 40, 49, 49, 17,195,135, 15,231,213,106,245,137,132,132,132, 27,124,177, 66,122, 59,127, 5, 94, 86,128,192,192, 64, 88, +173, 86,167,115,254,254,254,141,159,164,164, 36,196,198,198, 10,126,126,126, 89,122,189, 62,214,215, 42,164,183,243, 87,224,101, + 5,208,233,116, 48,153, 76,173,206, 55,180,162, 90,173, 22, 73, 73, 73, 24, 56,112,160, 74,163,209,156,213,235,245, 3,124,169, + 66,122, 59,127, 5,157,131,208,221, 55,140,138,138, 66, 77, 77, 13,172, 86, 43,180, 90, 45, 0,160,170,170, 10,165,165,165, 40, + 47, 47, 71,105,105, 41, 44, 22, 11, 6, 15, 30, 12, 81, 20,213, 87,175, 94, 61,175,215,235,135,164,165,165, 21,251, 66,133,244, +118,254, 10,188,172, 0,106,181, 26,227,199,143, 71, 78, 78, 14,116, 58, 29, 14, 28, 56,128,130,130, 2,196,198,198, 34, 42, 42, + 10, 67,135, 14, 5,207,243, 72, 77, 77,133,209,104,132, 40,138,126, 26,141, 38, 79,175,215, 15, 74, 75, 75, 43,245,118,133,244, +118,254, 10,188,172, 0, 0, 48,109,218, 52,124,250,233,167, 16, 69, 17,143, 63,254, 56,102,206,156, 9,181, 90,237, 84,102,209, +162, 69, 48,153, 76, 88,183,110, 29,182,108,217,162,165,148,190, 9,224, 9, 0,204,219,149,210,219,249, 43,240,162, 15, 0, 0, + 9, 9, 9, 8, 12, 12,196, 71, 31,125,132,217,179,103,183, 18,158, 6,132,132,132,224,201, 39,159,132, 70,163, 97, 86,171,117, @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs