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

⟦d37158e6a⟧ Ada Source

    Length: 9216 (0x2400)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Library_Ed, seg_027de0

Derivation

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

E3 Source Code



with Text_Io;
with Xt_Interface;  
with Ada_C;  
with Local_Frames;  
with Events;  
with Error_List;
with List_Editor;
with Status;
with Directory;
with Object_Management_System;

package body Library_Ed is
    package Oms renames Object_Management_System;
    Frame_Lf : constant Local_Frames.Local_Frame := Editor_Lf;
    List_Lf : constant Local_Frames.Local_Frame := Editor_Lf;

    Object_Dir : Oms.Library_Object := Oms.Library.Home;


    Error_Widget_Path : constant String := "F.PW.F2.SL2.SList";
    Library_Widget_Path : constant String := "F.PW.MW1.F1.SL1.SList";


    package Error is new Error_List (Lf => List_Lf,
                                     Widget_Path => Error_Widget_Path);

    package Status_Ed is new Status;

    procedure List_Process_Event;

    package List_Ed is new List_Editor (Lf => List_Lf,
                                        Widget_Path => "F.PW.ListEd",
                                        Process_Event => List_Process_Event);
    procedure List_Process_Event is
    begin
        List_Ed.Delete_All_Items;
    end List_Process_Event;


    procedure Display_Directory is
        I : Oms.Iterator;
    begin
        List_Ed.Delete_All_Items;
        Status_Ed.Set_Status (The_Editor => "( Library )",
                              The_Object => "",
                              Object_Status => "O",
                              Frame_Status => "F",
                              Editor_Status => "R");
        List_Ed.Set_Label (Label => Status_Ed.Get_Status);

        I := Oms.Library.Children (The_Library => Object_Dir);
        while not Oms.Done (Iter => I) loop
            List_Ed.Add_Item (Item => Oms.Any_Object.Image
                                         (The_Object => Oms.Value (Iter => I)));
            Oms.Next (Iter => I);
        end loop;
    end Display_Directory;

    procedure Init (Dir_Name : String) is
    begin  
        Error.Init;  
        List_Ed.Init;
        Display_Directory;
        null; -- must be replace by use of dir_name
    end Init;

    function Process_Events return Process_Events_State.Elements is
        Result_State : Process_Events_State.Elements :=
           Process_Events_State.Not_Processed;
    begin
        if not Events.Empty then
            declare  
                Lf : constant Local_Frames.Local_Frame := Events.Get_Lf;
                Evt_Type : constant String := Events.Get_Type;
                Field : constant String := Events.Get_Field;
                Value : constant String := Events.Get_Value;
            begin
                Text_Io.Put_Line ("GETEVENT: lf:" & Integer'Image (Lf) &
                                  "  type:" & Evt_Type & "  field:" &
                                  Field & "  value:" & Value);
                if Evt_Type = "Select" and Field = "FN" then
                    Display_Directory;
                    -- Events.Next;
                    Result_State := Process_Events_State.Processed;
                elsif Evt_Type = "Select" and Field = "FQ" then
                    Result_State := Process_Events_State.Quit;
                elsif Evt_Type = "Select" and Field = "OC" then
                    Error.Init;
                elsif Evt_Type = "Select" and Field = "OS" then
                    Error.Put_Line ("");
                elsif Evt_Type = "Select" and Field = "LL" then
                    declare
                        Object_Tmp : Oms.Library_Object :=
                           Oms.Any_Object.Value (The_String => Value);
                    begin
                        if Oms.Any_Object.Is_Library (Object_Tmp) then
                            Object_Dir := Object_Tmp;
                            Display_Directory;
                        else
                            Error.Put_Line ("this object is not a Library");
                        end if;
                    end;
                elsif Evt_Type = "Select" and Field = "TF" then
                    declare
                        Object_Tmp : Oms.Library_Object :=
                           Oms.Any_Object.Value (The_String =>
                                                    List_Ed.Get_Selected_Item);
                    begin
                        if Oms.Any_Object.Is_Library (Object_Tmp) then
                            Object_Dir := Object_Tmp;
                            Display_Directory;
                        else
                            Error.Put_Line ("this object is not a Library");
                        end if;
                    end;
                elsif Evt_Type = "Select" and Field = "TN" then
                    Object_Dir := Oms.Library.Enclosing_Library;
                    Display_Directory;
                elsif Evt_Type = "Select" then
                    Error.Put_Line (Field & " not yet implemented");
                end if;
                -- ligne suivante a supprimer
                Events.Next;
            end;
        end if;
        return Result_State;
    end Process_Events;
end Library_Ed;

E3 Meta Data

    nblk1=8
    nid=8
    hdr6=c
        [0x00] rec0=22 rec1=00 rec2=01 rec3=060
        [0x01] rec0=1c rec1=00 rec2=05 rec3=018
        [0x02] rec0=16 rec1=00 rec2=06 rec3=03a
        [0x03] rec0=13 rec1=00 rec2=07 rec3=024
        [0x04] rec0=14 rec1=00 rec2=04 rec3=00e
        [0x05] rec0=07 rec1=00 rec2=03 rec3=000
        [0x06] rec0=02 rec1=00 rec2=02 rec3=001
        [0x07] rec0=e8 rec1=39 rec2=c4 rec3=4e4
    tail 0x21520cca283ad6b950cbe 0x42a00088462060003
Free Block Chain:
  0x8: 0000  00 02 00 19 80 16 20 20 57 69 64 67 65 74 5f 50  ┆        Widget_P┆
  0x2: 0000  00 00 00 2e 80 16 50 61 74 68 2c 20 53 74 61 74  ┆   .  Path, Stat┆