BareBones.h

/*
    File:       BareBones.h
 
    Contains:   Common header file included by all source files
 
    Written by: Chris White 
 
    Copyright:  Copyright © 1995-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/6/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
                
 
*/
 
 
#ifndef __BAREBONES__
#define __BAREBONES__
 
 
 
// System includes
#ifndef __CONTROLS__
    #include <Controls.h>
#endif
 
#ifndef __QDOFFSCREEN__
    #include <QDOffscreen.h>
#endif
 
 
 
// Application includes
#ifndef __SCROLLBARS__
    #include "ScrollBars.h"
#endif
 
 
 
 
#define DEBUGGING           1           // Anything that shouldn't normally occur
#define WARNINGS            0           // Something that can occur, but you might like to know about
 
 
#define kFourQuestionMarks  0x3F3F3F3F  // C++ compilers that expand trigraphs don't
                                        // like '????'. This should keep them all happy.
 
 
enum
{
    // Generall application stuff
    
    kCreatorCode = kFourQuestionMarks,
    kSleepTime = 60L
 
};
 
 
 
enum
{
    // Menu ID numbers
    
    kMenuBarID = 1000,
    kAppleMenu = 1000,
    kFileMenu = 1001
};
 
 
 
enum
{
    // Apple menu commands
    
    cAbout = 1
};
 
 
 
enum
{
    // File menu commands
    
    cQuit = 1
};
 
 
 
 
 
 
enum
{
    // Error strings
    
    kNeedSystem7 = 1,
    kNeedColorQuickdraw,
    kGenericErrorStr
};
 
 
 
enum
{
    // Windows
    
    kDisplayWindow = 1000,
    kAboutDialog = 1000,
    kErrorDialog
};
 
 
 
enum
{
    // Strings
 
    kErrorStrings = 1000
};
 
 
 
enum
{
    // Misc Resources
 
    kPictureID = 1000,
    kScrollBar = 1000
};
 
 
 
enum
{
    // Misc constants
 
    kNoFlags = 0
};
 
 
 
 
struct WindowInfo
{
    ControlRef  hScrollBar;
    ControlRef  vScrollBar;
    GWorldPtr   offscreen;
};
 
typedef struct WindowInfo tWindowInfo, *tWindowInfoPtr;
 
 
 
// Global Variable Definitions. This allows me to include this file
// in all sources with the extern keyword used in all instances except
// the main source file.
 
#ifdef __MAIN__
    #define global
#else
    #define global  extern
#endif
 
 
global  Boolean                 gQuit;                      // quit program flag
global  Boolean                 gInBackground;
global  SInt32                  gSleepTime;
 
global  ControlActionUPP        gScrollControlActionUPP;
global  IndicatorActionUPP      gScrollThumbActionUPP;
 
 
 
 
 
#endif  // __BAREBONES__