📄 view0.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 */
/* */
/* VIEW0.c 1.9 */
/* */
/* COMPONENT */
/* */
/* All */
/* */
/* DESCRIPTION */
/* */
/* This file contains the mwDFP & InitPort functions. */
/* */
/* AUTHOR */
/* */
/* Robert G. Burrill, Accelerated Technology, Inc. */
/* */
/* DATA STRUCTURES */
/* */
/* None */
/* */
/* FUNCTIONS */
/* */
/* None */
/* */
/* DEPENDENCIES */
/* */
/* None */
/* */
/* HISTORY */
/* */
/* NAME DATE REMARKS */
/* */
/* BobB 11/16/99 Got rid of ANSI compiler warnings */
/* */
/*************************************************************************/
#include "meta_wnd.h"
#include "metconst.h" /* MetaWINDOW Constant & Stucture Definitions */
#include "metports.h" /* MetaWINDOW Port & Bitmap Definitions */
#include "grafdata.h"
/* Function mwDFP set the pen default values. Any and all changes will
happen here to avoid system sync problems. Notice that this module
assumes the relevant pen data areas in the grafPort have been zeroed. */
void mwDFP(metaPort *penPort)
{
/* Manually set the non zero pen fields */
penPort->pnPat = 1; /* solidOn */
penPort->pnFlags = pnShapeFlg; /* default pen to square */
penPort->pnColor = -1; /* white */
penPort->pnDashRcd = &DashTable[0]; /* default dash style records */
return;
}
/* Function InitPort initializes the specified MetaPort, argPORT, and makes
it the current port. The port fields are initialized as follows:
NAME TYPE INITIAL SETTING
------- ------- -------------------------------------
portMap farptr default grafMap
portRect rect default grafMap limits
portOrgn point (0,0)
portVirt rect default grafMap limits
portClip rect default grafMap limits
portRgn farptr nil (0)
portPat farptr default pattern list
portMask long -1 = all enabled
portU2GP void *() Ptr to mwVTOGP routine
portU2GR void *() Ptr to mwVTOGR routine
portG2UP void *() Ptr to Gbl2UsrP()
portG2UR void *() Ptr to Gbl2UsrR()
portFlags short origin upperleft
bkPat long 0 = solid back color
bkColor long 0
pnColor long -1
pnLoc point (0,0)
pnSize point (0,0) = thin
pnMode short 0 = replace
pnPat long 1 = solid pen color
pnCap short 0 = flat
pnJoin short 0 = round
pnLevel short 0 = visible
pnFlags short pnShapeFlg = square
pnDash short 0 = solid
pnDashRcd farptr default dash list
txFont farptr default font buffer
txFace short 0 = normal
txMode short 0 = replace
txSpace short 0
txBold short 1
txScore short 1
txUnder short 1
txAngle short 340.0 (-20.0) */
void InitPort(metaPort *argPORT)
{
void SetPort(metaPort *portPtr);
void mwV2GP();
void mwV2GR();
void mwG2VP();
void mwG2VR();
long *portAdrs;
int i;
int portSize;
/* Zero all port fields */
portSize = sizeof(metaPort) >> 2;
portAdrs = (long *) argPORT;
for (i = 0; i < portSize; i++)
{
*portAdrs++ = 0;
}
/* Now set up the port */
argPORT->portMap = &defGrafMap;
argPORT->portPat = &patTable;
/* set portRect, portClip, virtRect to grafMap limits */
/* BobB 10/22/99 - corrected tthe following
argPORT->portRect.Xmax = defGrafMap.pixWidth - 1;
argPORT->portClip.Xmax = defGrafMap.pixWidth - 1;
argPORT->portVirt.Xmax = defGrafMap.pixWidth - 1;
argPORT->portRect.Ymax = defGrafMap.pixHeight - 1;
argPORT->portClip.Ymax = defGrafMap.pixHeight - 1;
argPORT->portVirt.Ymax = defGrafMap.pixHeight - 1; */
argPORT->portRect.Xmax = defGrafMap.pixWidth;
argPORT->portClip.Xmax = defGrafMap.pixWidth;
argPORT->portVirt.Xmax = defGrafMap.pixWidth;
argPORT->portRect.Ymax = defGrafMap.pixHeight;
argPORT->portClip.Ymax = defGrafMap.pixHeight;
argPORT->portVirt.Ymax = defGrafMap.pixHeight;
/* set upper left, rect clip on */
argPORT->portFlags = pfUpper | pfRecClip;
/* set default virtual coordinate routines */
argPORT->portU2GP = &mwV2GP;
argPORT->portU2GR = &mwV2GR;
argPORT->portG2UP = &mwG2VP;
argPORT->portG2UR = &mwG2VR;
/* set default marker data */
argPORT->mkSize.X = 1;
argPORT->mkSize.Y = 1;
argPORT->txBold = 1;
argPORT->txUnder = 1;
argPORT->txScore = 1;
argPORT->txSlant = 3400;
/* set font to default font buffer */
argPORT->txFont = (long) defFont;
argPORT->portMask = 0xFFFFFFFF;
mwDFP(argPORT); /* Set the pen default values */
SetPort(argPORT); /* Update system */
return;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -