Ticket #22: mmfolder.diff

File mmfolder.diff, 29.3 KB (added by erdmann, 8 months ago)

Changes in mmfolder.c taken against SVN rev 67

  • D:\cwmmclasses\trunk\classes\c\c_mm\mmfolder.c

     
    1616 * You should have received a copy of the GNU General Public License
    1717 * along with this program; see the file COPYING.  If not, write to
    1818 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
    19  */         
     19 */
    2020/*
    2121 * If you need another license for your project/product (commercial,
    2222 * noncommercial, whatever) contact me at
    23  * 
     23 *
    2424 * http://www.os2world.com/cdwriting
    2525 * http://www.geocities.com/SiliconValley/Sector/5785/
    2626 *
    2727 */
    2828/*
    2929 *  This file was generated by the SOM Compiler and Emitter Framework.
    30  *  Generated using: 
     30 *  Generated using:
    3131 *      SOM Emitter emitctm: 2.42
    3232 */
    3333
     
    5858#include "som_wps_funcs.h"
    5959#include "sys_funcs.h"
    6060
    61 //#if 0
    62 #ifndef  _cwmmQuerySmallBitmapHandle
    63 #define _cwmmQuerySmallBitmapHandle MMImage_cwmmQuerySmallBitmapHandle
    64 #define _cwmmQuerySmallBitmapHandleCWBitmap MMBitmap_cwmmQuerySmallBitmapHandle
    65 #endif
    66 //#endif
    6761#define STOREWINDOWID 112233
    6862
    6963//#define DEBUG
     
    8276{
    8377  somId mySomId;
    8478  static SOMClass * mWPFolderClass=NULLHANDLE;
    85  
     79
    8680  if(!mWPFolderClass) {
    8781    if((mySomId=somIdFromString("WPFolder"))!=NULLHANDLE) {
    8882      mWPFolderClass=(SOMClass*)_somClassFromId(SOMClassMgrObject, mySomId);
     
    112106{
    113107  somId mySomId;
    114108  static SOMClass *mWPImgClass=NULL;
    115  
     109
    116110  if(!mWPImgClass) {
    117111    if((mySomId=somIdFromString("MMBitmap"))!=NULLHANDLE) {
    118112      mWPImgClass=(SOMClass*)_somClassFromId(SOMClassMgrObject, mySomId);
     
    122116  return mWPImgClass;
    123117}
    124118
    125 MRESULT EXPENTRY mmFolderContainerProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 
     119MRESULT EXPENTRY mmFolderContainerProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    126120{
    127121  HWND hwndStore;
    128122  MMFolder *somSelf;
     
    141135        PCNRINFO pCnrInfo=(PCNRINFO)PVOIDFROMMP(mp1);
    142136
    143137        if(pCnrInfo) {
    144           //      writeLog("flWindowAttr: 0x%x, Mask: 0x%x, cxTreeIndent: %d, cyLineSpacing: %d\n", 
     138          //      writeLog("flWindowAttr: 0x%x, Mask: 0x%x, cxTreeIndent: %d, cyLineSpacing: %d\n",
    145139          //       pCnrInfo->flWindowAttr, LONGFROMMP(mp2), pCnrInfo->cxTreeIndent, pCnrInfo->cyLineSpacing);
    146140
    147141          if(!(pCnrInfo->flWindowAttr & (CV_DETAIL|CV_TREE/*|CV_ICON|CV_NAME*/)) &&
     
    152146              {
    153147                somSelf=(MMFolder*) WinQueryWindowULong(hwndStore,QWL_USER);
    154148                if(somIsObj(somSelf)) {
    155                   MMFolderData *somThis = MMFolderGetData(somSelf); 
    156                  
     149                  MMFolderData *somThis = MMFolderGetData(somSelf);
     150
    157151                  pCnrInfo->flWindowAttr&=~CA_DRAWICON;
    158152                  pCnrInfo->flWindowAttr|=CA_DRAWBITMAP|CA_OWNERDRAW;
    159153                  pCnrInfo->slBitmapOrIcon.cx=_ulCurrentSize;
    160154                  pCnrInfo->slBitmapOrIcon.cy=_ulCurrentSize;
    161                  
     155
    162156                  mp2=MPFROMLONG(LONGFROMMP(mp2)|CMA_SLBITMAPORICON|CMA_FLWINDOWATTR);
    163157                }
    164158              }
     
    188182        {
    189183          somSelf=(MMFolder*) WinQueryWindowULong(hwndStore,QWL_USER);
    190184          if(somIsObj(somSelf)) {
    191             MMFolderData *somThis = MMFolderGetData(somSelf); 
     185            MMFolderData *somThis = MMFolderGetData(somSelf);
    192186            if(_oldContainerProc)
    193187              return _oldContainerProc(hwnd, msg, mp1, mp2);
    194188          }
    195189        }
    196     }   
     190    }
    197191  return WinDefWindowProc(hwnd, msg, mp1, mp2);
    198192}
    199193
     
    244238{
    245239  HPOINTER hptrTemplate;
    246240  HMODULE hmodTemplate;
    247  
     241
    248242  if(!DosQueryModuleHandle("PMWP",&hmodTemplate))
    249243    {
    250244      ULONG ulIconSize;
    251      
     245
    252246      hptrTemplate=WinLoadPointer(HWND_DESKTOP, hmodTemplate, 20);
    253247      WinDrawPointer(hps, rcl->xLeft, rcl->yBottom, hptrTemplate, (flCnr &  CV_MINI ? DP_MINI:DP_NORMAL));
    254248      WinDestroyPointer(hptrTemplate);
     
    260254        }
    261255      return DP_MINI;
    262256    }
    263  
     257
    264258  return DP_NORMAL;
    265259}
    266260
    267261
    268 MRESULT EXPENTRY mmFolderFrameProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 
     262MRESULT EXPENTRY mmFolderFrameProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    269263{
    270264  HWND hwndStore;
    271265  MMFolder *somSelf;
     
    278272    case WM_DRAWITEM:
    279273      {
    280274        POWNERITEM pOwnerItem=(POWNERITEM)PVOIDFROMMP(mp2);
    281  
     275
    282276
    283277        /* We only draw icons not text */
    284278        if(pOwnerItem->idItem==CMA_ICON /*&& !bNot*/) {
     
    304298             && (pCnrDrawItemInfo->pRecord->flRecordAttr & CRA_SELECTED)) {
    305299            POINTL pointl;
    306300
    307             WinFillRect(pOwnerItem->hps, &rclTemp, CLR_WHITE);           
     301            WinFillRect(pOwnerItem->hps, &rclTemp, CLR_WHITE);
    308302            GpiSetPattern(pOwnerItem->hps,PATSYM_DIAG2);
    309303            pointl.x = rclTemp.xLeft;
    310304            pointl.y = rclTemp.yBottom;
     
    312306            pointl.x = rclTemp.xRight - 1;
    313307            pointl.y = rclTemp.yTop - 1;
    314308            GpiSetColor(pOwnerItem->hps, CLR_BLACK);
    315             GpiBox(pOwnerItem->hps,DRO_FILL,&pointl,1,1);         
    316            
     309            GpiBox(pOwnerItem->hps,DRO_FILL,&pointl,1,1);
     310
    317311          }
    318312          /* Check if record is in use */
    319313          else if(pCnrDrawItemInfo->pRecord->flRecordAttr & CRA_INUSE) {
    320314            POINTL pointl;
    321315
    322             WinFillRect(pOwnerItem->hps, &rclTemp, CLR_WHITE);           
     316            WinFillRect(pOwnerItem->hps, &rclTemp, CLR_WHITE);
    323317            GpiSetPattern(pOwnerItem->hps,PATSYM_DIAG1);
    324318            pointl.x = rclTemp.xLeft;
    325319            pointl.y = rclTemp.yBottom;
     
    327321            pointl.x = rclTemp.xRight - 1;
    328322            pointl.y = rclTemp.yTop - 1;
    329323            GpiSetColor(pOwnerItem->hps, CLR_BLACK);
    330             GpiBox(pOwnerItem->hps,DRO_FILL,&pointl,1,1);                   
     324            GpiBox(pOwnerItem->hps,DRO_FILL,&pointl,1,1);
    331325          }
    332326          /* or is it only selected? */
    333327          else if(pCnrDrawItemInfo->pRecord->flRecordAttr & CRA_SELECTED)
     
    335329          /* Default is paint white background */
    336330          else
    337331            WinFillRect(pOwnerItem->hps, &rclTemp, CLR_WHITE);
    338           /* Emphasis drawn */         
     332          /* Emphasis drawn */
    339333
    340334          /********************************************/
    341335          /*                                          */
     
    345339          if(mrc){
    346340            WPObject *wpObject;
    347341            ULONG ulIconSize=150;/* Default if query fails */
    348            
     342
    349343            wpObject=(WPObject*)OBJECT_FROM_PREC(mrc); // Get object
    350344            wpObject=somGetFileSystemObject(wpObject);  // Get Filesystem object
    351345
     
    361355#ifdef DEBUG
    362356                SysWriteToTrapLog("Object is an image. (%s line: %d)\n", __FUNCTION__, __LINE__);
    363357#endif
    364                 /* Get object pointer of lighttable folder */               
     358                /* Get object pointer of lighttable folder */
    365359                if((hwndStore=WinWindowFromID(hwnd, STOREWINDOWID))!=NULLHANDLE)
    366360                  {
    367361                    somSelf=(MMFolder*) WinQueryWindowULong(hwndStore,QWL_USER);
    368362                    if(somIsObj(somSelf)) {
    369                       MMFolderData *somThis = MMFolderGetData(somSelf); 
     363                      MMFolderData *somThis = MMFolderGetData(somSelf);
    370364                      ulIconSize=_ulCurrentSize;
    371365                    }
    372366                  }
     
    388382
    389383                    Wondering what hidden problems/bugs will show upt in the future...
    390384                    */
    391                   if((hbm=_cwmmQuerySmallBitmapHandle( (MMImage*) wpObject, ulIconSize, mrc, hwndCnr))!=NULLHANDLE)         
     385                  if((hbm=cwimg_cwmmQuerySmallBitmapHandle( (MMImage*) wpObject, ulIconSize, mrc, hwndCnr))!=NULLHANDLE)
    392386                    pBmpInfoHeader2=(PBITMAPINFOHEADER2)_wpQueryBitmapInfoHeader((MMImage*)wpObject);
    393387#ifdef DEBUG
    394388                  SysWriteToTrapLog("Queried HBITMAP: %x (line: %d)\n", hbm, __LINE__);
     
    398392                else if(_somIsA(wpObject, cwBitmapClass)) {
    399393                  /* The default WPS bitmap class (WPBitmap) returns an PBITMAPHEADER. The CWBitmap class
    400394                     does return a PBITMAPHEADER2<-. */
    401                   if((hbm=_cwmmQuerySmallBitmapHandleCWBitmap( (MMBitmap*) wpObject, ulIconSize))!=NULLHANDLE)
     395                  if((hbm=cwbmp_cwmmQuerySmallBitmapHandle( (MMBitmap*) wpObject, ulIconSize))!=NULLHANDLE)
    402396                    pBmpInfoHeader2=(PBITMAPINFOHEADER2)_cwmmQueryBitmapInfoHeader((MMBitmap*)wpObject);
    403397                }
    404398
     
    428422                      cwAdjustIconRECTL(&rcl, ulIconWidth, ulWidth, ulHeight);
    429423                      /* And now draw the bitmap */
    430424#if 0
    431                       if(pBmpInfoHeader2->cclrUsed==2) {                       
     425                      if(pBmpInfoHeader2->cclrUsed==2) {
    432426                        WinDrawBitmap(pOwnerItem->hps, hbm, NULL, (PPOINTL)&rcl,//pOwnerItem->rclItem,
    433427                                      CLR_WHITE, CLR_BLACK, DBM_STRETCH /*| DBM_IMAGEATTRS*/);
    434428                      }
     
    441435                    /* Draw a small border around the image */
    442436                    cwDraw2ColorBorder(pOwnerItem->hps, &rclTemp, CLR_BLACK, CLR_DARKGRAY);
    443437                    /* Done */
    444                     free(hbm);
     438                    if(_somIsA(wpObject, cwImageClass)) {
     439                       cwimg_cwmmFreeSmallBitmap((MMImage *)wpObject);
     440                    }
     441                    else {
     442                       cwbmp_cwmmFreeSmallBitmap((MMBitmap*)wpObject);
     443                    }
    445444                    return (MRESULT) TRUE;
    446445                  }/* hbm */
    447446              }/* cwImageClass/cwBitmapClass */
     
    474473                if(pCnrDrawItemInfo->pRecord->flRecordAttr & CRA_INUSE)
    475474                  {
    476475                    SOMClass* wpFolderClass=queryWpFolderClass();
    477                    
     476
    478477                    if(somIsObj(wpFolderClass)) {
    479                       if(_somIsA(wpObject, wpFolderClass)) {   
     478                      if(_somIsA(wpObject, wpFolderClass)) {
    480479                        /* It's a folder */
    481480                        HPOINTER hptr;
    482                        
     481
    483482                        pOwnerItem->rclItem.xLeft=rcl.xLeft;
    484483                        pOwnerItem->rclItem.yBottom=rcl.yBottom;
    485                        
     484
    486485                        /* The following is only for Warp 4 but Warp 3 isn't supported anyway...*/
    487486                        hptr=_wpQueryIconN(wpObject,1);
    488487                        if(WinDrawPointer(pOwnerItem->hps, rcl.xLeft, rcl.yBottom, hptr, ulMiniOrNormal)) {
    489488                          cwDraw2ColorBorder(pOwnerItem->hps, &rclTemp, CLR_BLACK, CLR_DARKGRAY);
    490489                          return (MRESULT) TRUE;
    491490                        }
    492                        
     491
    493492                      }
    494493                    }/* if(somIsObj(wpFolderClass)) */
    495494                  }/* if(pCnrDrawItemInfo->pRecord->flRecordAttr & CRA_INUSE) */
    496                
     495
    497496                if(WinDrawPointer(pOwnerItem->hps, rcl.xLeft, rcl.yBottom, mrc->hptrIcon, ulMiniOrNormal)) {
    498497                  cwDraw2ColorBorder(pOwnerItem->hps, &rclTemp, CLR_BLACK, CLR_DARKGRAY);
    499498                  return (MRESULT) TRUE;
     
    508507          /* It's the details view */
    509508          /*************************/
    510509          PCNRDRAWITEMINFO pCnrDrawItemInfo=(PCNRDRAWITEMINFO)pOwnerItem->hItem;
    511          
     510
    512511          if(pCnrDrawItemInfo && pCnrDrawItemInfo->pFieldInfo->flData & CFA_BITMAPORICON) {
    513512            PMINIRECORDCORE mrc=(PMINIRECORDCORE)((PCNRDRAWITEMINFO)pOwnerItem->hItem)->pRecord;
    514513            if(mrc){
     
    517516              ULONG ulIconSize=150;/* Default if query fails */
    518517              HWND hwndCnr=WinWindowFromID(hwnd, FID_CLIENT);
    519518              RECTL rclTemp=pOwnerItem->rclItem;
    520              
     519
    521520              wpObjToRefresh=(WPObject*)OBJECT_FROM_PREC(mrc);//Get object
    522521              wpObject=somGetFileSystemObject(wpObjToRefresh);
    523              
     522
    524523              /* Draw Background */
    525524              rclTemp.xLeft+=2;
    526525              rclTemp.xRight-=2;
    527526              rclTemp.yBottom+=2;
    528527              rclTemp.yTop-=2;
    529              
     528
    530529              /* Check if record is selected and in use... */
    531530              if((pCnrDrawItemInfo->pRecord->flRecordAttr & CRA_INUSE)
    532531                 && (pCnrDrawItemInfo->pRecord->flRecordAttr & CRA_SELECTED)) {
    533532                POINTL pointl;
    534                
     533
    535534                GpiSetPattern(pOwnerItem->hps,PATSYM_DIAG2);
    536535                pointl.x = rclTemp.xLeft;
    537536                pointl.y = rclTemp.yBottom;
     
    539538                pointl.x = rclTemp.xRight - 1;
    540539                pointl.y = rclTemp.yTop - 1;
    541540                GpiSetColor(pOwnerItem->hps, CLR_BLACK);
    542                 GpiBox(pOwnerItem->hps,DRO_FILL,&pointl,1,1);         
    543                
     541                GpiBox(pOwnerItem->hps,DRO_FILL,&pointl,1,1);
     542
    544543              }
    545544              /* or only in use... */
    546545              else if(pCnrDrawItemInfo->pRecord->flRecordAttr & CRA_INUSE) {
    547546                POINTL pointl;
    548                
     547
    549548                GpiSetPattern(pOwnerItem->hps,PATSYM_DIAG1);
    550549                pointl.x = rclTemp.xLeft;
    551550                pointl.y = rclTemp.yBottom;
     
    553552                pointl.x = rclTemp.xRight - 1;
    554553                pointl.y = rclTemp.yTop - 1;
    555554                GpiSetColor(pOwnerItem->hps, CLR_BLACK);
    556                 GpiBox(pOwnerItem->hps,DRO_FILL,&pointl,1,1);         
     555                GpiBox(pOwnerItem->hps,DRO_FILL,&pointl,1,1);
    557556              }
    558557              /* or only selected. */
    559558              else if(pCnrDrawItemInfo->pRecord->flRecordAttr & CRA_SELECTED)
     
    564563              if(somIsObj(wpObject) && _wpIsObjectInitialized(wpObject)) {
    565564                SOMClass* cwBitmapClass=queryCWBitmapFileClass();
    566565                SOMClass* cwImageClass=queryCWImageFileClass();
    567                
     566
    568567                if(somIsObj(cwImageClass)||somIsObj(cwBitmapClass)) {
    569568                  HBITMAP hbm=NULLHANDLE;
    570569                  PBITMAPINFOHEADER2 pBmpInfoHeader2;
    571                  
     570
    572571                  /* Query object pointer */
    573572                  if((hwndStore=WinWindowFromID(hwnd, STOREWINDOWID))!=NULLHANDLE)
    574573                    {
    575574                      somSelf=(MMFolder*) WinQueryWindowULong(hwndStore,QWL_USER);
    576575                      if(somIsObj(somSelf)) {
    577                         MMFolderData *somThis = MMFolderGetData(somSelf); 
     576                        MMFolderData *somThis = MMFolderGetData(somSelf);
    578577                        ulIconSize=_ulCurrentSize;
    579578                      }
    580579                    }
    581                   /* Get the small bitmap from the object */ 
     580                  /* Get the small bitmap from the object */
    582581                  if(_somIsA(wpObject, cwImageClass)) {
    583                     hbm=_cwmmQuerySmallBitmapHandle( (MMImage*) wpObject, ulIconSize, mrc, hwndCnr);
     582                    hbm=cwimg_cwmmQuerySmallBitmapHandle( (MMImage*) wpObject, ulIconSize, mrc, hwndCnr);
    584583                    pBmpInfoHeader2=(PBITMAPINFOHEADER2)_wpQueryBitmapInfoHeader((MMImage*)wpObject);
    585584                  }
    586585                  else if(_somIsA(wpObject, cwBitmapClass)) {
    587                     hbm=_cwmmQuerySmallBitmapHandleCWBitmap( (MMImage*) wpObject, ulIconSize);
     586                    hbm=cwbmp_cwmmQuerySmallBitmapHandle( (MMBitmap*) wpObject, ulIconSize);
    588587                    pBmpInfoHeader2=(PBITMAPINFOHEADER2)_wpQueryBitmapInfoHeader((MMBitmap*)wpObject);
    589588                  }
    590589                  if(hbm)
     
    635634                        WinDrawBitmap(pOwnerItem->hps, hbm, NULL, (PPOINTL)&rcl,//pOwnerItem->rclItem,
    636635                                      CLR_WHITE, CLR_BLACK, DBM_STRETCH /*|DBM_IMAGEATTRS*/);
    637636                      }
     637                      if(_somIsA(wpObject, cwImageClass)) {
     638                         cwimg_cwmmFreeSmallBitmap((MMImage *)wpObject);
     639                      }
     640                      else {
     641                         cwbmp_cwmmFreeSmallBitmap((MMBitmap*)wpObject);
     642                      }
    638643                      return (MRESULT) TRUE;
    639644                    }/* hbm */
    640645                }/* cwImageClass */
     
    678683        {
    679684          somSelf=(MMFolder*) WinQueryWindowULong(hwndStore,QWL_USER);
    680685          if(somIsObj(somSelf)) {
    681             MMFolderData *somThis = MMFolderGetData(somSelf); 
     686            MMFolderData *somThis = MMFolderGetData(somSelf);
    682687            switch(_usLastSelMenuItem)
    683688              {
    684689              case 0x2d1:/* view menu */
     
    695700                    if((cnrInfo.flWindowAttr & CV_ICON) && !(cnrInfo.flWindowAttr & CV_TREE)) {
    696701                      /* insert separator */
    697702                      menuInsertMenuSeparator( HWNDFROMMP(mp2), NULLHANDLE, MIT_END);
    698                      
     703
    699704                      /* Load the menu from the resource */
    700705                      hwndMenu=WinLoadMenu(hwnd,queryResModuleHandle(), ID_MENUICONSIZE);
    701                      
     706
    702707                      /* Fill the MENUITEM structure */
    703708                      mi.iPosition=MIT_END;
    704709                      mi.afStyle=MIS_TEXT|MIS_SUBMENU;
    705710                      mi.id=ID_MENUICONSIZE;
    706                       mi.afAttribute=NULLHANDLE;               
     711                      mi.afAttribute=NULLHANDLE;
    707712                      mi.hwndSubMenu=hwndMenu;
    708713                      mi.hItem=NULLHANDLE;
    709714                      if(!getMessage(text, IDSTR_ICONSIZEMENU, sizeof(text), queryResModuleHandle(), hwnd))
    710715                        strcpy(text, "Icon ~size");;
    711716                      menuInsertMenuItem(HWNDFROMMP(mp2), hwndMenu, MIT_END, ID_MENUICONSIZE, text);
    712                      
     717
    713718                      /* check current menuitem */
    714719                      switch(_ulCurrentSize)
    715720                        {
     
    732737                          WinCheckMenuItem(hwndMenu, ID_250X250ITEM, TRUE);
    733738                          break;
    734739                        default:
    735                           break; 
     740                          break;
    736741                        }
    737742                    }
    738743                  }/* if() */
     
    749754        {
    750755          somSelf=(MMFolder*) WinQueryWindowULong(hwndStore,QWL_USER);
    751756          if(somIsObj(somSelf)) {
    752             MMFolderData *somThis = MMFolderGetData(somSelf); 
     757            MMFolderData *somThis = MMFolderGetData(somSelf);
    753758            _usLastSelMenuItem=SHORT1FROMMP(mp1);
    754759          }
    755760        }
     
    762767    {
    763768      somSelf=(MMFolder*) WinQueryWindowULong(hwndStore,QWL_USER);
    764769      if(somIsObj(somSelf)) {
    765         MMFolderData *somThis = MMFolderGetData(somSelf); 
     770        MMFolderData *somThis = MMFolderGetData(somSelf);
    766771        if(_oldFrameProc)
    767772          return _oldFrameProc(hwnd, msg, mp1, mp2);
    768773      }
    769774    }
    770  
     775
    771776  return WinDefWindowProc(hwnd, msg, mp1, mp2);
    772777}
    773778
     
    775780 *      wpSetupOnce :override;
    776781 */
    777782
    778 SOM_Scope HWND  SOMLINK mmfldr_wpOpen(MMFolder *somSelf, HWND hwndCnr, 
     783SOM_Scope HWND  SOMLINK mmfldr_wpOpen(MMFolder *somSelf, HWND hwndCnr,
    779784                                      ULONG ulView, ULONG param)
    780785{
    781786  HWND hwnd;
    782787
    783   MMFolderData *somThis = MMFolderGetData(somSelf); 
     788  MMFolderData *somThis = MMFolderGetData(somSelf);
    784789    MMFolderMethodDebug("MMFolder","mmfldr_wpOpen");
    785790
    786     hwnd=(MMFolder_parent_WPFolder_wpOpen(somSelf, hwndCnr, 
     791    hwnd=(MMFolder_parent_WPFolder_wpOpen(somSelf, hwndCnr,
    787792                                            ulView, param));
    788793
    789794    /* Only subclass folder frames, not settings notebooks */
    790     if(ulView!=OPEN_SETTINGS){   
     795    if(ulView!=OPEN_SETTINGS){
    791796      HWND hwndStore;
    792797
    793798      if((hwndStore=WinCreateWindow(hwnd, WC_STATIC, "objectStore", 0, 0,0,0,0,
    794799                         hwnd, HWND_BOTTOM, STOREWINDOWID, NULLHANDLE, NULLHANDLE))!=NULLHANDLE)
    795800        {
    796           HWND hwndContainer;     
     801          HWND hwndContainer;
    797802
    798803          WinSetWindowULong(hwndStore, QWL_USER, (ULONG)somSelf);
    799804          _oldFrameProc=WinSubclassWindow(hwnd, mmFolderFrameProc);
    800          
     805
    801806          if(hwnd)
    802807            {
    803808              CNRINFO cnrInfo;
    804809              HWND hwndContainer=WinWindowFromID(hwnd,FID_CLIENT);
    805  
     810
    806811              /* Change the containerflags */
    807812              if(WinSendMsg(hwndContainer,CM_QUERYCNRINFO, MPFROMP(&cnrInfo),
    808813                            MPFROMSHORT(sizeof(cnrInfo))))
    809814                {
    810                   if(cnrInfo.flWindowAttr & CV_ICON) {             
     815                  if(cnrInfo.flWindowAttr & CV_ICON) {
    811816                    cnrInfo.slBitmapOrIcon.cx=_ulCurrentSize;
    812817                    cnrInfo.slBitmapOrIcon.cy=_ulCurrentSize;
    813818                    cnrInfo.flWindowAttr&=~CA_DRAWICON;
     
    828833}
    829834
    830835#if 0
    831 SOM_Scope BOOL  SOMLINK mmfldr_wpSetupOnce(MMFolder *somSelf, 
     836SOM_Scope BOOL  SOMLINK mmfldr_wpSetupOnce(MMFolder *somSelf,
    832837                                           PSZ pszSetupString)
    833838{
    834839  BOOL rc;
     
    853858}
    854859#endif
    855860
    856 SOM_Scope BOOL  SOMLINK mmfldr_wpRestoreState(MMFolder *somSelf, 
     861SOM_Scope BOOL  SOMLINK mmfldr_wpRestoreState(MMFolder *somSelf,
    857862                                              ULONG ulReserved)
    858863{
    859864    MMFolderData *somThis = MMFolderGetData(somSelf);
     
    864869      _ulCurrentSize=MMFLDR_DEFAULT_ICONSIZE;
    865870    }
    866871
    867     return (MMFolder_parent_WPFolder_wpRestoreState(somSelf, 
     872    return (MMFolder_parent_WPFolder_wpRestoreState(somSelf,
    868873                                                    ulReserved));
    869874}
    870875
    871 SOM_Scope BOOL  SOMLINK mmfldr_wpRestoreData(MMFolder *somSelf, 
    872                                              PSZ pszClass, ULONG ulKey, 
     876SOM_Scope BOOL  SOMLINK mmfldr_wpRestoreData(MMFolder *somSelf,
     877                                             PSZ pszClass, ULONG ulKey,
    873878                                             PBYTE pValue, PULONG pcbValue)
    874879{
    875880  BOOL rc;
    876881    MMFolderData *somThis = MMFolderGetData(somSelf);
    877882    MMFolderMethodDebug("MMFolder","mmfldr_wpRestoreData");
    878883
    879     rc= (MMFolder_parent_WPFolder_wpRestoreData(somSelf, pszClass, 
    880                                                    ulKey, pValue, 
     884    rc= (MMFolder_parent_WPFolder_wpRestoreData(somSelf, pszClass,
     885                                                   ulKey, pValue,
    881886                                                   pcbValue));
    882887    switch(ulKey)
    883888      {
     
    913918{
    914919    MMFolderData *somThis = MMFolderGetData(somSelf);
    915920    MMFolderMethodDebug("MMFolder","mmfldr_wpSaveState");
    916    
     921
    917922    _wpSaveLong( somSelf, "MMFolder", KEY_ICONSIZE, _ulCurrentSize);
    918923
    919924    return (MMFolder_parent_WPFolder_wpSaveState(somSelf));
    920925}
    921926
    922927
    923 SOM_Scope BOOL  SOMLINK mmfldr_wpSaveData(MMFolder *somSelf, 
    924                                           PSZ pszClass, ULONG ulKey, 
     928SOM_Scope BOOL  SOMLINK mmfldr_wpSaveData(MMFolder *somSelf,
     929                                          PSZ pszClass, ULONG ulKey,
    925930                                          PBYTE pValue, ULONG cbValue)
    926931{
    927932  PSZ psz;
     
    931936    /* When the template is created wpRestoreData() isn't called so we don't have
    932937       the address of the instance data containing grid spacing and view. So
    933938       we force the object to save the instance data and in wpSaveData we
    934        finally get the right addresses to change the object view to gridded. 
     939       finally get the right addresses to change the object view to gridded.
    935940       This change is done in wpObjectReady() where we called wpSaveImmediate(). */
    936941
    937942    /* If no ID result is NULL */
     
    940945
    941946      Check ID for NULL to prevent crash in stricmp().
    942947     */
    943     psz=_wpQueryObjectID(somSelf);         
     948    psz=_wpQueryObjectID(somSelf);
    944949    //  if(!stricmp(_wpQueryObjectID(somSelf), "<MMPM2_MMFOLDERTEMPLATE>"))
    945950    if(psz && !stricmp(psz, "<MMPM2_MMFOLDERTEMPLATE>"))
    946951      {
     
    976981          }
    977982      }
    978983
    979     return (MMFolder_parent_WPFolder_wpSaveData(somSelf, pszClass, 
    980                                                 ulKey, pValue, 
     984    return (MMFolder_parent_WPFolder_wpSaveData(somSelf, pszClass,
     985                                                ulKey, pValue,
    981986                                                cbValue));
    982987}
    983988
    984 SOM_Scope BOOL  SOMLINK mmfldr_wpMenuItemSelected(MMFolder *somSelf, 
    985                                                   HWND hwndFrame, 
     989SOM_Scope BOOL  SOMLINK mmfldr_wpMenuItemSelected(MMFolder *somSelf,
     990                                                  HWND hwndFrame,
    986991                                                  ULONG ulMenuId)
    987992{
    988993  CNRINFO cnrInfo;
     
    9981003        {
    9991004          char text[200];
    10001005          CNRINFO cnrInfo2=cnrInfo;
    1001    
     1006
    10021007          switch(ulMenuId)
    10031008            {
    10041009            case ID_50X50ITEM:
     
    10481053            *(_pulGridSpacing--)=_ulCurrentSize+MMFLDR_SPACINGDELTA_Y;
    10491054          }
    10501055
    1051           _wpSetup(somSelf, "MENUITEMSELECTED=716");/* Change to icon view */         
     1056          _wpSetup(somSelf, "MENUITEMSELECTED=716");/* Change to icon view */
    10521057          _wpSetup(somSelf, "MENUITEMSELECTED=309");/* Arrange */
    10531058
    10541059          WinEnableWindowUpdate(hwndContainer, TRUE);
     
    10561061          return TRUE;
    10571062        }
    10581063    }/* if() */
    1059     return (MMFolder_parent_WPFolder_wpMenuItemSelected(somSelf, 
    1060                                                         hwndFrame, 
     1064    return (MMFolder_parent_WPFolder_wpMenuItemSelected(somSelf,
     1065                                                        hwndFrame,
    10611066                                                        ulMenuId));
    10621067}
    10631068
     
    10651070/*
    10661071 *wpSetup:override;
    10671072 */
    1068 SOM_Scope void  SOMLINK mmfldr_wpObjectReady(MMFolder *somSelf, 
     1073SOM_Scope void  SOMLINK mmfldr_wpObjectReady(MMFolder *somSelf,
    10691074                                             ULONG ulCode, WPObject* refObject)
    10701075{
    10711076    MMFolderData *somThis = MMFolderGetData(somSelf);
     
    10941099            _ulCurrentSize=MMFLDR_DEFAULT_ICONSIZE;
    10951100
    10961101          /* If no ID result is NULL */
    1097           psz=_wpQueryObjectID(somSelf);         
     1102          psz=_wpQueryObjectID(somSelf);
    10981103          if(psz && !stricmp(psz, "<MMPM2_MMFOLDERTEMPLATE>")) {
    10991104            /* When the template is created wpRestoreData() isn't called so we don't have
    11001105               the address of the instance data containing grid spacing and view. So
    11011106               we force the object to save the instance data and in wpSaveData we
    11021107               finally get the right addresses to change the object view to gridded. */
    1103            
     1108
    11041109            _wpSaveImmediate(somSelf);
    11051110            /* Set default view to gridded */
    1106            
     1111
    11071112            if(_pFldrLongArray!=NULLHANDLE) {
    11081113              *_pFldrLongArray=0x80;
    11091114              //DosBeep(100, 200);
     
    11141119              /* FIXME: Use fontsize */
    11151120              *(_pulGridSpacing--)=_ulCurrentSize+MMFLDR_SPACINGDELTA_Y;
    11161121            }
    1117            
     1122
    11181123          }
    11191124          break;
    11201125        }
     
    11311136    MMFolderData *somThis = MMFolderGetData(somSelf);
    11321137    MMFolderMethodDebug("MMFolder","mmfldr_wpSetup");
    11331138
    1134     bufferSize=sizeof(buffer); 
     1139    bufferSize=sizeof(buffer);
    11351140    if(_wpScanSetupString(somSelf, pszSetupString, SETUP_MMTHUMBSIZE, buffer, &bufferSize))
    11361141      {
    11371142        PVIEWITEM pViewItem;
     
    11741179            pViewItem;
    11751180            pViewItem=_wpFindViewItem(somSelf,VIEW_CONTENTS|VIEW_TREE|VIEW_DETAILS, pViewItem))
    11761181          {
    1177             _wpMenuItemSelected(somSelf, 
    1178                                 pViewItem->handle, 
     1182            _wpMenuItemSelected(somSelf,
     1183                                pViewItem->handle,
    11791184                                ulMenuId);
    11801185          }
    11811186      }
     
    11831188}
    11841189
    11851190
    1186 SOM_Scope BOOL  SOMLINK mmfldrM_wpclsCreateDefaultTemplates(M_MMFolder *somSelf, 
     1191SOM_Scope BOOL  SOMLINK mmfldrM_wpclsCreateDefaultTemplates(M_MMFolder *somSelf,
    11871192                                                            WPObject* Folder)
    11881193{
    11891194  char chrSetup[sizeof(MMFLDR_TEMPLATE_SETUP)+1];
     
    11991204  sprintf(chrSetup, MMFLDR_TEMPLATE_SETUP);
    12001205  wpFolder=_wpclsQueryFolder(somSelf, MMTEMPLATE_FOLDER_ID, FALSE);
    12011206  _wpclsNew(somSelf, _wpclsQueryTitle(somSelf), chrSetup, wpFolder,FALSE);
    1202  
     1207
    12031208  return TRUE;
    12041209}
    12051210
     
    12181223}
    12191224
    12201225
    1221 SOM_Scope ULONG  SOMLINK mmfldrM_wpclsQueryIconData(M_MMFolder *somSelf, 
     1226SOM_Scope ULONG  SOMLINK mmfldrM_wpclsQueryIconData(M_MMFolder *somSelf,
    12221227                                                    PICONINFO pIconInfo)
    12231228{
    12241229  HMODULE hmod;
     
    12401245}
    12411246
    12421247
    1243 SOM_Scope ULONG  SOMLINK mmfldrM_wpclsQueryIconDataN(M_MMFolder *somSelf, 
    1244                                                      ICONINFO* pIconInfo, 
     1248SOM_Scope ULONG  SOMLINK mmfldrM_wpclsQueryIconDataN(M_MMFolder *somSelf,
     1249                                                     ICONINFO* pIconInfo,
    12451250                                                     ULONG ulIconIndex)
    12461251{
    12471252  HMODULE hmod;