Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
Headers/GraphicsEnv.h
/* |
File: GraphicsEnv.h |
Contains: GraphicsEnv is a collection of utility classes that could be used for defining grafport values |
(font, pen drawing, color). |
GraphicsEnv.h contains the graphics environment class definitions. |
Written by: Kent Sandvik |
Copyright: Copyright © 1993-1999 by Apple Computer, Inc., All Rights Reserved. |
You may incorporate this Apple sample source code into your program(s) without |
restriction. This Apple sample source code has been provided "AS IS" and the |
responsibility for its operation is yours. You are not permitted to redistribute |
this Apple sample source code as "Apple sample source code" after having made |
changes. If you're going to re-distribute the source, we require that you make |
it clear in the source that the code was descended from Apple sample source |
code, but that you've made changes. |
Change History (most recent first): |
8/18/1999 Karl Groethe Updated for Metrowerks Codewarror Pro 2.1 |
*/ |
// Declare label for this header file |
#ifndef _GRAPHICSENV_ |
#define _GRAPHICSENV_ |
#ifndef _DTSCPLUSLIBRARY_ |
#include "DTSCPlusLibrary.h" |
#endif |
// TOOLBOX INTERFACES |
#ifndef __QUICKDRAW__ |
#include <Quickdraw.h> |
#endif |
// _________________________________________________________________________________________________________ // |
// TFontEnvironment Class Interface. |
class TFontEnvironment |
// TFontEnvironment will define the font size, numver and style. |
{ |
public: |
// CONSTRUCTORS AND DESTRUCTORS |
TFontEnvironment(short mode = srcOr, |
short fontNo = 0, |
short textSize = 0, |
Style newStyle = 0); |
virtual~ TFontEnvironment(); // default destructor |
// MAIN INTERFACE |
virtual void Set(); // set font values into grafport |
virtual void Reset(); // reset the grafport concerning font values |
// FIELDS |
protected: |
short fFont; // selected font |
short fTextSize; // font size |
Style fStyle; // font style (plain, bold, italicÉ) |
short fMode; // transfer mode |
}; |
// _________________________________________________________________________________________________________ // |
// TPenEnvironment Class Interface. |
class TPenEnvironment |
// TPenEnvironment will define the pen size, pattern and mode. |
{ |
public: |
// CONSTRUCTORS AND DESTRUCTORS |
TPenEnvironment(short mode = srcOr, |
Pattern penPattern = qd.black, |
short penWidth = 1, |
short penHigh = 1); |
virtual~ TPenEnvironment(); // default destructor |
// MAIN INTERFACE |
virtual void Set(); // set pen values in grafport |
virtual void Reset(); // reset the grafport concerning pen values |
// FIELDS |
protected: |
short fMode; // mode of pen |
ConstPatternParam fPattern; // pen pattern |
short fWidth; // width of pen |
short fHigh; // high of pen |
}; |
// _________________________________________________________________________________________________________ // |
// TColorEnvironment Class Interface. |
class TColorEnvironment |
// TColorEnvironment will define the grafport colors (background, foreground). |
{ |
public: |
// CONSTRUCTORS & DESTRUCTORS |
TColorEnvironment(unsigned short red, |
unsigned short green, |
unsigned short blue); |
TColorEnvironment(RGBColor theColor); // additional constructor, takes an RGBColor struct |
virtual~ TColorEnvironment(); // default destructor |
// MAIN INTERFACE |
virtual void SetForeground(); // set foreground color |
virtual void SetBackground(); // set background color |
virtual void Reset(); // reset grafport to black&white |
// FIELDS |
protected: |
RGBColor fColor; // RGB values for our color grafport |
}; |
#endif |
// _________________________________________________________________________________________________________ // |
/* Change History (most recent last): |
No Init. Date Comment |
1 khs 1/2/93 New file |
2 khs 1/7/93 Cleanup |
*/ |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-01-14