// Copyright 1999
// College of Computer Science
// Northeastern University Boston MA 02115

// This software may be used for educational purposes as long as this copyright
// notice is retained at the top of all files

// Should this software be modified, the words "Modified from Original" must be
// included as a comment below this notice

// All publication rights are retained.  This software or its documentation may
// not be published in any media either in whole or in part.

///////////////////////////////////////////////////////////////////////////////

// ConsoleBase.h

///////////////////////////////////////////////////////////////////////////////

#ifndef CONSOLEBASE_H_
#define CONSOLEBASE_H_

// The commented include files are brought in by later include directives

// #include "Platform.h"
// #include "CHeaders.h"
// #include "MathUtil.h"

#include "GeoTypes.h"


// must forward declare GraphicsWindow to avoid circular include chain

class EXPORT GraphicsWindow;


// since the console window is built by the system (WIN32 or MacOS)
// we will access the console properties using functions


// InitializeConsole will be called automatically before all console functions
// and before the construction of any graphics window
//
// this will guarantee that critical console actions are done up front

EXPORT void InitializeConsole();


// Get NativeWindowPtr for Console

EXPORT NativeWindowPtr GetConsoleNativeWindowPtr();


// make console the foreground window

EXPORT void MakeConsoleForeground();


// change console client size

EXPORT void SetConsoleClientSize(short xsize, short ysize);

// change console window spot

EXPORT void SetConsoleWindowSpot(short xspot, short yspot);

// change console client size and window spot

EXPORT void SetConsoleWindowSpecs(short xsize, short ysize, short xspot, short yspot);

	
// get console client size

EXPORT void GetConsoleClientSize(short& xsize, short& ysize);

// get console window spot

EXPORT void GetConsoleWindowSpot(short& xspot, short& yspot);

// get console client size and window spot

EXPORT void GetConsoleWindowSpecs(short& xsize, short& ysize, short& xspot, short& yspot);


// get console client rectangle

EXPORT RectData GetConsoleClientRect();

// get console window rectangle

EXPORT RectData GetConsoleWindowRect();

// get console window coordinates

EXPORT void GetConsoleCoordinates(short& x1, short&y1, short& x2, short& y2);


// Place console window to the right of a graphics window

EXPORT void ConsolePlaceRight(const GraphicsWindow& G);

// Place console window below a graphics window

EXPORT void ConsolePlaceBelow(const GraphicsWindow& G);


// Place console window to the right of a graphics window with given index

EXPORT void ConsolePlaceRight(int index = -1);

// Place console window below a graphics window with given index

EXPORT void ConsolePlaceBelow(int index = -1);


// utility used for both console and graphics windows to guarantee
// that an adequate amount of the window is visible on screen

EXPORT void AdjustWindowSpot(short& xspot, short& yspot);

#endif // CONSOLEBASE_H_

