Changeset 104 for trunk/classes/c


Ignore:
Timestamp:
Oct 2, 2023, 11:34:35 PM (23 months ago)
Author:
gyoung
Message:

Remaining changes from merge with Lars 2.9 branch

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/classes/c/c_audio/cwaudio.c

    r93 r104  
     1
     2/*
     3 *  This file was generated by the SOM Compiler.
     4 *  Generated using:
     5 *     SOM incremental update: 2.47
     6 */
     7
    18
    29/*
     
    664671 * The prototype for cwaudio_cwmmSetTrackInfo was replaced by the following prototype:
    665672 */
     673
     674/*
     675 * SOM_Scope BOOL  SOMLINK cwaudio_cwmmSetTrackInfo(MMAudio *somSelf,
     676 *                                                  char* chrString,
     677 *                                                  ULONG ulValue,
     678 *                                                  int iWhich)
     679 */
     680
     681/*
     682 * The prototype for cwaudio_cwmmSetTrackInfo was replaced by the following prototype:
     683 */
    666684SOM_Scope BOOL  SOMLINK cwaudio_cwmmSetTrackInfo(MMAudio *somSelf,
    667685                                                 char* chrString,
    668686                                                 ULONG ulValue,
    669                                                  int iWhich)
     687                                                 ULONG iWhich)
    670688{
    671689  ULONG ulError;
     
    939957/* successful completion.                                */
    940958/*!!******************************************************/
     959
     960/*
     961 * SOM_Scope ULONG  SOMLINK cwaudio_cwmmQueryTrackInfo(MMAudio *somSelf,
     962 *                                                     PSZ chrString,
     963 *                                                     ULONG ulSize,
     964 *                                                     int iWhich)
     965 */
     966
     967/*
     968 * The prototype for cwaudio_cwmmQueryTrackInfo was replaced by the following prototype:
     969 */
    941970SOM_Scope ULONG  SOMLINK cwaudio_cwmmQueryTrackInfo(MMAudio *somSelf,
    942971                                                    PSZ chrString,
    943972                                                    ULONG ulSize,
    944                                                     int iWhich)
     973                                                    ULONG iWhich)
    945974{
    946975  MMAudioData *somThis = MMAudioGetData(somSelf);
  • trunk/classes/c/c_audio/cwcdtrack.c

    r2 r104  
     1
     2/*
     3 *  This file was generated by the SOM Compiler.
     4 *  Generated using:
     5 *     SOM incremental update: 2.47
     6 */
     7
    18
    29/*
     
    207214    MMCDTrackMethodDebug("MMCDTrack","cwcdtrack_wpFilterPopupMenu");
    208215
    209     return CTXT_SETTINGS | CTXT_HELP;
     216    return CTXT_SETTINGS | CTXT_HELP | CTXT_DELETE;
    210217
    211218    /* We don't want to have XFolder or WPS-Wizard menus here. These are useless
     
    281288 * The prototype for cwcdtrack_cwmmQueryTrackInfo was replaced by the following prototype:
    282289 */
     290
     291/*
     292 * SOM_Scope ULONG  SOMLINK cwcdtrack_cwmmQueryTrackInfo(MMCDTrack *somSelf,
     293 *                                                       PSZ chrString,
     294 *                                                       ULONG ulSize,
     295 *                                                       int iWhich)
     296 */
     297
     298/*
     299 * The prototype for cwcdtrack_cwmmQueryTrackInfo was replaced by the following prototype:
     300 */
    283301SOM_Scope ULONG  SOMLINK cwcdtrack_cwmmQueryTrackInfo(MMCDTrack *somSelf,
    284302                                                      PSZ chrString,
    285303                                                      ULONG ulSize,
    286                                                       int iWhich)
     304                                                      ULONG iWhich)
    287305{
    288306    MMCDTrackData *somThis = MMCDTrackGetData(somSelf);
  • trunk/classes/c/c_audio/cwmp3.c

    r72 r104  
     1
     2/*
     3 *  This file was generated by the SOM Compiler.
     4 *  Generated using:
     5 *     SOM incremental update: 2.47
     6 */
     7
     8
    19/*
    210 * (C) Chris Wohlgemuth 2002-2004
     
    853861 *    cwmmAddTrackNamePage      : override;
    854862 */
     863
     864/*
     865 * SOM_Scope ULONG  SOMLINK cwmp3_cwmmQueryTrackInfo(MMMP3 *somSelf,
     866 *                                                   PSZ chrString,
     867 *                                                   ULONG ulSize,
     868 *                                                   int iWhich)
     869 */
     870
     871/*
     872 * The prototype for cwmp3_cwmmQueryTrackInfo was replaced by the following prototype:
     873 */
    855874SOM_Scope ULONG  SOMLINK cwmp3_cwmmQueryTrackInfo(MMMP3 *somSelf,
    856875                                                  PSZ chrString,
    857876                                                  ULONG ulSize,
    858                                                   int iWhich)
     877                                                  ULONG iWhich)
    859878{
    860879  somId id;
  • trunk/classes/c/c_audio/cwogg.c

    r2 r104  
     1
     2/*
     3 *  This file was generated by the SOM Compiler.
     4 *  Generated using:
     5 *     SOM incremental update: 2.47
     6 */
     7
     8
    19/*
    210 * (C) Chris Wohlgemuth 2002-2004
     
    8896 * The prototype for cwogg_cwmmQueryTrackInfo was replaced by the following prototype:
    8997 */
     98
     99/*
     100 * SOM_Scope ULONG  SOMLINK cwogg_cwmmQueryTrackInfo(MMOGG *somSelf,
     101 *                                                   PSZ chrString,
     102 *                                                   ULONG ulSize,
     103 *                                                   int iWhich)
     104 */
     105
     106/*
     107 * The prototype for cwogg_cwmmQueryTrackInfo was replaced by the following prototype:
     108 */
    90109SOM_Scope ULONG  SOMLINK cwogg_cwmmQueryTrackInfo(MMOGG *somSelf,
    91110                                                  PSZ chrString,
    92111                                                  ULONG ulSize,
    93                                                   int iWhich)
     112                                                  ULONG iWhich)
    94113{
    95114  /*     MMOGGData *somThis = MMOGGGetData(somSelf); */
  • trunk/classes/c/c_common/except.c

    r41 r104  
    130130   USHORT  SS;
    131131} DbgBuf;
    132 /*-------------------------------------*/
    133 APIRET APIENTRY DOSQUERYMODFROMEIP( HMODULE *phMod,
    134                                     ULONG *pObjNum,
    135                                     ULONG BuffLen,
    136                                     PCHAR pBuff,
    137                                     ULONG *pOffset,
    138                                     PVOID Address );
    139 /*APIRET APIENTRY DosQueryModFromEIP( HMODULE *phMod,
    140                                     ULONG *pObjNum,
    141                                     ULONG BuffLen,
    142                                     PCHAR pBuff,
    143                                     ULONG *pOffset,
    144                                     PVOID Address );*/
    145 
    146 /*-------------------------------------*/
     132
    147133/* CW
    148134#define DBG_O_OBJMTE       0x10000000L*/
     
    459445
    460446  return 'c';
    461 } 
     447}
    462448
    463449ULONG _System excHandler(PEXCEPTIONREPORTRECORD pERepRec,
     
    515501{
    516502  ULONG rc = XCPT_CONTINUE_SEARCH;
    517  
     503
    518504  if (pERepRec->fHandlerFlags & EH_EXIT_UNWIND)
    519505    return (XCPT_CONTINUE_SEARCH);
     
    522508  if (pERepRec->fHandlerFlags & EH_NESTED_CALL)
    523509    return (XCPT_CONTINUE_SEARCH);
    524  
     510
    525511  if ((pERepRec->ExceptionNum & XCPT_SEVERITY_CODE) == XCPT_FATAL_EXCEPTION)
    526512    {
     
    655641          }
    656642#endif
    657        
     643
    658644        fAlreadyTrapped = TRUE;
    659645        /* end  John Currier's recursion prevention */
     
    663649            (Version[0]>=20) &&
    664650            (Version[1]>=10) ) {
    665           /* version must be over 2.1 for DOSQUERYMODFROMEIP */
     651          /* version must be over 2.1 for DosQueryModFromEIP */
    666652          fprintf(hTrap,"OS/2 Version %d.%d\n",Version[0]/10,Version[1]);
    667           rc=DOSQUERYMODFROMEIP( &hMod, &ObjNum, CCHMAXPATH,
     653          rc=DosQueryModFromEIP( &hMod, &ObjNum, CCHMAXPATH,
    668654                                 Name, &Offset, pERepRec->ExceptionAddress);
    669655            if (rc==0) {
     
    814800     if ((AllocationFlags&PAG_EXECUTE)&&
    815801         (AllocationFlags&PAG_BASE)) {
    816         rc=DOSQUERYMODFROMEIP( &hMod, &ObjNum, CCHMAXPATH,
     802        rc=DosQueryModFromEIP( &hMod, &ObjNum, CCHMAXPATH,
    817803                              Name, &Offset, BaseAddress);
    818804        if (rc==0) {
     
    10381024            break; /* avoid infinite loops */
    10391025         } else {
    1040             rc = DOSQUERYMODFROMEIP(&hMod, &ObjNum, sizeof(Name),
     1026            rc = DosQueryModFromEIP(&hMod, &ObjNum, sizeof(Name),
    10411027                                    Name, &Offset, (PVOID)RetAddr);
    10421028            if (rc == NO_ERROR && ObjNum != -1)
     
    11811167}
    11821168
    1183 #include <exe.h>
    11841169#include <newexe.h>
    11851170#define  FOR_EXEHDR  1  /* avoid define conflicts between newexe.h and exe386.h */
     
    18351820               do {
    18361821                  read(fh,(void *)&FirstLine,sizeof(FirstLine));
    1837    
     1822
    18381823                  if (FirstLine.LineNum!=0) {
    18391824                     fprintf(hTrap,"Missing Line table information\n");
     
    18641849                        }
    18651850                        break;
    1866    
     1851
    18671852                     case 1:
    18681853                        lseek(fh, sizeof(struct linlist_rec), SEEK_CUR);
    18691854                        break;
    1870    
     1855
    18711856                     case 2:
    18721857                        lseek(fh, sizeof(struct linsourcelist_rec), SEEK_CUR);
    18731858                        break;
    1874    
     1859
    18751860                     case 3:
    18761861                        lseek(fh, sizeof(struct filenam_rec), SEEK_CUR);
    18771862                        break;
    1878    
     1863
    18791864                     case 4:
    18801865                        lseek(fh, sizeof(struct pathtab_rec), SEEK_CUR);
    18811866                        break;
    1882    
     1867
    18831868                  }
    18841869               }
  • trunk/classes/c/c_common/helper.c

    r57 r104  
    1919/*
    2020 * If you need another license for your prject/product contact me at
    21  * 
     21 *
    2222 * http://www.os2world.com/cdwriting
    2323 * http://www.geocities.com/SiliconValley/Sector/5785/
    2424 */
     25#define INCL_BASE
    2526#define INCL_WIN
    2627#define INCL_DOS
     
    4142
    4243#ifndef BS_NOTEBOOKBUTTON
    43 #define BS_NOTEBOOKBUTTON 8L   /* Warp 4 notebook style */ 
     44#define BS_NOTEBOOKBUTTON 8L   /* Warp 4 notebook style */
    4445#endif
    4546
     
    6667
    6768
    68   memset(&pDetails, 0, sizeof(pDetails)); 
     69  memset(&pDetails, 0, sizeof(pDetails));
    6970  pDetails.Length          = sizeof(PROGDETAILS);
    7071  pDetails.progt.progc     = PROG_DEFAULT;
     
    8182  }
    8283  pDetails.pszExecutable   = wrapperExe;
    83  
     84
    8485  pDetails.pszEnvironment  = NULLHANDLE;
    8586  pDetails.swpInitial.fl   = SWP_ACTIVATE|SWP_ZORDER; /* window positioning */
     
    9293  //  pDetails.swpInitial.ulReserved1      = 0;
    9394  //  pDetails.swpInitial.ulReserved2      = 0;
    94  
     95
    9596  /* Create an object window which will process the WM_APPTERMINATE message. While processing of this
    9697   message the view item (see below) will be removed from the inuse list thus removing the inuse emphasis. */
     
    150151  if(!hModule)
    151152    {
    152      
     153
    153154      if(queryModuleHandle())
    154155        {
     
    170171              if(NO_ERROR!=DosScanEnv("LANG", &pszLang))
    171172                break;
    172              
     173
    173174              /* Skip leading spaces */
    174175              chrPtr=pszLang;
    175176              while(*chrPtr==' ')
    176177                chrPtr++;
    177              
     178
    178179              /* Check if value seems to be valid. The var must be something like xx_XX thus length is 5 */
    179180              if(strlen(chrPtr)<5)
    180181                break;
    181              
    182               /* Extract the first two chars */       
     182
     183              /* Extract the first two chars */
    183184              sprintf(buf, RESDLLNAME, chrPtr[0], chrPtr[1]);
    184185              strcat(resDLLPath,buf);
     
    187188              //  HlpWriteToTrapLog(resDLLPath);
    188189              //  HlpWriteToTrapLog("\n");
    189        
     190
    190191              rc=DosLoadModule(buf,sizeof(buf), resDLLPath, &hModule);
    191192              if(rc==NO_ERROR)
    192193                break;
    193        
     194
    194195              /* Insert message in Logfile */
    195196              //  writeLog("Ressource-DLL for the current countrycode not found. Trying to load default one (CDFLD001.DLL).\n");
    196        
     197
    197198              /* NLS DLL not found. Try to load default */
    198199              found=strrchr(resDLLPath,'\\');
    199200              if(!found)
    200201                break;
    201              
     202
    202203              *found=0;
    203204
     
    206207              //   HlpWriteToTrapLog(resDLLPath);
    207208              //   HlpWriteToTrapLog("\n");
    208              
     209
    209210              rc=DosLoadModule(buf,sizeof(buf), resDLLPath, &hModule);
    210211              if(rc!=NO_ERROR) {
     
    215216                //writeLog("Ressource DLL loaded.\n");
    216217              }
    217              
     218
    218219              break;
    219220            }while(TRUE);
     
    223224 }
    224225
    225 /*APIRET APIENTRY DosQueryModFromEIP( HMODULE *phMod,
    226                                     ULONG *pObjNum,
    227                                     ULONG BuffLen,
    228                                     PCHAR pBuff,
    229                                     ULONG *pOffset,
    230                                     PVOID Address );*/
    231 
    232226 /* Get the HMODULE of the MM class DLL */
    233227HMODULE queryModuleHandle(void)
     
    242236      ULONG ulObj, ulBufLen, ulOffset;
    243237      char thePath[CCHMAXPATH];
    244      
     238
    245239      if(DosQueryModFromEIP( &hModule,
    246240                             &ulObj,
     
    248242                             thePath,
    249243                             &ulOffset,
    250                              (PVOID)queryModuleHandle )!=NO_ERROR) {
     244                             (ULONG)queryModuleHandle )!=NO_ERROR) {
    251245        SysWriteToTrapLog("Can't get module handle for CWMM class DLL!\n");
    252246        hModule=0;
     
    291285      strncpy(classDLLPath,moduleName, sizeof(classDLLPath));
    292286      classDLLPath[sizeof(classDLLPath)-1]=0;
    293      
     287
    294288      /* Get install dir */
    295289      strncpy(chrInstallDir,moduleName, sizeof(chrInstallDir));
     
    303297        strncpy(classDLLPath,chrInstallDir, sizeof(classDLLPath));
    304298        classDLLPath[sizeof(classDLLPath)-1]=0;
    305        
     299
    306300        /* Get install dir */
    307301        if((chrPtr=strrchr(chrInstallDir,'\\'))!=NULLHANDLE)
     
    352346    HENUM henum;
    353347    HWND hwnd;
    354    
     348
    355349    /* Move the default notebook buttons */
    356350    if((henum=WinBeginEnumWindows(hwndDlg))!=NULLHANDLE) {
     
    396390    {
    397391      snprintf(setup, sizeof(setup), "LOCATOR=%s;%s", chrUrl, "OPEN=DEFAULT");
    398       WinCreateObject("WPUrl","tempUrl", setup, tempDir, 
     392      WinCreateObject("WPUrl","tempUrl", setup, tempDir,
    399393                      CO_UPDATEIFEXISTS);
    400394        /* WinDestroyObject(hObject); Don't use it, blocks PM */
     
    402396}
    403397
    404 /* This function checks if the given file exists */ 
     398/* This function checks if the given file exists */
    405399ULONG checkFileSize(char* chrFileName)
    406400{
     
    410404  if(stat(chrFileName , &statBuf)==-1)
    411405    return 0;
    412  
     406
    413407  return statBuf.st_size;
    414408}
  • trunk/classes/c/c_mm/mmfolder.c

    r71 r104  
    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/
     
    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 */
     
    7777  somId mySomId;
    7878  static SOMClass * mWPFolderClass=NULLHANDLE;
    79  
     79
    8080  if(!mWPFolderClass) {
    8181    if((mySomId=somIdFromString("WPFolder"))!=NULLHANDLE) {
     
    107107  somId mySomId;
    108108  static SOMClass *mWPImgClass=NULL;
    109  
     109
    110110  if(!mWPImgClass) {
    111111    if((mySomId=somIdFromString("MMBitmap"))!=NULLHANDLE) {
     
    117117}
    118118
    119 MRESULT EXPENTRY mmFolderContainerProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 
     119MRESULT EXPENTRY mmFolderContainerProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    120120{
    121121  HWND hwndStore;
     
    136136
    137137        if(pCnrInfo) {
    138           //      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",
    139139          //       pCnrInfo->flWindowAttr, LONGFROMMP(mp2), pCnrInfo->cxTreeIndent, pCnrInfo->cyLineSpacing);
    140140
     
    147147                somSelf=(MMFolder*) WinQueryWindowULong(hwndStore,QWL_USER);
    148148                if(somIsObj(somSelf)) {
    149                   MMFolderData *somThis = MMFolderGetData(somSelf); 
    150                  
     149                  MMFolderData *somThis = MMFolderGetData(somSelf);
     150
    151151                  pCnrInfo->flWindowAttr&=~CA_DRAWICON;
    152152                  pCnrInfo->flWindowAttr|=CA_DRAWBITMAP|CA_OWNERDRAW;
    153153                  pCnrInfo->slBitmapOrIcon.cx=_ulCurrentSize;
    154154                  pCnrInfo->slBitmapOrIcon.cy=_ulCurrentSize;
    155                  
     155
    156156                  mp2=MPFROMLONG(LONGFROMMP(mp2)|CMA_SLBITMAPORICON|CMA_FLWINDOWATTR);
    157157                }
     
    183183          somSelf=(MMFolder*) WinQueryWindowULong(hwndStore,QWL_USER);
    184184          if(somIsObj(somSelf)) {
    185             MMFolderData *somThis = MMFolderGetData(somSelf); 
     185            MMFolderData *somThis = MMFolderGetData(somSelf);
    186186            if(_oldContainerProc)
    187187              return _oldContainerProc(hwnd, msg, mp1, mp2);
    188188          }
    189189        }
    190     }   
     190    }
    191191  return WinDefWindowProc(hwnd, msg, mp1, mp2);
    192192}
     
    239239  HPOINTER hptrTemplate;
    240240  HMODULE hmodTemplate;
    241  
     241
    242242  if(!DosQueryModuleHandle("PMWP",&hmodTemplate))
    243243    {
    244244      ULONG ulIconSize;
    245      
     245
    246246      hptrTemplate=WinLoadPointer(HWND_DESKTOP, hmodTemplate, 20);
    247247      WinDrawPointer(hps, rcl->xLeft, rcl->yBottom, hptrTemplate, (flCnr &  CV_MINI ? DP_MINI:DP_NORMAL));
     
    255255      return DP_MINI;
    256256    }
    257  
     257
    258258  return DP_NORMAL;
    259259}
    260260
    261261
    262 MRESULT EXPENTRY mmFolderFrameProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 
     262MRESULT EXPENTRY mmFolderFrameProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    263263{
    264264  HWND hwndStore;
     
    273273      {
    274274        POWNERITEM pOwnerItem=(POWNERITEM)PVOIDFROMMP(mp2);
    275  
     275
    276276
    277277        /* We only draw icons not text */
     
    299299            POINTL pointl;
    300300
    301             WinFillRect(pOwnerItem->hps, &rclTemp, CLR_WHITE);           
     301            WinFillRect(pOwnerItem->hps, &rclTemp, CLR_WHITE);
    302302            GpiSetPattern(pOwnerItem->hps,PATSYM_DIAG2);
    303303            pointl.x = rclTemp.xLeft;
     
    307307            pointl.y = rclTemp.yTop - 1;
    308308            GpiSetColor(pOwnerItem->hps, CLR_BLACK);
    309             GpiBox(pOwnerItem->hps,DRO_FILL,&pointl,1,1);         
    310            
     309            GpiBox(pOwnerItem->hps,DRO_FILL,&pointl,1,1);
     310
    311311          }
    312312          /* Check if record is in use */
     
    314314            POINTL pointl;
    315315
    316             WinFillRect(pOwnerItem->hps, &rclTemp, CLR_WHITE);           
     316            WinFillRect(pOwnerItem->hps, &rclTemp, CLR_WHITE);
    317317            GpiSetPattern(pOwnerItem->hps,PATSYM_DIAG1);
    318318            pointl.x = rclTemp.xLeft;
     
    322322            pointl.y = rclTemp.yTop - 1;
    323323            GpiSetColor(pOwnerItem->hps, CLR_BLACK);
    324             GpiBox(pOwnerItem->hps,DRO_FILL,&pointl,1,1);                   
     324            GpiBox(pOwnerItem->hps,DRO_FILL,&pointl,1,1);
    325325          }
    326326          /* or is it only selected? */
     
    330330          else
    331331            WinFillRect(pOwnerItem->hps, &rclTemp, CLR_WHITE);
    332           /* Emphasis drawn */         
     332          /* Emphasis drawn */
    333333
    334334          /********************************************/
     
    340340            WPObject *wpObject;
    341341            ULONG ulIconSize=150;/* Default if query fails */
    342            
     342
    343343            wpObject=(WPObject*)OBJECT_FROM_PREC(mrc); // Get object
    344344            wpObject=somGetFileSystemObject(wpObject);  // Get Filesystem object
     
    356356                SysWriteToTrapLog("Object is an image. (%s line: %d)\n", __FUNCTION__, __LINE__);
    357357#endif
    358                 /* Get object pointer of lighttable folder */               
     358                /* Get object pointer of lighttable folder */
    359359                if((hwndStore=WinWindowFromID(hwnd, STOREWINDOWID))!=NULLHANDLE)
    360360                  {
    361361                    somSelf=(MMFolder*) WinQueryWindowULong(hwndStore,QWL_USER);
    362362                    if(somIsObj(somSelf)) {
    363                       MMFolderData *somThis = MMFolderGetData(somSelf); 
     363                      MMFolderData *somThis = MMFolderGetData(somSelf);
    364364                      ulIconSize=_ulCurrentSize;
    365365                    }
     
    423423                      /* And now draw the bitmap */
    424424#if 0
    425                       if(pBmpInfoHeader2->cclrUsed==2) {                       
     425                      if(pBmpInfoHeader2->cclrUsed==2) {
    426426                        WinDrawBitmap(pOwnerItem->hps, hbm, NULL, (PPOINTL)&rcl,//pOwnerItem->rclItem,
    427427                                      CLR_WHITE, CLR_BLACK, DBM_STRETCH /*| DBM_IMAGEATTRS*/);
     
    437437                    /* Done */
    438438                    if(_somIsA(wpObject, cwImageClass)) {
    439                       MMImage_cwmmFreeSmallBitmap((MMImage *)wpObject);
    440                     }
    441                     else {
    442                      MMBitmap_cwmmFreeSmallBitmap((MMBitmap*)wpObject);
     439                       MMImage_cwmmFreeSmallBitmap((MMImage *)wpObject);
     440                    }
     441                    else {
     442                       MMBitmap_cwmmFreeSmallBitmap((MMBitmap*)wpObject);
    443443                    }
    444444                    return (MRESULT) TRUE;
     
    474474                  {
    475475                    SOMClass* wpFolderClass=queryWpFolderClass();
    476                    
     476
    477477                    if(somIsObj(wpFolderClass)) {
    478                       if(_somIsA(wpObject, wpFolderClass)) {   
     478                      if(_somIsA(wpObject, wpFolderClass)) {
    479479                        /* It's a folder */
    480480                        HPOINTER hptr;
    481                        
     481
    482482                        pOwnerItem->rclItem.xLeft=rcl.xLeft;
    483483                        pOwnerItem->rclItem.yBottom=rcl.yBottom;
    484                        
     484
    485485                        /* The following is only for Warp 4 but Warp 3 isn't supported anyway...*/
    486486                        hptr=_wpQueryIconN(wpObject,1);
     
    489489                          return (MRESULT) TRUE;
    490490                        }
    491                        
     491
    492492                      }
    493493                    }/* if(somIsObj(wpFolderClass)) */
    494494                  }/* if(pCnrDrawItemInfo->pRecord->flRecordAttr & CRA_INUSE) */
    495                
     495
    496496                if(WinDrawPointer(pOwnerItem->hps, rcl.xLeft, rcl.yBottom, mrc->hptrIcon, ulMiniOrNormal)) {
    497497                  cwDraw2ColorBorder(pOwnerItem->hps, &rclTemp, CLR_BLACK, CLR_DARKGRAY);
     
    508508          /*************************/
    509509          PCNRDRAWITEMINFO pCnrDrawItemInfo=(PCNRDRAWITEMINFO)pOwnerItem->hItem;
    510          
     510
    511511          if(pCnrDrawItemInfo && pCnrDrawItemInfo->pFieldInfo->flData & CFA_BITMAPORICON) {
    512512            PMINIRECORDCORE mrc=(PMINIRECORDCORE)((PCNRDRAWITEMINFO)pOwnerItem->hItem)->pRecord;
     
    517517              HWND hwndCnr=WinWindowFromID(hwnd, FID_CLIENT);
    518518              RECTL rclTemp=pOwnerItem->rclItem;
    519              
     519
    520520              wpObjToRefresh=(WPObject*)OBJECT_FROM_PREC(mrc);//Get object
    521521              wpObject=somGetFileSystemObject(wpObjToRefresh);
    522              
     522
    523523              /* Draw Background */
    524524              rclTemp.xLeft+=2;
     
    526526              rclTemp.yBottom+=2;
    527527              rclTemp.yTop-=2;
    528              
     528
    529529              /* Check if record is selected and in use... */
    530530              if((pCnrDrawItemInfo->pRecord->flRecordAttr & CRA_INUSE)
    531531                 && (pCnrDrawItemInfo->pRecord->flRecordAttr & CRA_SELECTED)) {
    532532                POINTL pointl;
    533                
     533
    534534                GpiSetPattern(pOwnerItem->hps,PATSYM_DIAG2);
    535535                pointl.x = rclTemp.xLeft;
     
    539539                pointl.y = rclTemp.yTop - 1;
    540540                GpiSetColor(pOwnerItem->hps, CLR_BLACK);
    541                 GpiBox(pOwnerItem->hps,DRO_FILL,&pointl,1,1);         
    542                
     541                GpiBox(pOwnerItem->hps,DRO_FILL,&pointl,1,1);
     542
    543543              }
    544544              /* or only in use... */
    545545              else if(pCnrDrawItemInfo->pRecord->flRecordAttr & CRA_INUSE) {
    546546                POINTL pointl;
    547                
     547
    548548                GpiSetPattern(pOwnerItem->hps,PATSYM_DIAG1);
    549549                pointl.x = rclTemp.xLeft;
     
    553553                pointl.y = rclTemp.yTop - 1;
    554554                GpiSetColor(pOwnerItem->hps, CLR_BLACK);
    555                 GpiBox(pOwnerItem->hps,DRO_FILL,&pointl,1,1);         
     555                GpiBox(pOwnerItem->hps,DRO_FILL,&pointl,1,1);
    556556              }
    557557              /* or only selected. */
     
    564564                SOMClass* cwBitmapClass=queryCWBitmapFileClass();
    565565                SOMClass* cwImageClass=queryCWImageFileClass();
    566                
     566
    567567                if(somIsObj(cwImageClass)||somIsObj(cwBitmapClass)) {
    568568                  HBITMAP hbm=NULLHANDLE;
    569569                  PBITMAPINFOHEADER2 pBmpInfoHeader2;
    570                  
     570
    571571                  /* Query object pointer */
    572572                  if((hwndStore=WinWindowFromID(hwnd, STOREWINDOWID))!=NULLHANDLE)
     
    574574                      somSelf=(MMFolder*) WinQueryWindowULong(hwndStore,QWL_USER);
    575575                      if(somIsObj(somSelf)) {
    576                         MMFolderData *somThis = MMFolderGetData(somSelf); 
     576                        MMFolderData *somThis = MMFolderGetData(somSelf);
    577577                        ulIconSize=_ulCurrentSize;
    578578                      }
    579579                    }
    580                   /* Get the small bitmap from the object */ 
     580                  /* Get the small bitmap from the object */
    581581                  if(_somIsA(wpObject, cwImageClass)) {
    582582                    hbm=MMImage_cwmmQuerySmallBitmapHandle( (MMImage*) wpObject, ulIconSize, mrc, hwndCnr);
     
    636636                      }
    637637                      if(_somIsA(wpObject, cwImageClass)) {
    638                       MMImage_cwmmFreeSmallBitmap((MMImage *)wpObject);
    639                     }
    640                     else {
    641                       MMBitmap_cwmmFreeSmallBitmap((MMBitmap*)wpObject);
    642                     }
     638                         MMImage_cwmmFreeSmallBitmap((MMImage *)wpObject);
     639                      }
     640                      else {
     641                         MMBitmap_cwmmFreeSmallBitmap((MMBitmap*)wpObject);
     642                      }
    643643                      return (MRESULT) TRUE;
    644644                    }/* hbm */
     
    684684          somSelf=(MMFolder*) WinQueryWindowULong(hwndStore,QWL_USER);
    685685          if(somIsObj(somSelf)) {
    686             MMFolderData *somThis = MMFolderGetData(somSelf); 
     686            MMFolderData *somThis = MMFolderGetData(somSelf);
    687687            switch(_usLastSelMenuItem)
    688688              {
     
    701701                      /* insert separator */
    702702                      menuInsertMenuSeparator( HWNDFROMMP(mp2), NULLHANDLE, MIT_END);
    703                      
     703
    704704                      /* Load the menu from the resource */
    705705                      hwndMenu=WinLoadMenu(hwnd,queryResModuleHandle(), ID_MENUICONSIZE);
    706                      
     706
    707707                      /* Fill the MENUITEM structure */
    708708                      mi.iPosition=MIT_END;
    709709                      mi.afStyle=MIS_TEXT|MIS_SUBMENU;
    710710                      mi.id=ID_MENUICONSIZE;
    711                       mi.afAttribute=NULLHANDLE;               
     711                      mi.afAttribute=NULLHANDLE;
    712712                      mi.hwndSubMenu=hwndMenu;
    713713                      mi.hItem=NULLHANDLE;
     
    715715                        strcpy(text, "Icon ~size");;
    716716                      menuInsertMenuItem(HWNDFROMMP(mp2), hwndMenu, MIT_END, ID_MENUICONSIZE, text);
    717                      
     717
    718718                      /* check current menuitem */
    719719                      switch(_ulCurrentSize)
     
    738738                          break;
    739739                        default:
    740                           break; 
     740                          break;
    741741                        }
    742742                    }
     
    755755          somSelf=(MMFolder*) WinQueryWindowULong(hwndStore,QWL_USER);
    756756          if(somIsObj(somSelf)) {
    757             MMFolderData *somThis = MMFolderGetData(somSelf); 
     757            MMFolderData *somThis = MMFolderGetData(somSelf);
    758758            _usLastSelMenuItem=SHORT1FROMMP(mp1);
    759759          }
     
    768768      somSelf=(MMFolder*) WinQueryWindowULong(hwndStore,QWL_USER);
    769769      if(somIsObj(somSelf)) {
    770         MMFolderData *somThis = MMFolderGetData(somSelf); 
     770        MMFolderData *somThis = MMFolderGetData(somSelf);
    771771        if(_oldFrameProc)
    772772          return _oldFrameProc(hwnd, msg, mp1, mp2);
    773773      }
    774774    }
    775  
     775
    776776  return WinDefWindowProc(hwnd, msg, mp1, mp2);
    777777}
     
    781781 */
    782782
    783 SOM_Scope HWND  SOMLINK mmfldr_wpOpen(MMFolder *somSelf, HWND hwndCnr, 
     783SOM_Scope HWND  SOMLINK mmfldr_wpOpen(MMFolder *somSelf, HWND hwndCnr,
    784784                                      ULONG ulView, ULONG param)
    785785{
    786786  HWND hwnd;
    787787
    788   MMFolderData *somThis = MMFolderGetData(somSelf); 
     788  MMFolderData *somThis = MMFolderGetData(somSelf);
    789789    MMFolderMethodDebug("MMFolder","mmfldr_wpOpen");
    790790
    791     hwnd=(MMFolder_parent_WPFolder_wpOpen(somSelf, hwndCnr, 
     791    hwnd=(MMFolder_parent_WPFolder_wpOpen(somSelf, hwndCnr,
    792792                                            ulView, param));
    793793
    794794    /* Only subclass folder frames, not settings notebooks */
    795     if(ulView!=OPEN_SETTINGS){   
     795    if(ulView!=OPEN_SETTINGS){
    796796      HWND hwndStore;
    797797
     
    799799                         hwnd, HWND_BOTTOM, STOREWINDOWID, NULLHANDLE, NULLHANDLE))!=NULLHANDLE)
    800800        {
    801           HWND hwndContainer;     
     801          HWND hwndContainer;
    802802
    803803          WinSetWindowULong(hwndStore, QWL_USER, (ULONG)somSelf);
    804804          _oldFrameProc=WinSubclassWindow(hwnd, mmFolderFrameProc);
    805          
     805
    806806          if(hwnd)
    807807            {
    808808              CNRINFO cnrInfo;
    809809              HWND hwndContainer=WinWindowFromID(hwnd,FID_CLIENT);
    810  
     810
    811811              /* Change the containerflags */
    812812              if(WinSendMsg(hwndContainer,CM_QUERYCNRINFO, MPFROMP(&cnrInfo),
    813813                            MPFROMSHORT(sizeof(cnrInfo))))
    814814                {
    815                   if(cnrInfo.flWindowAttr & CV_ICON) {             
     815                  if(cnrInfo.flWindowAttr & CV_ICON) {
    816816                    cnrInfo.slBitmapOrIcon.cx=_ulCurrentSize;
    817817                    cnrInfo.slBitmapOrIcon.cy=_ulCurrentSize;
     
    834834
    835835#if 0
    836 SOM_Scope BOOL  SOMLINK mmfldr_wpSetupOnce(MMFolder *somSelf, 
     836SOM_Scope BOOL  SOMLINK mmfldr_wpSetupOnce(MMFolder *somSelf,
    837837                                           PSZ pszSetupString)
    838838{
     
    859859#endif
    860860
    861 SOM_Scope BOOL  SOMLINK mmfldr_wpRestoreState(MMFolder *somSelf, 
     861SOM_Scope BOOL  SOMLINK mmfldr_wpRestoreState(MMFolder *somSelf,
    862862                                              ULONG ulReserved)
    863863{
     
    870870    }
    871871
    872     return (MMFolder_parent_WPFolder_wpRestoreState(somSelf, 
     872    return (MMFolder_parent_WPFolder_wpRestoreState(somSelf,
    873873                                                    ulReserved));
    874874}
    875875
    876 SOM_Scope BOOL  SOMLINK mmfldr_wpRestoreData(MMFolder *somSelf, 
    877                                              PSZ pszClass, ULONG ulKey, 
     876SOM_Scope BOOL  SOMLINK mmfldr_wpRestoreData(MMFolder *somSelf,
     877                                             PSZ pszClass, ULONG ulKey,
    878878                                             PBYTE pValue, PULONG pcbValue)
    879879{
     
    882882    MMFolderMethodDebug("MMFolder","mmfldr_wpRestoreData");
    883883
    884     rc= (MMFolder_parent_WPFolder_wpRestoreData(somSelf, pszClass, 
    885                                                    ulKey, pValue, 
     884    rc= (MMFolder_parent_WPFolder_wpRestoreData(somSelf, pszClass,
     885                                                   ulKey, pValue,
    886886                                                   pcbValue));
    887887    switch(ulKey)
     
    919919    MMFolderData *somThis = MMFolderGetData(somSelf);
    920920    MMFolderMethodDebug("MMFolder","mmfldr_wpSaveState");
    921    
     921
    922922    _wpSaveLong( somSelf, "MMFolder", KEY_ICONSIZE, _ulCurrentSize);
    923923
     
    926926
    927927
    928 SOM_Scope BOOL  SOMLINK mmfldr_wpSaveData(MMFolder *somSelf, 
    929                                           PSZ pszClass, ULONG ulKey, 
     928SOM_Scope BOOL  SOMLINK mmfldr_wpSaveData(MMFolder *somSelf,
     929                                          PSZ pszClass, ULONG ulKey,
    930930                                          PBYTE pValue, ULONG cbValue)
    931931{
     
    937937       the address of the instance data containing grid spacing and view. So
    938938       we force the object to save the instance data and in wpSaveData we
    939        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.
    940940       This change is done in wpObjectReady() where we called wpSaveImmediate(). */
    941941
     
    946946      Check ID for NULL to prevent crash in stricmp().
    947947     */
    948     psz=_wpQueryObjectID(somSelf);         
     948    psz=_wpQueryObjectID(somSelf);
    949949    //  if(!stricmp(_wpQueryObjectID(somSelf), "<MMPM2_MMFOLDERTEMPLATE>"))
    950950    if(psz && !stricmp(psz, "<MMPM2_MMFOLDERTEMPLATE>"))
     
    982982      }
    983983
    984     return (MMFolder_parent_WPFolder_wpSaveData(somSelf, pszClass, 
    985                                                 ulKey, pValue, 
     984    return (MMFolder_parent_WPFolder_wpSaveData(somSelf, pszClass,
     985                                                ulKey, pValue,
    986986                                                cbValue));
    987987}
    988988
    989 SOM_Scope BOOL  SOMLINK mmfldr_wpMenuItemSelected(MMFolder *somSelf, 
    990                                                   HWND hwndFrame, 
     989SOM_Scope BOOL  SOMLINK mmfldr_wpMenuItemSelected(MMFolder *somSelf,
     990                                                  HWND hwndFrame,
    991991                                                  ULONG ulMenuId)
    992992{
     
    10041004          char text[200];
    10051005          CNRINFO cnrInfo2=cnrInfo;
    1006    
     1006
    10071007          switch(ulMenuId)
    10081008            {
     
    10541054          }
    10551055
    1056           _wpSetup(somSelf, "MENUITEMSELECTED=716");/* Change to icon view */         
     1056          _wpSetup(somSelf, "MENUITEMSELECTED=716");/* Change to icon view */
    10571057          _wpSetup(somSelf, "MENUITEMSELECTED=309");/* Arrange */
    10581058
     
    10621062        }
    10631063    }/* if() */
    1064     return (MMFolder_parent_WPFolder_wpMenuItemSelected(somSelf, 
    1065                                                         hwndFrame, 
     1064    return (MMFolder_parent_WPFolder_wpMenuItemSelected(somSelf,
     1065                                                        hwndFrame,
    10661066                                                        ulMenuId));
    10671067}
     
    10711071 *wpSetup:override;
    10721072 */
    1073 SOM_Scope void  SOMLINK mmfldr_wpObjectReady(MMFolder *somSelf, 
     1073SOM_Scope void  SOMLINK mmfldr_wpObjectReady(MMFolder *somSelf,
    10741074                                             ULONG ulCode, WPObject* refObject)
    10751075{
     
    11001100
    11011101          /* If no ID result is NULL */
    1102           psz=_wpQueryObjectID(somSelf);         
     1102          psz=_wpQueryObjectID(somSelf);
    11031103          if(psz && !stricmp(psz, "<MMPM2_MMFOLDERTEMPLATE>")) {
    11041104            /* When the template is created wpRestoreData() isn't called so we don't have
     
    11061106               we force the object to save the instance data and in wpSaveData we
    11071107               finally get the right addresses to change the object view to gridded. */
    1108            
     1108
    11091109            _wpSaveImmediate(somSelf);
    11101110            /* Set default view to gridded */
    1111            
     1111
    11121112            if(_pFldrLongArray!=NULLHANDLE) {
    11131113              *_pFldrLongArray=0x80;
     
    11201120              *(_pulGridSpacing--)=_ulCurrentSize+MMFLDR_SPACINGDELTA_Y;
    11211121            }
    1122            
     1122
    11231123          }
    11241124          break;
     
    11371137    MMFolderMethodDebug("MMFolder","mmfldr_wpSetup");
    11381138
    1139     bufferSize=sizeof(buffer); 
     1139    bufferSize=sizeof(buffer);
    11401140    if(_wpScanSetupString(somSelf, pszSetupString, SETUP_MMTHUMBSIZE, buffer, &bufferSize))
    11411141      {
     
    11801180            pViewItem=_wpFindViewItem(somSelf,VIEW_CONTENTS|VIEW_TREE|VIEW_DETAILS, pViewItem))
    11811181          {
    1182             _wpMenuItemSelected(somSelf, 
    1183                                 pViewItem->handle, 
     1182            _wpMenuItemSelected(somSelf,
     1183                                pViewItem->handle,
    11841184                                ulMenuId);
    11851185          }
     
    11891189
    11901190
    1191 SOM_Scope BOOL  SOMLINK mmfldrM_wpclsCreateDefaultTemplates(M_MMFolder *somSelf, 
     1191SOM_Scope BOOL  SOMLINK mmfldrM_wpclsCreateDefaultTemplates(M_MMFolder *somSelf,
    11921192                                                            WPObject* Folder)
    11931193{
     
    12051205  wpFolder=_wpclsQueryFolder(somSelf, MMTEMPLATE_FOLDER_ID, FALSE);
    12061206  _wpclsNew(somSelf, _wpclsQueryTitle(somSelf), chrSetup, wpFolder,FALSE);
    1207  
     1207
    12081208  return TRUE;
    12091209}
     
    12241224
    12251225
    1226 SOM_Scope ULONG  SOMLINK mmfldrM_wpclsQueryIconData(M_MMFolder *somSelf, 
     1226SOM_Scope ULONG  SOMLINK mmfldrM_wpclsQueryIconData(M_MMFolder *somSelf,
    12271227                                                    PICONINFO pIconInfo)
    12281228{
     
    12461246
    12471247
    1248 SOM_Scope ULONG  SOMLINK mmfldrM_wpclsQueryIconDataN(M_MMFolder *somSelf, 
    1249                                                      ICONINFO* pIconInfo, 
     1248SOM_Scope ULONG  SOMLINK mmfldrM_wpclsQueryIconDataN(M_MMFolder *somSelf,
     1249                                                     ICONINFO* pIconInfo,
    12501250                                                     ULONG ulIconIndex)
    12511251{
  • trunk/classes/c/cwmm.DEF

    r3 r104  
    11; CWMM.DEF: DEF-file for CWMM.dll
    22;
    3 ;                    (C) Chris Wohlgemuth 2002-2005
     3;                    (C) Chris Wohlgemuth 2002-2020
    44;/*
    55; * This program is free software; you can redistribute it and/or modify
     
    2525
    2626LIBRARY CWMM INITGLOBAL
    27 DESCRIPTION '$@#(C) C. Wohlgemuth 2005:0.2        #@##1## 11/05/05 17:35:09        My ;-)  ::::9::@@CWMM-classes V0.2.9'
     27DESCRIPTION '$@#(C) C. Wohlgemuth 2020:0.2        #@##1## 18/07/20 19:38:26        My ;-)  ::::9::@@CWMM-classes V0.2.9'
    2828
    2929PROTMODE
Note: See TracChangeset for help on using the changeset viewer.