diff options
Diffstat (limited to 'source/blender')
23 files changed, 1968 insertions, 117 deletions
diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h index a09c45d0399..4fafac29a6f 100644 --- a/source/blender/blenloader/BLO_readfile.h +++ b/source/blender/blenloader/BLO_readfile.h @@ -200,8 +200,7 @@ BLO_blendhandle_close( 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); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 821da5a09f8..490e91fce15 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3942,11 +3942,11 @@ static void lib_link_screen(FileData *fd, Main *main) 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 @@ void lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *curscene) //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 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) 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 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) 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 @@ static void do_versions(FileData *fd, Library *lib, Main *main) 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 @@ void BLO_script_library_append(BlendHandle **bh, char *dir, char *name, } /* 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); diff --git a/source/blender/editors/datafiles/prvicons.c b/source/blender/editors/datafiles/prvicons.c new file mode 100644 index 00000000000..6222090705a --- /dev/null +++ b/source/blender/editors/datafiles/prvicons.c @@ -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, +108,104,104,104,127, 0,196,219,149,210,219,249, 43,240,178, 2, 4, 5, 5, 97,205,154, 53,136,137,137,233, 80,249, 33, 67,134, + 72, 86,171,213,204,243,252,253,190, 32, 64,189,157,191, 2, 47, 43, 0, 0, 8, 66,199,173, 43, 63, 63, 63, 70, 41,149, 24, 99, + 26, 95, 17,160,222,206, 95,129,151, 21,160,139,144,123,121,125,202,138, 72, 41, 10,208, 37, 16, 66,100, 66, 72,175, 21,160,222, +206,255,122,133,208, 19, 63, 98,178,216,193, 24,131, 74,224, 17,160, 81,185,109, 61, 25, 99, 50,122,111, 20,165,183,243, 87, 20, +192, 19,200, 45,174,194,152,103, 62, 5, 0, 68,135, 5,226,252,234, 37,224,185,122, 51,153, 81, 56,142,252, 11,183, 71, 92,225, + 39,223, 22, 56, 50, 88,173,213,234, 99,111,136,134, 64,254, 25,249,155,244,139,158,230,166, 82,185, 85, 70,136,162,216,217, 30, +128, 2,160,138, 15,160, 40,128, 19, 62, 63,112,186,241,255,171,149,181,248,241,100, 30,126, 54,113, 40, 0,128,154,174,192,126, +124, 61,146,194,192, 35, 76, 51, 28,192,112, 0,183, 17,137,255,216,155,194,223,145,235, 45,148,132, 1,104, 48,129,148, 30, 64, +241, 1,234,109, 2,202,240,159,159,178,157,206,125,113, 32,171,241,127, 90,118,190,213,119, 24, 80, 30,190, 60,165,192,155,194, +223,197,251, 80,197, 9, 86, 20,192, 9, 59, 79, 93,194,213, 42, 51,180,234,166,142,230,135, 19,121, 40,173,182,212, 41, 72,217, + 5,184,208,128, 19,189,169, 2,155, 41, 1,173,247, 1, 20, 40, 10,224,220,218,191,255,240, 76, 52, 44, 89, 23,101,138, 13, 41, +103,234, 36,166,212,101, 15,112,220,215, 43, 77, 20, 69,167, 15, 0, 13,165, 20, 0,244, 0,120, 69,172, 20, 5, 64,105,181, 5, +255, 61,158,139, 65, 17, 33, 88,116, 75, 28,102,196, 13,106,230, 23,100,213,247, 0, 46, 20,128,178,227,189,173, 18, 25, 99, 0, + 16, 7,160, 76,241, 1, 20, 39, 24, 0,176, 33,229, 12, 68,153,226,161,105, 55,130, 16,224,161,105, 99,176,231,116, 62, 0,224, +236,149,114,100,100,102, 97,148,189,166,213,247,204,140,157, 0,128,146,143,167, 7,242,212, 54, 7,192, 72, 70,137,131,227,113, + 90,148,232,145,168,223, 30, 54,250,168, 2,252, 4,160, 90, 17, 41,165, 7,104,108,229, 57, 66,240,224,180,186,229,179,115, 39, + 13, 67, 88, 64, 83,226,134,181,123, 91,155,250,162,204, 44,187,114,228, 75,229,171,227,159,225,101, 91, 49, 24,190, 2,195,171, +132,176,183, 25,101,219, 4,142,228, 85,172, 78, 88,234,139, 21,233,112, 56,202, 25, 99,134,122,103, 88,193,245,172, 0, 71,115, +139,113,246, 74, 57,102,142, 25,132,254,225, 65, 0, 0,141,138,199,130,196, 81,141,101, 54,159, 42,133, 85,118, 54,151,171,172, +180,224, 23,113,170,117, 0,121, 23, 64,128,139, 91,251, 51,176, 79,202, 62, 72, 88,229,131,117, 25, 98,179,217,250,195,247,166, +151, 40,232,105, 5, 88,187,191, 46,246,191,120,250, 24,167,243, 15, 79,111, 74,166, 80,227, 96,216, 86,230, 60,219, 82, 23,192, + 15, 35,192,130,246,238, 79, 8,123,166,236,189, 41,163,188, 85,105, 42,149,170, 85, 40,149, 16, 2, 74,169, 77, 81,128,235, 92, + 1, 44,118, 17,223,164,159,131, 46, 72,139,187,110, 26,234,116,109,236,160, 72,140, 27, 28,217,228, 39, 24, 7, 57,147, 33, 16, + 24, 96, 7,240, 79, 2,242, 75, 2,242, 75, 6, 28,112, 37,131,132,195,115,222,170,180,102,209,159, 70,225,231, 56, 14, 42,149, +234, 40,234,162, 64,202,104,240,245,170, 0, 91,143, 92, 64,181,213,142, 7, 18, 71, 65, 45,180,142, 8, 62,220,172, 87, 72,175, + 14,199,101, 91,147,165, 67, 41,236,162,204,238,214, 45, 59,180, 36,124, 89,250,134,240,101,233, 27,116, 21,126,183, 1,200,105, +221, 13,224,198,107, 17, 96, 15, 33,166,222, 7, 96, 0, 84,138,120, 93,135, 10,208, 16,251, 95, 60,205,117,238,168,249,250,145, +240, 19,184,250,232, 9,193,134,226,129,141,215, 14, 92, 52,255, 43,250,119,135,247, 56,201,249,171,251, 37, 66, 88,178,139,216, +139, 79,229,229,169,207,205, 43,212,127, 72,125,221,106, 20, 17,187,142, 20,224, 82,137, 9, 7,207, 26, 48, 49, 54, 10,113, 3, + 35, 92,150, 9, 11,240,195, 93,195,154,150, 24,126,109, 28, 8,153, 17, 88, 37, 88, 95,218,102,220,233, 70,188,170, 92,156,243, +243,149, 74,164,148,130, 82, 10, 73,146, 56, 0, 13,221,139, 31,234,204, 57, 5, 62,140,110, 29, 7,248,226, 64, 22, 24, 3,146, + 70, 14, 64,102,126,137,219,114, 19,131, 42,241, 13,234, 82,142, 92,117,248, 97,127,101, 36, 2,107, 11, 47, 24,107, 36,171,171, +242,140,161,159,139,211, 62,149,129,161,190, 7, 16,209, 52, 16,102, 82,196,235, 58, 82, 0,202, 24,214,255, 84,103,254,172,254, +239, 81,172,254,239,209, 54, 74,107,157,142, 54, 24, 7,226, 94,114,165,202,221,130, 18, 2, 50,136,181, 30, 96,205,242, 86,165, + 53, 68,128,154,251, 18,140, 49,112, 28, 39,214,215,169,168,136,214,117,166, 0,187, 78, 93, 70, 97, 69, 45,166,142, 26,128,219, +199, 14,118, 95, 80,118,192,126,116, 45, 14,155,194,177,187, 50, 10, 0,240, 99,121, 95,220,168,209, 88, 40,165,173,166, 19,151, +175,142, 15,102, 96,183,182,234, 21, 0,175,231,234, 87,169, 84, 78, 74,192,113,156, 67, 49,123,174, 83, 5,104,112,126, 95,186, + 79,143,164,145,253,221,150,147,138, 78,192,106, 60,143,139,186, 64,236, 62, 86,167, 0, 14,198,225, 44, 63,108, 24, 33, 57,178, + 11,211,226, 9,198, 16,220,178,195,225,101,124,233, 11, 21,216,208, 27,168, 84, 42,155, 90,173,110,112,128, 21, 92, 79, 78,112, +121,141, 21,219,143,231, 98, 72,100, 8, 18, 71,244,111,219, 84,170,159, 1, 58,204,191, 22, 55, 7, 87, 52,158, 63, 45,247, 31, + 76,235,167, 84, 54,160,236,195,201, 51, 24,195, 75, 46,140,162, 45, 97,191, 59,116,217,135,236,255, 82, 65, 16,120, 40, 19,225, +174,207, 30,224,171,212,179,112, 72, 50, 22,221,114, 35,218,219,169,171,249, 26,128, 95, 70,229,227, 72,117, 56, 0, 32,207, 22, + 36,124,241,127,250, 79,110,139,170,120,141,112, 40,231, 25,110,167, 12,207,160,117, 40,209,194,113,228, 89, 95,170, 68,158,231, + 3,120,158,175, 97,140, 29,135, 50, 23,232,250,235, 1,214,238, 63, 13,142, 16, 44,186,165,253,125, 35,154,175, 2,251,121, 68, + 33,252, 57,169,241,120,111,109,255, 49, 60,193, 55, 28,195, 62, 6,252,158,180, 22,126, 10, 66, 30, 14,123, 50, 45,223,199,234, +145, 17, 66,168, 39, 54,234, 83,224,163, 61, 64, 65, 89, 53,118,158,186,132,242, 26, 43,178, 13,101,232, 23, 30,136, 31, 79,230, + 1, 0,126, 54,113, 40, 98,194, 2, 91, 75,137,100, 3,173, 42, 64,165,164,198,119,165,117,243,128, 6,105, 45, 56,107,174, 51, +241,183,148,246,199,232,128,186, 25,197,183,134,149, 96,160,159,197,201,125, 32,192,178,240,167,210, 55,249, 82, 5,138,162,216, + 16, 2,149, 91,154,112, 10,254,135, 21, 32,203, 80,134,101,159,237,110, 60, 46,172,168,109, 60, 30,214, 55,204,165, 2,208,242, + 92,128, 81, 20,219,253,240,252,197,113,173,174, 87, 75,170,198,243,159,141,202,104,174, 0, 57,132,224,255,133, 63,117, 40,181, + 59, 5,247, 90,215, 6, 55, 68,128, 24, 99,168,239, 1, 20, 5,184, 94, 20, 32,126, 88, 52,118,252, 97,190,203,107, 99, 7,185, + 30, 5,230,130,251, 65, 59,247, 3,140,112,200,216, 62,185,166,222,129,228,177,230,235, 31,109,135,207,228,173, 11, 12,208,156, +126,112, 28, 25, 30,161,178, 15, 25, 27,100,178, 1,200, 97,132,238,235,243, 84,198, 94, 79,181,222,157, 77,141, 34, 73, 82,171, +180,137,132, 16, 48,198,168, 44,203, 65,138, 72, 93, 39, 10,160, 11,210,226,150,209,157,219, 28,133,104, 67, 33,104, 39, 32, 4, +192,173,131,155,206,127,191,245, 59, 57,220,116,225, 66,126,102,254,174, 63,236, 48,125,212,147,209,148,206, 78,140,115,151, 51, + 84,201, 12,119, 29, 59,193,221,132,222, 46, 64,138, 2,244,214, 30,192,100, 50, 9, 25, 25,222,219,255,217,100, 50,241,132, 16, + 42,203,178,220,197,239,247,106,254, 10,188,171, 0,198,226,226,226, 83,171, 86,173,226,237,118,123, 52, 99, 76,141,186,176, 30, +234, 77, 17,214,204, 36, 97,132,144,198,255, 91, 94,115,119,189,197,189, 90,150,101,178, 44,203,146, 36,149,212, 59,145,157, 53, +127,122, 59,127, 5, 94, 68,243,184, 53,167,211,233,150, 3,232,139,166, 44,103, 50, 99, 76, 34,132,200,140, 49,153, 16, 34, 53, + 59, 71,155, 93,107, 56, 47, 19, 66,164,250, 4, 81,114,195, 53, 66,136, 76, 41,149, 90, 28,203, 13,118, 51,165, 84,146,101, 89, + 98,140, 89,204,102,243,149,174,154,115,189,156,191, 2, 47, 43, 0, 9, 12, 12,140,230, 56, 78, 77, 8, 97,245, 19,189, 26, 91, +185,134, 86,176,249,113,125,232,143, 1,128,195,225,112,106, 65, 9, 33,172,217,167,161, 44, 44, 22,139,211, 61, 56,142, 99,132, + 16, 86, 89, 89,201,234,133,182,171, 51, 41,123, 59,127, 5, 94, 86, 0, 87,199, 29, 5,243,209,231,233,109,252, 21,244,180,192, + 36, 37, 37,141, 22, 4,225, 17, 79, 12,227, 51,198,194,101, 89, 30,206, 24,123, 57, 37, 37,101,159, 39, 30, 64,225,175,240,191, + 86, 5,184, 39, 38, 38,102,195,156, 57,115,186,117,137, 97,118,118, 54, 78,157, 58,133,200,200, 72, 24, 12, 6, 42, 73,210,180, +148,148,148, 20, 15,188, 0,133,191,194,255,154,162, 64,136,142,142,182, 47, 92,184,176,219, 30, 96,211,166, 77, 48, 24, 12,120, +244,209, 71,193,113, 28, 14, 30, 60,200,101,102,102, 30, 72, 76, 76, 76, 72, 77, 77,237,246,120,165,194, 95,225,223, 85,116,251, + 64,152, 36, 73, 88,191,126, 61, 22, 44, 88,128,190,125,251,194,223,223, 31,137,137,137,136,139,139,227, 84, 42, 85,186, 94,175, +159,232,203, 54,161,194,255,250,226,223,237, 10, 96, 48, 24, 16, 28, 28,140,136,136, 8, 8,130, 0,173, 86, 11,173, 86, 11,189, + 94,143,145, 35, 71,114,106,181, 58, 67,175,215,199,249,234, 11, 80,248, 95, 95,252,187, 93, 1, 10, 11, 11,161,211,233, 26,143, + 53, 26, 77,227, 67, 36, 38, 38, 98,248,240,225,188, 90,173, 62,145,144,144,112,131, 47,190, 0,133,255,245,197,191,219, 21, 32, + 48, 48, 16, 86,171,115,118, 19,127,127,255,198, 79, 82, 82, 18, 98, 99, 99, 5, 63, 63,191, 44,189, 94, 31,235,107, 47, 64,225, +127,125,241,239,118, 5,208,233,116, 48,153, 90,167,196,105,208, 98,173, 86,139,164,164, 36, 12, 28, 56, 80,165,209,104,206,234, +245,250, 1,190,244, 2, 20,254,215, 23,255,110,223, 32, 35, 42, 42, 10, 53, 53, 53,176, 90,173,208,106,235,242,255, 84, 85, 85, +161,180,180, 20,229,229,229, 40, 45, 45,133,197, 98,193,224,193,131, 33,138,162,250,234,213,171,231,245,122,253,144,180,180,180, + 98, 95,120, 1, 10,255,235,139,127,183, 43,128, 90,173,198,248,241,227,145,147,147, 3,157, 78,135, 3, 7, 14,160,160,160, 0, +177,177,177,136,138,138,194,208,161, 67,193,243, 60, 82, 83, 83, 97, 52, 26, 33,138,162,159, 70,163,201,211,235,245,131,210,210, +210,188,158,237, 77,225,127,125,241,247,200, 22, 73,211,166, 77,195,167,159,126, 10, 81, 20,241,248,227,143, 99,230,204,153, 80, +171,213, 78,101, 22, 45, 90, 4,147,201,132,117,235,214, 97,203,150, 45, 90, 74,233,155, 0,158,128, 15, 76, 75, 80,248, 95, 63, +252, 61,178, 32, 38, 33, 33, 1,129,129,129,248,232,163,143, 48,123,246,108,183,171,168, 66, 66, 66,240,228,147, 79, 66,163,209, + 48,171,213, 58, 54, 52, 52,180, 63,124, 32,177, 84, 75,254, 45, 43, 95,225,255,191,195,223, 35, 10, 16, 20, 20,132, 53,107,214, + 32, 38, 38, 6,207, 62,251, 44,102,204,152, 1,135,195,225,182,252,144, 33, 67, 36,171,213,106,230,121,254,126, 95,120, 1,205, +249,119, 4,189,141,191,217, 46,225, 82,105, 45,142, 95,174,192,190, 51,197,136,136,155, 70, 73,212, 40,191,136,184,169,207,196, +175,248, 79,191,235,169,254, 61,182, 75,164, 32, 8,248,252,243,207,177,122,245,106, 0, 64,114,114, 50, 22, 44,112,189,251,145, +159,159, 31,163,148, 74,140, 49, 13,124, 36,181,160,187, 94,171, 55,243, 63,122,169, 2,155, 50, 12,200, 41, 50,129,202, 82, 99, + 90,119, 22, 54,158, 15,157, 50,118,124, 8,165,227, 41,149,151, 37,190,240,245, 22,202,196,215,210,255,184,232,244,255,122,253, + 11,158,124,136, 63,252,225, 15, 0,128,216,216, 88,124,241,197, 23,110, 21,160, 25,122,251,146, 66,159,229,127,185,204,140, 55, +191,205,134,192, 1, 49, 33, 26, 20,148,137, 96,148,130,177, 86, 31, 2, 70,231,129,146, 95, 76,126,118,253,188,140,119, 23, 37, +119,250,189,111,248, 9, 89, 5,158,245,167,191,121,246, 94,168,120,238,154,235,223, 99, 10, 80, 84, 84,132,146,146, 18,188,249, +230,155,120,238,185,231,176,120,241,226, 54,203,247,246,172, 10,190,206,255, 68,126, 37, 24,163,120,235,254, 9, 24, 17, 29,140, + 63,109, 59,141,189, 89, 69, 96, 13,189, 64,227, 95,214,112, 76, 64,233, 59, 0, 58,173, 0,207,220, 61, 25, 14,201,179, 85,209, + 82,248,187, 90,255, 30, 83,128,236,236,108, 68, 68, 68,224,217,103,159, 5, 33, 4,185,185,185, 46,115,234, 52,215,222,250,165, +136,189,117,113,138, 79,243, 63, 83,104, 2,165, 20, 2, 87,103, 33,168, 56, 82,215, 3,180,248,180, 80,130, 27,110, 90,178,198, +255,216, 63,150, 90, 58,243, 91, 57,133,229, 40,175,181, 94, 51,103,209, 97,119,235, 59,206, 26, 59, 24, 92,253, 18, 4,187,221, + 14, 89,150, 57, 89,150,213, 0, 66,208,118,126,214,234,230,215, 59,164, 0,159,237,205,196,165,146,206,109,120,146,157,150,138, +232, 81,147,240,202,198, 84, 72, 14, 59,206,156,191,136, 87,190, 78, 1,199,183,222, 56,239, 80, 77, 8, 95, 54,112,234, 72,235, + 0,149, 86, 8, 31, 20, 13,144,118,133, 72, 82,227,143,248,114,101,165, 15,245, 0,180,190, 98,125, 50, 63,168, 67,148,193, 40, +195,138, 47,143,162, 95,152, 22, 57,133,149,117, 2,207, 24, 24,163,160,204,165, 57, 4,217, 95,173, 6,208, 41, 5,200, 51, 86, + 33,191,172,250,154, 57,239, 92,247, 49,210,183,111,236, 72, 81, 53,128, 59,235, 63,111,183, 83,246, 70, 0,103, 58,165, 0,250, + 17,253,220,238,249,229, 14, 17, 86, 3,138,250,248,225,238, 73,195,240,233, 71,239, 33,208,223, 31, 63,143, 31,225,186,194, 82, +183,211, 98, 83,126,161,228, 96,167,164,240,129,223, 18,158,111, 63,197, 96,165,214,210, 93,194, 65,171, 12,224, 66, 59, 54,162, +110, 50,153, 96,179,217, 16, 21, 21,213,252, 52, 67, 83, 94, 32, 31,237,193,234, 4,221,108,151,113,174,200,214, 36,244,148,130, + 82,230,214, 20, 2,215,249, 64,225,162, 91,110,236, 22,198,166, 67,201, 72,175,139,242, 32, 34,194,181,252,157, 57,115, 6,181, +181,181, 13,141, 80, 25, 99, 44,215,205,237, 70, 1,173,246,153,232,152, 2,140,236,167,235,188, 61, 80, 58, 4, 63, 92,202, 65, +148,202,129, 13,159,125,130, 25, 51,102, 96,242,176,104,151,101,163, 84, 14,234, 95,109, 40,179,150,151, 95,172,201,220,123, 8, + 61,156, 98,220,113, 98, 61,184,136, 17, 80,199,253,162,221,178, 85, 85, 85,152, 59,119, 46,118,239,222,221,242,165, 80, 95,115, +130, 25, 99, 16,229, 58,125, 92,126,199, 72,136,242, 8,103,253,100,117,255, 63,248,167,173,204, 14,129,184, 50,133, 0,128, 93, +125,186, 97,177,139, 68,162,255, 42,181,247,187,203,255,189, 27, 39, 47,151, 92,187,227,158, 86,183, 59, 46, 55,106, 6,248,113, + 83,157,174,237,122,105, 1,212, 2,143,105,211,166, 33, 61, 61, 29, 0,160,209,104,126,176,217,108, 15,187,145,159, 61, 0,102, +244,152, 15, 48, 96,192, 0, 28, 59,118, 12,219,183,111,135,205,102,195,252,249,243,219,109,136,235,109,104,175,180,142,246,148, + 15, 64, 56, 30,170,209, 63,111,183,244,217,179,103,113,199, 29,119, 96,231,206,157,232,211,167,143, 15,240,119,150,233,140,188, + 10,164,158, 47, 65, 70, 94, 57,204, 86, 7, 40,149, 91,181,240, 78,231,160, 34, 13, 38, 80, 75, 83,232,181,159, 93,137, 4,112, +174,241, 25,175,254,238, 44,152,188,140,196,172,118,155,175,245,131, 71,110,235,150,103,121,222,122, 18,239,103,236,192,138,123, +226,241,240,195,191,236,136,194,119,186,225,236,144, 2, 56, 36, 25,148,117,174,103, 55,219,108,216,187,119, 47,100, 89, 70,100, +100, 36,102,205,254, 25,108,162,228, 38,118, 72, 64,121, 1,208,104, 57,220,189,212, 15,186,232,246, 31,100,237, 43,246,142,248, + 10,157, 81, 2,219, 79,127, 5, 8, 15,213,168,187,218, 45,157,149,149,133, 59,239,188, 19, 59,119, 54,238,236,234, 19, 81,160, + 79,246,229,226,199,204,162, 38, 97,111, 33,216, 77, 2,206,156,237,125, 23,166, 80,235, 42,162, 28,152,116, 35,152,252, 29, 51, + 44, 25, 72, 6,252,163,194, 21,135,175,211,114, 96,232, 6, 31,224,104,110,221,252,182, 31, 79, 94, 66,217,119,206, 43, 33,127, +119,215,205,224,185, 86,238,150,103, 20,224,181, 77,169,157,138,235, 58,204,213, 72, 91,243, 18, 26, 50, 5, 14,152,181, 24,143, +253, 99,143,251, 22,181, 50, 92, 85, 26, 59,123,170, 72, 84,163, 4, 77,240, 47, 96,110,223,142,150, 22,190,189, 24, 27, 96,236, +238,158,192,118,224,207, 0,199, 67, 53, 98,118,187,165, 51, 51, 51, 49,123,246,108, 76,154, 52, 9,245,137,182,188,170, 0, 57, + 87,107,240,227,233,171,237, 10,182,187,191,172,222,236,113, 45,252, 18,192,228,186, 15,149, 2,192,228,223, 0,120,195,165, 73, + 27,226,223, 24,161,185, 22,204,152, 53, 27, 67, 6, 13, 68,220,164,201,232, 31, 17,210, 34,232,224,218,138,104,227,118, 31, 3, +216, 6,160,184,211, 10,240,214,194, 91, 58, 69,124,225,194,133,176, 86,214,217,128, 43, 86,172,192, 27,111,188,209,102,249,167, +159,126,218,177,235,232,174, 93,165,165,165,187, 42, 42, 42,190,132, 87,183, 25, 98,176,237,255, 35, 8,199, 67, 24, 62,171,221, +210, 39, 78,156, 64, 97, 97,161, 42, 40, 40,136,247,182, 15,176,247,140,177, 93,193,102, 45,206, 57,149,173,239, 33,154,161,118, +214,232,138, 64, 48, 9,160,178,179, 18, 48,233,255,220, 41,192,164,161,125, 33,201,215,254, 10,111, 31, 59, 8,192,189, 46,175, +185, 81,176,182, 26,206, 45, 93,238, 1, 58,131, 77,155, 54, 97,243,230,205, 0,128,233,211,167, 99,220,184,113, 29, 14, 35,250, +130, 13, 93,223,213,195,186,247,109,104, 9, 15, 97,216,204,118,139,151,148,148,112, 85, 85, 85, 51,181, 90,237, 78,111,210, 46, + 40, 51,183, 22,108, 39,211,135,181,109, 10, 81,218,232, 24,215,139,211, 14, 63, 34,198,131,214, 11,190,179, 18,244,101,185,247, + 69, 76, 93, 92,236,210, 98,200,204,247,236, 72,240,182, 23,230, 65, 45,240, 61,227, 3,116, 20, 70,163, 17,203,150, 45, 3, 0, + 60,245,212, 83, 88,190,124, 57,222,127,255,125,220,119,223,125,237, 9,191,207,216,208, 78, 74,176,231, 13,104, 57, 30, 66,236, +244,246,205, 62,135, 35, 66,146,164, 21, 0, 54,163,110,176,165,199, 81,108,178,180, 22,236, 86,145,157, 54, 76, 32,103, 63,239, +220,188,201,149,175,129,138, 59,235, 91,252,230, 38, 80,195,255,195, 93,241,248,243,131,183,122,235,173,121, 70, 1, 58, 58, 16, +182,229,253,151, 80, 94, 94,142,126,195,227,224, 55,241,110,124,188,247, 44, 54,126,247, 3, 28, 3, 39, 35,172,175,251, 73,134, +233, 53,193, 66,241,128, 91, 38, 89, 7,106,116, 66,112,244, 77, 62, 51, 16,198, 40,172,187, 95,131,246,118, 30,194,144,169,237, +215, 62,165, 35,234,237,204,159, 1, 48,247,228,155,183,139, 50,202,170,173,109, 10, 56, 24,197,168,126, 97, 24, 30, 19, 10,127, + 53, 95,175, 36, 12,187,247,236,145, 10,140,101,217, 18,175,189,164, 14, 31,144, 77,128,172,111,127,115,246,252,128, 80,219, 23, + 96, 82,180,139,214, 31,245,102,209, 48, 87,202,254,238,119, 25, 56, 95, 84,225,209,231,253,248,241, 89,174,230, 2,121, 70, 1, +166,223, 56, 16,147,134, 58,218,142,138,156, 58,129, 11,199,211,160,235, 19,129,127,253,123, 45, 34,162,250,226,245,149,207,162, +164, 32, 23,255,120,254, 33, 68,247,235,143, 71,150, 62,137, 95, 44, 92,212,186,235, 78,219, 78, 75,170, 46, 94,144,236, 72,167, +129,186,253,224, 85,237, 63,136, 40,246,140,128, 81, 25,214, 93,175, 64,123,199, 27, 16, 6, 37,118,228, 27,183,212, 43,193, 28, + 0,214,158, 82, 0,158, 35, 0, 99,110,109,252,176, 64, 53,126, 63,111, 18,110, 30, 80, 14, 34, 93, 6, 88,211,134,246, 55,251, +149, 18,201, 94,174,234, 19, 74,252, 71, 13,171,138, 38,160,119,130, 74,227, 65,101,190,141,214, 31, 96, 82,128, 43, 5, 88,144, + 56, 10, 86,187,103,115, 4, 11,174, 7,232,152, 71, 20, 32, 54, 42,180,221, 50, 23,143,213,201,227,250,117, 95, 96,230,228,177, + 88,191,126, 61,190,251,230,171,198,235, 87, 11,175,224,237,151, 95,192,200,193, 49,120,224,129, 7,156,190,219, 71, 37,202, 1, +181, 87, 75,106,141,198,139,181,153,123, 79,194,215,246,218,165, 18,172, 59, 95,134,118,214,155, 0, 58, 52, 71,253, 86, 0,223, + 1,184, 27,128,173, 39, 40, 10, 60,135,240, 0, 21, 74, 76, 98, 43, 27,159,128,225,181, 7,166, 96, 92,216, 15,224,106,178, 90, +125, 87, 63, 30, 60, 88,232,104, 80,121,180,139, 86, 30,173,148,160, 73, 17,114, 80, 55,247,198, 9,102,155, 3,213, 86,199,255, +142, 9,212, 17,148,151,151, 35, 52, 52, 20, 51,103,214, 57,141,111,189,245, 22,198,141, 27,135,249,243,231, 35, 47, 47, 15, 35, + 71,142,196, 59,239,188,131, 23, 95,124,177,149, 2, 52,115, 96,124,119, 54,168, 44,194,150,242, 30,144,240,118, 71,191,113, 27, +128,135, 0,252,163,167, 40,246, 13,209,194, 88, 89,219,202,244,153,114, 67, 20,198, 70, 21,128,171,205,114,209,102,182, 16,112, + 87,166,142,203,243, 50, 64,165,179, 0,166,180,188,229,206, 83,151,112,161,216,179,214,233,196, 33, 81, 16,122,202, 4,170,181, + 57,218, 13,107,197, 12, 28,140, 81,163,111, 68,149,217,134,146, 18, 35,114,115,115,241,205,214,239, 16, 63, 37, 1,143, 62,180, + 8,171,222,125, 15, 34, 5,126,191,226, 57,100,229, 92, 64,255, 1, 77,115,111,236,148, 16, 89,229,175,146, 2,250,248,225,230, +135, 67,161, 13,110,255, 65,198,163, 26,175,190,218, 99, 61, 5,231,175,131,118,206,187, 40, 55,117,184,151,125,191, 39,133, 31, + 0,134, 68, 4,226,100, 94, 73,171,112,231,232, 1,225, 32,226,233,214,214, 66, 91,173, 60,117,161, 4,206,231,175,144,184,148, +226,164,164,164, 86, 60,150,253,108,146,119,226, 22,158,138, 2,253,101,219, 17,100, 27,218, 14,107,201, 14, 59, 78, 95,184,132, + 37,107,118,128,202, 18,180, 33, 58,124,145, 85,131,245, 57,251,144,117,165, 2, 75,214,236,128,100,139, 0, 39,168,240,252,231, + 59, 17, 24,209,228, 20,103, 85,135,169,138, 7,207,184,205, 65,212, 99, 4, 77,224, 67, 29,114,130, 79, 9, 75, 0,148,244,152, +240,207,253, 0, 92,232, 64,192,148,223, 81,225,255, 93, 79, 11,192,188,248,193,248,238, 72, 30,100,217, 57,220, 25,232,167, 2, +161,181, 78,206,125,199, 90,249,230,202,209,226, 26,240, 23,119, 60,126,253,207,157, 56,158,231,217, 44, 43, 7,223,248, 85,171, + 48,168,199,122,128, 87,238,239,144,243,135,249,199, 55,227, 47,247,223,132, 1, 3, 6,224, 29,249, 34,180,154, 34, 44, 95,190, + 28,203,243,247,225,165,135,146,224,231,231,135, 81,127, 95,129,109,111, 62, 1,190,217,180,232,103,158, 57,232,216,115,108, 79, +178,209,104,252,161,188,188,124,191, 47,249, 0, 78,194,223, 49,124,224, 13,225, 7,128,200, 16, 45,102,143, 31,128,173,135,115, +157, 28, 96,231, 9,112,157,106,229, 91, 40,135,220,240,106, 74,219,234,221,254,254,248, 44,175,188,171,102,251,187,245,188, 15, + 0, 0,127,255,251,223,241,252,243,207,227,239,127,255, 59, 94,120,225, 5, 36, 39, 39, 67,146, 36,140, 27, 55, 14,199,143, 31, + 71,126,126, 62,238,184,227, 14, 39,225,111,230,189,203,148, 82,159,154, 78,220, 89,225,231,121,254, 27, 89,150,127,231, 77,206, +191,190, 35, 14,126, 42, 14, 7, 78, 27, 80, 92, 89, 11, 6, 82, 63,106, 74, 1, 38,186,108,229,101, 81, 6,152, 36, 19, 34, 83, + 14, 50,117,171, 4,117, 14,253, 81, 0,207,146,184, 84,183,211,209,119,158,186,132, 18,147,197,163,207,185, 48,105,116,171,185, + 64,245, 38, 16,243,154, 2,232,116, 58,188,248,226,139, 88,185,114, 37,238,186,235, 46,220,123,111,221, 48,246,152, 49, 99,240, +250,235,175,227,198, 27,111,196,154, 53,107,220,105, 47,245,165,129,176,206, 10,127, 80, 80,208, 17,149, 74,245, 65, 69, 69,133, + 87,121,171, 4, 14, 75,102,197, 97,201,172, 22, 9,148, 77,123, 1, 42,186, 52,117,254,181, 45,216,158,113,228,196,231,209, 97, +214,159, 94,249, 77,255,227, 42,158,177,102,189,193,121, 18,119,176, 83, 61,178, 40, 83,183, 19, 31,123,101, 20,232,147,157, 39, +144,107,172,234, 56,139,209,183,227,131,173, 7,241,202,223,214,163,232, 66, 54,170,203,141,144, 28,118,140,184,255,183,120,225, +203,159, 90,219,115,213, 33,234, 43, 3,111,157,105, 25,172, 29, 42,248,135,221,215,145, 69, 85, 18, 52,175, 99,211,211, 21,190, + 32,252,227,198,141,147, 36, 73,218, 89, 88, 88,232, 91,225,219, 22,161,220,186, 86,189,181,169,179,244,238, 18,205,210,187,162, +150,128,201, 75, 90,181,254, 96, 97, 0,170, 58,243, 83,115, 38, 14,245,150, 19,236, 25, 19,104,214,184, 33,168,181,117, 50,174, +123,155,243, 62, 6, 75, 23,221,143,135,166,141,113, 89,180,228,200,143, 82, 85,213,197,147,146,168, 74,113, 12,158,156, 5,194, +117,224, 65,170,107,125, 65,248,151, 45, 91, 6,198,152, 99,223,190,125, 62,190,168, 95,114,107, 2, 57, 69,129, 84,209,102, 16, +129,192,122,222,191,203,102, 88, 39,157,224,221, 47, 63,128, 32,173,218,119,123,128,142, 12,132,181,135, 49,163, 70, 96,236,160, + 72,151,215,250,168, 68, 57,168,182,176,168,186,176,240,172,249,232,182,147,222,242, 3,186, 34,252,239,190,251, 46,158,121,230, + 25,230,107, 38, 92,235,214,145, 7,105, 48,129,220,216,248,148,105,109, 92,236,218, 0, 16, 14,184,176,160, 22,142, 66,127, 0, +246, 78,251,130, 94,114,130,225,205,129,176,230, 56,113,226, 4,190,252,242, 75, 76,157, 58, 21,115,231,206, 5, 0, 12, 29, 58, + 20,178, 44,187,114,128, 27, 39,195,213, 59,193,232, 77,194,239, 43,252,219, 85, 0,213, 96,192,156,222,102,180,135, 48,137,135, + 92, 13,112, 26, 64,174, 38, 0, 78,146,184, 84,171,175, 61,203,246,237,219, 81, 88, 88, 8, 0, 40, 46,110,234,105, 40,165, 19, +209,148, 31,116, 63,128,156, 30, 87, 0, 74, 41,230,205,155,135, 43, 87,174,224,227,143, 63,198,241,227,199, 49,114,228, 72,132, +132,132,192,106,181, 34, 48, 48,208,149,237,230, 85, 39,152,248,247,233,178,240,251, 2,255, 14,189,151,192, 89,224, 44,135, 64, +172,103, 93,155, 64,160, 32,128, 10,231,127,110, 7, 56, 6, 38,137, 0,150,250,226,179,172, 94,189, 26,251,246,237,115, 37,123, +115, 80, 55, 7, 11, 0, 30,243,138, 2,212,214,214,226,202,149, 43,141,202,208,208,226, 23, 23, 23, 67, 20, 69,119, 17, 32, 48, +198,168,220,176,132,172,135,161,185,249, 49,128,227, 59, 84,182, 95,191,126, 78,194,239, 11,252, 59,166,229, 42, 72, 81,175,131, + 51,167,129,171, 88, 7, 98,191,220,220,209,109,214, 26,201,118, 64,126, 15,192,123, 36, 46,213,228,139,143,242,231, 63,255, 25, +149,149, 77, 83, 45,254,246,183,191,217, 14, 31, 62,188,174,180,180, 52, 77, 20,197,252,250, 7,202,233,200,189,186, 93, 1,130, +131,131,113,251,237,183, 35, 59, 59, 27,159,127,254, 57,134, 15, 31,142,140,140, 12, 24,141, 70,132,133,133,185,127, 63,222,204, +172,214, 65,225, 7,220,231,172,236, 29,153,237, 8,104, 64, 34,104, 64, 34, 32, 87,129, 56, 10, 64, 28, 6,108,217,188,209,158, +151,119,225,115,115,109,229, 87, 99,134, 9, 63,205,127,250,156, 79, 63,199,216,177, 99,157,142,183,109,219, 38,231,230,230, 94, + 48,155,205,135, 76, 38,211,185,206,248,144, 30,241, 1, 54,110,220,136,215, 94,123, 13,159,125,246, 25,190,255,254,123,232,116, + 58,124,240,193, 7,237,125,173, 87,167, 70,236,117,252,249, 80, 48,109, 40,152,118, 44, 82,206,236,147,246,239,207, 62, 87, 80, + 80,126,165,170,170,138, 94, 79,245, 47, 0,128,201,100, 18, 50, 50,186,119,255,228,150,171,192, 78,158, 60,233,182,172,201,100, +226, 9, 33, 93, 54, 33, 60,193,191,147,191,175,240,239,165,252, 5, 0,198,226,226,226, 83,171, 86,173,226,237,118,123, 52, 99, + 76, 13,128,213, 71, 54, 88,179, 15,234,207, 55,254,223,242,154,187,235, 45,238,213,178, 44,147,101, 89,150, 36,169,164, 62,189, + 96,103, 67,160, 10,127,133,127,151,249, 55, 31,114,229,116, 58,221,114, 0,125,209,148,229, 76,102,140, 73,132, 16,153, 49, 38, + 19, 66,164,102,231,104,179,107, 13,231,101, 66,136, 84,191,184, 93,110,184, 70, 8,145, 41,165, 82,139, 99,185,193,110,166,148, + 74,178, 44, 75,140, 49,139,217,108,190,210, 85, 75, 94,225,175,240,239, 44,255,230, 10, 64, 2, 3, 3,163, 57,142, 83, 19, 66, +152, 74,165,130, 40,138,141, 90,214,160,133,205,143,235, 67,127, 12, 0, 28, 14,135,147, 6, 19, 66, 88,179, 79, 67, 89, 88, 44, + 22,167,123,112, 28,199, 8, 33,172,178,178,146,213, 87, 90, 87,215,210, 41,252, 21,254,157,230, 79,218, 57,238, 40,124,101, 6, +167,194, 95,225,223, 35,132,187, 5, 73, 73, 73, 2,128,217, 28,199,221,247,211, 79, 63, 45,238,109, 97, 7,133, 63,144,148,148, + 52, 90, 16,132, 71, 8, 33,221, 46, 75,140,177,112, 89,150,135, 51,198, 94, 78, 73, 73,217,231,137, 58, 16,186,169, 34,251, 1, + 40, 79, 73, 73,177,117,176,252,120,181, 90,189,132, 49,246, 43,157, 78,199,149,149,149, 9, 0, 22,123, 81, 16, 20,254, 93,231, +127, 67,100,100,228,147,115,230,204,241,235,206,103,202,206,206,198,169, 83,167, 16, 25, 25, 9,131,193,176, 59, 41, 41,105, 90, + 74, 74, 74,138,207, 40, 64, 82, 82, 82, 8,128,121, 90,173,246,215, 14,135, 99,188, 32, 8, 59,146,146,146,230,166,164,164, 48, + 55,229, 35, 57,142,123, 80,173, 86,255,159, 32, 8, 81,241,241,241,154, 73,147, 38, 9, 90,173, 22,111,190,249,166,205, 11, 66, +163,240,239, 38,254,209,209,209,246,133, 11, 23,118,155, 2,108,218,180, 9, 6,131, 1,143, 62,250, 40, 56,142,195,193,131, 7, +185,204,204,204, 3,137,137,137, 9,169,169,169, 25, 94, 83,128,164,164, 36, 53,128,217,126,126,126, 75,101, 89,158, 62,108,216, + 48, 41, 62, 62, 62,104,232,208,161, 88,179,102,205,173, 37, 37, 37,239, 2,120,166, 69,249,185, 90,173,246, 73, 73,146,226,227, +226,226,104,124,124,188,255,224,193,131, 27, 38,144,193,106,181,246,164,208, 40,252,189,200,191, 35,144, 36, 9,235,215,175,199, +210,165, 75, 17, 22, 22,134,218,218, 90, 36, 38, 38,130, 82,202,101,101,101,165,235,245,250,155,211,210,210,142,247,152, 2, 36, + 37, 37, 17, 0, 73, 26,141,230, 49, 74,233,188,190,125,251,202, 83,166, 76, 9,137,139,139,131,159, 95,147,210, 63,246,216, 99, + 1,239,189,247,222, 19,183,220,114, 75, 14,165,244,148, 70,163, 89, 74, 41,157, 31, 19, 19, 67, 19, 18, 18,130,227,226,226,160, + 82,169,188, 97, 30, 40,252,189,200,191,179, 48, 24, 12, 8, 14, 14,110,220,124, 68,171,213, 66,150,101,232,245,122, 72,146,196, +229,228,228,100,232,245,250,241,105,105,105, 89, 30, 85,128,122,231,102, 49,199,113,143, 6, 6, 6,170,227,227,227, 3, 38, 76, +152,192,135,132,132,184, 44,239,239,239,143, 37, 75,150,248,175, 94,189,250, 35,173, 86,235,152, 50,101,138,118,226,196,137,124, +104,104,104,183, 85,206,244,233,211,251,216,237,118,154,158,158, 94,209, 1,193, 81,248,123,145,127, 87, 81, 88, 88, 8,157,174, +105, 71, 34,141, 70, 3, 89,150, 33,203, 50, 18, 19, 19, 33,203, 50,127,225,194,133, 19, 9, 9, 9, 55,166,167,167,159,239, 86, + 5, 72, 74, 74,138,225, 56,238, 87,106,181,122, 9,199,113, 49,147, 38, 77, 18,110,186,233, 38,117,223,190,125, 59,116,179,136, +136, 8,172, 92,185, 82,237,239,239,175,238,206, 74, 73, 76, 76, 28, 17, 16, 16,176,210,110,183,223, 86, 93, 93, 29,219,134,208, + 40,252,189,200,191, 59, 16, 24, 24,216,202, 44,243,247,247,111,220,212, 59, 41, 41, 9,178, 44, 11,151, 46, 93,202,210,235,245, + 35,211,210,210,242,186, 69, 1,146,146,146, 18, 4, 65,216, 59,102,204, 24,122,243,205, 55,251,199,198,198,162, 43,145, 45,127, +127,255,110,171,140,169, 83,167, 78, 11, 8, 8,120,153, 82,154, 16, 16, 16,160,150,101,249,163,236,236,108,135, 27,225, 81,248, +123,145,127,119, 65,167,211,193,100,106, 61, 11,187,193, 20,146,101,185, 65, 9, 84, 5, 5, 5,103,245,122,253,176,180,180, 52, +195, 53, 43,128,159,159,223,107,208,238,250,153, 0, 0, 20,252, 73, 68, 65, 84,119,222,121,167, 58, 33, 33,129,131, 23, 49,125, +250,116, 65,150,229,251,252,253,253, 95,241,247,247,239,255,224,131, 15, 6, 76,159, 62,157, 44, 88,176,192,102,177, 88, 62,114, +247, 61,133,191,119,249,119, 23,162,162,162, 80, 83, 83, 3,171,213, 10,173, 86, 11,160,110, 99,194,210,210, 82,148,151,151,163, +180,180, 20, 22,139, 5,131, 7, 15,134, 40,138,234,171, 87,175,158,215,235,245, 67,210,210,210,138,187,172, 0, 73, 73, 73, 35, + 1, 36, 77,154, 52,201,107,149, 31, 31, 31, 31,172,209,104,150, 8,130,176, 98,232,208,161,154,135, 30,122, 40,104,202,148, 41, + 32,132, 96,247,238,221, 16, 4,225, 84,122,122,250, 69, 55,173,167,194,223,139,252,187, 19,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,237,146, 2,104, 52,154,151,166, 78,157,170,242, 70,148,160,186,186, 26, 28, +199,169, 2, 3, 3,139, 38, 79,158,140, 95,253,234, 87, 1, 55,220,112,131, 83,153,111,190,249,166,166,182,182,246,207,238,238, +161,240,119,195,205, 38,225,167,139,165, 40,169,113, 64, 45,112, 80,243, 4,106,158,131, 70,224, 48, 97, 64, 40,250, 6,251,117, + 11,255,238,198,180,105,211,240,233,167,159, 66, 20, 69, 60,254,248,227,152, 57,115, 38,212,106,103,183,102,209,162, 69, 48,153, + 76, 88,183,110, 29,182,108,217,162,165,148,190,137,166,245,192, 29, 87,128,164,164,164,104, 74,233,189,122,189, 94,232, 73,193, + 41, 44, 44, 68, 74, 74, 10,206,157, 59,135, 57,115,230,240, 11, 22, 44, 8,136,140,108,157, 53, 34, 63, 63, 31, 5, 5, 5,148, +231,249,111,221,180,158, 94,231, 63,243,206,159,241,139,127,249,128, 79,240,183, 75, 20,169,121,229,216,157, 83,130,140,252, 74, +136,110,146, 26, 19, 0, 3, 53,118,220,104,207,198, 67,119, 37,240,183,205,127, 34, 32, 50, 50,170,211,252, 61,129,132,132, 4, +124,253,245,215,120,227,141, 55, 16, 19,227, 62, 29,125, 72, 72, 8,158,124,242, 73,108,223,190,157,213,212,212,140, 13, 13, 13, +237, 95, 85, 85,117,165, 51, 74, 32,168,213,234,231,110,186,233, 38,174, 59,157, 39,119, 96,140, 33, 39, 39, 7,169,169,169,168, +172,172,196,125,247,221,135,215, 95,127,189, 77,199, 45, 57, 57,217,193, 24, 91,179,127,255,126,201, 77,151,233, 85,254,137,243, + 30,197,211,235,126,194, 61,178, 10,145, 94,228,207, 24,240,245,113, 3,214, 30, 42,128, 85,108,127, 93, 8, 3,144,111,215,224, +151,131,181,184, 91,216, 3,203,119,199, 96, 31, 57, 3,252,144,169, 16,162,199, 55, 46, 19,109,143,191, 39, 16, 20, 20,132, 53, +107,214,184, 93,126,218, 18, 67,134, 12,145, 12, 6,131,153,231,249,251, 81,151,152,184,227, 10,192,243,252,207, 39, 77,154,164, +241,228, 3, 73,146,132, 99,199,142, 33, 45, 45, 13, 1, 1, 1, 88,184,112, 33,166, 77,155,230, 50, 69,138, 83,107,102,183, 99, +231,206,157,212,106,181,254,205, 93, 25,111,242,207,200, 45,198, 93,171,190,129,213, 33,225,238,119,190,193,190, 87, 23, 34, 58, + 44,176,199,249,151,155, 29,120,251,199,115, 56, 90,208,249,156,252, 19, 2,235,190,227, 47, 85,193,145,181, 5,200,218, 2,226, + 23, 12, 97,144, 30,108,128, 30,251,246,180,205,223, 83,232,168,240,215, 7, 16, 24,165, 84, 98,140,105,208,201, 9,158, 2, 0, +194,113,158,241,189,204,102, 51,210,211,211,113,248,240, 97,140, 26, 53, 10, 43, 86,172,232,240,174,145, 0,176,111,223, 62, 8, +130,112, 36, 45, 45,173,173,156,228, 94,225,159,109, 40,195,188,119,183,194,234,168,107, 24, 11,202,170,113,239,159,147,177,243, +165,249, 8,214,106,122,140,191,201, 38,225,183,155, 51, 81, 80,209,249,100,180, 4,192,248,160,214, 89, 15,153,173, 26,226,185, + 29,192,185, 29,248,247,108,162, 82, 17,246, 23,242,192,148,100,104,196,239,195,151, 30,243,201, 76, 17,245,232,218,154,224,238, + 70,105,105, 41, 82, 83, 83,145,153,153,137,105,211,166,225,195, 15, 63,196,128,102, 27, 98,116, 20, 61,237,124,117,148,127, 65, + 89, 53,230,190,243, 13,170,204,206,115,200, 50,243, 75,176,240,253,109, 72,126,238, 94,168, 5,222,227,252,173,162,140,231,147, + 79,119, 73,248, 1, 32, 86, 91,139, 16,161,237,245, 35, 42,142,241, 0,230, 49, 96, 58,236,170,229,229, 31, 76,249, 74,144,201, +218,144,167,211,189,155, 5,152, 81,128, 52, 53, 28, 93,205,202,209,173, 10,144,151,151,135,148,148, 20, 20, 22, 22, 98,238,220, +185,120,238,185,231,208,213,161,248,220,220, 92, 92,189,122, 85,140,142,142,254,111, 79,213,105, 71,248,151,152, 44,152,179,106, + 19,174, 86,185,222,163,111, 95, 86, 62,150,124,178, 3, 47,222, 57,210,227,252,255,153,122, 25, 57,198,154,182, 91,121, 2,232, + 71,244, 71, 76, 88, 0,204, 54, 17,149,102, 59, 14, 95, 40, 2,101, 12, 19,130, 42,219,234,151,144,122,133,179,199,199,208, 39, + 52, 4, 7, 67,151,165,229,250, 66, 19, 79, 45,229,176,253,176, 18,204, 82, 6,245,228, 37, 80,141,184,163,177,245,175, 95, 74, +217,233,244,232,215,180, 26,135, 82,138,204,204, 76,164,166,166, 66,150,101, 60,240,192, 3,184,253,246,219, 91,133,173, 58,139, +173, 91,183,218, 41,165, 31,111,218,180,169, 61,173,238, 49,254, 53, 86, 7,238,249,211, 22,228, 22,183,157, 44,121, 99,122, 14, + 12,185, 57,178,218,131,252, 47,150,214, 34,249, 84,161,219,235,129,126,106,172,184, 39, 30, 11, 18, 71,161,127,120,144,211,181, +203, 37, 38,124,180,227, 56, 6, 95,106, 61,159,204, 6, 13,252, 96, 7, 24,197,153, 50, 97,227,220, 63,166,172,245, 37, 27,135, + 85, 23, 65,174,200,173,219,179,109,223,219, 16,179,147, 17,227, 7, 82,191, 32,158,118,197, 7,232, 18, 28, 14, 7, 14, 29, 58, +132,244,244,116,244,239,223, 31, 79, 60,241, 4,226,227,227,209, 29, 11,131,108, 54, 27,246,236,217,195,108, 54,219, 39,158,170, +200,206,242,183,139, 50, 22,188,247, 45, 78, 94, 54,118,232,254,233, 37,224, 53, 33,137, 20,216,227, 17,254,255, 72,201, 3,117, +163, 58,209, 97,129,216,242,236,189, 24, 55,216,117, 50,226,193,145, 33,120,247,161, 91, 81,242,229, 23, 78,155,156,214,112, 65, + 8,162, 77, 61,202,226, 56,199,224, 23,124,204,200,231,251,142,129,118,214, 27,176,238,124, 9,144, 69,200, 37,103,241,255, 6, + 16,149,223, 20,255,193,111,109, 39, 93,234, 1,186,132,109,219,182,129, 82,138, 85,171, 86, 97,248,240,225,221,250,144,123,246, +236,129, 32, 8,169,169,169,169, 69,158,170,200,206,240,167,140,225,145,143,183, 99,127,118, 65,167,126,195,206,107, 95,230,231, +175, 58, 39,111, 92,185,161, 59,185,151,155, 29,200,200,175,116,217,216, 13,208, 5, 97,247, 43, 11, 49, 64, 23,212,142,187, 40, + 66,107,174,123, 30, 17, 2,100,162,114, 18,126, 0, 80,243,152, 90,249,158,126,124,216,239,210, 78,250,146, 18, 8,131,244,208, +206,122, 3,182,157, 47,131,201, 14,240,132, 97,241, 36,191,113, 83, 6, 14,122, 88, 16,134,173,155,252,234,225,234,142,222,139, + 67, 23,246, 21, 48,155,205,200,204,204,196,202,149, 43,187, 93,248, 27,156, 95,179,217,220, 81,231,209,227,252,151,125,182, 27, + 91,143, 92,232,202,163, 16,194,176, 86,184,127,213,140,238,228,191, 35,171, 16,204, 77, 79,255,135,121,250,246,133, 31,128, 92, + 94,103, 70,128, 87, 33, 48,225, 9,248, 49,215, 11, 99, 40, 47,223,235,139,225, 30, 97,144, 30,126,179,255, 8,162,210, 54,158, + 27, 17,169,158, 52, 52,156, 28, 42,251, 48, 97,164, 71,123,128,163, 71,143, 34, 33, 33,161,205, 92,159, 93,197,185,115,231, 80, + 82, 82, 98, 59,120,240,224, 78, 79, 85, 94,103,248,191,254, 77, 42, 62,219,155,121, 45, 63,167, 6,144,172, 90,240,206, 45,226, +215, 47,156,234, 14,254,169,103, 93, 79,126, 28,216, 39, 24, 11,147, 70,119, 44, 94, 88,114, 6, 32, 28,180,183,191, 6, 97,112, + 18,196,236,100,208,106, 23, 62, 5, 35, 9, 61,102,223,215,150, 64, 42, 60, 6, 72,118, 48, 89, 4,100, 7, 24, 21, 65,168, 4, +230,176,130, 57,106,193, 28,181,128,104, 1,179,155,235,254,111,189, 51,234, 40,194,216,225,242, 15, 19,230,235,158, 74,255,177, +219, 21,128, 82,138,140,140, 12,188,252,242,203, 30,169,132,173, 91,183,218, 68, 81,252, 0, 30, 74,149,209, 25,254,127,251,241, + 56,222, 73, 62,212,120, 28,164, 85, 99, 70,220, 32,216, 68, 9, 63,158,188,228,186, 66, 9, 16,224,168, 56,100, 82,133,107, 0, + 76,168, 63, 29,204, 40,251,193,239,129, 85,122,219, 87, 43, 47, 95, 43,255,203,149, 86,128,104, 91, 93, 91,116,203,141, 80,241, + 29, 27, 83,160, 37,103,161,137, 95, 10, 97,112,221, 62,191,170,225, 51, 97, 63,246,133,139, 62, 12, 61,178,233,175,116, 97, 39, +172,123,223,118, 37,208, 93, 65, 48, 24,219, 94,241, 97,252,178,240,167, 14,255,173, 61, 19,168, 83, 56,127,254, 60,130,130,130, + 16, 23, 23,215,237,149, 96,177, 88,176,127,255,126, 56, 28,142,127,122,170,162, 59,202,255,235,180, 28, 60,183,110, 31,162,195, + 2,241,248,109,227,240,237,138,121, 48,124,242,127,216,240,219,185,109,239,129, 69, 37,140, 40, 73,253,185,180,105,229, 68, 9, +100, 16, 1,158, 2,176, 27, 64,164, 36, 99, 7,238,125, 91,119,173,252, 45,196,245,250,243,168,144,128,142,219,102,234, 0,168, +199, 63,208, 36, 8, 49, 19,221, 21, 13,233, 9, 5, 16,207,239,236, 46,225,111,244,151, 25, 35, 31,151,127,144,240, 62,123,213, +189,156, 11,157,221, 91,245,240,225,195,248,197, 47,126,225,145, 74,216,181,107, 23, 83,171,213,123,247,236,217,211,225, 13,176, + 61,193,127, 87,230,101,252,117, 91, 6,214, 44,189, 19, 11,244,163, 58,220,170, 2, 0, 3,145,210,210,210,234,248,111,122,161, + 64, 4, 62, 2,240,145,102,193,159,134, 74,178,252,172, 32,112,155,164,251,255, 58, 7,155,158,182,118,149,191,138,143,133, 67, +110,253,181,176, 64,103,197, 56,124,161, 8,195,163,195, 17,222,226, 60, 24,133,122,226,131,206, 78,180,228, 54, 49, 4,199, 54, +222,207,147,249,155, 60,154,249,218,111,198,139,144, 75,178, 1,209, 10, 38, 90,193, 28, 22,192, 81, 3,106, 53,129,150,157,131, + 92,226, 58,221, 63, 31, 58, 16,124,248, 96, 64,208,128, 89, 42, 32, 22,157,172,223,240,163, 65, 64,216,242,242,176, 41, 67, 75, + 62,246, 91, 24,249,155,253,181, 93, 54,129, 24, 99, 40, 47, 47, 71, 65, 65, 1,110,187,237, 54,143, 84,194,166, 77,155,204,213, +213,213,239,122,196,190,236, 32,127,179, 93,132,192, 17, 28,122,251, 33,116, 37,162, 75, 9,231,114, 79, 45,251,215,207,231, 2, +248, 53, 22,190, 21, 37,136,142, 9, 18,144,214, 85,254, 1,125, 71,194, 97,110,253, 51,205,103,126,214,218, 28,120,107, 75, 58, +190, 91, 49,207, 69,171,193,129,248, 59,119, 68,204,230, 54,112, 34,226,204, 38,143,103,110, 35,218, 80, 8,131, 90,111,200, 46, + 95,205,132, 53,111,127,171,243,170,126, 19,161,141,127, 28, 66,191,241,173,158,195,126,126, 39, 44, 41,171,235,156,124, 0,132, +224, 46, 94,182,165,148,175,142,191, 75,183,236,240,149, 78, 41, 0, 99,245, 59,142, 51,134,195,135, 15, 99,214,172, 89,208,104, +186,127,238,217,153, 51,103, 80, 85, 85, 85,147,154,154,186,175,187, 5,191, 51,252, 3, 52, 42,220, 26, 55,168,235,191, 7,210, +246,172,201, 13,127, 48, 74,128,241, 90,248, 27, 11,131, 81,105,110,189,246, 99,219,145, 11, 88,152, 56, 10,140, 1,203, 63,219, +141, 62, 65,218, 14,243, 46,185,120, 28,193,174, 47, 93, 32,175,194, 43,123, 6, 72, 23,247,192,186,239,237, 70, 65,110,236, 45, +110,122, 8,254, 9, 75, 27,167, 66,156, 59,127, 6,102,179, 25,186,112, 29, 6, 13,138,133,223,216,251, 32, 68,220,128,154,237, + 43,192,172,141,131,150,227, 0,238, 61, 0,247,119,216, 7,160,148, 54,174,195,180,217,108, 56,126,252, 56,238,185,231, 30,143, + 60,236,150, 45, 91,172,162, 40,190,215,221, 14,111, 79,241,247,148,195,238,138,255,228,225,209, 46,203,239,204,188, 12,139, 93, +196,239, 55, 28,192,134,212,179,152, 60, 44,186, 99, 74,230,176, 64,147,191,219, 77, 43, 79,206,244,248,131, 51, 10,251,225, 53, +176,238,126,189,149,240,171,135,205,128,191,254,215, 0,225,112, 56, 35, 29,241, 79,188,138,184, 23,191, 67,252,170, 61, 24,246, +220, 70,252,252,153, 55,112,241, 98, 14,132,232,177, 8,185,255, 95, 32,126,205,167,178,176,123,171, 62,156, 60,164,165, 2,180, +138, 67, 55,175,248,134, 79,102,102, 38,134, 13, 27,134,254,253,251,119,251,243,214,212,212, 32, 53, 53,149,216,108,182, 79,187, +214,200,123,151,255,181,119, 82,157,227, 63,101,120, 63,215, 65, 4,187,136,121,127,217,138, 15,182, 31, 5, 0, 76, 30, 22,211, + 33, 2,181,199,191,130,134,147,220, 24,124,108,103,143, 42,189,185, 12,150,109,203,225, 56,241,159,214,129, 64, 65, 3,255,233, +207, 2, 0,242,242,206,227,231,171,119,227,120,133,179,127,243, 95,131, 10,243,255,244, 21, 36, 81, 4, 23,210, 15,234, 33,122, + 39,151, 65,166,252,114,183, 61, 0, 99,172,177,194, 37, 73,130, 36, 73,141,199,199,143, 31,199,188,121,243, 60,242,208, 59,119, +238,132, 90,173,222,113,173,249,102,188,197,191, 59,205,181,142,240,159, 59,105, 24, 66,252, 93,155,113, 7,234, 71,171,181,106, + 1, 99, 6, 69,180,111,102,228,167, 65, 62,245, 31,119,151,109, 68, 35,110,236, 49,147,231,202, 49, 88,191,121, 12,114,145,235, +225, 18, 85,244, 88,112,218,186,177,155, 15,191,254, 14,229, 14,215, 75, 72, 79, 87,249,225,207,255,168, 11, 36,170, 6, 76,110, +209,161,177, 71, 13,127, 77,208, 58, 41, 64,131,157,217,178,213,105,120, 17, 6,131, 1, 22,139, 5, 9, 9,221, 59, 38, 66, 41, +197,158, 61,123,176,118,237, 90,212,214,214,190,123, 45,130,227, 13,254,221,237,167,116,148,127,144, 86,141, 71,110, 29,219,230, + 61,199,235, 36,168,218,153, 30,239,200,254, 22,150, 31, 86,130,103,110,167, 68,127,213, 35,243,255, 25,133,253,216, 90, 88,183, + 63, 3,106,117, 63, 67, 85,136,106, 26,228, 59,125,213,220,230, 45,243, 74,235,156,122, 97,192,205, 45, 47, 5,169,180, 36,168, +185, 19,204, 26, 42,186,193,217,106, 72, 66,212,240, 57,113,226, 4,238,185,231, 30,116,215,194, 19, 89,150,177,107,215, 46,124, +246,217,103,176, 88, 44,142,226,226,226, 45, 6,131, 33, 60, 56, 56,248,230,234,234,234, 35,157,173,190,158,230, 79,105,183,250, +132, 93,226,255,200,140, 49, 88,179,235, 68,227,130,156,150,152,192, 95,132,121,227, 98, 8, 35,102, 67,125,195, 29, 32,129,117, + 19,227,152,104,133,227,226, 62,148, 30,222,128, 16, 91,126, 91, 83, 39, 77, 50, 47,175,244,184,236,139, 86,216,118,189, 2,169, +224,144,115, 67,205,171,193,192,156,124, 0, 90,219, 20, 29, 31, 18,174,193,129, 54, 18,161,140,111,152, 8,232, 98,108,193,223, +108,111, 60, 41, 52,111,125, 26, 42,188,249, 75,176, 88, 44, 56,127,254, 60, 94,121,229,149,107,239,226, 36, 9, 63,252,240, 3, +214,174, 93, 11,155,205,102,191,122,245,234,214,162,162,162,100, 74,105, 49,207,243, 70, 89,150, 75,174,165,245,236, 41,254,255, + 90,191, 3, 16, 98,187,189,245,119,197,223, 84,107,198,169,220, 43,184,243, 87, 75,177,249,240,121, 28,207, 43, 70,218,185, 66, +156,184,100,132, 67,114,223,194,223, 20, 84, 9,106, 42,130, 35,227,159,112,100,252,179, 46, 98, 66, 56, 48, 42,131,128,181, 59, +186, 69, 8, 94,136,252,205,145, 98,143, 10,191,189, 22,214,255, 62, 7,217,152,237,252,219,193, 49,240,159,245, 38,236, 71,254, + 5, 41,191, 41, 90, 44,149,158,107,252,255,233, 7,238,194,127, 94,217, 6,145,181, 86,225, 80,149,132,217,183,212,141,112,203, +165,173,179, 39, 50, 78, 77,157,194,160, 45, 95, 64,243, 23,113,234,212, 41, 36, 36, 36,224, 90,114, 76, 58, 28, 14,124,255,253, +247, 88,183,110, 29, 28, 14,135,173,168,168, 40,185,168,168,232,123,142,227,140,140, 49,163, 36, 73,198,170,170,170,210,107,105, +145,123,146,255, 85, 41,226, 52,250,224,230,238,142,246,184,226,159,125,250, 52,134,198, 77,192, 15, 89,133,216,118,244, 34,174, + 86,214,118,232,158, 55, 5, 87,180, 50, 51,192,104,135, 38,203, 51,134,191,233,150, 29,250,196,147,194, 79,173,149,117, 38, 79, +153,115,170, 33, 97,144, 30,126, 51, 94, 4,209, 4, 66, 24,156,232,164, 0,114,121, 30,236,103,191,135,102,212, 93, 24, 53, 50, + 14,219,127, 99,196, 67,255, 76, 69,177,189,105,237,198,208, 0, 59, 62, 91, 58, 3,177,177,117,169, 93,172, 39,190,108,249,211, +162, 57,192, 97,115, 82,128, 6,123,179,229, 11,144,101, 25, 89, 89, 89,120,253,245,215,187,244,144,118,187, 29,223,126,251, 45, +214,175, 95, 15, 89,150,109,133,133,133,155,141, 70,227, 14,198,152, 17,128,145,231,121, 99,121,121,185,241, 90, 43,179,167,249, + 91,198,207,187, 25,232, 62, 5,104,139,127,118,214,105,188,254,250,235, 24, 61,122, 52,254,186,120, 6, 14,157, 47, 66,114,198, +121,108,205, 56,143,194, 10,215,202, 16,163,177, 34, 90,109,235, 98,143,132, 47,117,149,135,158,242,104,203,111,173,130,245,219, + 39, 65,171,154, 77,234,227, 4,104,110,126, 12,234, 9,191, 68,195, 8, 53, 63, 48,161,254,255,166,104,144, 53,245, 35,168, 98, + 38,128, 11,233,135, 91,111,153,137,203,137,211,177,231,192, 30, 20,149,150, 33, 38,162, 15,110,155, 62, 19, 28,199, 3,140,194, +146,178, 26,210,149, 99, 45,186, 54,124, 25,179,244,152,197,165, 15,208,210,254,204,203,203, 67,104,104, 40, 70,143, 30,221,169, + 7,180, 88, 44, 72, 78, 78,198,134, 13, 27, 64, 41,181, 22, 20, 20,108, 46, 47, 47,223,205, 24, 51, 82, 74,141,130, 32, 24,203, +202,202,140,232,194, 34,230,182,108,232,158,226, 79,253,195,251,121,194, 7,104,143, 63, 71, 8,244, 35,250, 65, 63,162, 31,254, +180,232, 86, 28,201,189,138,228,140,243, 72, 62,124, 30, 5,101,213, 78,230, 79, 23, 32,130,177,223,235,150, 29,254, 11, 33,158, +221,179, 75, 46, 60,234, 36,252, 92,200, 0,248,221,246, 50,248,136, 17, 78,229,184,128, 62,224,251,222, 8,185, 56,171, 89,207, + 97,130,233,171,135, 17,112,219, 31,160, 30, 58, 29, 60,207, 99,214,140, 89,173, 76,171,218, 29, 47, 66, 44, 56,220,170,174,193, +216,159,156,122,156,230,161,183,150, 54,232,153, 51,103, 58, 21, 58,172,173,173,197,230,205,155,177,113,227, 70, 80, 74, 45, 6, +131,225,155,178,178,178,253,140, 49, 35,207,243, 70,198,152,177,170,170,202,136,174,239, 68,216,102,232,176,167,248,171,180, 33, +241,221, 37, 34, 93,229, 79, 8, 48,121, 88, 52, 38, 15,139,198,170, 95, 78,195,241, 60, 35, 54,238,203, 64,114,250,105,140, 15, +236,148, 2, 72,140, 97, 7,227,232,107, 17,203, 50,142, 98,185,231,163, 94,252,160, 68,240,125,199, 64, 46, 57, 11,213,136,217, +208,232,159,116,154,215,223, 28,154,164,223,194,178,229, 9,128, 54, 57,251,204, 81,139,218,255,174,132,122,232,116, 8, 81,163, +193,135, 15, 1, 9,208, 65,174,184, 12,185,236, 2, 28,185, 7, 64,171, 91,175,165, 98,192,247,125,150, 29,118, 26,216,115,235, + 3,152, 76, 38, 20, 23, 23, 99,198,140, 25,237, 62, 80,117,117, 53,190,254,250,107, 36, 39, 39,131, 82,106,190,114,229,202,230, +178,178,178,131,140, 49, 99,189,157, 95, 28, 26, 26,106,188,120,241,162,221, 35,246,164,194, 31,199,246,124,135,204,228,100, 12, +161,212,188, 35,219,184,189,223, 56,106,191,101,120,224, 68,157, 63, 63, 26,196,133,233, 79,112,152, 49,178, 94,237,112,124, 21, +252,236,177,178,158, 12,251, 18,149, 22,254,247,124,220,184, 32,167, 77,101,233,115, 3,212,147, 30,169,115,228, 91,250,102,185, +251,225,200,221,223,193, 31, 37,121, 2,228, 86,234,237,214, 7,200,206,206,198,157,119,222,217,230,188,153,170,170, 42,124,249, +229,151, 13,203, 11,107, 13, 6,195,230,170,170,170,180, 6, 27,159, 82,106,212,106,181,198,162,162, 34, 75,101,101,165,199, 42, + 84,225,223,154,255,243,151,152, 81,150,139,140,235, 31, 25, 64, 18, 6, 5,106,136, 74,230,136,172, 34, 96, 50, 7,162,170, 10, + 95,150, 82, 0,111,131,239, 88, 46, 84,205,132, 95, 1,142, 90, 56, 78,118,121,101,233, 41,153,147,238,212,185,136,106, 53, 42, + 64,115, 27, 84, 20, 69,156, 63,127, 30,207, 60,243,140,203,187,149,151,151, 99,253,250,245,216,177, 99, 7,100, 89,174,169,175, +248,140, 6,161, 81,169, 84,197,140, 49, 99, 69, 69, 69,173,171, 92,239,158, 16, 32,133,191,107,254,119,191,239,203,121,172, 58, +218,101,112,208, 76,249, 53,248, 62, 55,192,182,255,143, 96, 82,167, 28,252, 20,162, 17,239,138,116, 51,160,215,202, 4, 98,140, +225,226,197,139, 24, 49, 98, 4,250,245,115,246,245, 74, 74, 74,240,197, 23, 95, 96,247,238,221,144, 36,169,218, 96, 48,108,169, +174,174, 62,202, 24, 51, 54,216,201, 0,140, 37, 37, 37, 61, 90,235, 10,127,239,242,239, 41, 8,195,102,194,191,223, 68,136,103, +190,131,120,230, 91, 48,179, 91,203,205, 0, 32,153, 3,217, 18,218,183,127, 74, 91,107, 25, 4,198, 24,107,217, 5, 95,184,112, + 1, 79, 61,213, 20, 9, 43, 42, 42,194,231,159,127,142, 3, 7, 14, 64,146, 36, 83,126,126,254,150,218,218,218,147, 13, 81, 17, +158,231,141,146, 36, 25, 43, 43, 43,123, 60, 91,152, 87,248,203,220, 81,240,244, 53,215,132,136,205,231,249,247, 98,112,218, 48, +104,110, 90, 12,205,132, 69,117,249,129, 28, 22,124,182,230, 67, 27, 45, 57,179,121, 76, 31,122,118,100,140,176,179,239,242, 35, + 29,158, 77, 32, 16, 66,242,171,171,171, 71,134,133,133,129, 82,138,210,210, 82,136,162,136, 41, 83,166,192, 96, 48,224,223,255, +254, 55,210,210,210, 32,138, 98,229,229,203,151,183,154,205,230,204, 6,231, 16,128, 81,150,101, 99, 85, 85, 85,153,183, 42,196, + 27,252,197,205, 43,142, 2, 56,218, 91,249,255,111,104, 2, 15,190, 79,221, 96,215, 57,115,152,188,255,136,120,188,160,160, 96, + 91, 85, 85, 85,167, 54,241, 16,236,118,123,106, 73, 73,201,204,254,253,251, 11,148, 82, 92,188,120, 17, 19, 38, 76,192,203, 47, +191,140, 35, 71,142,192,110,183, 87, 24, 12,134,111,107,107,107,179, 8, 33, 37,168, 91,204, 97,228,121,222, 88, 82, 82, 98,244, +118, 61, 40,252,189, 15,147,201, 36,100,100,100,120,243,247,121, 66, 8,149,101,185,243,185, 65, 25, 99, 25,121,121,121,246, 33, + 67,134, 8,118,187, 29,121,121,121,200,207,207,135,205,102,107,168,248,179,205, 91,155,102,131, 88,212, 23, 42, 95,225,239,117, + 24,139,139,139, 79,173, 90,181,138,183,219,237,209,140, 49, 53, 0, 86,159, 97,143, 53,251,160,254, 60,107, 10,203, 59, 95,115, +119,189,197,189, 90,150,101,178, 44,203,146, 36,149,212,167, 71,236,212, 8, 13, 1,128,105,211,166, 61, 79, 41,125, 11,128,236, +112, 56,106,138,138,138,182,213,214,214,158,227, 56,174,193,198, 44, 97,140, 21,215, 79, 91,144,224, 99, 80,248,251,134, 81,162, +211,233,150, 3,232, 91,175,156, 50,234, 18,214, 74,132, 16,153, 49, 38, 19, 66,164,102,231,104,179,107, 13,231,101, 66,136, 84, +159,228, 86,110,184, 70, 8,145, 41,165, 82,139, 99,185, 33, 35, 52,165, 84,146,101, 89, 98,140, 89,204,102,243,149, 78, 43, 64, + 61, 84,225,225,225, 81,140,177, 48,142,227,180, 0,136, 44,203,118,142,227,202,195,195,195, 75, 60, 53, 8,212,141, 80,248,123, + 57, 88, 25, 24, 24, 24,205,113,156,154, 16,194, 84, 42, 21, 68, 81,108,108,165, 27, 90,241,230,199,132, 16,218,208,226, 59, 28, + 14,167, 30,128, 16,194,154,125, 26,202,194, 98,177, 56,221,131,227, 56, 70, 8, 97,149,149,149,172, 94,233,196,174, 42,128, 2, + 5,215,172, 4, 93,181, 4,189, 69,248,255, 3,212, 21,184,121, 66,226, 69,162, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130, +}; + diff --git a/source/blender/editors/include/ED_datafiles.h b/source/blender/editors/include/ED_datafiles.h index 4ea122346af..89f28c67533 100644 --- a/source/blender/editors/include/ED_datafiles.h +++ b/source/blender/editors/include/ED_datafiles.h @@ -37,6 +37,9 @@ extern char datatoc_B_blend[]; extern int datatoc_blenderbuttons_size; extern char datatoc_blenderbuttons[]; +extern int datatoc_prvicons_size; +extern char datatoc_prvicons[]; + extern int datatoc_splash_jpg_size; extern char datatoc_splash_jpg[]; diff --git a/source/blender/editors/include/ED_fileselect.h b/source/blender/editors/include/ED_fileselect.h new file mode 100644 index 00000000000..55399691b3d --- /dev/null +++ b/source/blender/editors/include/ED_fileselect.h @@ -0,0 +1,65 @@ +/** + * $Id: + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2008 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ +#ifndef ED_FILES_H +#define ED_FILES_H + +typedef struct FileSelectParams { + int type; /* the mode of the filebrowser, FILE_BLENDER, FILE_SPECIAL, FILE_MAIN or FILE_LOADLIB */ + char title[24]; /* title, also used for the text of the execute button */ + char dir[240]; /* directory */ + char file[80]; /* file */ + + short flag; /* settings for filter, hiding files and display mode */ + short sort; /* sort order */ + short display; /* display mode flag */ + short filter; /* filter when (flags & FILE_FILTER) is true */ + + /* XXX - temporary, better move to filelist */ + short active_bookmark; + int active_file; + int selstate; + + /* XXX --- still unused -- */ + short f_fp; /* show font preview */ + char fp_str[8]; /* string to use for font preview */ + + char *pupmenu; /* allows menu for save options - result stored in menup */ + short menu; /* currently selected option in pupmenu */ + /* XXX --- end unused -- */ + + struct FileList *files; + +} FileSelectParams; + +FileSelectParams* ED_fileselect_get_params(const struct bContext *C); + +short ED_fileselect_set_params(const struct bContext *C, int type, const char *title, const char *path, + short flag, short display, short filter); + +#endif /* ED_FILES_H */ + diff --git a/source/blender/editors/include/ED_space_api.h b/source/blender/editors/include/ED_space_api.h index e5cf3479e9b..b705c050aa3 100644 --- a/source/blender/editors/include/ED_space_api.h +++ b/source/blender/editors/include/ED_space_api.h @@ -48,5 +48,11 @@ void ED_spacetype_script(void); void ED_spacetype_text(void); void ED_spacetype_sequencer(void); +/* calls for instancing and freeing spacetype static data + called in WM_init_exit */ +/* in space_file.c */ +void ED_file_init(void); +void ED_file_exit(void); + #endif /* ED_SPACE_API_H */ diff --git a/source/blender/editors/include/UI_interface_icons.h b/source/blender/editors/include/UI_interface_icons.h index 6db2cb35107..9387eabbae6 100644 --- a/source/blender/editors/include/UI_interface_icons.h +++ b/source/blender/editors/include/UI_interface_icons.h @@ -58,6 +58,7 @@ void UI_icon_draw_preview(float x, float y, int icon_id, int nocreate); void UI_icon_draw_aspect(float x, float y, int icon_id, float aspect); void UI_icon_draw_aspect_blended(float x, float y, int icon_id, float aspect, int shade); +void UI_icon_draw_size_blended(float x, float y, int size, int icon_id, int shade); void UI_icons_free(); void UI_icons_free_drawinfo(void *drawinfo); diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 4155935c28f..1fd4142a29c 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -98,12 +98,13 @@ static struct ListBase iconfilelist = {0, 0}; /* **************************************************** */ -static void def_internal_icon(ImBuf *bbuf, int icon_id, int xofs, int yofs) +static void def_internal_icon(ImBuf *bbuf, int icon_id, int xofs, int yofs, int size) { Icon *new_icon = NULL; IconImage *iimg = NULL; DrawInfo *di; int y = 0; + int imgsize = 0; new_icon = MEM_callocN(sizeof(Icon), "texicon"); @@ -112,18 +113,19 @@ static void def_internal_icon(ImBuf *bbuf, int icon_id, int xofs, int yofs) di = MEM_callocN(sizeof(DrawInfo), "drawinfo"); di->drawFunc = 0; - di->w = ICON_DEFAULT_HEIGHT; - di->h = ICON_DEFAULT_HEIGHT; + di->w = size; + di->h = size; di->aspect = 1.0f; iimg = MEM_mallocN(sizeof(IconImage), "icon_img"); - iimg->rect = MEM_mallocN(ICON_DEFAULT_HEIGHT*ICON_DEFAULT_HEIGHT*sizeof(unsigned int), "icon_rect"); - iimg->w = ICON_DEFAULT_HEIGHT; - iimg->h = ICON_DEFAULT_HEIGHT; + iimg->rect = MEM_mallocN(size*size*sizeof(unsigned int), "icon_rect"); + iimg->w = size; + iimg->h = size; /* Here we store the rect in the icon - same as before */ - for (y=0; y<ICON_DEFAULT_HEIGHT; y++) { - memcpy(&iimg->rect[y*ICON_DEFAULT_HEIGHT], &bbuf->rect[(y+yofs)*ICON_IMAGE_W+xofs], ICON_DEFAULT_HEIGHT*sizeof(int)); + imgsize = bbuf->x; + for (y=0; y<size; y++) { + memcpy(&iimg->rect[y*size], &bbuf->rect[(y+yofs)*imgsize+xofs], size*sizeof(int)); } di->icon = iimg; @@ -423,9 +425,9 @@ static void init_internal_icons() printf("\n***WARNING***\nIcons file %s too small.\nUsing built-in Icons instead\n", iconfilestr); IMB_freeImBuf(bbuf); bbuf= NULL; - } } } + } if(bbuf==NULL) bbuf = IMB_ibImageFromMemory((int *)datatoc_blenderbuttons, datatoc_blenderbuttons_size, IB_rect); @@ -433,7 +435,7 @@ static void init_internal_icons() for (x=0; x<ICON_GRID_COLS; x++) { def_internal_icon(bbuf, BIFICONID_FIRST + y*ICON_GRID_COLS + x, x*(ICON_GRID_W+ICON_GRID_MARGIN)+ICON_GRID_MARGIN, - y*(ICON_GRID_H+ICON_GRID_MARGIN)+ICON_GRID_MARGIN); + y*(ICON_GRID_H+ICON_GRID_MARGIN)+ICON_GRID_MARGIN, ICON_GRID_W); } } @@ -867,13 +869,11 @@ static int preview_size(int miplevel) return 0; } - -static void icon_draw_mipmap(float x, float y, int icon_id, float aspect, int miplevel, int nocreate) +static void icon_draw_size(float x, float y, int icon_id, float aspect, int miplevel, int draw_size, int nocreate) { Icon *icon = NULL; DrawInfo *di = NULL; - int draw_size = preview_size(miplevel); - + icon = BKE_icon_get(icon_id); if (!icon) { @@ -926,6 +926,13 @@ static void icon_draw_mipmap(float x, float y, int icon_id, float aspect, int mi } } +static void icon_draw_mipmap(float x, float y, int icon_id, float aspect, int miplevel, int nocreate) +{ + int draw_size = preview_size(miplevel); + icon_draw_size(x,y,icon_id, aspect, miplevel, draw_size, nocreate); +} + + void UI_icon_draw_aspect(float x, float y, int icon_id, float aspect) { icon_draw_mipmap(x,y,icon_id, aspect, PREVIEW_MIPMAP_ZERO, 0); @@ -936,6 +943,19 @@ void UI_icon_draw(float x, float y, int icon_id) UI_icon_draw_aspect(x, y, icon_id, 1.0f); } +void UI_icon_draw_size_blended(float x, float y, int size, int icon_id, int shade) +{ + if(shade < 0) { + float r= (128+shade)/128.0f; + glPixelTransferf(GL_ALPHA_SCALE, r); + } + + icon_draw_size(x,y,icon_id, 1.0f, 0, size, 1); + + if(shade < 0) + glPixelTransferf(GL_ALPHA_SCALE, 1.0f); +} + void UI_icon_draw_preview(float x, float y, int icon_id, int nocreate) { icon_draw_mipmap(x,y,icon_id, 1.0f, PREVIEW_MIPMAP_LARGE, nocreate); diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 6f912ce393f..ee0da138941 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -649,6 +649,42 @@ void area_newspace(bContext *C, ScrArea *sa, int type) } } +void area_prevspace(bContext *C) +{ + SpaceLink *sl= CTX_wm_space_data(C); + ScrArea *sa= CTX_wm_area(C); + + /* cleanup */ +#if 0 // XXX needs to be space type specific + if(sfile->spacetype==SPACE_FILE) { + if(sfile->pupmenu) { + MEM_freeN(sfile->pupmenu); + sfile->pupmenu= NULL; + } + } +#endif + + if(sl->next) { + + BLI_remlink(&sa->spacedata, sl); + BLI_addtail(&sa->spacedata, sl); + + sl= sa->spacedata.first; + +#if 0 // XXX check whether this is still needed + if (sfile->spacetype == SPACE_SCRIPT) { + SpaceScript *sc = (SpaceScript *)sfile; + if (sc->script) sc->script->flags &=~SCRIPT_FILESEL; + } +#endif + + area_newspace(C, sa, SPACE_FILE); + } + else { + area_newspace(C, sa, SPACE_INFO); + } +} + static char *windowtype_pup(void) { return( diff --git a/source/blender/editors/screen/screen_intern.h b/source/blender/editors/screen/screen_intern.h index 43a1015562a..37932ee87a3 100644 --- a/source/blender/editors/screen/screen_intern.h +++ b/source/blender/editors/screen/screen_intern.h @@ -35,6 +35,7 @@ struct Scene; /* area.c */ void area_copy_data (ScrArea *sa1, ScrArea *sa2, int swap_space); void area_newspace(bContext *C, ScrArea *sa, int type); +void area_prevspace(bContext *C); /* screen_edit.c */ bScreen *screen_add(struct wmWindow *win, struct Scene *scene, char *name); diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c new file mode 100644 index 00000000000..04b126bf858 --- /dev/null +++ b/source/blender/editors/space_file/file_draw.c @@ -0,0 +1,598 @@ +/** + * $Id: + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2008 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include "BLI_blenlib.h" +#include "BLI_storage_types.h" +#ifdef WIN32 +#include "BLI_winstuff.h" +#endif + +#include "BIF_gl.h" +#include "BIF_glutil.h" + +#include "BKE_colortools.h" +#include "BKE_context.h" +#include "BKE_screen.h" +#include "BKE_global.h" +#include "BKE_utildefines.h" + +#include "BMF_Api.h" + +#include "DNA_space_types.h" +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" +#include "DNA_userdef_types.h" + +#include "ED_fileselect.h" + +#include "IMB_imbuf_types.h" +#include "IMB_imbuf.h" + +#include "MEM_guardedalloc.h" + +#include "PIL_time.h" + +#include "RNA_access.h" + +#include "UI_interface.h" +#include "UI_interface_icons.h" +#include "UI_resources.h" +#include "UI_text.h" +#include "UI_view2d.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "fsmenu.h" +#include "filelist.h" + +#include "file_intern.h" // own include + +/* ui geometry */ +#define IMASEL_BUTTONS_HEIGHT 60 +#define TILE_BORDER_X 8 +#define TILE_BORDER_Y 8 + +/* button events */ +enum { + B_REDR = 0, + B_FS_LOAD, + B_FS_CANCEL, +} eFile_ButEvents; + +// XXX for Ton: bad level, maybe needs export in ED_screen? +extern void area_prevspace(bContext *C); + +static void do_file_buttons(bContext *C, void *arg, int event) +{ + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + switch(event) { + case B_FS_LOAD: + { + char name[FILE_MAX]; + + area_prevspace(C); + BLI_strncpy(name, sfile->params->dir, sizeof(name)); + strcat(name, sfile->params->file); + RNA_string_set(sfile->op->ptr, "filename", name); + sfile->op->type->exec(C, sfile->op); + /* XXX for Ton: the call to WM_operator_free crashes + WM_operator_free(sfile->op); + sfile->op = NULL; + */ + } + break; + case B_FS_CANCEL: + /* XXX for Ton: the call to area_prevspace crashes + area_prevspace(C); + */ + break; + } +} + +void file_draw_buttons(const bContext *C, ARegion *ar) +{ + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + FileSelectParams* params = sfile->params; + uiBlock *block; + int loadbutton; + char name[20]; + char *menu; + float slen; + float parentbut_width = 20; + float bookmarkbut_width = 0.0f; + float file_start_width = 0.0f; + + int filebuty1, filebuty2; + + float xmin = ar->v2d.mask.xmin + 10; + float xmax = ar->v2d.mask.xmax - 10; + + filebuty1= ar->v2d.mask.ymax - IMASEL_BUTTONS_HEIGHT; + filebuty2= filebuty1+IMASEL_BUTTONS_HEIGHT/2 -6; + + /* HEADER */ + sprintf(name, "win %d", 1); // XXX sa-win??? + block = uiBeginBlock(C, ar, name, UI_EMBOSS, UI_HELV); + uiBlockSetHandleFunc(block, do_file_buttons, NULL); + + /* XXXX + uiSetButLock( filelist_gettype(simasel->files)==FILE_MAIN && simasel->returnfunc, NULL); + */ + + /* space available for load/save buttons? */ + slen = BMF_GetStringWidth(G.font, sfile->params->title); + loadbutton= slen > 60 ? slen + 20 : MAX2(80, 20+UI_GetStringWidth(G.font, params->title, 0)); + if(ar->v2d.mask.xmax-ar->v2d.mask.xmin > loadbutton+20) { + /* XXX + if(simasel->title[0]==0) { + loadbutton= 0; + } + */ + } + else { + loadbutton= 0; + } + + /* XXX to channel region */ + menu= fsmenu_build_menu(); + + if (menu[0]&& (params->type != FILE_MAIN)) { + bookmarkbut_width = parentbut_width; + file_start_width = parentbut_width; + } + + uiDefBut(block, TEX, 0 /* XXX B_FS_FILENAME */,"", xmin+file_start_width+bookmarkbut_width+2, filebuty1, xmax-xmin-loadbutton-file_start_width-bookmarkbut_width, 21, params->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, ""); + uiDefBut(block, TEX, 0 /* XXX B_FS_DIRNAME */,"", xmin+parentbut_width, filebuty2, xmax-xmin-loadbutton-parentbut_width, 21, params->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, ""); + + if(loadbutton) { + uiSetCurFont(block, UI_HELV); + uiDefBut(block, BUT, B_FS_LOAD, params->title, xmax-loadbutton, filebuty2, loadbutton, 21, params->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, ""); + uiDefBut(block, BUT, B_FS_CANCEL, "Cancel", xmax-loadbutton, filebuty1, loadbutton, 21, params->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, ""); + } + + /* menu[0] = NULL happens when no .Bfs is there, and first time browse + disallow external directory browsing for databrowse */ + + if(menu[0] && (params->type != FILE_MAIN)) { + uiDefButS(block, MENU, 0 /* B_FS_DIR_MENU */, menu, xmin, filebuty1, parentbut_width, 21, ¶ms->menu, 0, 0, 0, 0, ""); + uiDefBut(block, BUT, 0 /* B_FS_BOOKMARK */, "B", xmin+22, filebuty1, bookmarkbut_width, 21, 0, 0, 0, 0, 0, "Bookmark current directory"); + } + + MEM_freeN(menu); + + uiDefBut(block, BUT, 0 /* XXX B_FS_PARDIR */, "P", xmin, filebuty2, parentbut_width, 21, 0, 0, 0, 0, 0, "Move to the parent directory (PKEY)"); + uiEndBlock(C, block); + uiDrawBlock(C, block); +} + + +static void draw_tile(SpaceFile *sfile, short sx, short sy, short width, short height, int colorid) +{ + /* TODO: BIF_ThemeColor seems to need this to show the color, not sure why? - elubie */ + glEnable(GL_BLEND); + glColor4ub(0, 0, 0, 100); + glDisable(GL_BLEND); + + UI_ThemeColor4(colorid); + uiSetRoundBox(15); + glRecti(sx, sy - height, sx + width, sy); + + // uiRoundBox(sx+TILE_BORDER_X, sy - sfile->prv_h - TILE_BORDER_Y*3 - U.fontsize, sx + sfile->prv_w + TILE_BORDER_X*3, sy, 6); +} + +static float shorten_string(char* string, float w) +{ + short shortened = 0; + float sw = 0; + + sw = UI_GetStringWidth(G.font, string,0); + while (sw>w) { + int slen = strlen(string); + string[slen-1] = '\0'; + sw = UI_GetStringWidth(G.font, string,0); + shortened = 1; + } + if (shortened) { + int slen = strlen(string); + if (slen > 3) { + BLI_strncpy(string+slen-3, "...", 4); + } + } + return sw; +} + +static void file_draw_string(short sx, short sy, char* string, short width, short height) +{ + short soffs; + char fname[FILE_MAXFILE]; + float sw; + float x,y; + + BLI_strncpy(fname,string, FILE_MAXFILE); + sw = shorten_string(fname, width ); + soffs = (width - sw) / 2; + x = (float)(sx); + y = (float)(sy-height); + + // XXX was using ui_rasterpos_safe + glRasterPos2f(x, y); + UI_RasterPos(x, y); + + /* XXX TODO: handling of international fonts. + TODO: proper support for utf8 in languages different from ja_JP abd zh_CH + needs update of iconv in lib/windows to support getting the system language string + */ + UI_DrawString(G.font, fname, 0); + +} + +/* returns max number of rows in view */ +static int file_view_rows(SpaceFile* sfile, View2D *v2d) +{ + int height= (v2d->cur.ymax - v2d->cur.ymin - 2*sfile->tile_border_y); + return height / (sfile->tile_h + sfile->tile_border_y); +} + +/* returns max number of columns in view */ +static int file_view_columns(SpaceFile* sfile, View2D *v2d) +{ + int width= (v2d->cur.xmax - v2d->cur.xmin - 2*sfile->tile_border_x); + return width / (sfile->tile_w + sfile->tile_border_x); +} + +void file_calc_previews(const bContext *C, ARegion *ar) +{ + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + FileSelectParams* params = sfile->params; + View2D *v2d= &ar->v2d; + int width=0, height=0; + int rows, columns; + int linestep = U.fontsize*3/2; + + if (params->display) { + sfile->prv_w = 96; + sfile->prv_h = 96; + sfile->tile_border_x = 8; + sfile->tile_border_y = 8; + sfile->prv_border_x = 4; + sfile->prv_border_y = 4; + sfile->tile_w = sfile->prv_w + 2*sfile->prv_border_x; + sfile->tile_h = sfile->prv_h + 2*sfile->prv_border_y + U.fontsize*3/2; + width= (v2d->cur.xmax - v2d->cur.xmin - 2*sfile->tile_border_x); + columns= file_view_columns(sfile, v2d); + rows= filelist_numfiles(params->files)/columns + 1; // XXX dirty, modulo is zero + height= rows*(sfile->tile_h+sfile->tile_border_y) + sfile->tile_border_y*2; + } else { + sfile->prv_w = 0; + sfile->prv_h = 0; + sfile->tile_border_x = 8; + sfile->tile_border_y = 2; + sfile->prv_border_x = 0; + sfile->prv_border_y = 0; + sfile->tile_w = 240; + sfile->tile_h = U.fontsize*3/2; + height= v2d->cur.ymax - v2d->cur.ymin; + rows = file_view_rows(sfile, v2d); + columns = filelist_numfiles(params->files)/rows + 1; // XXX dirty, modulo is zero + width = columns * (sfile->tile_w + sfile->tile_border_x) + sfile->tile_border_x*2; + } + + UI_view2d_totRect_set(v2d, width, height); +} + +void file_draw_previews(const bContext *C, ARegion *ar) +{ + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + FileSelectParams* params=sfile->params; + View2D *v2d= &ar->v2d; + static double lasttime= 0; + struct FileList* files = params->files; + int numfiles; + struct direntry *file; + + short sx, sy; + int do_load = 1; + + ImBuf* imb=0; + int i; + short type; + int colorid = 0; + int todo; + int offset; + int columns; + + if (!files) return; + /* Reload directory */ + BLI_strncpy(params->dir, filelist_dir(files), FILE_MAX); + + type = filelist_gettype(files); + + filelist_imgsize(files,sfile->prv_w,sfile->prv_h); + + numfiles = filelist_numfiles(files); + + todo = 0; + if (lasttime < 0.001) lasttime = PIL_check_seconds_timer(); + + sx = v2d->cur.xmin + sfile->tile_border_x; + sy = v2d->cur.ymax - sfile->tile_border_y; + columns = file_view_columns(sfile, v2d); + offset = columns*(-v2d->cur.ymax+sfile->tile_border_y)/sfile->tile_h; + offset = (offset/columns-1)*columns; + if (offset<0) offset=0; + for (i=offset; (i < numfiles); ++i) + { + sx = v2d->tot.xmin + sfile->tile_border_x + ((i)%columns)*(sfile->tile_w+sfile->tile_border_x); + sy = v2d->tot.ymax - sfile->tile_border_y - ((i)/columns)*(sfile->tile_h+sfile->tile_border_y); + file = filelist_file(files, i); + + if (params->active_file == i) { + colorid = TH_ACTIVE; + draw_tile(sfile, sx, sy, sfile->tile_w, sfile->tile_h, colorid); + } else if (file->flags & ACTIVE) { + colorid = TH_HILITE; + draw_tile(sfile, sx, sy+sfile->tile_border_y, sfile->tile_w, sfile->tile_h-sfile->tile_border_y, colorid); + } else { + /* + colorid = TH_PANEL; + draw_tile(simasel, sx, sy, tilewidth, tileheight, colorid); + */ + } + +#if 0 + if ( type == FILE_MAIN) { + ID *id; + int icon_id = 0; + int idcode; + idcode= groupname_to_code(sfile->dir); + if (idcode == ID_MA || idcode == ID_TE || idcode == ID_LA || idcode == ID_WO || idcode == ID_IM) { + id = (ID *)file->poin; + icon_id = BKE_icon_getid(id); + } + if (icon_id) { + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + if (do_load) { + UI_icon_draw_preview(sx+2*TILE_BORDER_X, sy-simasel->prv_w-TILE_BORDER_X, icon_id, 0); + } else { + UI_icon_draw_preview(sx+2*TILE_BORDER_X, sy-simasel->prv_w-TILE_BORDER_X, icon_id, 1); + todo++; + } + + glDisable(GL_BLEND); + } + } + else { +#endif + if ( (file->flags & IMAGEFILE) /* || (file->flags & MOVIEFILE) */) + { + if (do_load) { + filelist_loadimage(files, i); + } else { + todo++; + } + imb = filelist_getimage(files, i); + } else { + imb = filelist_getimage(files, i); + } + + if (imb) { + float fx = ((float)sfile->prv_w - (float)imb->x)/2.0f; + float fy = ((float)sfile->prv_h - (float)imb->y)/2.0f; + short dx = (short)(fx + 0.5f + sfile->prv_border_x); + short dy = (short)(fy + 0.5f + sfile->prv_border_y); + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + // glaDrawPixelsSafe((float)sx+8 + dx, (float)sy - imgwidth + dy - 8, imb->x, imb->y, imb->x, GL_RGBA, GL_UNSIGNED_BYTE, imb->rect); + glColor4f(1.0, 1.0, 1.0, 1.0); + glaDrawPixelsTex((float)sx + dx, (float)sy - sfile->prv_h + dy, imb->x, imb->y,GL_UNSIGNED_BYTE, imb->rect); + // glDisable(GL_BLEND); + imb = 0; + } +#if 0 + } +#endif + if (type == FILE_MAIN) { + glColor3f(1.0f, 1.0f, 1.0f); + } + else { + if (S_ISDIR(file->type)) { + glColor3f(1.0f, 1.0f, 0.9f); + } + else if (file->flags & IMAGEFILE) { + UI_ThemeColor(TH_SEQ_IMAGE); + } + else if (file->flags & MOVIEFILE) { + UI_ThemeColor(TH_SEQ_MOVIE); + } + else if (file->flags & BLENDERFILE) { + UI_ThemeColor(TH_SEQ_SCENE); + } + else { + if (params->active_file == i) { + UI_ThemeColor(TH_GRID); /* grid used for active text */ + } else if (file->flags & ACTIVE) { + UI_ThemeColor(TH_TEXT_HI); + } else { + UI_ThemeColor(TH_TEXT); + } + } + } + + file_draw_string(sx + sfile->prv_border_x, sy, file->relname, sfile->tile_w, sfile->tile_h); +#if 0 + if(do_load && (PIL_check_seconds_timer() - lasttime > 0.3)) { + lasttime= PIL_check_seconds_timer(); + do_load = 0; + } +#endif + } +#if 0 // XXX solve with threads or add notifier ?? + if (!do_load && todo > 0) /* we broke off loading */ + addafterqueue(sa->win, RENDERPREVIEW, 1); +#endif +} + + +void file_draw_list(const bContext *C, ARegion *ar) +{ + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + FileSelectParams* params = sfile->params; + struct FileList* files = params->files; + struct direntry *file; + int numfiles; + int colorid = 0; + short sx, sy; + int offset; + short type; + int i; + int rows; + + numfiles = filelist_numfiles(files); + type = filelist_gettype(files); + + sx = ar->v2d.tot.xmin + sfile->tile_border_x/2; + sy = ar->v2d.cur.ymax - sfile->tile_border_y; + + rows = (ar->v2d.cur.ymax - ar->v2d.cur.ymin - 2*sfile->tile_border_y) / (sfile->tile_h+sfile->tile_border_y); + offset = rows*(sx - sfile->tile_border_x)/(sfile->tile_w+sfile->tile_border_x); + offset = (offset/rows-1)*rows; + + while (sx < ar->v2d.cur.xmax) { + sx += (sfile->tile_w+sfile->tile_border_x); + glColor4ub(0xB0,0xB0,0xB0, 0xFF); + sdrawline(sx+1, ar->v2d.cur.ymax - sfile->tile_border_y , sx+1, ar->v2d.cur.ymin + sfile->tile_border_y); + glColor4ub(0x30,0x30,0x30, 0xFF); + sdrawline(sx, ar->v2d.cur.ymax - sfile->tile_border_y , sx, ar->v2d.cur.ymin + sfile->tile_border_y); + } + + sx = ar->v2d.cur.xmin + sfile->tile_border_x; + sy = ar->v2d.cur.ymax - sfile->tile_border_y; + if (offset<0) offset=0; + for (i=offset; (i < numfiles); ++i) + { + sy = ar->v2d.tot.ymax-sfile->tile_border_y - (i%rows)*(sfile->tile_h+sfile->tile_border_y); + sx = ar->v2d.tot.xmin +sfile->tile_border_x + (i/rows)*(sfile->tile_w+sfile->tile_border_x); + + file = filelist_file(files, i); + + if (params->active_file == i) { + colorid = TH_ACTIVE; + draw_tile(sfile, sx, sy, sfile->tile_w, sfile->tile_h, colorid); + } else if (file->flags & ACTIVE) { + colorid = TH_HILITE; + draw_tile(sfile, sx, sy, sfile->tile_w, sfile->tile_h, colorid); + } else { + /* + colorid = TH_PANEL; + draw_tile(simasel, sx, sy, sfile->tile_w, sfile->tile_h, colorid); + */ + } + if (type == FILE_MAIN) { + glColor3f(1.0f, 1.0f, 1.0f); + } + else { + if (S_ISDIR(file->type)) { + glColor3f(1.0f, 1.0f, 0.9f); + } + else if (file->flags & IMAGEFILE) { + UI_ThemeColor(TH_SEQ_IMAGE); + } + else if (file->flags & MOVIEFILE) { + UI_ThemeColor(TH_SEQ_MOVIE); + } + else if (file->flags & BLENDERFILE) { + UI_ThemeColor(TH_SEQ_SCENE); + } + else { + if (params->active_file == i) { + UI_ThemeColor(TH_GRID); /* grid used for active text */ + } else if (file->flags & ACTIVE) { + UI_ThemeColor(TH_TEXT_HI); + } else { + UI_ThemeColor(TH_TEXT); + } + } + } + + file_draw_string(sx, sy, file->relname, sfile->tile_w, sfile->tile_h); + file_draw_string(sx + sfile->tile_w - UI_GetStringWidth(G.font, file->size, 0), sy, + file->size, sfile->tile_w - UI_GetStringWidth(G.font, file->size, 0), sfile->tile_h); + } +} + +void file_draw_fsmenu(const bContext *C, ARegion *ar) +{ + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + FileSelectParams* params = sfile->params; + char bookmark[FILE_MAX]; + int nentries = fsmenu_get_nentries(); + int linestep = U.fontsize*3/2; + int i; + short sx, sy; + int bmwidth = ar->v2d.cur.xmax - ar->v2d.cur.xmin - 2*TILE_BORDER_X; + int fontsize = U.fontsize; + + sx = ar->v2d.cur.xmin + TILE_BORDER_X; + sy = -2*TILE_BORDER_Y; + for (i=0; i< nentries && (sy > ar->v2d.cur.ymin) ;++i) { + char *fname = fsmenu_get_entry(i); + + if (fname) { + int sl; + BLI_strncpy(bookmark, fname, FILE_MAX); + + sl = strlen(bookmark)-1; + while (bookmark[sl] == '\\' || bookmark[sl] == '/') { + bookmark[sl] = '\0'; + sl--; + } + if (params->active_bookmark == i ) { + glColor4ub(0, 0, 0, 100); + UI_ThemeColor(TH_HILITE); + // uiSetRoundBox(15); + // uiRoundBox(simasel->bookmarkrect.xmin + TILE_BORDER_X - 1, sy - linestep*0.25, simasel->bookmarkrect.xmax - TILE_BORDER_X + 1, sy + linestep*0.75, 6); + glRecti(sx, sy - linestep, sx + bmwidth, sy); + UI_ThemeColor(TH_TEXT_HI); + } else { + UI_ThemeColor(TH_TEXT); + } + + file_draw_string(sx, sy, bookmark, bmwidth, fontsize); + sy -= linestep; + } else { + glColor4ub(0xB0,0xB0,0xB0, 0xFF); + sdrawline(sx, sy-1-fontsize/2 , sx + bmwidth, sy-1-fontsize/2); + glColor4ub(0x30,0x30,0x30, 0xFF); + sdrawline(sx, sy-fontsize/2 , sx + bmwidth, sy - fontsize/2); + sy -= linestep; + } + } +}
\ No newline at end of file diff --git a/source/blender/editors/space_file/file_header.c b/source/blender/editors/space_file/file_header.c index ccaa0acbfd3..21f81cd83a7 100644 --- a/source/blender/editors/space_file/file_header.c +++ b/source/blender/editors/space_file/file_header.c @@ -40,10 +40,12 @@ #include "BKE_context.h" #include "BKE_screen.h" +#include "BKE_global.h" #include "ED_screen.h" #include "ED_types.h" #include "ED_util.h" +#include "ED_fileselect.h" #include "WM_api.h" #include "WM_types.h" @@ -51,11 +53,17 @@ #include "BIF_gl.h" #include "BIF_glutil.h" +#include "BMF_Api.h" + #include "UI_interface.h" #include "UI_resources.h" #include "UI_view2d.h" #include "file_intern.h" +#include "filelist.h" + +#define B_SORTIMASELLIST 1 +#define B_RELOADIMASELDIR 2 /* ************************ header area region *********************** */ @@ -91,10 +99,17 @@ static uiBlock *dummy_viewmenu(bContext *C, uiMenuBlockHandle *handle, void *arg return block; } - -static void do_file_buttons(bContext *C, void *arg, int event) +static void do_file_header_buttons(bContext *C, void *arg, int event) { + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); switch(event) { + case B_SORTIMASELLIST: + filelist_sort(sfile->params->files, sfile->params->sort); + WM_event_add_notifier(C, NC_WINDOW, NULL); + break; + case B_RELOADIMASELDIR: + WM_event_add_notifier(C, NC_WINDOW, NULL); + break; } } @@ -102,11 +117,15 @@ static void do_file_buttons(bContext *C, void *arg, int event) void file_header_buttons(const bContext *C, ARegion *ar) { ScrArea *sa= CTX_wm_area(C); + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + FileSelectParams* params = sfile->params; + uiBlock *block; int xco, yco= 3; + int xcotitle; block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS, UI_HELV); - uiBlockSetHandleFunc(block, do_file_buttons, NULL); + uiBlockSetHandleFunc(block, do_file_header_buttons, NULL); xco= ED_area_header_standardbuttons(C, block, yco); @@ -122,6 +141,23 @@ void file_header_buttons(const bContext *C, ARegion *ar) xco+=XIC+xmax; } + /* SORT TYPE */ + xco+=XIC; + uiBlockBeginAlign(block); + uiDefIconButS(block, ROW, B_SORTIMASELLIST, ICON_SORTALPHA, xco+=XIC,0,XIC,YIC, ¶ms->sort, 1.0, 0.0, 0, 0, "Sorts files alphabetically"); + uiDefIconButS(block, ROW, B_SORTIMASELLIST, ICON_SORTBYEXT, xco+=XIC,0,XIC,YIC, ¶ms->sort, 1.0, 3.0, 0, 0, "Sorts files by extension"); + uiDefIconButS(block, ROW, B_SORTIMASELLIST, ICON_SORTTIME, xco+=XIC,0,XIC,YIC, ¶ms->sort, 1.0, 1.0, 0, 0, "Sorts files by time"); + uiDefIconButS(block, ROW, B_SORTIMASELLIST, ICON_SORTSIZE, xco+=XIC,0,XIC,YIC, ¶ms->sort, 1.0, 2.0, 0, 0, "Sorts files by size"); + uiBlockEndAlign(block); + xco+=XIC+10; + + if (sfile->params->type != FILE_MAIN) { + uiDefIconButBitS(block, TOG, 1, B_RELOADIMASELDIR, ICON_BOOKMARKS,xco+=XIC,0,XIC,YIC, ¶ms->display, 0, 0, 0, 0, "Toggles Bookmarks on/off"); + xco+=XIC+10; + } + xcotitle= xco; + xco+= BMF_GetStringWidth(G.font, params->title); + uiBlockSetEmboss(block, UI_EMBOSS); /* always as last */ @@ -132,3 +168,4 @@ void file_header_buttons(const bContext *C, ARegion *ar) } + diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h index 2322c60f9c9..f5b93a84f39 100644 --- a/source/blender/editors/space_file/file_intern.h +++ b/source/blender/editors/space_file/file_intern.h @@ -34,9 +34,20 @@ /* file_header.c */ void file_header_buttons(const bContext *C, ARegion *ar); -/* filesel.c */ -void freefilelist(SpaceFile *sfile); +/* file_draw.c */ +#define TILE_BORDER_X 8 +#define TILE_BORDER_Y 8 +void file_draw_buttons(const bContext *C, ARegion *ar); +void file_calc_previews(const bContext *C, ARegion *ar); +void file_draw_previews(const bContext *C, ARegion *ar); +void file_draw_list(const bContext *C, ARegion *ar); +void file_draw_fsmenu(const bContext *C, ARegion *ar); + +/* file_ops.h */ +struct wmOperatorType; +void ED_FILE_OT_select(struct wmOperatorType *ot); +void ED_FILE_OT_select_bookmark(struct wmOperatorType *ot); #endif /* ED_FILE_INTERN_H */ diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c new file mode 100644 index 00000000000..2d1617d03a3 --- /dev/null +++ b/source/blender/editors/space_file/file_ops.c @@ -0,0 +1,269 @@ +/** + * $Id: + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2008 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Andrea Weikert (c) 2008 Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include "BKE_context.h" +#include "BKE_screen.h" +#include "BKE_global.h" + +#include "BLI_blenlib.h" +#include "BLI_storage_types.h" +#ifdef WIN32 +#include "BLI_winstuff.h" +#endif +#include "DNA_space_types.h" +#include "DNA_userdef_types.h" + +#include "ED_space_api.h" +#include "ED_screen.h" +#include "ED_fileselect.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "file_intern.h" +#include "filelist.h" +#include "fsmenu.h" + +#include <stdlib.h> +#include <string.h> +#include <stdio.h> + +/* for events */ +#define NOTACTIVE 0 +#define ACTIVATE 1 +#define INACTIVATE 2 + + +static void set_active_file_thumbs(SpaceFile *sfile, FileSelectParams* params, struct ARegion* ar, short mval[]) +{ + float x,y; + int active_file = -1; + int stridex, stridey; + struct direntry* file; + int offsetx, offsety; + int numfiles = filelist_numfiles(params->files); + int columns; + + View2D* v2d = &ar->v2d; + UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, &y); + + offsetx = (x - (v2d->cur.xmin+sfile->tile_border_x))/(sfile->tile_w + sfile->tile_border_x); + offsety = (-y+sfile->tile_border_y)/(sfile->tile_h + sfile->tile_border_y); + columns = (v2d->cur.xmax - v2d->cur.xmin) / (sfile->tile_w+ sfile->tile_border_x); + + printf("tile (%d, %d, %d)\n", offsetx, offsety, columns); + active_file = offsetx + columns*offsety; + + if (active_file >= 0 && active_file < numfiles ) + { + printf("active file: %d\n", active_file); + params->active_file = active_file; + if (params->selstate & ACTIVATE) { + file = filelist_file(params->files, params->active_file); + printf("active file: %s\n", file->relname); + file->flags |= ACTIVE; + } + } +} + + +static void set_active_file(SpaceFile *sfile, FileSelectParams* params, struct ARegion* ar, short mval[]) +{ + int offsetx, offsety; + float x,y; + int active_file = -1; + int numfiles = filelist_numfiles(params->files); + int rows; + struct direntry* file; + + View2D* v2d = &ar->v2d; + UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, &y); + + offsetx = (x-sfile->tile_border_x)/(sfile->tile_w + sfile->tile_border_x); + offsety = (v2d->cur.ymax-y-sfile->tile_border_y)/(sfile->tile_h + sfile->tile_border_y); + rows = (v2d->cur.ymax - v2d->cur.ymin - 2*sfile->tile_border_y) / (sfile->tile_h+sfile->tile_border_y); + active_file = rows*offsetx + offsety; + printf("offsets (%d, %d)\n", offsetx, offsety); + printf("active_file (%d)\n", active_file); + if ( (active_file >= 0) && (active_file < numfiles) ) + { + params->active_file = active_file; + if (params->selstate & ACTIVATE) { + file = filelist_file(params->files, params->active_file); + file->flags |= ACTIVE; + } + } +} + + +static void set_active_bookmark(SpaceFile *sfile, FileSelectParams* params, struct ARegion* ar, short y) +{ + int nentries = fsmenu_get_nentries(); + short posy = ar->v2d.mask.ymax - TILE_BORDER_Y - y; + params->active_bookmark = ((float)posy / (U.fontsize*3.0f/2.0f)); + printf("active bookmark: %d\n", params->active_bookmark); + if (params->active_bookmark < 0 || params->active_bookmark > nentries) { + params->active_bookmark = -1; + } +} + +static void mouse_select(SpaceFile* sfile, FileSelectParams* params, ARegion* ar, short *mval) +{ + int numfiles = filelist_numfiles(params->files); + if(mval[0]>ar->v2d.mask.xmin && mval[0]<ar->v2d.mask.xmax + && mval[1]>ar->v2d.mask.ymin && mval[1]<ar->v2d.mask.ymax) { + params->selstate = NOTACTIVE; + if (params->display) { + set_active_file_thumbs(sfile, params, ar, mval); + } else { + set_active_file(sfile, params, ar, mval); + } + if (params->active_file >= 0 && params->active_file < numfiles) { + struct direntry* file = filelist_file(params->files, params->active_file); + + if(file && S_ISDIR(file->type)) { + /* the path is too long and we are not going up! */ + if (strcmp(file->relname, ".") && + strcmp(file->relname, "..") && + strlen(params->dir) + strlen(file->relname) >= FILE_MAX ) + { + // XXX error("Path too long, cannot enter this directory"); + } else { + if (strcmp(file->relname, "..")==0) { + /* avoids /../../ */ + BLI_parent_dir(params->dir); + } else { + strcat(params->dir, file->relname); + strcat(params->dir,"/"); + params->file[0] = '\0'; + BLI_cleanup_dir(G.sce, params->dir); + } + filelist_setdir(params->files, params->dir); + filelist_free(params->files); + params->active_file = -1; + } + } + else if (file) + { + if (file->relname) { + BLI_strncpy(params->file, file->relname, FILE_MAXFILE); + /* XXX + if(event==MIDDLEMOUSE && filelist_gettype(sfile->files)) + imasel_execute(sfile); + */ + } + + } + /* XXX + if(BIF_filelist_gettype(sfile->files)==FILE_MAIN) { + active_imasel_object(sfile); + } + */ + } + } +} + +static void mouse_select_bookmark(SpaceFile* sfile, ARegion* ar, short *mval) +{ + if(mval[0]>ar->v2d.mask.xmin && mval[0]<ar->v2d.mask.xmax + && mval[1]>ar->v2d.mask.ymin && mval[1]<ar->v2d.mask.ymax) { + int nentries = fsmenu_get_nentries(); + char *selected; + printf("selecting...\n"); + set_active_bookmark(sfile, sfile->params, ar, mval[1]); + selected= fsmenu_get_entry(sfile->params->active_bookmark); + /* which string */ + if (selected) { + FileSelectParams* params = sfile->params; + BLI_strncpy(params->dir, selected, sizeof(params->dir)); + BLI_cleanup_dir(G.sce, params->dir); + filelist_free(params->files); + filelist_setdir(params->files, params->dir); + params->file[0] = '\0'; + params->active_file = -1; + } + } +} + +static int file_select_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + ScrArea *sa= CTX_wm_area(C); + ARegion *ar= CTX_wm_region(C); + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + short mval[2]; + + /* note; otherwise opengl select won't work. do this for every glSelectBuffer() */ + wmSubWindowSet(CTX_wm_window(C), ar->swinid); + + mval[0]= event->x - ar->winrct.xmin; + mval[1]= event->y - ar->winrct.ymin; + mouse_select(sfile, sfile->params, ar, mval); + WM_event_add_notifier(C, NC_WINDOW, 0, NULL); + return OPERATOR_FINISHED; +} + + +void ED_FILE_OT_select(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Activate/Select File"; + ot->idname= "ED_FILE_OT_select"; + + /* api callbacks */ + ot->invoke= file_select_invoke; + ot->poll= ED_operator_file_active; +} + + +static int bookmark_select_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + ScrArea *sa= CTX_wm_area(C); + ARegion *ar= CTX_wm_region(C); + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + short mval[2]; + + /* note; otherwise opengl select won't work. do this for every glSelectBuffer() */ + wmSubWindowSet(CTX_wm_window(C), ar->swinid); + + mval[0]= event->x - ar->winrct.xmin; + mval[1]= event->y - ar->winrct.ymin; + mouse_select_bookmark(sfile, ar, mval); + ED_area_tag_redraw(sa); + return OPERATOR_FINISHED; +} + +void ED_FILE_OT_select_bookmark(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Select Directory"; + ot->idname= "ED_FILE_OT_select_bookmark"; + + /* api callbacks */ + ot->invoke= bookmark_select_invoke; + ot->poll= ED_operator_file_active; +}
\ No newline at end of file diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 5b5ff95d37c..f03ea8d9456 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -72,13 +72,14 @@ #include "DNA_scene_types.h" #include "DNA_userdef_types.h" +#include "ED_datafiles.h" + #include "IMB_imbuf.h" #include "IMB_imbuf_types.h" #include "IMB_thumbs.h" #include "PIL_time.h" -#include "ED_datafiles.h" #include "filelist.h" @@ -908,7 +909,7 @@ void filelist_from_library(struct FileList* filelist) void filelist_append_library(struct FileList *filelist, char *dir, char *file, short flag, int idcode, struct Main *mainvar, struct Scene* scene) { // XXX todo: replace NULL with op->reports - BLO_library_append_(&filelist->libfiledata, filelist->filelist, filelist->numfiles, dir, file, flag, idcode, mainvar, scene, NULL); + BLO_library_append(&filelist->libfiledata, filelist->filelist, filelist->numfiles, dir, file, flag, idcode, mainvar, scene, NULL); } void filelist_from_main(struct FileList *filelist) diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index ea20758884d..9e991fc861e 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -56,9 +56,11 @@ #include "BKE_context.h" #include "BKE_screen.h" +#include "BKE_global.h" #include "ED_screen.h" #include "ED_util.h" +#include "ED_fileselect.h" #include "WM_api.h" #include "WM_types.h" @@ -71,22 +73,78 @@ #include "UI_view2d.h" #include "file_intern.h" +#include "filelist.h" -void freefilelist(SpaceFile *sfile) +FileSelectParams* ED_fileselect_get_params(const struct bContext *C) { - int num; - - num= sfile->totfile-1; + SpaceLink *sl= CTX_wm_space_data(C); + SpaceFile *sfile; + FileSelectParams *params = 0; + + if (sl->spacetype == SPACE_FILE) { + sfile= (SpaceFile*)sl; + params = sfile->params; + } + return params; +} + +short ED_fileselect_set_params(const struct bContext *C, int type, const char *title, const char *path, + short flag, short display, short filter) +{ + char group[32], name[FILE_MAX], temp[FILE_MAX], dir[FILE_MAX], file[FILE_MAX]; + SpaceLink *sl= CTX_wm_space_data(C); + SpaceFile *sfile; + FileSelectParams *params; + + if (sl->spacetype != SPACE_FILE) { + return 0; + } + sfile= (SpaceFile*)sl; + + if (!sfile->params) { + sfile->params = MEM_callocN(sizeof(FileSelectParams), "fileselparams"); + sfile->params->files = filelist_new(); + } + params = sfile->params; + + params->type = type; + params->flag = flag; + params->display = display; + params->filter = filter; + + BLI_strncpy(params->title, title, sizeof(params->title)); - if (sfile->filelist==0) return; + BLI_strncpy(name, path, sizeof(name)); + BLI_convertstringcode(name, G.sce); - for(; num>=0; num--){ - MEM_freeN(sfile->filelist[num].relname); - - if (sfile->filelist[num].string) MEM_freeN(sfile->filelist[num].string); + switch(type) { + case FILE_MAIN: + break; + case FILE_LOADLIB: + break; + case FILE_BLENDER: + case FILE_LOADFONT: + default: + { + BLI_split_dirfile(name, dir, file); + BLI_strncpy(params->file, file, sizeof(params->file)); + BLI_strncpy(params->dir, dir, sizeof(params->dir)); + BLI_make_file_string(G.sce, params->dir, dir, ""); /* XXX needed ? - also solve G.sce */ + + filelist_settype(params->files, type); + filelist_setdir(params->files, params->dir); + BLI_cleanup_dir(G.sce, params->dir); /* XXX solve G.sce */ + + /* free: filelist and libfiledata became incorrect */ + if (params->files) { + filelist_free(params->files); + filelist_freelib(params->files); + } + } + break; } - free(sfile->filelist); - sfile->filelist= 0; + + return 1; } diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index da363cf4071..b4b2688ed7b 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -22,13 +22,14 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Andrea Weikert (c) 2008 Blender Foundation. * * ***** END GPL LICENSE BLOCK ***** */ #include <stdlib.h> #include <string.h> +#include <stdio.h> #include <math.h> #include "MEM_guardedalloc.h" @@ -37,6 +38,14 @@ #include "BLI_linklist.h" #include "BLI_dynstr.h" +#ifdef WIN32 +#include <windows.h> /* need to include windows.h so _WIN32_IE is defined */ +#ifndef _WIN32_IE +#define _WIN32_IE 0x0400 /* minimal requirements for SHGetSpecialFolderPath on MINGW MSVC has this defined already */ +#endif +#include <shlobj.h> /* for SHGetSpecialFolderPath, has to be done before BLI_winstuff because 'near' is disabled through BLI_windstuff */ +#include "BLI_winstuff.h" +#endif #include "fsmenu.h" /* include ourselves */ @@ -64,7 +73,7 @@ int fsmenu_get_nentries(void) return count; } -int fsmenu_is_entry_a_seperator(int idx) +int fsmenu_is_entry_a_separator(int idx) { FSMenuEntry *fsme; @@ -233,6 +242,60 @@ void fsmenu_write_file(const char *filename) fclose(fp); } +void fsmenu_read_file(const char *filename) +{ + char line[256]; + FILE *fp; + + #ifdef WIN32 + /* Add the drive names to the listing */ + { + __int64 tmp; + char folder[256]; + char tmps[4]; + int i; + + tmp= GetLogicalDrives(); + + for (i=2; i < 26; i++) { + if ((tmp>>i) & 1) { + tmps[0]='a'+i; + tmps[1]=':'; + tmps[2]='\\'; + tmps[3]=0; + + fsmenu_insert_entry(tmps, 0, 0); + } + } + + /* Adding Desktop and My Documents */ + fsmenu_append_separator(); + + SHGetSpecialFolderPath(0, folder, CSIDL_PERSONAL, 0); + fsmenu_insert_entry(folder, 0, 0); + SHGetSpecialFolderPath(0, folder, CSIDL_DESKTOPDIRECTORY, 0); + fsmenu_insert_entry(folder, 0, 0); + + fsmenu_append_separator(); + } +#endif + + fp = fopen(filename, "w"); + if (!fp) return; + + while ( fgets ( line, 256, fp ) != NULL ) /* read a line */ + { + int len = strlen(line); + if (len>0) { + if (line[len-1] == '\n') { + line[len-1] = '\0'; + } + fsmenu_insert_entry(line, 0, 1); + } + } + fclose(fp); +} + void fsmenu_free(void) { FSMenuEntry *fsme= fsmenu; diff --git a/source/blender/editors/space_file/fsmenu.h b/source/blender/editors/space_file/fsmenu.h index 7cd7f78a363..f4291673a3e 100644 --- a/source/blender/editors/space_file/fsmenu.h +++ b/source/blender/editors/space_file/fsmenu.h @@ -37,10 +37,10 @@ int fsmenu_get_nentries (void); /** Returns true if the fsmenu entry at @a index exists and * is a seperator. */ -int fsmenu_is_entry_a_seperator (int index); +int fsmenu_is_entry_a_separator (int index); /** Returns the fsmenu entry at @a index (or NULL if a bad index) - * or a seperator. + * or a separator. */ char* fsmenu_get_entry (int index); @@ -63,8 +63,11 @@ void fsmenu_insert_entry (char *path, int sorted, short save); /** Removes the fsmenu entry at the given @a index. */ void fsmenu_remove_entry (int index); - /** saves the 'favourites' to the specified file */ + /** saves the 'bookmarks' to the specified file */ void fsmenu_write_file(const char *filename); + + /** reads the 'bookmarks' from the specified file */ +void fsmenu_read_file(const char *filename); /** Free's all the memory associated with the fsmenu */ void fsmenu_free (void); diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 3d20dbe39a1..f5e7ffa7773 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -48,6 +48,7 @@ #include "ED_space_api.h" #include "ED_screen.h" +#include "ED_fileselect.h" #include "BIF_gl.h" @@ -59,8 +60,11 @@ #include "UI_view2d.h" #include "ED_markers.h" +#include "ED_fileselect.h" #include "file_intern.h" // own include +#include "fsmenu.h" +#include "filelist.h" /* ******************** default callbacks for file space ***************** */ @@ -70,27 +74,50 @@ static SpaceLink *file_new(const bContext *C) SpaceFile *sfile; sfile= MEM_callocN(sizeof(SpaceFile), "initfile"); - sfile->spacetype= SPACE_FILE; - + sfile->spacetype= SPACE_FILE; + sfile->params= MEM_callocN(sizeof(FileSelectParams), "fileselparams"); + sfile->params->files = filelist_new(); + + // ED_fileselect_set_params(C, FILE_UNIX, "Load File", "F:\\photos\\2008_Kos", NULL, NULL, 0, 0, 0); + + /* XXX move to context sfile->dir[0]= '/'; + strcpy(sfile->dir, "F:\\photos\\2008_Kos"); sfile->type= FILE_UNIX; - + strcpy(sfile->title, "Load"); + sfile->prv_h = 96; + sfile->prv_w = 96; + sfile->files = NULL; + */ + /* header */ ar= MEM_callocN(sizeof(ARegion), "header for file"); - BLI_addtail(&sfile->regionbase, ar); ar->regiontype= RGN_TYPE_HEADER; ar->alignment= RGN_ALIGN_BOTTOM; - + + /* channel list region */ + ar= MEM_callocN(sizeof(ARegion), "channel area for file"); + BLI_addtail(&sfile->regionbase, ar); + ar->regiontype= RGN_TYPE_CHANNELS; + ar->alignment= RGN_ALIGN_LEFT; + + /* ui list region */ + ar= MEM_callocN(sizeof(ARegion), "ui area for file"); + BLI_addtail(&sfile->regionbase, ar); + ar->regiontype= RGN_TYPE_UI; + ar->alignment= RGN_ALIGN_TOP; + /* main area */ ar= MEM_callocN(sizeof(ARegion), "main area for file"); - BLI_addtail(&sfile->regionbase, ar); ar->regiontype= RGN_TYPE_WINDOW; - - /* channel list region XXX */ + ar->v2d.scroll = (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM); + 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); + ar->v2d.keeptot= V2D_KEEPTOT_STRICT; + ar->v2d.minzoom= ar->v2d.maxzoom= 1.0f; - return (SpaceLink *)sfile; } @@ -98,21 +125,26 @@ static SpaceLink *file_new(const bContext *C) static void file_free(SpaceLink *sl) { SpaceFile *sfile= (SpaceFile *) sl; - - if(sfile->libfiledata) - BLO_blendhandle_close(sfile->libfiledata); - if(sfile->filelist) - freefilelist(sfile); - if(sfile->pupmenu) - MEM_freeN(sfile->pupmenu); + + if (sfile->params) { + if(sfile->params->files) { + filelist_free(sfile->params->files); + filelist_freelib(sfile->params->files); + MEM_freeN(sfile->params->files); + sfile->params->files = 0; + } + if(sfile->params->pupmenu) + MEM_freeN(sfile->params->pupmenu); + MEM_freeN(sfile->params); + sfile->params = 0; + } } /* spacetype; init callback */ static void file_init(struct wmWindowManager *wm, ScrArea *sa) -{ - +{ } static SpaceLink *file_duplicate(SpaceLink *sl) @@ -141,34 +173,103 @@ static void file_main_area_init(wmWindowManager *wm, ARegion *ar) static void file_main_area_draw(const bContext *C, ARegion *ar) { /* draw entirely, view changes should be handled here */ - // SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + FileSelectParams* params = ED_fileselect_get_params(C); View2D *v2d= &ar->v2d; + View2DScrollers *scrollers; float col[3]; + if (!params->files) { + params->files = filelist_new(); + filelist_setdir(params->files, params->dir); + filelist_settype(params->files, params->type); + } + + if (filelist_empty(params->files)) + { + unsigned int filter = 0; + filelist_hidedot(params->files, params->flag & FILE_HIDE_DOT); + if (params->flag & FILE_FILTER) { + filter = params->filter ; + } else { + filter = 0; + } + + filelist_setfilter(params->files, filter); + filelist_readdir(params->files); + + if(params->sort!=FILE_SORTALPHA) filelist_sort(params->files, params->sort); + } + + /* clear and setup matrix */ UI_GetThemeColor3fv(TH_BACK, col); glClearColor(col[0], col[1], col[2], 0.0); glClear(GL_COLOR_BUFFER_BIT); - UI_view2d_view_ortho(C, v2d); - + file_calc_previews(C,ar); + + /* data... */ + UI_view2d_view_ortho(C, v2d); + + if (params->display) { + file_draw_previews(C, ar); + } else { + file_draw_list(C, ar); + } /* reset view matrix */ UI_view2d_view_restore(C); - /* scrollers? */ + /* scrollers */ + scrollers= UI_view2d_scrollers_calc(C, v2d, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY); + UI_view2d_scrollers_draw(C, v2d, scrollers); + UI_view2d_scrollers_free(scrollers); + } void file_operatortypes(void) { - + WM_operatortype_append(ED_FILE_OT_select); + WM_operatortype_append(ED_FILE_OT_select_bookmark); } void file_keymap(struct wmWindowManager *wm) { - + ListBase *keymap= WM_keymap_listbase(wm, "File", SPACE_FILE, 0); + WM_keymap_add_item(keymap, "ED_FILE_OT_select", SELECTMOUSE, KM_PRESS, 0, 0); + + keymap= WM_keymap_listbase(wm, "FileBookmark", SPACE_FILE, 0); + WM_keymap_add_item(keymap, "ED_FILE_OT_select_bookmark", SELECTMOUSE, KM_PRESS, 0, 0); +} + + +static void file_channel_area_init(wmWindowManager *wm, ARegion *ar) +{ + ListBase *keymap; + + UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy); + + /* own keymap */ + keymap= WM_keymap_listbase(wm, "FileBookmark", SPACE_FILE, 0); + WM_event_add_keymap_handler_bb(&ar->handlers, keymap, NULL, NULL); +} + +static void file_channel_area_draw(const bContext *C, ARegion *ar) +{ + View2D *v2d= &ar->v2d; + float col[3]; + + UI_GetThemeColor3fv(TH_BACK, col); + glClearColor(col[0], col[1], col[2], 0.0); + glClear(GL_COLOR_BUFFER_BIT); + + /* data... */ + UI_view2d_view_ortho(C, v2d); + + file_draw_fsmenu(C, ar); } /* add handlers, stuff you only do once or on area/region changes */ @@ -199,6 +300,28 @@ static void file_header_area_draw(const bContext *C, ARegion *ar) UI_view2d_view_restore(C); } +/* add handlers, stuff you only do once or on area/region changes */ +static void file_ui_area_init(wmWindowManager *wm, ARegion *ar) +{ + UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy); +} + +static void file_ui_area_draw(const bContext *C, ARegion *ar) +{ + float col[3]; + /* clear */ + UI_GetThemeColor3fv(TH_BACK, col); + glClearColor(col[0], col[1], col[2], 0.0); + glClear(GL_COLOR_BUFFER_BIT); + + /* set view2d view matrix for scrolling (without scrollers) */ + UI_view2d_view_ortho(C, &ar->v2d); + + file_draw_buttons(C, ar); + + UI_view2d_view_restore(C); +} + static void file_main_area_listener(ARegion *ar, wmNotifier *wmn) { /* context changes */ @@ -224,9 +347,8 @@ void ED_spacetype_file(void) art->regionid = RGN_TYPE_WINDOW; art->init= file_main_area_init; art->draw= file_main_area_draw; - art->listener= file_main_area_listener; - art->keymapflag= ED_KEYMAP_VIEW2D; - + // art->listener= file_main_area_listener; + art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D; BLI_addhead(&st->regiontypes, art); /* regions: header */ @@ -234,24 +356,42 @@ void ED_spacetype_file(void) art->regionid = RGN_TYPE_HEADER; art->minsizey= HEADERY; art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D; - art->init= file_header_area_init; art->draw= file_header_area_draw; - BLI_addhead(&st->regiontypes, art); - /* regions: channels */ + /* regions: ui */ + art= MEM_callocN(sizeof(ARegionType), "spacetype file region"); + art->regionid = RGN_TYPE_UI; + art->minsizey= 100; + art->keymapflag= ED_KEYMAP_UI; + art->init= file_ui_area_init; + art->draw= file_ui_area_draw; + BLI_addhead(&st->regiontypes, art); + + /* regions: channels (directories) */ art= MEM_callocN(sizeof(ARegionType), "spacetype file region"); art->regionid = RGN_TYPE_CHANNELS; - art->minsizex= 80; + art->minsizex= 200; art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D; - -// art->init= file_channel_area_init; -// art->draw= file_channel_area_draw; - + art->init= file_channel_area_init; + art->draw= file_channel_area_draw; BLI_addhead(&st->regiontypes, art); - BKE_spacetype_register(st); + } +void ED_file_init(void) +{ + char name[FILE_MAX]; + BLI_make_file_string("/", name, BLI_gethome(), ".Bfs"); + fsmenu_read_file(name); + filelist_init_icons(); +} + +void ED_file_exit(void) +{ + fsmenu_free(); + filelist_free_icons(); +}
\ No newline at end of file diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h index 353bacf7a43..454ebd4873e 100644 --- a/source/blender/makesdna/DNA_screen_types.h +++ b/source/blender/makesdna/DNA_screen_types.h @@ -194,6 +194,7 @@ typedef struct ARegion { #define RGN_TYPE_HEADER 1 #define RGN_TYPE_CHANNELS 2 #define RGN_TYPE_TEMPORARY 3 +#define RGN_TYPE_UI 4 /* region alignment */ #define RGN_ALIGN_NONE 0 diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 170542ab530..3943d552d41 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -51,6 +51,8 @@ struct bNodeTree; struct uiBlock; struct FileList; struct bGPdata; +struct FileSelectParams; +struct wmOperator; /** * The base structure all the other spaces @@ -160,35 +162,27 @@ typedef struct SpaceFile { SpaceLink *next, *prev; ListBase regionbase; /* storage of regions for inactive spaces */ int spacetype; - float blockscale; - - short blockhandler[8]; - struct direntry *filelist; - int totfile; - - char title[24]; - char dir[240]; - char file[80]; + struct FileSelectParams* params; /* config and input for file select */ - short type, ofs, flag, sort; - short maxnamelen, collums, f_fp, pad1; - int pad2; - char fp_str[8]; + /* operator that is invoking fileselect + op->exec() will be called on the 'Load' button. + if operator provides op->cancel(), then this will be invoked + on the cancel button. + */ + struct wmOperator *op; + + /* view settings - XXX - move into own struct */ + short prv_w; + short prv_h; + short tile_w; + short tile_h; + short tile_border_x; + short tile_border_y; + short prv_border_x; + short prv_border_y; - struct BlendHandle *libfiledata; - - unsigned short retval; /* event */ - short menu, act, ipotype; - - /* one day we'll add unions to dna */ - void (*returnfunc)(char *); - void (*returnfunc_event)(unsigned short); - void (*returnfunc_args)(char *, void *, void *); - void *arg1, *arg2; - short *menup; /* pointer to menu result or ID browsing */ - char *pupmenu; /* optional menu in header */ } SpaceFile; typedef struct SpaceOops { diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 4bac829c80a..3bb49b60715 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -127,7 +127,9 @@ void WM_init(bContext *C) set_blender_test_break_cb(wm_window_testbreak); /* blender.c */ ED_spacetypes_init(); /* editors/area/spacetype.c */ - + + ED_file_init(); /* for fsmenu */ + /* get the default database, plus a wm */ WM_read_homefile(C, 0); @@ -141,8 +143,6 @@ void WM_init(bContext *C) // XXX BIF_preview_init_dbase(); -// XXX UI_filelist_init_icons(); - GPU_extensions_init(); G.ndofdevice = -1; /* XXX bad initializer, needs set otherwise buttons show! */ @@ -259,6 +259,8 @@ void WM_exit(bContext *C) BKE_undo_save_quit(); // saves quit.blend if global undo is on BKE_reset_undo(); + ED_file_exit(); /* for fsmenu */ + UI_exit(); BLI_freelistN(&U.themes); // XXX BIF_preview_free_dbase(); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 305d72a53c6..a703f2b5c0e 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -46,6 +46,9 @@ #include "BKE_main.h" #include "BKE_utildefines.h" +#include "ED_fileselect.h" +#include "ED_screen.h" + #include "RNA_access.h" #include "RNA_define.h" @@ -60,7 +63,7 @@ #include "wm_subwindow.h" #include "wm_event_system.h" -#include "ED_screen.h" + static ListBase global_ops= {NULL, NULL}; @@ -306,6 +309,9 @@ static int wm_recentfile_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } +// XXX for Ton: bad level, maybe this needs export in ED_screen? +extern void area_newspace(bContext *C, ScrArea *sa, int type); + static void WM_OT_open_recentfile(wmOperatorType *ot) { ot->name= "Open Recent File"; @@ -321,6 +327,87 @@ static void WM_OT_open_recentfile(wmOperatorType *ot) } +/* ********* main file *********** */ + +static int wm_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + wmWindow *newwin, *win; + bScreen *newsc, *sc; + ScrArea *sa, *oldsa; + SpaceFile *sfile; + + rcti rect; + + win= CTX_wm_window(C); + sc= CTX_wm_screen(C); + oldsa= CTX_wm_area(C); + +#if 0 /* XXX experimental code for opening filebrowser in new window */ + /* poll() checks area context, but we don't accept full-area windows */ + if(sc->full != SCREENNORMAL) + return OPERATOR_CANCELLED; + + /* adds window to WM */ + rect.xmin = 0; + rect.ymin = 0; + rect.xmax = win->sizex; + rect.ymax = win->sizey; + BLI_translate_rcti(&rect, win->posx, win->posy); + newwin= WM_window_open(C, &rect); + + /* allocs new screen and adds to newly created window, using window size */ + newsc= screen_add(newwin, CTX_data_scene(C), sc->id.name+2); + newwin->screen= newsc; + + /* create filebrowser */ + CTX_wm_window_set(C, newwin); + CTX_wm_screen_set(C, newsc); + sa= (ScrArea*)newsc->areabase.first; + CTX_wm_area_set(C, sa); + area_newspace(C, sa, SPACE_FILE); +#else + area_newspace(C, oldsa, SPACE_FILE); +#endif + + /* settings for filebrowser */ + sfile= (SpaceFile*)CTX_wm_space_data(C); + sfile->op = op; + + ED_fileselect_set_params(C, FILE_BLENDER, "Load", "C:\\", 0, 0, 0); + + /* screen, areas init */ + WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL); + + return OPERATOR_RUNNING_MODAL; +} + +static int wm_mainfile_exec(bContext *C, wmOperator *op) +{ + char filename[FILE_MAX]; + RNA_string_get(op->ptr, "filename", filename); + + WM_read_file(C, filename, op->reports); + + WM_event_add_notifier(C, NC_WINDOW, NULL); + + return 0; +} + +static void WM_OT_open_mainfile(wmOperatorType *ot) +{ + ot->name= "Open Blender File"; + ot->idname= "WM_OT_open_mainfile"; + + ot->invoke= wm_mainfile_invoke; + ot->exec= wm_mainfile_exec; + ot->poll= WM_operator_winactive; + + ot->flag= OPTYPE_REGISTER; + + RNA_def_property(ot->srna, "filename", PROP_STRING, PROP_FILEPATH); + +} + /* *********************** */ static void WM_OT_window_fullscreen_toggle(wmOperatorType *ot) @@ -748,6 +835,7 @@ void wm_operatortype_init(void) WM_operatortype_append(WM_OT_exit_blender); WM_operatortype_append(WM_OT_tweak_gesture); WM_operatortype_append(WM_OT_open_recentfile); + WM_operatortype_append(WM_OT_open_mainfile); } /* default keymap for windows and screens, only call once per WM */ @@ -759,6 +847,7 @@ void wm_window_keymap(wmWindowManager *wm) WM_keymap_verify_item(keymap, "WM_OT_window_duplicate", AKEY, KM_PRESS, KM_CTRL|KM_ALT, 0); WM_keymap_verify_item(keymap, "WM_OT_save_homefile", UKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_verify_item(keymap, "WM_OT_open_recentfile", OKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_verify_item(keymap, "WM_OT_open_mainfile", F1KEY, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "WM_OT_window_fullscreen_toggle", FKEY, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "WM_OT_exit_blender", QKEY, KM_PRESS, KM_CTRL, 0); } |