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

⟦8bd1d3f39⟧ TextFile

    Length: 3146 (0xc4a)
    Types: TextFile
    Names: »B«

Derivation

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

TextFile

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_003 is

    List : X_Segment_List;

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

        List := new X_Segment_Array (1 .. Count);
        for I in 1 .. Count loop
            List (I).X1 := Random_X (Width);
            List (I).Y1 := Random_Y (Height - 15) + 15;
            List (I).X2 := Random_X (Width);
            List (I).Y2 := Random_Y (Height - 15) + 15;
        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;
        I     : S_Natural;
        J     : S_Natural;
    begin

        I := List'First;
        while I < List'Last loop
            if List'Last - I + 1 >= Per_Message then
                J := I + Per_Message - 1;
            else
                J := List'Last;
            end if;
            X_Draw_Segments (Dpy, Window.Drawable, Gc, List (I .. J));
            Flush := Flush + 1;
            if Flush >= Per_Message then
                X_Flush (Dpy);
                Flush := 0;
            end if;
            I := J + 1;
        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_Segment_List then
            Generate_List (Dpy, Width, Height);
        end if;
        case State is
            when 1 =>
                X_Draw_Segments (Dpy, Window.Drawable, Gc,
                                 List (List'First .. List'First +
                                                        List'Length / 2 - 1));
            when 2 =>
                X_Draw_Segments (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_Segment_List (List);
                State := 0;
        end case;
    end Do_Graphics;

    procedure Test is new Gr_State_Test (Do_Graphics);

begin

    Test;

end Gr_003;