Súbor: [Platon] / games / _shared / mouse-x11.c (stiahnutie)
Revízia 1.4, Tue Apr 6 09:54:16 2004 UTC (20 years ago) by nepto
Zmeny od 1.3: +12 -5
[lines]
Headers update:
- switch to standard/classic Platon SDG source header
- bumped copyright year to 2004
- changelog dates reformatted to new format YYYY-MM-DD
|
/*
* games/_shared/ - shared routines for games
*
* mouse-x11.c - X11 (X Windows System) mouse handler
* ____________________________________________________________
*
* Developed by Ondrej Jombik <nepto@platon.sk>
* Copyright (c) 2003-2004 Platon SDG, http://platon.sk/
* All rights reserved.
*
* See README file for more information about this software.
* See COPYING file for license information.
*
* Download the latest version from
* http://platon.sk/projects/games/
*
* Changelog:
* 2003-08-12 - created
*/
/* $Platon: games/_shared/mouse-x11.c,v 1.3 2003/10/27 09:52:10 nepto Exp $ */
#include <macros.h>
#include <dos2linux.h>
#include <x11-bgi.h>
#include "mouse.h"
void mouse_status_update(void) /* {{{ */
{
X11_BGI_update_IO();
MOUINFO_xpos = max(0, MOUINFO_xpos);
MOUINFO_ypos = max(0, MOUINFO_ypos);
} /* }}} */
BYTE initmouse(void) /* {{{ */
{
MOUINFO_xpos = 0;
MOUINFO_ypos = 0;
MOUINFO_bstat = 0;
MOUINFO_pressed_count [0] = MOUINFO_pressed_count [1] = MOUINFO_pressed_count [2] = 0;
MOUINFO_released_count[0] = MOUINFO_released_count[1] = MOUINFO_released_count[2] = 0;
return 2;
} /* }}} */
void showmouse(void) /* {{{ */
{
return;
} /* }}} */
void hidemouse(void) /* {{{ */
{
return;
} /* }}} */
BYTE getmousepos(WORD *x, WORD *y) /* {{{ */
{
mouse_status_update();
if (x != NULL) *x = (WORD) MOUINFO_xpos;
if (y != NULL) *y = (WORD) MOUINFO_ypos;
return MOUINFO_bstat;
} /* }}} */
void setmousepos(WORD x, WORD y) /* {{{ */
{
MOUINFO_xpos = x;
MOUINFO_ypos = y;
return;
} /* }}} */
BYTE pressbutton(BYTE but, WORD *x, WORD *y) /* {{{ */
{
register BYTE ret;
mouse_status_update();
if (but > 2) {
ret = 0;
} else {
ret = MOUINFO_pressed_count[but];
MOUINFO_pressed_count[but] = 0;
}
if (x != NULL) *x = MOUINFO_xpos;
if (y != NULL) *y = MOUINFO_ypos;
return ret;
} /* }}} */
BYTE releasebutton(BYTE but, WORD *x, WORD*y) /* {{{ */
{
register BYTE ret;
mouse_status_update();
if (but > 2) {
ret = 0;
} else {
ret = MOUINFO_released_count[but];
MOUINFO_released_count[but] = 0;
}
if (x != NULL) *x = MOUINFO_xpos;
if (y != NULL) *y = MOUINFO_ypos;
return ret;
} /* }}} */
void rangex(WORD a_min, WORD a_max) /* {{{ */
{
return;
} /* }}} */
void rangey(WORD a_min, WORD a_max) /* {{{ */
{
return;
} /* }}} */
void setmousecur(WORD x, WORD y, void *p) /* {{{ */
{
return;
} /* }}} */
void exclude(WORD x1, WORD y1, WORD x2, WORD y2) /* {{{ */
{
return;
} /* }}} */
void mousesensitive(WORD x, WORD y) /* {{{ */
{
return;
} /* }}} */
void setmousespeed(WORD speed) /* {{{ */
{
return;
} /* }}} */
/* Modeline for ViM {{{
* vim: set ts=4:
* vim600: fdm=marker fdl=0 fdc=0:
* }}} */
Platon Group <platon@platon.sk> http://platon.sk/
|