A Fragment Of Your Imagination 1995
From the originals
13 scansMachine-transcribed text and image descriptions. Check the linked original for uncertain words or fine print.
These are transcribed pages from the documents, not the full publications. Open the original for the remaining pages.
Image 1
A FRAGMENT OF YOUR IMAGINATION Code Fragments and Code Resources for Power Macintosh® and Macintosh Programmers Joe Zobkiw Foreword by Scott Knaster Includes a Special Version of Metrowerks CodeWarrior™ Compiler
A book cover with a vivid purple, pink, and orange streaked light-ray background, large orange three-dimensional block title letters with black drop shadows, and a small compact disc icon at the lower left.
Reading notes: The 'A' above 'FRAGMENT' is set separately at top left and is read as part of the title; reading order follows the stacked title lines. The surname 'Zobkiw' is printed as shown; the small disc caption is small and was read with moderate confidence.
- Printed product names
- Power Macintosh
- Languages
- English
PDF page 1
A FRAGMENT OF YOUR IMAGINATION Code Fragments and Code Resources for Power Macintosh® and Macintosh Programmers Joe Zobkiw Foreword by Scott Knaster Includes a Special Version of Metrowerks CodeWarrior™ Compiler
A book cover with a purple, pink, and orange rainbow-streaked background, large orange three-dimensional title lettering with black drop shadows, and a small compact disc icon in the lower left corner.
Reading notes: The small CD caption and the registered-trademark symbols are small but legible; exact symbol rendering may vary.
- Languages
- English
PDF page 2
A FRAGMENT OF YOUR IMAGINATION
A FRAGMENT OF YOUR IMAGINATION Code Fragments and Code Resources for Power Macintosh® and Macintosh Programmers JoeZobkiw Foreword by Scott Knaster • ~ Addison-Wesley Publishing Company Reading, Massachusetts • Menlo Park, California • New York Don Mills, Ontario • Wokingham, England • Amsterdam Bonn • Sydney • Singapore • Tokyo • Madrid • San Juan Paris • Seoul • Milan • Mexico City • Taipei
Reading notes: Transcript is set to an empty string because the exact text is preserved separately. The supplied copy appears to be a book title page rather than an advertisement, so no advertised products or prices were identified. No printed dates or years appear in the supplied copy. The '~' and '•' glyphs are decorative separators and were not included in any field. The headline line break (A FRAGMENT OF / YOUR IMAGINATION) is inferred from the supplied layout and may not match the physical page exactly. Fields were filled from the supplied extracted text only, not from direct inspection of an image.
- Languages
- English
PDF page 3
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and Addison-Wesley was aware of a trademark claim, the designations have been printed in initial capital letters or all capital letters. The author and publisher have taken care in preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. Libran1 of Congress Cataloging-in-Publication Data Zobkiw, Joe. A fragment of your imagination : code fragments and code resources for Power Macintosh and Macintosh programmers I Joe Zobkiw. p. cm. Includes bibliographical references and index. ISBN 0-201-48358-0 1. Macintosh (Computer)-Programming. 2. PowerPC microprocessors- Programming. I. Title. QA76.8.M3Z63 1995 005.26-dc20 95-17045 Copyright © 1995 by Joseph M. Zobkiw The Tiger Slider used in Chapter Seven, "Control Definition" is © 1995 Tiger Technologies. It was written by Robert L. Mathews. CIP The Infinity Windoid WDEF used in Chapter Eight, "Window Definitions," is© 1991-95 by Infinity Systems and Troy Gaul. The TV Tube Photoshop filter used in Chapter Ten, "Photoshop Filters," was written by Troy Gaul and was based on the Dissolve sample from Adobe. The RefConLDEF is loosely based on an initial concept by Manoj Patwardhan called LDEFl, which is© 1995 Crystal Software Inc. All rights reserved. It was renamed and changed for use in this book. All other code, unless otherwise noted, is© 1995 by Joe Zobkiw. All rights reserved. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America. Published simultaneously in Canada. Sponsoring Editor: Martha Steffen Project Manager: John Fuller Production Coordinator: Ellen Savett Cover Design: Chris St. Cyr Set in 10 point Palatino by Clarinda 1 2 3 4 5 6 7 8 9-MA-9998979695 First printing, July 1995 Addison-Wesley books are available for bulk purchases by corporations, institutions, and other organizations. For more information please contact the Corporate, Government, and Special Sales Department at (800) 238-9682.
Reading notes: Library of Congress cataloging line contains OCR-like spacing and character errors (e.g., 'Libran1', 'QA76.8.M3Z63')
- Printed product names
- Power Macintosh · Macintosh · Tiger Slider · Infinity Windoid WDEF · TV Tube · RefConLDEF · LDEFl
- Printed dates
- 1995 · July 1995 · 1991-95 · 1991
- Languages
- English
PDF page 4
The image is a entirely blank white page with no visible artwork, layout elements, or text.
PDF page 5
Contents Special Thanks Foreword Introduction xv xvii xix Chapter One Introduction to Code Resources 1 Introduction 1 Anatomy of a Code Resource 2 Calling a Code Resource 2 Real-world Example of Using Code Resources 4 Code Resource Limitations 6 Globals in Code Resources 6 32K Limit and Multisegment Code Resources 12 Code Resource Tips 13 v
- Languages
- English
PDF page 6
vi CONTENTS Chapter Two Power Macintosh Code Fragments 15 Introduction The Mixed Mode Manager Universal Procedure Pointers Using Universal Procedure Pointers The Code Fragment Manager Always Be Prepared Code Fragment Structure Fragment-specific Routines The Code Fragment Resource Resources Fat and Safe Fat Resources Code Fragment and Mixed Mode Tips Chapter Three Application Extensions 15 16 17 23 26 27 28 30 31 32 33 34 37 Introduction 37 Private Resources 38 Beyond Private Resources 39 Calling the Code 40 680x0 Code 41 PowerPC Code 42 Code That Won't Require a Mode Switch 42 Calling 680x0 Code 43 Calling PowerPC Code 46 Calling Code That Won't Require a Mode Switch 47 The Resource Code 48 Other Types of Private Resources 49 Working with Shared Libraries 52 Calling Our Shared Library 53 Our Shared Library Code 56 Compiling Our Code 58 Private Resource Tips 59
- Languages
- English
PDF page 7
Chapter Four System Extensions
Chapter Four System Extensions Introduction Anatomy of a System Extension Introduction to MenuScript and Patching Traps More MenuScript Features MenuScript Code Patching Traps for PowerPC Inside the Patches Compiling Our Code System Extension Tips Chapter Five Control Panels Introduction Anatomy of a Control Panel System Extension Changes Control Panel Code Compiling Our Code Control Panel Tips Chapter Six List Definitions Introduction List Definition Code Compiling Our Code Modifying the List Definition List Definition Tips Chapter Seven Control Definitions Introduction Icon Family Control Control Definition Code Compiling Our Code CONTENTS vii 61 61 62 64 66 67 75 79 82 84 87 87 89 90 93 98 100 103 103 106 115 117 118 121 121 123 123 127
Reading notes: Table of contents page numbers are listed in a block without clear mapping to individual entries
- Languages
- English
PDF page 8
viii CONTENTS Modifying the Icon Family Control 128 Slider Control 129 Control Definition Code 133 Compiling Our Code 143 Modifying the Slider Control 145 Control Definition Tips 145 Chapter Eight Window Definitions 147 Introduction 147 Window Definition Code 150 Main 150 New 152 Draw 152 Hit 156 CalcRegions 157 Grow and Grow Icon 158 Dispose 161 Compiling Our Code 161 Window Definition Tips 162 Chapter Nine HyperCard Externals 165 Introduction 165 PowerPC Support 167 XCMD Development 168 RecordToDisk XCMD Code 169 PlayFromDisk XCMD Code 173 Compiling Our Code 180 HyperCard External Tips 182 Chapter Ten Photoshop Filters 185 Introduction 185 ColorFill Filter 195 Filter Code 195
- Languages
- English
PDF page 9
Compiling Our Filter TV Tube Filter Compiling Our Filter Ideas for Other Filters Filter Tips Chapter Eleven Components Introduction Component Code Open Message Close Message Can Do Message Version Message Other Predefined, Unrequired Messages Do Beep Message Do Flash Message The thng Resource Component Tester Code Component Tester PowerPC Changes Compiling Our Code Component Tips CONTENTS 205 206 208 208 209 211 211 212 217 218 219 220 220 221 221 222 225 230 233 234 Chapter Twelve Advanced and Undocumented 237 Techniques Introduction 237 Building Fat Resources 238 Building Safe Fat Resources 239 Using FatMan to Create Fat and Safe Fat Resources 240 Multiple Cell Formats in a List 243 Code Optimization 245 Optimize Inner Loops 245 Unroll Loops 246 Optimize the Code that Executes the Most 246 Use Macros Instead of Function Calls 246 ix
Reading notes: The header 'thng Resource' is likely a damaged or OCR-garbled rendering of 'The 'thng' Resource' and may be uncertain. Page numbers appear interleaved with table-of-contents entries, so reading order is uncertain. Entries such as 'Fat Resources' and 'Multiple Cell Formats in a List' lack surrounding context, making some items ambiguous.
- Printed dates
- 205 · 206 · 208 · 209 · 211 · 212 · 217 · 218 · 219 · 220 · 221 · 222 · 225 · 230 · 233 · 234 · 237 · 238 · 239 · 240 · 243 · 245 · 246
- Languages
- English
PDF page 10
x CONTENTS Don't Multiply or Divide 246 Optimize Last 247 Debugging Techniques 247 If You Have to Support System 6 248 Sending AppleEvents from a Code Resource 249 Writing a Daemon Application 249 Creating Stand-alones 250 Patching Traps 251 Patching a Register-based Trap 252 System Extension Conflicts 253 Disabling Command-Option-Escape 253 Getting the Directory ID of the Frontmost 254 Finder Window Creating Your Own AS World 255 Adding a Rightmost System Menu 260 GetMenu 261 MenuSelect 261 SystemMenu 261 Conclusion 261 Projects to Try on Your Own 263 Suggested Reading 265 Magazines 265 Mac Tech 265 develop 265 Books 266 Inside Macintosh 266 Macintosh Programming Secrets (Second 266 Edition) How To Write Macintosh Software (Third 266 Edition) XCMDs for HyperCard 266 PowerPC 601 RISC Microprocessor 266 User's Manual
Reading notes: Source appears to be a table of contents with page numbers; no advertised products, prices, or dates are visible. Some line breaks and page numbers in the extracted text may not reflect the original reading order.
- Languages
- English
PDF page 11
CONTENTS xi Other 267 Technical Notes 267 Online Services 267 Internet 267 Your CodeWarrior CD-ROM 267 Appendix 269 Chapter Three Source Code 269 main.c 269 main.h 276 modules.c 276 modules.h 282 globs.c 284 globs.h 284 ae.c 285 ae.h 289 dlogutils.c 289 dlogutils.h 291 init.c 292 init.h 293 prefs.c 294 prefs.h 295 utils.c 295 utils.h 296 Shared Library.c 297 Shared Library.h 299 xShell.c 299 xShell.h 300 Chapter Four Source Code 300 INIT.c 300 INIT.h 311 PPCPatches.c 311 PPCPatches.h 314 common.c 314 common.h 321
Reading notes: Source appears to be a table of contents with page numbers; no advertised products, prices, or dates are printed.
- Printed product names
- CodeWarrior
- Languages
- English