DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦02eccdc63⟧ TextFile

    Length: 9121 (0x23a1)
    Types: TextFile
    Names: »B«

Derivation

└─⟦85b835f43⟧ Bits:30000549 8mm tape, Rational 1000, Xlib rev 6.00
    └─ ⟦0c20f784e⟧ »DATA« 
        └─⟦1abbe589f⟧ 
            └─⟦059497ac5⟧ 
                └─⟦this⟧ 

TextFile

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.
------------------------------------------------------------------------------

--\f

    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;

--\f

    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;

--\f

    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;

--\f

    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;

--\f

end Xlbp_Pointer_Control;