Solaris X Window System Developer's Guide
Total Page:16
File Type:pdf, Size:1020Kb
Solaris X Window System Developer’s Guide 2550 Garcia Avenue Mountain View, CA 94043 U.S.A. A Sun Microsystems, Inc. Business 1995 Sun Microsystems, Inc. 2550 Garcia Avenue, Mountain View, California 94043-1100 U.S.A. All rights reserved. This product or document is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation. No part of this product or document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Portions of this product may be derived from the UNIX® system, licensed from UNIX System Laboratories, Inc., a wholly owned subsidiary of Novell, Inc., and from the Berkeley 4.3 BSD system, licensed from the University of California. Third-party software, including font technology in this product, is protected by copyright and licensed from Sun’s suppliers. RESTRICTED RIGHTS LEGEND: Use, duplication, or disclosure by the government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR 52.227-19. The product described in this manual may be protected by one or more U.S. patents, foreign patents, or pending applications. TRADEMARKS Sun, Sun Microsystems, the Sun logo, SunSoft, the SunSoft logo, Solaris, SunOS, OpenWindows, DeskSet, ONC, ONC+, NFS, OpenStep, and XGL are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. UNIX is a registered trademark in the United States and other countries, exclusively licensed through X/Open Company, Ltd. OPEN LOOK is a registered trademark of Novell, Inc. PostScript and Display PostScript are trademarks of Adobe Systems, Inc. All SPARC trademarks are trademarks or registered trademarks of SPARC International, Inc. in the United States and other countries. SPARCcenter, SPARCcluster, SPARCompiler, SPARCdesign, SPARC811, SPARCengine, SPARCprinter, SPARCserver, SPARCstation, SPARCstorage, SPARCworks, microSPARC, microSPARC-II, and UltraSPARC are licensed exclusively to Sun Microsystems, Inc. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc. The OPEN LOOK® and Sun™ Graphical User Interfaces were developed by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the pioneering efforts of Xerox in researching and developing the concept of visual or graphical user interfaces for the computer industry. Sun holds a non-exclusive license from Xerox to the Xerox Graphical User Interface, which license also covers Sun’s licensees who implement OPEN LOOK GUIs and otherwise comply with Sun’s written license agreements. X Window System is a trademark of X Consortium, Inc. THIS PUBLICATION IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THIS PUBLICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN. THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THE PUBLICATION. SUN MICROSYSTEMS, INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAMS(S) DESCRIBED IN THIS PUBLICATION AT ANY TIME. Please Recycle Contents Preface. xiii New Features . xvii 1. Introduction to the Solaris X Server . 1 About the Solaris X Server . 1 X11R5 Sample Server. 2 DPS Extension . 4 X Consortium Extensions . 4 AccessX . 6 Shared Memory Transport . 7 Visual Overlay Windows . 7 X11 Libraries. 8 Applications That Run With the Solaris X Server . 8 Supported X11 Applications. 9 Unsupported Applications . 10 OpenWindows Directory Structure . 10 iii Notes on X11 Programming . 13 Compose Key Support . 13 NumLock Key Support . 13 Color Name Database . 14 Color Recommendations. 14 Further Reading . 15 2. DPS Features and Enhancements. 17 About DPS . 17 How DPS Works. 18 DPS Font Enhancements in the Solaris Server . 20 DPS Libraries . 20 Adobe NX Agent Support . 20 DPS Security Issues . 21 System File Access . 21 Secure Context Creation . 21 When DPS Encounters Internal Errors . 23 How To Access Information From Adobe. 23 DPS Compositing Operators . 24 Operator Descriptions. 26 Implementation Notes and Limitations . 31 3. Visuals on the Solaris X Server. 35 About Visuals . 35 Default Visual. 36 Visuals on Multi-Depth Devices . 37 iv Solaris X Window System Developer’s Guide—November 1995 Hints for Windows Programming With Visuals . 37 Gamma-Corrected Visuals . 38 Finding a Linear Visual. 39 Visual Selection Alternatives . 41 4. Font Support . 43 Font Support in the Solaris X Server . 43 Available Font Formats . 44 Associated Files . 45 Outline and Bitmap Fonts. 46 Replacing Outline Fonts With Bitmap Fonts . 47 Using F3 Fonts in DPS. 47 Locating Fonts . 48 Changing the Default Font Path in X11. 48 Changing the Resource Path in DPS . 50 Adding New Fonts . 51 Adding Bitmap Fonts . 52 Adding Outline Fonts . 53 Using OPEN LOOK Fonts on X Terminals . 56 5. Transparent Overlay Windows . 57 What are Transparent Overlay Windows? . 57 Basic Characteristics of Overlay Windows . 59 Overlay Window Paint Type . 59 Overlay Window Viewability. 60 Rendering Transparent Paint . 60 Contents v More on Overlay Window Characteristics . 60 Overlay Window Background . 61 Overlay Window Border. 62 Overlay Window Backing Store . 62 Overlay Window Gravity . 63 Overlay Colormap . 63 Input Distribution Model . 63 Print Capture . 64 Choosing Visuals for Overlay/Underlay Windows . 65 Example Program. 66 Overview of the Solaris Transparent Overlay Window API. 67 Creating Overlay Windows . 68 Setting the Paint Type of a Graphics Context. 70 Setting the Background State of an Overlay Window . 71 Rendering to an Overlay Window . 71 Querying the Characteristics of an Overlay Window . 72 Determining Whether a Window is an Overlay Window. 72 Determining the Paint Type of a Graphics Context. 72 Pixel Transfer Routines . 73 Filling an Area Using the Source Area Paint Type . 73 Copying an Area and Its Paint Type . 75 Retrieving Overlay Color Information . 79 Using Existing Xlib Pixel Transfer Routines With Overlay Windows. 81 vi Solaris X Window System Developer’s Guide—November 1995 Designing an Application for Portability . 82 Selecting a Visual for an Overlay/Underlay Window . 83 Selecting an Optimal Overlay/Underlay Visual Pair . 88 6. Security Issues. 93 Access Control Mechanisms . 94 User-Based . 94 Host-Based . 94 Authorization Protocols . 95 MIT-MAGIC-COOKIE-1 . 95 SUN-DES-1 . 95 Changing the Default Authorization Protocol . 96 Manipulating Access to the Server . 97 Client Authority File . ..