Changeset 184
- Timestamp:
- Jul 5, 2002, 9:13:36 AM (23 years ago)
- Location:
- trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/helpers/nls.h
r174 r184 100 100 PSZ XWPENTRY nlsVariableDouble(PSZ pszTarget, 101 101 double dbl, 102 P SZ pszUnits,102 PCSZ pszUnits, 103 103 CHAR cThousands); 104 104 -
trunk/include/helpers/syssound.h
r113 r184 66 66 ********************************************************************/ 67 67 68 ULONG sndParseSoundData(P SZ pszSoundData,68 ULONG sndParseSoundData(PCSZ pszSoundData, 69 69 PSZ pszDescr, 70 70 PSZ pszFile, … … 83 83 BOOL sndWriteSoundData(HINI hiniMMPM, 84 84 USHORT usIndex, 85 P SZ pszDescr,86 P SZ pszFile,85 PCSZ pszDescr, 86 PCSZ pszFile, 87 87 ULONG ulVolume); 88 88 89 89 BOOL sndSetSystemSound(HAB hab, 90 90 USHORT usIndex, 91 P SZ pszDescr,92 P SZ pszFile,91 PCSZ pszDescr, 92 PCSZ pszFile, 93 93 ULONG ulVolume); 94 94 95 BOOL sndDoesSchemeExist(PSZ pszScheme); 95 BOOL sndDoesSchemeExist(PCSZ pszScheme, 96 PSZ *ppszRealScheme); 96 97 97 98 APIRET sndCreateSoundScheme(HINI hiniMMPM, 98 P SZ pszNewScheme);99 PCSZ pszNewScheme); 99 100 100 101 APIRET sndLoadSoundScheme(HINI hiniMMPM, 101 P SZ pszScheme);102 PCSZ pszScheme); 102 103 103 APIRET sndDestroySoundScheme(P SZ pszScheme);104 APIRET sndDestroySoundScheme(PCSZ pszScheme); 104 105 105 106 #endif -
trunk/src/helpers/animate.c
r35 r184 140 140 141 141 WinDrawBitmap(hps, hbm, NULL, (PPOINTL)&rtlStretch, 142 0, 0, // we don't need colors143 DBM_STRETCH);142 0, 0, // we don't need colors 143 DBM_STRETCH); 144 144 145 145 DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, … … 159 159 // finally, draw the 1:1 version 160 160 WinDrawBitmap(hps, hbm, NULL, &ptl, 161 0, 0, // we don't need colors162 DBM_NORMAL);161 0, 0, // we don't need colors 162 DBM_NORMAL); 163 163 164 164 } // end if (hps) 165 165 166 return (ulrc);166 return ulrc; 167 167 } 168 168 -
trunk/src/helpers/apmh.c
r167 r184 78 78 &DataPacket, sizeof(DataPacket), &ulRetSize))) 79 79 if (DataPacket.ReturnCode) 80 arc = DataPacket.ReturnCode |10000;80 arc = DataPacket.ReturnCode + 10000; 81 81 82 82 return arc; -
trunk/src/helpers/apps.c
r167 r184 94 94 } 95 95 96 return (cbEnvironment);96 return cbEnvironment; 97 97 } 98 98 … … 299 299 } 300 300 301 return (ppszRet);301 return ppszRet; 302 302 } 303 303 … … 717 717 { 718 718 if (G_aProgTypes[ul].progc == progc) 719 return (G_aProgTypes[ul].pcsz);719 return G_aProgTypes[ul].pcsz; 720 720 } 721 721 … … 748 748 case PROG_31_ENHSEAMLESSCOMMON: // 18 749 749 case PROG_31_ENH: // 19 750 return (2);750 return 2; 751 751 752 752 #ifndef PROG_30_STD … … 766 766 case PROG_31_STDSEAMLESSCOMMON: // 16 767 767 case PROG_31_STD: // 20 768 return (1);769 } 770 771 return (0);768 return 1; 769 } 770 771 return 0; 772 772 } 773 773 … … 1992 1992 } 1993 1993 1994 return (happReturn);1994 return happReturn; 1995 1995 } -
trunk/src/helpers/cctl_chart.c
r167 r184 1084 1084 } // end if (dTotal > 0) 1085 1085 1086 return (hbmReturn);1086 return hbmReturn; 1087 1087 } 1088 1088 … … 1455 1455 LONG ly) 1456 1456 { 1457 // LONG lRegionFound = -1; // none1458 1459 1457 POINTL ptlMouse = {lx, ly}; 1460 1458 … … 1477 1475 == PRGN_INSIDE) 1478 1476 { 1479 return (ul);1477 return ul; 1480 1478 } 1481 1479 } … … 1483 1481 } 1484 1482 1485 return (-1);1483 return -1; 1486 1484 } 1487 1485 … … 1897 1895 pChtCData->fHasFocus = FALSE; 1898 1896 WinSetWindowPtr(hwndChart, QWL_USER, pChtCData); 1899 return (TRUE);1897 return TRUE; 1900 1898 } 1901 1899 } 1902 1900 1903 return (FALSE);1901 return FALSE; 1904 1902 } 1905 1903 -
trunk/src/helpers/cctl_checkcnr.c
r167 r184 745 745 pcbco->habCnr = WinQueryAnchorBlock(hwndCnr); 746 746 747 return (pcbco);747 return pcbco; 748 748 } 749 749 } … … 891 891 } 892 892 } 893 return (ulrc); 893 894 return ulrc; 894 895 } 895 896 … … 914 915 (ULONG)&precc); 915 916 916 return (precc);917 return precc; 917 918 } 918 919 … … 938 939 USHORT usCheckState) // in: 0, 1, 2, 3 939 940 { 940 BOOL brc = FALSE; 941 PCHECKBOXRECORDCORE precc = ctlFindCheckRecord(hwndCnr, ulItemID); 942 943 if (precc) 941 PCHECKBOXRECORDCORE precc; 942 if (precc = ctlFindCheckRecord(hwndCnr, ulItemID)) 944 943 { 945 944 precc->usCheckState = usCheckState; … … 949 948 MPFROM2SHORT(1, 950 949 CMA_NOREPOSITION)); 951 brc =TRUE;952 } 953 954 return brc;950 return TRUE; 951 } 952 953 return FALSE; 955 954 } 956 955 … … 975 974 USHORT usCheckState) // in: 0, 1, 2, 3 976 975 { 977 ULONG ulrc = -1; 978 PCHECKBOXRECORDCORE precc = ctlFindCheckRecord(hwndCnr, ulItemID); 979 980 if (precc) 981 ulrc = precc->usCheckState; 982 983 return (ulrc); 976 PCHECKBOXRECORDCORE precc; 977 if (precc = ctlFindCheckRecord(hwndCnr, ulItemID)) 978 return precc->usCheckState; 979 980 return -1; 984 981 } 985 982 … … 999 996 BOOL fEnable) 1000 997 { 1001 BOOL brc = FALSE; 1002 PCHECKBOXRECORDCORE precc = ctlFindCheckRecord(hwndCnr, ulItemID); 1003 1004 if (precc) 998 PCHECKBOXRECORDCORE precc; 999 1000 if (precc = ctlFindCheckRecord(hwndCnr, ulItemID)) 1005 1001 { 1006 1002 ULONG ulAttr = precc->recc.flRecordAttr; … … 1018 1014 CMA_NOREPOSITION)); 1019 1015 1020 brc =TRUE;1021 } 1022 1023 return brc;1024 } 1025 1026 1016 return TRUE; 1017 } 1018 1019 return FALSE; 1020 } 1021 1022 -
trunk/src/helpers/cctl_progbar.c
r167 r184 401 401 BOOL ctlProgressBarFromStatic(HWND hwndChart, ULONG ulAttr) 402 402 { 403 PFNWP OldStaticProc = WinSubclassWindow(hwndChart, ctl_fnwpProgressBar);404 if (OldStaticProc )403 PFNWP OldStaticProc; 404 if (OldStaticProc = WinSubclassWindow(hwndChart, ctl_fnwpProgressBar)) 405 405 { 406 406 PPROGRESSBARDATA pData = (PPROGRESSBARDATA)malloc(sizeof(PROGRESSBARDATA)); … … 414 414 return (TRUE); 415 415 } 416 else return (FALSE); 416 417 return (FALSE); 417 418 } 418 419 -
trunk/src/helpers/cctl_splitwin.c
r167 r184 735 735 } 736 736 737 hwndSplit = WinCreateWindow(psbcd->hwndParentAndOwner, // parent 738 WC_SPLITWINDOW, 739 "", 740 WS_VISIBLE, 741 0, 0, 10, 10, 742 psbcd->hwndParentAndOwner, // owner 743 HWND_TOP, 744 psbcd->ulSplitWindowID, 745 NULL, 746 NULL); 747 if (hwndSplit) 737 if ( (hwndSplit = WinCreateWindow(psbcd->hwndParentAndOwner, // parent 738 WC_SPLITWINDOW, 739 "", 740 WS_VISIBLE, 741 0, 0, 10, 10, 742 psbcd->hwndParentAndOwner, // owner 743 HWND_TOP, 744 psbcd->ulSplitWindowID, 745 NULL, 746 NULL)) 747 && (hwndBar = WinCreateWindow(psbcd->hwndParentAndOwner, // parent 748 WC_STATIC, 749 "", 750 WS_VISIBLE // wnd style 751 | SS_TEXT, 752 0, 0, 10, 10, 753 psbcd->hwndParentAndOwner, // owner 754 HWND_TOP, 755 ID_SPLITBAR, // win ID 756 NULL, // cdata 757 NULL)) // presparams 758 ) 748 759 { 749 hwndBar = WinCreateWindow(psbcd->hwndParentAndOwner, // parent 750 WC_STATIC, 751 "", 752 WS_VISIBLE // wnd style 753 | SS_TEXT, 754 0, 0, 10, 10, 755 psbcd->hwndParentAndOwner, // owner 756 HWND_TOP, 757 ID_SPLITBAR, // win ID 758 NULL, // cdata 759 NULL // presparams 760 ); 761 if (hwndBar) 760 // create SPLITBARDATA to store in split bar's QWL_USER 761 PSPLITBARDATA pData; 762 if (pData = (PSPLITBARDATA)malloc(sizeof(SPLITBARDATA))) 762 763 { 763 // create SPLITBARDATA to store in split bar's QWL_USER 764 PSPLITBARDATA pData = (PSPLITBARDATA)malloc(sizeof(SPLITBARDATA)); 765 if (pData) 766 { 767 // set parent for split bar 768 WinSetParent(hwndBar, hwndSplit, FALSE); 769 770 memset(pData, 0, sizeof(SPLITBARDATA)); 771 772 // copy control data 773 memcpy(&(pData->sbcd), psbcd, sizeof(SPLITBARCDATA)); 774 // set other data 775 /* WinQueryWindowRect(hwndBar, &(pData->rclBar)); 776 (pData->rclBar.xRight)--; 777 (pData->rclBar.yTop)--; */ 778 // subclass static control to make it a split bar 779 pData->OldStaticProc = WinSubclassWindow(hwndBar, ctl_fnwpSplitBar); 780 pData->hptrOld = NULLHANDLE; 781 pData->hptrMove = WinQuerySysPointer(HWND_DESKTOP, 782 (psbcd->ulCreateFlags & SBCF_HORIZONTAL) 783 ? SPTR_SIZENS 784 : SPTR_SIZEWE, 785 FALSE); // don't make copy 786 pData->fCaptured = FALSE; 787 pData->hwndLinked1 = 788 pData->hwndLinked2 = NULLHANDLE; 789 790 WinSetWindowULong(hwndBar, QWL_USER, (ULONG)pData); 791 } 764 // set parent for split bar 765 WinSetParent(hwndBar, hwndSplit, FALSE); 766 767 memset(pData, 0, sizeof(SPLITBARDATA)); 768 769 // copy control data 770 memcpy(&(pData->sbcd), psbcd, sizeof(SPLITBARCDATA)); 771 // set other data 772 /* WinQueryWindowRect(hwndBar, &(pData->rclBar)); 773 (pData->rclBar.xRight)--; 774 (pData->rclBar.yTop)--; */ 775 // subclass static control to make it a split bar 776 pData->OldStaticProc = WinSubclassWindow(hwndBar, ctl_fnwpSplitBar); 777 pData->hptrOld = NULLHANDLE; 778 pData->hptrMove = WinQuerySysPointer(HWND_DESKTOP, 779 (psbcd->ulCreateFlags & SBCF_HORIZONTAL) 780 ? SPTR_SIZENS 781 : SPTR_SIZEWE, 782 FALSE); // don't make copy 783 pData->fCaptured = FALSE; 784 pData->hwndLinked1 = 785 pData->hwndLinked2 = NULLHANDLE; 786 787 WinSetWindowULong(hwndBar, QWL_USER, (ULONG)pData); 792 788 } 793 789 } 794 790 } 795 791 796 return (hwndSplit);792 return hwndSplit; 797 793 } 798 794 … … 999 995 LONG ctlQuerySplitPos(HWND hwndSplit) 1000 996 { 1001 ULONG lrc = 0;1002 1003 997 // the split bar data is stored in QWL_USER of the 1004 998 // split bar (not the split window) 1005 HWND hwndSplitBar = WinWindowFromID(hwndSplit, ID_SPLITBAR); 1006 if (hwndSplitBar) 1007 { 1008 PSPLITBARDATA psbd = (PSPLITBARDATA)WinQueryWindowULong(hwndSplitBar, QWL_USER); 1009 if (psbd) 1010 lrc = psbd->sbcd.lPos; 1011 } 1012 1013 return (lrc); 999 HWND hwndSplitBar; 1000 PSPLITBARDATA psbd; 1001 if ( (hwndSplitBar = WinWindowFromID(hwndSplit, ID_SPLITBAR)) 1002 && (psbd = (PSPLITBARDATA)WinQueryWindowULong(hwndSplitBar, QWL_USER)) 1003 ) 1004 return psbd->sbcd.lPos; 1005 1006 return 0; 1014 1007 } 1015 1008 -
trunk/src/helpers/cctl_tooltip.c
r169 r184 111 111 BOOL ctlRegisterTooltip(HAB hab) 112 112 { 113 return (WinRegisterClass(hab,114 115 116 117 118 119 sizeof(PVOID)*2)); // addt'l bytes to reserve:113 return WinRegisterClass(hab, 114 COMCTL_TOOLTIP_CLASS, 115 ctl_fnwpTooltip, 116 CS_HITTEST, // class styles; 117 // CS_FRAME not working, 118 // CS_CLIPSIBLINGS not working 119 sizeof(PVOID) * 2); // addt'l bytes to reserve: 120 120 // one pointer for QWL_USER, 121 121 // one more for instance data … … 203 203 PSUBCLASSEDTOOL pstThis = (PSUBCLASSEDTOOL)pNode->pItemData; 204 204 if (pstThis->hwndTool == hwndTool) 205 { 206 return (pstThis); 207 } 205 return pstThis; 206 208 207 pNode = pNode->pNext; 209 208 } … … 327 326 static BOOL UnSubclassTool(HWND hwndTool) 328 327 { 329 PSUBCLASSEDTOOL pst = FindSubclassedTool(hwndTool);330 if (pst )328 PSUBCLASSEDTOOL pst; 329 if (pst = FindSubclassedTool(hwndTool)) 331 330 { 332 331 WinSubclassWindow(hwndTool, 333 332 pst->pfnwpOrig); 334 333 // orig winproc == un-subclass 335 return (lstRemoveItem(&G_llSubclassedTools, pst));334 return lstRemoveItem(&G_llSubclassedTools, pst); 336 335 // this frees the item 337 336 } 338 337 339 return (FALSE);338 return FALSE; 340 339 } 341 340 … … 446 445 447 446 // allocate and initialize tooltip data 448 pttd = (PTOOLTIPDATA)malloc(sizeof(TOOLTIPDATA)); 449 if (pttd) 447 if (pttd = (PTOOLTIPDATA)malloc(sizeof(TOOLTIPDATA))) 450 448 { 451 449 CHAR szFont[256]; … … 498 496 return (MPARAM)FALSE; 499 497 } 500 else 501 502 498 499 // malloc failed: 500 return (MPARAM)TRUE; 503 501 } 504 502 … … 543 541 } // end switch 544 542 545 return (TRUE);543 return TRUE; 546 544 } 547 545 … … 735 733 { 736 734 PTOOLTIPDATA pttd = (PTOOLTIPDATA)WinQueryWindowPtr(hwndTooltip, 1); 737 PTOOLINFO ptiSearch = (PTOOLINFO)mp2;738 if (ptiSearch )735 PTOOLINFO ptiSearch; 736 if (ptiSearch = (PTOOLINFO)mp2) 739 737 { 740 738 PLISTNODE pToolNode = lstQueryFirstNode(&pttd->llTools); … … 962 960 { 963 961 PTOOLTIPDATA pttd = (PTOOLTIPDATA)WinQueryWindowPtr(hwndTooltip, 1); 964 PTOOLINFO ptiTarget = (PTOOLINFO)mp2;965 if (ptiTarget )962 PTOOLINFO ptiTarget; 963 if (ptiTarget = (PTOOLINFO)mp2) 966 964 { 967 965 PTOOLINFO ptiFound = (PTOOLINFO)lstItemFromIndex(&pttd->llTools, … … 987 985 { 988 986 PTOOLTIPDATA pttd = (PTOOLTIPDATA)WinQueryWindowPtr(hwndTooltip, 1); 989 PTOOLINFO ptiTarget = (PTOOLINFO)mp2;990 if (ptiTarget )987 PTOOLINFO ptiTarget; 988 if (ptiTarget = (PTOOLINFO)mp2) 991 989 { 992 990 if (pttd->ptiMouseOver) 993 991 { 994 992 memcpy(ptiTarget, pttd->ptiMouseOver, sizeof(TOOLINFO)); 995 return (M PARAM)TRUE;993 return (MRESULT)TRUE; 996 994 } 997 995 } 998 996 999 return ( (MPARAM)FALSE);997 return (MRESULT)FALSE; 1000 998 } 1001 999 … … 1010 1008 { 1011 1009 PTOOLTIPDATA pttd = (PTOOLTIPDATA)WinQueryWindowPtr(hwndTooltip, 1); 1012 PTOOLINFO ptiSearch = (PTOOLINFO)mp2;1013 if (ptiSearch )1010 PTOOLINFO ptiSearch; 1011 if (ptiSearch = (PTOOLINFO)mp2) 1014 1012 { 1015 1013 PLISTNODE pToolNode = lstQueryFirstNode(&pttd->llTools); -
trunk/src/helpers/cnrh.c
r167 r184 96 96 ulFlags |= CMA_INVALIDATE; 97 97 98 return (ULONG) (WinSendMsg(hwndCnr,99 100 101 102 ulFlags)));98 return (ULONG)WinSendMsg(hwndCnr, 99 CM_REMOVEDETAILFIELDINFO, 100 (MPARAM)NULL, 101 MPFROM2SHORT(0, // all 102 ulFlags)); 103 103 } 104 104 … … 218 218 fii.cFieldInfoInsert = ulFieldCount; 219 219 220 return ( (ULONG)WinSendMsg(hwndCnr,221 222 223 (MPARAM)&fii));220 return (ULONG)WinSendMsg(hwndCnr, 221 CM_INSERTDETAILFIELDINFO, 222 (MPARAM)pFieldInfoFirst, 223 (MPARAM)&fii); 224 224 } 225 225 … … 348 348 } 349 349 350 return (pFieldInfoReturn);350 return pFieldInfoReturn; 351 351 } 352 352 … … 395 395 ULONG ulCount) // in: number of records to allocate (> 0) 396 396 { 397 PRECORDCORE precc; 398 precc = (PRECORDCORE)WinSendMsg(hwndCnr, 399 CM_ALLOCRECORD, 400 (MPARAM)(cbrecc-sizeof(RECORDCORE)), 401 (MPARAM)ulCount); 402 403 return (precc); 397 return (PRECORDCORE)WinSendMsg(hwndCnr, 398 CM_ALLOCRECORD, 399 (MPARAM)(cbrecc - sizeof(RECORDCORE)), 400 (MPARAM)ulCount); 404 401 } 405 402 … … 478 475 ULONG ulCount) // in: number of records to insert (> 0) 479 476 { 480 ULONG ulrc = 0;481 477 RECORDINSERT ri; 482 478 … … 503 499 ri.cRecordsInsert = ulCount; // V0.9.0 504 500 505 ulrc =(ULONG)WinSendMsg(hwndCnr,501 return (ULONG)WinSendMsg(hwndCnr, 506 502 CM_INSERTRECORD, 507 503 (MPARAM)precc, 508 504 (MPARAM)&ri); 509 505 } 510 return (ulrc); 506 507 return 0; 511 508 } 512 509 … … 528 525 BOOL fInvalidate) // in: invalidate records? 529 526 { 530 ULONG ulrc = 0;531 527 RECORDINSERT ri; 532 528 … … 552 548 ri.cRecordsInsert = 1; 553 549 554 ulrc =(ULONG)WinSendMsg(hwndCnr,550 return (ULONG)WinSendMsg(hwndCnr, 555 551 CM_INSERTRECORD, 556 552 (MPARAM)precc, … … 558 554 } 559 555 } 560 return (ulrc); 556 557 return 0; 561 558 } 562 559 … … 608 605 return (ulrc != 0); 609 606 } 610 else return (FALSE); 607 608 return FALSE; 611 609 } 612 610 … … 807 805 } while (TRUE); 808 806 809 return (ulrc);807 return ulrc; 810 808 } 811 809 … … 946 944 // _Pmpf((" CM_QUERYVIEWPORTRECT failed.")); 947 945 948 return (preccReturn);946 return preccReturn; 949 947 } 950 948 … … 979 977 } 980 978 981 return (ul);979 return ul; 982 980 } 983 981 … … 1387 1385 } 1388 1386 1389 return (preccReturn);1387 return preccReturn; 1390 1388 } 1391 1389 … … 1416 1414 preccReturn = preccNext; 1417 1415 } 1418 return (preccReturn); 1416 1417 return preccReturn; 1419 1418 } 1420 1419 … … 1485 1484 } 1486 1485 1487 return (lrc);1486 return lrc; 1488 1487 } 1489 1488 … … 1642 1641 } 1643 1642 1644 return (ulrc);1643 return ulrc; 1645 1644 } 1646 1645 … … 1773 1772 if (hwndFrame) 1774 1773 { 1775 henum = WinBeginEnumWindows(hwndFrame); 1776 if (henum) 1774 if (henum = WinBeginEnumWindows(hwndFrame)) 1777 1775 { 1778 1776 do 1779 1777 { 1780 hwndTemp = WinGetNextWindow(henum); 1781 if (hwndTemp) 1778 if (hwndTemp = WinGetNextWindow(henum)) 1782 1779 { 1783 1780 if (WinQueryClassName(hwndTemp, 250, szClassName)) … … 2001 1998 } // end if (pdrgInfo) 2002 1999 2003 return (pdrgInfo);2000 return pdrgInfo; 2004 2001 } 2005 2002 … … 2183 2180 pctime->hours = pdt->hours; 2184 2181 } 2185 return (TRUE);2182 return TRUE; 2186 2183 } 2187 else 2188 return (FALSE);2184 2185 return FALSE; 2189 2186 } 2190 2187 … … 2203 2200 pcd->month = pfd->month; 2204 2201 pcd->year = pfd->year + 1980; 2205 return (TRUE);2202 return TRUE; 2206 2203 } 2207 else 2208 return (FALSE);2204 2205 return FALSE; 2209 2206 } 2210 2207 … … 2224 2221 pct->hours = pft->hours; 2225 2222 pct->ucReserved = 0; 2226 return (TRUE);2223 return TRUE; 2227 2224 } 2228 else 2229 return (FALSE);2230 } 2225 2226 return FALSE; 2227 } -
trunk/src/helpers/comctl.c
r178 r184 632 632 free(pmbd); 633 633 } 634 634 635 return brc; 635 636 } … … 1005 1006 } 1006 1007 1007 return (pa);1008 return pa; 1008 1009 } 1009 1010 … … 1141 1142 } 1142 1143 } 1144 1143 1145 return (paNew != NULL); 1144 1146 } … … 1420 1422 BOOL ctlMakeHotkeyEntryField(HWND hwndHotkeyEntryField) 1421 1423 { 1422 PFNWP pfnwpOrig = WinSubclassWindow(hwndHotkeyEntryField,1423 ctl_fnwpObjectHotkeyEntryField);1424 if (pfnwpOrig)1424 PFNWP pfnwpOrig; 1425 if (pfnwpOrig = WinSubclassWindow(hwndHotkeyEntryField, 1426 ctl_fnwpObjectHotkeyEntryField)) 1425 1427 { 1426 1428 WinSetWindowPtr(hwndHotkeyEntryField, QWL_USER, (PVOID)pfnwpOrig); 1427 return (TRUE);1429 return TRUE; 1428 1430 } 1429 1431 1430 return (FALSE);1432 return FALSE; 1431 1433 } 1432 1434 -
trunk/src/helpers/configsys.c
r167 r184 284 284 } while ((!pReturn) && (p != NULL) && (p != pcszSearchIn)); 285 285 286 return (pReturn);286 return pReturn; 287 287 } 288 288 … … 335 335 } 336 336 337 return (prc);337 return prc; 338 338 } 339 339 … … 457 457 } 458 458 459 return (pReturn);459 return pReturn; 460 460 } 461 461 -
trunk/src/helpers/datetime.c
r123 r184 87 87 &ulTimeNow, 88 88 sizeof(ulTimeNow)); 89 return (ulTimeNow); 90 91 /* DATETIME dt; 92 ULONG ulHours, 93 ulDaysPassed = 0; 94 95 if (G_ulDateScalarFirstCalled == 0) 96 { 97 // first call: 98 G_ulDateScalarFirstCalled = dtDate2Scalar(dt.year, 99 dt.month, 100 dt.day); 101 } 102 else 103 { 104 // not first call: 105 ULONG ulDateScalarNow = dtDate2Scalar(dt.year, 106 dt.month, 107 dt.day); 108 ulDaysPassed = (ulDateScalarNow - G_ulDateScalarFirstCalled); 109 _Pmpf((__FUNCTION__ ": days passed = %d", ulDaysPassed)); 110 } 111 112 DosGetDateTime(&dt); 113 ulHours = dt.hours; // this is UCHAR in DATETIME 114 // get the hours; for every day passed, add 24 hours... 115 ulHours += (24 * ulDaysPassed); 116 // 0 if we're still on the first date 117 118 return (10*(dt.hundredths + 100*(dt.seconds + 60*(dt.minutes + 60*(ulHours))))); */ 89 return ulTimeNow; 119 90 } 120 91 … … 150 121 FTIME* pftime) // in: time 151 122 { 152 return (sprintf(pszTimeStamp,153 154 155 156 157 158 159 pftime->twosecs * 2));123 return sprintf(pszTimeStamp, 124 pcszFormatTimestamp, 125 pfdate->year + 1980, 126 pfdate->month, 127 pfdate->day, 128 pftime->hours, 129 pftime->minutes, 130 pftime->twosecs * 2); 160 131 } 161 132 … … 173 144 DATETIME* pdt) 174 145 { 175 return (sprintf(pszTimeStamp,176 177 178 179 180 181 182 pdt->seconds));146 return sprintf(pszTimeStamp, 147 pcszFormatTimestamp, 148 pdt->year, 149 pdt->month, 150 pdt->day, 151 pdt->hours, 152 pdt->minutes, 153 pdt->seconds); 183 154 } 184 155 … … 372 343 if (day == 29) 373 344 if (dtIsLeapYear(year)) 374 return (TRUE);345 return TRUE; 375 346 } 376 347 } 377 348 378 return (FALSE);379 } 380 349 return FALSE; 350 } 351 -
trunk/src/helpers/encodings.c
r169 r184 15 15 16 16 /* 17 * Copyright (C) 2001 Ulrich Mller.17 * Copyright (C) 2001-2002 Ulrich Mller. 18 18 * This file is part of the "XWorkplace helpers" source package. 19 19 * This is free software; you can redistribute it and/or modify -
trunk/src/helpers/nls.c
r174 r184 85 85 86 86 BOOL G_afLeadByte[MAX_LEADBYTE] = {0}; 87 ULONG G_fDBCS = -1; // not queried yet87 ULONG G_fDBCS = 2; // not queried yet 88 88 COUNTRYCODE G_cc = { 0, 0 }; 89 89 DBCSVECTOR G_aDBCSVector[8]; … … 94 94 * 95 95 *@@added V0.9.19 (2002-06-13) [umoeller] 96 *@@changed V0.9.20 (2002-07-03) [umoeller]: fixed, this never worked 96 97 */ 97 98 98 99 BOOL nlsDBCS(VOID) 99 100 { 100 int i;101 102 if (G_fDBCS != -1)101 APIRET arc; 102 103 if (G_fDBCS != 2) 103 104 // already queried: 104 105 return G_fDBCS; 105 106 106 if (DosQueryDBCSEnv(8 * sizeof(DBCSVECTOR), 107 &G_cc, 108 (PCHAR)G_aDBCSVector)) 107 // V0.9.20 (2002-07-03) [umoeller] 108 // assume a non-DBCS system UNLESS the below 109 // loop gives us something meaningful; even 110 // on non-DBCS systems like mine, DosQueryDBCSEnv 111 // does not return an error 112 G_fDBCS = FALSE; 113 114 if (arc = DosQueryDBCSEnv(8 * sizeof(DBCSVECTOR), 115 &G_cc, 116 (PCHAR)G_aDBCSVector)) 117 { 109 118 // not DBCS: 110 return (G_fDBCS = FALSE); 111 112 for (i = 0; 113 i < 8; 114 ++i) 115 { 116 if ( (G_aDBCSVector[i].bLow) 117 && (G_aDBCSVector[i].bHigh) 118 ) 119 _PmpfF(("DosQueryDBCSEnv returned arc %d", arc)); 120 } 121 else 122 { 123 int i; 124 for (i = 0; 125 i < 8; 126 ++i) 119 127 { 120 int n; 121 for (n = G_aDBCSVector[i].bLow; 122 n <= G_aDBCSVector[i].bHigh; 123 ++n) 124 G_afLeadByte[n] = TRUE; 125 G_fDBCS = TRUE; 128 if ( (G_aDBCSVector[i].bLow) 129 && (G_aDBCSVector[i].bHigh) 130 ) 131 { 132 int n; 133 for (n = G_aDBCSVector[i].bLow; 134 n <= G_aDBCSVector[i].bHigh; 135 ++n) 136 G_afLeadByte[n] = TRUE; 137 G_fDBCS = TRUE; 138 } 139 else 140 break; 126 141 } 127 else128 break;129 142 } 130 143 … … 342 355 * 343 356 * Use nlsThousandsDouble for "double" values. 357 * 358 *@@changed V0.9.20 (2002-07-03) [umoeller]: optimized 344 359 */ 345 360 … … 350 365 USHORT ust, uss, usc; 351 366 CHAR szTemp[40]; 352 sprintf(szTemp, "%lu", ul);367 usc = sprintf(szTemp, "%lu", ul); // V0.9.20 (2002-07-03) [umoeller] 353 368 354 369 ust = 0; 355 usc = strlen(szTemp);370 // usc = strlen(szTemp); 356 371 for (uss = 0; uss < usc; uss++) 357 372 { … … 367 382 pszTarget[ust] = '\0'; 368 383 369 return (pszTarget);384 return pszTarget; 370 385 } 371 386 … … 382 397 CHAR cThousands) // in: separator char (e.g. '.') 383 398 { 384 return (nlsThousandsULong(pszTarget, ul, cThousands));399 return nlsThousandsULong(pszTarget, ul, cThousands); 385 400 } 386 401 … … 389 404 * like nlsThousandsULong, but for a "double" 390 405 * value. Note that after-comma values are truncated. 406 * 407 *@@changed V0.9.20 (2002-07-03) [umoeller]: optimized 391 408 */ 392 409 … … 397 414 USHORT ust, uss, usc; 398 415 CHAR szTemp[40]; 399 sprintf(szTemp, "%.0f", floor(dbl));416 usc = sprintf(szTemp, "%.0f", floor(dbl)); // V0.9.20 (2002-07-03) [umoeller] 400 417 401 418 ust = 0; 402 usc = strlen(szTemp);419 // usc = strlen(szTemp); 403 420 for (uss = 0; uss < usc; uss++) 404 421 { … … 414 431 pszTarget[ust] = '\0'; 415 432 416 return (pszTarget);433 return pszTarget; 417 434 } 418 435 … … 424 441 * 425 442 *@@added V0.9.6 (2000-11-12) [pr] 443 *@@changed V0.9.20 (2002-07-03) [umoeller]: now using PCSZ pcszUnits 426 444 */ 427 445 428 446 PSZ nlsVariableDouble(PSZ pszTarget, 429 447 double dbl, 430 P SZ pszUnits,448 PCSZ pcszUnits, 431 449 CHAR cThousands) 432 450 { 433 451 if (dbl < 100.0) 434 sprintf(pszTarget, "%.2f%s", dbl, p szUnits);452 sprintf(pszTarget, "%.2f%s", dbl, pcszUnits); 435 453 else 436 454 if (dbl < 1000.0) 437 sprintf(pszTarget, "%.1f%s", dbl, p szUnits);455 sprintf(pszTarget, "%.1f%s", dbl, pcszUnits); 438 456 else 439 457 strcat(nlsThousandsDouble(pszTarget, dbl, cThousands), 440 p szUnits);441 442 return (pszTarget);458 pcszUnits); 459 460 return pszTarget; 443 461 } 444 462 … … 700 718 cc.country = 0; // use system country code 701 719 cc.codepage = 0; // use process default codepage 702 return (DosMapCase(ulLength,703 704 psz));720 return DosMapCase(ulLength, 721 &cc, 722 psz); 705 723 } 706 724 } 707 725 708 return (ERROR_INVALID_PARAMETER);709 } 710 711 726 return ERROR_INVALID_PARAMETER; 727 } 728 729 -
trunk/src/helpers/shapewin.c
r167 r184 578 578 return WinSendMsg(pRgn->pCtrl->hwndShape, msg, mp1, mp2); 579 579 } 580 580 581 return WinDefWindowProc(hwnd, msg, mp1, mp2); 581 582 } … … 647 648 } 648 649 } */ 650 649 651 return 0; 650 652 } … … 675 677 pRect = ▭ 676 678 } 679 677 680 for (i = 0, pRgn = pCtrl->aRegion; i < pCtrl->nRegion; i++, pRgn++) 678 681 { … … 683 686 } 684 687 } 688 685 689 return 0; 686 690 } … … 783 787 } 784 788 } 789 785 790 if (inspan == TRUE) 786 791 { … … 997 1002 NULL); // Pres. Param. 998 1003 } 1004 999 1005 return 0; 1000 1006 } -
trunk/src/helpers/syssound.c
r167 r184 21 21 * These are the general flags in the "MMPM2_AlarmSoundsData" 22 22 * application: 23 * 23 24 * -- If "EnableSounds" is FALSE, all system sounds are disabled. 24 25 * This defaults to TRUE (tested). 26 * 25 27 * -- If "ApplyVolumeToAll" is TRUE, the same volume is used for 26 28 * all sounds. This defaults to FALSE (tested). 29 * 27 30 * -- If ApplyVolumeToAll is TRUE, "Volume" is used for the 28 31 * global volume. Otherwise, the individual sound volumes … … 34 37 * 35 38 * Each sound data block in there consists of three elements: 39 * 36 40 + soundfile#description#volume 41 * 37 42 * where "description" is what is listed in the "Sound" object. 38 43 * "volume" is only used when "ApplyVolumeToAll" (above) is FALSE. … … 114 119 * 115 120 *@@added V0.9.0 [umoeller] 116 */ 117 118 ULONG sndParseSoundData(PSZ pszSoundData, // in: INI data from MMPM.INI 121 *@@changed V0.9.20 (2002-07-03) [umoeller]: optimized 122 */ 123 124 ULONG sndParseSoundData(PCSZ pszSoundData, // in: INI data from MMPM.INI 119 125 PSZ pszDescr, // out: sound description, as displayed 120 126 // in the "Sound" object (ptr may be NULL) … … 124 130 // even if "Global volume" is set in MMPM.INI. 125 131 { 126 P SZp1 = pszSoundData, p2;132 PCSZ p1 = pszSoundData, p2; 127 133 ULONG ulrc = 0; 128 134 // get sound file 129 p2 = strchr(p1, '#'); 130 if (p2) 135 if (p2 = strchr(p1, '#')) 131 136 { 132 137 ulrc++; 133 138 if (pszFile) 134 139 { 135 strncpy(pszFile, p1, p2 -p1);140 strncpy(pszFile, p1, p2 - p1); 136 141 pszFile[p2-p1] = '\0'; 137 142 } … … 139 144 140 145 // get sound description 141 p2 = strchr(p1, '#'); 142 if (p2) 146 if (p2 = strchr(p1, '#')) 143 147 { 144 148 ulrc++; … … 154 158 { 155 159 // individual volume settings per sound 156 sscanf(p1, "%lu", pulVolume); 160 *pulVolume = atoi(p1); // V0.9.20 (2002-07-03) [umoeller] 161 // sscanf(p1, "%lu", pulVolume); 157 162 ulrc++; 158 163 } … … 160 165 } 161 166 162 return (ulrc);167 return ulrc; 163 168 } 164 169 … … 173 178 VOID sndQueryMmpmIniPath(PSZ pszMMPM) // out: fully q'fied MMPM.INI 174 179 { 175 PSZ pszMMPMPath = getenv("MMBASE"); // V0.9.6 (2000-10-16) [umoeller]176 if (pszMMPMPath )180 PSZ pszMMPMPath; 181 if (pszMMPMPath = getenv("MMBASE")) // V0.9.6 (2000-10-16) [umoeller] 177 182 { 178 183 // variable set: … … 182 187 183 188 // kill semicolon if present 184 p = strchr(pszMMPM, ';'); 185 if (p) 189 if (p = strchr(pszMMPM, ';')) 186 190 *p = 0; 187 191 … … 211 215 HAB habDesktop = WinQueryAnchorBlock(HWND_DESKTOP); 212 216 CHAR szMMPM[CCHMAXPATH]; 213 HINI hini = NULLHANDLE;214 217 215 218 sndQueryMmpmIniPath(szMMPM); 216 219 217 hini = PrfOpenProfile(habDesktop, szMMPM); 218 return (hini); 220 return PrfOpenProfile(habDesktop, szMMPM); 219 221 } 220 222 … … 324 326 } 325 327 326 return (rc);328 return rc; 327 329 } 328 330 … … 345 347 BOOL sndWriteSoundData(HINI hiniMMPM, // in: MMPM.INI handle (from sndOpenMmpmIni) 346 348 USHORT usIndex, // in: sound index 347 P SZ pszDescr,// in: sound name or NULL for removal348 P SZ pszFile,// in: sound file349 PCSZ pszDescr, // in: sound name or NULL for removal 350 PCSZ pszFile, // in: sound file 349 351 ULONG ulVolume) // in: sound volume 350 352 { … … 359 361 sprintf(szData, "%s#%s#%lu", pszFile, pszDescr, ulVolume); 360 362 brc = PrfWriteProfileString(hiniMMPM, 361 MMINIKEY_SYSSOUNDS, szKey, 363 MMINIKEY_SYSSOUNDS, 364 szKey, 362 365 szData); 363 366 } … … 366 369 // delete entry 367 370 brc = PrfWriteProfileString(hiniMMPM, 368 MMINIKEY_SYSSOUNDS, szKey, 371 MMINIKEY_SYSSOUNDS, 372 szKey, 369 373 NULL); 370 374 … … 396 400 BOOL sndSetSystemSound(HAB hab, 397 401 USHORT usIndex, 398 P SZ pszDescr,399 P SZ pszFile,402 PCSZ pszDescr, 403 PCSZ pszFile, 400 404 ULONG ulVolume) 401 405 { 402 406 BOOL brc = FALSE; 403 HINI hiniMMPM = sndOpenMmpmIni(hab);404 if (hiniMMPM )407 HINI hiniMMPM; 408 if (hiniMMPM = sndOpenMmpmIni(hab)) 405 409 { 406 410 brc = sndWriteSoundData(hiniMMPM, usIndex, pszDescr, pszFile, ulVolume); 407 411 PrfCloseProfile(hiniMMPM); 408 412 } 413 409 414 return brc; 410 415 } … … 415 420 * in OS2SYS.INI. 416 421 * 422 * If so, and *ppszRealScheme is != NULL, it 423 * is set to the key name found. Since the 424 * scheme names are case-insensitive, this 425 * check is necessary to delete the original 426 * scheme for overwrites. The caller is 427 * responsible for free()ing *ppszRealScheme 428 * then. 429 * 417 430 *@@added V0.9.0 [umoeller] 418 */ 419 420 BOOL sndDoesSchemeExist(PSZ pszScheme) 421 { 431 *@@changed V0.9.20 (2002-07-03) [umoeller]: check has to be case-insensitive, fixed; changed prototype 432 */ 433 434 BOOL sndDoesSchemeExist(PCSZ pcszScheme, 435 PSZ *ppszRealScheme) // out: actual key name (ptr can be NULL) 436 { 437 BOOL fExists = FALSE; 438 PSZ pszKeysList; 439 if (!prfhQueryKeysForApp(HINI_SYSTEM, 440 MMINIKEY_SOUNDSCHEMES, // "PM_SOUND_SCHEMES_LIST" 441 &pszKeysList)) 442 { 443 PSZ pKey2 = pszKeysList; 444 while (*pKey2) 445 { 446 if (!stricmp(pKey2, pcszScheme)) 447 { 448 fExists = TRUE; 449 450 if (ppszRealScheme) 451 *ppszRealScheme = strdup(pKey2); 452 453 break; 454 } 455 456 pKey2 += strlen(pKey2)+1; // next key 457 } 458 459 free(pszKeysList); 460 } 461 462 return fExists; 463 464 /* old code V0.9.20 (2002-07-03) [umoeller] 422 465 // check in OS2SYS.INI's scheme list whether that 423 466 // scheme exists already … … 433 476 434 477 return (FALSE); 478 */ 479 435 480 } 436 481 … … 453 498 454 499 APIRET sndCreateSoundScheme(HINI hiniMMPM, // in: MMPM.INI handle (from sndOpenMmpmIni) 455 P SZ pszNewScheme)// in: name of new scheme500 PCSZ pszNewScheme) // in: name of new scheme 456 501 { 457 502 APIRET arc = NO_ERROR; … … 489 534 // file name and append the volume... 490 535 491 PSZ pSoundData = prfhQueryProfileData(hiniMMPM, 536 PSZ pSoundData; 537 if (pSoundData = prfhQueryProfileData(hiniMMPM, 492 538 MMINIKEY_SYSSOUNDS, // "MMPM2_AlarmSounds" 493 539 pKey2, 494 NULL); 495 if (pSoundData) 540 NULL)) 496 541 { 497 542 sndParseSoundData(pSoundData, … … 521 566 PrfWriteProfileString(HINI_SYSTEM, 522 567 MMINIKEY_SOUNDSCHEMES, // "PM_SOUND_SCHEMES_LIST" 523 pszNewScheme, // key is scheme name568 (PSZ)pszNewScheme, // key is scheme name 524 569 szNewAppName); // data is new OS2SYS.INI application 525 570 } … … 562 607 563 608 APIRET sndLoadSoundScheme(HINI hiniMMPM, // in: HINI of ?:\MMOS2\MMPM.INI (PrfOpenProfile) 564 P SZ pszScheme)// in: scheme name609 PCSZ pszScheme) // in: scheme name 565 610 { 566 611 APIRET arc = NO_ERROR; … … 702 747 */ 703 748 704 APIRET sndDestroySoundScheme(P SZ pszScheme)749 APIRET sndDestroySoundScheme(PCSZ pszScheme) 705 750 { 706 751 APIRET arc = NO_ERROR; 707 752 708 753 // check in OS2SYS.INI's scheme list whether that 709 // scheme exists already 710 PSZ pszExisting = prfhQueryProfileData(HINI_SYSTEM, 754 // scheme exists 755 PSZ pszExisting; 756 if (pszExisting = prfhQueryProfileData(HINI_SYSTEM, 711 757 MMINIKEY_SOUNDSCHEMES, // "PM_SOUND_SCHEMES_LIST" 712 758 pszScheme, 713 NULL); 714 if (pszExisting) 759 NULL)) 715 760 { 716 761 // delete whole existing PM_SOUNDS_BLAHBLAH application … … 722 767 PrfWriteProfileString(HINI_SYSTEM, 723 768 MMINIKEY_SOUNDSCHEMES, // "PM_SOUND_SCHEMES_LIST" 724 pszScheme,769 (PSZ)pszScheme, 725 770 NULL); 726 771 free(pszExisting);
Note:
See TracChangeset
for help on using the changeset viewer.