📄 view1.c
字号:
/*************************************************************************/
/* */
/* Copyright (c) 1997 - 1999 Accelerated Technology, Inc. */
/* */
/* PROPRIETARY RIGHTS of Accelerated Technology are involved in the */
/* subject matter of this material. All manufacturing, reproduction, */
/* use, and sales rights pertaining to this subject matter are governed */
/* by the license agreement. The recipient of this software implicitly */
/* accepts the terms of the license. */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* FILE NAME VERSION */
/* */
/* VIEW1.c 1.9 */
/* */
/* COMPONENT */
/* */
/* All */
/* */
/* DESCRIPTION */
/* */
/* This file contains the SetPort function. */
/* */
/* AUTHOR */
/* */
/* Robert G. Burrill, Accelerated Technology, Inc. */
/* */
/* DATA STRUCTURES */
/* */
/* None */
/* */
/* FUNCTIONS */
/* */
/* None */
/* */
/* DEPENDENCIES */
/* */
/* None */
/* */
/* HISTORY */
/* */
/* NAME DATE REMARKS */
/* */
/* */
/*************************************************************************/
#include "meta_wnd.h"
#include "metconst.h" /* MetaWINDOW Constant & Stucture Definitions */
#include "metports.h" /* MetaWINDOW Port & Bitmap Definitions */
#include "grafdata.h"
#include "metfonts.h"
/* Function SetPort sets the specified GrafPort to be the current port.
Also calls PortBitmap to reset the current grafMap. */
void SetPort(metaPort *portPtr)
{
void PortBitmap(grafMap *ptrBMAP);
void mwGblCoord(void);
void mwGblPen(void);
void PenColor(int argColor);
void PenMode(int Mode);
void PlaneMask(long PLNMSK);
void SetFont( fontRcd *FONT);
short grafErrValue;
if (gFlags & gfRgnOpen)
{ /* region open */
grafErrValue = c_SetPort + c_RgnOflow;
nuGrafErr(grafErrValue);
return;
}
if (portPtr == NULL) portPtr = &defPort; /* use default port if null */
thePort = portPtr; /* Place in GRAFIX_DATA:thePort */
grafPort = *portPtr; /* Copy thePort to grafPort shadow */
PortBitmap(portPtr->portMap); /* reset bitmap */
mwGblCoord(); /* update coordinate xform data */
mwGblPen(); /* update LocX, LocY in global coords */
PenColor(grafPort.pnColor); /* reset pen color */
PenMode(grafPort.pnMode); /* reset pen mode */
SETLINESTYLE(grafPort.pnFlags); /* refresh current line style vector */
PlaneMask(grafPort.portMask); /* reset plane mask */
grafBlit.blitBack = grafPort.bkColor; /* set blit record */
grafBlit.blitPat = grafPort.pnPat;
grafBlit.blitSmap = grafPort.portMap;
grafBlit.blitDmap = grafPort.portMap;
grafBlit.blitPatl = grafPort.portPat;
grafBlit.blitRegn = grafPort.portRegion; /* Set the region clipping info */
if (grafPort.portFlags & pfRgnClip)
{ /* regions enabled - set flag for regions */
grafBlit.blitFlags = grafBlit.blitFlags | bfClipRegn;
}
else
{ /* regions not enabled - clear region flag */
grafBlit.blitFlags = grafBlit.blitFlags & ~bfClipRegn;
}
SetFont((fontRcd *)grafPort.txFont); /* set font */
return;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -