007-2006-100 Contributors
Total Page:16
File Type:pdf, Size:1020Kb
Indigo Magic™ Desktop Integration Guide Document Number 007-2006-100 CONTRIBUTORS Written by Beth Fryer, Jed Hartman, Ken Jones, and Pete Sullivan Illustrated by Beth Fryer and Seth Katz Edited by Christina Cary Production by Derrald Vogt, Cindy Stief, and Linda Rae Sande Engineering contributions by Bob Blean, Susan Dahlberg, Susan Ellis, John Krystynak, Chandra Pisupati, Jack Repenning, CJ Smith, Dave Story, Steve Strasnick, Rebecca Underwood, Steve Yohanan, and Betsy Zeller St Peter’s Basilica image courtesy of ENEL SpA and InfoByte SpA. Disk Thrower image courtesy of Xavier Berenguer, Animatica. © Copyright 1994, 1995, 1996 Silicon Graphics, Inc.— All Rights Reserved The contents of this document may not be copied or duplicated in any form, in whole or in part, without the prior written permission of Silicon Graphics, Inc. RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure of the technical data contained in this document by the Government is subject to restrictions as set forth in subdivision (c) (1) (ii) of the Rights in Technical Data and Computer Software clause at DFARS 52.227-7013 and/or in similar or successor clauses in the FAR, or in the DOD or NASA FAR Supplement. Unpublished rights reserved under the Copyright Laws of the United States. Contractor/manufacturer is Silicon Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. Silicon Graphics, the Silicon Graphics logo, and IRIS are registered trademarks and IRIS, IRIS GL, IRIS IM, IRIS InSight, IRIS ViewKit, IRIX, GoldenGate, IconSmith, Indigo Magic, the Graphics Library, OpenGL, Open Inventor, and RapidApp are trademarks of Silicon Graphics, Inc. Apple is a registered trademark and Apple Quicktime is a trademark of Apple Computer, Inc. Kodak is a trademark of Eastman Kodak Company. Microsoft is a registered trademark of Microsoft Corporation. Motif and OSF/Motif are trademarks of the Open Software Foundation. PostScript is a registered trademark of Adobe Systems, Inc. Solaris is a registered trademark and Sun and SunOS are trademarks of Sun Microsystems, Inc. Wavefront is a trademark of Wavefront Technologies. X Window System is a trademark of the Massachusetts Institute of Technology. Indigo Magic™ Desktop Integration Guide Document Number 007-2006-100 Contents List of Examples xv List of Figures xvii List of Tables xix About This Guide xxi What This Guide Contains xxi How to Use This Guide xxi What You Should Know Before Reading This Guide xxi Suggested Reading xxii Font Conventions in This Guide xxiii Integrating an Application Into the Indigo Magic Desktop Environment: An Introduction xxv About the Indigo Magic Desktop Environment xxv Implementation Strategies and Toolkits xxvii Implementation Checklist xxviii Using ViewKit and RapidApp xxix Integrating an Application xxxii PART I Getting the Right Look and Feel 1. Getting the Right Look and Feel: An Overview 5 About the Indigo Magic Look and Feel 5 Getting the Right Look and Feel: The Basic Steps 6 iii Contents 2. Getting the Indigo Magic Look 9 3. Using Schemes 13 Schemes Overview 13 Why You Should Use Schemes 14 Basic Scheme Concepts 14 Using Schemes in Your Application 15 Turning on Schemes for Your Application 15 Special Considerations for Programming with Schemes 16 Assigning Non-Default Colors and Fonts to Widgets 17 Directly Accessing Colors and Fonts 18 Pre-Defined Scheme Resources and Symbolic Values 21 Extending a Scheme to Support New Colors 24 Scheme File Organization 24 How to Extend a Scheme 25 Testing Your Application with Schemes 27 Creating New Schemes 27 Hard-Coding a Scheme for an Application 28 4. Using the Silicon Graphics Enhanced Widgets 31 Using the SGI Enhanced Widgets 31 Using the Widget Demos 31 Location of Widget Demos 32 Instructions for Building the Widget Demos 32 The Enhanced Widgets 33 The File Selection Box Widget 33 The Scale (Percent Done Indicator) Widget 35 The Text and TextField Widgets 36 The Mixed-Model Programming Widgets 37 iv Contents The SGI Enhanced Widgets 38 The Color Chooser Widget 39 The Dial Widget 44 The Thumbwheel Widget 46 The Drop Pocket Widget 49 The Finder Widget 51 The Graph Widget 54 The Springbox Widget 55 The Grid Widget 56 HTML Viewer Component 60 Overview of the HTML Viewer Components 62 Viewer Components 62 Supported Tags and Attributes 63 5. Window, Session, and Desk Management 69 Window, Session, and Desk Management Overview 69 Window Management 69 Session Management 70 Desk Management 74 Further Reading on Window and Session Management 75 Implementing an Application Model 75 Implementing the “Single Document, One Primary” Model 76 Implementing the “Single Document, Multiple Primaries” Model 76 Implementing the “Multiple Document, Visible Main” Model 76 Implementing the “Multiple Document, No Visible Main” Model 77 Interacting With the Window and Session Manager 78 Creating Windows and Setting Decorations 79 Handling Window Manager Protocols 85 Setting the Window Title 89 Controlling Window Placement and Size 90 v Contents 6. Customizing Your Application’s Minimized Windows 95 Some Different Sources for Minimized Window Images 95 Creating a Minimized Window Image: The Basic Steps 96 Using mediarecorder to Get an RGB Format Image 97 Resizing the RGB Image Using imgworks 99 Setting the Minimized Window Label 99 Changing the Minimized Window Image 100 7. Interapplication Data Exchange 103 Data Exchange Overview 103 Primary Transfer Model Overview 104 Clipboard Transfer Model Overview 105 Interaction Between the Primary and Clipboard Transfer Models 106 Implementing the Primary Transfer Model 107 Data Selection 107 Requests for the Primary Selection 108 Loss of the Primary Selection 109 Inserting the Primary Selection 109 Implementing the Clipboard Transfer Model 110 Cut Actions 110 Copy Actions 112 Requests for the Clipboard Selection 112 Paste Actions 112 Loss of the Clipboard Selection 113 Supported Target Formats 113 Data Conversion Service 117 The Converter Registry 118 The GoldenGate API 118 vi Contents 8. Monitoring Changes to Files and Directories 121 FAM Overview 121 Theory of Operation 122 FAM Libraries and Include Files 122 The FAM Interface 123 Opening and Closing a FAM Connection 123 Monitoring a File or Directory 124 Suspending, Resuming, and Canceling Monitoring 125 Detecting Changes to Files and Directories 126 FAM Examples 131 Using FAM 132 Waiting for File Changes 133 Polling for File Changes 136 9. Providing Online Help With SGIHelp 141 Overview of SGIHelp 141 The Help Viewer 142 The SGIHelp Library and Include File 143 Help Document Files 144 Application Helpmap Files 144 The SGIHelp Interface 144 Initializing the Help Session 144 Displaying a Help Topic 146 Displaying the Help Index 147 Implementing Help in an Application 148 Constructing a Help Menu 149 Implementing a Help Button 150 Providing Context-Sensitive Help 151 Application Helpmap Files 153 Helpmap File Conventions 154 Helpmap File Format 154 Widget Hierarchies in the Helpmap File 157 vii Contents Writing the Online Help 159 Overview of Help Document Files 159 Viewing the Sample Help Document Files 160 Creating a Help Document File 161 Preparing to Build the Online Help 161 Building the Online Help 163 Finding and Correcting Build Errors 163 Producing the Final Product 165 Creating the Installable Subsystem 165 Incorporating the Help Subsystem into an Installable Product 165 Incorporating the Help Subsystem into a Product With a Custom Installation Script 166 Bibliography of SGML References 166 10. Handling Users’ System Preferences 171 Handling the Mouse Double-Click Speed Setting 171 Using the Default Viewer and Editor Utilities Panel 172 Selecting Utilities and Their Values 173 Setting the Preferred Text Editor 173 PART II Creating Desktop Icons 11. Creating Desktop Icons: An Overview 179 About Indigo Magic Desktop Icons 179 Checklist for Creating an Icon 181 Creating an Icon: The Basic Steps Explained in Detail 182 Step One: Tagging Your Application 183 Step Two: Drawing a Picture of Your Icon 183 Step Three: Programming Your Icon 184 Step Four: Compiling the Source Files 189 Step Five: Installing Your Application in the Icon Catalog 190 Step Six: Restarting the Desktop 191 Step Seven: Updating Your Installation Process 191 viii Contents 12. Using IconSmith 195 About IconSmith 196 Where to Install Your Completed Icon 196 Some Definitions 197 Starting IconSmith 198 IconSmith Menus 199 IconSmith Windows 200 Drawing With IconSmith 200 Drawing Paths 202 Drawing Filled Shapes 202 Deleting 203 Keeping the 3-D Look 204 Drawing for All Scales 204 Sharing Design Elements 205 Templates 206 Selecting 206 Partial 207 Deselect Fragments 207 Select Next 208 Select All 208 Transformations 208 Scale 209 Scale X and Y 209 Rotate 209 Shear Y 210 Concave Polygons 210 Constraints: Gravity (Object) Snap and Grid Snap 211 Controlling the Grid 212 Controlling Gravity 212 Icon Design and Composition Conventions 213 Importing Generic Icon Components (Magic Carpet) 213 Icon Size 214 Selecting Colors 214 ix Contents Advanced IconSmith Techniques 215 Drawing a Circle 215 Drawing an Oval 217 Isometric Circles 218 13. File Typing Rules 225 A Table of the FTRs With Descriptions 226 Naming File Types: The TYPE Rule 227 Categorizing File Types: The SUPERTYPE Rule 228 Matching File Types With Applications: The MATCH Rule 229 Matching Tagged Files 230 Matching Files Without the tag Command 231 Matching Non-Plain Files: The SPECIALFILE Rule 235 Adding a Descriptive Phrase: The LEGEND Rule 235 Setting FTR Variables: The SETVAR Rule 236 Programming Open Behavior: The CMD OPEN Rule 237 Programming Alt-Open Behavior: The CMD ALTOPEN Rule 238 Programming Drag and Drop Behavior: The CMD DROP and DROPIF Rules 239 Mapping Names: The MAP Rule 242 Programming Print Behavior: The CMD PRINT Rule 242 Adding Menu Items: The MENUCMD Rule 243 Getting the Icon Picture: The ICON Rule 244 Creating a File Type: An Example 246 Open an FTR File for scribble 246 Add the Rules to the scribble FTR File 247 Name the scribble FTR File and Put It in the Appropriate Directory 250 The scribble FTRs 251 x Contents 14.