Ignore:
Timestamp:
May 21, 2008, 11:02:07 PM (16 years ago)
Author:
dai_9181
Message:

Projectクラスをリファクタリング

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/abdev/src/ProjectManager/ProjectManager.cpp

    r622 r623  
    2525    lstrcpy(pobj_nv->DefSaveDir,this->GetWorkDir().GetPath().c_str());
    2626
    27 
    28     //////////////////////////////////////////
    29     // リソースデータ用領域を確保
    30     this->res.pCursorResInfo=(RESITEMINFO *)HeapAlloc(hHeap,0,1);
    31     this->res.NumberOfCursorRes=0;
    32     this->res.pBitmapResInfo=(RESITEMINFO *)HeapAlloc(hHeap,0,1);
    33     this->res.NumberOfBitmapRes=0;
    34     this->res.pIconResInfo=(RESITEMINFO *)HeapAlloc(hHeap,0,1);
    35     this->res.NumberOfIconRes=0;
    3627
    3728
     
    242233
    243234    // リソースを読み込む
    244     Jenga::Common::Path resourcePath( projectInfo.GetResourceFileFullPath() );
     235    Jenga::Common::Path resourcePath( this->GetResourceFileFullPath() );
    245236    if( resourcePath.IsExistFile() )
    246237    {
    247         GetResourceData();
     238        this->resourceManager.Load( this->GetResourceFileFullPath() );
    248239    }
    249240
     
    302293        if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){
    303294            if(MdiInfo[WndNum].MdiIconEditInfo->bModify){
    304                 for(i=0;i<this->res.NumberOfIconRes;i++){
    305                     lstrcpy(temporary,this->res.pIconResInfo[i].path);
     295                for(i=0;i<this->resourceManager.iconResources.size();i++){
     296                    lstrcpy(temporary,this->resourceManager.iconResources[i].filepath.c_str());
    306297                    lstrcpy( temporary, this->GetWorkDir().GetFullPath( temporary ).c_str() );
    307298                    if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){
     
    366357        i2=0;
    367358        i3=101;
    368         for(i=0;i<this->res.NumberOfCursorRes;i++,i3++){
     359        for(i=0;i<this->resourceManager.cursorResources.size();i++,i3++){
    369360            sprintf(buffer+i2,"Const %s=%d\r\n",
    370                 this->res.pCursorResInfo[i].IdName,
     361                this->resourceManager.cursorResources[i].idName.c_str(),
    371362                i3);
    372363            i2+=lstrlen(buffer+i2);
    373364        }
    374         for(i=0;i<this->res.NumberOfBitmapRes;i++,i3++){
     365        for(i=0;i<this->resourceManager.bitmapResources.size();i++,i3++){
    375366            sprintf(buffer+i2,"Const %s=%d\r\n",
    376                 this->res.pBitmapResInfo[i].IdName,
     367                this->resourceManager.bitmapResources[i].idName.c_str(),
    377368                i3);
    378369            i2+=lstrlen(buffer+i2);
    379370        }
    380         for(i=0;i<this->res.NumberOfIconRes;i++,i3++){
     371        for(i=0;i<this->resourceManager.iconResources.size();i++,i3++){
    381372            sprintf(buffer+i2,"Const %s=%d\r\n",
    382                 this->res.pIconResInfo[i].IdName,
     373                this->resourceManager.iconResources[i].idName.c_str(),
    383374                i3);
    384375            i2+=lstrlen(buffer+i2);
     
    389380
    390381        i2=0;
    391         for(i=0;i<this->res.NumberOfCursorRes;i++){
     382        for(i=0;i<this->resourceManager.cursorResources.size();i++){
    392383            sprintf(buffer+i2,"%s CURSOR \"%s\"\r\n",
    393                 this->res.pCursorResInfo[i].IdName,
    394                 this->res.pCursorResInfo[i].path);
    395             i2+=lstrlen(buffer+i2);
    396         }
    397         for(i=0;i<this->res.NumberOfBitmapRes;i++){
     384                this->resourceManager.cursorResources[i].idName.c_str(),
     385                this->resourceManager.cursorResources[i].filepath.c_str());
     386            i2+=lstrlen(buffer+i2);
     387        }
     388        for(i=0;i<this->resourceManager.bitmapResources.size();i++){
    398389            sprintf(buffer+i2,"%s BITMAP \"%s\"\r\n",
    399                 this->res.pBitmapResInfo[i].IdName,
    400                 this->res.pBitmapResInfo[i].path);
    401             i2+=lstrlen(buffer+i2);
    402         }
    403         for(i=0;i<this->res.NumberOfIconRes;i++){
     390                this->resourceManager.bitmapResources[i].idName.c_str(),
     391                this->resourceManager.bitmapResources[i].filepath.c_str());
     392            i2+=lstrlen(buffer+i2);
     393        }
     394        for(i=0;i<this->resourceManager.iconResources.size();i++){
    404395            sprintf(buffer+i2,"%s ICON \"%s\"\r\n",
    405                 this->res.pIconResInfo[i].IdName,
    406                 this->res.pIconResInfo[i].path);
     396                this->resourceManager.iconResources[i].idName.c_str(),
     397                this->resourceManager.iconResources[i].filepath.c_str());
    407398            i2+=lstrlen(buffer+i2);
    408399        }
     
    578569        }
    579570        else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){
    580             for(i=0;this->res.NumberOfIconRes;i++){
    581                 lstrcpy(temporary,this->res.pIconResInfo[i].path);
     571            for(i=0;this->resourceManager.iconResources.size();i++){
     572                lstrcpy(temporary,this->resourceManager.iconResources[i].filepath.c_str());
    582573                lstrcpy( temporary, this->GetWorkDir().GetFullPath( temporary ).c_str() );
    583574                if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){
     
    627618
    628619    //リソースのメモリを解放
    629     for(i=0;i<this->res.NumberOfCursorRes;i++){
    630         HeapDefaultFree(this->res.pCursorResInfo[i].IdName);
    631         HeapDefaultFree(this->res.pCursorResInfo[i].path);
    632     }
    633     HeapDefaultFree(this->res.pCursorResInfo);
    634     for(i=0;i<this->res.NumberOfBitmapRes;i++){
    635         HeapDefaultFree(this->res.pBitmapResInfo[i].IdName);
    636         HeapDefaultFree(this->res.pBitmapResInfo[i].path);
    637     }
    638     HeapDefaultFree(this->res.pBitmapResInfo);
    639     for(i=0;i<this->res.NumberOfIconRes;i++){
    640         HeapDefaultFree(this->res.pIconResInfo[i].IdName);
    641         HeapDefaultFree(this->res.pIconResInfo[i].path);
    642     }
    643     HeapDefaultFree(this->res.pIconResInfo);
     620    this->resourceManager.Clear();
    644621
    645622    //プロジェクト ビューを非表示にする
Note: See TracChangeset for help on using the changeset viewer.