~ubuntu-branches/ubuntu/feisty/fpc/feisty

« back to all changes in this revision

Viewing changes to packages/extra/ptc/keyi.inc

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-01-27 20:08:50 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070127200850-9mrptaqqjsx9nwa7
Tags: 2.0.4-5
* Fixed Build-Depends.
* Add myself to Uploaders in debian/control.
* Make sure that the sources are really patched before building them.
* Build unit 'libc' on powerpc too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{
 
2
    Free Pascal port of the OpenPTC C++ library.
 
3
    Copyright (C) 2001-2003  Nikolay Nikolov (nickysn@users.sourceforge.net)
 
4
    Original C++ version by Glenn Fiedler (ptc@gaffer.org)
 
5
 
 
6
    This library is free software; you can redistribute it and/or
 
7
    modify it under the terms of the GNU Lesser General Public
 
8
    License as published by the Free Software Foundation; either
 
9
    version 2.1 of the License, or (at your option) any later version.
 
10
 
 
11
    This library is distributed in the hope that it will be useful,
 
12
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
    Lesser General Public License for more details.
 
15
 
 
16
    You should have received a copy of the GNU Lesser General Public
 
17
    License along with this library; if not, write to the Free Software
 
18
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
19
}
 
20
 
 
21
Constructor TPTCKey.Create;
 
22
 
 
23
Begin
 
24
  m_code := Integer(PTCKEY_UNDEFINED);
 
25
  m_unicode := -1;
 
26
  m_alt := False;
 
27
  m_shift := False;
 
28
  m_control := False;
 
29
  m_press := True;
 
30
End;
 
31
 
 
32
Constructor TPTCKey.Create(_code : Integer);
 
33
 
 
34
Begin
 
35
  m_code := _code;
 
36
  m_unicode := -1;
 
37
  m_alt := False;
 
38
  m_shift := False;
 
39
  m_control := False;
 
40
  m_press := True;
 
41
End;
 
42
 
 
43
Constructor TPTCKey.Create(_code, _unicode : Integer);
 
44
 
 
45
Begin
 
46
  m_code := _code;
 
47
  m_unicode := _unicode;
 
48
  m_alt := False;
 
49
  m_shift := False;
 
50
  m_control := False;
 
51
  m_press := True;
 
52
End;
 
53
 
 
54
Constructor TPTCKey.Create(_code, _unicode : Integer; _press : Boolean);
 
55
 
 
56
Begin
 
57
  m_code := _code;
 
58
  m_unicode := _unicode;
 
59
  m_alt := False;
 
60
  m_shift := False;
 
61
  m_control := False;
 
62
  m_press := _press;
 
63
End;
 
64
 
 
65
Constructor TPTCKey.Create(_code : Integer; _alt, _shift, _control : Boolean);
 
66
 
 
67
Begin
 
68
  m_code := _code;
 
69
  m_unicode := -1;
 
70
  m_alt := _alt;
 
71
  m_shift := _shift;
 
72
  m_control := _control;
 
73
  m_press := True;
 
74
End;
 
75
 
 
76
Constructor TPTCKey.Create(_code : Integer; _alt, _shift, _control, _press : Boolean);
 
77
 
 
78
Begin
 
79
  m_code := _code;
 
80
  m_unicode := -1;
 
81
  m_alt := _alt;
 
82
  m_shift := _shift;
 
83
  m_control := _control;
 
84
  m_press := _press;
 
85
End;
 
86
 
 
87
Constructor TPTCKey.Create(_code, _unicode : Integer; _alt, _shift, _control : Boolean);
 
88
 
 
89
Begin
 
90
  m_code := _code;
 
91
  m_unicode := _unicode;
 
92
  m_alt := _alt;
 
93
  m_shift := _shift;
 
94
  m_control := _control;
 
95
  m_press := True;
 
96
End;
 
97
 
 
98
Constructor TPTCKey.Create(_code, _unicode : Integer;
 
99
                           _alt, _shift, _control, _press : Boolean);
 
100
 
 
101
Begin
 
102
  m_code := _code;
 
103
  m_unicode := _unicode;
 
104
  m_alt := _alt;
 
105
  m_shift := _shift;
 
106
  m_control := _control;
 
107
  m_press := _press;
 
108
End;
 
109
 
 
110
Constructor TPTCKey.Create(Const key : TPTCKey);
 
111
 
 
112
Begin
 
113
  ASSign(key);
 
114
End;
 
115
 
 
116
Destructor TPTCKey.Destroy;
 
117
 
 
118
Begin
 
119
  Inherited Destroy;
 
120
End;
 
121
 
 
122
Procedure TPTCKey.Assign(Const key : TPTCKey);
 
123
 
 
124
Begin
 
125
  If Self = key Then
 
126
    Raise TPTCError.Create('self assignment is not allowed');
 
127
 
 
128
  m_code := key.code;
 
129
  m_unicode := key.unicode;
 
130
  m_alt := key.alt;
 
131
  m_shift := key.shift;
 
132
  m_control := key.control;
 
133
  m_press := key.press;
 
134
End;
 
135
 
 
136
Function TPTCKey.Equals(Const key : TPTCKey) : Boolean;
 
137
 
 
138
Begin
 
139
  Equals := (m_code = key.m_code) And (m_unicode = key.m_unicode) And
 
140
            (m_alt = key.m_alt) And (m_shift = key.m_shift) And
 
141
            (m_control = key.m_control) And (m_press = key.m_press);
 
142
End;
 
143
 
 
144
Function TPTCKey.GetRelease : Boolean;
 
145
 
 
146
Begin
 
147
  GetRelease := Not m_press;
 
148
End;