Changeset 138 for branches


Ignore:
Timestamp:
Dec 30, 2023, 1:21:06 PM (20 months ago)
Author:
erdmann
Message:

fix a trap that reports on my system in CWMMCls.LOG as "Trap occured in createBMPObjectProc, file c/c_image/cwimage.c, around line 245."

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/v2.9_Lars/classes/c/c_image/cwimage.c

    r130 r138  
    2525 * along with this program; see the file COPYING.  If not, write to
    2626 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
    27  */         
     27 */
    2828/*
    2929 * If you need another license for your project/product (commercial,
    3030 * noncommercial, whatever) contact me at
    31  * 
     31 *
    3232 * http://www.os2world.com/cdwriting
    3333 * http://www.geocities.com/SiliconValley/Sector/5785/
     
    3636/*
    3737 *  This file was generated by the SOM Compiler and Emitter Framework.
    38  *  Generated using: 
     38 *  Generated using:
    3939 *      SOM Emitter emitctm: 2.42
    4040 */
     
    120120HBITMAP createNewBitmap ( HBITMAP hbm,
    121121                          PBITMAPINFOHEADER2 pBmpInfoHeader2,
    122                           ULONG ulWidth, 
    123                           ULONG ulHeight, 
     122                          ULONG ulWidth,
     123                          ULONG ulHeight,
    124124                          BOOL* pbQuitEarly);
    125125
     
    129129BOOL getStringFromRexxScript(PSZ rexxFile, char* chrResult, ULONG ulSize);
    130130
    131 BOOL mmclsCreateTheDefaultTemplate(M_WPObject *somSelf, 
     131BOOL mmclsCreateTheDefaultTemplate(M_WPObject *somSelf,
    132132                                   WPObject* Folder);
    133133
    134134MRESULT menuInsertMenuSeparator(HWND hwndMenu, HWND hwndSubMenu, SHORT sPosition );
    135135
    136 /* 
     136/*
    137137   This Proc creates the small bitmaps for display on a separate thread.
    138138   It's used indirectly used by the lighttable folder when an attempt to
     
    151151          case ACKEY_CREATE_SMALLBITMAP:
    152152            {
    153               BOOL bLoaded=FALSE;
    154153              HBITMAP hbm;
    155154              PCREATEBMPINFO pCreateBMP=PVOIDFROMMP(mp1);
     
    167166                return (MRESULT) FALSE;
    168167
    169               /* 
    170                  V0.2.8, CW 2004/11/01 
    171                  
     168              /*
     169                 V0.2.8, CW 2004/11/01
     170
    172171                 It's possible that a lot of requests are issued to this thread while opening a folder.
    173172                 These are qeued and in the meanwhile the user may have closed the folder.
     
    181180                pmrcToRefresh=pCreateBMP->pmrcToRefresh;
    182181                for(;;) {
    183                   RECTL rectl, rectl2;
     182                  RECTL rectl2;
    184183                  if(WinSendMsg(pCreateBMP->hwndCnr, CM_QUERYVIEWPORTRECT, MPFROMP(&rectl2), MPFROM2SHORT(CMA_WORKSPACE, FALSE))) {
    185184
     
    197196
    198197                  _wpLockObject(pCreateBMP->wpObject);
    199                  
     198
    200199                  /* Check if in the meantime the bitmap was created */
    201                   if(!_hBitmapSmall) {
    202                     /* 
     200                  if(!_hBitmapSmall && _hBitmap) {
     201                    /*
    203202                       FIXME:
    204                        
     203
    205204                       Not threadsafe!!!
    206                        
     205
    207206                       Use a private work alike for wpQueryBitmapHandle instead???
    208                        
    209                        Check if bitmap data already loaded. Keep the info so we don't discard the bitmap later on. Another
    210                        function may have requested the bitmap before. During wpQueryBitmapHandle() a normal size bitmap
    211                        is always created. We don't want to have memory wasted by the big one so it's discarded afterwards.
    212                        Not perfect, but works at the moment. Will be revamped later with automatic bitmap deletion. */
    213                     if(_hBitmap)
    214                       bLoaded=TRUE;
    215                    
    216                     if(_wpQueryBitmapHandle(pCreateBMP->wpObject,
    217                                             &hbm,
     207                    */
     208
     209                    if(_wpQueryBitmapHandle(pCreateBMP->wpObject,
     210                                            &hbm,
    218211                                            NULLHANDLE,
    219                                             pCreateBMP->ulWidth, 
    220                                             pCreateBMP->ulHeight, 
    221                                             0, /* ulFlags*/ 
    222                                             0, 
     212                                            pCreateBMP->ulWidth,
     213                                            pCreateBMP->ulHeight,
     214                                            0, /* ulFlags*/
     215                                            0,
    223216                                            NULLHANDLE)) {
    224217                      _hBitmapSmall=hbm;
    225218                      _ulSizeSmallBitmap=pCreateBMP->ulHeight;
    226                       if(!bLoaded) {
    227                         /* The bitmap wasn't loaded so discard it now, we don't need it any more as we have
    228                            the small one. */
    229                         GpiDeleteBitmap(_hBitmap);
    230                         _hBitmap=NULLHANDLE;
    231                       }
     219                      /* Discard the large bitmap now, we don't need it any more as we have
     220                         the small one. */
     221                      GpiDeleteBitmap(_hBitmap);
     222                      _hBitmap=NULLHANDLE;
    232223                    }/* _wpQueryBitmapHandle() */
    233224                  }
     
    235226                    //    WinPostMsg(pCreateBMP->hwndCnr, CM_INVALIDATERECORD,MPFROMP(&pmrcToRefresh),MPFROM2SHORT(1,CMA_NOREPOSITION));
    236227                    WinSendMsg(pCreateBMP->hwndCnr, CM_INVALIDATERECORD,MPFROMP(&pmrcToRefresh),MPFROM2SHORT(1,CMA_NOREPOSITION));
    237                  
    238                   _wpUnlockObject(pCreateBMP->wpObject);
    239228                  break;
    240229                }/* for */
     
    244233                  SysWriteToTrapLog("\nTrap occured in %s, file %s, around line %d.\n",
    245234                                    __FUNCTION__, __FILE__, __LINE__);
    246                   _wpUnlockObject(pCreateBMP->wpObject); /* If we trapped in wpUnlockObject(), we will have a problem here... */
    247235                } END_CATCH;
     236                _wpUnlockObject(pCreateBMP->wpObject);
    248237                //        WinSendMsg(pCreateBMP->hwndCnr, CM_INVALIDATERECORD,MPFROMP(&pmrcToRefresh),MPFROM2SHORT(1,CMA_NOREPOSITION));
    249238                //   _wp_FreeMem(wpObject, (PBYTE)pCreateBMP);
     
    262251                return (MRESULT) FALSE;
    263252
    264               TRY_LOUD(BITMAPIH_OBJECT) {         
     253              TRY_LOUD(BITMAPIH_OBJECT) {
    265254                somThis  = MMImageGetData(pCreateBMP->wpObject);
    266                                
     255
    267256                /* Check if in the meantime the bitmap was created */
    268257                if(!_pBmpInfoHeader2) {
     
    303292  HMQ  hmq;
    304293  QMSG qmsg;
    305  
     294
    306295  hab=WinInitialize(0);
    307296  if(hab) {
     
    348337        }
    349338        return FALSE;
    350        
     339
    351340      }
    352341    default:
     
    430419                //ulPostCount++;
    431420                //SysWriteToTrapLog("  Have msg %d\n", ulPostCount);
    432                
     421
    433422                /*
    434423                  Check for system msgs and dispatch them.
     
    476465                /*
    477466                  queue is almost full. The semaphore was posted by the function so
    478                   dispatch messages faster. 
     467                  dispatch messages faster.
    479468                 */
    480469                int a=0;
    481470                //                SysWriteToTrapLog(" --Semaphore posted\n");
    482                 while((bQuit=!WinGetMsg(hab,&qmsg,(HWND)NULL,0,0))==FALSE 
     471                while((bQuit=!WinGetMsg(hab,&qmsg,(HWND)NULL,0,0))==FALSE
    483472                      && a < BMP_DEL_UPPER-BMP_DEL_LOWER) {
    484473                  //     SysWriteToTrapLog(" -- Got message, dispatching it...\n");
     
    560549
    561550          if(pbmpih2->cbFix==sizeof(BITMAPINFOHEADER2)) {
    562             if(!getMessage(chrTemplate, IDSTR_SPRINTFPIXEL, sizeof(chrTemplate), 
     551            if(!getMessage(chrTemplate, IDSTR_SPRINTFPIXEL, sizeof(chrTemplate),
    563552                       queryResModuleHandle(), hwnd))
    564553              strcpy(chrTemplate, "%d Pixel");
    565554            sprintf(fName, chrTemplate, pbmpih2->cx);
    566555            WinSetWindowText(WinWindowFromID(hwnd, IDST_IMAGEWIDTH),fName);
    567            
     556
    568557            sprintf(fName, chrTemplate, pbmpih2->cy);
    569558            WinSetWindowText(WinWindowFromID(hwnd, IDST_IMAGEHEIGHT),fName);
    570559
    571             if(!getMessage(chrTemplate, IDSTR_SPRINTFBIT, sizeof(chrTemplate), 
     560            if(!getMessage(chrTemplate, IDSTR_SPRINTFBIT, sizeof(chrTemplate),
    572561                           queryResModuleHandle(), hwnd))
    573               strcpy(chrTemplate, "%d Bit");           
     562              strcpy(chrTemplate, "%d Bit");
    574563            sprintf(fName, chrTemplate, pbmpih2->cBitCount);
    575564            WinSetWindowText(WinWindowFromID(hwnd, IDST_COLORDEPTH),fName);
     
    578567            /* We shouldn't get a BITMAPINFOHEADER here but who knows...*/
    579568            PBITMAPINFOHEADER pbmpih=(PBITMAPINFOHEADER)pbmpih2;
    580             if(!getMessage(chrTemplate, IDSTR_SPRINTFPIXEL, sizeof(chrTemplate), 
     569            if(!getMessage(chrTemplate, IDSTR_SPRINTFPIXEL, sizeof(chrTemplate),
    581570                           queryResModuleHandle(), hwnd))
    582571              strcpy(chrTemplate, "%d Pixel");
    583572            sprintf(fName, chrTemplate,pbmpih->cx);
    584573            WinSetWindowText(WinWindowFromID(hwnd, IDST_IMAGEWIDTH),fName);
    585            
     574
    586575            sprintf(fName, chrTemplate, pbmpih->cy);
    587576            WinSetWindowText(WinWindowFromID(hwnd, IDST_IMAGEHEIGHT),fName);
    588577
    589             if(!getMessage(chrTemplate, IDSTR_SPRINTFBIT, sizeof(chrTemplate), 
    590                            queryResModuleHandle(), hwnd))                       
     578            if(!getMessage(chrTemplate, IDSTR_SPRINTFBIT, sizeof(chrTemplate),
     579                           queryResModuleHandle(), hwnd))
    591580              strcpy(chrTemplate, "%d Bit");
    592581            sprintf(fName, chrTemplate, pbmpih->cBitCount);
    593582            WinSetWindowText(WinWindowFromID(hwnd, IDST_COLORDEPTH),fName);
    594583          }
    595          
     584
    596585          WinSetWindowText(WinWindowFromID(hwnd, IDST_IMAGEFORMAT),_chrIOProcName);
    597586        }
     
    607596          mp2=MPFROMLONG(LONGFROMMP(mp2)|0x80000);/*AWP_ACTIVATE 0x00080000L*/
    608597          mr=WinDefDlgProc(hwnd, msg, mp1, mp2);
    609           return mr; 
     598          return mr;
    610599        }
    611600        break;
     
    618607
    619608            mr=WinDefDlgProc(hwnd, msg, mp1, mp2);
    620             WinSendMsg(WinQueryWindow(WinQueryWindow(hwnd, QW_PARENT), QW_PARENT), 
     609            WinSendMsg(WinQueryWindow(WinQueryWindow(hwnd, QW_PARENT), QW_PARENT),
    621610                       WM_SETFOCUS, MPFROMHWND(hwnd), (MPARAM)TRUE);
    622611            return mr;
     
    688677/*                                                       */
    689678/*!!******************************************************/
    690 SOM_Scope ULONG  SOMLINK cwimg_cwmmAddImageInformationPage(MMImage *somSelf, 
     679SOM_Scope ULONG  SOMLINK cwimg_cwmmAddImageInformationPage(MMImage *somSelf,
    691680                                                           HWND hwndNotebook)
    692681{
     
    797786/*                                                       */
    798787/*!!******************************************************/
    799 SOM_Scope HBITMAP  SOMLINK cwimg_cwmmQuerySmallBitmapHandle(MMImage *somSelf, 
    800                                                             ULONG ulSize, 
    801                                                             PMINIRECORDCORE pmrcToRefresh, 
     788SOM_Scope HBITMAP  SOMLINK cwimg_cwmmQuerySmallBitmapHandle(MMImage *somSelf,
     789                                                            ULONG ulSize,
     790                                                            PMINIRECORDCORE pmrcToRefresh,
    802791                                                            HWND hwndCnr)
    803792{
     
    818807
    819808      if(_bNoIOProcAvailable)
    820         return NULLHANDLE; /* No IO-proc for this image format. Don't try again in the future. 
     809        return NULLHANDLE; /* No IO-proc for this image format. Don't try again in the future.
    821810                            This var is set if we trapped during reading. */
    822811
     
    842831      }
    843832
    844     /* 
    845        FIXME: use WinIsWindow() here?? 
     833    /*
     834       FIXME: use WinIsWindow() here??
    846835     */
    847836    if(!_hBitmapSmall && hwndCreateBMP) {
     
    924913
    925914/*
    926  * SOM_Scope ULONG  SOMLINK cwimg_cwmmQueryImageInfo(MMImage *somSelf, 
    927  *                                                   char** chrString, 
    928  *                                                   ULONG ulSize, 
     915 * SOM_Scope ULONG  SOMLINK cwimg_cwmmQueryImageInfo(MMImage *somSelf,
     916 *                                                   char** chrString,
     917 *                                                   ULONG ulSize,
    929918 *                                                   int iWhich)
    930919 */
     
    933922 * The prototype for cwimg_cwmmQueryImageInfo was replaced by the following prototype:
    934923 */
    935 SOM_Scope ULONG  SOMLINK cwimg_cwmmQueryImageInfo(MMImage *somSelf, 
    936                                                   char** chrString, 
    937                                                   ULONG ulSize, 
     924SOM_Scope ULONG  SOMLINK cwimg_cwmmQueryImageInfo(MMImage *somSelf,
     925                                                  char** chrString,
     926                                                  ULONG ulSize,
    938927                                                  long iWhich)
    939928{
    940   PBITMAPINFOHEADER2 pBmpInfoHdr2=NULLHANDLE;       
     929  PBITMAPINFOHEADER2 pBmpInfoHdr2=NULLHANDLE;
    941930  ULONG ulWidth, ulHeight, ulDepth;
    942931    MMImageData *somThis = MMImageGetData(somSelf);
     
    987976}
    988977
    989 SOM_Scope void  SOMLINK cwimg_cwmmRequestBmpDeletion(MMImage *somSelf, 
     978SOM_Scope void  SOMLINK cwimg_cwmmRequestBmpDeletion(MMImage *somSelf,
    990979                                                     ULONG ulFlags)
    991980{
     
    10131002        RECTL rectl2;
    10141003        PRECORDITEM pri=(PRECORDITEM)(++pui);
    1015        
     1004
    10161005        /*
    10171006          V0.2.9 CW 2004/11/12
    1018          
     1007
    10191008          Check if small bitmaps for icons are currently visible in any container. This is useful if the
    10201009          user scrolls a folder with a lot of pictures.
     
    10261015          pui--;
    10271016          if(WinSendMsg(pri->hwndCnr, CM_QUERYVIEWPORTRECT, MPFROMP(&rectl2), MPFROM2SHORT(CMA_WORKSPACE, FALSE))) {
    1028            
     1017
    10291018            if(pri->pRecord->ptlIcon.y >= rectl2.yBottom  && pri->pRecord->ptlIcon.y <= rectl2.yTop &&
    10301019               pri->pRecord->ptlIcon.x >= rectl2.xLeft && pri->pRecord->ptlIcon.x < rectl2.xRight)
    10311020              bDeleteBmp=FALSE;
    1032            
    1033           }/* WinSendMsg() */   
     1021
     1022          }/* WinSendMsg() */
    10341023        }
    10351024      }/* else */
     
    10611050 * The prototype for cwimg_wpQueryBitmapHandle was replaced by the following prototype:
    10621051 */
    1063 SOM_Scope BOOL  SOMLINK cwimg_wpQueryBitmapHandle(MMImage *somSelf, 
    1064                                                   HBITMAP* phBitmap, 
    1065                                                   HPAL* phPalette, 
    1066                                                   ULONG ulWidth, 
    1067                                                   ULONG ulHeight, 
    1068                                                   ULONG ulFlags, 
    1069                                                   long lBackgroundColor, 
     1052SOM_Scope BOOL  SOMLINK cwimg_wpQueryBitmapHandle(MMImage *somSelf,
     1053                                                  HBITMAP* phBitmap,
     1054                                                  HPAL* phPalette,
     1055                                                  ULONG ulWidth,
     1056                                                  ULONG ulHeight,
     1057                                                  ULONG ulFlags,
     1058                                                  long lBackgroundColor,
    10701059                                                  BOOL* pbQuitEarly)
    10711060{
     
    10731062  char chrName[CCHMAXPATH];
    10741063
    1075     MMImageData *somThis = MMImageGetData(somSelf); 
     1064    MMImageData *somThis = MMImageGetData(somSelf);
    10761065    MMImageMethodDebug("MMImage","cwimg_wpQueryBitmapHandle");
    10771066
     
    10911080      return FALSE;
    10921081
    1093    
     1082
    10941083    TRY_LOUD(QRY_HBM) {
    10951084      /* Create a new (maybe smaller) bitmap from the normal size bitmap */
    1096       *phBitmap=createNewBitmap ( _hBitmap, (PBITMAPINFOHEADER2) _pBmpInfoHeader2, 
     1085      *phBitmap=createNewBitmap ( _hBitmap, (PBITMAPINFOHEADER2) _pBmpInfoHeader2,
    10971086                                  ulWidth, ulHeight , pbQuitEarly);
    10981087    }
     
    11061095                          chrName);
    11071096      } END_CATCH;
    1108      
     1097
    11091098      if(!*phBitmap)
    11101099        return FALSE;
     
    11241113  BOOL bSem;
    11251114
    1126   MMImageData *somThis = MMImageGetData(somSelf); 
     1115  MMImageData *somThis = MMImageGetData(somSelf);
    11271116    MMImageMethodDebug("MMImage","cwimg_wpQueryBitmapInfoHeader");
    11281117
     
    11931182            break;
    11941183
    1195           bGotHeader=getBmpInfoHeader( (PBITMAPINFOHEADER2) pByte, chrName, _chrIOProcName, 
     1184          bGotHeader=getBmpInfoHeader( (PBITMAPINFOHEADER2) pByte, chrName, _chrIOProcName,
    11961185                                       sizeof(_chrIOProcName), &_bNoIOProcAvailable);
    11971186          break;
     
    12531242 * The prototype for cwimg_wpQueryBitmapData was replaced by the following prototype:
    12541243 */
    1255 SOM_Scope PBYTE  SOMLINK cwimg_wpQueryBitmapData(MMImage *somSelf, 
     1244SOM_Scope PBYTE  SOMLINK cwimg_wpQueryBitmapData(MMImage *somSelf,
    12561245                                                 ULONG* pulSize)
    12571246{
     
    12611250    NOT_IMPLEMENTED
    12621251
    1263     return (MMImage_parent_WPImageFile_wpQueryBitmapData(somSelf, 
     1252    return (MMImage_parent_WPImageFile_wpQueryBitmapData(somSelf,
    12641253                                                         pulSize));
    12651254}
     
    12681257 * The prototype for cwimg_wpSetBitmapData was replaced by the following prototype:
    12691258 */
    1270 SOM_Scope BOOL  SOMLINK cwimg_wpSetBitmapData(MMImage *somSelf, 
    1271                                               PBYTE pBitmapData, 
     1259SOM_Scope BOOL  SOMLINK cwimg_wpSetBitmapData(MMImage *somSelf,
     1260                                              PBYTE pBitmapData,
    12721261                                              ULONG ulSize)
    12731262{
     
    12841273#endif
    12851274
    1286     return (MMImage_parent_WPImageFile_wpSetBitmapData(somSelf, 
    1287                                                        pBitmapData, 
     1275    return (MMImage_parent_WPImageFile_wpSetBitmapData(somSelf,
     1276                                                       pBitmapData,
    12881277                                                       ulSize));
    12891278}
     
    12981287  BOOL bGotHeader=FALSE;
    12991288
    1300   MMImageData *somThis = MMImageGetData(somSelf); 
     1289  MMImageData *somThis = MMImageGetData(somSelf);
    13011290    MMImageMethodDebug("MMImage","cwimg_wpReadImageFile");
    13021291
     
    13271316                          chrName);
    13281317      }END_CATCH;
    1329      
     1318
    13301319      if(!bGotHeader)
    13311320        return FALSE;
     
    13471336          _bNoIOProcAvailable=TRUE;
    13481337        } END_CATCH;
    1349        
     1338
    13501339        if(!_hBitmap) {
    13511340          return FALSE;
    13521341        }
    1353        
     1342
    13541343        return TRUE;
    13551344}
     
    14131402    HWND hwndSubMenu;
    14141403    MENUITEM mi;
    1415    
     1404
    14161405    if(g_pmmFormatInfoArray)
    14171406      free(g_pmmFormatInfoArray);
     
    14211410            '\0',
    14221411            sizeof(MMFORMATINFO) );
    1423    
     1412
    14241413    mmFormatInfo.ulMediaType |= MMIO_MEDIATYPE_IMAGE;
    1425     mmFormatInfo.ulFlags|=MMIO_CANWRITETRANSLATED;   
     1414    mmFormatInfo.ulFlags|=MMIO_CANWRITETRANSLATED;
    14261415    ulReturnCode = mmioQueryFormatCount ( &mmFormatInfo,
    14271416                                          &lNumIOProcs,
    14281417                                          0,
    14291418                                          0 );
    1430    
     1419
    14311420    if( ulReturnCode != MMIO_SUCCESS )
    14321421      {
     
    14441433        return FALSE;
    14451434      }
    1446    
     1435
    14471436    /*
    14481437     * call mmioGetFormats to get info on the formats supported.
     
    14631452        return FALSE;
    14641453      }
    1465    
     1454
    14661455    if( lFormatsRead != lNumIOProcs )
    14671456      {
     
    14791468    hwndSubMenu=WinCreateWindow(hwndMenu,WC_MENU,"",0,
    14801469                                0,0,0,0,
    1481                                 hwndMenu,//Owner. If set, this window 
     1470                                hwndMenu,//Owner. If set, this window
    14821471                                //is destroyed if owner is destroyed
    14831472                                HWND_TOP,
     
    14881477    mi.afStyle=MIS_TEXT;//|MIS_SUBMENU;
    14891478    mi.id=ID_MENU_CONVERT;
    1490     mi.afAttribute=NULLHANDLE;   
     1479    mi.afAttribute=NULLHANDLE;
    14911480    mi.hwndSubMenu=NULLHANDLE;//hwndSubMenu;
    14921481    mi.hItem=NULLHANDLE;
     
    15021491      {
    15031492        mmioGetFormatName(pmmFormatInfoArray, szBuffer, &lBytesRead, 0L, 0L);
    1504        
     1493
    15051494        /* Insert NULL string terminator */
    15061495        *( szBuffer + lBytesRead ) = (CHAR)NULL;
     
    15201509            mi.afStyle=MIS_TEXT|MIS_SUBMENU;
    15211510            mi.id=ID_ITEM_FIRSTCONVERT+index;/* Create menu id */
    1522             mi.afAttribute=NULLHANDLE;   
     1511            mi.afAttribute=NULLHANDLE;
    15231512            mi.hwndSubMenu=NULLHANDLE;//hwndSubMenu;
    15241513            mi.hItem=NULLHANDLE;
     
    15281517        /*
    15291518         *  advance to next entry in mmFormatInfo array
    1530          */       
     1519         */
    15311520        pmmFormatInfoArray++;
    15321521      }
     
    15641553 * The prototype for cwimg_wpModifyPopupMenu was replaced by the following prototype:
    15651554 */
    1566 SOM_Scope BOOL  SOMLINK cwimg_wpModifyPopupMenu(MMImage *somSelf, 
    1567                                                 HWND hwndMenu, 
    1568                                                 HWND hwndCnr, 
     1555SOM_Scope BOOL  SOMLINK cwimg_wpModifyPopupMenu(MMImage *somSelf,
     1556                                                HWND hwndMenu,
     1557                                                HWND hwndCnr,
    15691558                                                ULONG iPosition)
    15701559{
     
    15831572          if(!getMessage(text, IDSTR_MENU_IMAGEINFO, sizeof(text), queryResModuleHandle(), hwndMenu))
    15841573            strcpy(text, "Image information: %d x %d x %d");
    1585          
     1574
    15861575          sprintf(menuText, text, _ulWidth, _ulHeight, _ulDepth);//create menuitem
    1587          
     1576
    15881577          //insert size menuitem in popupmenu
    15891578
     
    15991588      insertIOProcMenuItems( hwndMenu );
    16001589      menuInsertMenuSeparator(hwndMenu, NULLHANDLE, MIT_END );
    1601      
     1590
    16021591    }/* TRY_LOUD */
    16031592    CATCH(IMAGE_INSERTPOPUPMENU)
     
    16071596      } END_CATCH;
    16081597
    1609     return (MMImage_parent_WPImageFile_wpModifyPopupMenu(somSelf, 
    1610                                                          hwndMenu, 
    1611                                                          hwndCnr, 
     1598    return (MMImage_parent_WPImageFile_wpModifyPopupMenu(somSelf,
     1599                                                         hwndMenu,
     1600                                                         hwndCnr,
    16121601                                                         iPosition));
    16131602}
     
    16171606 * The prototype for cwimg_wpMenuItemSelected was replaced by the following prototype:
    16181607 */
    1619 SOM_Scope BOOL  SOMLINK cwimg_wpMenuItemSelected(MMImage *somSelf, 
    1620                                                  HWND hwndFrame, 
     1608SOM_Scope BOOL  SOMLINK cwimg_wpMenuItemSelected(MMImage *somSelf,
     1609                                                 HWND hwndFrame,
    16211610                                                 ULONG ulMenuId)
    16221611{
     
    16311620        ULONG ulSize;
    16321621        ULONG ulRc;
    1633        
     1622
    16341623        PrfQueryProfileString(HINI_USERPROFILE, "CWMM", "imageconverter", "", chrEditor,
    16351624                              sizeof(chrEditor));
     
    16591648      }
    16601649
    1661     return (MMImage_parent_WPImageFile_wpMenuItemSelected(somSelf, 
    1662                                                           hwndFrame, 
     1650    return (MMImage_parent_WPImageFile_wpMenuItemSelected(somSelf,
     1651                                                          hwndFrame,
    16631652                                                          ulMenuId));
    16641653}
     
    16671656 * The prototype for cwimg_wpOpen was replaced by the following prototype:
    16681657 */
    1669 SOM_Scope HWND  SOMLINK cwimg_wpOpen(MMImage *somSelf, HWND hwndCnr, 
     1658SOM_Scope HWND  SOMLINK cwimg_wpOpen(MMImage *somSelf, HWND hwndCnr,
    16701659                                     ULONG ulView, ULONG param)
    16711660{
     
    17111700     }
    17121701
    1713     return (MMImage_parent_WPImageFile_wpOpen(somSelf, hwndCnr, 
     1702    return (MMImage_parent_WPImageFile_wpOpen(somSelf, hwndCnr,
    17141703                                              ulView, param));
    17151704}
     
    17191708 * The prototype for cwimg_wpAddSettingsPages was replaced by the following prototype:
    17201709 */
    1721 SOM_Scope BOOL  SOMLINK cwimg_wpAddSettingsPages(MMImage *somSelf, 
     1710SOM_Scope BOOL  SOMLINK cwimg_wpAddSettingsPages(MMImage *somSelf,
    17221711                                                 HWND hwndNotebook)
    17231712{
     
    17261715    MMImageMethodDebug("MMImage","cwimg_wpAddSettingsPages");
    17271716
    1728     rc=(MMImage_parent_WPImageFile_wpAddSettingsPages(somSelf, 
     1717    rc=(MMImage_parent_WPImageFile_wpAddSettingsPages(somSelf,
    17291718                                                          hwndNotebook));
    17301719    return rc | (_cwmmAddImageInformationPage(somSelf, hwndNotebook));
     
    17351724 * The prototype for cwimg_wpQueryDetailsData was replaced by the following prototype:
    17361725 */
    1737 SOM_Scope ULONG  SOMLINK cwimg_wpQueryDetailsData(MMImage *somSelf, 
    1738                                                   PVOID* ppDetailsData, 
     1726SOM_Scope ULONG  SOMLINK cwimg_wpQueryDetailsData(MMImage *somSelf,
     1727                                                  PVOID* ppDetailsData,
    17391728                                                  PULONG pcp)
    17401729{
     
    17461735
    17471736    /* Fill parent info */
    1748     rcParent=(MMImage_parent_WPImageFile_wpQueryDetailsData(somSelf, 
    1749                                                           ppDetailsData, 
     1737    rcParent=(MMImage_parent_WPImageFile_wpQueryDetailsData(somSelf,
     1738                                                          ppDetailsData,
    17501739                                                          pcp));
    17511740
     
    17541743      {
    17551744        ULONG ulWidth, ulHeight, ulDepth;
    1756      
    1757         PBITMAPINFOHEADER2 pBmpInfoHeader2=NULLHANDLE;       
     1745
     1746        PBITMAPINFOHEADER2 pBmpInfoHeader2=NULLHANDLE;
    17581747
    17591748#if 0
     
    17611750                                   is on CD is done in wpRestore() */
    17621751          pBmpInfoHeader2=(PBITMAPINFOHEADER2) _wpQueryBitmapInfoHeader(somSelf);
    1763 #endif   
     1752#endif
    17641753
    17651754        pBmpInfoHeader2=(PBITMAPINFOHEADER2)_pBmpInfoHeader2;
     
    17851774            ulDepth=_ulDepth;
    17861775          }
    1787         /* Fill the structure with the info to be displayed */     
    1788         pImageDetails=(PIMAGEDETAILS)*ppDetailsData; 
     1776        /* Fill the structure with the info to be displayed */
     1777        pImageDetails=(PIMAGEDETAILS)*ppDetailsData;
    17891778        pImageDetails->ulWidth=ulWidth;
    17901779        pImageDetails->ulHeight=ulHeight;
    17911780        pImageDetails->ulDepth=ulDepth;
    17921781        pImageDetails->pszFormat=_chrIOProcName;
    1793        
    1794         *ppDetailsData=((PBYTE) (*ppDetailsData))+sizeof(*pImageDetails);         
     1782
     1783        *ppDetailsData=((PBYTE) (*ppDetailsData))+sizeof(*pImageDetails);
    17951784      }
    17961785    else
     
    18061795 * The prototype for cwimg_wpRestoreState was replaced by the following prototype:
    18071796 */
    1808 SOM_Scope BOOL  SOMLINK cwimg_wpRestoreState(MMImage *somSelf, 
     1797SOM_Scope BOOL  SOMLINK cwimg_wpRestoreState(MMImage *somSelf,
    18091798                                             ULONG ulReserved)
    18101799{
     
    18131802    MMImageData *somThis = MMImageGetData(somSelf);
    18141803    MMImageMethodDebug("MMImage","cwimg_wpRestoreState");
    1815    
     1804
    18161805    _bUseNewClsFeatures=TRUE;
    1817    
     1806
    18181807    if(cwObjectIsOnCD(somSelf)) {
    18191808      /* The object is on CD. Check if we should use the new class features */
     
    18271816       the filename is unknown). Querying the image data in wpObjectReady() is to late because that method is called after
    18281817       wpQueryDetailsData(). In wpObjectReady the image header will be read in. */
    1829    
     1818
    18301819    /* Query the image info */
    18311820    if(!_wpRestoreLong(somSelf, "CWImage", KEY_FILESIZE, &_ulFileSize))
     
    18431832    //      _wpQueryBitmapInfoHeader(somSelf);
    18441833
    1845     return (MMImage_parent_WPImageFile_wpRestoreState(somSelf, 
     1834    return (MMImage_parent_WPImageFile_wpRestoreState(somSelf,
    18461835                                                      ulReserved));
    18471836}
     
    18701859
    18711860    /* Refresh */
    1872     bufferSize=sizeof(buffer); 
     1861    bufferSize=sizeof(buffer);
    18731862    if(_wpScanSetupString(somSelf, pszSetupString, SETUP_MMREFRESH, buffer,&bufferSize))
    18741863      {
    18751864        _cwmmFreeBitmaps(somSelf);
    18761865#if 0
    1877         _cwmmQuerySmallBitmapHandle(somSelf, 
    1878                                     0, 
    1879                                     NULLHANDLE, 
     1866        _cwmmQuerySmallBitmapHandle(somSelf,
     1867                                    0,
     1868                                    NULLHANDLE,
    18801869                                    0);
    18811870#endif
     
    18831872        //        _wpCnrRefreshDetails(somSelf);
    18841873      }
    1885    
     1874
    18861875    return (MMImage_parent_WPImageFile_wpSetup(somSelf, pszSetupString));
    18871876}
    18881877
    18891878
    1890 SOM_Scope void  SOMLINK cwimg_wpObjectReady(MMImage *somSelf, 
     1879SOM_Scope void  SOMLINK cwimg_wpObjectReady(MMImage *somSelf,
    18911880                                            ULONG ulCode, WPObject* refObject)
    1892 { 
     1881{
    18931882  PCREATEBMPINFO pCreateBMP;
    18941883  ULONG ulError;
    18951884  MMImageData *somThis = MMImageGetData(somSelf);
    18961885  MMImageMethodDebug("MMImage","cwimg_wpObjectReady");
    1897  
    1898   MMImage_parent_WPImageFile_wpObjectReady(somSelf, ulCode, 
     1886
     1887  MMImage_parent_WPImageFile_wpObjectReady(somSelf, ulCode,
    18991888                                           refObject);
    19001889  /* Get image info asynchronous to replace cached image size read in from EA  which
     
    19061895      /* Only the object pointer is used */
    19071896      pCreateBMP->wpObject=somSelf;
    1908      
    1909       //      WinPostMsg(hwndCreateBMP, WM_APPTERMINATENOTIFY,MPFROMP(pCreateBMP), MPFROM2SHORT(0, ACKEY_QUERY_BITMAPINFO));     
     1897
     1898      //      WinPostMsg(hwndCreateBMP, WM_APPTERMINATENOTIFY,MPFROMP(pCreateBMP), MPFROM2SHORT(0, ACKEY_QUERY_BITMAPINFO));
    19101899    }
    19111900#endif
     
    19271916            '\0',
    19281917            sizeof(MMFORMATINFO) );
    1929    
     1918
    19301919    mmFormatInfo.ulMediaType |= MMIO_MEDIATYPE_IMAGE;
    1931     mmFormatInfo.ulFlags|=MMIO_CANREADTRANSLATED;/* Read !!!*/   
     1920    mmFormatInfo.ulFlags|=MMIO_CANREADTRANSLATED;/* Read !!!*/
    19321921    ulReturnCode = mmioQueryFormatCount ( &mmFormatInfo,
    19331922                                          &lNumIOProcs,
    19341923                                          0,
    19351924                                          0 );
    1936    
     1925
    19371926    if( ulReturnCode != MMIO_SUCCESS )
    19381927      {
     
    19551944        return FALSE;
    19561945      }
    1957    
     1946
    19581947    /*
    19591948     * call mmioGetFormats to get info on the formats supported.
     
    19731962        return FALSE;
    19741963      }
    1975    
     1964
    19761965    if( lFormatsRead != lNumIOProcs )
    19771966      {
     
    20051994          //          HlpWriteToTrapLog("Known Extension: %s\n", chrMMImageKnownExt);
    20061995          //          HlpWriteToTrapLog("Extension: %s\n", chrMMImageExt);
    2007         } 
     1996        }
    20081997        /*
    20091998         *  advance to next entry in mmFormatInfo array
    2010          */       
     1999         */
    20112000        pmmFormatInfoArray++;
    20122001      }
     
    20362025    if(_pBmpInfoHeader2) {
    20372026      if(((PBITMAPINFOHEADER2)_pBmpInfoHeader2)->cbFix==sizeof(BITMAPINFOHEADER2)) {
    2038         _wpSaveLong(somSelf, "CWImage", KEY_WIDTH, ((PBITMAPINFOHEADER2)_pBmpInfoHeader2)->cx);   
     2027        _wpSaveLong(somSelf, "CWImage", KEY_WIDTH, ((PBITMAPINFOHEADER2)_pBmpInfoHeader2)->cx);
    20392028        _wpSaveLong(somSelf, "CWImage", KEY_HEIGHT, ((PBITMAPINFOHEADER2)_pBmpInfoHeader2)->cy);
    20402029        _wpSaveLong(somSelf, "CWImage", KEY_DEPTH, ((PBITMAPINFOHEADER2)_pBmpInfoHeader2)->cBitCount);
     
    20432032        PBITMAPINFOHEADER pBmpInfoHeader=(PBITMAPINFOHEADER)_pBmpInfoHeader2;
    20442033
    2045         _wpSaveLong(somSelf, "CWImage", KEY_WIDTH, pBmpInfoHeader->cx);   
     2034        _wpSaveLong(somSelf, "CWImage", KEY_WIDTH, pBmpInfoHeader->cx);
    20462035        _wpSaveLong(somSelf, "CWImage", KEY_HEIGHT, pBmpInfoHeader->cy);
    20472036        _wpSaveLong(somSelf, "CWImage", KEY_DEPTH, pBmpInfoHeader->cBitCount);
     
    20522041
    20532042#if 0
    2054 SOM_Scope BOOL  SOMLINK cwimg_wpFormatDragItem(MMImage *somSelf, 
     2043SOM_Scope BOOL  SOMLINK cwimg_wpFormatDragItem(MMImage *somSelf,
    20552044                                               PDRAGITEM pdrgItem)
    20562045{
     
    20602049    MMImageMethodDebug("MMImage","cwimg_wpFormatDragItem");
    20612050
    2062     rc= (MMImage_parent_WPImageFile_wpFormatDragItem(somSelf, 
     2051    rc= (MMImage_parent_WPImageFile_wpFormatDragItem(somSelf,
    20632052                                                        pdrgItem));
    20642053DosBeep(500,10);
     
    20802069      If the folder is closed it's likely the bitmaps may be obsolete. A check for USAGE_RECORD items
    20812070      will be done on another thread.
    2082  
     2071
    20832072      wpDeleteFromObjUseList() seems to be the more natural place to do this but the method is not called
    20842073      when an object is removed from a container. Also wpCnrRemoveObject() doesn't work because the WPS seems
     
    20892078
    20902079     */
    2091     if(_hBitmap || _hBitmapSmall) 
     2080    if(_hBitmap || _hBitmapSmall)
    20922081      sendDeleteBMPMsg(somSelf);
    20932082
     
    21262115        /* Now check installed IO procs for other exts and add them to the filter list */
    21272116        _getMissingExtFromImageIOProc();
    2128         bGotImgExt=TRUE; 
     2117        bGotImgExt=TRUE;
    21292118      }
    21302119
     
    21342123      globalHab=WinQueryAnchorBlock(HWND_DESKTOP);
    21352124
    2136     if(!getMessage(chrHelpLibrary, IDSTR_HELPLIBRARY, sizeof(chrHelpLibrary), 
     2125    if(!getMessage(chrHelpLibrary, IDSTR_HELPLIBRARY, sizeof(chrHelpLibrary),
    21372126                   queryModuleHandle(), HWND_DESKTOP))
    21382127      strcpy(chrHelpLibrary,"MMPARTS.HLP");
     
    21522141      {
    21532142        memset((PCH)pCfi,0,sizeof(CLASSFIELDINFO));
    2154        
     2143
    21552144        pCfi->cb=sizeof(CLASSFIELDINFO);
    21562145        pCfi->flData=CFA_LEFT|CFA_SEPARATOR|CFA_FIREADONLY;
     
    21592148        pCfi->pTitleData=(PVOID)pszImageColTitles[i];
    21602149        pCfi->flCompare=COMPARE_SUPPORTED|SORTBY_SUPPORTED;
    2161        
     2150
    21622151        switch(i)
    21632152          {
     
    21912180          }/* switch(i) */
    21922181      }/* for() */
    2193     cfiImageFieldInfo[NUM_IMAGE_DETAILS_FIELDS].pNextFieldInfo=NULL;   
     2182    cfiImageFieldInfo[NUM_IMAGE_DETAILS_FIELDS].pNextFieldInfo=NULL;
    21942183    if(!hwndCreateBMP)
    21952184      _beginthread(createBMPThreadFunc,NULL,8192*20, NULLHANDLE); //Fehlerbehandlung fehlt
     
    22232212      {
    22242213        ULONG ulHowMatched=1;
    2225        
     2214
    22262215        DosBeep(5000, 1000);
    22272216        /* Template found. Now query associated program */
     
    22302219          DosBeep(500, 1000);
    22312220      }
    2232 #endif       
     2221#endif
    22332222    /* Create default templates. We do it here because we need an object to query the associated
    22342223       program (if any) when the system asks for the default view. */
     
    22522241            '\0',
    22532242            sizeof(MMFORMATINFO) );
    2254    
     2243
    22552244    mmFormatInfo.ulMediaType |= MMIO_MEDIATYPE_IMAGE;
    2256     mmFormatInfo.ulFlags|=MMIO_CANWRITETRANSLATED;   
     2245    mmFormatInfo.ulFlags|=MMIO_CANWRITETRANSLATED;
    22572246    ulReturnCode = mmioQueryFormatCount ( &mmFormatInfo,
    22582247                                          &lNumIOProcs,
    22592248                                          0,
    22602249                                          0 );
    2261    
     2250
    22622251    if( ulReturnCode != MMIO_SUCCESS )
    22632252      {
     
    22802269        return FALSE;
    22812270      }
    2282    
     2271
    22832272    /*
    22842273     * call mmioGetFormats to get info on the formats supported.
     
    22982287        return FALSE;
    22992288      }
    2300    
     2289
    23012290    if( lFormatsRead != lNumIOProcs )
    23022291      {
     
    23142303      {
    23152304        mmioGetFormatName(pmmFormatInfoArray, szBuffer, &lBytesRead, 0L, 0L);
    2316        
     2305
    23172306        /* Insert NULL string terminator */
    23182307        *( szBuffer + lBytesRead ) = (CHAR)NULL;
     
    23202309        /* Compressed TIF is not supported because the Warp 4 IO-Procs are
    23212310           broken. */
    2322         //HlpWriteToTrapLog("---------  Ext: %s, IO-Proc: %s, Name: %s\n", 
     2311        //HlpWriteToTrapLog("---------  Ext: %s, IO-Proc: %s, Name: %s\n",
    23232312        //chrExt,  pmmFormatInfoArray->szDefaultFormatExt,
    23242313        //                szBuffer);
     
    23362325        /*
    23372326         *  advance to next entry in mmFormatInfo array
    2338          */       
     2327         */
    23392328        pmmFormatInfoArray++;
    23402329      }
     
    23442333}
    23452334
    2346 SOM_Scope BOOL  SOMLINK cwimgM_wpclsCreateDefaultTemplates(M_MMImage *somSelf, 
     2335SOM_Scope BOOL  SOMLINK cwimgM_wpclsCreateDefaultTemplates(M_MMImage *somSelf,
    23472336                                                           WPObject* Folder)
    23482337{
     
    23542343    /* The FOURCC of the JPEG-IO proc is JPEG so we have to create that template
    23552344       in the JPG class. */
    2356    
     2345
    23572346    if(checkImageIOProc( _wpclsQueryInstanceFilter(somSelf))) {
    23582347      //   WPFolder* wpFolder;
     
    24002389 */
    24012390
    2402 SOM_Scope ULONG  SOMLINK cwimgM_wpclsQueryIconData(M_MMImage *somSelf, 
     2391SOM_Scope ULONG  SOMLINK cwimgM_wpclsQueryIconData(M_MMImage *somSelf,
    24032392                                                   PICONINFO pIconInfo)
    24042393{
     
    24242413 * The prototype for cwimgM_wpclsQueryDetailsInfo was replaced by the following prototype:
    24252414 */
    2426 SOM_Scope ULONG  SOMLINK cwimgM_wpclsQueryDetailsInfo(M_MMImage *somSelf, 
    2427                                                       PCLASSFIELDINFO* ppClassFieldInfo, 
     2415SOM_Scope ULONG  SOMLINK cwimgM_wpclsQueryDetailsInfo(M_MMImage *somSelf,
     2416                                                      PCLASSFIELDINFO* ppClassFieldInfo,
    24282417                                                      PULONG pSize)
    24292418{
     
    24352424    M_MMImageMethodDebug("M_MMImage","cwimgM_wpclsQueryDetailsInfo");
    24362425
    2437     cParentColumns= (M_MMImage_parent_M_WPImageFile_wpclsQueryDetailsInfo(somSelf, 
    2438                                                                  ppClassFieldInfo, 
     2426    cParentColumns= (M_MMImage_parent_M_WPImageFile_wpclsQueryDetailsInfo(somSelf,
     2427                                                                 ppClassFieldInfo,
    24392428                                                                 pSize));
    24402429  if(pSize)
Note: See TracChangeset for help on using the changeset viewer.