/*===============================
|	BlugsAppearanceExtras.h
|
|	Blugs 1.1 auxiliary routines.
|	www.blugs.com
|
|	Portions copyright © 1998-2001 Brian Hall
|	local_BLDrawTextBox based on NeoTextBox from an early
|		issue of d e v e l o p Magazine.
|	Theme draw state code adapted from "More is Better" sample code
|		(specifically MoreAppearance.cp) copyright © 1998 Apple Computer, Inc.
|
|===============================*/

#ifndef __APPEARANCE__
	#include <Appearance.h>
#endif




/* Low order is horizontal alignment. */
typedef UInt16	BLAlignment;
enum
{
	blAlignSame			= 0,
	blAlignSysDirection,
	blAlignHCenter,
	blAlignLeft,
	blAlignRight,
	blAlignVCenter		= blAlignHCenter << 8,
	blAlignTop			= blAlignLeft << 8,
	blAlignBottom		= blAlignRight << 8,
	
	blAlignCenter		= blAlignHCenter | blAlignVCenter,
	blAlignHMask		= 0x00FF,
	blAlignVMask		= 0xFF00
};

void		BLDrawCheckBox( Rect inRect, ThemeDrawState inState, ThemeButtonValue inValue );
void		BLDrawPopupArrow( Rect inRect, ThemeArrowOrientation inOrientation,
								ThemePopupArrowSize inSize, ThemeDrawState inState );

#if TARGET_API_MAC_CARBON
#define BLGetThemeDrawingState			GetThemeDrawingState
#define BLNormalizeThemeDrawingState	NormalizeThemeDrawingState
#define BLSetThemeDrawingState			SetThemeDrawingState
#define BLDisposeThemeDrawingState		DisposeThemeDrawingState
#else
typedef struct	BLThemeDrawingStateRec*		BLThemeDrawingState;
OSStatus	BLGetThemeDrawingState( BLThemeDrawingState* outState );
OSStatus	BLNormalizeThemeDrawingState( void );
OSStatus	BLSetThemeDrawingState( BLThemeDrawingState inState, Boolean inDisposeNow );
OSStatus	BLDisposeThemeDrawingState( BLThemeDrawingState inState );
#endif

OSErr		BLGetFont( ThemeFontID inFont, Str255 outName, SInt16* outFont,
						SInt16* outSize, Style* outStyle );
OSErr		BLUseFont( ThemeFontID inFont );
OSErr		BLGetFontInfo( ThemeFontID inFont, FontInfo* outInfo );
OSErr		BLGetStringLength( Str255 inString, ThemeFontID inFont, SInt16* outLength );
OSErr		BLTruncateString( Str255 inString, ThemeFontID inFont, SInt16 inWidthLimit,
								TruncCode inWhere, Boolean* outTruncated );
OSErr		BLGetTextDimensions( void* inText, Size inLength, ThemeFontID inFont, ThemeDrawState inState,
								Boolean inWrapToWidth, Point* ioBounds, SInt16* outBaseline );
OSErr		BLDrawTextBox( void* inText, Size inLength, ThemeFontID inFont,
							ThemeDrawState inState, Boolean inWrapToWidth,
							const Rect* inRect, SInt16 inJust );
void		BLDrawStringVerticallyCentered( Str255 inString, const Rect* inRect, UInt16 inIndent );


SInt16		BLGetPortTextFont( CGrafPtr inPort );
SInt16		BLGetPortTextSize( CGrafPtr inPort );
SInt16		BLGetPortTextFace( CGrafPtr inPort );

void		BLAlignRectInRect( BLAlignment inAlignment, Boolean inShrinkToFit,
								Rect* inAlignRect, const Rect* inThisRect );
OSErr		BLGetViewsFont( SInt16* outFont, SInt16* outSize );

