Ignore:
Timestamp:
Jan 21, 2024, 10:15:49 PM (19 months ago)
Author:
gyoung
Message:

Merged changes from Lar's branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/classes/c/c_image/cwimage.c

    r108 r141  
    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
     
    160160              if(!pCreateBMP)
    161161                return (MRESULT) FALSE;
     162
    162163#ifdef DEBUG
    163164              SysWriteToTrapLog("In %s, line %d\n", __FUNCTION__, __LINE__);
     
    167168                return (MRESULT) FALSE;
    168169
    169               /* 
    170                  V0.2.8, CW 2004/11/01 
    171                  
     170              /*
     171                 V0.2.8, CW 2004/11/01
     172
    172173                 It's possible that a lot of requests are issued to this thread while opening a folder.
    173174                 These are qeued and in the meanwhile the user may have closed the folder.
     
    181182                pmrcToRefresh=pCreateBMP->pmrcToRefresh;
    182183                for(;;) {
    183                   RECTL rectl, rectl2;
     184                  RECTL rectl2;
    184185                  if(WinSendMsg(pCreateBMP->hwndCnr, CM_QUERYVIEWPORTRECT, MPFROMP(&rectl2), MPFROM2SHORT(CMA_WORKSPACE, FALSE))) {
    185186
     
    197198
    198199                  _wpLockObject(pCreateBMP->wpObject);
    199                  
     200
    200201                  /* Check if in the meantime the bitmap was created */
    201202                  if(!_hBitmapSmall) {
    202                     /* 
     203                    /*
    203204                       FIXME:
    204                        
     205
    205206                       Not threadsafe!!!
    206                        
     207
    207208                       Use a private work alike for wpQueryBitmapHandle instead???
    208209                       
     
    214215                      bLoaded=TRUE;
    215216                   
    216                     if(_wpQueryBitmapHandle(pCreateBMP->wpObject, 
    217                                             &hbm, 
     217                    if(_wpQueryBitmapHandle(pCreateBMP->wpObject,
     218                                            &hbm,
    218219                                            NULLHANDLE,
    219                                             pCreateBMP->ulWidth, 
    220                                             pCreateBMP->ulHeight, 
    221                                             0, /* ulFlags*/ 
    222                                             0, 
     220                                            pCreateBMP->ulWidth,
     221                                            pCreateBMP->ulHeight,
     222                                            0, /* ulFlags*/
     223                                            0,
    223224                                            NULLHANDLE)) {
    224225                      _hBitmapSmall=hbm;
    225226                      _ulSizeSmallBitmap=pCreateBMP->ulHeight;
    226227                      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;
     228                      /* Discard the large bitmap now, we don't need it any more as we have
     229                         the small one. */
     230                      GpiDeleteBitmap(_hBitmap);
     231                      _hBitmap=NULLHANDLE;
    231232                      }
    232233                    }/* _wpQueryBitmapHandle() */
     
    235236                    //    WinPostMsg(pCreateBMP->hwndCnr, CM_INVALIDATERECORD,MPFROMP(&pmrcToRefresh),MPFROM2SHORT(1,CMA_NOREPOSITION));
    236237                    WinSendMsg(pCreateBMP->hwndCnr, CM_INVALIDATERECORD,MPFROMP(&pmrcToRefresh),MPFROM2SHORT(1,CMA_NOREPOSITION));
    237                  
    238                   _wpUnlockObject(pCreateBMP->wpObject);
    239238                  break;
    240239                }/* for */
    241240              }/* Try */
    242               CATCH(BITMAP_OBJECT)
    243                 {
     241              CATCH(BITMAP_OBJECT) {
    244242                  SysWriteToTrapLog("\nTrap occured in %s, file %s, around line %d.\n",
    245243                                    __FUNCTION__, __FILE__, __LINE__);
    246                   _wpUnlockObject(pCreateBMP->wpObject); /* If we trapped in wpUnlockObject(), we will have a problem here... */
    247                 } END_CATCH;
    248                 //        WinSendMsg(pCreateBMP->hwndCnr, CM_INVALIDATERECORD,MPFROMP(&pmrcToRefresh),MPFROM2SHORT(1,CMA_NOREPOSITION));
    249                 //   _wp_FreeMem(wpObject, (PBYTE)pCreateBMP);
    250                 free((PBYTE)pCreateBMP);
    251 
    252                 return (MRESULT) FALSE;
     244              } END_CATCH;
     245              _wpUnlockObject(pCreateBMP->wpObject);
     246              //        WinSendMsg(pCreateBMP->hwndCnr, CM_INVALIDATERECORD,MPFROMP(&pmrcToRefresh),MPFROM2SHORT(1,CMA_NOREPOSITION));
     247              //   _wp_FreeMem(wpObject, (PBYTE)pCreateBMP);
     248              free((PBYTE)pCreateBMP);
     249
     250              return (MRESULT) FALSE;
    253251            }/* case ACKEY_CREATE_SMALLBITMAP */
    254252          case ACKEY_QUERY_BITMAPINFO:
     
    262260                return (MRESULT) FALSE;
    263261
    264               TRY_LOUD(BITMAPIH_OBJECT) {         
     262              TRY_LOUD(BITMAPIH_OBJECT) {
    265263                somThis  = MMImageGetData(pCreateBMP->wpObject);
    266                                
     264
    267265                /* Check if in the meantime the bitmap was created */
    268266                if(!_pBmpInfoHeader2) {
     
    303301  HMQ  hmq;
    304302  QMSG qmsg;
    305  
     303
    306304  hab=WinInitialize(0);
    307305  if(hab) {
     
    348346        }
    349347        return FALSE;
    350        
     348
    351349      }
    352350    default:
     
    430428                //ulPostCount++;
    431429                //SysWriteToTrapLog("  Have msg %d\n", ulPostCount);
    432                
     430
    433431                /*
    434432                  Check for system msgs and dispatch them.
     
    476474                /*
    477475                  queue is almost full. The semaphore was posted by the function so
    478                   dispatch messages faster. 
     476                  dispatch messages faster.
    479477                 */
    480478                int a=0;
    481479                //                SysWriteToTrapLog(" --Semaphore posted\n");
    482                 while((bQuit=!WinGetMsg(hab,&qmsg,(HWND)NULL,0,0))==FALSE 
     480                while((bQuit=!WinGetMsg(hab,&qmsg,(HWND)NULL,0,0))==FALSE
    483481                      && a < BMP_DEL_UPPER-BMP_DEL_LOWER) {
    484482                  //     SysWriteToTrapLog(" -- Got message, dispatching it...\n");
     
    560558
    561559          if(pbmpih2->cbFix==sizeof(BITMAPINFOHEADER2)) {
    562             if(!getMessage(chrTemplate, IDSTR_SPRINTFPIXEL, sizeof(chrTemplate), 
     560            if(!getMessage(chrTemplate, IDSTR_SPRINTFPIXEL, sizeof(chrTemplate),
    563561                       queryResModuleHandle(), hwnd))
    564562              strcpy(chrTemplate, "%d Pixel");
    565563            sprintf(fName, chrTemplate, pbmpih2->cx);
    566564            WinSetWindowText(WinWindowFromID(hwnd, IDST_IMAGEWIDTH),fName);
    567            
     565
    568566            sprintf(fName, chrTemplate, pbmpih2->cy);
    569567            WinSetWindowText(WinWindowFromID(hwnd, IDST_IMAGEHEIGHT),fName);
    570568
    571             if(!getMessage(chrTemplate, IDSTR_SPRINTFBIT, sizeof(chrTemplate), 
     569            if(!getMessage(chrTemplate, IDSTR_SPRINTFBIT, sizeof(chrTemplate),
    572570                           queryResModuleHandle(), hwnd))
    573               strcpy(chrTemplate, "%d Bit");           
     571              strcpy(chrTemplate, "%d Bit");
    574572            sprintf(fName, chrTemplate, pbmpih2->cBitCount);
    575573            WinSetWindowText(WinWindowFromID(hwnd, IDST_COLORDEPTH),fName);
     
    578576            /* We shouldn't get a BITMAPINFOHEADER here but who knows...*/
    579577            PBITMAPINFOHEADER pbmpih=(PBITMAPINFOHEADER)pbmpih2;
    580             if(!getMessage(chrTemplate, IDSTR_SPRINTFPIXEL, sizeof(chrTemplate), 
     578            if(!getMessage(chrTemplate, IDSTR_SPRINTFPIXEL, sizeof(chrTemplate),
    581579                           queryResModuleHandle(), hwnd))
    582580              strcpy(chrTemplate, "%d Pixel");
    583581            sprintf(fName, chrTemplate,pbmpih->cx);
    584582            WinSetWindowText(WinWindowFromID(hwnd, IDST_IMAGEWIDTH),fName);
    585            
     583
    586584            sprintf(fName, chrTemplate, pbmpih->cy);
    587585            WinSetWindowText(WinWindowFromID(hwnd, IDST_IMAGEHEIGHT),fName);
    588586
    589             if(!getMessage(chrTemplate, IDSTR_SPRINTFBIT, sizeof(chrTemplate), 
    590                            queryResModuleHandle(), hwnd))                       
     587            if(!getMessage(chrTemplate, IDSTR_SPRINTFBIT, sizeof(chrTemplate),
     588                           queryResModuleHandle(), hwnd))
    591589              strcpy(chrTemplate, "%d Bit");
    592590            sprintf(fName, chrTemplate, pbmpih->cBitCount);
    593591            WinSetWindowText(WinWindowFromID(hwnd, IDST_COLORDEPTH),fName);
    594592          }
    595          
     593
    596594          WinSetWindowText(WinWindowFromID(hwnd, IDST_IMAGEFORMAT),_chrIOProcName);
    597595        }
     
    607605          mp2=MPFROMLONG(LONGFROMMP(mp2)|0x80000);/*AWP_ACTIVATE 0x00080000L*/
    608606          mr=WinDefDlgProc(hwnd, msg, mp1, mp2);
    609           return mr; 
     607          return mr;
    610608        }
    611609        break;
     
    618616
    619617            mr=WinDefDlgProc(hwnd, msg, mp1, mp2);
    620             WinSendMsg(WinQueryWindow(WinQueryWindow(hwnd, QW_PARENT), QW_PARENT), 
     618            WinSendMsg(WinQueryWindow(WinQueryWindow(hwnd, QW_PARENT), QW_PARENT),
    621619                       WM_SETFOCUS, MPFROMHWND(hwnd), (MPARAM)TRUE);
    622620            return mr;
     
    688686/*                                                       */
    689687/*!!******************************************************/
    690 SOM_Scope ULONG  SOMLINK cwimg_cwmmAddImageInformationPage(MMImage *somSelf, 
     688SOM_Scope ULONG  SOMLINK cwimg_cwmmAddImageInformationPage(MMImage *somSelf,
    691689                                                           HWND hwndNotebook)
    692690{
     
    797795/*                                                       */
    798796/*!!******************************************************/
    799 SOM_Scope HBITMAP  SOMLINK cwimg_cwmmQuerySmallBitmapHandle(MMImage *somSelf, 
    800                                                             ULONG ulSize, 
    801                                                             PMINIRECORDCORE pmrcToRefresh, 
     797SOM_Scope HBITMAP  SOMLINK cwimg_cwmmQuerySmallBitmapHandle(MMImage *somSelf,
     798                                                            ULONG ulSize,
     799                                                            PMINIRECORDCORE pmrcToRefresh,
    802800                                                            HWND hwndCnr)
    803801{
     
    818816
    819817      if(_bNoIOProcAvailable)
    820         return NULLHANDLE; /* No IO-proc for this image format. Don't try again in the future. 
     818        return NULLHANDLE; /* No IO-proc for this image format. Don't try again in the future.
    821819                            This var is set if we trapped during reading. */
    822820
     
    842840      }
    843841
    844     /* 
    845        FIXME: use WinIsWindow() here?? 
     842    /*
     843       FIXME: use WinIsWindow() here??
    846844     */
    847845    if(!_hBitmapSmall && hwndCreateBMP) {
     
    866864
    867865      WinPostMsg(hwndCreateBMP, WM_APPTERMINATENOTIFY,MPFROMP(pCreateBMP), MPFROM2SHORT(0, ACKEY_CREATE_SMALLBITMAP));
    868       free(pCreateBMP);
    869866      return NULLHANDLE;
    870867    }
     
    924921
    925922/*
    926  * SOM_Scope ULONG  SOMLINK cwimg_cwmmQueryImageInfo(MMImage *somSelf, 
    927  *                                                   char** chrString, 
    928  *                                                   ULONG ulSize, 
     923 * SOM_Scope ULONG  SOMLINK cwimg_cwmmQueryImageInfo(MMImage *somSelf,
     924 *                                                   char** chrString,
     925 *                                                   ULONG ulSize,
    929926 *                                                   int iWhich)
    930927 */
     
    933930 * The prototype for cwimg_cwmmQueryImageInfo was replaced by the following prototype:
    934931 */
    935 SOM_Scope ULONG  SOMLINK cwimg_cwmmQueryImageInfo(MMImage *somSelf, 
    936                                                   char** chrString, 
    937                                                   ULONG ulSize, 
     932SOM_Scope ULONG  SOMLINK cwimg_cwmmQueryImageInfo(MMImage *somSelf,
     933                                                  char** chrString,
     934                                                  ULONG ulSize,
    938935                                                  long iWhich)
    939936{
    940   PBITMAPINFOHEADER2 pBmpInfoHdr2=NULLHANDLE;       
     937  PBITMAPINFOHEADER2 pBmpInfoHdr2=NULLHANDLE;
    941938  ULONG ulWidth, ulHeight, ulDepth;
    942939    MMImageData *somThis = MMImageGetData(somSelf);
     
    987984}
    988985
    989 SOM_Scope void  SOMLINK cwimg_cwmmRequestBmpDeletion(MMImage *somSelf, 
     986SOM_Scope void  SOMLINK cwimg_cwmmRequestBmpDeletion(MMImage *somSelf,
    990987                                                     ULONG ulFlags)
    991988{
     
    10131010        RECTL rectl2;
    10141011        PRECORDITEM pri=(PRECORDITEM)(++pui);
    1015        
     1012
    10161013        /*
    10171014          V0.2.9 CW 2004/11/12
    1018          
     1015
    10191016          Check if small bitmaps for icons are currently visible in any container. This is useful if the
    10201017          user scrolls a folder with a lot of pictures.
     
    10261023          pui--;
    10271024          if(WinSendMsg(pri->hwndCnr, CM_QUERYVIEWPORTRECT, MPFROMP(&rectl2), MPFROM2SHORT(CMA_WORKSPACE, FALSE))) {
    1028            
     1025
    10291026            if(pri->pRecord->ptlIcon.y >= rectl2.yBottom  && pri->pRecord->ptlIcon.y <= rectl2.yTop &&
    10301027               pri->pRecord->ptlIcon.x >= rectl2.xLeft && pri->pRecord->ptlIcon.x < rectl2.xRight)
    10311028              bDeleteBmp=FALSE;
    1032            
    1033           }/* WinSendMsg() */   
     1029
     1030          }/* WinSendMsg() */
    10341031        }
    10351032      }/* else */
     
    10611058 * The prototype for cwimg_wpQueryBitmapHandle was replaced by the following prototype:
    10621059 */
    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, 
     1060SOM_Scope BOOL  SOMLINK cwimg_wpQueryBitmapHandle(MMImage *somSelf,
     1061                                                  HBITMAP* phBitmap,
     1062                                                  HPAL* phPalette,
     1063                                                  ULONG ulWidth,
     1064                                                  ULONG ulHeight,
     1065                                                  ULONG ulFlags,
     1066                                                  long lBackgroundColor,
    10701067                                                  BOOL* pbQuitEarly)
    10711068{
     
    10731070  char chrName[CCHMAXPATH];
    10741071
    1075     MMImageData *somThis = MMImageGetData(somSelf); 
     1072    MMImageData *somThis = MMImageGetData(somSelf);
    10761073    MMImageMethodDebug("MMImage","cwimg_wpQueryBitmapHandle");
    10771074
     
    10911088      return FALSE;
    10921089
    1093    
     1090
    10941091    TRY_LOUD(QRY_HBM) {
    10951092      /* Create a new (maybe smaller) bitmap from the normal size bitmap */
    1096       *phBitmap=createNewBitmap ( _hBitmap, (PBITMAPINFOHEADER2) _pBmpInfoHeader2, 
     1093      *phBitmap=createNewBitmap ( _hBitmap, (PBITMAPINFOHEADER2) _pBmpInfoHeader2,
    10971094                                  ulWidth, ulHeight , pbQuitEarly);
    10981095    }
     
    11061103                          chrName);
    11071104      } END_CATCH;
    1108      
     1105
    11091106      if(!*phBitmap)
    11101107        return FALSE;
     
    11241121  BOOL bSem;
    11251122
    1126   MMImageData *somThis = MMImageGetData(somSelf); 
     1123  MMImageData *somThis = MMImageGetData(somSelf);
    11271124    MMImageMethodDebug("MMImage","cwimg_wpQueryBitmapInfoHeader");
    11281125
     
    11931190            break;
    11941191
    1195           bGotHeader=getBmpInfoHeader( (PBITMAPINFOHEADER2) pByte, chrName, _chrIOProcName, 
     1192          bGotHeader=getBmpInfoHeader( (PBITMAPINFOHEADER2) pByte, chrName, _chrIOProcName,
    11961193                                       sizeof(_chrIOProcName), &_bNoIOProcAvailable);
    11971194          break;
     
    12531250 * The prototype for cwimg_wpQueryBitmapData was replaced by the following prototype:
    12541251 */
    1255 SOM_Scope PBYTE  SOMLINK cwimg_wpQueryBitmapData(MMImage *somSelf, 
     1252SOM_Scope PBYTE  SOMLINK cwimg_wpQueryBitmapData(MMImage *somSelf,
    12561253                                                 ULONG* pulSize)
    12571254{
     
    12611258    NOT_IMPLEMENTED
    12621259
    1263     return (MMImage_parent_WPImageFile_wpQueryBitmapData(somSelf, 
     1260    return (MMImage_parent_WPImageFile_wpQueryBitmapData(somSelf,
    12641261                                                         pulSize));
    12651262}
     
    12681265 * The prototype for cwimg_wpSetBitmapData was replaced by the following prototype:
    12691266 */
    1270 SOM_Scope BOOL  SOMLINK cwimg_wpSetBitmapData(MMImage *somSelf, 
    1271                                               PBYTE pBitmapData, 
     1267SOM_Scope BOOL  SOMLINK cwimg_wpSetBitmapData(MMImage *somSelf,
     1268                                              PBYTE pBitmapData,
    12721269                                              ULONG ulSize)
    12731270{
     
    12841281#endif
    12851282
    1286     return (MMImage_parent_WPImageFile_wpSetBitmapData(somSelf, 
    1287                                                        pBitmapData, 
     1283    return (MMImage_parent_WPImageFile_wpSetBitmapData(somSelf,
     1284                                                       pBitmapData,
    12881285                                                       ulSize));
    12891286}
     
    12981295  BOOL bGotHeader=FALSE;
    12991296
    1300   MMImageData *somThis = MMImageGetData(somSelf); 
     1297  MMImageData *somThis = MMImageGetData(somSelf);
    13011298    MMImageMethodDebug("MMImage","cwimg_wpReadImageFile");
    13021299
     
    13271324                          chrName);
    13281325      }END_CATCH;
    1329      
     1326
    13301327      if(!bGotHeader)
    13311328        return FALSE;
     
    13471344          _bNoIOProcAvailable=TRUE;
    13481345        } END_CATCH;
    1349        
     1346
    13501347        if(!_hBitmap) {
    13511348          return FALSE;
    13521349        }
    1353        
     1350
    13541351        return TRUE;
    13551352}
     
    14131410    HWND hwndSubMenu;
    14141411    MENUITEM mi;
    1415    
     1412
    14161413    if(g_pmmFormatInfoArray)
    14171414      free(g_pmmFormatInfoArray);
     
    14211418            '\0',
    14221419            sizeof(MMFORMATINFO) );
    1423    
     1420
    14241421    mmFormatInfo.ulMediaType |= MMIO_MEDIATYPE_IMAGE;
    1425     mmFormatInfo.ulFlags|=MMIO_CANWRITETRANSLATED;   
     1422    mmFormatInfo.ulFlags|=MMIO_CANWRITETRANSLATED;
    14261423    ulReturnCode = mmioQueryFormatCount ( &mmFormatInfo,
    14271424                                          &lNumIOProcs,
    14281425                                          0,
    14291426                                          0 );
    1430    
     1427
    14311428    if( ulReturnCode != MMIO_SUCCESS )
    14321429      {
     
    14441441        return FALSE;
    14451442      }
    1446    
     1443
    14471444    /*
    14481445     * call mmioGetFormats to get info on the formats supported.
     
    14631460        return FALSE;
    14641461      }
    1465    
     1462
    14661463    if( lFormatsRead != lNumIOProcs )
    14671464      {
     
    14791476    hwndSubMenu=WinCreateWindow(hwndMenu,WC_MENU,"",0,
    14801477                                0,0,0,0,
    1481                                 hwndMenu,//Owner. If set, this window 
     1478                                hwndMenu,//Owner. If set, this window
    14821479                                //is destroyed if owner is destroyed
    14831480                                HWND_TOP,
     
    14881485    mi.afStyle=MIS_TEXT;//|MIS_SUBMENU;
    14891486    mi.id=ID_MENU_CONVERT;
    1490     mi.afAttribute=NULLHANDLE;   
     1487    mi.afAttribute=NULLHANDLE;
    14911488    mi.hwndSubMenu=NULLHANDLE;//hwndSubMenu;
    14921489    mi.hItem=NULLHANDLE;
     
    15021499      {
    15031500        mmioGetFormatName(pmmFormatInfoArray, szBuffer, &lBytesRead, 0L, 0L);
    1504        
     1501
    15051502        /* Insert NULL string terminator */
    15061503        *( szBuffer + lBytesRead ) = (CHAR)NULL;
     
    15201517            mi.afStyle=MIS_TEXT|MIS_SUBMENU;
    15211518            mi.id=ID_ITEM_FIRSTCONVERT+index;/* Create menu id */
    1522             mi.afAttribute=NULLHANDLE;   
     1519            mi.afAttribute=NULLHANDLE;
    15231520            mi.hwndSubMenu=NULLHANDLE;//hwndSubMenu;
    15241521            mi.hItem=NULLHANDLE;
     
    15281525        /*
    15291526         *  advance to next entry in mmFormatInfo array
    1530          */       
     1527         */
    15311528        pmmFormatInfoArray++;
    15321529      }
     
    15641561 * The prototype for cwimg_wpModifyPopupMenu was replaced by the following prototype:
    15651562 */
    1566 SOM_Scope BOOL  SOMLINK cwimg_wpModifyPopupMenu(MMImage *somSelf, 
    1567                                                 HWND hwndMenu, 
    1568                                                 HWND hwndCnr, 
     1563SOM_Scope BOOL  SOMLINK cwimg_wpModifyPopupMenu(MMImage *somSelf,
     1564                                                HWND hwndMenu,
     1565                                                HWND hwndCnr,
    15691566                                                ULONG iPosition)
    15701567{
     
    15831580          if(!getMessage(text, IDSTR_MENU_IMAGEINFO, sizeof(text), queryResModuleHandle(), hwndMenu))
    15841581            strcpy(text, "Image information: %d x %d x %d");
    1585          
     1582
    15861583          sprintf(menuText, text, _ulWidth, _ulHeight, _ulDepth);//create menuitem
    1587          
     1584
    15881585          //insert size menuitem in popupmenu
    15891586
     
    15991596      insertIOProcMenuItems( hwndMenu );
    16001597      menuInsertMenuSeparator(hwndMenu, NULLHANDLE, MIT_END );
    1601      
     1598
    16021599    }/* TRY_LOUD */
    16031600    CATCH(IMAGE_INSERTPOPUPMENU)
     
    16071604      } END_CATCH;
    16081605
    1609     return (MMImage_parent_WPImageFile_wpModifyPopupMenu(somSelf, 
    1610                                                          hwndMenu, 
    1611                                                          hwndCnr, 
     1606    return (MMImage_parent_WPImageFile_wpModifyPopupMenu(somSelf,
     1607                                                         hwndMenu,
     1608                                                         hwndCnr,
    16121609                                                         iPosition));
    16131610}
     
    16171614 * The prototype for cwimg_wpMenuItemSelected was replaced by the following prototype:
    16181615 */
    1619 SOM_Scope BOOL  SOMLINK cwimg_wpMenuItemSelected(MMImage *somSelf, 
    1620                                                  HWND hwndFrame, 
     1616SOM_Scope BOOL  SOMLINK cwimg_wpMenuItemSelected(MMImage *somSelf,
     1617                                                 HWND hwndFrame,
    16211618                                                 ULONG ulMenuId)
    16221619{
     
    16311628        ULONG ulSize;
    16321629        ULONG ulRc;
    1633        
     1630
    16341631        PrfQueryProfileString(HINI_USERPROFILE, "CWMM", "imageconverter", "", chrEditor,
    16351632                              sizeof(chrEditor));
     
    16591656      }
    16601657
    1661     return (MMImage_parent_WPImageFile_wpMenuItemSelected(somSelf, 
    1662                                                           hwndFrame, 
     1658    return (MMImage_parent_WPImageFile_wpMenuItemSelected(somSelf,
     1659                                                          hwndFrame,
    16631660                                                          ulMenuId));
    16641661}
     
    16671664 * The prototype for cwimg_wpOpen was replaced by the following prototype:
    16681665 */
    1669 SOM_Scope HWND  SOMLINK cwimg_wpOpen(MMImage *somSelf, HWND hwndCnr, 
     1666SOM_Scope HWND  SOMLINK cwimg_wpOpen(MMImage *somSelf, HWND hwndCnr,
    16701667                                     ULONG ulView, ULONG param)
    16711668{
     
    17111708     }
    17121709
    1713     return (MMImage_parent_WPImageFile_wpOpen(somSelf, hwndCnr, 
     1710    return (MMImage_parent_WPImageFile_wpOpen(somSelf, hwndCnr,
    17141711                                              ulView, param));
    17151712}
     
    17191716 * The prototype for cwimg_wpAddSettingsPages was replaced by the following prototype:
    17201717 */
    1721 SOM_Scope BOOL  SOMLINK cwimg_wpAddSettingsPages(MMImage *somSelf, 
     1718SOM_Scope BOOL  SOMLINK cwimg_wpAddSettingsPages(MMImage *somSelf,
    17221719                                                 HWND hwndNotebook)
    17231720{
     
    17261723    MMImageMethodDebug("MMImage","cwimg_wpAddSettingsPages");
    17271724
    1728     rc=(MMImage_parent_WPImageFile_wpAddSettingsPages(somSelf, 
     1725    rc=(MMImage_parent_WPImageFile_wpAddSettingsPages(somSelf,
    17291726                                                          hwndNotebook));
    17301727    return rc | (_cwmmAddImageInformationPage(somSelf, hwndNotebook));
     
    17351732 * The prototype for cwimg_wpQueryDetailsData was replaced by the following prototype:
    17361733 */
    1737 SOM_Scope ULONG  SOMLINK cwimg_wpQueryDetailsData(MMImage *somSelf, 
    1738                                                   PVOID* ppDetailsData, 
     1734SOM_Scope ULONG  SOMLINK cwimg_wpQueryDetailsData(MMImage *somSelf,
     1735                                                  PVOID* ppDetailsData,
    17391736                                                  PULONG pcp)
    17401737{
     
    17461743
    17471744    /* Fill parent info */
    1748     rcParent=(MMImage_parent_WPImageFile_wpQueryDetailsData(somSelf, 
    1749                                                           ppDetailsData, 
     1745    rcParent=(MMImage_parent_WPImageFile_wpQueryDetailsData(somSelf,
     1746                                                          ppDetailsData,
    17501747                                                          pcp));
    17511748
     
    17541751      {
    17551752        ULONG ulWidth, ulHeight, ulDepth;
    1756      
    1757         PBITMAPINFOHEADER2 pBmpInfoHeader2=NULLHANDLE;       
     1753
     1754        PBITMAPINFOHEADER2 pBmpInfoHeader2=NULLHANDLE;
    17581755
    17591756#if 0
     
    17611758                                   is on CD is done in wpRestore() */
    17621759          pBmpInfoHeader2=(PBITMAPINFOHEADER2) _wpQueryBitmapInfoHeader(somSelf);
    1763 #endif   
     1760#endif
    17641761
    17651762        pBmpInfoHeader2=(PBITMAPINFOHEADER2)_pBmpInfoHeader2;
     
    17851782            ulDepth=_ulDepth;
    17861783          }
    1787         /* Fill the structure with the info to be displayed */     
    1788         pImageDetails=(PIMAGEDETAILS)*ppDetailsData; 
     1784        /* Fill the structure with the info to be displayed */
     1785        pImageDetails=(PIMAGEDETAILS)*ppDetailsData;
    17891786        pImageDetails->ulWidth=ulWidth;
    17901787        pImageDetails->ulHeight=ulHeight;
    17911788        pImageDetails->ulDepth=ulDepth;
    17921789        pImageDetails->pszFormat=_chrIOProcName;
    1793        
    1794         *ppDetailsData=((PBYTE) (*ppDetailsData))+sizeof(*pImageDetails);         
     1790
     1791        *ppDetailsData=((PBYTE) (*ppDetailsData))+sizeof(*pImageDetails);
    17951792      }
    17961793    else
     
    18061803 * The prototype for cwimg_wpRestoreState was replaced by the following prototype:
    18071804 */
    1808 SOM_Scope BOOL  SOMLINK cwimg_wpRestoreState(MMImage *somSelf, 
     1805SOM_Scope BOOL  SOMLINK cwimg_wpRestoreState(MMImage *somSelf,
    18091806                                             ULONG ulReserved)
    18101807{
     
    18131810    MMImageData *somThis = MMImageGetData(somSelf);
    18141811    MMImageMethodDebug("MMImage","cwimg_wpRestoreState");
    1815    
     1812
    18161813    _bUseNewClsFeatures=TRUE;
    1817    
     1814
    18181815    if(cwObjectIsOnCD(somSelf)) {
    18191816      /* The object is on CD. Check if we should use the new class features */
     
    18271824       the filename is unknown). Querying the image data in wpObjectReady() is to late because that method is called after
    18281825       wpQueryDetailsData(). In wpObjectReady the image header will be read in. */
    1829    
     1826
    18301827    /* Query the image info */
    18311828    if(!_wpRestoreLong(somSelf, "CWImage", KEY_FILESIZE, &_ulFileSize))
     
    18431840    //      _wpQueryBitmapInfoHeader(somSelf);
    18441841
    1845     return (MMImage_parent_WPImageFile_wpRestoreState(somSelf, 
     1842    return (MMImage_parent_WPImageFile_wpRestoreState(somSelf,
    18461843                                                      ulReserved));
    18471844}
     
    18701867
    18711868    /* Refresh */
    1872     bufferSize=sizeof(buffer); 
     1869    bufferSize=sizeof(buffer);
    18731870    if(_wpScanSetupString(somSelf, pszSetupString, SETUP_MMREFRESH, buffer,&bufferSize))
    18741871      {
    18751872        _cwmmFreeBitmaps(somSelf);
    18761873#if 0
    1877         _cwmmQuerySmallBitmapHandle(somSelf, 
    1878                                     0, 
    1879                                     NULLHANDLE, 
     1874        _cwmmQuerySmallBitmapHandle(somSelf,
     1875                                    0,
     1876                                    NULLHANDLE,
    18801877                                    0);
    18811878#endif
     
    18831880        //        _wpCnrRefreshDetails(somSelf);
    18841881      }
    1885    
     1882
    18861883    return (MMImage_parent_WPImageFile_wpSetup(somSelf, pszSetupString));
    18871884}
    18881885
    18891886
    1890 SOM_Scope void  SOMLINK cwimg_wpObjectReady(MMImage *somSelf, 
     1887SOM_Scope void  SOMLINK cwimg_wpObjectReady(MMImage *somSelf,
    18911888                                            ULONG ulCode, WPObject* refObject)
    1892 { 
     1889{
    18931890  PCREATEBMPINFO pCreateBMP;
    18941891  ULONG ulError;
    18951892  MMImageData *somThis = MMImageGetData(somSelf);
    18961893  MMImageMethodDebug("MMImage","cwimg_wpObjectReady");
    1897  
    1898   MMImage_parent_WPImageFile_wpObjectReady(somSelf, ulCode, 
     1894
     1895  MMImage_parent_WPImageFile_wpObjectReady(somSelf, ulCode,
    18991896                                           refObject);
    19001897  /* Get image info asynchronous to replace cached image size read in from EA  which
     
    19061903      /* Only the object pointer is used */
    19071904      pCreateBMP->wpObject=somSelf;
    1908      
    1909       //      WinPostMsg(hwndCreateBMP, WM_APPTERMINATENOTIFY,MPFROMP(pCreateBMP), MPFROM2SHORT(0, ACKEY_QUERY_BITMAPINFO));     
     1905
     1906      //      WinPostMsg(hwndCreateBMP, WM_APPTERMINATENOTIFY,MPFROMP(pCreateBMP), MPFROM2SHORT(0, ACKEY_QUERY_BITMAPINFO));
    19101907    }
    19111908#endif
     
    19271924            '\0',
    19281925            sizeof(MMFORMATINFO) );
    1929    
     1926
    19301927    mmFormatInfo.ulMediaType |= MMIO_MEDIATYPE_IMAGE;
    1931     mmFormatInfo.ulFlags|=MMIO_CANREADTRANSLATED;/* Read !!!*/   
     1928    mmFormatInfo.ulFlags|=MMIO_CANREADTRANSLATED;/* Read !!!*/
    19321929    ulReturnCode = mmioQueryFormatCount ( &mmFormatInfo,
    19331930                                          &lNumIOProcs,
    19341931                                          0,
    19351932                                          0 );
    1936    
     1933
    19371934    if( ulReturnCode != MMIO_SUCCESS )
    19381935      {
     
    19551952        return FALSE;
    19561953      }
    1957    
     1954
    19581955    /*
    19591956     * call mmioGetFormats to get info on the formats supported.
     
    19731970        return FALSE;
    19741971      }
    1975    
     1972
    19761973    if( lFormatsRead != lNumIOProcs )
    19771974      {
     
    20052002          //          HlpWriteToTrapLog("Known Extension: %s\n", chrMMImageKnownExt);
    20062003          //          HlpWriteToTrapLog("Extension: %s\n", chrMMImageExt);
    2007         } 
     2004        }
    20082005        /*
    20092006         *  advance to next entry in mmFormatInfo array
    2010          */       
     2007         */
    20112008        pmmFormatInfoArray++;
    20122009      }
     
    20362033    if(_pBmpInfoHeader2) {
    20372034      if(((PBITMAPINFOHEADER2)_pBmpInfoHeader2)->cbFix==sizeof(BITMAPINFOHEADER2)) {
    2038         _wpSaveLong(somSelf, "CWImage", KEY_WIDTH, ((PBITMAPINFOHEADER2)_pBmpInfoHeader2)->cx);   
     2035        _wpSaveLong(somSelf, "CWImage", KEY_WIDTH, ((PBITMAPINFOHEADER2)_pBmpInfoHeader2)->cx);
    20392036        _wpSaveLong(somSelf, "CWImage", KEY_HEIGHT, ((PBITMAPINFOHEADER2)_pBmpInfoHeader2)->cy);
    20402037        _wpSaveLong(somSelf, "CWImage", KEY_DEPTH, ((PBITMAPINFOHEADER2)_pBmpInfoHeader2)->cBitCount);
     
    20432040        PBITMAPINFOHEADER pBmpInfoHeader=(PBITMAPINFOHEADER)_pBmpInfoHeader2;
    20442041
    2045         _wpSaveLong(somSelf, "CWImage", KEY_WIDTH, pBmpInfoHeader->cx);   
     2042        _wpSaveLong(somSelf, "CWImage", KEY_WIDTH, pBmpInfoHeader->cx);
    20462043        _wpSaveLong(somSelf, "CWImage", KEY_HEIGHT, pBmpInfoHeader->cy);
    20472044        _wpSaveLong(somSelf, "CWImage", KEY_DEPTH, pBmpInfoHeader->cBitCount);
     
    20522049
    20532050#if 0
    2054 SOM_Scope BOOL  SOMLINK cwimg_wpFormatDragItem(MMImage *somSelf, 
     2051SOM_Scope BOOL  SOMLINK cwimg_wpFormatDragItem(MMImage *somSelf,
    20552052                                               PDRAGITEM pdrgItem)
    20562053{
     
    20602057    MMImageMethodDebug("MMImage","cwimg_wpFormatDragItem");
    20612058
    2062     rc= (MMImage_parent_WPImageFile_wpFormatDragItem(somSelf, 
     2059    rc= (MMImage_parent_WPImageFile_wpFormatDragItem(somSelf,
    20632060                                                        pdrgItem));
    20642061DosBeep(500,10);
     
    20802077      If the folder is closed it's likely the bitmaps may be obsolete. A check for USAGE_RECORD items
    20812078      will be done on another thread.
    2082  
     2079
    20832080      wpDeleteFromObjUseList() seems to be the more natural place to do this but the method is not called
    20842081      when an object is removed from a container. Also wpCnrRemoveObject() doesn't work because the WPS seems
     
    20892086
    20902087     */
    2091     if(_hBitmap || _hBitmapSmall) 
     2088    if(_hBitmap || _hBitmapSmall)
    20922089      sendDeleteBMPMsg(somSelf);
    20932090
     
    21262123        /* Now check installed IO procs for other exts and add them to the filter list */
    21272124        _getMissingExtFromImageIOProc();
    2128         bGotImgExt=TRUE; 
     2125        bGotImgExt=TRUE;
    21292126      }
    21302127
     
    21342131      globalHab=WinQueryAnchorBlock(HWND_DESKTOP);
    21352132
    2136     if(!getMessage(chrHelpLibrary, IDSTR_HELPLIBRARY, sizeof(chrHelpLibrary), 
     2133    if(!getMessage(chrHelpLibrary, IDSTR_HELPLIBRARY, sizeof(chrHelpLibrary),
    21372134                   queryModuleHandle(), HWND_DESKTOP))
    21382135      strcpy(chrHelpLibrary,"MMPARTS.HLP");
     
    21522149      {
    21532150        memset((PCH)pCfi,0,sizeof(CLASSFIELDINFO));
    2154        
     2151
    21552152        pCfi->cb=sizeof(CLASSFIELDINFO);
    21562153        pCfi->flData=CFA_LEFT|CFA_SEPARATOR|CFA_FIREADONLY;
     
    21592156        pCfi->pTitleData=(PVOID)pszImageColTitles[i];
    21602157        pCfi->flCompare=COMPARE_SUPPORTED|SORTBY_SUPPORTED;
    2161        
     2158
    21622159        switch(i)
    21632160          {
     
    21912188          }/* switch(i) */
    21922189      }/* for() */
    2193     cfiImageFieldInfo[NUM_IMAGE_DETAILS_FIELDS].pNextFieldInfo=NULL;   
     2190    cfiImageFieldInfo[NUM_IMAGE_DETAILS_FIELDS].pNextFieldInfo=NULL;
    21942191    if(!hwndCreateBMP)
    21952192      _beginthread(createBMPThreadFunc,NULL,8192*20, NULLHANDLE); //Fehlerbehandlung fehlt
     
    22232220      {
    22242221        ULONG ulHowMatched=1;
    2225        
     2222
    22262223        DosBeep(5000, 1000);
    22272224        /* Template found. Now query associated program */
     
    22302227          DosBeep(500, 1000);
    22312228      }
    2232 #endif       
     2229#endif
    22332230    /* Create default templates. We do it here because we need an object to query the associated
    22342231       program (if any) when the system asks for the default view. */
     
    22522249            '\0',
    22532250            sizeof(MMFORMATINFO) );
    2254    
     2251
    22552252    mmFormatInfo.ulMediaType |= MMIO_MEDIATYPE_IMAGE;
    2256     mmFormatInfo.ulFlags|=MMIO_CANWRITETRANSLATED;   
     2253    mmFormatInfo.ulFlags|=MMIO_CANWRITETRANSLATED;
    22572254    ulReturnCode = mmioQueryFormatCount ( &mmFormatInfo,
    22582255                                          &lNumIOProcs,
    22592256                                          0,
    22602257                                          0 );
    2261    
     2258
    22622259    if( ulReturnCode != MMIO_SUCCESS )
    22632260      {
     
    22802277        return FALSE;
    22812278      }
    2282    
     2279
    22832280    /*
    22842281     * call mmioGetFormats to get info on the formats supported.
     
    22982295        return FALSE;
    22992296      }
    2300    
     2297
    23012298    if( lFormatsRead != lNumIOProcs )
    23022299      {
     
    23142311      {
    23152312        mmioGetFormatName(pmmFormatInfoArray, szBuffer, &lBytesRead, 0L, 0L);
    2316        
     2313
    23172314        /* Insert NULL string terminator */
    23182315        *( szBuffer + lBytesRead ) = (CHAR)NULL;
     
    23202317        /* Compressed TIF is not supported because the Warp 4 IO-Procs are
    23212318           broken. */
    2322         //HlpWriteToTrapLog("---------  Ext: %s, IO-Proc: %s, Name: %s\n", 
     2319        //HlpWriteToTrapLog("---------  Ext: %s, IO-Proc: %s, Name: %s\n",
    23232320        //chrExt,  pmmFormatInfoArray->szDefaultFormatExt,
    23242321        //                szBuffer);
     
    23362333        /*
    23372334         *  advance to next entry in mmFormatInfo array
    2338          */       
     2335         */
    23392336        pmmFormatInfoArray++;
    23402337      }
     
    23442341}
    23452342
    2346 SOM_Scope BOOL  SOMLINK cwimgM_wpclsCreateDefaultTemplates(M_MMImage *somSelf, 
     2343SOM_Scope BOOL  SOMLINK cwimgM_wpclsCreateDefaultTemplates(M_MMImage *somSelf,
    23472344                                                           WPObject* Folder)
    23482345{
     
    23542351    /* The FOURCC of the JPEG-IO proc is JPEG so we have to create that template
    23552352       in the JPG class. */
    2356    
     2353
    23572354    if(checkImageIOProc( _wpclsQueryInstanceFilter(somSelf))) {
    23582355      //   WPFolder* wpFolder;
     
    24002397 */
    24012398
    2402 SOM_Scope ULONG  SOMLINK cwimgM_wpclsQueryIconData(M_MMImage *somSelf, 
     2399SOM_Scope ULONG  SOMLINK cwimgM_wpclsQueryIconData(M_MMImage *somSelf,
    24032400                                                   PICONINFO pIconInfo)
    24042401{
     
    24242421 * The prototype for cwimgM_wpclsQueryDetailsInfo was replaced by the following prototype:
    24252422 */
    2426 SOM_Scope ULONG  SOMLINK cwimgM_wpclsQueryDetailsInfo(M_MMImage *somSelf, 
    2427                                                       PCLASSFIELDINFO* ppClassFieldInfo, 
     2423SOM_Scope ULONG  SOMLINK cwimgM_wpclsQueryDetailsInfo(M_MMImage *somSelf,
     2424                                                      PCLASSFIELDINFO* ppClassFieldInfo,
    24282425                                                      PULONG pSize)
    24292426{
     
    24352432    M_MMImageMethodDebug("M_MMImage","cwimgM_wpclsQueryDetailsInfo");
    24362433
    2437     cParentColumns= (M_MMImage_parent_M_WPImageFile_wpclsQueryDetailsInfo(somSelf, 
    2438                                                                  ppClassFieldInfo, 
     2434    cParentColumns= (M_MMImage_parent_M_WPImageFile_wpclsQueryDetailsInfo(somSelf,
     2435                                                                 ppClassFieldInfo,
    24392436                                                                 pSize));
    24402437  if(pSize)
Note: See TracChangeset for help on using the changeset viewer.