|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: ┃ B T ┃
Length: 8768 (0x2240) Types: TextFile Names: »B«
└─⟦85b835f43⟧ Bits:30000549 8mm tape, Rational 1000, Xlib rev 6.00 └─ ⟦0c20f784e⟧ »DATA« └─⟦1abbe589f⟧ └─⟦059497ac5⟧ └─⟦this⟧
with Xlbt_Arithmetic; use Xlbt_Arithmetic; with Xlbt_Basic; use Xlbt_Basic; with Xlbt_Context_Manager; use Xlbt_Context_Manager; with Xlbt_Context_Manager2; use Xlbt_Context_Manager2; with Xlbt_Rm; use Xlbt_Rm; with Xlbt_Rm2; use Xlbt_Rm2; with Xlbt_String; use Xlbt_String; with Xlbt_Univ_Ptr; use Xlbt_Univ_Ptr; with Xlbp_Rm_Quark; use Xlbp_Rm_Quark; package body Xlbp_Context_Manager is ------------------------------------------------------------------------------ -- X Library Context Management -- -- Xlbp_Context_Manager - Used to associate data with a window. ------------------------------------------------------------------------------ -- Copyright 1989 - 1991 by Rational, Santa Clara, California. -- Copyright 1987 - 1989 by Digital Equipment Corporation, Maynard, Mass. -- Copyright 1987 - 1989 by Massachusetts Institute of Technology -- Cambridge, Massachusetts. -- -- 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 Digital, MIT, or Rational -- not be used in advertising or publicity pertaining to distribution of -- the software without specific, written prior permission. -- -- Digital, MIT, and Rational disclaim all warranties with regard to this -- software, including all implied warranties of merchantability and fitness, -- in no event shall Digital, 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. ------------------------------------------------------------------------------ --/ if OLD_CONTEXT_MANAGER then --// --\f --// function Hash (Window : X_Window; --// Context : X_Context) return S_Natural is --// begin --// return S_Natural ((Window.Drawable.Id.Number / 8 * 7 + Context.Id) rem --// X_Context_Hash_Table'Length); --// end Hash; --// --// --/ if INLINE then --// --// pragma Inline (Hash); --// --/ end if; --// --// --\f --// function X_Delete_Context --// (Display : X_Display; --// Window : X_Window; --// Context : X_Context) return X_Associative_Returns is --// ------------------------------------------------------------------------------ --// -- Locate and remove a Window/Context pair. --// ------------------------------------------------------------------------------ --// The_Hash : S_Natural := Hash (Window, Context); --// The_Entry : X_Context_Table_Entry; --// Nxt_Entry : X_Context_Table_Entry; --// Tmp_Entry : X_Context_Table_Entry; --// Contexts : X_Context_Hash_List; --// begin --// --// if Display.Contexts /= None_X_Universal_Pointer then --// Contexts := Univ_X_Context_Hash_List.From_X_Universal_Pointer --// (Display.Contexts); --// The_Entry := Contexts (The_Hash); --// --// if The_Entry.Window = Window and then --// The_Entry.Context = Context then --// Contexts (The_Hash) := The_Entry.Next; --// Free_X_Context_Table_Entry (The_Entry); --// return Xc_Success; --// end if; --// --// Nxt_Entry := The_Entry.Next; --// while Nxt_Entry /= null loop --// if Nxt_Entry.Window = Window and then --// Nxt_Entry.Context = Context then --// Tmp_Entry := Nxt_Entry; --// The_Entry.Next := Nxt_Entry.Next; --// Free_X_Context_Table_Entry (Nxt_Entry); --// return Xc_Success; --// end if; --// The_Entry := Nxt_Entry; --// Nxt_Entry := Nxt_Entry.Next; --// end loop; --// end if; --// --// return Xc_No_Ent; --// --// end X_Delete_Context; --// --// --\f --// procedure X_Find_Context (Display : X_Display; --// Window : X_Window; --// Context : X_Context; --// Data : out X_Rm_Value; --// Status : out X_Associative_Returns) is --// ------------------------------------------------------------------------------ --// -- Insert/Replace an entry corresponding to Window/Context into the Contexts --// -- table for this Display. --// ------------------------------------------------------------------------------ --// The_Hash : S_Natural := Hash (Window, Context); --// The_Entry : X_Context_Table_Entry; --// Contexts : X_Context_Hash_List; --// begin --// --// if Display.Contexts /= None_X_Universal_Pointer then --// Contexts := Univ_X_Context_Hash_List.From_X_Universal_Pointer --// (Display.Contexts); --// The_Entry := Contexts (The_Hash); --// --// while The_Entry /= null loop --// if The_Entry.Window = Window and then --// The_Entry.Context = Context then --// Data := The_Entry.Data; --// Status := Xc_Success; --// return; --// end if; --// end loop; --// end if; --// --// Data := None_X_Rm_Value; --// Status := Xc_No_Ent; --// --// end X_Find_Context; --// --// --\f --// function X_Save_Context --// (Display : X_Display; --// Window : X_Window; --// Context : X_Context; --// Data : X_Rm_Value) return X_Associative_Returns is --// ------------------------------------------------------------------------------ --// -- Insert/Replace an entry corresponding to Window/Context into the Contexts --// -- table for this Display. --// ------------------------------------------------------------------------------ --// The_Hash : S_Natural := Hash (Window, Context); --// The_Entry : X_Context_Table_Entry; --// Contexts : X_Context_Hash_List; --// begin --// if Display.Contexts = None_X_Universal_Pointer then --// Contexts := new X_Context_Hash_Table; --// Display.Contexts := --// Univ_X_Context_Hash_List.To_X_Universal_Pointer (Contexts); --// else --// Contexts := Univ_X_Context_Hash_List.From_X_Universal_Pointer --// (Display.Contexts); --// end if; --// --// The_Entry := Contexts (The_Hash); --// --// while The_Entry /= null loop --// if The_Entry.Window = Window and then --// The_Entry.Context = Context then --// The_Entry.Data := Data; --// return Xc_Success; --// end if; --// end loop; --// --// Contexts (The_Hash) := --// new X_Context_Table_Entry_Rec'((Window => Window, --// Context => Context, --// Data => Data, --// Next => Contexts (The_Hash))); --// return Xc_Success; --// --// exception --// --// when Storage_Error => --// return Xc_No_Mem; --// --// end X_Save_Context; --// --// --\f --// function X_String_To_Context (Name : X_String) return X_Context is --// begin --// return X_Context (X_Rm_String_To_Quark (Name)); --// end X_String_To_Context; --// --// --\f --// function X_Context_To_String (Context : X_Context) return X_String is --// ------------------------------------------------------------------------------ --// -- Context - Specifies the X_Context to convert. --// -- --// -- Returns the original string name of a context. --// ------------------------------------------------------------------------------ --// begin --// return X_Rm_Quark_To_String (X_Rm_Quark (Context)); --// end X_Context_To_String; --// --// --\f --// function X_Unique_Context return X_Context is --// begin --// return X_Context (X_Rm_Unique_Quark); --// end X_Unique_Context; --// --/ end if; --\f end Xlbp_Context_Manager;