-------------------------------------------------------------------------------------- -- Ada language interface to OSF/Motif toolkit -- -- Version: 1.0 -- -- Release date: 3/19/91 -- -- Compiled under: -- VADS 5.5+ on Apollo Domain / DEC Ultrix / SCO Unix -- -- This is an Ada binding to the OSF Motif toolkit. -- Requires: -- OSF/Motif toolkit -- Verdix (or Verdix-derived) Ada libraries -- -- Author: -- Boeing Commercial Airplanes Avionics Flight Systems Organization -- -- -- Mailing Address: -- P.O. Box 3999, M/S 65-07 -- Seattle, WA 98124 -- Attn: E. J. Jones -- -- -- Approved for public release; distribution is unlimited. Per DoD Directive -- 5230.24. -- -- Copyright (c) 1991, The Boeing Company, Seattle, Washington. This software, -- the BCA Ada language interface to the OSF/Motif toolkit, produced by the -- Boeing Commercial Airplane Company and made available under STARS (Software -- Technology for Adaptable, Reliable Systems) is approved for release under -- Distribution "A" of the Scientific and Technical Information Program -- Classification Scheme (DoD Directive 5230.24) unless otherwise indicated. -- Sponsored by the U.S. Defense Advanced Research Project Agency (DARPA) under -- contract F19628-88-D-0028, the STARS program is supported by the military -- services, SEI, and MITRE, with the U.S. Air Force as the executive -- contracting agent. The code identified herein is subject to change. -- -- Permission to use, modify, copy, and comment on this software for purposes -- stated under Distribution "A" and without fee is hereby granted. This -- software retains Contractor indemnification to the Government regarding -- copyrights pursuant to the above referenced STARS contract. The Government -- disclaims all responsibility against liability, including costs and expenses -- for violation of proprietary rights, or copyrights arising out of the -- creation or use of this software. -- -- In addition, the Government and The Boeing Company disclaim all warranties -- with regard to this software, including all implied warranties of -- merchantability and fitness. In no event shall the Government or The Boeing -- Company be liable for any special, indirect or consequential damages or any -- damages whatsoever resulting from the loss of use, data or profits, whether -- in action of contract, negligence or other tortuous action, arising in -- connection with the use or performance of this software. The Boeing Company -- does not agree to support or maintain this software or to produce any -- future versions. -------------------------------------------------------------------------------------- ---------------------------------------------------------------------- -- Package body XLIB ---------------------------------------------------------------------- -- CHANGE HISTORY -- Ver. Developer Date Description -- ---- -------- ----- --------------------------------- -- 1.0 E.J.Jones(206)477-3566 12/91 Original version for Ada Motif Bindings -- -- ----------------------------------------------------------------------------- -- This package implements the features and the structures needed for -- interfacing with the Ada Motif bindings. Of course you won't find -- everything in here from Xlib just some of the stuff you will need -- to use the Motif bindings. -------------------------------------------------------------------------- package body XLIB is function ADDR_TO_DISPLAY_POINTER ( ADDR : SYSTEM.ADDRESS ) return DISPLAY_POINTER is begin return DISPLAY_POINTER ( ADDR ); end ADDR_TO_DISPLAY_POINTER; function ADDR_TO_SCREEN_POINTER( ADDR: SYSTEM.ADDRESS ) return SCREEN_POINTER is begin return SCREEN_POINTER ( ADDR ); end ADDR_TO_SCREEN_POINTER; function DISPLAY_POINTER_TO_ADDR ( DP: DISPLAY_POINTER ) return SYSTEM.ADDRESS is begin return SYSTEM.ADDRESS(DP); end DISPLAY_POINTER_TO_ADDR; function SCREEN_POINTER_TO_ADDR ( SC: SCREEN_POINTER ) return SYSTEM.ADDRESS is begin return SYSTEM.ADDRESS(SC); end SCREEN_POINTER_TO_ADDR; function X_LOAD_QUERY_FONT( DISPLAY : DISPLAY_POINTER; NAME : STRING) return X_FONT_STRUCT_PTR is function XLOADQUERYFONT( DISPLAY : in DISPLAY_POINTER; NAME : in SYSTEM.ADDRESS) return X_FONT_STRUCT_PTR; PRAGMA INTERFACE( C, XLOADQUERYFONT ); PRAGMA INTERFACE_NAME( XLOADQUERYFONT,"XLoadQueryFont"); TEMP_NAME : constant STRING := NAME & ASCII.NUL; begin return XLOADQUERYFONT( DISPLAY, TEMP_NAME'address); end X_LOAD_QUERY_FONT; function X_READ_BITMAP_FILE( DISPLAY : in DISPLAY_POINTER; DRAWABLE_ID : in DRAWABLE; FILENAME : in STRING; WIDTH : in SYSTEM.ADDRESS; HEIGHT : in SYSTEM.ADDRESS ; BITMAP : in SYSTEM.ADDRESS; X_HOT : in SYSTEM.ADDRESS; Y_HOT : in SYSTEM.ADDRESS) return AFS.AFS_LARGE_INTEGER is function XREADBITMAPFILE( DISPLAY : in DISPLAY_POINTER; DRAWABLE_ID : in DRAWABLE; FILENAME : in SYSTEM.ADDRESS; WIDTH : in SYSTEM.ADDRESS; HEIGHT : in SYSTEM.ADDRESS; BITMAP : in SYSTEM.ADDRESS; X_HOT : in SYSTEM.ADDRESS; Y_HOT : in SYSTEM.ADDRESS) return AFS.AFS_LARGE_INTEGER; TEMP_STRING : constant STRING:= FILENAME & ASCII.NUL; pragma INTERFACE ( C, XREADBITMAPFILE); pragma INTERFACE_NAME( XREADBITMAPFILE, "XReadBitmapFile"); begin return ( XREADBITMAPFILE( DISPLAY => DISPLAY, DRAWABLE_ID => DRAWABLE_ID, FILENAME => TEMP_STRING'address, WIDTH => WIDTH, HEIGHT => HEIGHT, BITMAP => BITMAP, X_HOT => X_HOT, Y_HOT => Y_HOT)); end X_READ_BITMAP_FILE; ---------------------------------------------------------------------------------- -- CURSORS ---------------------------------------------------------------------------------- procedure X_DEFINE_CURSOR( DISPLAY : in DISPLAY_POINTER; WINDOW : in WINDOW_ID; CURSOR : in CURSOR_ID) is procedure XDEFINECURSOR( DISPLAY : in DISPLAY_POINTER; WINDOW : in WINDOW_ID; CURSOR : in CURSOR_ID); pragma INTERFACE ( C , XDEFINECURSOR ); pragma INTERFACE_NAME( XDEFINECURSOR,"XDefineCursor"); begin XDEFINECURSOR( DISPLAY => DISPLAY, WINDOW => WINDOW, CURSOR => CURSOR); end X_DEFINE_CURSOR; function X_CREATE_FONT_CURSOR( DISPLAY : in DISPLAY_POINTER; SHAPE : in AFS.AFS_LARGE_NATURAL) return CURSOR_ID is function XCREATEFONTCURSOR( DISPLAY : in DISPLAY_POINTER; SHAPE : in AFS.AFS_LARGE_NATURAL) return CURSOR_ID; pragma INTERFACE( C, XCREATEFONTCURSOR); pragma INTERFACE_NAME( XCREATEFONTCURSOR,"XCreateFontCursor"); begin return( XCREATEFONTCURSOR( DISPLAY => DISPLAY, SHAPE => SHAPE)); end X_CREATE_FONT_CURSOR; end XLIB;