Changeset 622 in dev
- Timestamp:
- May 21, 2008, 1:16:21 PM (17 years ago)
- Location:
- trunk/ab5.0
- Files:
-
- 6 added
- 1 deleted
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/BasicCompiler_Common/BasicCompiler.h
r541 r622 25 25 //リソース情報 26 26 char ResourceFileName[MAX_PATH]; 27 RESOURCEDATAINFO *pCursorResourceInfo;28 int CursorResourceNum;29 RESOURCEDATAINFO *pBitmapResourceInfo;30 int BitmapResourceNum;31 RESOURCEDATAINFO *pIconResourceInfo;32 int IconResourceNum;33 char szManifestPath[MAX_PATH];34 int XPManiResourceNum;35 27 36 28 //デバッグ -
trunk/ab5.0/abdev/BasicCompiler_Common/MakeExe.cpp
r605 r622 237 237 MakeExe(); 238 238 239 //リソース情報を解放240 extern RESOURCEDATAINFO *pCursorResourceInfo;241 extern RESOURCEDATAINFO *pIconResourceInfo;242 extern RESOURCEDATAINFO *pBitmapResourceInfo;243 HeapDefaultFree(pCursorResourceInfo);244 HeapDefaultFree(pBitmapResourceInfo);245 HeapDefaultFree(pIconResourceInfo);246 247 239 //コンパイルダイアログのプログレスバーを上げる 248 240 StepCompileProgress(); -
trunk/ab5.0/abdev/BasicCompiler_Common/RSrcSection.cpp
r467 r622 61 61 62 62 //カーソルリソース 63 extern RESOURCEDATAINFO *pCursorResourceInfo;64 extern int CursorResourceNum;65 63 int CursorNum; 66 64 CURSORDIR *pCursorDir; … … 69 67 CursorNum=0; 70 68 71 //ビットマップリソース72 extern RESOURCEDATAINFO *pBitmapResourceInfo;73 extern int BitmapResourceNum;74 75 69 //アイコンリソース 76 extern RESOURCEDATAINFO *pIconResourceInfo;77 extern int IconResourceNum;78 70 int IconNum; 79 71 ICONDIR *pIconDir; … … 82 74 IconNum=0; 83 75 84 //XPManifestリソース85 extern char szManifestPath[MAX_PATH];86 extern int XPManiResourceNum;87 88 76 BufSize=8192*2; 89 77 buffer=(char *)HeapAlloc(hHeap,0,BufSize); … … 97 85 *pLen=0; 98 86 99 if(CursorResourceNum==0&& 100 BitmapResourceNum==0&& 101 IconResourceNum==0&& 102 XPManiResourceNum==0) return buffer; 87 if( compiler.resourceManager.cursorResources.empty() 88 && compiler.resourceManager.bitmapResources.empty() 89 && compiler.resourceManager.iconResources.empty() 90 && compiler.resourceManager.manifestFilePath.empty() ) 91 { 92 return buffer; 93 } 103 94 104 95 sw=0; 105 96 106 97 //カーソルの枚数を計算(CursorNumに格納) 107 for(i3=0;i3< CursorResourceNum;i3++){108 hFile=CreateFile( pCursorResourceInfo[i3].FileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);98 for(i3=0;i3<compiler.resourceManager.cursorResources.size();i3++){ 99 hFile=CreateFile(compiler.resourceManager.cursorResources[i3].filepath.c_str(),GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 109 100 if(hFile==INVALID_HANDLE_VALUE){ 110 compiler.errorMessenger.Output(23, pCursorResourceInfo[i3].FileName,-1);101 compiler.errorMessenger.Output(23,compiler.resourceManager.cursorResources[i3].filepath.c_str(),-1); 111 102 sw=1; 112 103 continue; … … 124 115 125 116 //ビットマップのファイルの有無を確認 126 for(i3=0;i3< BitmapResourceNum;i3++){127 hFile=CreateFile( pBitmapResourceInfo[i3].FileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);117 for(i3=0;i3<compiler.resourceManager.bitmapResources.size();i3++){ 118 hFile=CreateFile(compiler.resourceManager.bitmapResources[i3].filepath.c_str(),GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 128 119 if(hFile==INVALID_HANDLE_VALUE){ 129 compiler.errorMessenger.Output(23, pBitmapResourceInfo[i3].FileName,-1);120 compiler.errorMessenger.Output(23,compiler.resourceManager.bitmapResources[i3].filepath.c_str(),-1); 130 121 sw=1; 131 122 continue; … … 135 126 136 127 //アイコンの枚数を計算(IconNumに格納) 137 for(i3=0;i3< IconResourceNum;i3++){138 hFile=CreateFile( pIconResourceInfo[i3].FileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);128 for(i3=0;i3<compiler.resourceManager.iconResources.size();i3++){ 129 hFile=CreateFile(compiler.resourceManager.iconResources[i3].filepath.c_str(),GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 139 130 if(hFile==INVALID_HANDLE_VALUE){ 140 compiler.errorMessenger.Output(23, pIconResourceInfo[i3].FileName,-1);131 compiler.errorMessenger.Output(23,compiler.resourceManager.iconResources[i3].filepath.c_str(),-1); 141 132 sw=1; 142 133 continue; … … 161 152 ///////////////////////// 162 153 TypeNum=0; 163 if( CursorResourceNum) TypeNum+=2;164 if( BitmapResourceNum) TypeNum++;165 if( IconResourceNum) TypeNum+=2;166 if( XPManiResourceNum) TypeNum++;154 if( !compiler.resourceManager.cursorResources.empty() ) TypeNum+=2; 155 if( !compiler.resourceManager.bitmapResources.empty() ) TypeNum++; 156 if( !compiler.resourceManager.iconResources.empty() ) TypeNum+=2; 157 if( !compiler.resourceManager.manifestFilePath.empty() ) TypeNum++; 167 158 168 159 NextBase=sizeof(IMAGE_RESOURCE_DIRECTORY)+ … … 193 184 sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY)*CursorNum; 194 185 } 195 if( BitmapResourceNum){186 if( !compiler.resourceManager.bitmapResources.empty() ){ 196 187 //RT_BITMAP 197 188 ImgDirEntry.Name=(DWORD)(LONG_PTR)RT_BITMAP; … … 202 193 //2階層のサイズ 203 194 i6+= sizeof(IMAGE_RESOURCE_DIRECTORY)+ 204 sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY) *BitmapResourceNum;195 sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY) * compiler.resourceManager.bitmapResources.size(); 205 196 } 206 197 if(IconNum){ … … 215 206 sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY)*IconNum; 216 207 } 217 if(CursorResourceNum){ 208 if( !compiler.resourceManager.cursorResources.empty() ) 209 { 218 210 //RT_GROUP_CURSOR 219 211 ImgDirEntry.Name=(DWORD)(LONG_PTR)RT_GROUP_CURSOR; … … 226 218 sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY)*CursorNum; 227 219 } 228 if(IconResourceNum){ 220 if( !compiler.resourceManager.iconResources.empty() ) 221 { 229 222 //RT_GROUP_ICON 230 223 ImgDirEntry.Name=(DWORD)(LONG_PTR)RT_GROUP_ICON; … … 235 228 //2階層のサイズ 236 229 i6+= sizeof(IMAGE_RESOURCE_DIRECTORY)+ 237 sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY)*IconResourceNum; 238 } 239 if(XPManiResourceNum){ 230 sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY) * compiler.resourceManager.iconResources.size(); 231 } 232 if( !compiler.resourceManager.manifestFilePath.empty() ) 233 { 240 234 //RT_MANIFEST 241 235 ImgDirEntry.Name=(DWORD)(LONG_PTR)RT_MANIFEST; … … 246 240 //2階層のサイズ 247 241 i6+= sizeof(IMAGE_RESOURCE_DIRECTORY)+ 248 sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY) *XPManiResourceNum;242 sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY) * 1/*XPManiResourceNum*/ ; 249 243 } 250 244 … … 279 273 sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY))*CursorNum; 280 274 } 281 if( BitmapResourceNum){275 if( !compiler.resourceManager.bitmapResources.empty() ){ 282 276 //RT_BITMAP 283 277 ImgResDir.Characteristics=0; … … 286 280 ImgResDir.MinorVersion=0; 287 281 ImgResDir.NumberOfNamedEntries=0; 288 ImgResDir.NumberOfIdEntries =BitmapResourceNum;282 ImgResDir.NumberOfIdEntries = compiler.resourceManager.bitmapResources.size(); 289 283 memcpy(buffer+i2,&ImgResDir,sizeof(IMAGE_RESOURCE_DIRECTORY)); 290 284 i2+=sizeof(IMAGE_RESOURCE_DIRECTORY); 291 285 292 for(i3=0;i3<BitmapResourceNum;i3++){ 293 ImgDirEntry.Name=pBitmapResourceInfo[i3].dwId; 286 for(i3=0;i3<compiler.resourceManager.bitmapResources.size();i3++) 287 { 288 ImgDirEntry.Name = compiler.GetObjectModule().meta.GetGlobalConsts().GetWholeData( 289 ActiveBasic::Compiler::LexicalAnalyzer::FullNameToSymbol( 290 compiler.resourceManager.bitmapResources[i3].idName 291 ) 292 ); 294 293 ImgDirEntry.OffsetToData=(NextBase+i6+ 295 294 (sizeof(IMAGE_RESOURCE_DIRECTORY)+ … … 301 300 302 301 i6+=(sizeof(IMAGE_RESOURCE_DIRECTORY)+ 303 sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY)) *BitmapResourceNum;302 sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY)) * compiler.resourceManager.bitmapResources.size(); 304 303 } 305 304 if(IconNum){ … … 328 327 sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY))*IconNum; 329 328 } 330 if(CursorResourceNum){ 329 if( !compiler.resourceManager.cursorResources.empty() ) 330 { 331 331 //RT_GROUP_CURSOR 332 332 ImgResDir.Characteristics=0; … … 335 335 ImgResDir.MinorVersion=0; 336 336 ImgResDir.NumberOfNamedEntries=0; 337 ImgResDir.NumberOfIdEntries =CursorResourceNum;337 ImgResDir.NumberOfIdEntries = compiler.resourceManager.cursorResources.size(); 338 338 memcpy(buffer+i2,&ImgResDir,sizeof(IMAGE_RESOURCE_DIRECTORY)); 339 339 i2+=sizeof(IMAGE_RESOURCE_DIRECTORY); 340 340 341 for(i3=0;i3<CursorResourceNum;i3++){ 342 ImgDirEntry.Name=pCursorResourceInfo[i3].dwId; 341 for(i3=0;i3<compiler.resourceManager.cursorResources.size();i3++){ 342 ImgDirEntry.Name = compiler.GetObjectModule().meta.GetGlobalConsts().GetWholeData( 343 ActiveBasic::Compiler::LexicalAnalyzer::FullNameToSymbol( 344 compiler.resourceManager.cursorResources[i3].idName 345 ) 346 ); 343 347 ImgDirEntry.OffsetToData=(NextBase+i6+ 344 348 (sizeof(IMAGE_RESOURCE_DIRECTORY)+ … … 351 355 //3階層のサイズ 352 356 i6+=(sizeof(IMAGE_RESOURCE_DIRECTORY)+ 353 sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY))*CursorResourceNum; 354 } 355 if(IconResourceNum){ 357 sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY)) * compiler.resourceManager.cursorResources.size(); 358 } 359 if( !compiler.resourceManager.iconResources.empty() ) 360 { 356 361 //RT_GROUP_ICON 357 362 ImgResDir.Characteristics=0; … … 360 365 ImgResDir.MinorVersion=0; 361 366 ImgResDir.NumberOfNamedEntries=0; 362 ImgResDir.NumberOfIdEntries =IconResourceNum;367 ImgResDir.NumberOfIdEntries = compiler.resourceManager.iconResources.size(); 363 368 memcpy(buffer+i2,&ImgResDir,sizeof(IMAGE_RESOURCE_DIRECTORY)); 364 369 i2+=sizeof(IMAGE_RESOURCE_DIRECTORY); 365 370 366 for(i3=0;i3<IconResourceNum;i3++){ 367 ImgDirEntry.Name=pIconResourceInfo[i3].dwId; 371 for(i3=0;i3<compiler.resourceManager.iconResources.size();i3++){ 372 ImgDirEntry.Name = compiler.GetObjectModule().meta.GetGlobalConsts().GetWholeData( 373 ActiveBasic::Compiler::LexicalAnalyzer::FullNameToSymbol( 374 compiler.resourceManager.iconResources[i3].idName 375 ) 376 ); 368 377 ImgDirEntry.OffsetToData=(NextBase+i6+ 369 378 (sizeof(IMAGE_RESOURCE_DIRECTORY)+ … … 376 385 //3階層のサイズ 377 386 i6+=(sizeof(IMAGE_RESOURCE_DIRECTORY)+ 378 sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY))*IconResourceNum; 379 } 380 if(XPManiResourceNum){ 387 sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY)) * compiler.resourceManager.iconResources.size(); 388 } 389 if( !compiler.resourceManager.manifestFilePath.empty() ) 390 { 381 391 //RT_MANIFEST 382 392 ImgResDir.Characteristics=0; … … 385 395 ImgResDir.MinorVersion=0; 386 396 ImgResDir.NumberOfNamedEntries=0; 387 ImgResDir.NumberOfIdEntries =XPManiResourceNum;397 ImgResDir.NumberOfIdEntries = 1 /*XPManiResourceNum*/ ; 388 398 memcpy(buffer+i2,&ImgResDir,sizeof(IMAGE_RESOURCE_DIRECTORY)); 389 399 i2+=sizeof(IMAGE_RESOURCE_DIRECTORY); 390 400 391 for(i3=0;i3<XPManiResourceNum;i3++){ 401 i3 = 0; 402 { 392 403 ImgDirEntry.Name=i3+1; 393 404 ImgDirEntry.OffsetToData=(NextBase+i6+ … … 400 411 401 412 i6+=(sizeof(IMAGE_RESOURCE_DIRECTORY)+ 402 sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY)) *XPManiResourceNum;413 sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY)) * 1 /*XPManiResourceNum*/ ; 403 414 } 404 415 … … 434 445 i6+=sizeof(IMAGE_RESOURCE_DATA_ENTRY)*CursorNum; 435 446 } 436 if( BitmapResourceNum){447 if( !compiler.resourceManager.bitmapResources.empty() ){ 437 448 //RT_BITMAP 438 for(i3=0;i3< BitmapResourceNum;i3++){449 for(i3=0;i3<compiler.resourceManager.bitmapResources.size();i3++){ 439 450 ImgResDir.Characteristics=0; 440 451 ImgResDir.TimeDateStamp=0; … … 453 464 } 454 465 455 i6+=sizeof(IMAGE_RESOURCE_DATA_ENTRY) *BitmapResourceNum;466 i6+=sizeof(IMAGE_RESOURCE_DATA_ENTRY) * compiler.resourceManager.bitmapResources.size(); 456 467 } 457 468 if(IconNum){ … … 476 487 i6+=sizeof(IMAGE_RESOURCE_DATA_ENTRY)*IconNum; 477 488 } 478 if(CursorResourceNum){ 489 if( !compiler.resourceManager.cursorResources.empty() ) 490 { 479 491 //RT_GROUP_CURSOR 480 for(i3=0;i3< CursorResourceNum;i3++){492 for(i3=0;i3<compiler.resourceManager.cursorResources.size();i3++){ 481 493 ImgResDir.Characteristics=0; 482 494 ImgResDir.TimeDateStamp=0; … … 495 507 } 496 508 497 i6+=sizeof(IMAGE_RESOURCE_DATA_ENTRY)*CursorResourceNum; 498 } 499 if(IconResourceNum){ 509 i6+=sizeof(IMAGE_RESOURCE_DATA_ENTRY) * compiler.resourceManager.cursorResources.size(); 510 } 511 if( !compiler.resourceManager.iconResources.empty() ) 512 { 500 513 //RT_GROUP_ICON 501 for(i3=0;i3< IconResourceNum;i3++){514 for(i3=0;i3<compiler.resourceManager.iconResources.size();i3++){ 502 515 ImgResDir.Characteristics=0; 503 516 ImgResDir.TimeDateStamp=0; … … 516 529 } 517 530 518 i6+=sizeof(IMAGE_RESOURCE_DATA_ENTRY)* IconResourceNum;519 } 520 if( XPManiResourceNum){531 i6+=sizeof(IMAGE_RESOURCE_DATA_ENTRY)*compiler.resourceManager.iconResources.size(); 532 } 533 if( !compiler.resourceManager.manifestFilePath.empty() ){ 521 534 //RT_MANIFEST 522 for(i3=0;i3<XPManiResourceNum;i3++){ 535 i3 = 0; 536 { 523 537 ImgResDir.Characteristics=0; 524 538 ImgResDir.TimeDateStamp=0; … … 537 551 } 538 552 539 i6+=sizeof(IMAGE_RESOURCE_DATA_ENTRY) *XPManiResourceNum;553 i6+=sizeof(IMAGE_RESOURCE_DATA_ENTRY) * 1 /*XPManiResourceNum*/ ; 540 554 } 541 555 … … 576 590 //RT_BITMAP 577 591 BitmapEntryBase=DataEntryScheduleNum; 578 for(i3=0;i3< BitmapResourceNum;i3++){592 for(i3=0;i3<compiler.resourceManager.bitmapResources.size();i3++){ 579 593 dwDataEntrySchedule[DataEntryScheduleNum]=i2; 580 594 DataEntryScheduleNum++; … … 594 608 //RT_GROUP_CURSOR 595 609 CursorGroupEntryBase=DataEntryScheduleNum; 596 for(i3=0;i3< CursorResourceNum;i3++){610 for(i3=0;i3<compiler.resourceManager.cursorResources.size();i3++){ 597 611 dwDataEntrySchedule[DataEntryScheduleNum]=i2; 598 612 DataEntryScheduleNum++; … … 603 617 //RT_GROUP_ICON 604 618 IconGroupEntryBase=DataEntryScheduleNum; 605 for(i3=0;i3< IconResourceNum;i3++){619 for(i3=0;i3<compiler.resourceManager.iconResources.size();i3++){ 606 620 dwDataEntrySchedule[DataEntryScheduleNum]=i2; 607 621 DataEntryScheduleNum++; … … 613 627 int XPManiEntryBase; 614 628 XPManiEntryBase=DataEntryScheduleNum; 615 for(i3=0;i3<XPManiResourceNum;i3++){ 629 i3 = 0; 630 { 616 631 dwDataEntrySchedule[DataEntryScheduleNum]=i2; 617 632 DataEntryScheduleNum++; … … 642 657 643 658 //カーソルリソース 644 for(i3=0,i6=0;i3< CursorResourceNum;i3++){645 hFile=CreateFile( pCursorResourceInfo[i3].FileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);659 for(i3=0,i6=0;i3<compiler.resourceManager.cursorResources.size();i3++){ 660 hFile=CreateFile(compiler.resourceManager.cursorResources[i3].filepath.c_str(),GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 646 661 if(hFile==INVALID_HANDLE_VALUE){ 647 compiler.errorMessenger.Output(23, pCursorResourceInfo[i3].FileName,-1);662 compiler.errorMessenger.Output(23,compiler.resourceManager.cursorResources[i3].filepath.c_str(),-1); 648 663 return buffer; 649 664 } … … 722 737 723 738 //ビットマップリソース 724 for(i3=0;i3< BitmapResourceNum;i3++){725 hFile=CreateFile( pBitmapResourceInfo[i3].FileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);739 for(i3=0;i3<compiler.resourceManager.bitmapResources.size();i3++){ 740 hFile=CreateFile(compiler.resourceManager.bitmapResources[i3].filepath.c_str(),GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 726 741 if(hFile==INVALID_HANDLE_VALUE){ 727 compiler.errorMessenger.Output(23, pBitmapResourceInfo[i3].FileName,-1);742 compiler.errorMessenger.Output(23,compiler.resourceManager.bitmapResources[i3].filepath.c_str(),-1); 728 743 return buffer; 729 744 } … … 750 765 751 766 //アイコンリソース 752 for(i3=0,i6=0;i3< IconResourceNum;i3++){753 hFile=CreateFile( pIconResourceInfo[i3].FileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);767 for(i3=0,i6=0;i3<compiler.resourceManager.iconResources.size();i3++){ 768 hFile=CreateFile(compiler.resourceManager.iconResources[i3].filepath.c_str(),GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 754 769 if(hFile==INVALID_HANDLE_VALUE){ 755 compiler.errorMessenger.Output(23, pIconResourceInfo[i3].FileName,-1);770 compiler.errorMessenger.Output(23,compiler.resourceManager.iconResources[i3].filepath.c_str(),-1); 756 771 return buffer; 757 772 } … … 831 846 832 847 //XPManifestリソース 833 for(i3=0;i3<XPManiResourceNum;i3++){ 834 extern char BasicCurDir[MAX_PATH]; 835 extern char szManifestPath[MAX_PATH]; 836 char temp2[MAX_PATH]; 837 lstrcpy(temp2,szManifestPath); 838 GetFullPath(temp2,BasicCurDir); 839 hFile=CreateFile(temp2,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 848 i3 = 0; 849 if( !compiler.resourceManager.manifestFilePath.empty() ) 850 { 851 hFile=CreateFile(compiler.resourceManager.manifestFilePath.c_str(),GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 840 852 if(hFile==INVALID_HANDLE_VALUE){ 841 compiler.errorMessenger.Output(59, temp2,-1);853 compiler.errorMessenger.Output(59,compiler.resourceManager.manifestFilePath.c_str(),-1); 842 854 return buffer; 843 855 } … … 857 869 //アプリケーション名をセット 858 870 char szAppliName[MAX_PATH]; 871 char temp2[MAX_PATH]; 859 872 _splitpath( program.GetOutputFilePath().c_str(),NULL,NULL,szAppliName,temp2); 860 873 lstrcat(szAppliName,temp2); -
trunk/ab5.0/abdev/BasicCompiler_Common/common.h
r605 r622 294 294 //preprocessor.cpp 295 295 char *OpenBasicFile(char *FileName); 296 297 //Resource.cpp298 void GetResourceData(char *FileName);299 296 300 297 //CommandFormat.cpp -
trunk/ab5.0/abdev/BasicCompiler_Common/include/Compiler.h
r608 r622 94 94 Linker linker; 95 95 96 // リソースマネージャ 97 ActiveBasic::Common::ResourceManager resourceManager; 98 96 99 // 静的リンクするオブジェクトファイル 97 100 std::vector<std::string> staticLibraryFilePaths; -
trunk/ab5.0/abdev/ab_common/ab_common.vcproj
r605 r622 428 428 </File> 429 429 </Filter> 430 <Filter 431 Name="ResourceManager" 432 > 433 <File 434 RelativePath=".\src\ResourceManager\ResourceManager.cpp" 435 > 436 </File> 437 </Filter> 430 438 </Filter> 431 439 <Filter … … 535 543 <File 536 544 RelativePath=".\include\Lexical\Variable.h" 545 > 546 </File> 547 </Filter> 548 <Filter 549 Name="ResourceManager" 550 > 551 <File 552 RelativePath=".\include\ResourceManager\ResourceManager.h" 537 553 > 538 554 </File> -
trunk/ab5.0/abdev/ab_common/include/ab_common.h
r603 r622 29 29 #include "Lexical/DataTable.h" 30 30 #include "Lexical/ObjectModule.h" 31 32 #include "ResourceManager/ResourceManager.h" -
trunk/ab5.0/abdev/abdev/Common.h
r620 r622 664 664 char *ReadBuffer( const std::string &path ); 665 665 char *ReadBuffer_NonErrMsg( const std::string &path ); 666 _int8 WriteBuffer(c har *path,char *buffer,int length, bool isEnableError = true);667 _int8 WriteBuffer_NonErrMsg(c har *path,char *buffer,int length);666 _int8 WriteBuffer(const std::string &path,char *buffer,int length, bool isEnableError = true); 667 _int8 WriteBuffer_NonErrMsg(const std::string &path,char *buffer,int length); 668 668 void GetRelationalPath(char *path,char *dir); 669 669 void GetFullPath(char *path,const char *dir); -
trunk/ab5.0/abdev/abdev/FileOperation.cpp
r621 r622 57 57 return buffer; 58 58 } 59 _int8 WriteBuffer(c har *path,char *buffer,int length, bool isEnableError){59 _int8 WriteBuffer(const std::string &path,char *buffer,int length, bool isEnableError){ 60 60 HANDLE hFile; 61 61 DWORD dw; 62 hFile=CreateFile(path ,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);62 hFile=CreateFile(path.c_str(),GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL); 63 63 if(hFile==INVALID_HANDLE_VALUE){ 64 64 char temporary[MAX_PATH]; … … 75 75 return 1; 76 76 } 77 _int8 WriteBuffer_NonErrMsg(c har *path,char *buffer,int length){77 _int8 WriteBuffer_NonErrMsg(const std::string &path,char *buffer,int length){ 78 78 return WriteBuffer( path, buffer, length, false ); 79 79 } -
trunk/ab5.0/abdev/abdev/Resource.cpp
r620 r622 17 17 HANDLE hFile; 18 18 19 lstrcpy(temporary,projectInfo.ResourceFileName); 20 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 21 22 hFile=CreateFile(temporary,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 19 hFile=CreateFile( projectInfo.GetResourceFileFullPath().c_str(),GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 23 20 if(hFile==INVALID_HANDLE_VALUE) return; 24 21 i2=GetFileSize(hFile,NULL); … … 123 120 } 124 121 125 //リソースが空の場合126 if(projectInfo.res.NumberOfCursorRes==0&&127 projectInfo.res.NumberOfBitmapRes==0&&128 projectInfo.res.NumberOfIconRes==0)129 projectInfo.ResourceFileName[0]=0;130 131 122 HeapDefaultFree(buffer); 132 123 } … … 137 128 int i2,i3; 138 129 char temporary[MAX_PATH]; 139 140 if(!projectInfo.ResourceFileName[0])141 sprintf(projectInfo.ResourceFileName,"%s.rc",projectInfo.GetName().c_str());142 130 143 131 //"カーソル ファイルを指定してください" … … 242 230 char temporary[MAX_PATH]; 243 231 244 if(!projectInfo.ResourceFileName[0])245 sprintf(projectInfo.ResourceFileName,"%s.rc",projectInfo.GetName().c_str());246 247 232 //"ビットマップ ファイルを指定してください" 248 233 if(!GetFilePathDialog(hOwner,temporary,BitmapFileFilter,STRING_FILEOPENTITLE_BITMAP,TRUE)) return; … … 355 340 int i2,i3; 356 341 char temporary[MAX_PATH]; 357 358 if(!projectInfo.ResourceFileName[0])359 sprintf(projectInfo.ResourceFileName,"%s.rc",projectInfo.GetName().c_str());360 342 361 343 //"アイコン ファイルを指定してください" -
trunk/ab5.0/abdev/abdev/include/ProjectManager/ProjectManager.h
r621 r622 27 27 } 28 28 29 const std::string GetResourceFileFullPath() const 30 { 31 return this->GetWorkDir().GetFullPath( this->GetName() + ".rc" ); 32 } 33 29 34 bool IsOpened() const 30 35 { … … 40 45 41 46 CDBFileInfo *pobj_DBFileInfo; 42 43 char ResourceFileName[MAX_PATH];44 47 45 48 int NumberOfMenu; -
trunk/ab5.0/abdev/abdev/src/ProjectManager/ProjectManager.cpp
r621 r622 196 196 temporary[i2]=buffer[i]; 197 197 } 198 if(temporary[0]!='\0'&&(!(temporary[0]=='0'&&temporary[1]=='\0'))){ 199 lstrcpy(this->ResourceFileName,temporary); 200 GetResourceData(); 201 } 202 else{ 203 sprintf(this->ResourceFileName,"%s.rc",this->GetName().c_str()); 204 } 198 199 // このパラメータは使用しなくなった 205 200 } 206 201 else if(lstrcmpi(temporary,"SOURCE")==0&&buffer[i]=='\r'&&buffer[i+1]=='\n'){ … … 244 239 } 245 240 sprintf(this->lpszOutput_Debug,".\\%s_debug.exe",this->GetName().c_str()); 241 } 242 243 // リソースを読み込む 244 Jenga::Common::Path resourcePath( projectInfo.GetResourceFileFullPath() ); 245 if( resourcePath.IsExistFile() ) 246 { 247 GetResourceData(); 246 248 } 247 249 … … 347 349 sprintf(buffer+i2,"#DEBUG_EXE_PATH=%s\r\n\r\n",this->szExePath); 348 350 i2+=lstrlen(buffer+i2); 349 if(this->ResourceFileName[0]){350 sprintf(buffer+i2,"#RESOURCE=%s\r\n\r\n",this->ResourceFileName);351 i2+=lstrlen(buffer+i2);352 }353 else{354 lstrcpy(buffer+i2,"#RESOURCE=0\r\n\r\n");355 i2+=lstrlen(buffer+i2);356 }357 351 sprintf(buffer+i2,"#SOURCE\r\n"); 358 352 i2+=lstrlen(buffer+i2); … … 369 363 ////////////////////////////////// 370 364 // リソースファイル(*.rc、resource.ab)を作成 371 if(this->ResourceFileName[0]){365 { 372 366 i2=0; 373 367 i3=101; … … 392 386 393 387 //保存(resource.ab) 394 lstrcpy(temporary,"resource.ab"); 395 lstrcpy( temporary, this->GetWorkDir().GetFullPath( temporary ).c_str() ); 396 WriteBuffer(temporary,buffer,i2); 388 WriteBuffer(this->GetWorkDir().GetFullPath( "resource.ab" ),buffer,i2); 397 389 398 390 i2=0; … … 424 416 425 417 //保存 426 lstrcpy(temporary,this->ResourceFileName); 427 lstrcpy( temporary, this->GetWorkDir().GetFullPath( temporary ).c_str() ); 428 WriteBuffer(temporary,buffer,i2); 418 WriteBuffer(this->GetResourceFileFullPath(),buffer,i2); 429 419 } 430 420 … … 498 488 i2+=lstrlen(buffer+i2); 499 489 } 500 if(this->ResourceFileName[0]){ 501 //リソースファイルが含まれる場合 502 lstrcpy(buffer+i2,"\r\n"); 503 i2+=lstrlen(buffer+i2); 504 lstrcpy(buffer+i2,"'リソースファイル\r\n"); 505 i2+=lstrlen(buffer+i2); 506 lstrcpy(buffer+i2,"#include \"resource.ab\"\r\n"); 507 i2+=lstrlen(buffer+i2); 508 sprintf(buffer+i2,"#resource \"%s.rc\"\r\n",this->GetName().c_str()); 509 i2+=lstrlen(buffer+i2); 510 } 490 491 //リソースファイル 492 lstrcpy(buffer+i2,"\r\n"); 493 i2+=lstrlen(buffer+i2); 494 lstrcpy(buffer+i2,"'リソースファイル\r\n"); 495 i2+=lstrlen(buffer+i2); 496 lstrcpy(buffer+i2,"#include \"resource.ab\"\r\n"); 497 i2+=lstrlen(buffer+i2); 498 sprintf(buffer+i2,"#resource \"%s.rc\"\r\n",this->GetName().c_str()); 499 i2+=lstrlen(buffer+i2); 511 500 512 501 //保存 -
trunk/ab5.0/abdev/compiler_x86/MakePeHdr.cpp
r608 r622 595 595 ///////////////////////////// 596 596 extern char ResourceFileName[MAX_PATH]; 597 GetResourceData(ResourceFileName);597 compiler.resourceManager.Load( ResourceFileName ); 598 598 599 599 -
trunk/ab5.0/abdev/compiler_x86/compiler_x86.vcproj
r603 r622 573 573 </FileConfiguration> 574 574 </File> 575 <File576 RelativePath="..\BasicCompiler_Common\Resource.cpp"577 >578 <FileConfiguration579 Name="Debug|Win32"580 >581 <Tool582 Name="VCCLCompilerTool"583 PreprocessorDefinitions=""584 />585 </FileConfiguration>586 <FileConfiguration587 Name="Release|Win32"588 >589 <Tool590 Name="VCCLCompilerTool"591 PreprocessorDefinitions=""592 />593 </FileConfiguration>594 </File>595 575 </Filter> 596 576 <Filter -
trunk/ab5.0/jenga/include/common/String.h
r607 r622 14 14 std::wstring ToWString( const std::string &str ); 15 15 16 bool IsIdentifierTopChar( char c ); 17 bool IsIdentifierChar( char c ); 16 18 17 19 } -
trunk/ab5.0/jenga/include/jenga.h
r532 r622 5 5 #include "common/CmdLine.h" 6 6 #include "common/Directory.h" 7 #include "common/EasyToken.h" 7 8 #include "common/Environment.h" 8 9 #include "common/Exception.h" -
trunk/ab5.0/jenga/projects/jenga/jenga.vcproj
r529 r622 287 287 <File 288 288 RelativePath="..\..\src\common\Directory.cpp" 289 > 290 </File> 291 <File 292 RelativePath="..\..\src\common\EasyToken.cpp" 289 293 > 290 294 </File> … … 360 364 </File> 361 365 <File 366 RelativePath="..\..\include\common\EasyToken.h" 367 > 368 </File> 369 <File 362 370 RelativePath="..\..\include\common\Environment.h" 363 371 > -
trunk/ab5.0/jenga/src/common/String.cpp
r607 r622 55 55 return wstr; 56 56 } 57 58 bool Jenga::Common::IsIdentifierTopChar( char c ) 59 { 60 return ( isalpha( c ) || c == '_' ); 61 } 62 63 bool Jenga::Common::IsIdentifierChar( char c ) 64 { 65 return ( IsIdentifierTopChar( c ) || isdigit( c ) ); 66 }
Note:
See TracChangeset
for help on using the changeset viewer.