Files
harbour-core/harbour/contrib/hbnf/mouse.c
Viktor Szakats 7df0d4b153 2010-07-14 14:52 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbnf/acctyear.prg
  * contrib/hbnf/byteneg.prg
  * contrib/hbnf/isshare.prg
  * contrib/hbnf/sinkey.prg
  * contrib/hbnf/kspeed.c
  * contrib/hbnf/prtscr.c
  * contrib/hbnf/descendn.c
  * contrib/hbnf/peek.c
  * contrib/hbnf/scancode.prg
  * contrib/hbnf/vidmode.prg
  * contrib/hbnf/nwsem.prg
  * contrib/hbnf/acctadj.prg
  * contrib/hbnf/week.prg
  * contrib/hbnf/vidcur.prg
  * contrib/hbnf/iamidle.c
  * contrib/hbnf/miltime.prg
  * contrib/hbnf/prtesc.prg
  * contrib/hbnf/acctmnth.prg
  * contrib/hbnf/proper.c
  * contrib/hbnf/savearr.prg
  * contrib/hbnf/madd.prg
  * contrib/hbnf/rand1.prg
  * contrib/hbnf/dispmsg.prg
  * contrib/hbnf/fttext.c
  * contrib/hbnf/mouse1.prg
  * contrib/hbnf/settime.prg
  * contrib/hbnf/page.prg
  * contrib/hbnf/restsets.prg
  * contrib/hbnf/byt2bit.prg
  * contrib/hbnf/setkeys.c
  * contrib/hbnf/month.prg
  * contrib/hbnf/byt2hex.prg
  * contrib/hbnf/findith.prg
  * contrib/hbnf/at2.prg
  * contrib/hbnf/acctweek.prg
  * contrib/hbnf/dispc.c
  * contrib/hbnf/gcd.prg
  * contrib/hbnf/pegs.prg
  * contrib/hbnf/min2dhm.prg
  * contrib/hbnf/acctqtr.prg
  * contrib/hbnf/numlock.c
  * contrib/hbnf/dosver.prg
  * contrib/hbnf/nooccur.prg
  * contrib/hbnf/dayofyr.prg
  * contrib/hbnf/metaph.prg
  * contrib/hbnf/ontick.c
  * contrib/hbnf/menu1.prg
  * contrib/hbnf/byteand.prg
  * contrib/hbnf/sqzn.prg
  * contrib/hbnf/bytexor.prg
  * contrib/hbnf/ftidle.c
  * contrib/hbnf/workdays.prg
  * contrib/hbnf/byteor.prg
  * contrib/hbnf/asum.prg
  * contrib/hbnf/shift.c
  * contrib/hbnf/sleep.prg
  * contrib/hbnf/wda.prg
  * contrib/hbnf/woy.prg
  * contrib/hbnf/aavg.prg
  * contrib/hbnf/any2any.prg
  * contrib/hbnf/origin.c
  * contrib/hbnf/mouse.c
  * contrib/hbnf/chdir.c
  * contrib/hbnf/adessort.prg
  * contrib/hbnf/setdate.prg
  * contrib/hbnf/netpv.prg
  * contrib/hbnf/amedian.prg
  * contrib/hbnf/blink.prg
  * contrib/hbnf/stod.c
  * contrib/hbnf/vertmenu.prg
  * contrib/hbnf/linked.prg
  * contrib/hbnf/qtr.prg
  * contrib/hbnf/aredit.prg
  * contrib/hbnf/n2color.c
  * contrib/hbnf/alt.c
  * contrib/hbnf/xbox.prg
  * contrib/hbnf/ftround.prg
  * contrib/hbnf/hex2dec.prg
  * contrib/hbnf/getver.c
  * contrib/hbnf/nwuid.prg
  * contrib/hbnf/dectobin.prg
  * contrib/hbnf/aemaxlen.prg
  * contrib/hbnf/bitset.prg
  * contrib/hbnf/nwlstat.prg
  * contrib/hbnf/invclr.prg
  * contrib/hbnf/ctrl.c
  * contrib/hbnf/popadder.prg
  * contrib/hbnf/lastday.prg
  * contrib/hbnf/tempfile.prg
  * contrib/hbnf/diskfunc.prg
  * contrib/hbnf/scregion.prg
  * contrib/hbnf/d2e.prg
  * contrib/hbnf/mouse2.prg
  * contrib/hbnf/ftisprn.c
  * contrib/hbnf/pickday.prg
  * contrib/hbnf/firstday.prg
  * contrib/hbnf/daytobow.prg
  * contrib/hbnf/anomatch.prg
  * contrib/hbnf/menutonf.prg
  * contrib/hbnf/ftattr.c
  * contrib/hbnf/pvid.prg
  * contrib/hbnf/isbiton.prg
  * contrib/hbnf/color2n.c
  * contrib/hbnf/isbit.prg
  * contrib/hbnf/datecnfg.prg
  * contrib/hbnf/cntryset.prg
  * contrib/hbnf/putkey.c
  * contrib/hbnf/getenvrn.c
  * contrib/hbnf/easter.prg
  * contrib/hbnf/bytenot.prg
  * contrib/hbnf/ntow.prg
  * contrib/hbnf/aeminlen.prg
  * contrib/hbnf/poke.c
  * contrib/hbnf/floptst.prg
  * contrib/hbnf/pchr.prg
  * contrib/hbnf/savesets.prg
  * contrib/hbnf/tbwhile.prg
  * contrib/hbnf/mkdir.c
  * contrib/hbnf/year.prg
  * contrib/hbnf/caplock.c
  * contrib/hbnf/rmdir.c
  * contrib/hbnf/calendar.prg
  * contrib/hbnf/e2d.prg
  * contrib/hbnf/elapsed.prg
  * contrib/hbnf/sysmem.prg
  * contrib/hbnf/bitclr.prg
  * contrib/hbnf/eltime.prg
  * contrib/hbnf/aading.prg
  * contrib/hbnf/dfile.prg
  * contrib/hbnf/elapmil.prg
  * contrib/hbnf/setlastk.c
  * contrib/hbnf/pending.prg
  * contrib/hbnf/clrsel.prg
    - Stripped NFDOC/HBDOC from source code.
2010-07-14 12:57:05 +00:00

517 lines
10 KiB
C

/*
* $Id$
*/
/*
* Harbour Project source code
*
* mouse.c Support functions for Nanfor Library
*
* Copyright 2000 Luiz Rafael Culik <Culik@sl.conex.net>
* www - http://harbour-project.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
*
* As a special exception, the Harbour Project gives permission for
* additional uses of the text contained in its release of Harbour.
*
* The exception is that, if you link the Harbour libraries with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the Harbour library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the Harbour
* Project under the name Harbour. If you copy code from other
* Harbour Project or Free Software Foundation releases into a copy of
* Harbour, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for Harbour, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*
*/
#include "hbapi.h"
#if defined( HB_OS_DOS )
#include "dos.h"
#endif
#include "hbapiitm.h"
#include "hbapigt.h"
HB_FUNC( _MGET_PAGE )
{
int iPage;
#if defined( HB_OS_DOS )
{
union REGS regs;
regs.HB_XREGS.ax = 0x1E;
HB_DOS_INT86( 0x33, &regs, &regs );
iPage = regs.HB_XREGS.bx;
}
#else
{
iPage = 0;
}
#endif
hb_retni( iPage );
}
HB_FUNC( _MSET_PAGE )
{
#if defined( HB_OS_DOS )
{
union REGS regs;
regs.HB_XREGS.ax = 0x1D;
regs.HB_XREGS.bx = hb_parni( 1 );
HB_DOS_INT86( 0x33, &regs, &regs );
}
#endif
}
HB_FUNC( _MGET_MVERSION )
{
int iMinor;
int iType;
int iIRQ;
int iMajor;
#if defined( HB_OS_DOS )
{
union REGS regs;
regs.HB_XREGS.ax = 0x24;
HB_DOS_INT86( 0x33, &regs, &regs );
iMinor = regs.h.bl;
iType = regs.h.ch;
iIRQ = regs.h.cl;
iMajor = regs.h.bh;
}
#else
{
iMinor = 0;
iType = 0;
iIRQ = 0;
iMajor = 0;
}
#endif
{
PHB_ITEM pArray = hb_itemArrayNew( 4 );
hb_arraySetNI( pArray, 1, iMinor );
hb_arraySetNI( pArray, 2, iType );
hb_arraySetNI( pArray, 3, iIRQ );
hb_arraySetNI( pArray, 4, iMajor );
hb_itemReturnRelease( pArray );
}
}
HB_FUNC( _MGET_HORISPEED )
{
int iSpeed;
#if defined( HB_OS_DOS )
{
union REGS regs;
regs.HB_XREGS.ax = 0x1B;
HB_DOS_INT86( 0x33, &regs, &regs );
iSpeed = regs.HB_XREGS.bx;
}
#else
{
iSpeed = 0;
}
#endif
hb_retni( iSpeed );
}
HB_FUNC( _MGET_VERSPEED )
{
int iSpeed;
#if defined( HB_OS_DOS )
{
union REGS regs;
regs.HB_XREGS.ax = 0x1B;
HB_DOS_INT86( 0x33, &regs, &regs );
iSpeed = regs.HB_XREGS.cx;
}
#else
{
iSpeed = 0;
}
#endif
hb_retni( iSpeed );
}
HB_FUNC( _MGET_DOUBLESPEED )
{
int iSpeed;
#if defined( HB_OS_DOS )
{
union REGS regs;
regs.HB_XREGS.ax = 0x1B;
HB_DOS_INT86( 0x33, &regs, &regs );
iSpeed = regs.HB_XREGS.dx;
}
#else
{
iSpeed = 0;
}
#endif
hb_retni( iSpeed );
}
HB_FUNC( _MSET_SENSITIVE ) /* nHoriz,nVert,nDouble) */
{
#if defined( HB_OS_DOS )
{
union REGS regs;
regs.HB_XREGS.ax = 0x1A;
regs.HB_XREGS.bx = hb_parni( 1 );
regs.HB_XREGS.cx = hb_parni( 2 );
regs.HB_XREGS.dx = hb_parni( 3 );
HB_DOS_INT86( 0x33, &regs, &regs );
}
#endif
}
HB_FUNC( _MSE_CONOFF ) /* nTop*8,nLeft*8,nBotton*8,nRight*8) */
{
#if defined( HB_OS_DOS )
{
union REGS regs;
regs.HB_XREGS.ax = 0x1A;
regs.HB_XREGS.cx = hb_parni( 2 );
regs.HB_XREGS.dx = hb_parni( 1 );
regs.HB_XREGS.si = hb_parni( 4 );
regs.HB_XREGS.di = hb_parni( 3 );
HB_DOS_INT86( 0x33, &regs, &regs );
}
#endif
}
HB_FUNC( _MGET_MICS )
{
int iHori;
int iVert;
#if defined( HB_OS_DOS )
{
union REGS regs;
regs.HB_XREGS.ax = 0x0B;
HB_DOS_INT86( 0x33, &regs, &regs );
iHori = regs.HB_XREGS.cx;
iVert = regs.HB_XREGS.dx;
}
#else
{
iHori = 0;
iVert = 0;
}
#endif
{
PHB_ITEM pArray = hb_itemArrayNew( 2 );
hb_arraySetNI( pArray, 1, iHori );
hb_arraySetNI( pArray, 2, iVert );
hb_itemReturnRelease( pArray );
}
}
HB_FUNC( _M_RESET )
{
int iMouse;
#if defined( HB_OS_DOS )
{
union REGS regs;
regs.HB_XREGS.ax = 0;
HB_DOS_INT86( 0x33, &regs, &regs );
iMouse = regs.HB_XREGS.ax;
}
#else
{
iMouse = 0;
}
#endif
{
hb_retl( iMouse );
}
}
HB_FUNC( _MSE_SHOWCURS )
{
#if defined( HB_OS_DOS )
{
union REGS regs;
regs.HB_XREGS.ax = 1;
HB_DOS_INT86( 0x33, &regs, &regs );
}
#endif
}
HB_FUNC( _MSE_MHIDECRS )
{
#if defined( HB_OS_DOS )
{
union REGS regs;
regs.HB_XREGS.ax = 2;
HB_DOS_INT86( 0x33, &regs, &regs );
}
#endif
}
HB_FUNC( _MSE_GETPOS )
{
int iHori;
int iVert;
#if defined( HB_OS_DOS )
{
union REGS regs;
regs.HB_XREGS.ax = 3;
HB_DOS_INT86( 0x33, &regs, &regs );
iHori = regs.HB_XREGS.cx;
iVert = regs.HB_XREGS.dx;
}
#else
{
iHori = 0;
iVert = 0;
}
#endif
{
PHB_ITEM pArray = hb_itemArrayNew( 2 );
hb_arraySetNI( pArray, 1, iHori );
hb_arraySetNI( pArray, 2, iVert );
hb_itemReturnRelease( pArray );
}
}
HB_FUNC( _M_GETX )
{
int iRow;
#if defined( HB_OS_DOS )
{
union REGS regs;
regs.HB_XREGS.ax = 3;
HB_DOS_INT86( 0x33, &regs, &regs );
iRow = regs.HB_XREGS.dx;
}
#else
{
iRow = 0;
}
#endif
hb_retni( iRow );
}
HB_FUNC( _M_GETY )
{
int iCol;
#if defined( HB_OS_DOS )
{
union REGS regs;
regs.HB_XREGS.ax = 3;
HB_DOS_INT86( 0x33, &regs, &regs );
iCol = regs.HB_XREGS.cx;
}
#else
{
iCol = 0;
}
#endif
hb_retni( iCol );
}
HB_FUNC( _M_MSETPOS )
{
#if defined( HB_OS_DOS )
{
union REGS regs;
regs.HB_XREGS.ax = 4;
regs.HB_XREGS.cx = hb_parni( 1 );
regs.HB_XREGS.dx = hb_parni( 2 );
HB_DOS_INT86( 0x33, &regs, &regs );
}
#endif
}
HB_FUNC( _M_MSETCOORD )
{
#if defined( HB_OS_DOS )
{
union REGS regs;
regs.HB_XREGS.ax = 4;
regs.HB_XREGS.cx = hb_parni( 1 );
regs.HB_XREGS.dx = hb_parni( 2 );
HB_DOS_INT86( 0x33, &regs, &regs );
}
#endif
}
HB_FUNC( _M_MXLIMIT )
{
#if defined( HB_OS_DOS )
{
union REGS regs;
int iMaxRow = hb_parni( 2 );
int iMinRow = hb_parni( 1 );
regs.HB_XREGS.ax = 7;
regs.HB_XREGS.cx = iMinRow;
regs.HB_XREGS.dx = iMaxRow;
HB_DOS_INT86( 0x33, &regs, &regs );
}
#endif
}
HB_FUNC( _M_MYLIMIT )
{
#if defined( HB_OS_DOS )
{
union REGS regs;
int iMaxCol = hb_parni( 2 );
int iMinCol = hb_parni( 1 );
regs.HB_XREGS.ax = 8;
regs.HB_XREGS.cx = iMinCol;
regs.HB_XREGS.dx = iMaxCol;
HB_DOS_INT86( 0x33, &regs, &regs );
}
#endif
}
HB_FUNC( _M_MBUTPRS )
{
int inX;
int inY;
int inButton;
int lStatus;
#if defined( HB_OS_DOS )
{
union REGS regs;
regs.HB_XREGS.ax = 6;
regs.HB_XREGS.bx = hb_parni( 1 );
HB_DOS_INT86( 0x33, &regs, &regs );
inY = regs.HB_XREGS.cx;
inX = regs.HB_XREGS.dx;
inButton = regs.HB_XREGS.bx;
lStatus = regs.HB_XREGS.ax;
}
#else
{
inY = 0;
inX = 0;
inButton = 0;
lStatus = 0;
}
#endif
{
PHB_ITEM pArray = hb_itemArrayNew( 4 );
hb_arraySetNI( pArray, 1, inButton ); /* NOTE: I've changed 1 to 3 */
hb_arraySetNI( pArray, 2, inX );
hb_arraySetNI( pArray, 3, inY );
hb_arraySetNI( pArray, 4, lStatus ); /* NOTE: I've changed 1 to 3 */
hb_itemReturnRelease( pArray );
}
}
HB_FUNC( _M_MBUTREL )
{
#if defined( HB_OS_DOS )
union REGS regs;
regs.HB_XREGS.ax = 0x0A;
regs.HB_XREGS.bx = hb_parni( 1 );
HB_DOS_INT86( 0x33, &regs, &regs );
hb_reta( 4 );
hb_storvni( regs.HB_XREGS.bx, -1, 1 );
hb_storvni( regs.HB_XREGS.cx, -1, 2 );
hb_storvni( regs.HB_XREGS.dx, -1, 3 );
hb_storvni( regs.HB_XREGS.ax, -1, 4 );
#else
hb_reta( 4 );
hb_storvni( 0, -1, 1 );
hb_storvni( 0, -1, 2 );
hb_storvni( 0, -1, 3 );
hb_storvni( 0, -1, 4 );
#endif
}
HB_FUNC( _M_MDEFCRS )
{
#if defined( HB_OS_DOS )
{
union REGS regs;
regs.HB_XREGS.ax = 0x0A;
regs.HB_XREGS.bx = hb_parni( 1 );
regs.HB_XREGS.cx = hb_parni( 2 );
regs.HB_XREGS.dx = hb_parni( 3 );
HB_DOS_INT86( 0x33, &regs, &regs );
}
#endif
}
HB_FUNC( _M_MGETCOORD )
{
int inX;
int inY;
int inButton;
#if defined( HB_OS_DOS )
{
union REGS regs;
regs.HB_XREGS.ax = 3;
HB_DOS_INT86( 0x33, &regs, &regs );
inButton = regs.HB_XREGS.bx;
inY = regs.HB_XREGS.cx;
inX = regs.HB_XREGS.dx;
}
#else
{
inX = 0;
inY = 0;
inButton = 0;
}
#endif
{
PHB_ITEM pArray = hb_itemArrayNew( 3 );
hb_arraySetNI( pArray, 1, inX );
hb_arraySetNI( pArray, 2, inY );
hb_arraySetNI( pArray, 3, inButton );
hb_itemReturnRelease( pArray );
}
}