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/GDevice.h
/* |
File: GDevice.h |
Contains: TGDevice is a GDevice utility class, finding out GDevice information. |
GDevice.h contains the header file information for the TGDevice class. |
Written by: Kent Sandvik |
Copyright: Copyright © 1992-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 _GDEVICE_ |
#define _GDEVICE_ |
#ifndef _DTSCPLUSLIBRARY_ |
#include "DTSCPlusLibrary.h" |
#endif |
// Toolbox Include Files |
#ifndef __TOOLUTILS__ |
#include <ToolUtils.h> |
#endif |
#ifndef __QUICKDRAW__ |
#include <Quickdraw.h> |
#endif |
// _________________________________________________________________________________________________________ // |
// Class Interface |
class TGDevice |
// TGDevice is a simple information class which will provide GDevice information, style |
// base address of the GDevice, the rowbytes information, and the depth of each |
// screen connected to the system. It will wrap around at the end of the GDList |
// to the first GDevice. |
{ |
public: |
// CONSTRUCTORS & DESTRUCTORS |
TGDevice(); // basic constructor |
virtual~ TGDevice(); // virtual destructor |
// ITERATORS |
virtual void Next(); // get next GDevice |
virtual void First(); // first value |
virtual Boolean Last() const; // last GDevice? |
// PUBLIC ACCESSORS AND MUTATORS |
virtual Ptr GetBase() const; // get address to base |
virtual long GetRow() const; // get N row value |
virtual short GetDepth() const; // get depth value |
protected: |
virtual void GetGDeviceValues(); // get the GDevice values |
protected: |
// INITIATION ROUTINES |
virtual Boolean IGDevice(); // initialize needed class information |
private: |
// FIELDS |
GDHandle fGDList; // the list of GDevices in the system |
GDHandle fFirstGDList; // the first one we encounter (used for wrap) |
Boolean fState; // state for the class |
Boolean fFirstTime; // signals constructor state |
Boolean fLast; // used to signal the last entry |
Ptr fBase; // base address of the GDevice |
long fRow; // row information |
short fDepth; // depth information |
}; |
#endif |
// _________________________________________________________________________________________________________ // |
/* Change History (most recent last): |
No Init. Date Comment |
1 khs 6/2/92 New file |
2 khs 7/5/92 First decent release |
3 khs 9/7/92 Changed the structure of the classes |
*/ |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-01-14