mirror of
https://github.com/jmarshall23/msword.git
synced 2026-08-11 23:50:53 +02:00
Page margin fixes.
This commit is contained in:
@@ -117,6 +117,7 @@ extern IDF vidf;
|
||||
extern struct ITR vitr;
|
||||
#ifdef OPUS_X64
|
||||
extern int OpusCreateWin95Chrome(HWND);
|
||||
extern void OpusRequestWin95PageView(HWND);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -657,6 +658,11 @@ BOOL fTutorial;
|
||||
Scribble(15,'L');
|
||||
Scribble(14,' ');
|
||||
|
||||
#ifdef OPUS_X64
|
||||
/* Enter Page View after the document layout records are fully built. */
|
||||
OpusRequestWin95PageView(vhwndApp);
|
||||
#endif
|
||||
|
||||
Profile( vpfi == pfiInit ? StopProf() : 0 );
|
||||
Debug(CkSortOrdinals());
|
||||
|
||||
|
||||
@@ -2569,6 +2569,15 @@ FReadUserState()
|
||||
if (!FReadOpusIni() && !FInitDefaultPrefs(fFalse))
|
||||
return fFalse;
|
||||
|
||||
#ifdef OPUS_X64
|
||||
/*
|
||||
* Page View has to be activated after FCreateMw finishes constructing its
|
||||
* layout records. The Win95 shell requests it from its post-startup timer;
|
||||
* prevent a saved preference from entering it too early here.
|
||||
*/
|
||||
vpref.fPageView = fFalse;
|
||||
#endif
|
||||
|
||||
/* this is not a *user* view preference, used internally only! */
|
||||
vpref.grpfvisi.fForceField = fFalse;
|
||||
|
||||
|
||||
+5
-1
@@ -1127,7 +1127,11 @@ but outline and header iconbar should be dypIconBar */
|
||||
#ifdef OPUS_X64
|
||||
LWin95Toolbar:
|
||||
if (OpusWin95ChromeActive())
|
||||
prc->ypTop += OpusWin95ToolbarHeight() - vsci.dypBorder;
|
||||
{
|
||||
int dypWin95Toolbar = OpusWin95ToolbarHeight();
|
||||
if (dypWin95Toolbar > 0)
|
||||
prc->ypTop += dypWin95Toolbar - vsci.dypBorder;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -69,6 +69,7 @@ extern BOOL vfInitializingRuler;
|
||||
extern CHAR szEmpty[];
|
||||
extern HCURSOR vhcArrow;
|
||||
extern struct CA caTap;
|
||||
extern struct CA caHdt;
|
||||
extern BOOL vfSeeSel;
|
||||
|
||||
extern struct REB * PrebInitPrebHrsd ();
|
||||
@@ -97,6 +98,227 @@ extern int vdbmgDevice;
|
||||
|
||||
extern struct REB * vpreb;
|
||||
|
||||
#ifdef OPUS_X64
|
||||
/* Read-only layout metrics used by the Win95 vertical ruler overlay. */
|
||||
int OpusGetWin95VerticalRulerMetrics(hwnd, pypPageTop, pypPageBottom,
|
||||
pdypTopMargin, pdypBottomMargin, pdypInch)
|
||||
HWND hwnd;
|
||||
int *pypPageTop, *pypPageBottom;
|
||||
int *pdypTopMargin, *pdypBottomMargin, *pdypInch;
|
||||
{
|
||||
int ww = WwFromHwnd(hwnd);
|
||||
struct WWD *pwwd;
|
||||
struct DOD *pdod;
|
||||
|
||||
if (ww < wwDocMin || ww >= wwMac)
|
||||
return fFalse;
|
||||
pwwd = PwwdWw(ww);
|
||||
if (!pwwd->fPageView || pwwd->ipgd == ipgdNil)
|
||||
return fFalse;
|
||||
pdod = PdodDoc(PmwdWw(ww)->doc);
|
||||
*pypPageTop = pwwd->rcePage.yeTop;
|
||||
*pypPageBottom = pwwd->rcePage.yeBottom;
|
||||
*pdypTopMargin = DypFromDya(abs(pdod->dop.dyaTop));
|
||||
*pdypBottomMargin = DypFromDya(abs(pdod->dop.dyaBottom));
|
||||
*pdypInch = vfti.dypInch;
|
||||
return fTrue;
|
||||
}
|
||||
|
||||
/* Commit a vertical-ruler drag through the document's existing DOP state.
|
||||
The UI passes a screen-pixel margin; preserve header/footer overlap signs
|
||||
and invalidate page layout exactly as the Page Setup path does. */
|
||||
int OpusSetWin95VerticalMargin(hwnd, fTop, dypMargin)
|
||||
HWND hwnd;
|
||||
int fTop, dypMargin;
|
||||
{
|
||||
int ww = WwFromHwnd(hwnd);
|
||||
int doc, dyaMargin, dyaOther, dyaMax, dyaOld, dyaNew;
|
||||
struct DOD *pdod;
|
||||
|
||||
if (ww < wwDocMin || ww >= wwMac || vfti.dypInch <= 0)
|
||||
return fFalse;
|
||||
doc = PmwdWw(ww)->doc;
|
||||
dyaMargin = NMultDiv(max(0, dypMargin), czaInch, vfti.dypInch);
|
||||
|
||||
FreezeHp();
|
||||
pdod = PdodDoc(doc);
|
||||
dyaOther = abs(fTop ? pdod->dop.dyaBottom : pdod->dop.dyaTop);
|
||||
/* Retain at least a quarter inch of writable page height. */
|
||||
dyaMax = max(0, pdod->dop.yaPage - dyaOther - czaInch / 4);
|
||||
dyaMargin = min(dyaMargin, dyaMax);
|
||||
dyaOld = fTop ? pdod->dop.dyaTop : pdod->dop.dyaBottom;
|
||||
dyaNew = dyaOld < 0 ? -dyaMargin : dyaMargin;
|
||||
if (dyaNew == dyaOld)
|
||||
{
|
||||
MeltHp();
|
||||
return fTrue;
|
||||
}
|
||||
if (fTop)
|
||||
pdod->dop.dyaTop = dyaNew;
|
||||
else
|
||||
pdod->dop.dyaBottom = dyaNew;
|
||||
pdod->fDirty = pdod->fFormatted = fTrue;
|
||||
pdod->fEnvDirty = fTrue;
|
||||
MeltHp();
|
||||
|
||||
caHdt.doc = docNil;
|
||||
SetUndoNil();
|
||||
InvalPageView(doc);
|
||||
if (doc == DocMother(selCur.doc))
|
||||
selCur.fUpdatePap = fTrue;
|
||||
InvalidateRect(hwnd, NULL, TRUE);
|
||||
UpdateWindow(hwnd);
|
||||
return fTrue;
|
||||
}
|
||||
|
||||
int OpusGetWin95HorizontalPageMargins(hwndMark, pdxpLeft, pdxpRight)
|
||||
HWND hwndMark;
|
||||
int *pdxpLeft, *pdxpRight;
|
||||
{
|
||||
HWND hwndRuler = GetParent(hwndMark);
|
||||
struct RSD **hrsd;
|
||||
struct DOD *pdod;
|
||||
int doc;
|
||||
|
||||
if (hwndRuler == NULL || selCur.doc == docNil)
|
||||
return fFalse;
|
||||
hrsd = HrsdFromHwndRuler(hwndRuler);
|
||||
if (hrsd == hNil || *hrsd == NULL || (*hrsd)->hwndMark != hwndMark)
|
||||
return fFalse;
|
||||
doc = DocMother(selCur.doc);
|
||||
FreezeHp();
|
||||
pdod = PdodDoc(doc);
|
||||
*pdxpLeft = DxsFromDxa(0, max(0, pdod->dop.dxaLeft));
|
||||
*pdxpRight = DxsFromDxa(0, max(0, pdod->dop.dxaRight));
|
||||
MeltHp();
|
||||
return fTrue;
|
||||
}
|
||||
|
||||
int OpusAdjustWin95HorizontalMargin(hwndMark, fLeft, dxpDelta)
|
||||
HWND hwndMark;
|
||||
int fLeft, dxpDelta;
|
||||
{
|
||||
HWND hwndRuler = GetParent(hwndMark);
|
||||
struct RSD **hrsd;
|
||||
struct DOD *pdod;
|
||||
int doc, dxaDelta, dxaOther, dxaMax, dxaOld, dxaNew;
|
||||
|
||||
if (hwndRuler == NULL || selCur.doc == docNil)
|
||||
return fFalse;
|
||||
hrsd = HrsdFromHwndRuler(hwndRuler);
|
||||
if (hrsd == hNil || *hrsd == NULL || (*hrsd)->hwndMark != hwndMark)
|
||||
return fFalse;
|
||||
doc = DocMother(selCur.doc);
|
||||
dxaDelta = DxaFromDxs(0, dxpDelta);
|
||||
|
||||
FreezeHp();
|
||||
pdod = PdodDoc(doc);
|
||||
dxaOld = fLeft ? pdod->dop.dxaLeft : pdod->dop.dxaRight;
|
||||
dxaOther = fLeft ? pdod->dop.dxaRight : pdod->dop.dxaLeft;
|
||||
dxaNew = fLeft ? dxaOld + dxaDelta : dxaOld - dxaDelta;
|
||||
dxaMax = max(0, pdod->dop.xaPage - max(0, dxaOther) -
|
||||
max(0, pdod->dop.dxaGutter) - czaInch / 4);
|
||||
dxaNew = max(0, min(dxaNew, dxaMax));
|
||||
if (dxaNew == dxaOld)
|
||||
{
|
||||
MeltHp();
|
||||
return fTrue;
|
||||
}
|
||||
if (fLeft)
|
||||
pdod->dop.dxaLeft = dxaNew;
|
||||
else
|
||||
pdod->dop.dxaRight = dxaNew;
|
||||
pdod->fDirty = pdod->fFormatted = fTrue;
|
||||
pdod->fEnvDirty = fTrue;
|
||||
pdod->fLRDirty = fTrue;
|
||||
MeltHp();
|
||||
|
||||
caHdt.doc = docNil;
|
||||
SetUndoNil();
|
||||
InvalPageView(doc);
|
||||
InvalDoc(doc);
|
||||
InvalTableProps(doc, cp0, CpMacDoc(doc), fTrue);
|
||||
InvalFli();
|
||||
if (doc == DocMother(selCur.doc))
|
||||
selCur.fUpdatePap = fTrue;
|
||||
InvalidateRect(hwndMark, NULL, TRUE);
|
||||
UpdateWindow(hwndMark);
|
||||
return fTrue;
|
||||
}
|
||||
|
||||
/* Snapshot the native ruler geometry for the Win95 paint-only overlay. */
|
||||
int OpusGetWin95HorizontalRulerMetrics(hwndMark, pxpZero, pxpActiveLeft,
|
||||
pxpActiveRight, pdxpInch, pxpLeftIndent, pxpFirstIndent,
|
||||
pxpRightIndent, pdxpDefaultTab, pcTabs, rgxpTabs, rgbTabTypes,
|
||||
cTabsMax)
|
||||
HWND hwndMark;
|
||||
int *pxpZero, *pxpActiveLeft, *pxpActiveRight, *pdxpInch;
|
||||
int *pxpLeftIndent, *pxpFirstIndent, *pxpRightIndent, *pdxpDefaultTab;
|
||||
int *pcTabs, *rgxpTabs;
|
||||
unsigned char *rgbTabTypes;
|
||||
int cTabsMax;
|
||||
{
|
||||
HWND hwndRuler = GetParent(hwndMark);
|
||||
struct RSD **hrsd;
|
||||
struct RSD *prsd;
|
||||
int itbd, itbdMac;
|
||||
int xpOrigin;
|
||||
|
||||
if (hwndRuler == NULL)
|
||||
return fFalse;
|
||||
hrsd = HrsdFromHwndRuler(hwndRuler);
|
||||
if (hrsd == hNil || *hrsd == NULL || (*hrsd)->hwndMark != hwndMark)
|
||||
return fFalse;
|
||||
prsd = *hrsd;
|
||||
xpOrigin = XpMarkFromXaMark(0, hrsd);
|
||||
*pxpZero = xpOrigin;
|
||||
*pdxpInch = XpMarkFromXaMark(czaInch, hrsd) - xpOrigin;
|
||||
*pcTabs = 0;
|
||||
|
||||
if (prsd->rk == rkNormal)
|
||||
{
|
||||
*pxpActiveLeft = xpOrigin;
|
||||
*pxpActiveRight = XpMarkFromXaMark(prsd->dxaColumnNorm, hrsd);
|
||||
*pxpLeftIndent = XpMarkFromXaMark(prsd->pap.dxaLeft, hrsd);
|
||||
*pxpFirstIndent = XpMarkFromXaMark(
|
||||
prsd->pap.dxaLeft + prsd->pap.dxaLeft1, hrsd);
|
||||
*pxpRightIndent = XpMarkFromXaMark(
|
||||
prsd->dxaColumnNorm - prsd->pap.dxaRight, hrsd);
|
||||
*pdxpDefaultTab = XpMarkFromXaMark(prsd->dxaTab, hrsd) - xpOrigin;
|
||||
itbdMac = min(prsd->pap.itbdMac, cTabsMax);
|
||||
for (itbd = 0; itbd < itbdMac; ++itbd)
|
||||
{
|
||||
rgxpTabs[itbd] = XpMarkFromXaMark(
|
||||
prsd->pap.rgdxaTab[itbd], hrsd);
|
||||
rgbTabTypes[itbd] =
|
||||
((unsigned char)prsd->pap.rgtbd[itbd]) & 7;
|
||||
}
|
||||
*pcTabs = itbdMac;
|
||||
}
|
||||
else if (prsd->rk == rkPage)
|
||||
{
|
||||
*pxpActiveLeft = XpMarkFromXaMark(
|
||||
prsd->dxaLeftMar + prsd->dxaExtraLeft, hrsd);
|
||||
*pxpActiveRight = XpMarkFromXaMark(
|
||||
prsd->xaPage - prsd->dxaRightMar -
|
||||
prsd->dxaExtraRight, hrsd);
|
||||
*pxpLeftIndent = *pxpFirstIndent = *pxpActiveLeft;
|
||||
*pxpRightIndent = *pxpActiveRight;
|
||||
*pdxpDefaultTab = max(1, *pdxpInch / 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
*pxpActiveLeft = xpOrigin;
|
||||
*pxpActiveRight = prsd->xpRight;
|
||||
*pxpLeftIndent = *pxpFirstIndent = *pxpActiveLeft;
|
||||
*pxpRightIndent = *pxpActiveRight;
|
||||
*pdxpDefaultTab = max(1, *pdxpInch / 2);
|
||||
}
|
||||
|
||||
return *pdxpInch > 0 && *pxpActiveRight > *pxpActiveLeft;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* scale display infromation */
|
||||
/* domain: utInch, utPt, utCm, utPica */
|
||||
@@ -939,6 +1161,66 @@ ScrollRuler ()
|
||||
|
||||
/* RULER PAINTING FUNCTIONS */
|
||||
|
||||
#ifdef OPUS_X64
|
||||
static void DrawWord95RulerBand(hdc, preb, ypTop, ypBottom)
|
||||
HDC hdc;
|
||||
struct REB *preb;
|
||||
int ypTop, ypBottom;
|
||||
{
|
||||
RECT rcClient, rcBand, rcWrite;
|
||||
struct RSD **hrsd = preb->hrsd;
|
||||
int xpLeft, xpRight;
|
||||
|
||||
GetClientRect((*hrsd)->hwndMark, &rcClient);
|
||||
rcBand.left = max(rcClient.left, preb->xpLeft);
|
||||
rcBand.right = min(rcClient.right, preb->xpRight);
|
||||
rcBand.top = max(rcClient.top, ypTop);
|
||||
rcBand.bottom = min(rcClient.bottom, ypBottom);
|
||||
if (rcBand.right <= rcBand.left || rcBand.bottom <= rcBand.top)
|
||||
return;
|
||||
|
||||
FillRect(hdc, &rcBand, GetSysColorBrush(COLOR_BTNFACE));
|
||||
xpLeft = (*hrsd)->xpZero;
|
||||
xpRight = XpMarkFromXaMark((*hrsd)->dxaColumnNorm, hrsd);
|
||||
if (xpRight < xpLeft)
|
||||
{
|
||||
int xp = xpLeft;
|
||||
xpLeft = xpRight;
|
||||
xpRight = xp;
|
||||
}
|
||||
if (xpLeft < rcClient.left || xpLeft >= rcClient.right)
|
||||
xpLeft = rcClient.left + 2;
|
||||
if (xpRight <= xpLeft || xpRight > rcClient.right)
|
||||
xpRight = rcClient.right - 2;
|
||||
rcWrite = rcBand;
|
||||
rcWrite.left = max(rcBand.left, xpLeft);
|
||||
rcWrite.right = min(rcBand.right, xpRight);
|
||||
if (rcWrite.right > rcWrite.left)
|
||||
FillRect(hdc, &rcWrite, GetSysColorBrush(COLOR_WINDOW));
|
||||
}
|
||||
|
||||
static void FrameWord95Ruler(hdc, preb)
|
||||
HDC hdc;
|
||||
struct REB *preb;
|
||||
{
|
||||
RECT rcClient, rcWrite;
|
||||
struct RSD **hrsd = preb->hrsd;
|
||||
|
||||
GetClientRect((*hrsd)->hwndMark, &rcClient);
|
||||
rcWrite = rcClient;
|
||||
rcWrite.left = max(rcClient.left, (*hrsd)->xpZero);
|
||||
rcWrite.right = min(rcClient.right,
|
||||
XpMarkFromXaMark((*hrsd)->dxaColumnNorm, hrsd));
|
||||
if (rcWrite.left < rcClient.left || rcWrite.left >= rcClient.right)
|
||||
rcWrite.left = rcClient.left + 2;
|
||||
if (rcWrite.right <= rcWrite.left || rcWrite.right > rcClient.right)
|
||||
rcWrite.right = rcClient.right - 2;
|
||||
DrawEdge(hdc, &rcClient, EDGE_RAISED, BF_RECT);
|
||||
if (rcWrite.right > rcWrite.left)
|
||||
DrawEdge(hdc, &rcWrite, EDGE_SUNKEN, BF_RECT);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* PaintRuler
|
||||
*/
|
||||
@@ -988,6 +1270,13 @@ int rpc;
|
||||
ErrorNoMemory(eidNoMemDisplay);
|
||||
goto LRetCleanup;
|
||||
}
|
||||
#ifdef OPUS_X64
|
||||
if (rpc & rpcmScale)
|
||||
DrawWord95RulerBand(hdc, preb, 0, ypScaleBottom);
|
||||
if (rpc & rpcmMark)
|
||||
DrawWord95RulerBand(hdc, preb, ypMark, ypMarkBottom);
|
||||
fErased = fTrue;
|
||||
#endif
|
||||
#ifdef WIN23
|
||||
if (vsci.fWin3Visuals)
|
||||
hbrOld = SelectObject(hdc, vdbmgDevice != dbmgEGA3 ? vhbrLtGray : vhbrGray);
|
||||
@@ -1024,6 +1313,9 @@ int rpc;
|
||||
dypMark);
|
||||
}
|
||||
|
||||
#ifdef OPUS_X64
|
||||
FrameWord95Ruler(hdc, preb);
|
||||
#endif
|
||||
|
||||
LRetCleanup:
|
||||
/* clean up */
|
||||
@@ -2232,6 +2524,7 @@ BOOL fErased;
|
||||
#else
|
||||
DrawRulerTicks(hdc, hrsd, dxa, 0, ut, preb->xpRight, fTrue);
|
||||
#endif /* REVIEW */
|
||||
#ifndef OPUS_X64
|
||||
/*****
|
||||
3D effect for ticks. I repeated the loop to avoid switching
|
||||
brushes constantly.
|
||||
@@ -2272,6 +2565,7 @@ BOOL fErased;
|
||||
#else
|
||||
DrawRulerTicks(hdc, hrsd, dxa, -1, ut, preb->xpRight, fFalse);
|
||||
#endif /* REVIEW */
|
||||
#endif /* !OPUS_X64 */
|
||||
SelectObject(hdc, vhbrBlack);
|
||||
|
||||
if (hfontStatLine && hfontOld)
|
||||
@@ -2326,6 +2620,107 @@ struct REB * preb;
|
||||
int xp, imk, ms;
|
||||
int fErase; /* are we removing the mark? For color we have different ROPs */
|
||||
{
|
||||
#ifdef OPUS_X64
|
||||
int ypTop = ypMark + 1;
|
||||
int ypBottom = ypMarkBottom - 2;
|
||||
int ypMiddle = (ypTop + ypBottom) / 2;
|
||||
int ropOld;
|
||||
COLORREF color = ms == msGray ? GetSysColor(COLOR_GRAYTEXT) : RGB(0, 0, 0);
|
||||
HPEN hpen, hpenOld;
|
||||
HBRUSH hbr, hbrOld;
|
||||
POINT rgpt[3];
|
||||
RECT rc;
|
||||
|
||||
if (xp + 8 < preb->xpLeft || xp - 8 > preb->xpRight)
|
||||
return;
|
||||
if (fErase)
|
||||
{
|
||||
int xpWriteLeft = XpMarkFromXaMark(0, preb->hrsd);
|
||||
int xpWriteRight = XpMarkFromXaMark((*preb->hrsd)->dxaColumnNorm,
|
||||
preb->hrsd);
|
||||
rc.left = xp - 8;
|
||||
rc.right = xp + 9;
|
||||
rc.top = ypMark;
|
||||
rc.bottom = ypMarkBottom;
|
||||
FillRect(hdc, &rc, GetSysColorBrush(
|
||||
xp >= xpWriteLeft && xp <= xpWriteRight ?
|
||||
COLOR_WINDOW : COLOR_BTNFACE));
|
||||
return;
|
||||
}
|
||||
|
||||
hpen = CreatePen(PS_SOLID, 1, color);
|
||||
hbr = CreateSolidBrush(ms == msInvert ? RGB(255, 255, 255) :
|
||||
(ms == msGray ? GetSysColor(COLOR_BTNFACE) : RGB(255, 255, 255)));
|
||||
hpenOld = SelectObject(hdc, hpen);
|
||||
hbrOld = SelectObject(hdc, hbr);
|
||||
ropOld = SetROP2(hdc, ms == msInvert ? R2_NOTXORPEN : R2_COPYPEN);
|
||||
|
||||
switch (imk)
|
||||
{
|
||||
case imkTabLeft:
|
||||
MoveToEx(hdc, xp, ypTop, NULL);
|
||||
LineTo(hdc, xp, ypBottom - 2);
|
||||
LineTo(hdc, xp + 5, ypBottom - 2);
|
||||
break;
|
||||
case imkTabCenter:
|
||||
MoveToEx(hdc, xp, ypTop, NULL);
|
||||
LineTo(hdc, xp, ypBottom - 2);
|
||||
MoveToEx(hdc, xp - 4, ypBottom - 2, NULL);
|
||||
LineTo(hdc, xp + 5, ypBottom - 2);
|
||||
break;
|
||||
case imkTabRight:
|
||||
MoveToEx(hdc, xp, ypTop, NULL);
|
||||
LineTo(hdc, xp, ypBottom - 2);
|
||||
LineTo(hdc, xp - 5, ypBottom - 2);
|
||||
break;
|
||||
case imkTabDecimal:
|
||||
MoveToEx(hdc, xp, ypTop, NULL);
|
||||
LineTo(hdc, xp, ypBottom - 2);
|
||||
MoveToEx(hdc, xp - 3, ypBottom - 2, NULL);
|
||||
LineTo(hdc, xp + 2, ypBottom - 2);
|
||||
SetPixel(hdc, xp + 4, ypBottom - 3, color);
|
||||
break;
|
||||
case imkIndLeft1:
|
||||
rgpt[0].x = xp - 6; rgpt[0].y = ypTop;
|
||||
rgpt[1].x = xp + 6; rgpt[1].y = ypTop;
|
||||
rgpt[2].x = xp; rgpt[2].y = min(ypBottom, ypTop + 7);
|
||||
Polygon(hdc, rgpt, 3);
|
||||
break;
|
||||
case imkIndLeft:
|
||||
case imkIndRight:
|
||||
rgpt[0].x = xp - 6; rgpt[0].y = ypBottom - 3;
|
||||
rgpt[1].x = xp + 6; rgpt[1].y = ypBottom - 3;
|
||||
rgpt[2].x = xp; rgpt[2].y = max(ypTop, ypBottom - 10);
|
||||
Polygon(hdc, rgpt, 3);
|
||||
if (imk == imkIndLeft)
|
||||
Rectangle(hdc, xp - 4, ypBottom - 3, xp + 5, ypBottom + 1);
|
||||
break;
|
||||
case imkDefTab:
|
||||
Rectangle(hdc, xp - 1, ypMiddle, xp + 2, ypMiddle + 3);
|
||||
break;
|
||||
case imkTLeft:
|
||||
case imkTableCol:
|
||||
Rectangle(hdc, xp - 3, ypTop + 1, xp + 4, ypBottom);
|
||||
MoveToEx(hdc, xp, ypTop + 1, NULL);
|
||||
LineTo(hdc, xp, ypBottom);
|
||||
break;
|
||||
case imkLeftMargin:
|
||||
case imkRightMargin:
|
||||
rgpt[0].x = xp; rgpt[0].y = ypMiddle;
|
||||
rgpt[1].x = xp + (imk == imkLeftMargin ? 6 : -6);
|
||||
rgpt[1].y = ypTop;
|
||||
rgpt[2].x = rgpt[1].x; rgpt[2].y = ypBottom;
|
||||
Polygon(hdc, rgpt, 3);
|
||||
break;
|
||||
}
|
||||
|
||||
SetROP2(hdc, ropOld);
|
||||
SelectObject(hdc, hpenOld);
|
||||
SelectObject(hdc, hbrOld);
|
||||
DeleteObject(hpen);
|
||||
DeleteObject(hbr);
|
||||
return;
|
||||
#else
|
||||
struct BMI *pbmi = &mpidrbbmi [idrbRulerMarks3];
|
||||
int dxp = pbmi->dxpEach;
|
||||
int ddxp = dxp / 2;
|
||||
@@ -2355,6 +2750,7 @@ int fErase; /* are we removing the mark? For color we have different ROPs */
|
||||
BitBlt (hdc, (xp - ddxp), ypMark, dxp, pbmi->dyp, pmdcd->hdc,
|
||||
xpSrc, 0, rop);
|
||||
}
|
||||
#endif /* OPUS_X64 */
|
||||
}
|
||||
|
||||
#endif /* WIN23 */
|
||||
|
||||
+2
-1
@@ -1480,7 +1480,8 @@ int imk, i, xa, xaOld;
|
||||
prl[0] = sprmTDxaCol;
|
||||
prl[1] = i;
|
||||
prl[2] = i+1;
|
||||
bltb(&xaT, &prl[3], sizeof(int));
|
||||
/* sprmTDxaCol stores a two-byte Word-format distance. */
|
||||
bltb(&xaT, &prl[3], sizeof(short));
|
||||
pprl += 5;
|
||||
|
||||
/* invalidate table caches */
|
||||
|
||||
@@ -2132,7 +2132,11 @@ int ww;
|
||||
|
||||
/* special case if page is smaller than rcDisp: center the page in the display */
|
||||
if (FSmallPage(ww, &dxw, &dyw) || dxw > 0)
|
||||
#ifdef OPUS_X64
|
||||
return max(dxpGrayOutsideSci / 2, (dxw >> 1));
|
||||
#else
|
||||
return (dxw >> 1);
|
||||
#endif
|
||||
|
||||
if (pwwd->ipgd == ipgdNil)
|
||||
{
|
||||
@@ -2145,7 +2149,12 @@ int ww;
|
||||
GetXlMargins(&pdod->dop, pgd.pgn & 1,
|
||||
WinMac(vfli.dxsInch, DxsSetDxsInch(DocBaseWw(ww))),
|
||||
&xlLeft, &xlRight);
|
||||
return max(dxwSelBarSci - xlLeft, ((dxw >> 1) - dxpGrayOutsideSci));
|
||||
dxw = max(dxwSelBarSci - xlLeft, ((dxw >> 1) - dxpGrayOutsideSci));
|
||||
#ifdef OPUS_X64
|
||||
/* Reserve a narrow gutter for the Word 95 vertical ruler. */
|
||||
dxw = max(dxpGrayOutsideSci / 2, dxw);
|
||||
#endif
|
||||
return dxw;
|
||||
}
|
||||
|
||||
|
||||
@@ -2157,7 +2166,13 @@ int ww;
|
||||
/* return ye such that if pwwd->yeTop equals ye, then top of main text area is at
|
||||
the top of the display.
|
||||
*/
|
||||
#ifdef OPUS_X64
|
||||
/* The Win95 presentation keeps the physical top edge of the sheet visible
|
||||
instead of hiding the top margin above the viewport. */
|
||||
return dypGrayOutsideSci;
|
||||
#else
|
||||
return (YePage(ww, fTrue/*fTop*/));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -178,6 +178,17 @@ CMB *pcmb; /* NOTE: for Win, this might be a flag (0 or 1) */
|
||||
|
||||
if ((*hwwdCur)->wk == wkPage)
|
||||
{
|
||||
#ifdef OPUS_X64
|
||||
/*
|
||||
* The Win95 shell treats Page View as a stable view selection. The
|
||||
* legacy command is a toggle, so duplicate startup/menu messages would
|
||||
* otherwise enter CmdPageViewOff. That old galley reconstruction path
|
||||
* is not used by the restored shell and is unsafe for the native DR
|
||||
* layout. Make repeated Page View selections idempotent here, at the
|
||||
* command source, instead of relying on a window-message filter.
|
||||
*/
|
||||
goto LRet;
|
||||
#endif
|
||||
/* goto galley view */
|
||||
if ((BOOL) pcmb != fTrue && CmdPageViewOff(wwCur) != cmdOK)
|
||||
goto LRet2;
|
||||
@@ -819,7 +830,10 @@ struct LBS *plbsText;
|
||||
MeltHp();
|
||||
|
||||
FreeDrs(hpldr, 0);
|
||||
SetWords(&dr, 0, sizeof(struct DR) / sizeof(short));
|
||||
/* SetWords counts native int-sized words in the x64 port. Dividing by
|
||||
sizeof(short) wrote twice past dr and tripped the stack cookie as Page
|
||||
View was entered. */
|
||||
SetWords(&dr, 0, cwDR);
|
||||
SetWords(&lbs, 0, cwLBS);
|
||||
for (idrMac = ilr = 0; ilr < ilrMac; ++ilr)
|
||||
{
|
||||
|
||||
@@ -1947,7 +1947,14 @@ int val;
|
||||
break;
|
||||
case 3:
|
||||
/* word quantity */
|
||||
bltbyte(&val, &prl[1], sizeof(int));
|
||||
/*
|
||||
* A PRL word is part of the on-disk Word binary format and is always
|
||||
* two bytes wide. The original Win16 build used a two-byte int, but
|
||||
* int is four bytes in the native port. Copying sizeof(int) here
|
||||
* overruns every three-byte PRL supplied by callers (notably the
|
||||
* ruler's prlGray scratch buffer while dragging a marker).
|
||||
*/
|
||||
bltbyte(&val, &prl[1], sizeof(short));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ LRESULT CALLBACK PromptWndProc(HWND, UINT, WPARAM, LPARAM);
|
||||
extern HCURSOR vhcIBeam;
|
||||
extern HCURSOR vhcArrow;
|
||||
int OurSetCursor(HCURSOR cursor);
|
||||
void OpusDrawWin95HorizontalRuler(HWND ruler);
|
||||
|
||||
} // extern "C"
|
||||
|
||||
@@ -183,8 +184,13 @@ LRESULT CALLBACK NatIconBarWndProc(HWND h, UINT m, WPARAM w, LPARAM l) {
|
||||
MouseCursor::arrow);
|
||||
}
|
||||
LRESULT CALLBACK NatRulerMarkWndProc(HWND h, UINT m, WPARAM w, LPARAM l) {
|
||||
return Dispatch(h, m, w, l, RulerMarkWndProc, kRulerMarkMessages,
|
||||
MouseCursor::arrow);
|
||||
const LRESULT result = Dispatch(h, m, w, l, RulerMarkWndProc,
|
||||
kRulerMarkMessages,
|
||||
MouseCursor::arrow);
|
||||
if (m == WM_PAINT) {
|
||||
OpusDrawWin95HorizontalRuler(h);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
LRESULT CALLBACK NatPromptWndProc(HWND h, UINT m, WPARAM w, LPARAM l) {
|
||||
return Dispatch(h, m, w, l, PromptWndProc, kPromptMessages,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user