📄 curs9.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 */
/* */
/* CURS9.c 1.9 */
/* */
/* COMPONENT */
/* */
/* All */
/* */
/* DESCRIPTION */
/* */
/* This file contains the TrackCursor & QueryCursor functions. */
/* */
/* 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 "metmacs3.h"
#include "curs_ega.h"
/* Function TrackCursor enables and disables cursor tracking of the current
input device. When cursor tracking is enabled (TrackCursor(TRUE)), the cursor
position is automatically updated to follow input movement. If cursor
tracking is disabled (TrackCursor(FALSE)), Input device movement has no
effect on the cursor position. */
void TrackCursor(int argTF)
{
short tmpIMPOSN;
long memPntr;
void mwTracker(void);
/* void mwMoveCursor(void);*/
void nuMoveCursor(int gblX, int gblY);
void HideCursor(void);
/* void mwMoveCurEGA(); */
void mwRDIMA(grafMap * rdiBmap, image *dstImage, int gblYmax, int gblXmax,
int gblYmin, int gblXmin);
void mwWRIMA(blitRcd *blitRec);
void mwWRIMMA(blitRcd *blitRec);
#ifndef REMOVE_8514
void mwRDIM8(void);
void mwWRIM8(void);
void mwWRIMM8(void);
#endif
#ifndef REMOVE_16BIT
void mwRDIM6(void);
void mwWRIM6(void);
void mwWRIMM6(void);
#endif
void InitBankMgr(grafMap *argGRAFMAP);
if(argTF == 0) /* if false, turn off tracking */
{
gFlags &= ~gfTrkEnab; /* Flag tracking disabled */
return;
}
gFlags &= ~gfTrkEnab; /* disable tracking while we muck */
TrackIDV = mwTracker; /* install indirect vector for input device
call backs to get a tracking routine */
MovCursIDV = nuMoveCursor; /* install indirect vector for resuming grafMap
callbacks to get a move cursor routine */
curTrack = curInput; /* set current input device as the tracking device */
if (!(curInput->mrFlags & mrOpenedSig)) return;; /* ignore this call if
input device was never opened? */
curInput->mrEvent.evntX = CursorX; /* Sync the input device to the cursor */
curInput->mrEvent.evntY = CursorY; /* position */
tmpIMPOSN = IMPOSN;
tmpIMPOSN = CallmrInputMgr(curInput, tmpIMPOSN);
#if CPU386 /* lock memory used by Tracking */
memPntr = (long) &ISR_STACK; /* lock grafdata */
CallmwLockMem(memPntr, 12000);
memPntr = (long) (cursBlit.blitDmap->mapTable); /* lock rowtable */
#ifdef FIXUP386
memPntr -= dllFixup; /* unfixup pointer */
#endif
CallmwLockMem(memPntr, 0x1100);
memPntr = (long) mwTracker; /* lock mwTracker in this module */
CallmwLockMem(memPntr, 1000);
memPntr = (long) HideCursor; /* lock mwMoveCursor, HideCursor, ShowCursor */
CallmwLockMem(memPntr, 1300);
/* memPntr = (long) mwMoveCurEGA;*/ /* lock mwMoveCurEGA */
/* CallmwLockMem(memPntr, 4500);*/
/* lock read image and write image primitives
we have no idea where the component parts of the primitives will be
located in the link, so we must explicitly lock down address */
memPntr = (long) mwRDIMA;
CallmwLockMem(memPntr, 1000);
memPntr = (long) mwWRIMA;
CallmwLockMem(memPntr, 3000);
memPntr = (long) mwWRIMMA;
CallmwLockMem(memPntr, 15000);
#ifndef REMOVE_8514
memPntr = (long) mwRDIM8;
CallmwLockMem(memPntr, 1000);
memPntr = (long) mwWRIM8;
CallmwLockMem(memPntr, 1000);
memPntr = (long) mwWRIMM8;
CallmwLockMem(memPntr, 1000);
#endif
#ifndef REMOVE_16BIT
memPntr = (long) mwRDIM6;
CallmwLockMem(memPntr, 2000);
memPntr = (long) mwWRIM6;
CallmwLockMem(memPntr, 2000);
memPntr = (long) mwWRIMM6;
CallmwLockMem(memPntr, 3000);
#endif
#endif
memPntr = (long) InitBankMgr; /* lock bank managers */
CallmwLockMem(memPntr, 5800);
cursBlit.blitDmap->mapLock = 0; /* unlock the cursor grafMap */
gFlags |= gfTrkEnab; /* Flag tracking enabled */
return;
}
/* Function QueryCursor returns the current CURSORX, CURSORY, CURSORLEVEL, and
returns the current tracking devices BUTTON values. */
void QueryCursor(int *argCURXO, int *argCURYO, int *argCURLO, int *argBUTNO)
{
short tempX;
short tempY;
tempX = CursorX;
tempY = CursorY;
*argCURLO = CursorLevel;
if (globalLevel > 0)
{
/* convert from global to user */
G2UP(CursorX, CursorY, &tempX, &tempY);
}
*argCURXO = tempX;
*argCURYO = tempY;
*argBUTNO = 0;
if (gFlags & gfTrkEnab) /* tracking enabled? */
{
*argBUTNO = curTrack->mrEvent.evntButtons;
}
return;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -