|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 15360 (0x3c00)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Xlbp_Pointer_Control, seg_004f7b
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦cfc2e13cd⟧ »Space Info Vol 2«
└─⟦this⟧
with Xlbt_Arithmetic;
use Xlbt_Arithmetic;
with Xlbt_Basic;
use Xlbt_Basic;
with Xlbt_Key;
use Xlbt_Key;
with Xlbt_Keyboard;
use Xlbt_Keyboard;
with Xlbt_Misc;
use Xlbt_Misc;
with Xlbt_Reply;
use Xlbt_Reply;
with Xlbt_Request;
use Xlbt_Request;
with Xlbip_Get_Reply;
use Xlbip_Get_Reply;
with Xlbip_Internal;
use Xlbip_Internal;
with Xlbip_Put_Request;
use Xlbip_Put_Request;
with Xlbmt_Network_Types;
use Xlbmt_Network_Types;
package body Xlbp_Pointer_Control is
------------------------------------------------------------------------------
-- X Library Pointer Controls
--
-- Xlbp_Pointer_Control - Controls over pointer motion and button encoding
------------------------------------------------------------------------------
-- Copyright 1989 - 1991 by Rational, Santa Clara, California.
-- Copyright 1985 - 1989 by the Massachusetts Institute of Technology
--
-- All Rights Reserved.
--
-- Permission to use, copy, modify, and distribute this software and its
-- documentation for any purpose and without fee is hereby granted,
-- provided that the above copyright notice(s) appear in all copies and that
-- both that copyright notice(s) and this permission notice appear in
-- supporting documentation, and that the names of MIT or Rational not be
-- used in advertising or publicity pertaining to distribution of the software
-- without specific, written prior permission.
--
-- MIT and Rational disclaim all warranties with regard to this software,
-- including all implied warranties of merchantability and fitness, in no
-- event shall MIT or Rational be liable for any special, indirect or
-- consequential damages or any damages whatsoever resulting from loss of use,
-- data or profits, whether in an action of contract, negligence or other
-- tortious action, arising out of or in connection with the use or performance
-- of this software.
------------------------------------------------------------------------------
--\x0c
procedure X_Change_Pointer_Control (Display : X_Display;
Do_Accelerate : Boolean;
Do_Threshold : Boolean;
Accelerate_Numerator : S_Short;
Accelerate_Denominator : S_Short;
Threshold : S_Short) is
begin
----Lock the display;
Lock_Display (Display);
begin
----Send the request.
Put_X_Change_Pointer_Control_Request
(Display, (Kind => Change_Pointer_Control,
Length => X_Change_Pointer_Control_Request'Size / 32,
Pad => 0,
Accel_Num => Accelerate_Numerator,
Accel_Denom => Accelerate_Denominator,
Threshold => Threshold,
Do_Accel => From_Boolean (Do_Accelerate),
Do_Thresh => From_Boolean (Do_Threshold)));
----Catch exceptions.
exception
when others =>
Unlock_Display (Display);
raise;
end;
----Unlock; sync; return.
Unlock_Display (Display);
Sync_Handle (Display);
end X_Change_Pointer_Control;
--\x0c
procedure X_Get_Pointer_Control (Display : X_Display;
Accelerate_Numerator : out U_Short;
Accelerate_Denominator : out U_Short;
Threshold : out U_Short) is
Rep : X_Reply_Contents;
Succ : X_Status;
begin
----Lock the display;
Lock_Display (Display);
begin
----Send the request.
Put_X_Get_Pointer_Control_Request
(Display, (Kind => Get_Pointer_Control,
Length => X_Get_Pointer_Control_Request'Size / 32,
Pad => 0));
----Get the reply.
Get_Reply (Display => Display,
Code => Get_Pointer_Control,
Reply => Rep,
Extra => 0,
Discard => True,
Status => Succ);
if Succ /= Failed then
Accelerate_Numerator := Rep.Get_Pointer_Control.Accel_Numerator;
Accelerate_Denominator :=
Rep.Get_Pointer_Control.Accel_Denominator;
Threshold := Rep.Get_Pointer_Control.Threshold;
else
Accelerate_Numerator := 0;
Accelerate_Denominator := 0;
Threshold := 0;
end if;
----Catch exceptions.
exception
when others =>
Unlock_Display (Display);
raise;
end;
----Unlock; sync; return.
Unlock_Display (Display);
Sync_Handle (Display);
end X_Get_Pointer_Control;
--\x0c
procedure X_Get_Pointer_Mapping (Display : X_Display;
Map : out X_Key_Code_List;
Status : out X_Mapping_Status) is
Rep : X_Reply_Contents;
Succ : X_Status;
begin
----Lock the display.
Lock_Display (Display);
begin
----Send the request.
Put_X_Get_Pointer_Mapping_Request
(Display, (Kind => Get_Pointer_Mapping,
Length => X_Get_Pointer_Mapping_Request'Size / 32,
Pad => 0));
----Read the reply.
Get_Reply (Display => Display,
Code => Get_Pointer_Mapping,
Reply => Rep,
Extra => 0,
Discard => False,
Status => Succ);
----Check the Status and read the extra reply data.
if Succ = Failed then
Status := Mapping_Failed;
Map := None_X_Key_Code_List;
else
declare
List : X_Key_Code_List;
begin
begin
List := new X_Key_Code_Array
(1 .. S_Natural (Rep.Get_Pointer_Mapping.
N_Elts));
exception
when others =>
Eat_Raw_Data
(Display,
(X_Key_Code'Size / 8) *
S_Natural (Rep.Get_Pointer_Mapping.Length));
raise;
end;
Get_X_Key_Code_Array (Display, List.all);
Status := Mapping_Success;
exception
when others =>
Free_X_Key_Code_List (List);
raise;
end;
end if;
----Catch exceptions.
exception
when others =>
Unlock_Display (Display);
raise;
end;
----Unlock; sync; return.
Unlock_Display (Display);
Sync_Handle (Display);
end X_Get_Pointer_Mapping;
--\x0c
procedure X_Set_Pointer_Mapping (Display : X_Display;
Map : X_Key_Code_Array;
Status : out X_Mapping_Status) is
Rep : X_Reply_Contents;
Succ : X_Status;
begin
----Lock the display.
Lock_Display (Display);
begin
----Send the request.
Put_X_Set_Pointer_Mapping_Request
(Display, (Kind => Set_Pointer_Mapping,
Length => X_Set_Pointer_Mapping_Request'Size / 32 +
U_Short ((Map'Length + 3) / 4),
N_Elts => Map'Length),
Map'Length);
----Send the extra data.
Put_X_Key_Code_Array (Display, Map);
----Get the reply.
Get_Reply (Display => Display,
Code => Set_Pointer_Mapping,
Reply => Rep,
Extra => 0,
Discard => False,
Status => Succ);
if Succ = Failed then
Status := Mapping_Failed;
else
Status := Rep.Set_Pointer_Mapping.Success;
end if;
----Catch exceptions.
exception
when others =>
Unlock_Display (Display);
raise;
end;
----Unlock; sync; return.
Unlock_Display (Display);
Sync_Handle (Display);
end X_Set_Pointer_Mapping;
--\x0c
end Xlbp_Pointer_Control;
nblk1=e
nid=0
hdr6=1c
[0x00] rec0=24 rec1=00 rec2=01 rec3=04e
[0x01] rec0=11 rec1=00 rec2=02 rec3=01e
[0x02] rec0=17 rec1=00 rec2=03 rec3=052
[0x03] rec0=1f rec1=00 rec2=04 rec3=006
[0x04] rec0=00 rec1=00 rec2=0e rec3=002
[0x05] rec0=19 rec1=00 rec2=05 rec3=016
[0x06] rec0=00 rec1=00 rec2=0d rec3=004
[0x07] rec0=24 rec1=00 rec2=06 rec3=050
[0x08] rec0=02 rec1=00 rec2=0c rec3=014
[0x09] rec0=19 rec1=00 rec2=07 rec3=050
[0x0a] rec0=00 rec1=00 rec2=0b rec3=004
[0x0b] rec0=20 rec1=00 rec2=08 rec3=028
[0x0c] rec0=1f rec1=00 rec2=09 rec3=038
[0x0d] rec0=17 rec1=00 rec2=0a rec3=000
tail 0x217006e3c819782f3bfea 0x42a00088462063203