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

⟦eb4e37865⟧ Ada Source

    Length: 7168 (0x1c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, procedure Gr_005, seg_00552f

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 Gr_Random;
use Gr_Random;
with Gr_State_Test;
with Test_Io;
use Test_Io;

with Xlbt_Arithmetic;
use Xlbt_Arithmetic;
with Xlbt_Basic;
use Xlbt_Basic;
with Xlbt_Font;
use Xlbt_Font;
with Xlbt_Graphics;
use Xlbt_Graphics;

with Xlbp_Event;
use Xlbp_Event;
with Xlbp_Graphics;
use Xlbp_Graphics;

procedure Gr_005 is

    List : X_Arc_List;

    procedure Generate_List (Dpy    : X_Display;  
                             Width  : S_Short;  
                             Height : S_Short) is
        Count : S_Long := Dpy.Poly_Arc_Limit;
        A1    : S_Short;
        A2    : S_Short;
    begin

        List := new X_Arc_Array (1 .. Count);
        A1   := 45 * 64;
        A2   := 135 * 64;
        for I in 1 .. Count loop
            List (I).X      := Random_X (Width);
            List (I).Y      := Random_Y (Height - 15) + 15;
            List (I).Width  := Random_W (100);
            List (I).Height := Random_H (100);
            List (I).Angle1 := A1;
            List (I).Angle2 := A2;
            A1              := (A1 + 64) rem (360 * 64);
            A2              := (A2 + 128) rem (360 * 64);
        end loop;

    end Generate_List;

    procedure Draw (Dpy         : X_Display;  
                    Window      : X_Window;  
                    Gc          : X_Gc;  
                    Font        : X_Font_Struct;  
                    Width       : S_Short;  
                    Height      : S_Short;
                    Per_Message : S_Natural) is
        Flush : S_Natural := 0;
    begin

        for I in List'Range loop
            X_Draw_Arc (Dpy, Window.Drawable, Gc, List (I).X,
                        List (I).Y, List (I).Width, List (I).Height,
                        List (I).Angle1, List (I).Angle2);
            Flush := Flush + 1;
            if Flush >= Per_Message then
                X_Flush (Dpy);
                Flush := 0;
            end if;
        end loop;

    end Draw;

    procedure Do_Graphics (Dpy    :        X_Display;  
                           State  : in out Natural;  
                           Window :        X_Window;  
                           Gc     :        X_Gc;  
                           Font   :        X_Font_Struct;  
                           Width  :        S_Short;  
                           Height :        S_Short) is
    begin
        if List = None_X_Arc_List then
            Generate_List (Dpy, Width, Height);
        end if;
        case State is
            when 1 =>
                X_Draw_Arcs (Dpy, Window.Drawable, Gc,
                             List (List'First .. List'First +
                                                    List'Length / 2 - 1));
            when 2 =>
                X_Draw_Arcs (Dpy, Window.Drawable, Gc, List.all);
            when 3 =>
                Draw (Dpy, Window, Gc, Font, Width, Height, 1);
            when 4 =>
                Draw (Dpy, Window, Gc, Font, Width, Height, 5);
            when 5 =>
                Draw (Dpy, Window, Gc, Font, Width, Height, S_Natural'Last);
            when others =>
                Free_X_Arc_List (List);
                State := 0;
        end case;
    end Do_Graphics;

    procedure Test is new Gr_State_Test (Do_Graphics);

begin

    Test;

end Gr_005;

E3 Meta Data

    nblk1=6
    nid=0
    hdr6=c
        [0x00] rec0=29 rec1=00 rec2=01 rec3=05c
        [0x01] rec0=01 rec1=00 rec2=06 rec3=02a
        [0x02] rec0=1b rec1=00 rec2=02 rec3=020
        [0x03] rec0=03 rec1=00 rec2=05 rec3=000
        [0x04] rec0=16 rec1=00 rec2=03 rec3=05a
        [0x05] rec0=10 rec1=00 rec2=04 rec3=000
    tail 0x21700988e81978b7af73b 0x42a00088462063203