From: tmoran@acm.org
Subject: re: ada and mouse
Date: Fri, 31 May 2002 21:53:53 GMT
Date: 2002-05-31T21:53:53+00:00 [thread overview]
Message-ID: <RhSJ8.1444$9w7.230361117@newssvr13.news.prodigy.com> (raw)
In-Reply-To: ad7pgu$jic$1@news2adm.admin.in.none.net
> how using mouse in ada83 ?
> please, send me an exemple.
Here's the spec for a 16 bit DOS mouse interface using Janus Ada 83.
I'll e-mail the body if you want.
with System;
package Mouse is
-- low level mouse driver interface
-- uses int33 functions
-- 16#00#: reset
-- 16#01#: show cursor
-- 16#02#: hide cursor
-- 16#03#: get mouse position and button status
-- 16#04#: set mouse cursor position
-- 16#07#: set min/max horizontal position
-- 16#08#: set min/max vertical position
-- 16#09#: set graphics cursor block
-- This is set True or False by calls on Reset.
-- There is an automatic call on Reset at package initialization time.
-- All mouse operations are NOPs if not Driver_Present
Driver_Present: Boolean := False;
type State is record
X,
Y : Integer;
Left_Button,
Middle_Button,
Right_Button: Boolean;
end record;
-- x,y measured in mickeys
-- button flags are true iff button is currently depressed
Current : State := (X | Y => 0,
Left_Button | Middle_Button | Right_Button => False);
procedure Check; -- updates Current
-- The public record 'current' is used, rather than having 'out'
-- parameters to the 'check' routine, for simplicity and efficiency.
-- There is no way with this interface to have more than one mouse
-- per OS task, so the generality of out parameters, or a generic
-- mouse package, would be spurious.
procedure Reset;
procedure Hide_Cursor;
procedure Show_Cursor;
procedure Horizontal_Range(Min,
Max : in Natural);
procedure Vertical_Range(Min,
Max : in Natural);
type Graphic_Cursor_Bits is array (Integer range <>) of System.Word;
subtype Normal_Graphic_Cursor_Bits is Graphic_Cursor_Bits(0 .. 15);
subtype Hot_Spot_Offsets is Integer range - 16 .. 16;
procedure Set_Graphic_Cursor_Words(Screen_Mask: in Graphic_Cursor_Bits;
Cursor_Mask: in Graphic_Cursor_Bits;
X_Hot_Spot : in Hot_Spot_Offsets;
Y_Hot_Spot : in Hot_Spot_Offsets);
procedure Set_Cursor_Position(X,
Y : in Integer);
end Mouse;
prev parent reply other threads:[~2002-05-31 21:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-31 12:15 ada and mouse tony
2002-05-31 17:57 ` Larry Kilgallen
2002-05-31 21:53 ` tmoran [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox