Changeset 1871 for trunk/dll/findrec.c


Ignore:
Timestamp:
Sep 21, 2015, 12:57:02 AM (10 years ago)
Author:
Gregg Young
Message:

Create CollapseAll and modify ExpandAll to reduce code overhead both to try and speed drive expansion. Change ExpandAll to allow it to loop in UM_EXPAND until until drive is completely expanded. Changes were need to work with Flesh, Stubby and UnFlesh being moved to a thread. Add code for Flesh to skip the directory entry added by Stubby (eliminate use of NULL/Nullstr pszFileNames by Stubby). Add code in Stubby to insert a complete container item. Add a flag to indicate when a directory needed to be Fleshed. Get expand and switch code to work with Flesh, UnFlesh and Stubby running on a thread. Loop and idle ExpandAll; Move tree expand to a thread; Have ShowTreeRec wait for the Flesh thread. Add a correction factor so directories don't get placed above the top of the tree container when a large drive has been expanded. Debug is mostly still in but all turned off.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/findrec.c

    r1865 r1871  
    1414  06 Aug 15 SHL Clean up and comment
    1515  23 Aug 15 SHL Protect FindCnrRecord filename arg
     16  20 Sep 15 GKY Add a correction factor so directories don't get placed above the top of the
     17                tree container when a large drive has been expanded.
    1618
    1719***********************************************************************/
     
    6365    pciParent = (PCNRITEM) CMA_FIRST;
    6466  pci = WinSendMsg(hwndCnr,
    65                    CM_SEARCHSTRING, MPFROMP(&srch), MPFROMP(pciParent));
     67                   CM_SEARCHSTRING, MPFROMP(&srch), MPFROMP(pciParent));
     68  //DbgMsg(pszSrcFile, __LINE__,"FindCnrItem pciParent %p pci %p file %s", pciParent,
     69  //      pci, file);
    6670  while (pci && (INT) pci != -1) {
    6771    if (!noenv || (pci->flags & (RECFLAGS_ENV | RECFLAGS_UNDERENV)) == 0) {
     
    123127  RECTL rcl;
    124128  RECTL rclViewport;
     129  RECTL rclFirst;
     130  RECTL rclLast;
     131  PMINIRECORDCORE pmiFirst;
     132  PMINIRECORDCORE pmiLast;
     133  INT correction;
    125134
     135  pmiFirst = WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(NULL),
     136                        MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
     137  pmiLast = WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(NULL),
     138                       MPFROM2SHORT(CMA_LAST, CMA_ITEMORDER));
     139  WinSendMsg(hwndCnr,
     140             CM_QUERYVIEWPORTRECT,
     141             MPFROMP(&rclViewport), MPFROM2SHORT(CMA_WINDOW , TRUE));
    126142  memset(&qrecrct, 0, sizeof(QUERYRECORDRECT));
    127143  qrecrct.cb = sizeof(QUERYRECORDRECT);
     
    133149    WinSendMsg(hwndCnr, CM_QUERYRECORDRECT, MPFROMP(&rcl), MPFROMP(&qrecrct));
    134150  }
     151  qrecrct.pRecord = (PRECORDCORE) pmiFirst;
     152  WinSendMsg(hwndCnr, CM_QUERYRECORDRECT, MPFROMP(&rclFirst), MPFROMP(&qrecrct));
     153  qrecrct.pRecord = (PRECORDCORE) pmiLast;
     154  WinSendMsg(hwndCnr, CM_QUERYRECORDRECT, MPFROMP(&rclLast), MPFROMP(&qrecrct));
     155  correction = 5 + ((abs(rclFirst.yTop) + abs(rclLast.yTop)) / 22500);
    135156  WinSendMsg(hwndCnr,
    136              CM_QUERYVIEWPORTRECT,
    137              MPFROMP(&rclViewport), MPFROM2SHORT(CMA_WINDOW, TRUE));
    138   //DbgMsg(pszSrcFile, __LINE__, "TOPPORT %i TOPRCL %i", rclViewport.yTop , rcl.yTop);
     157             CM_SCROLLWINDOW,
     158             MPFROMSHORT(CMA_VERTICAL),
     159             MPFROMLONG((rclViewport.yTop - (rcl.yTop) - correction)));
     160#if 0
     161  DbgMsg(pszSrcFile, __LINE__, "RECTLFIRST %i RECTLLAST %i %p",
     162         rclFirst.yTop, rclLast.yTop, pmiLast);
     163  DbgMsg(pszSrcFile, __LINE__, "TOPPORT %i TOPRCL %i RIGHTRCL %i",
     164         rclViewport.yTop , rcl.yTop, rcl.xRight);
     165#endif
    139166  WinSendMsg(hwndCnr,
    140167             CM_SCROLLWINDOW,
    141168             MPFROMSHORT(CMA_HORIZONTAL), MPFROMLONG(rcl.xRight - rclViewport.xRight));
    142   WinSendMsg(hwndCnr,
    143              CM_SCROLLWINDOW,
    144              MPFROMSHORT(CMA_VERTICAL),
    145              MPFROMLONG((rclViewport.yTop - (rcl.yTop) - 4)));
     169 
    146170}
    147171
Note: See TracChangeset for help on using the changeset viewer.