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

⟦ea635238e⟧ TextFile

    Length: 11430 (0x2ca6)
    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_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.
------------------------------------------------------------------------------
--\f

    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

--\f

    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;

--\f

    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;

--\f

    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;

--\f

    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;

--\f

    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;


--\f

    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;

--\f

    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;

--\f

    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;

--\f

end Xlbp_Cursor;