Programming Primer for the Macintosh®
1st Edition
Volume 1
Secure Checkout
Personal information is secured with SSL technology.Free Shipping
Free global shippingNo minimum order.
Description
Programming Primer for the Macintosh, Volume 1 focuses on the principles and operations of the Macintosh system.
The publication first offers information on the development environment, creating a simple program with Symantec C++, and a review of C++. Discussions focus on pointers, handles, patterns, points, creating a source file, compiling the program, adding libraries, adding file to the subject, building an application, and useful tools. The text then takes a look at the Macintosh ROM, Mac programs and system software, and toolbox managers. Topics include menu, window, control, and dialog manager, alerts, desktop interface, event-driven programming, trap mechanism, interface and library files, stack frame incompatibility, and the relationship between an application and toolbox. The book examines QuickDraw, alerts, and dialogs, memory manager, and object-oriented programming. Concerns include structures, linked list example, new and delete operators, and handling lines, rectangles, round rectangles, ovals, arcs, and polygons
The publication is a dependable reference for computer programmers and researchers interested in the Macintosh system.
Table of Contents
Acknowledgments
Chapter 1 Introduction
History of the Macintosh
Macintosh Innovations
Apple Macintosh Naming Creations
Elements Comprising a Macintosh System
Common Peripheral Options
Connecting Components
Display Options
Video Circuitry
Input Options
Apple Desktop Bus (ADB) Connections
Small Computer Standard Interface (SCSI) Devices
SCSI Connections
Audio Input/Output Options
Audio Connections
Serial Device Options
Serial Port Connections
Network/Connectivity Options
Telephone Jack
Ethernet Port
Optional Ports
Electrical Power and Power Switch
Programmer's Switch
Startup
Shutdown
Sleep
Restart
Summary
Chapter 2 The Development Environment
What the Developer Needs
CPU
RAM Memory
Disk Memory
Screens
Peripherals
Other Things
A Word About Development Environments
MPW
Symantec Development Environment
Metrowerks® Code Warrior™
A Brief Look into the Future
Summary
Chapter 3 Creating a Simple Program with Symantec C++
Starting Symantec C++
Constructing a Project
Segments
Creating a Source File
Adding the File to the Project
Adding Libraries
Compiling the Program
Running the Program
Building an Application
Summary
Chapter 4 A Review of C++, Mac Style
Basic Variable Types
Advanced Variable Types
Points
Rects
Patterns
Val Vs. Var
Arrays
Pointers
Handles
Comments
Constants
If
Switch
While
Do-While
For
Break
Continue
Operators
Unary Prefixed Operators
Unary Postfix Operators
Binary Arithmetic and Logical Operators
Binary Assignment Operators
Binary Comparison Operators
The Ternary Operator
The C Preprocessor
Structure of a C Program
C Features Not Used on the Mac
Right-Left Rule
Left-Right Walk Through
Another Example
Summary
Chapter 5 The Macintosh ROM
It's All in the Name: The Toolbox
Managers
Relationship Between an Application and the Toolbox
Trap Mechanism
A Final Word on Traps
Interface and Library Files
Stack Frame Incompatibility
Summary
Chapter 6 Mac Programs and System Software
Macintosh Programs
Desk Accessory
Device Driver
Code Resource
Macintosh System Software
Event-driven Programming
Pizza Delivery Program
Types of Events
Structure of an Event-Driven Program
Event Manager
Priority of Events
Keyboard Events: A Revisit
Auto-Key Events
The Desktop Interface
Summary
Chapter 7 Toolbox Managers
Menu Manager
Menu Bar
Menus
Resources Involved in Menus
How Menus Work
Menu Scrolling
Keyboard Equivalents
Window Manager
Windows
How Windows Work
Window Regions
Update Regions
How Windows Are Drawn
Control Manager
How Controls Are Drawn
Control States
Dialog Manager
Dialog Types
How Dialog Boxes Are Drawn
Alerts
TextEdit Manager
List Manager
Scrap Manager
Resources
Advantages of Resources
Summary
Chapter 8 QuickDraw
Video Principles
The Macintosh Screen
Shapes Drawn by QuickDraw
Handling Lines
QuickDraw Terminology—GrafVerbs
Simple QuickDraw Toolbox Calls
Handling Rectangles
Handling Round Rectangles
Handling Ovals
Handling Arcs
Handling Polygons
Handling Regions
Handling Points
Handling Pictures
Example of Putting a Picture Together
More QuickDraw Terminology
BitMaps/PixMaps
CopyBits
BitMap/PixMap Bounds Value
Port Frame
The Graphics Pen
Pen Routines
Pen Frame
Pen and Port Frames
Text Characteristics
QuickDraw Text Routines
Font Frame
QuickDraw Color
Color Frame
Basic Color
Cursors
Example
Summary
Exercise
Chapter 9 Alerts and Dialogs
Alerts
ParamText
Alert Project
Dialogs
Button Dialog Project
Dialog Check Box Project
Radio Button Project
Dialog Static Text Project
Dialog Edit Text Project
Dialog Icon Project
Dialog PICT Project
Dialog User Item Project
Dialog Sound Project
Editing Sounds
Summary
Chapter 10 Memory Manager
Stack and Heap
The Stack
The Heap
Stack Sniffer
Memory Blocks in the Heap
How Heap Space Is Allocated
Pointers and the Heap
Handles and the Heap
Dereferencing
A Valid Pointer
Memory Frame
Why You May Not Want to Lock a Handle
Low-Memory Global Variables
Summary
Chapter 11 Object-Oriented Programming
OOP and C++
Structures
Declaring and Instance Structure
Referencing Data Members of Individual Structures
Member Functions and Structures
Encapsulation
Data Hiding
Class
Objects
Instance Variable
Methods
Messages
Accessor
Constructor
Destructor
The New and Delete Operators
Friends
Linked List Example
Designing the List Example
Using the TList and TNode Classes
Derived Classes
Pointers and Objects
Traditional or Object Programming: When to Use Each
Class Libraries
Summary
Chapter 12 Debugging and Finder Resources
Debugging
Types of Bugs
Debuggers
Symantec C++ Debugging
BOMBS!!!
Finder Resources
Giving an Application Its Own Icon
Creating a BNDL Resource in ResEdit
Adding the Icon to Your Program
vers Resources
Summary
Appendix A Glossary
Appendix B Bibliography
Index
Details
- No. of pages:
- 302
- Language:
- English
- Copyright:
- © Academic Press 1995
- Published:
- 21st October 1994
- Imprint:
- Academic Press
- eBook ISBN:
- 9781483265551
About the Authors
John May
John May is the Group Leader for Computer Science in the Center for Applied Scientific Computing (CASC) at the Lawrence Livermore National Laboratory. His interests include parallel programming models, performance analysis, parallel I/O, and parallel programming tools. He has served on the MPI-2 Forum, the High Performance Debugger Forum, and the Steering Committee of the Parallel Tools Consortium. Currently, he works on the Parallel Performance Improvement project, where he is investigating performance analysis techniques for massively parallel computers.
Dr. May joined LLNL in 1994 after receiving his Ph.D. in Computer Science from the University of California, San Diego. He also holds a BA in Physics from Dartmouth College. Prior to entering graduate school, he worked at AT&T (now Lucent) Bell Laboratories on optoelectronic device technology.
Affiliations and Expertise
Lawrence Livermore National Laboratory
Judy Whittle
Ratings and Reviews
Request Quote
Tax Exemption
Elsevier.com visitor survey
We are always looking for ways to improve customer experience on Elsevier.com.
We would like to ask you for a moment of your time to fill in a short questionnaire, at the end of your visit.
If you decide to participate, a new browser tab will open so you can complete the survey after you have completed your visit to this website.
Thanks in advance for your time.