示例#1
0
/* %%Function:FFailWinOp %%Owner:BRADV */
BOOL FFailWinOp()
{
	if (vfInDebug)
		return fFalse;

	if (vdbs.fOutsideCmd || vfInCmd)
		{
		if (vdbs.fWinAct)
			CommSz(SzShared(" w"));
		vdbs.cWinCalls++;
		if (vdbs.cWinSucceed)
			{
			if (vdbs.fWinAct)
				CommSz(SzShared("s "));
			vdbs.cWinSucceed--;
			return fFalse;
			}
		if (vdbs.cWinFail)
			{
			if (vdbs.fWinAct)
				CommSz(SzShared("f "));
			vdbs.cWinFail--;
			if (vdbs.fBreakOnFail)
				DebugBreak(1);
			return fTrue;
			}
		if (vdbs.fWinAct)
			CommSz(SzShared(" "));
		}
	return fFalse;
}
示例#2
0
/* %%Function:FInitCvt %%Owner:peterj */
BOOL FInitCvt()
{
	BOOL    fRetry = fTrue;

LRetry:

	if (vhsttbCvt == hNil)
		{
		int     i, iMac;
		BOOL    fValid;
		CHAR   *pchApnd, *pchApndSv;
		int     cch;
		CHAR    szKey[ichMaxCvtKey];
		CHAR    szBuf[ichMaxCvt];

		if ((vhsttbCvt = HsttbInit(0, fTrue/*fExt*/)) == hNil)
			return fFalse;

		Assert(cbCvtNum < ichMaxCvtKey);
		bltbx((CHAR FAR *) szCvtNum, (CHAR FAR *) szKey, cbCvtNum);

		iMac = GetProfileInt((CHAR FAR *) szApp, (CHAR FAR *) szKey, 0);
		bltbx((CHAR FAR *) szCvt, (CHAR FAR *) szKey, cbCvt);

		if (iMac >= 0)
			{
			pchApndSv = szKey + cbCvt - 1;
			for (i = 0; i < iMac; i++)
				{
				pchApnd = pchApndSv;
				CchIntToPpch(i + 1, &pchApnd);
				*pchApnd = '\0';
				cch = GetProfileString((CHAR FAR *) szApp, 
						(CHAR FAR *) szKey,
						(CHAR FAR *) szEmpty,
						(CHAR FAR *) szBuf, ichMaxCvt);
#ifdef SHOWCVT
				CommSzSz(SzShared("Converter String Read: "), szBuf);
#endif
				if ((cch = CchStripString(szBuf, cch)) == 0 ||
						ItMaxInSz(szBuf) < itCvtExtMin)
					{
					continue;
					}

				SzToStInPlace(szBuf);
				if (IbstAddStToSttb(vhsttbCvt, szBuf) == ibstNil)
					break;
				}
			}
		}

	if (vhsttbCvt != hNil && (*vhsttbCvt)->ibstMac == 0 && vpexcr == NULL
			&& fRetry)
		{
		BOOL fAnyFound;
		struct EXCR excr;
		fRetry = fFalse;
		InitExcr(&excr);
		fAnyFound = FFindOtherConvtrs();
		FreeExcr(&excr);
		if (fAnyFound)
			{
			FreePh(&vhsttbCvt);
			goto LRetry;
			}
		}

	return fTrue;
}
示例#3
0
extern HWND             vhwndAppIconBar;
extern HWND             vhwndDeskTop;
extern HWND             vhwndPrompt;
extern HWND             vhwndStatLine;
extern int              vflm;
extern BOOL             vfInLongOperation;
extern int              vfInitializing;
extern CHAR             szEmpty[];
extern CHAR             stEmpty[];
extern CHAR		szApp[];
extern HBRUSH           vhbrGray;
extern struct ITR	vitr;
extern struct STTB **vhsttbCvt;


csconst CHAR	szCvtNum[]	= SzShared("CONVNUM");
csconst CHAR	szCvt[]		= SzShared("CONV");

#define cbCvtNum	sizeof(szCvtNum)
#define cbCvt		sizeof(szCvt)

#define ichMaxCvtKey (cbCvt + ichMaxNum)

CHAR *PchSkipStrictlySpacesPch(CHAR *);

struct EXCR *vpexcr;  /* pointer to currently active External Converter Record */

void AppendRgchToFnRtf(struct RARF *, char *, int);

/* F  I N I T  C V T */
/* Initialize file converter string table. */
示例#4
0
/* %%Function:FIdle %%Owner:PETERJ */
FIdle()
{ /* Idle routine -- executes in the background when no messages are waiting */
	/* Returns fTrue iff there is a message in the queue on return */

	/* WARNING: in Preview mode, we skip everything except:
				Enable AwfulNoise
				OnTime Macro
				Updating Menus
				Initializing SDM
				Autosave
				Debug Checks
		Due to the special nature of the font cache while in preview, we cannot
		do FormatLines except while in the preview code!
	*/
	extern int vfDeactByOtherApp;
	extern int vlm;
	extern HWND vhwndRibbon;
	extern HWND vhwndStatLine;
	struct RPL rpl;
	struct LBS lbsText, lbsFtn;
	int ww;
	int wwHdr = wwNil;
	int docCur = PselActive()->doc;
	static int cPassUninterrupt = 0;
#define cPassOne    5
#define cPassTwo    20

#ifdef DEBUG
	int iGotoLRet = -1;
#endif /* DEBUG */

	Assert(vidf.fInIdle == 0);
	vidf.fInIdle = fTrue;

#ifdef RSH
	RestartUatTimer();
	CheckUat();
#endif /* RSH */

	Assert(vpvs.lmSave != lmPreview);
#ifdef BATCH
	/* If vfBatchIdle is true, allow idle-ing in batch mode */
	if (vfBatchMode && !vfBatchIdle)
		BatchModeError(SzShared("Idle entered!"), NULL, 0, 0);
#endif /* BATCH */

/* if free heap space has changed, dump the new cbFree to the comm port */
	Debug (vdbs.fReportHeap ? ReportHeapSz (SzShared("memory usage "), 1) : 0);
	Debug (vdbs.fHeapAct||vdbs.fWinAct ? ReportFailCalls() : 0);

#ifdef DEBUG
/* show each pass through idle */
		{
		static int cIdlePasses = 0;

		Scribble (ispIdle1, 'I'); /* indicate in idle */
		Scribble (ispIdle2, '0'+cIdlePasses);
		cIdlePasses = (cIdlePasses + 1) % 10;
		}

	if (vdbs.fShowDirty)
		ScribbleDirty(DocMother(selCur.doc));
#endif  /* DEBUG */

	Assert( cHpFreeze == 0 );
	Debug( cHpFreeze = 0 );
	Assert( vfInsertMode || cpInsert == cpNil );
	Assert(vcPreload == 0 && vfnPreload == fnNil);

	ClearInputState();

	if (vidf.fInvalSeqLev)
		{
		InvalSeqLevFields();
		Assert(!vidf.fInvalSeqLev);
		}

/* Re-enable beep, disk full alert, memory alert, other alerts */
	vfAwfulNoise = fFalse;

	if (vlm == lmPreview)
		goto LPrvw1;

/* Reset the cound of consecutive scrolls. */
	if (vcConseqScroll != 0 &&
			GetKeyState(VK_UP) >= 0 && GetKeyState(VK_DOWN) >= 0 &&
			GetKeyState(VK_LBUTTON) >= 0 && GetKeyState(VK_RBUTTON) >= 0)
		{
		vcConseqScroll = 0;
		}

	Assert(vlm != lmPreview);
/* Update all document windows */
	UpdateAllWws( fTrue );

	Debug (iGotoLRet = 0);
	if (FMsgPresent(mtyIdle & ~mtyMouseMove))
		goto LRet;

/* scroll active cp of selection into view */
	if (vfSeeSel && hwwdCur != hNil)
		SeeSel();
	vfSeeSel = fFalse;

	Debug (iGotoLRet = 1);
	if (FMsgPresent(mtyIdle))
		goto LRet;

	Assert(vlm != lmPreview);
/* turn on selection highlight */
	if (!vfDeactByOtherApp)
		{
		if (!selCur.fNil && selCur.fHidden)
			TurnOnSelCur();
		if (!selDotted.fNil && selDotted.fHidden)
			TurnOnSel(&selDotted);
		}

	Debug (iGotoLRet = 2);
	if (FMsgPresent(mtyIdle))
		goto LRet;

	Assert(vlm != lmPreview);

/* make sure we have our full swap area (or reduce if we have used up memory) */
	if (!(cPassUninterrupt+1 & 0x00ff))
		{
#ifdef DEBUG
		if (vcShrinkSwapArea != 0)
			ReportSz("vcShringSwapArea non zero at idle");
#endif /* DEBUG */
		vcShrinkSwapArea = 0;
		OurSetSas(sasFull);
		}

/* bring in our core (wait until now so screen is up to date & we don't
	postpone our responsiveness) */
	if (cPassUninterrupt > cPassOne)
		CoreNewest (cPassUninterrupt >= cPassTwo/*fLoad*/);

	Debug (iGotoLRet = 3);
	if (FMsgPresent(mtyIdle))
		goto LRet;

/* update ruler */
	if (hmwdCur != hNil && (*hmwdCur)->hwndRuler != hNil)
		if (selCur.fUpdatePap || selCur.fUpdateRuler)
			UpdateRuler(hmwdCur, fFalse /*!fInit*/, -1/*rk*/, fTrue /*fAbortOK*/);

	Debug (iGotoLRet = 4);
	if (FMsgPresent(mtyIdle))
		goto LRet;

	Assert(vlm != lmPreview);
/* update outline iconbar if in outline. */
	if (hwwdCur != hNil && (*hwwdCur)->fOutline)
		{
		UpdateOutlineIconBar();
		}

	Debug (iGotoLRet = 5);
	if (FMsgPresent(mtyIdle))
		goto LRet;

/* Update the beautification of edited text in the various macro windows */
	if (vhmes != hNil)
		{
		uns imei;
		uns imeiMax;
		MEI * pmei;
		MES * pmes;
		struct CA ca;

		pmes = *vhmes;
		pmei = &pmes->rgmei[0];
		imeiMax = pmes->imeiMax;
		for (imei = 0; imei < imeiMax; ++imei, ++pmei)
			/* okay to ignore expansion failure 
				as beauty is at stake */
			if (pmei->fNotExpanded && !DiDirtyDoc(pmei->docEdit))
				{
				if (FExpandHqrgbToPca(pmei->hqrgbTokens, 
						pmei->cbTokens, 
						PcaSetWholeDoc(&ca,pmei->docEdit),imei,fTrue))
					PmeiImei(imei)->fNotExpanded = fFalse;
				pmei = PmeiImei(imei);
				}
		}

/* Update Start/Continue button on macro icon bar */
	{
	MEI * pmei;
	
	if (vhmes != hNil && (pmei = PmeiCur())->heli != hNil && 
			PdodDoc(pmei->docEdit)->fDirty)
		{
		FreeEditMacro(iNil);
		}
	}

	Debug (iGotoLRet = 6);
	if (FMsgPresent(mtyIdle))
		goto LRet;

/* notice editing in header pane, enable "link with prev/reset" button if 
	it is not the first section's header/footer */
/* Why is this not done at NewCurWw time? - because you don't know when it 
is dirtied */
	if (wwCur != wwNil && PwwdWw(wwCur)->wk == wkHdr && 
			PdodDoc(docCur)->fDirty)
		{
		Assert(PdodDoc(docCur)->fDispHdr);
		if (FCanLinkPrev(wwCur))
			{
			SetSameAsPrevCtl(wwCur, fTrue /*fEnable*/);
			}
		}

	Assert(vlm != lmPreview);
/* update ribbon */
	if (vhwndRibbon != NULL)
		if (selCur.fUpdateChp || selCur.fUpdateChpGray ||
				selCur.fUpdateRibbon)
			UpdateRibbon(fFalse);

	Debug (iGotoLRet = 7);
	if (FMsgPresent(mtyIdle))
		goto LRet;

	Assert(vlm != lmPreview);

/* update header window's iconbar text */
	if (vdocHdrEdit != docNil)
		{
		int docHdrDisp = docNil;
		int docMom = vdocHdrEdit; /* saved away because vdocHdrEdit may
		be reset to zero */
		while ((wwHdr = WwHdrFromDocMom(docMom, &docHdrDisp)) != wwNil)
			{
			Assert(docHdrDisp);
			if (PwwdWw(wwHdr)->fHdr)
				SetHdrIBarName(docHdrDisp, IhtstFromDoc(docHdrDisp), wwHdr);
			}
		}

	Debug (iGotoLRet = 8);
	if (FMsgPresent(mtyIdle))
		goto LRet;

	Assert(vlm != lmPreview);

/* perform background DDE processes, if any */
	if (vfDdeIdle)
		{
		DoDdeIdle ();
		}

	Debug (iGotoLRet = 9);
	if (FMsgPresent(mtyIdle))
		goto LRet;

	/* WwCur enhancement for pictures. If window was dirtied and there
		are lines with pictures whose display was postponed, do the
		full display now. Other windows done later.
	
		Can use this loop for gray-scale fonts too.
	
	*/

	Assert(vlm != lmPreview);
	if (hwwdCur != hNil && (*hwwdCur)->fNeedEnhance)   /* wwCur first */
		{
		UpdateWw(wwCur, fTrue /* fAbortOK */); /* be sure window is up to date first */
		if (FEnhanceWw(wwCur))
			(*hwwdCur)->fNeedEnhance = fFalse;
		else  /* false if interrupted */				
			{
			Debug (iGotoLRet = 10);
			goto LRet;
			}
		}

	Debug (iGotoLRet = 11);
	if (FMsgPresent(mtyIdle))
		goto LRet;

/* Update the status line */
	if (vhwndStatLine != NULL && 
			(selCur.fUpdateStatLine || selCur.fUpdateStatLine2))
		UpdateStatusLine(usoCache);
	Debug (iGotoLRet = 12);
	if (FMsgPresent(mtyIdle))
		goto LRet;

/* preload font, if changed, to avoid delay when typing commences */
	if (vrf.fPreloadSelFont)
		{
		vrf.fPreloadSelFont = fFalse;
		if (selCur.fIns && hwwdCur != hNil &&
				DocMother(vfli.doc) == DocMother(selCur.doc))
	/* one case where vfli.doc not equal to selCur.doc is we are stepping
	through macro statement in an active window.  vfli.doc may point to the
	macro doc because we just hilighted the macro statement but selCur.doc
	is the active doc that the macro is executing on.
*/
			{
#ifdef BRYANL
			CommSz( SzShared( "Preloading font!!\r\n") );
#endif
			SetFlm( (*hwwdCur)->grpfvisi.flm );
			LoadFont( &selCur.chp, fFalse /*fWidthsOnly*/ );
			}
		}
	Debug (iGotoLRet = 12);
	if (FMsgPresent(mtyIdle))
		goto LRet;

LPrvw1:

/* Check for OnTime macro */
	if (vhotd != hNil)
		{
		extern unsigned long LTimeCur();
		OTD * potd;
		unsigned long lTime;

		lTime = LTimeCur();
		potd = *vhotd;
		if (lTime >= potd->lTime && 
				lTime < potd->lTime + potd->lTolerance)
			{
			extern BOOL vfAbortInsert;

			if (vfInsertMode)
				{
LAbortInsert:
				Assert(vfInsertMode); /* protect the label */
				/* Have to run next time in idle... */
				vfAbortInsert = fTrue;

				/* need to idle again ASAP! */
				Scribble (ispIdleComplete, 'M'); /* successful idle  */
				Scribble (ispIdle1, ' '); /* no longer in idle */
				cPassUninterrupt++;
				vidf.fInIdle = fFalse;
				return fFalse;
				}
			else
				{
				char stMacro [cchMaxSt];

				CopySt(potd->stMacro, stMacro);
				FreePh(&vhotd);
				FRunMacro(stMacro);
				}
			}
		}


	Debug (iGotoLRet = 13);
	if (FMsgPresent(mtyIdle))
		goto LRet;

/* make sure all the menus are up to date */
	if ((vgrfMenuCmdsAreDirty || vgrfMenuKeysAreDirty) && 
			cPassUninterrupt > cPassTwo)
		BringMenusUpToDate();

	Debug (iGotoLRet = 14);
	if (FMsgPresent(mtyIdle))
		goto LRet;

	if (cPassUninterrupt > cPassTwo+1 && 
			(!vmerr.fSdmInit||vpvs.fLoadPrvwFon))
		{
		FAbortNewestCmg(cmgInitStuff, fFalse, fTrue);
/* init SDM if we haven't already */
		if (!vmerr.fSdmInit)
			FAssureSdmInit();
		Debug (iGotoLRet = 15);
		if (FMsgPresent(mtyIdle))
			goto LRet;
/* Add preview font to master font table */
		if (vpvs.fLoadPrvwFon)
			LoadPreviewFont();
		OldestCmg(cmgInitStuff);
		}


	Debug (iGotoLRet = 16);
	if (FMsgPresent(mtyIdle))
		goto LRet;

	if (vlm == lmPreview)
		goto LPrvw2;

/* perform background repagination */
	if (selCur.doc != docNil && cPassUninterrupt >= cPassOne)
		{
		if (vpref.fBkgrndPag && !vpref.fDraftView 
				&& PwwdWw(wwCur)->wk != wkMacro)
			{
			int docMother = DocMother(selCur.doc);
			int lmSave = vlm;
			int flmSave = vflm;

			if (FInitWwLbsForRepag(wwCur, docMother, lmBRepag, &lbsText, &lbsFtn))
				{
				int fAbort, ipgdMacOld;

				SetWords(&rpl, pgnMax, cwRPL);
				rpl.cp = cpMax;
				ipgdMacOld = IMacPlc(PdodDoc(docMother)->hplcpgd);
				fAbort = !FUpdateHplcpgd(wwTemp, docMother, &lbsText, &lbsFtn, &rpl, patSilent );
				EndFliLayout(lmSave, flmSave);
				EndLayout(&lbsText, &lbsFtn);
				Debug (iGotoLRet = 17);
				if (fAbort)
					goto LRet;
				if (vhwndStatLine && ipgdMacOld !=
						IMacPlc(PdodDoc(docMother)->hplcpgd))
					UpdateStatusLine(usoCache);
				}
			}

		Debug (iGotoLRet = 18);
		if (FMsgPresent(mtyIdle))
			goto LRet;

		CoreNewest(fFalse);
		}


	Debug (iGotoLRet = 19);
	if (FMsgPresent(mtyIdle))
		goto LRet;

/* Get rid of the monster printer DC if we can live without it */
	if (vpri.hdc)
		{
		SetFlm( flmTossPrinter );
		Debug(hdcPrint = NULL);
		}

	Debug (iGotoLRet = 20);
	if (FMsgPresent(mtyIdle))
		goto LRet;

/* To improve global memory conditions, unlock any locked bitmaps */
	if (vsci.hdcScratch)
		SetScratchPbmi( &vbmiEmpty );

/* Shrink heap blocks for FormatLine.  Call this when it's
possible that the contents of the screen have gotten less complex */
	Assert(vbchrMax >= bchrMaxInit);
	if (vbchrMax - vbchrMac > bchrMaxFree)
		{
		vbchrMax = max(bchrMaxInit,vbchrMac);
		FChngSizeHCw(vhgrpchr, CwFromCch(vbchrMax + cbCHRE), fTrue);
		}

/* inside ruler functions the ruler grpprl is never shrunk.  This
	checks to see if it is bigger then it needs to be & shrinks it */
	if (vrulss.hgrpprl != hNil)
		CheckRulerGrpprlSize ();

	Assert (vdocTemp == docNil || mpdochdod[vdocTemp] != hNil);
	Assert (vdocScratch == docNil || mpdochdod[vdocScratch] != hNil);

	Assert(vlm != lmPreview);

	Debug (iGotoLRet = 21);
	if (FMsgPresent(mtyIdle))
		goto LRet;

/* delete vdocScratch here to free heap */
	if (vdocScratch != docNil)
		{
#ifdef DEBUG
		extern BOOL fDocScratchInUse;
		Assert (!fDocScratchInUse);
#endif /* DEBUG */
		DisposeDoc (vdocScratch);
		/* vdocScratch = docNil; */
		}
	if (vdocTemp != docNil && CpMacDocEdit(vdocTemp) > cp0)
		{
		struct CA caT;
		PdodDoc(vdocTemp)->doc = docScrap;   /* ensure valid chain */
		FDelete(PcaSetWholeDoc(&caT, vdocTemp));
		}

LPrvw2:
	Debug (iGotoLRet = 22);
	if (FMsgPresent(mtyIdle))
		goto LRet;

/* check to see if autosave should be done.  If so, do it. */
	Assert(GetTickCount() > 0L);
	if (vpref.iAS == iASNever || mwMac == 0 || !FAnyDirtyDocs())
		ResetASBase();
	else if (cPassUninterrupt > cPassTwo && FDoAutoSave())
		{
		if (vfInsertMode)
			/* must exit insert mode before we can save */
			goto LAbortInsert;
		else
			CmdAutosave();
		}

	Debug (iGotoLRet = 23);
	if (FMsgPresent(mtyIdle))
		goto LRet;

	/* check for discardable cursors */
	if (vhcOtlCross)
		{
		int ww;
		for (ww = 0; ww < wwMac; ww++)
			if (mpwwhwwd[ww] != hNil && PwwdWw(ww)->fOutline)
				break;
		if (ww == wwMac)
			/* no one in outline mode, discard outline cursors */
			{
			FreeIrcds(ircdsOtlCross);
			FreeIrcds(ircdsOtlVert);
			FreeIrcds(ircdsOtlHorz);
			}
		}
	if (vhcPrvwCross && vlm != lmPreview)
		FreeIrcds(ircdsPrvwCross);

	Assert(!vhcHelp == !vfHelp);

	Debug (iGotoLRet = 24);
	if (FMsgPresent(mtyIdle))
		goto LRet;

	if (vlm == lmPreview)
		goto LPrvw3;

	if (cPassUninterrupt > cPassTwo && selCur.doc != docNil)
		/* load pieces of selCur.doc into file cache */
		{
		int doc = DocMother(selCur.doc);
		int fn = PdodDoc(doc)->fn;
		CP ccpScan = CpMin((vbptbExt.ibpMac / 4) * cbSector, 
				CpMacDoc(doc));
		CP cpCur = doc != selCur.doc ? cp0 :
				CpMax(cp0, selCur.cpFirst - (ccpScan/3));
		if (fn != fnNil)
			EnablePreload(fn);
		while (ccpScan > cp0 && cpCur < CpMacDoc(doc) && 
				!FMsgPresent(mtyIdle))
			{
			CachePara(doc, cpCur);
			FetchCp(doc, cpCur, fcmProps+fcmChars);
			cpCur += vccpFetch;
			ccpScan -= vccpFetch;
			}
		if (fn != fnNil)
			DisablePreload();
		}

	Debug (iGotoLRet = 25);
	if (FMsgPresent(mtyIdle))
		goto LRet;

	/* GlobalWire the current font (leaves it unselected) 
		(DavidW says DON'T try to access the bits under win3) */
 	if (vwWinVersion < 0x0300)
		{
		int f;
		HFONT hfont;
		HANDLE hfontPhy;
		HDC hdc;

		if (vsci.pfti != NULL && (hfont = vsci.pfti->hfont) != NULL && 
				hwwdCur != hNil && (hdc = (*hwwdCur)->hdc) != NULL)
			{
			hfontPhy = GetPhysicalFontHandle(hdc);

			ResetFont(fFalse);

			if (((f = GlobalFlags(hfontPhy)) & GMEM_LOCKCOUNT) == 0 &&
					(f & ~GMEM_LOCKCOUNT) != 0)
				{
				Scribble(ispWireFont, 'W');
				/* Make the block non-discardable so that
				   windows won't throw out the block when
				   making room to GlobalWire it. */
				Assert(f & GMEM_DISCARDABLE);
				if (f & GMEM_DISCARDABLE)
					GlobalReAlloc(hfontPhy, GlobalSize(hfontPhy),
						GMEM_MODIFY);
				GlobalWire(hfontPhy);
				if (f & GMEM_DISCARDABLE)
					GlobalReAlloc(hfontPhy, GlobalSize(hfontPhy),
						GMEM_MODIFY | GMEM_DISCARDABLE);
				GlobalUnlock(hfontPhy);
				}
			}
		}

	/*  make sure temp files used (especially TIFF files, etc) won't cause
		us to run out of fns. */
	if (fnMac > fnMax-5 && cPassUninterrupt > cPassTwo)
		KillExtraFns();

	Debug (iGotoLRet = 26);
	if (FMsgPresent(mtyIdle))
		goto LRet;

	/* Enhancement loop for pictures. If window was dirtied and there
		are lines with pictures whose display was postponed, do the
		full display now.
	
		Did wwCur above before background repag; should not now be dirty 
		Can use this loop for gray-scale fonts too.
	
	*/

	Assert(vlm != lmPreview);

	if (cPassUninterrupt > cPassOne)
		{
		if (hwwdCur != hNil && (*hwwdCur)->fNeedEnhance && (*hwwdCur)->fDirty)
			UpdateWw(wwCur, fTrue /* fAbortOK */);

		for (ww = wwDocMin; ww < wwMac; ++ww)
			{
			struct WWD **hwwd;
			if (((hwwd = mpwwhwwd[ww]) != hNil) && (*hwwd)->fNeedEnhance)
				{
				if (FEnhanceWw(ww))
					(*hwwd)->fNeedEnhance = fFalse;
				else  /* false if interrupted */							
					{
					Debug (iGotoLRet = 27);
					goto LRet;
					}

				}
			}
		}

LPrvw3:
	Debug (iGotoLRet = 28);
	if (FMsgPresent(mtyIdle))
		goto LRet;

/* debugging checks */
#ifdef DEBUG
/* Check to see if the toolbox has been trashed */
	Debug(vdbs.fCkTlbx ? CkTlbx(fFalse) : 0 );

/* following Asserts try to catch storing into NULL pointers */
	Assert( *((char *) 0) == 0 );
	Assert( *((char *) 2) == 0 );
	Assert( *((char *) 8) == 0 );

	if (cPassUninterrupt > cPassOne)
		DoDebugTests(fTrue);
#endif  /* DEBUG */

	Debug (iGotoLRet = 29);
	if (FMsgPresent(mtyIdle))
		goto LRet;

	if (vlm == lmPreview)
		goto LPrvw4;

/* quietly load each of the code segments we use */
	if (!(cPassUninterrupt+1 & 0x0007))
		GetNextHcd();

	Debug (iGotoLRet = 30);
	if (FMsgPresent(mtyIdle))
		goto LRet;

/* make sure our core is loaded in */
	CoreNewest (fFalse);

LPrvw4:
	Scribble (ispIdleComplete, '*'); /* successful idle  */
	Scribble (ispIdle1, ' '); /* no longer in idle */
	cPassUninterrupt++;
	vidf.fInIdle = fFalse;
	return fFalse;

LRet:   /* Idle was interrupted by the arrival of an interesting message */

/* show each interrupted pass through idle with indicator of how far through */
	Scribble (ispIdleComplete, 'a'+iGotoLRet);
	Scribble (ispIdle1, ' '); /* no longer in idle */
	cPassUninterrupt = 0;
	vidf.fInIdle = fFalse;
	return fTrue;
}