mirror of
https://github.com/aaronsgiles/JPEGView.git
synced 2024-06-06 21:29:27 +00:00
1 line
6.0 KiB
C
1 line
6.0 KiB
C
|
//=====================================================================================
// MarchingAnts.h -- written by Aaron Giles
// Last update: 4/19/94 (version 1.0)
//=====================================================================================
// A source code library for handling rectangular graphical selections involving the
// famous "marching ants". This header file contains a brief description of each
// function; see the prelude to each function in the definition file MarchingAnts.c
// for a full description of its operation and expected use.
//=====================================================================================
// This code has been compiled successfully under MPW C, MPW PPCC, THINK C, and
// Metrowerks C/C++, both 68k and PowerPC. This code has been compiled under both the
// Universal Headers and the old 7.1 headers; if it works earlier than that I cannot
// say for sure.
//=====================================================================================
// If you find any bugs in this source code, please email me and I will attempt to fix
// them. If you have any additions/modifications that you think would be generally
// useful, email those to me as well, and I will consider incorporating them into the
// next release. My email address is giles@med.cornell.edu.
//=====================================================================================
// This source code is copyright <20> 1994, Aaron Giles. Permission to use this code in
// your product is freely granted, provided that you credit me appropriately in your
// application's About box/credits *and* documentation. If you ship an application
// which uses this code, I would also like to request that you provide me with one
// complimentary copy of the application.
//=====================================================================================
#ifndef __MARCHINGANTS__
#define __MARCHINGANTS__
//=====================================================================================
// Mac headers needed for the headers
//=====================================================================================
#include <QDOffscreen.h>
//=====================================================================================
// If you are using old headers that don't know about the new Pattern definitions you
// may need to uncomment this line.
//=====================================================================================
//#define dangerousPattern 1
//=====================================================================================
// Definition of the AntsRecord; note that there is no need for other functions to know
// anything about the internals here. Everything that you will need is provided
// through accessor functions which accept parameters of type AntsReference, which is
// intended to be an opaque data type.
//=====================================================================================
typedef struct AntsRecord {
GWorldPtr verticalWorld;
GWorldPtr horizontalWorld;
Rect bounds, limitRect;
GrafPtr port;
Boolean active;
Boolean visible;
Boolean drawn;
} AntsRecord, *AntsPtr, **AntsHandle;
//=====================================================================================
// Here is the AntsReference typedef. All ants functions accept AntsReference
// parameters.
//=====================================================================================
typedef AntsHandle AntsReference;
//=====================================================================================
// Minimum values in each dimension for a "valid" selection.
//=====================================================================================
enum {
antsMinimumX = 8,
antsMinimumY = 8
};
//=====================================================================================
// The public ants interface.
//=====================================================================================
#ifdef __cplusplus
extern "C" {
#endif
// NewAnts: allocate and initialize a new set of ants
extern A
|