~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to rtl/inc/mouseh.inc

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{
2
 
    $Id: mouseh.inc,v 1.3 2002/09/07 15:07:45 peter Exp $
3
 
    This file is part of the Free Pascal run time library.
4
 
    Copyright (c) 1999-2000 by the Free Pascal development team
5
 
 
6
 
    See the file COPYING.FPC, included in this distribution,
7
 
    for details about the copyright.
8
 
 
9
 
    This program is distributed in the hope that it will be useful,
10
 
    but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
 
 
13
 
 **********************************************************************}
14
 
 
15
 
const
16
 
  { We have an errorcode base of 1030 }
17
 
  errMouseBase                    = 1030;
18
 
  errMouseInitError               = errMouseBase + 0;
19
 
  errMouseNotImplemented          = errMouseBase + 1;
20
 
 
21
 
type
22
 
  PMouseEvent=^TMouseEvent;
23
 
  TMouseEvent=packed record { 8 bytes }
24
 
    buttons : word;
25
 
    x,y     : word;
26
 
    Action  : word;
27
 
  end;
28
 
 
29
 
const
30
 
  MouseActionDown = $0001;                         { Mouse down event }
31
 
  MouseActionUp   = $0002;                         { Mouse up event }
32
 
  MouseActionMove = $0004;                         { Mouse move event }
33
 
 
34
 
  MouseLeftButton   = $01;                         { Left mouse button }
35
 
  MouseRightButton  = $02;                         { Right mouse button }
36
 
  MouseMiddleButton = $04;                         { Middle mouse button }
37
 
 
38
 
  MouseEventBufSize = 16;                { Size of event queue }
39
 
 
40
 
var
41
 
  MouseIntFlag : Byte;                                { Mouse in int flag }
42
 
  MouseButtons : Byte;                                { Mouse button state }
43
 
  MouseWhereX,
44
 
  MouseWhereY  : Word;                                { Mouse position }
45
 
 
46
 
Type
47
 
  TMouseDriver = Record
48
 
    UseDefaultQueue : Boolean;
49
 
    InitDriver : Procedure;
50
 
    DoneDriver : Procedure;
51
 
    DetectMouse : Function : Byte;
52
 
    ShowMouse : Procedure;
53
 
    HideMouse : Procedure;
54
 
    GetMouseX : Function : Word;
55
 
    GetMouseY : Function : Word;
56
 
    GetMouseButtons : Function : Word;
57
 
    SetMouseXY : procedure (x,y:word);
58
 
    GetMouseEvent : procedure (var MouseEvent:TMouseEvent);
59
 
    PollMouseEvent : function (var MouseEvent: TMouseEvent):boolean;
60
 
    PutMouseEvent : procedure (Const MouseEvent:TMouseEvent);
61
 
  end;
62
 
 
63
 
procedure InitMouse;
64
 
{ Initialize the mouse interface }
65
 
 
66
 
procedure DoneMouse;
67
 
{ Deinitialize the mouse interface }
68
 
 
69
 
function DetectMouse:byte;
70
 
{ Detect if a mouse is present, returns the amount of buttons or 0
71
 
  if no mouse is found }
72
 
 
73
 
procedure ShowMouse;
74
 
{ Show the mouse cursor }
75
 
 
76
 
procedure HideMouse;
77
 
{ Hide the mouse cursor }
78
 
 
79
 
function GetMouseX:word;
80
 
{ Return the current X position of the mouse }
81
 
 
82
 
function GetMouseY:word;
83
 
{ Return the current Y position of the mouse }
84
 
 
85
 
function GetMouseButtons:word;
86
 
{ Return the current button state of the mouse }
87
 
 
88
 
procedure SetMouseXY(x,y:word);
89
 
{ Place the mouse cursor on x,y }
90
 
 
91
 
procedure GetMouseEvent(var MouseEvent:TMouseEvent);
92
 
{ Returns the last Mouseevent, and waits for one if not available }
93
 
 
94
 
procedure PutMouseEvent(const MouseEvent: TMouseEvent);
95
 
{ Adds the given MouseEvent to the input queue. Please note that depending on
96
 
  the implementation this can hold only one value (NO FIFOs etc) }
97
 
 
98
 
function PollMouseEvent(var MouseEvent: TMouseEvent):boolean;
99
 
{ Checks if a Mouseevent is available, and returns it if one is found. If no
100
 
  event is pending, it returns 0 }
101
 
 
102
 
Procedure SetMouseDriver(Const Driver : TMouseDriver);
103
 
{ Sets the mouse driver. }
104
 
 
105
 
Procedure GetMouseDriver(Var Driver : TMouseDriver);
106
 
{ Returns the currently active mouse driver }
107
 
 
108
 
{
109
 
  $Log: mouseh.inc,v $
110
 
  Revision 1.3  2002/09/07 15:07:45  peter
111
 
    * old logs removed and tabs fixed
112
 
 
113
 
}