view3.c
来自「nucleus 文件系统,内核和彩色图形系统,在小系统上非常好用」· C语言 代码 · 共 93 行
C
93 行
/*************************************************************************/
/* */
/* 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 */
/* */
/* VIEW3.c 1.9 */
/* */
/* COMPONENT */
/* */
/* All */
/* */
/* DESCRIPTION */
/* */
/* This file contains the ClipRect 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"
/* Function ClipRect sets the clipping limits of the current metaPort to the
rectangle specified by cRECT. Rectangle cRECT is defined in the current ports
coordinate system. The port clip rectangle is maintained in LOCAL
co-ordinates.
If cRECT is a null pointer, then the clip rect is disabled (set to the bitmap
limits). */
void ClipRect(rect *cRECT)
{
void Vir2LclRect(rect *argR);
void mwGblClip(metaPort *inpClpPort, rect *outClipR);
rect tmpRect;
if (cRECT == NULL)
{ /* null pointer - make it bitmap limits */
grafPort.portFlags = grafPort.portFlags & ~pfRecClip;
thePort->portFlags = thePort->portFlags & ~pfRecClip;
}
else
{
tmpRect = *cRECT;
if (grafPort.portFlags & pfVirtual)
{ /* convert virtual rect to local */
Vir2LclRect(&tmpRect);
}
grafPort.portClip = tmpRect; /* set shadow port */
grafPort.portFlags |= pfRecClip;
thePort->portClip = tmpRect; /* set user port */
thePort->portFlags |= pfRecClip;
}
mwGblClip(thePort, &tmpRect); /* convert to global and check port clip */
ViewClip = tmpRect;
return;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?