DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

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

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦8a0a15281⟧ Ada Source

    Length: 13312 (0x3400)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Xlbp_Cursor, seg_004f53

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



with Xlbt_Arithmetic;  
use Xlbt_Arithmetic;  
with Xlbt_Basic;  
use Xlbt_Basic;  
with Xlbt_Color;  
use Xlbt_Color;  
with Xlbt_Cursor_Font;  
use Xlbt_Cursor_Font;  
with Xlbt_Gc;  
use Xlbt_Gc;  
with Xlbt_Request;  
use Xlbt_Request;  
with Xlbt_String;  
use Xlbt_String;  
with Xlbt_Window;  
use Xlbt_Window;

with Xlbp_Extension;  
use Xlbp_Extension;  
with Xlbp_Font;  
use Xlbp_Font;  
with Xlbp_Gc;  
use Xlbp_Gc;

with Xlbip_Internal;  
use Xlbip_Internal;  
with Xlbip_Put_Request;  
use Xlbip_Put_Request;

with Xlbmt_Parameters;  
use Xlbmt_Parameters;

package body Xlbp_Cursor is
------------------------------------------------------------------------------
-- X Library Cursors
--
-- Xlbp_Cursor - Creating, changing, and destroying cursors.
------------------------------------------------------------------------------
-- 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
    Foreground : constant X_Color :=  
       (None_X_Pixel, 0, 0, 0, None_X_Color_Flags, 0);             -- black

    Background : constant X_Color :=  
       (None_X_Pixel, 65535, 65535, 65535, None_X_Color_Flags, 0); -- white

--\x0c
    function X_Create_Font_Cursor (Display : X_Display;  
                                   Cursor  : X_Cursor_Font) return X_Cursor is
        --
        -- the cursor font contains the shape glyph followed by the mask
        -- glyph; so character the_position 0 contains a shape, 1 the mask for 0,
        -- 2 a shape, etc.  <X11/cursorfont.h> contains hash define names
        -- for all of these.
        --
        Result : X_Cursor;  
    begin  
        if Display.Cursor_Font = None_X_Font then  
            Display.Cursor_Font :=  
               X_Load_Font (Display, To_X_String (X_Cursor_Font_Name));  
            if Display.Cursor_Font = None_X_Font then  
                return None_X_Cursor;  
            end if;  
        end if;  
        Result := X_Create_Glyph_Cursor  
                     (Display, Display.Cursor_Font, Display.Cursor_Font,  
                      U_Short (Cursor), U_Short (Cursor + 1),  
                      Foreground, Background);  
        return Result;

    end X_Create_Font_Cursor;

--\x0c
    function X_Create_Glyph_Cursor (Display     : X_Display;  
                                    Source_Font : X_Font;  
                                    Mask_Font   : X_Font;  
                                    Source_Char : U_Short;  
                                    Mask_Char   : U_Short;  
                                    Foreground  : X_Color;  
                                    Background  : X_Color) return X_Cursor is  
        Cid : X_Cursor;  
    begin

----Lock the display.

        Lock_Display (Display);  
        begin

----Send the request.

            Cid := (Id => X_Alloc_Id (Display));  
            Put_X_Create_Glyph_Cursor_Request  
               (Display, (Kind => Create_Glyph_Cursor,  
                          Length => X_Create_Glyph_Cursor_Request'Size / 32,  
                          Pad => 0,  
                          Cursor => Cid,  
                          Source => Source_Font,  
                          Mask => Mask_Font,  
                          Source_Char => U_Short (Source_Char),  
                          Mask_Char => U_Short (Mask_Char),  
                          Fore_Red => Foreground.Red,  
                          Fore_Green => Foreground.Green,  
                          Fore_Blue => Foreground.Blue,  
                          Back_Red => Background.Red,  
                          Back_Green => Background.Green,  
                          Back_Blue => Background.Blue));

----Catch exceptions.

        exception  
            when others =>  
                Unlock_Display (Display);  
                raise;  
        end;

----Unlock; sync; return new cursor.

        Unlock_Display (Display);  
        Sync_Handle (Display);  
        return Cid;

    end X_Create_Glyph_Cursor;

--\x0c
    function X_Create_Pixmap_Cursor (Display    : X_Display;  
                                     Source     : X_Pixmap;  
                                     Mask       : X_Pixmap;  
                                     Foreground : X_Color;  
                                     Background : X_Color;  
                                     X          : U_Short;  
                                     Y          : U_Short) return X_Cursor is  
        Cid : X_Cursor;  
    begin

----Lock the display.

        Lock_Display (Display);  
        begin

----Send the request.

            Cid := (Id => X_Alloc_Id (Display));  
            Put_X_Create_Cursor_Request  
               (Display,  
                (Kind       => Create_Cursor,  
                 Length     => X_Create_Cursor_Request'Size / 32,  
                 Pad        => 0,  
                 Cursor     => Cid,  
                 Source     => Source,  
                 Mask       => Mask,  
                 Fore_Red   => Foreground.Red,  
                 Fore_Green => Foreground.Green,  
                 Fore_Blue  => Foreground.Blue,  
                 Back_Red   => Background.Red,  
                 Back_Green => Background.Green,  
                 Back_Blue  => Background.Blue,  
                 X          => X,  
                 Y          => Y));

----Catch exceptions.

        exception  
            when others =>  
                Unlock_Display (Display);  
                raise;  
        end;

----Unlock; sync; return new cursor.

        Unlock_Display (Display);  
        Sync_Handle (Display);  
        return Cid;

    end X_Create_Pixmap_Cursor;

--\x0c
    procedure X_Define_Cursor (Display : X_Display;  
                               Window  : X_Window;  
                               Cursor  : X_Cursor) is  
    begin

----Lock the display.

        Lock_Display (Display);  
        begin

----Send the request.

            Put_X_Change_Window_Attributes_Request  
               (Display,  
                (Kind       => Change_Window_Attributes,  
                 Length     => X_Change_Window_Attributes_Request'Size / 32 + 1,  
                 Pad        => 0,  
                 Window     => Window,  
                 Value_Mask => (Cw_Cursor => True, others => False)),  
                4);  
            Put_X_Id (Display, Cursor.Id);

----Catch exceptions.

        exception  
            when others =>  
                Unlock_Display (Display);  
                raise;  
        end;

----Unlock; sync; return.

        Unlock_Display (Display);  
        Sync_Handle (Display);

    end X_Define_Cursor;

--\x0c
    procedure X_Free_Cursor (Display :        X_Display;  
                             Cursor  : in out X_Cursor) is  
    begin

----Lock the display.

        Lock_Display (Display);  
        begin

----Send the request.

            Put_X_Free_Cursor_Request  
               (Display, (Kind   => Free_Cursor,  
                          Length => X_Free_Cursor_Request'Size / 32,  
                          Pad    => 0,  
                          Id     => Cursor));  
            Cursor := None_X_Cursor;

----Catch exceptions.

        exception  
            when others =>  
                Unlock_Display (Display);  
                raise;  
        end;

----Unlock and return.

        Unlock_Display (Display);  
        Sync_Handle (Display);

    end X_Free_Cursor;


--\x0c
    procedure X_Query_Best_Cursor (Display     :     X_Display;  
                                   Drawable    :     X_Drawable;  
                                   Width       :     U_Short;  
                                   Height      :     U_Short;  
                                   Best_Width  : out U_Short;  
                                   Best_Height : out U_Short;  
                                   Status      : out X_Status) is  
    begin

        X_Query_Best_Size (Display, Cursor_Shape, Drawable, Width,  
                           Height, Best_Width, Best_Height, Status);

    end X_Query_Best_Cursor;

--\x0c
    procedure X_Recolor_Cursor (Display    : X_Display;  
                                Cursor     : X_Cursor;  
                                Foreground : X_Color;  
                                Background : X_Color) is  
    begin

----Lock the display.

        Lock_Display (Display);  
        begin

----Send the request.

            Put_X_Recolor_Cursor_Request  
               (Display, (Kind       => Recolor_Cursor,  
                          Length     => X_Recolor_Cursor_Request'Size / 32,  
                          Pad        => 0,  
                          Cursor     => Cursor,  
                          Fore_Red   => Foreground.Red,  
                          Fore_Green => Foreground.Green,  
                          Fore_Blue  => Foreground.Blue,  
                          Back_Red   => Background.Red,  
                          Back_Green => Background.Green,  
                          Back_Blue  => Background.Blue));

----Catch exceptions.

        exception  
            when others =>  
                Unlock_Display (Display);  
                raise;  
        end;

----Unlock; sync; and return.

        Unlock_Display (Display);  
        Sync_Handle (Display);

    end X_Recolor_Cursor;

--\x0c
    procedure X_Undefine_Cursor (Display : X_Display;  
                                 Window  : X_Window) is  
    begin

----Lock the display.

        Lock_Display (Display);  
        begin

----Send the request.

            Put_X_Change_Window_Attributes_Request  
               (Display,  
                (Kind       => Change_Window_Attributes,  
                 Length     => X_Change_Window_Attributes_Request'Size / 32 + 1,  
                 Pad        => 0,  
                 Window     => Window,  
                 Value_Mask => (Cw_Cursor => True, others => False)),  
                4);  
            Put_X_Id (Display, None_X_Cursor.Id);

----Catch exceptions.

        exception  
            when others =>  
                Unlock_Display (Display);  
                raise;  
        end;

----Unlock; sync; and return.

        Unlock_Display (Display);  
        Sync_Handle (Display);

    end X_Undefine_Cursor;

--\x0c
end Xlbp_Cursor;  

E3 Meta Data

    nblk1=c
    nid=0
    hdr6=18
        [0x00] rec0=29 rec1=00 rec2=01 rec3=03c
        [0x01] rec0=11 rec1=00 rec2=02 rec3=044
        [0x02] rec0=17 rec1=00 rec2=03 rec3=04c
        [0x03] rec0=19 rec1=00 rec2=04 rec3=000
        [0x04] rec0=17 rec1=00 rec2=05 rec3=014
        [0x05] rec0=23 rec1=00 rec2=06 rec3=00a
        [0x06] rec0=1c rec1=00 rec2=07 rec3=032
        [0x07] rec0=24 rec1=00 rec2=08 rec3=024
        [0x08] rec0=2b rec1=00 rec2=09 rec3=042
        [0x09] rec0=1c rec1=00 rec2=0a rec3=022
        [0x0a] rec0=1d rec1=00 rec2=0b rec3=00c
        [0x0b] rec0=25 rec1=00 rec2=0c rec3=000
    tail 0x217006af4819781ec0bba 0x42a00088462063203