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

⟦aeacff292⟧ TextFile

    Length: 6549 (0x1995)
    Types: TextFile
    Names: »B«

Derivation

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

TextFile

with Text_Io;

with Xload_Main;  
use Xload_Main;

with Xlbt_Arithmetic;  
use Xlbt_Arithmetic;  
with Xlbt_Basic;  
use Xlbt_Basic;  
with Xlbt_Event;  
use Xlbt_Event;  
with Xlbt_Gc;  
use Xlbt_Gc;  
with Xlbt_Geometry;  
use Xlbt_Geometry;  
with Xlbt_Hint;  
use Xlbt_Hint;  
with Xlbt_Image;  
use Xlbt_Image;  
with Xlbt_Image3;  
with Xlbt_String;  
use Xlbt_String;  
with Xlbt_Window;  
use Xlbt_Window;  
with Xlbt_Visual;  
use Xlbt_Visual;

with Xlbp_Bitmap;  
use Xlbp_Bitmap;  
with Xlbp_Display;  
use Xlbp_Display;  
with Xlbp_Event;  
use Xlbp_Event;  
with Xlbp_Gc;  
use Xlbp_Gc;  
with Xlbp_Geometry;  
use Xlbp_Geometry;  
with Xlbp_Graphics;  
use Xlbp_Graphics;  
with Xlbp_Hint;  
use Xlbp_Hint;  
with Xlbp_Image;  
use Xlbp_Image;  
with Xlbp_Window;  
use Xlbp_Window;  
with Xlbp_Window_Information;  
use Xlbp_Window_Information;

package body Xload_Icon is
------------------------------------------------------------------------------
-- Xload - a version of Mah-Jongg for X Windows
--
-- Author: Gary E. Barnes        March 1989
--
-- icon.c - Deals with our icon.  Setup and execution.
------------------------------------------------------------------------------
-- 05/30/90 GEB  - Translate to Ada
------------------------------------------------------------------------------

    Xload_Width  : constant := 32;  
    Xload_Height : constant := 32;

    Xload_Bits : constant U_Char_Array :=  
       (16#00#, 16#00#, 16#C0#, 16#03#, 16#1E#, 16#00#, 16#F0#, 16#03#, 16#00#,  
        16#00#, 16#F8#, 16#03#, 16#FF#, 16#FF#, 16#FF#, 16#FF#, 16#00#, 16#00#,  
        16#FC#, 16#03#, 16#00#, 16#00#, 16#FE#, 16#03#, 16#FF#, 16#FF#, 16#FF#,  
        16#FF#, 16#00#, 16#80#, 16#FF#, 16#03#, 16#00#, 16#C0#, 16#FF#, 16#03#,  
        16#FF#, 16#FF#, 16#FF#, 16#FF#, 16#00#, 16#E0#, 16#FF#, 16#03#, 16#00#,  
        16#F0#, 16#FF#, 16#03#, 16#FF#, 16#FF#, 16#FF#, 16#FF#, 16#00#, 16#F8#,  
        16#FF#, 16#03#, 16#00#, 16#F8#, 16#FF#, 16#03#, 16#FF#, 16#FF#, 16#FF#,  
        16#FF#, 16#00#, 16#FC#, 16#FF#, 16#03#, 16#00#, 16#FC#, 16#FF#, 16#03#,  
        16#FF#, 16#FF#, 16#FF#, 16#FF#, 16#00#, 16#FE#, 16#FF#, 16#03#,  
        16#00#, 16#FE#, 16#FF#, 16#03#, 16#FF#, 16#FF#, 16#FF#, 16#FF#,  
        16#00#, 16#FF#, 16#FF#, 16#03#, 16#00#, 16#FF#, 16#FF#, 16#03#,  
        16#FF#, 16#FF#, 16#FF#, 16#FF#, 16#80#, 16#FF#, 16#FF#, 16#03#,  
        16#C0#, 16#FF#, 16#FF#, 16#03#, 16#FF#, 16#FF#, 16#FF#, 16#FF#,  
        16#F8#, 16#FF#, 16#FF#, 16#03#, 16#FF#, 16#FF#, 16#FF#, 16#03#,  
        16#FF#, 16#FF#, 16#FF#, 16#FF#, 16#FF#, 16#FF#, 16#FF#, 16#03#);

--  \f

    procedure Icon_Setup (Wm_Hints : in out X_Wm_Hints) is
------------------------------------------------------------------------------
--  Wm_Hints    - Specifies an X_Wm_Hints structure to modify, it receives
--                  an Icon_Pixmap.
--
-- Called to handle all of the Icon setup for our main shell.
------------------------------------------------------------------------------
        Ic          : X_Icon_Size_List;  
        Success     : X_Status;  
        I           : S_Long;  
        Size        : S_Long;  
        Accepted    : S_Long;  
        Icon_Pixmap : X_Pixmap := None_X_Pixmap;  
        W, H        : U_Short  := 0;  
        X, Y        : S_Short  := 0;  
        Flags       : X_Parse_Geometry_Flags;  
    begin

----If we've been asked to set up the Icon geometry then do that.

        -- Debug_Call ("Icon_Setup");
        X_Parse_Geometry (Xload_Resources.Icon_Geometry.all, X, Y, W, H, Flags);  
        if Flags (X_Value) then  
            Wm_Hints.Icon_X                     := S_Long (X);  
            Wm_Hints.Flags (Icon_Position_Hint) := True;  
        end if;  
        if Flags (Y_Value) then  
            Wm_Hints.Icon_Y                     := S_Long (Y);  
            Wm_Hints.Flags (Icon_Position_Hint) := True;  
        end if;

----Set up the Icon pixmap or window.  We try to use a pixmap instead of a
--  window because it is simply less overhead. If there are supported Icon
--  pixmap sizes then maybe we can use an icon pixmap.

        X_Get_Icon_Sizes (Dpy,  
                          X_Default_Root_Window (Dpy),  
                          Ic,  
                          Success);  
        if Success /= Failed then

----Run over all of the sizes.  We try to get a 32x32 pixmap.
--  We grab the first size that allows us to create a pixmap of 32x32 or
--  larger.

            Size := 0;  
            for I in Ic'Range loop  
                if Ic (I).Width_Inc = 0 or else  
                   Ic (I).Height_Inc = 0 then  
                    if Ic (I).Min_Width = 32 and then  
                       Ic (I).Min_Height = 32 then  
                        Size := 32;  
                        exit;  
                    elsif Ic (I).Min_Width >= 32 and then  
                          Ic (I).Min_Height >= 32 then  
                        Size := 32;  
                    else  
                        Size := 32;  
                    end if;  
                elsif Size = 0 and then  
                      32 in Ic (I).Min_Width .. Ic (I).Max_Width and then  
                      32 in Ic (I).Min_Height .. Ic (I).Max_Height and then  
                      (32 - Ic (I).Min_Width) rem Ic (I).Width_Inc = 0 and then  
                      (32 - Ic (I).Min_Height) rem Ic (I).Height_Inc = 0 then  
                    Size := 32;  
                    exit;  
                elsif Size = 0 and then  
                      Ic (I).Max_Width >= 32 and then  
                      Ic (I).Max_Height >= 32 then  
                    Size := 32;  
                end if;  
            end loop;  
            Icon_Pixmap :=              -- Size is perfect
               X_Create_Pixmap_From_Bitmap_Data  
                  (Dpy, X_Default_Root_Window (Dpy).Drawable,  
                   Xload_Bits, Xload_Width, Xload_Height,  
                   Xload_Resources.Foreground, Xload_Resources.Background,  
                   X_Default_Depth_Of_Screen  
                      (X_Default_Screen_Of_Display (Dpy)));  
        end if;

----If we managed to create a pixmap then use that.  Otherwise we don't use
--  anything.

        if Icon_Pixmap /= None_X_Pixmap then
            -- Debug_Other ("Icon_Setup", "Icon X_Pixmap");
            Wm_Hints.Icon_Pixmap              := Icon_Pixmap;  
            Wm_Hints.Flags (Icon_Pixmap_Hint) := True;  
        end if;
        -- Debug_Return ("Icon_Setup");

    end Icon_Setup;

--  \f

end Xload_Icon;