Concepts

1 Introduction
1.1 Overview of The Documentation
1.1.1 What You Will Learn
1.1.2 What You Are Expected To Know
1.1.3 Roadmap to the Development Kit
1.1.4 Typographical Cues
1.2 Chapters in the Books
1.2.1 The Concepts Book
1.2.2 The Object Reference Book
1.2.3 The Tools Reference Manual
1.2.4 The Esp Book
1.3 Suggestions for Study

2 Building Your Application
2.1 What Everyone Should Read
2.2 Topics Listing
2.2.1 Defining Your User Interface
2.2.2 Providing Other User Interface
2.2.3 Documents and Data Structures
2.2.4 Accessing Hardware
2.2.5 Programming Topics
2.2.6 Other Topics

3 System Architecture
3.1 GEOS Overview
3.2 The System Architecture
3.2.1 Applications
3.2.2 Libraries
3.2.3 The Kernel
3.2.4 Device Drivers
3.2.5 The User Interface
3.3 Object-Oriented Programming
3.3.1 Objects, Messages, and Methods
3.3.2 Classes and Inheritance
3.4 Multitasking and Multithreading
3.5 The GEOS User Interface
3.5.1 The Generic User Interface
3.5.2 The Scalable User Interface
3.5.3 Windows and Window Management
3.5.4 Input
3.5.5 Menus and Dialog Boxes
3.5.6 Scrolling Views
3.5.7 Visible Object Classes
3.5.8 Geometry Manager
3.5.9 Lists
3.5.10 Other Gadgets
3.5.11 Managing Documents and Files
3.5.12 Multiple Document Interface
3.5.13 Clipboard and Quick-Transfer
3.5.14 General Change Notification
3.5.15 Help Object
3.6 System Services
3.6.1 Memory
3.6.2 Virtual Memory
3.6.3 Local Memory and Object Blocks
3.6.4 Item Database Library
3.6.5 Graphics System
3.6.6 Text
3.6.7 Print Spooler and Printing
3.6.8 Timers
3.6.9 Streams
3.6.10 Math support
3.6.11 International Support
3.7 Libraries
3.8 Device Drivers

4 First Steps: Hello World
4.1 Application Structure
4.2 Hello World
4.2.1 Features of Hello World
4.2.2 Strategy and Internals
4.2.3 Naming Conventions
4.3 Geode Parameters File
4.4 The Source File and Source Code
4.4.1 Inclusions and Global Variables
4.4.2 The Process Object
4.4.3 UI Objects
4.4.4 Code and Message Handlers
4.5 Exercises and Suggestions

5 GEOS Programming
5.1 Basic Data Types and Structures
5.1.1 Records and Enumerated Types
5.1.2 Handles and Pointers
5.1.3 Fixed Point Structures
5.2 Goc and C
5.2.1 Goc File Types
5.2.2 Conditional Code in Goc
5.2.3 Macros in Goc
5.2.4 Using Routine Pointers in Goc
5.3 The GEOS Object System
5.3.1 GEOS Terminology
5.3.2 Object Structures
5.3.3 The GEOS Message System
5.4 Using Classes and Objects
5.4.1 Defining a New Class or Subclass
5.4.2 Non-relocatable Data
5.4.3 Defining Methods
5.4.4 Declaring Objects
5.4.5 Sending Messages
5.4.6 Managing Objects

6 Applications and Geodes
6.1 Geodes
6.1.1 Geode Components and Structures
6.1.2 Launching an Application
6.1.3 Shutting Down an Application
6.1.4 Saving and Restoring State
6.1.5 Using Other Geodes
6.1.6 Writing Your Own Libraries
6.1.7 Working with Geodes
6.1.8 Geode Protocols and Release Levels
6.1.9 Temporary Geode Memory
6.2 Creating Icons
6.2.1 The Token Database
6.2.2 Managing the Token Database File
6.3 Saving User Options
6.3.1 Saving Generic Object Options
6.3.2 The GEOS.INI File
6.4 General System Utilities
6.4.1 Changing the System Clock
6.4.2 Using Timers
6.4.3 System Statistics and Utilities
6.4.4 Shutting the System Down
6.5 The Error-Checking Version
6.5.1 Adding EC Code to Your Program
6.5.2 Special EC Routines
6.6 Inter-Application Communication
6.6.1 IACP Overview
6.6.2 GenApplicationClass Behavior
6.6.3 Messages Across an IACP Link
6.6.4 Being a Client
6.6.5 Being a Server

7 The Clipboard
7.1 Overview
7.1.1 Cut, Copy, and Paste
7.1.2 Quick-Transfer
7.2 Transfer Data Structures
7.2.1 The Transfer VM File Format
7.2.2 ClipboardItemFormatInfo
7.2.3 Transfer Data Structures
7.2.4 Clipboard Item Formats
7.3 Using The Clipboard
7.3.1 Registering with the Clipboard
7.3.2 Managing the Edit Menu
7.3.3 The GenEditControl
7.3.4 Handling Cut and Copy
7.3.5 Handling Paste
7.3.6 Unregistering with the Clipboard
7.3.7 Implementing Undo
7.3.8 Transfer File Information
7.3.9 Undoing a Clipboard Change
7.4 Using Quick-Transfer
7.4.1 Supporting Quick-Transfer
7.4.2 Quick-Transfer Procedure
7.4.3 Quick-Transfer Data Structures
7.4.4 Source Object Responsibility
7.5 Shutdown Issues

8 Localization
8.1 Localization Goals
8.2 How To Use Localization
8.3 Preparing for ResEdit
8.4 International Formats
8.4.1 Number and Measure
8.4.2 Currency
8.4.3 Quotation Marks
8.4.4 Dates and Times
8.4.5 Filters for Formats
8.5 Lexical Functions
8.5.1 Comparing Strings
8.5.2 String Length and Size
8.5.3 Casing
8.5.4 Character Categories
8.5.5 Lexical Values
8.5.6 DOS Text & Code Pages

9 General Change Notification
9.1 Design Goals
9.2 The Mechanics of GCN
9.3 System Notification
9.3.1 Registering for System Notification
9.3.2 Handling System Notification
9.3.3 Removal from a System List
9.4 Application Local GCN Lists
9.4.1 Creating Types and Lists
9.4.2 Registering for Notification
9.4.3 Handling Application Notification
9.4.4 Removal from Application Lists

10 The GEOS User Interface
10.1 The GUI
10.2 The GEOS User Interface
10.3 Using the Generic Classes
10.3.1 The Generic Class Tree
10.3.2 Creating a Generic Object Tree
10.4 Using the Visible Classes
10.4.1 Visible Objects and the GenView
10.4.2 The Visible Object Document
10.4.3 Visible Object Abilities
10.4.4 The Vis Class Tree
10.4.5 Creating a Visible Object Tree
10.4.6 Working with Visible Object Trees
10.5 A UI Example
10.5.1 What TicTac Illustrates
10.5.2 What TicTac Does
10.5.3 The Structure of TicTac
10.5.4 TicTacBoard Specifics
10.5.5 TicTacPiece Specifics

11 Input
11.1 Input Flow
11.1.1 Devices and Drivers
11.1.2 Input Manager and GenSystem
11.1.3 Input Events
11.1.4 Input Hierarchies
11.2 Mouse Input
11.2.1 Mouse Events
11.2.2 Gaining the Mouse Grab
11.2.3 Large Mouse Events
11.2.4 Setting the Pointer Image
11.3 Keyboard Input
11.3.1 Keyboard Input Flow
11.3.2 Keyboard Events
11.4 Pen Input and Ink
11.4.1 Ink Data Structures
11.4.2 Ink Input Flow
11.5 Input Hierarchies
11.5.1 The Three Hierarchies
11.5.2 Common Hierarchy Basics
11.5.3 Using Focus
11.5.4 Using Target
11.5.5 Using Model
11.5.6 Extending the Hierarchies

12 Managing UI Geometry
12.1 Geometry Manager Overview
12.1.1 Geometry Manager Features
12.1.2 How Geometry Is Managed
12.2 Arranging Your Generic Objects
12.2.1 General Geometry Rules
12.2.2 Orienting Children
12.2.3 Justifying and Centering Children
12.2.4 Sizing Objects
12.2.5 Outlining the Composite
12.2.6 Using Monikers
12.2.7 Using Custom Child Spacing
12.2.8 Allowing Children to Wrap
12.2.9 Object Placement
12.3 Positioning and Sizing Windows
12.3.1 Window Positioning
12.3.2 Determining Initial Size
12.3.3 On-Screen Behavior
12.3.4 Window Look and Feel

13 Sound Library
13.1 Goals and Motives
13.2 Playing UI Sounds
13.3 Representing Tones
13.4 Single Notes
13.5 Declaring Music Buffers
13.6 Playing Music Buffers
13.7 Playing Very Large Music Buffers
13.8 Playing Sampled Sounds
13.9 Grabbing the Sound Exclusive
13.10 Simulating Musical Instruments
13.10.1 Acoustics In Brief
13.10.2 Simple Instrument Description
13.10.3 Advanced Description

14 Handles
14.1 Design Philosophy
14.2 The Global Handle Table
14.3 Local Handles

15 Memory Management
15.1 Design Philosophy
15.2 The Structure of Memory
15.2.1 Expanded/Extended Memory
15.2.2 Main Memory
15.3 Using Global Memory
15.3.1 Memory Etiquette
15.3.2 Requesting Memory
15.3.3 Freeing Memory
15.3.4 Accessing Data in a Block
15.3.5 Accessing Data: An Example
15.3.6 Data-Access Synchronization
15.3.7 Retrieving Block Information
15.3.8 The Reference Count
15.4 malloc()

16 Local Memory
16.1 Design Philosophy
16.2 Structure of a Local Memory Heap
16.2.1 The Local Heap
16.2.2 Chunks and Chunk Handles
16.2.3 Types of LMem Heaps
16.3 Using Local Memory Heaps
16.3.1 Creating a Local Heap
16.3.2 Using Chunks
16.3.3 Contracting the LMem Heap
16.3.4 Example of LMem Usage
16.4 Special LMem Uses
16.4.1 Chunk Arrays
16.4.2 Element Arrays
16.4.3 Name Arrays

17 File System
17.1 Design Philosophy
17.2 File System Overview
17.3 Disks and Drives
17.3.1 Accessing Drives
17.3.2 Accessing Disks
17.4 Directories and Paths
17.4.1 Standard Paths
17.4.2 Current Path and Directory Stack
17.4.3 Creating and Deleting Directories
17.5 Files
17.5.1 DOS Files and GEOS Files
17.5.2 Files and File Handles
17.5.3 GEOS Extended Attributes
17.5.4 File Utilities
17.5.5 FileEnum()
17.5.6 Bytewise File Operations

18 Virtual Memory
18.1 Design Philosophy
18.2 VM Structure
18.2.1 The VM Manager
18.2.2 VM Handles
18.2.3 Virtual Memory Blocks
18.2.4 VM File Attributes
18.3 Using Virtual Memory
18.3.1 How to Use VM
18.3.2 Opening or Creating a VM File
18.3.3 Changing VM File Attributes
18.3.4 Creating and Freeing Blocks
18.3.5 Attaching Memory Blocks
18.3.6 Accessing and Altering VM Blocks
18.3.7 VM Block Information
18.3.8 Updating and Saving Files
18.3.9 Closing Files
18.3.10 The VM File’s Map Block
18.3.11 File-Access Synchronization
18.3.12 Other VM Utilities
18.4 VM Chains
18.4.1 Structure of a VM Chain
18.4.2 VM Chain Utilities
18.5 Huge Arrays
18.5.1 Structure of a Huge Array
18.5.2 Basic Huge Array Routines
18.5.3 Huge Array Utilities

19 Database Library
19.1 Design Philosophy
19.2 Database Structure
19.2.1 DB Items
19.2.2 DB Groups
19.2.3 Allocating Groups and Items
19.2.4 Ungrouped DB Items
19.2.5 The DB Map Item
19.3 Using Database Routines
19.3.1 General Rules to Follow
19.3.2 Allocating and Freeing Groups
19.3.3 Allocating and Freeing Items
19.3.4 Accessing DB Items
19.3.5 Resizing DB Items
19.3.6 Setting and Using the Map Item
19.3.7 Routines for Ungrouped Items
19.3.8 Other DB Utilities
19.4 The Cell Library
19.4.1 Structure and Design
19.4.2 Using the Cell Library

20 Parse Library
20.1 Parse Library Behavior
20.1.1 The Scanner
20.1.2 The Parser
20.1.3 Evaluator
20.1.4 Formatter
20.2 Parser Functions
20.2.1 Internal Functions
20.2.2 External Functions
20.3 Coding with the Parse Library
20.3.1 Parsing a String
20.3.2 Evaluating a Token Sequence
20.3.3 Formatting a Token Sequence

21 Using Streams
21.1 Using Streams: The Basics
21.1.1 Initializing a Stream
21.1.2 Blocking on Read or Write
21.1.3 Writing Data to a Stream
21.1.4 Reading Data from a Stream
21.1.5 Shutting Down a Stream
21.1.6 Miscellaneous Functions
21.2 Using the Serial Ports
21.2.1 Initializing a Serial Port
21.2.2 Communicating
21.2.3 Closing a Serial Port
21.3 Using the Parallel Ports
21.3.1 Initializing a Parallel Port
21.3.2 Communicating
21.3.3 Closing a Parallel Port

22 PCCom Library
22.1 PCCom Library Abilities
22.2 What To Do
22.3 Staying Informed

23 Graphics Environment
23.1 Graphics Road Map
23.1.1 Chapter Structure
23.1.2 Vocabulary
23.2 Graphics Goals
23.3 Graphics Architecture
23.4 How To Use Graphics
23.5 Coordinate Space
23.5.1 Standard Coordinate Space
23.5.2 Coordinate Transformations
23.5.3 Precise Coordinates
23.5.4 Device Coordinates
23.5.5 Larger Document Spaces
23.5.6 Current Position
23.6 Graphics State
23.6.1 GState Contents
23.6.2 Working with GStates
23.7 Working With Bitmaps
23.8 Graphics Strings
23.8.1 Storage and Loading
23.8.2 Special Drawing Commands
23.8.3 Declaring a GString Statically
23.8.4 Creating GStrings Dynamically
23.8.5 Drawing and Scanning
23.8.6 Editing GStrings Dynamically
23.8.7 Parsing GStrings
23.9 Graphics Paths
23.10 Working With Video Drivers
23.10.1 Kernel Routines
23.10.2 Direct Calls to the Driver
23.11 Windowing and Clipping
23.11.1 Palettes
23.11.2 Clipping
23.11.3 Signalling Updates

24 Drawing Graphics
24.1 Drawing Goals
24.2 Shapes
24.2.1 Dots
24.2.2 Lines
24.2.3 Rectangles
24.2.4 Ellipses
24.2.5 Elliptical Arcs
24.2.6 Three-Point Arcs
24.2.7 Rounded Rectangles
24.2.8 Polylines and Polygons
24.2.9 Bezier Curves and Splines
24.2.10 Drawing Bitmaps
24.2.11 Paths
24.2.12 Regions
24.2.13 Text
24.3 Shape Attributes
24.3.1 Color
24.3.2 Patterns and Hatching
24.3.3 Mix Mode
24.3.4 Masks
24.3.5 Line-Specific Attributes

A Machine Architecture
A.1 History of the 80x86
A.2 8086 Architecture Overview
A.2.1 Memory
A.2.2 Registers
A.2.3 The Prefetch Queue
A.2.4 Inherent Optimizations

B Threads and Semaphores
B.1 Multitasking Goals
B.2 Two Models of Multitasking
B.2.1 Cooperative Multitasking
B.2.2 Preemptive Multitasking
B.3 GEOS Multitasking
B.3.1 GEOS Threads
B.3.2 Context Switches
B.3.3 Thread Scheduling
B.3.4 Applications and Threads
B.4 Using Multiple Threads
B.4.1 How GEOS Threads Are Created
B.4.2 Managing Priority Values
B.4.3 Handling Errors in a Thread
B.4.4 When a Thread Is Finished
B.5 Synchronizing Threads
B.5.1 Semaphores: The Concept
B.5.2 Semaphores In GEOS

C Libraries
C.1 Design Philosophy
C.2 Library Basics
C.3 The Library Entry Point
C.4 Exported Routines and Classes
C.5 Header Files
C.6 Compiler Directives

D The Math Library
D.1 Basic Math Functions
D.1.1 Algebraic Functions
D.1.2 Transcendental Functions
D.1.3 Random Number Generation
D.2 Conversions to Other Types
D.3 Float Formats
D.3.1 System-defined Formats
D.3.2 User-defined Formats
D.4 Direct FP Operations
D.4.1 Floating Point Numbers
D.4.2 The Floating Point Stack
D.4.3 Floating Point Math Routines


Table of contents