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

⟦2af2cb384⟧ TextFile

    Length: 7794 (0x1e72)
    Types: TextFile
    Names: »B«

Derivation

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

TextFile

with Xlbp_Proc_Var;  
use Xlbp_Proc_Var;

separate (Xev_Main)  
procedure Main (Display       : X_String             := "";  
                Geometry      : X_String             := "";  
                Backing_Store : X_Backing_Store_Hint := Not_Useful;  
                Save_Under    : Boolean              := False;  
                Border_Width  : U_Short              := 2;  
                Sync          : Boolean              := False) is

    Hints   : Xlbt_Hint.X_Size_Hints;  
    W       : X_Window;  
    Subw    : X_Window;  
    Attr    : X_Set_Window_Attributes;  
    Mask    : X_New_Window_Attributes := None_X_New_Window_Attributes;  
    Done    : Boolean;  
    Error   : X_Error_String;  
    Screen  : X_Screen_Number;  
    Event   : X_Event;  
    Success : X_Status;  
    Env     : constant X_String       :=  
       X_Display_Name (Display);  
begin


    Attr.Backing_Store      := Backing_Store;  
    Mask (Cw_Backing_Store) := True;

    if Save_Under then  
        Attr.Save_Under      := True;  
        Mask (Cw_Save_Under) := True;  
    end if;

    X_Open_Display (Env, Dpy, Error);  
    if Dpy = null then  
        Text_Io.Put_Line ("xev: unable to open display {" &  
                          To_String (Display) & "}: " &  
                          To_String (Err (Error)));  
        return;  
    end if;  
    if Sync then  
        declare  
            Pv : Proc_Var_X_Synchandler.Pv;  
        begin  
            Pv := X_Synchronize (Dpy, False);  
        end;  
    end if;

    Set_Sizehints (Hints, Outer_Window_Min_Width, Outer_Window_Min_Height,  
                   Outer_Window_Def_Width, Outer_Window_Def_Height,  
                   Outer_Window_Def_X, Outer_Window_Def_Y, Geometry);

    Screen := X_Default_Screen (Dpy);

    Attr.Background_Pixel  := X_Black_Pixel (Dpy, Screen);  
    Mask (Cw_Back_Pixel)   := True;  
    Attr.Border_Pixel      := X_White_Pixel (Dpy, Screen);  
    Mask (Cw_Border_Pixel) := True;

----Select for all events.

    Attr.Event_Mask      :=  
       X_Event_Mask'  
          (Key_Press_Mask | Key_Release_Mask | Button_Press_Mask |  
           Button_Release_Mask | Enter_Window_Mask | Leave_Window_Mask |  
           Pointer_Motion_Mask | Pointer_Motion_Hint_Mask |  
           Button_1_Motion_Mask | Button_2_Motion_Mask | Button_3_Motion_Mask |  
           Button_4_Motion_Mask | Button_5_Motion_Mask |  
           Button_Motion_Mask | Keymap_State_Mask | Exposure_Mask |  
           Visibility_Change_Mask | Structure_Notify_Mask |  
           Substructure_Notify_Mask | Substructure_Redirect_Mask |  
           Focus_Change_Mask | Property_Change_Mask |  
           Colormap_Change_Mask | Owner_Grab_Button_Mask => True,  
           Resize_Redirect_Mask => False,  
           others => False);  
    Mask (Cw_Event_Mask) := True;

    W := X_Create_Window (Dpy, X_Root_Window (Dpy, Screen),  
                          S_Short (Hints.X), S_Short (Hints.Y),  
                          U_Short (Hints.Width), U_Short (Hints.Height),  
                          Border_Width, 0, Input_Output,  
                          Copy_From_Parent_Visual, Mask, Attr);

    X_Set_Wm_Properties (Dpy, W, "Event Tester", "", (1 .. 0 => null), Hints,  
                         None_X_Wm_Hints, None_X_Class_Hint, Success);

----GEB 10/3/89
    declare  
        H : Xlbt_Hint.X_Wm_Hints;  
    begin  
        H.Flags (Input_Hint) := True;  
        H.Input              := True;  
        X_Set_Wm_Hints (Dpy, W, H, Success);  
    end;

    Subw := X_Create_Simple_Window  
               (Dpy, W, Inner_Window_X, Inner_Window_Y, Inner_Window_Width,  
                Inner_Window_Height, Inner_Window_Border,  
                Attr.Border_Pixel, Attr.Background_Pixel);

    X_Map_Window (Dpy, Subw);           -- map before w so that it appears
    X_Map_Window (Dpy, W);

    Text_Io.Put ("Outer window is ");  
    S_Long_Io.Put (W.Drawable.Id.Number, Base => 16);  
    Text_Io.Put (", inner window is ");  
    S_Long_Io.Put (Subw.Drawable.Id.Number, Base => 16);  
    Text_Io.New_Line;

    Done := False;  
    while not Done loop

        Xlbp_Event.X_Next_Event (Dpy, Event);  
        Prologue (Event, X_Event_Code'Image (Event.Kind));

        begin  
            case Event.Kind is  
                when Key_Press =>  
                    Do_Keypress (Event);

                when Key_Release =>  
                    Do_Keyrelease (Event);

                when Button_Press =>  
                    Do_Buttonpress (Event);

                when Button_Release =>  
                    Do_Buttonrelease (Event);

                when Motion_Notify =>  
                    Do_Motionnotify (Event);

                when Enter_Notify =>  
                    Do_Enternotify (Event);

                when Leave_Notify =>  
                    Do_Leavenotify (Event);

                when Focus_In =>  
                    Do_Focusin (Event);

                when Focus_Out =>  
                    Do_Focusout (Event);

                when Keymap_Notify =>  
                    Do_Keymapnotify (Event);

                when Expose =>  
                    Do_Expose (Event);

                when Graphics_Expose =>  
                    Do_Graphicsexpose (Event);

                when No_Expose =>  
                    Do_Noexpose (Event);

                when Visibility_Notify =>  
                    Do_Visibilitynotify (Event);

                when Create_Notify =>  
                    Do_Createnotify (Event);

                when Destroy_Notify =>  
                    Do_Destroynotify (Event);

                when Unmap_Notify =>  
                    Do_Unmapnotify (Event);

                when Map_Notify =>  
                    Do_Mapnotify (Event);

                when Map_Request =>  
                    Do_Maprequest (Event);

                when Reparent_Notify =>  
                    Do_Reparentnotify (Event);

                when Configure_Notify =>  
                    Do_Configurenotify (Event);

                when Configure_Request =>  
                    Do_Configurerequest (Event);

                when Gravity_Notify =>  
                    Do_Gravitynotify (Event);

                when Resize_Request =>  
                    Do_Resizerequest (Event);

                when Circulate_Notify =>  
                    Do_Circulatenotify (Event);

                when Circulate_Request =>  
                    Do_Circulaterequest (Event);

                when Property_Notify =>  
                    Do_Propertynotify (Event);

                when Selection_Clear =>  
                    Do_Selectionclear (Event);

                when Selection_Request =>  
                    Do_Selectionrequest (Event);

                when Selection_Notify =>  
                    Do_Selectionnotify (Event);

                when Colormap_Notify =>  
                    Do_Colormapnotify (Event);

                when Client_Message =>  
                    Do_Clientmessage (Event);

                when Mapping_Notify =>  
                    Do_Mappingnotify (Event);

                when others =>  
                    Text_Io.Put_Line ("Unknown event type " &  
                                      X_Event_Code'Image (Event.Kind) & ".");

            end case;  
        exception  
            when others =>  
                Text_Io.Put_Line ("Exception raised during event type " &  
                                  X_Event_Code'Image (Event.Kind));
--/ if R1000 then
                Text_Io.Put_Line (Debug_Tools.Get_Exception_Name & " at " &  
                                  Debug_Tools.Get_Raise_Location);
--/ end if;
        end;  
    end loop;

    X_Close_Display (Dpy);

end Main;