|
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: 12288 (0x3000) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Xlbp_Keyboard_Control, seg_004f75
└─⟦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_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; package body Xlbp_Keyboard_Control is ------------------------------------------------------------------------------ -- X Library Keyboard Controls -- -- Xlbp_Keyboard_Control - Controls over physical portions of the keyboard ------------------------------------------------------------------------------ -- 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_Auto_Repeat_On (Display : X_Display) is Values : X_Keyboard_Control; begin Values.Auto_Repeat_Mode := Auto_Repeat_Mode_On; X_Change_Keyboard_Control (Display, X_Keyboard_Control_Flags' (Kb_Auto_Repeat_Mode => True, others => False), Values); end X_Auto_Repeat_On; --\x0c procedure X_Auto_Repeat_Off (Display : X_Display) is Values : X_Keyboard_Control; begin Values.Auto_Repeat_Mode := Auto_Repeat_Mode_Off; X_Change_Keyboard_Control (Display, X_Keyboard_Control_Flags' (Kb_Auto_Repeat_Mode => True, others => False), Values); end X_Auto_Repeat_Off; --\x0c procedure X_Bell (Display : X_Display; Percent : S_Percent) is begin Lock_Display (Display); begin Put_X_Bell_Request (Display, (Kind => Bell, Length => X_Bell_Request'Size / 32, Percent => Percent)); exception when others => Unlock_Display (Display); raise; end; Unlock_Display (Display); Sync_Handle (Display); end X_Bell; --\x0c procedure X_Change_Keyboard_Control (Display : X_Display; Values_Mask : X_Keyboard_Control_Flags; Values : X_Keyboard_Control) is Extra_Words : S_Natural; begin ----Lock the display. Lock_Display (Display); begin ----Count the extra words we will send in the request Extra_Words := 0; for I in Values_Mask'Range loop if Values_Mask (I) then Extra_Words := Extra_Words + 1; end if; end loop; ----Send the request. Put_X_Change_Keyboard_Control_Request (Display, (Kind => Change_Keyboard_Control, Length => X_Change_Keyboard_Control_Request'Size / 32 + U_Short (Extra_Words), Pad => 0, Mask => Values_Mask), Extra_Words * 4); ----Send the extra data. if Values_Mask (Kb_Key_Click_Percent) then Put_S_Long (Display, S_Long (Values.Key_Click_Percent)); end if; if Values_Mask (Kb_Bell_Percent) then Put_S_Long (Display, S_Long (Values.Bell_Percent)); end if; if Values_Mask (Kb_Bell_Pitch) then Put_S_Long (Display, S_Long (Values.Bell_Pitch)); end if; if Values_Mask (Kb_Bell_Duration) then Put_S_Long (Display, S_Long (Values.Bell_Duration)); end if; if Values_Mask (Kb_Led) then Put_X_Led_Bits (Display, Values.Led); end if; if Values_Mask (Kb_Led_Mode) then Put_S_Long (Display, S_Long (X_Led_Mode'Pos (Values.Led_Mode))); end if; if Values_Mask (Kb_Key) then Put_S_Long (Display, S_Long (Values.Key)); end if; if Values_Mask (Kb_Auto_Repeat_Mode) then Put_S_Long (Display, S_Long (X_Auto_Repeat_Mode'Pos (Values.Auto_Repeat_Mode))); end if; ----Catch exceptions. exception when others => Unlock_Display (Display); raise; end; ----Unlock; sync; return. Unlock_Display (Display); Sync_Handle (Display); end X_Change_Keyboard_Control; --\x0c procedure X_Get_Keyboard_Control (Display : X_Display; State : out X_Keyboard_State) is Rep : X_Reply_Contents; Succ : X_Status; begin ----Lock the display. Lock_Display (Display); begin ----Send the request. Put_X_Get_Keyboard_Control_Request (Display, (Kind => Get_Keyboard_Control, Length => X_Get_Keyboard_Control_Request'Size / 32, Pad => 0)); ----Read the reply. Get_Reply (Display => Display, Code => Get_Keyboard_Control, Reply => Rep, Extra => 0, Discard => True, Status => Succ); ----If we succeeded then return the values. if Succ /= Failed then Stte.Key_Click_Percent := Rep.Get_Keyboard_Control.Key_Click_Percent; State.Bell_Percent := Rep.Get_Keyboard_Control.Bell_Percent; State.Bell_Pitch := Rep.Get_Keyboard_Control.Bell_Pitch; State.Bell_Duration := Rep.Get_Keyboard_Control.Bell_Duration; State.Led_Mask := Rep.Get_Keyboard_Control.Led_Mask; State.Global_Auto_Repeat := To_Boolean (Rep.Get_Keyboard_Control.Global_Auto_Repeat); State.Auto_Repeats := Rep.Get_Keyboard_Control.Map; else State := None_X_Keyboard_State; end if; ----Catch exceptions. exception when others => Unlock_Display (Display); raise; end; ----Unlock; sync; and return. Unlock_Display (Display); Sync_Handle (Display); end X_Get_Keyboard_Control; --\x0c procedure X_Query_Keymap (Display : X_Display; Keys : out X_Keyboard_As_Bits) is Rep : X_Reply_Contents; Succ : X_Status; begin ----Lock the display. Lock_Display (Display); begin ----Send the request. Put_X_Query_Keymap_Request (Display, (Kind => Query_Keymap, Length => X_Query_Keymap_Request'Size / 32, Pad => 0)); ----Get the reply. Get_Reply (Display => Display, Code => Query_Keymap, Reply => Rep, Extra => 0, Discard => True, Status => Succ); if Succ /= Failed then Keys := Rep.Query_Keymap.Map; else Keys := (others => False); end if; ----Catch exceptions. exception when others => Unlock_Display (Display); raise; end; ----Unlock; sync; return. Unlock_Display (Display); Sync_Handle (Display); end X_Query_Keymap; --\x0c end Xlbp_Keyboard_Control;
nblk1=b nid=0 hdr6=16 [0x00] rec0=22 rec1=00 rec2=01 rec3=016 [0x01] rec0=11 rec1=00 rec2=02 rec3=028 [0x02] rec0=1e rec1=00 rec2=03 rec3=01a [0x03] rec0=1e rec1=00 rec2=04 rec3=02e [0x04] rec0=1a rec1=00 rec2=05 rec3=034 [0x05] rec0=1d rec1=00 rec2=06 rec3=020 [0x06] rec0=21 rec1=00 rec2=07 rec3=024 [0x07] rec0=00 rec1=00 rec2=0b rec3=002 [0x08] rec0=1a rec1=00 rec2=08 rec3=03a [0x09] rec0=21 rec1=00 rec2=09 rec3=01a [0x0a] rec0=13 rec1=00 rec2=0a rec3=000 tail 0x217006dbe819782e0e760 0x42a00088462063203