/*===============================
Copyright (C) 1998-2003 Brian "Moses" Hall

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*===============================*/
#ifndef __BLUGS__
#define __BLUGS__


/* Mask out everything irrelevant to Rez when this file is included from Blugs.r.
	For C compilation everything is relevant.
*/
#ifndef REZ

#ifdef __APPLE_CC__
	#include <Carbon/Carbon.h>
#else
#ifndef __APPEARANCE__
	#include <Appearance.h>
#endif
#endif

#ifndef __BL_USE_CARBON_API__
#if TARGET_API_MAC_CARBON
	#define __BL_USE_CARBON_API__	1
#elif TARGET_RT_MAC_MACHO
	#define __BL_USE_CARBON_API__	1
#else
	#define __BL_USE_CARBON_API__	0
#endif
#endif

/* If using or compiling Pascal versions of Blugs,
	BL_PROC should be defined to 'pascal' in a suitable prefix file. */
#ifndef BL_PROC
	#if defined( __cplusplus )
		#define BL_PROC	extern "C"
	#else
		#define BL_PROC
	#endif
#endif

#pragma mark Basic Types
typedef UInt16			BLMessage;
typedef UInt16			BLContentType;
typedef OSType			BLNotificationMessage; /* Issued by Blugs. */


typedef struct
{
	UInt16	row;
	UInt16	col;
} BLCell;

typedef UnsignedWide	BLUID;
typedef struct
{
	BLUID		rowID;
	BLUID		colID;
} BLCellUID;

#ifndef BlugsRef
typedef struct OpaqueBLReference *			BlugsRef;
#endif


/*===============================*/
/* Pass zero or more of these OR-combined flags to BLEnter and BLSettings. */
#pragma mark Global Settings Flags
enum
{
	blNoSettings		= 0x00000000,
	blTempGWorlds		= 0x00000001,	/* Use temp memory when creating GWorld for list. */
	blMax16BitGWorlds	= 0x00000002,	/* Use 16 as the depth for calls to NewGWorld and
											UpdateGWorld. */
	blMax8BitGWorlds	= 0x00000004,	/* Use 8 as the depth for calls to NewGWorld and
											UpdateGWorld. Anything less than 8 bits looks
											really awful. */
	blDumpGWorldsOnHide	= 0x00000008	/* List only has a GWorld when it's visible. (1.01) */
};

/*===============================*/
/* Get these flags from BLEnvironment. */
#pragma mark Environment Flags
enum
{
	blInitialized			= 1 << 0,	/* Blugs is initialized. */
	blHasAppearance			= 1 << 1,	/* Appearance Manager present. */
	blHasAqua				= 1 << 2,	/* Running under Aqua. Carbon builds on X only. */
	blHasDragMgr			= 1 << 3,	/* Drag Manager present. */
	blHasTranslucentDrags	= 1 << 4,	/* Drag Manager 7.5 present. */
	blHasControlMgr2		= 1 << 5	/* Control Manager 2 present (Mac OS 8.5). */
};

/*===============================*/
#pragma mark List Flags
#endif /* !REZ */

enum
{
	blResizableHeight	= 0x00000001,	/* User can resize row height by dragging edge of
											title in vertical title bar. */
	blResizableWidth	= 0x00000002,	/* User can resize row width by dragging edge of
											title in horizontal title bar. */
	blHorizontalScroll	= 0x00000004,	/* List has a horizontal scroll bar. */
	blVerticalScroll	= 0x00000008,	/* List has a vertical scroll bar. */
	blLiveScroll		= 0x00000010,	/* List scrolls as the thumb is dragged. */
	blSmallScroll		= 0x00000020,	/* The list is in a utility (floating) window.
											For consistency with UI guidelines use thinner
											scroll bars -- 11 pixels wide instead of 16. */
	blAutodraw			= 0x00000040,	/* List changes are reflected onscreen and offscreen. */
	blHasGrow			= 0x00000080,	/* Leave space for a grow box (either is part of an
											Appearance window frame or one you draw yourself). */
	blDrawGrow			= 0x00000100,	/* Draw a grow box. Only set this feature if the list is
											not bounded by the window frame, or there is no
											chance that Blugs' drawing will interfere with an
											Appearance Manager grow box.
											Ignored if there are no scroll bars. */
	blCanFocus			= 0x00000200,
	blVisible			= 0x00000400,	/* List is drawn onscreen. */
	blActive			= 0x00000800,	/* List is enabled, responds to events. */
	blInlineEditOnClick	= 0x00001000,	/* Click to start inline edit (like Finder).
											Otherwise app must initiate via BLBeginInlineEdit. */
	blDisclosure		= 0x00008000,	/* Uses disclosure triangles. */
	blBorderMetrics		= 0x00010000,	/* Truncates title bevel buttons by 1 pixel on the left and/or
											top. This way the scroll bar ends can be
											overlapped by a list border or window border without
											an ugly gutter between the border and the button.
											(Blugs draws the button as though it were 1 pixel larger
											so the black border is clipped out.)
											Automatically set if blDrawBorder is set.
											Ignored under Aqua (I think) */
	blDrawBorder		= 0x00020000,	// Blugs draws a theme or black border around the list.
	blSortable			= 0x00040000,	// List can be sorted.
	blDrawSortButton 	= 0x00080000,
	blTable				= 0x00100000,	/* All cells in a column have a single content handler/type. */
	blOnlyOne			= 0x00200000,	/* Maximum of one cell can be selected. */
	blUseSense			= 0x00400000,	/* Shift-click toggles selection status. */
	blNoExtend			= 0x00800000,	/* Shift-click does not select intervening cells. */
	blNoDisjoint		= 0x01000000,	/* Only a range of consecutive cells can be selected. */
	blPinRight			= 0x02000000,	// Blugs tries to keep the last column pinned to the right edge.
	blImmediateInline	= 0x04000000,	// Inline edit immediately on click -- no delay.
	blIndentTriangles	= 0x08000000	// Indent disclosure triangles OS X style.
};


/*===============================*/
#ifndef REZ
#pragma mark Drag flags
#endif
enum
{
	blCanStartDrags				= 0x0001,	/* This must be set to start a drag. */
	blAllowDragsOnlyToSelf		= 0x0002,	/* ONLY drag cells within the same list. */
	blImmediateDrag				= 0x0004,	/* Set this to click and drag in one motion. */
	blReceiveDrags				= 0x0008,	/* List can receive any valid drag. */
	blReceiveDragsFromSelf		= 0x0010,	/* List can receive drag from self. */
	blReceiveDragsOnlyFromSelf	= 0x0020	/* List ONLY receives drags from self. */
};


/*===============================*/
#ifndef REZ
#pragma mark Row flags
#endif
enum
{
	blRowHasChildren			= 0x0001,	/* Row has a disclosure triangle. */
	blRowIsExpanded				= 0x0002,	/* Disclosure triangle points down. */
	blRowIsTitleRow				= 0x0004,	/* Column 1 extends to full list width. */
	blRowDrawBorder				= 0x0008,	/* Draw border at bottom of this row. */
	blRowMarkedForMovement		= 0x0010,	/* Row will be moved in next call to
												BLMoveMarkedRows. Generally you will only use
												this flag in BLSetRowFlags; it doesn't make
												much sense to use it in a 'LiSt' resource,
												although you can if you want. */
	blRowSelectAll				= 0x0020	/* Selecting a cell selects all cells in its row. */
};


/*===============================*/
#ifndef REZ
#pragma mark Column flags
#endif
enum
{
	blColumnCantSelect			= 0x0001,	// Can't select cells in this column.
	blColumnDrawBorder			= 0x0002	// Draw border to right of this column.
};


/*===============================*/
#ifndef REZ
#pragma mark Title bar info & flags

typedef struct
{
	BLContentType	defaultContentType;		// The content type to which new titles are initialized
	UInt16			thickness;				// The title bar size. (Horizontal bar thickness is ignored under Aqua.)
	UInt16			whichTitleBarFlags;		// A mask indicating which of the titleBarFlags are applied.
	UInt16			titleBarFlags;			// New title bar flags; bits masked in by whichTitleBarFlags are applied.
	UInt16			whichDefaultTitleFlags;	// A mask indicating which of the defaultTitleFlags are applied.
	UInt16			defaultTitleFlags;		// The flags to which new titles are initialized;
											//	bits masked in by whichDefaultTitleFlags are applied.
} BLTitleBarInfo;

#endif /* !REZ */

enum
{
	blSetTitleBarThickness			= 1 << 0,
	blSetTitleBarDefaultContentType	= 1 << 1,
	blSetTitleBarFlags				= 1 << 2,
	blSetTitleBarDefaultTitleFlags	= 1 << 3
};

enum
{
	blTitleBarResizableThickness 	= 0x0001,	/* User can drag-resize horizontal title bar height,
													or vertical width. */
	blTitleBarReorderable			= 0x0002,	/* User can drag-reorder titles. */
	blAllPublicTitleBarFlags		= (blTitleBarResizableThickness | blTitleBarReorderable)
};


/*===============================*/
#ifndef REZ
#pragma mark Title info & flags

typedef struct
{
	BLContentType	titleContentType;
	UInt16			whichTitleFlags;
	UInt16			titleFlags;
} BLTitleInfo;

#endif /* !REZ */

enum
{
	blTitleSelectable			= 0x0001,	/* User can click on this title and select it. */
	blAllPublicTitleFlags		= (blTitleSelectable)
};

enum
{
	blSetTitleContentType		= 0x0001,
	blSetTitleFlags				= 0x0002,
	blSetAllTitleFields			= (blSetTitleContentType | blSetTitleFlags)
};


/*===============================*/
#ifndef REZ
#pragma mark Widget info & flags

typedef struct
{
	UInt32				command;
	BLContentType		content;
	SInt16				size;
	UInt16				whichWidgetFlags;
	UInt16				widgetFlags;
} BLWidgetInfo;

#endif /* !REZ */

enum
{
	blSetWidgetCommand			= 0x0001,
	blSetWidgetSize				= 0x0002,
	blSetWidgetContentType		= 0x0004,
	blSetWidgetFlags			= 0x0008,
	blSetAllWidgetFields		= (blSetWidgetCommand | blSetWidgetSize | blSetWidgetContentType |
									blSetWidgetFlags)
};

enum
{
	blWidgetInert				= 0x0001,	/* Widget does not interact with the user. */
	blWidgetOn					= 0x0002,	/* Placard is drawn as pressed. */
	blWidgetSticky				= 0x0004,	/* Stays on when pressed. (i.e., not push-button) */
	blWidgetToggles				= 0x0008,	/* Push once to turn it on, push again to turn off.
												Ignored unless blWidgetSticky bit is set also. */
	blWidgetRadioGroup			= 0x0010,	/* Only one widget with this flag can be pressed.
												Only makes sense for blWidgetSticky items. */
	blAllPublicWidgetFlags		= (blWidgetInert | blWidgetOn | blWidgetSticky |
									blWidgetToggles | blWidgetRadioGroup)
};


#ifndef REZ
#pragma mark Part definitions
/*===============================*/
/* Apple uses part codes less than 256 so far. blNoPart is synonomous with kControlNoPart.
	Everything else is numbered to avoid collisions. */
typedef ControlPartCode		BLPart;

enum
{
	blNoPart		= 0,
	blCellPart		= 256,	/* Cell, but not in content rgn as defined by handler. */
	blCellRegionPart,		/* Handler-defined content (hilite/hit-test) rgn. */
	blBottomRightBlankPart, /* Area of view rectangle below and to the right of cells. */
	blRightBlankPart,		/* Area of view rectangle to the right of cells. */
	blBottomBlankPart,		/* Area of view rectangle below cells. */
	blHScrollPart,			/* Horizontal scroll bar. */
	blVScrollPart,			/* Vertical scroll bar. */
	blHTitleBarTitlePart,	/* Title in horizontal title bar. */
	blHTitleBarFillerPart,	/* Horizontal title bar, not in any title. */
	blVTitleBarTitlePart,	/* Title in vertical title bar. */
	blVTitleBarFillerPart,	/* Vertical title bar, not in any title. */
	blTopLeftPart,			/* Rectangle where horizontal and vertical title bars meet. */
	blSortButtonPart,		/* The sort button. */
	blGrowBoxPart,			/* The grow box (or no-grow box) where the scroll bars intersect. */
	blInlineEditPart,		/* Used for focusing, mainly. A list's inline edit rect. */
	blDisclosureTrianglePart, /* A cell's disclosure triangle. */
	blWidgetPart			/* A placard inline with a scroll bar. */
};

// Parts of a title bar that may prompt a cursor change.
typedef UInt8	BLTitleZone;
enum
{
	blNotInZone,
	blZoneLeft,
	blZoneRight,
	blZoneTop,
	blZoneBottom
};

typedef struct
{
	BLPart			part;			/* Horizontal title number is returned in cell->col. */
	BLCell			cell;
	Rect			rect;			/* Rect for cells, title bars, sort button, top left. */
	union
	{
		ControlPartCode	controlPart;	/* For scroll bars. */
		BLTitleZone		zone;			/* For all title bar parts. */
	} u;
} BLHitTestRec, *BLHitTestPtr;


#pragma mark BLDisclosureOption
/*===============================*/
/* Used for adding rows (BLAddRows) to a disclosure list. */
typedef UInt8		BLDisclosureOption;
enum
{
	blDisclosureOptionSame,		/* Add rows at same disclosure level as previous row. */
	blDisclosureOptionChild,	/* Add rows as child of previous row. */
	blDisclosureOptionRoot		/* Add rows at disclosure level 0. */
};


#pragma mark Sort State
/*===============================*/
typedef UInt8		BLSortState;
enum
{
	blSortStateUnsorted				= 0,
	blSortStateSorted				= 1 << 0,
	blSortStateLargeToSmall			= 1 << 1	 /* z...a direction */
};


#pragma mark BLKeyResult
/*===============================*/
/* Gives you an idea what BLKey did. */
typedef UInt16		BLKeyResult;
enum
{
	blNothingHappenedKeyResult,	/* The key could not be processed. For example,
									Command-printing-character combinations should be
									handled by the Menu Manager. Blugs ignores them. */
	blErrorKeyResult,			/* Some kind of internal error. Should never happen. */
	blArrowKeyResult,			/* An arrow key was processed. */
	blNavigationKeyResult,		/* A navigation key (home, page up...) was processed. */
	blSearchKeyResult,			/* The character was added to the search string and
									the list was searched. Sorted tables only. */
	blSentToInlineEditKeyResult,/* The key was sent to the inline session.
									(Whether the handler did anything with the key is not
									reported.) */
	blInlineEditBegunKeyResult,	/* Return or enter key started an inline session. */
	blInlineEditEndedKeyResult	/* Return or enter key ended an inline session. */
};


#pragma mark BLClickResult
/*===============================*/
/* Gives you an idea what BLClick did. */
typedef UInt16		BLClickResult;
enum
{
	blNothingHappenedClickResult,	/* Click was not in list, or no special reporting. */
	blCellRgnSingleClickResult,		/* Single click in cell region. */
	blCellRgnDoubleClickResult,		/* Double click in cell region. */
	//blCellRgnTripleClickResult,		/* Triple click in cell region. */
	blGrowBoxClickResult			/* The list's grow box was hit. */
};

#pragma mark BLGetSelectMethod
/*===============================*/
/* Tells BLGetSelect how you want to search. */
typedef UInt8		BLGetSelectMethod;
enum
{
	blCellGetSelectMethod,		/* Search all cells starting with ioCell. */
	blRowGetSelectMethod,		/* Search in ioCell->row starting with ioCell->col. */
	blColumnGetSelectMethod		/* Search in ioCell->col starting with ioCell->row. */
};


#pragma mark Notification
/*===============================*/
/* As you can see, this is in the prototype stage. */
enum
{
	blNoNotificationCommand				= '????',	/* A content handler wasn't invoked for this action,
														or did not respond with a command. */
	blCellDoubleClickNotificationMsg	= 'Cli2',
	blCellTripleClickNotificationMsg	= 'Cli3',
	blInlineEditBeganNotificationMsg	= 'InlB',
	blInlineEditEndedNotificationMsg	= 'InlE',
	blWidgetClickedNotificationMsg		= 'WidC'	/* Mouse down and up in non-inert widget, and/or
													widget content handler intercepted the click. */
};


#pragma mark -
#pragma mark ¥¥¥User-Defined Routines¥¥¥
#pragma mark BLBackgroundProcPtr
/*===============================*/
/* Use your implementation of this routine to draw the background of a cell.
	If inIsSortColumn is true, you should draw whatever shading is appropriate to indicate
	that this is the sorted column.
 Return something other than noErr (how 'bout eventNotHandledErr?) if you want Blugs to apply
	the default background.
*/
typedef pascal OSErr (*BLBackgroundProcPtr)( Boolean inIsSortColumn, BLCell inCell,
											const Rect* inRect, BlugsRef inList );


#pragma mark BLBevelButtonProcPtr
/*===============================*/
/* This routine is called for the drawing of titles in vertical and horizontal
	title bars, 'filler' titles that extend the title bar, when necessary, to the edges
	of the list, the top left corner, and other objects that are normally drawn on bevel buttons.
	The following part codes may be sent:
		blHTitleBarTitlePart
		blHTitleBarFillerPart
		blVTitleBarTitlePart
		blVTitleBarFillerPart
		blTopLeftPart
		blSortButtonPart
		blGrowBoxPart

	Return true if you drew the object; return false to have Blugs draw it as normal.
	For titles, the inTitle parameter contains a title number.
	For other parts, inTitle is zero.
*/
typedef pascal Boolean (*BLBevelButtonProcPtr)( BLPart inPart, UInt16 inTitle,
												const Rect* inRect, ThemeDrawState inState,
												ThemeButtonValue inValue, BlugsRef inList );


#pragma mark BLBorderProcPtr
/*===============================*/
/* If you install a border routine for a list, it overrides Blugs' built-in row/col
	border drawing. The inDrawRowBorder and inDrawColumnBorder parameters correspond
	to the list flags that control border drawing. If the list is not set up to draw borders,
	your routine will not be called (i.e., the routine is not called if the parameters
	would be ( false, false, ... )).
*/
typedef pascal void (*BLBorderProcPtr)( Boolean inDrawRowBorder, Boolean inDrawColumnBorder,
										BLCell inCell, const Rect* inRect, BlugsRef inList );


#pragma mark BLFlattenProcPtr
/*===============================*/
/*	Pass your implementation of this routine to BLFlatten. The first time it is called,
	outData is nil. Return the data size. If, on output, dataSize is nonzero,
	it will be called a second time with a valid outData buffer. Generally this function
	will act as a wrapper for BLGetCellData. It allows you to determine what data flavors
	to use, and you can filter out cells/titles you don't want to save.
*/
typedef pascal void (*BLFlattenProcPtr)( BLCell inCell, OSType* outDataFlavor, UInt32* ioDataSize,
										void* outData, BlugsRef inList );


#pragma mark BLHiliteProcPtr
/*===============================*/
/* If you install a hilite routine for a list, it overrides Blugs' native hiliting and
	also any special hiliting supplied by content handlers. This routine is only called
	for cells; it is not called for titles.
	
 Make sure your routine is compatible with the GUI of all your handlers.
 	Cell content is drawn after, and thus on top of, your routine's drawing.
*/
typedef pascal void (*BLHiliteProcPtr)( const Rect* inRect, BlugsRef inList );


#pragma mark BLNotificationProcPtr
/*===============================*/
/* Called to notify your application about user activity in list parts. Useful particularly
	when you have a user pane control and can't get "what happened" information back from the
	Blugs event handling routines.
 Commands are returned by content handlers (this isn't really implemented yet but you can
 	see where I'm going with it) where messages are issued only by Blugs.
 	If Blugs calls you thusly:
 	
 	(*yourProc)( blCellClickNotification, kHICommandDoSuchAndSo,
 				blCellPart, clickedCell, list );
 	
	...it means Blugs says to your app, "Pssst! The user clicked a cell and the cell said
  'do such and so'". This is how you can get stuff back out of content handlers.
*/
typedef pascal void (*BLNotificationProcPtr)( BLNotificationMessage inMessage,
												UInt32 inCommand, BLPart inPart,
												BLCell inCell, BlugsRef inList );


#pragma mark BLRowExpandProcPtr
/*===============================*/
/* Blugs calls this routine, if you have installed it via BLRegisterRowExpandProc(),
	when a row which has a disclosure triangle is expanded or collapsed. You can use it to add
	new rows, so you need not populate nested rows all at once.
	The first row you add will be one greater than the inExpandedRow parameter.
	You can add rows all at once like this:
	
	err = BLAddRows( true, myRowsToAdd, inExpandedRow + 1, inList );
	
	Then set cell data after all are added. Or you can loop and add each row, then fill it.
*/
typedef pascal void (*BLRowExpandProcPtr)( Boolean inExpanding, UInt16 inExpandedRow,
											BlugsRef inList );


#pragma mark BLSecondarySortColumnProcPtr
/*===============================*/
/* Returns a column number to be the secondary column, based on the primary column */
typedef pascal UInt16 (*BLSecondarySortColumnProcPtr)( UInt16 inPrimaryColumn, BlugsRef inList );


#pragma mark BLPreDragProcPtr
/*===============================*/
/*	This routine is called immediately before TrackDrag when a drag has been detected.
	If any result other than noErr is returned, TrackDrag is not called.

	inDragRef contains all the cell data.
	inDragGWorld may be nil if translucent dragging is not available.
*/
typedef pascal OSErr (*BLPreDragProcPtr)( DragReference inDragRef, GWorldPtr inDragGWorld,
											RgnHandle inDragRgn, EventRecord *inEvent,
											BlugsRef inList );


#pragma mark BLDragDataProcPtr
/*===============================*/
/*	This routine is called once for each selected cell, to add data to a drag begun in a list.
	inItem begins at 1. Use that item number when you add flavor data.
	
	If you don't want to have inCell dragged, return badDragItemErr.
*/
typedef pascal OSErr (*BLDragDataProcPtr)( DragReference inDragRef, DragItemRef inItem,
											BLCell inCell, BlugsRef inList );


#pragma mark BLDropValidationProcPtr
/*===============================*/
/*	Called to validate a drop location. The drag may have come from anywhere (another
	list, Finder, etc.) but you are dropping into inList. Return noErr to accept the
	drop location, anything else to reject it. If accepted, Blugs draws an
	insertion caret at the indicated location.
*/
typedef pascal OSErr (*BLDropValidationProcPtr)( DragReference inDragRef, UInt16 inUnderThisRow,
												UInt16 inDisclosureLevel, BlugsRef inList );


#pragma mark BLDropProcPtr
/*===============================*/
/*	Called when it's time to drop in a list. The drag may have come from anywhere (another
	list, Finder, etc.) but you are dropping into inList.
*/
typedef pascal void (*BLDropProcPtr)( DragReference inDragRef, UInt16 inUnderThisRow,
										UInt16 inDisclosureLevel, BlugsRef inList );


#pragma mark BLPostDragProcPtr
/*===============================*/
/*	Called just before a drag that originated in a list is finished (disposed).
	This is where you detect whether the drag was to the Finder trash, or to some app
	other than your own. If, of course, you need this information.
*/
typedef pascal void (*BLPostDragProcPtr)( DragReference inDragRef, BlugsRef inList );


/*===============================*/
/* Use this record to get and set list callbacks en masse. Do you like this method of
	registration better than one call per callback type?
*/
typedef struct
{
	BLBackgroundProcPtr				backgroundProc;
	BLBevelButtonProcPtr			bevelButtonProc;
	BLBorderProcPtr					borderProc;
	BLHiliteProcPtr					hiliteProc;
	BLNotificationProcPtr			notificationProc;
	BLRowExpandProcPtr				rowExpandProc;
	BLSecondarySortColumnProcPtr	secondaryProc;
	BLPreDragProcPtr				preDragProc;
	BLDragDataProcPtr				dragDataProc;
	BLDropValidationProcPtr			dropValidationProc;
	BLDropProcPtr					dropProc;
	BLPostDragProcPtr				postDragProc;
} BLCallbacksRec, *BLCallbacksPtr;

#pragma mark -
#pragma mark ¥¥¥ Content Handler Stuff ¥¥¥
/*===============================*/
#pragma mark BLHandlerParamBlock
typedef struct
{
	BLCell						inCell;
	Rect						inRect;
	Handle						ioStorage;
	Handle						inStorage2;			/* Only used for blCellSortMsg comparisons. */
	Ptr							ioDataBuffer;
	UInt32						ioDataSize;
	OSType						ioDataFlavor;
	RgnHandle					inRegion;			/* You can modify the region,
														but don't allocate one. */
	BlugsRef					inList;
	UInt32						ioCommand;			/* Reported back to app via notification proc,
														also used for inline edit command status
														and process messages. */
	Point						inEventWhereLocal;
	UInt32						inEventMessage;
	EventModifiers				inEventModifiers;
	
	BLPart						inPart;
	UInt16						inIndex;			/* For getting an indexed (1-based)
														element (flavor data). */
	UInt16						inIndent;
	UInt16						outMinWidth;
	UInt16						outMinHeight;
	UInt16						inVariationCode;
	Boolean						inIsSelected;		/* Cell or title is selected. */
} BLHandlerParamBlock, *BLHandlerParamPtr;



#pragma mark BLContentHandlerProcPtr
typedef pascal UInt32 (*BLContentHandlerProcPtr)(	BLMessage			inMessage,
													BLHandlerParamPtr	ioParam		);


#pragma mark Messages
enum
{
	/* These are the required messages: */
	blHandlerInitMsg,		/* Sent once to each handler when BLRegisterContentHandler()
								is called. Allocate any needed memory and return handler
								features. */
	blHandlerDeinitMsg,		/* Sent to each registered handler when BLExit() is called. */
	blCellInitMsg,			/* Sent when a cell is created. Handler should allocate storage
								for future data if necessary and initialize as appropriate. */
	blCellDeinitMsg,		/* Sent when a cell is removed from the list. Handler should release
								memory allocated for that cell. */
	blCellDrawMsg,			/* Sent to have the handler draw its content in the current port.
								Handler returns Boolean to indicate whether, if the cell is
								selected, Blugs should draw hiliting for the cell. */
	blCellSetDataMsg,		/* Stores passed-in data of a particular flavor in a cell. */
	blCellClearDataMsg,		/* Resets a cell to its default or initial data content. */
	blCellGetDataMsg,		/* Get the data for a cell, in the specified flavor. */
	//blCountImportFlavorsMsg,	/* Return the number of data flavors handler can import. */
	//blCountExportFlavorsMsg,	/* Return the number of data flavors handler can export. */
	//blGetNthImportFlavorInfoMsg,	/* Get OSType and maximum size for the indexed (1-based)
	//									data import flavor. */
	//blGetNthExportFlavorInfoMsg,	/* Get OSType, size and data for the indexed (1-based)
	//									data export flavor. */
/* These 5 are only sent if blWantsInlineEdit flag is set: */
	blInlineEditRegionMsg,	/* Blugs asks for a region, and uses that for determining whether
								a click starts an inline edit session. It also uses the
								region for drawing the focus around inline text.
								Blugs allocates and disposes of this region handle. */
	blInlineEditBeginMsg,	/* An inline edit session has begun. */
	blInlineEditKeyMsg,		/* Handle a keypress during an inline edit. */
	blInlineEditClickMsg,	/* Handle a click in the inline edit cell. */
	blInlineEditEndMsg,		/* Edit session is over. */
	blInlineEditCommandStatusMsg,	/* Handler responds by returning true if the command in ioCommand
								is supported, false otherwise. */
	blInlineEditCommandProcessMsg,/* Handler should execute the command in ioCommand. */
/* End of inline edit stuff */
/* The following are optional: */
	blCellRegionMsg,		/* Only sent if blWantsRegion flag bit is set.
								Blugs asks for a region, and uses that for hit-testing,
								hiliting the cell contents, and drag-selecting cells.
								Blugs allocates and disposes of this region handle. */
	blCellClickMsg,			/* Only sent if blWantsClick flag is set. */
	blCellIdleMsg,			/* Only sent if blWantsIdle flag is set or cell is the target
								of an inline edit session. For non-inline cells, only sent when
								the cursor is within the cell rectangle. See Idle Results below
								for the type of information that can be returned after a
								blIdleMsg call. */
	blCellMinSizeMsg,		/* Only sent if blWantsMin is set; minimum applies to all cells.
								Return minima in outMinWidth and outMinHeight in param block.
								Set one to zero to indicate no minimum in that dimension. */
	blCellSortMsg,			/* Only sent if blWantsSort is set. Returns blFirstIsLess if the
								data in the storage1 field is less than storage2, etc. */
	blCellSearchMsg			/* Only sent if blWantsSort is set. Returns blCellDataIsLess if
								the search string is greater, etc. See below. */
};



#pragma mark Feature flags
/* These are the flags returned by blGetFeaturesMsg */
enum
{
	blWantsClick			= 0x00000001, /* If this feature is supported, Blugs calls the handler
											with blCellClickMsg; the handler can run its own
											mini event loop. Return blCellClickUpdate if cell
											needs an update, blCellClickNoUpdate otherwise. */
	blWantsIdle				= 0x00000002, /* Set if the handler wants idle events passed on to it
											by BLIdle. Note that Blugs sends blCellIdleMsg to the
											inline cell regardless of the status of this flag. */
	blWantsInlineEdit 		= 0x00000004, /* Set if handler can do inline text editing. */
	blWantsInlineReturn 	= 0x00000008, /* Set if return and enter keys should be sent to the
											handler during inline edit sessions. By default,
											return and enter end the session. Set this bit
											to support multi-line edit fields. */
	blWantsInlineFocus		= 0x00000010, /* Set if the handler wants Blugs to draw a focus box
											around the edit text. */
	blWantsSort				= 0x00000020, /* Set if handler has data that can be sorted. */
	blWantsMin				= 0x00000040, /* Set if handler can return a minimum size for cells. */
	blWantsRegion			= 0x00000080, /* Set if the handler calculates a region for hit-testing,
											hiliting, and drag-selection that is not the same
											as the cell rectangle. Blugs sends blCellRegionMsg
											only if this bit is set. */
	blWantsHilite			= 0x00000100 /* Set if the handler does its own hiliting. Blugs will
											not try to hilite a selected cell controlled by
											this handler.
											**NOTE** Titles are drawn on bevel buttons, so they
											are pressed, not hilited, when selected.
											blWantsHilite does not apply to titles. */
};


/* Note: to use sort/search replies with OS routines like CompareText,
	pass the cell data as the first parameter and search data as the second. */
#pragma mark Replies
enum
{
	blCellSortFirstIsLess			= -1L,
	blCellSortEqual					= 0,
	blCellSortFirstIsGreater		= 1,
	blCellSearchCellDataIsLess		= -1L,
	blCellSearchEqual				= 0,
	blCellSearchCellDataIsGreater	= 1,
	blInlineEditKeyUpdate			= true,		/* Need update after handling key event. */
	blInlineEditKeyNoUpdate			= false,	/* No need to update. */
	blInlineEditClickHandled		= true,		/* The click was handled. */
	blInlineEditClickNotHandled		= false,	/* Click was not handled. */
	blInlineEditEndChanged			= true,		/* Contents of edit cell changed. */
	blInlineEditEndNotChanged		= false,	/* Contents of edit cell did not change. */
	blCellClickUpdate				= 0x00000001, /* Need update after handling click. */
	blCellClickHandled				= 0x00000002, /* Blugs should leave cell selection as it was before;
													The click was strictly for manipulating something
													in the cell, not for selecting and deselecting
													list items. */
	blCellIdleAdjustedCursor		= 0x00000001, /* Handler adjusted cursor. */
	blCellIdleNeedUpdate			= 0x00000002, /* Need blDrawMsg. */
	blInlineEditCommandStatusIgnore = 0,		// Command is not relevant.
	blInlineEditCommandStatusEnable = 1,		// Command should be enabled.
	blInlineEditCommandStatusDisable = 2		// Command should be disabled.
};


/*===============================*/
#pragma mark -
#pragma mark ¥¥¥ Constants ¥¥¥
/*===============================*/
#define blDefaultIndent			12
#define blMaxIndent				100
#define blListResType			'LiSt'
#define blColResizeCURS			2600	/* A 'CURS' resource. */
#define blRowResizeCURS			2601	/* A 'CURS' resource. */


#pragma mark Errors and result codes
/*===============================*/
/* For the most part we recycle Mac OS error codes for our errors. It's sorta fun.
	But we need to use a few entries in the result code space reserved for developers,
	when we have not found good predefined codes. (See Apple Technical Q&A OV02 on
	the developer OSErr/OSStatus space 1000-9999.) */
enum
{
	/* OSErr codes that indicate what was found by BLSearch. */
	blSearchResultExactMatch	= noErr,	/* Search data was matched exactly. */
	blSearchResultNextCell		= 1000,		/* Inexact match: BLSearch returns the next
												cell greater than the search data. */
	blSearchResultPrevCell					/* Inexact match: there is no cell greater
												than the search data. BLSearch returns the
												previous cell less than the search data. */
};


#pragma mark -
#pragma mark ¥¥¥ Public API ¥¥¥
/*===============================*/
#pragma mark Initialization
BL_PROC OSErr			BLEnter( UInt32 inSettings );



/*===============================*/
#pragma mark Creating and Disposing of Lists
BL_PROC BlugsRef		BLNew( UInt16 inColumns, UInt16 inRows, const Rect* inRect,
								Point inDefaultCellSize, WindowRef inWindow, UInt32 inListFlags,
								UInt16 inDragFlags );
BL_PROC BlugsRef		BLLoad( SInt16 inResID, WindowRef inWindow );
BL_PROC OSErr			BLFlatten( BLFlattenProcPtr inFlattenProc, Handle* outHandle, BlugsRef inList );
BL_PROC BlugsRef		BLUnflatten( Handle inHandle, WindowRef inWindow );
BL_PROC void			BLDispose( BlugsRef inList );
BL_PROC WindowRef		BLWindow( BlugsRef inList );


/*===============================*/
#pragma mark Rows and Columns
BL_PROC OSErr			BLAddRows( BLDisclosureOption inOption, UInt16 inCount, UInt16 inRow,
									BlugsRef inList );
BL_PROC OSErr			BLAddColumns( UInt16 inCount, UInt16 inColumn, BlugsRef inList );
BL_PROC OSErr			BLDeleteRows( UInt16 inCount, UInt16 inRow, BlugsRef inList );
BL_PROC OSErr			BLDeleteColumns( UInt16 inCount, UInt16 inColumn, BlugsRef inList );
BL_PROC OSErr			BLMoveRows( UInt16 inCount, UInt16 inRow, UInt16 inAfterThisRow,
									UInt16 inDisclosureLevel, BlugsRef inList );
BL_PROC OSErr			BLMoveMarkedRows( UInt16 inAfterThisRow, UInt16 inDisclosureLevel,
										BlugsRef inList );
BL_PROC OSErr			BLMoveColumns( UInt16 inCount, UInt16 inColumn,
										UInt16 inAfterThisColumn, BlugsRef inList );
BL_PROC UInt16			BLCountRows( BlugsRef inList );
BL_PROC UInt16			BLCountColumns( BlugsRef inList );
BL_PROC UInt16			BLGetRowFlags( UInt16 inRow, BlugsRef inList );
BL_PROC OSErr			BLSetRowFlags( UInt16 inRow, UInt16 inWhichFlags, UInt16 inFlags,
										BlugsRef inList );
BL_PROC UInt16			BLGetColumnFlags( UInt16 inColumn, BlugsRef inList );
BL_PROC OSErr			BLSetColumnFlags( UInt16 inColumn, UInt16 inWhichFlags, UInt16 inFlags,
										BlugsRef inList );


/*===============================*/
#pragma mark Metrics
BL_PROC OSErr			BLGetViewRect( Rect* outRect, BlugsRef inList );
BL_PROC OSErr			BLGetRect( Rect* outRect, BlugsRef inList );
BL_PROC OSErr			BLSetRect( const Rect* inRect, BlugsRef inList );
BL_PROC OSErr			BLCellRect( BLCell inCell, Rect* outRect, BlugsRef inList );
BL_PROC void			BLGetMinimumSize( UInt16* outMinWidth, UInt16* outMinHeight,
											BlugsRef inList );
BL_PROC OSErr	 		BLSetRowHeight( UInt16 inRow, UInt16 inHeight, BlugsRef inList );
BL_PROC OSErr	 		BLSetColumnWidth( UInt16 inColumn, UInt16 inWidth, BlugsRef inList );
BL_PROC OSErr			BLSetDefaultCellSize( Point inSize, BlugsRef inList );
BL_PROC UInt8			BLGetIndent( BlugsRef inList );
BL_PROC OSErr			BLSetIndent( UInt8 inIndent, BlugsRef inList );


/*===============================*/
#pragma mark Events
BL_PROC BLClickResult	BLClick( UInt32 inWhen, Point inWhereLocal, EventModifiers inModifiers,
								BlugsRef inList );
BL_PROC BLKeyResult		BLKey( UInt32 inMessage, UInt32 inWhen, EventModifiers inModifiers,
								BlugsRef inList );
BL_PROC void			BLIdle( Point inMouse, BlugsRef inList );


/*===============================*/
#pragma mark Selection
BL_PROC OSErr			BLSetCellSelectable( BLCell inCell, Boolean inSelectable,
												BlugsRef inList );
BL_PROC OSErr			BLSetRepresentativeColumn( UInt16 inColumn, BlugsRef inList );
BL_PROC OSErr			BLSetSelect( Boolean inSelect, BLCell inCell, BlugsRef inList );
BL_PROC void			BLSelectOneCell( BLCell inCell, BlugsRef inList );
BL_PROC OSErr			BLSelectAll( BlugsRef inList );
BL_PROC void			BLDeselectAll( BlugsRef inList );
BL_PROC Boolean			BLIsCellSelected( BLCell inCell, BlugsRef inList );
BL_PROC OSErr			BLGetSelect( BLGetSelectMethod inMethod, BLCell* ioCell, BlugsRef inList );
BL_PROC OSErr			BLHitTest( Point inWhere, BLHitTestPtr outHitTest, BlugsRef inList );


/*===============================*/
#pragma mark Drag and Drop
BL_PROC OSErr			BLTrackDrag( DragTrackingMessage inMessage, DragReference inDragRef,
										BlugsRef inList );
BL_PROC OSErr			BLReceiveDrag( DragReference inDragRef, BlugsRef inList );
BL_PROC OSErr			BLGetListFromDrag( DragReference inDragRef, BlugsRef* outList );
BL_PROC OSErr			BLGetCellFromDragItemRef( DragReference inDragRef,
												DragItemRef inDragItem, BLCell* outCell );


/*===============================*/
#pragma mark Display
BL_PROC OSErr			BLSetAutodraw( Boolean inDraw, BlugsRef inList );
BL_PROC void			BLUpdate( RgnHandle inUpdateRgn, BlugsRef inList );
BL_PROC Boolean			BLIsVisible( BlugsRef inList );
BL_PROC OSErr			BLSetVisible( Boolean inMakeVisible, BlugsRef inList );
BL_PROC Boolean			BLIsActive( BlugsRef inList );
BL_PROC void			BLSetActive( Boolean inMakeActive, BlugsRef inList );
BL_PROC ControlPartCode	BLGetFocusedPart( BlugsRef inList );
BL_PROC ControlPartCode	BLSetFocusedPart( ControlPartCode inPart, BlugsRef inList );
BL_PROC OSErr			BLGetColumnFontStyle( UInt16 inColumn, ControlFontStylePtr outFontStyle,
											BlugsRef inList );
BL_PROC OSErr			BLSetColumnFontStyle( UInt16 inColumn,
											const ControlFontStyleRec* inFontStyle,
											BlugsRef inList );
BL_PROC void			BLDrawHiliteRect( Boolean inActive, const Rect* inRect );
BL_PROC void			BLDrawHiliteRgn( Boolean inActive, RgnHandle inRgn );


/*===============================*/
#pragma mark User Pane Controls
BL_PROC OSErr			BLMakeUserPaneControl( ControlRef* outControl, BlugsRef inList );
BL_PROC OSErr			BLConvertUserPaneControl( Boolean inSyncRects, ControlRef ioControl, BlugsRef inList );
BL_PROC BlugsRef		BLRefFromUserPaneControl( ControlRef inControl );
BL_PROC OSErr			BLDisposeUserPaneControl( Boolean inDisposeOfList, ControlRef inControl );
#if __BL_USE_CARBON_API__
BL_PROC OSErr			BLMakeCarbonControl( ControlRef* outControl, BlugsRef inList );
#endif

/*===============================*/
#pragma mark Inline Editing
BL_PROC Boolean			BLIsCellEditable( BLCell inCell, BlugsRef inList );
BL_PROC OSErr			BLSetCellEditable( BLCell inCell, Boolean inEditable, BlugsRef inList );
BL_PROC Boolean			BLIsInlineEdit( BlugsRef inList );
BL_PROC OSErr			BLGetInlineEditCell( BLCell* outCell, BlugsRef inList );
BL_PROC OSErr			BLBeginInlineEdit( BLCell inCell, BlugsRef inList );
BL_PROC void			BLEndInlineEdit( BlugsRef inList );
BL_PROC UInt32			BLGetCommandStatus( UInt32 inCommand, UInt32 inModifiers, BlugsRef inList );
BL_PROC OSErr			BLProcessCommand( UInt32 inCommand, UInt32 inModifiers, BlugsRef inList );


/*===============================*/
#pragma mark Cell Data
BL_PROC BLContentType	BLGetCellContentType( BLCell inCell, BlugsRef inList );
BL_PROC OSErr			BLSetCellContentType( BLCell inCell, BLContentType inContent,
												BlugsRef inList );
BL_PROC OSErr			BLGetCellData( BLCell inCell, OSType inDataFlavor, UInt32* ioDataSize,
										void* outData, BlugsRef inList );
BL_PROC OSErr			BLSetCellData( BLCell inCell, OSType inDataFlavor, UInt32 inDataSize,
										void* inData, BlugsRef inList );
BL_PROC void			BLClearCell( BLCell inCell, BlugsRef inList );
//BL_PROC UInt32			BLCountCellFlavors( BLCell inCell, BlugsRef inList );
//BL_PROC OSErr			BLGetIndFlavorInfo( BLCell inCell, UInt16 inIndex, OSType* outDataFlavor,
//											UInt32* outSize, BlugsRef inList );


/*===============================*/
#pragma mark Sorting and Searching
BL_PROC OSErr			BLGetSortState( BLSortState* outState, UInt16* outColumn, BlugsRef inList );
BL_PROC OSErr			BLSort( BLSortState inState, UInt16 inColumn, BlugsRef inList );
BL_PROC OSErr			BLSearch( UInt16 inColumn, void* inData, UInt32 inDataSize,
									BLCell* outCell, BlugsRef inList );


/*===============================*/
#pragma mark Row and Column Identifiers
BL_PROC OSErr			BLSetDefaultRowFlags( UInt16 inWhichFlags, UInt16 inFlags, BlugsRef inList );
BL_PROC OSErr			BLSetRowIdentifier( UInt16 inRow, UInt32 inIdentifier, BlugsRef inList );
BL_PROC OSErr			BLGetRowIdentifier( UInt16 inRow, UInt32* outIdentifier, BlugsRef inList );
BL_PROC OSErr			BLSetDefaultColumnFlags( UInt16 inWhichFlags, UInt16 inFlags, BlugsRef inList );
BL_PROC OSErr			BLSetColumnIdentifier( UInt16 inColumn, UInt32 inIdentifier,
												BlugsRef inList );
BL_PROC OSErr			BLGetColumnIdentifier( UInt16 inColumn, UInt32* outIdentifier,
												BlugsRef inList );
BL_PROC OSErr			BLGetCellFromUID( BLCellUID* inID, BLCell* outCell, BlugsRef inList );
BL_PROC UInt16			BLGetRowFromUID( BLUID* inID, BlugsRef inList );
BL_PROC UInt16			BLGetColumnFromUID( BLUID* inID, BlugsRef inList );
BL_PROC OSErr			BLGetCellUID( BLCell inCell, BLCellUID* outID, BlugsRef inList );
BL_PROC void			BLGetRowUID( UInt16 inRow, BLUID* outID, BlugsRef inList );
BL_PROC void			BLGetColumnUID( UInt16 inColumn, BLUID* outID, BlugsRef inList );


/*===============================*/
#pragma mark User Data
BL_PROC OSErr			BLSetUserData( SInt32 inKey, SInt32 inData, BlugsRef inList );
BL_PROC OSErr			BLGetUserData( SInt32 inKey, SInt32* outData, BlugsRef inList );
BL_PROC OSErr			BLRemoveUserData( SInt32 inKey, BlugsRef inList );


/*===============================*/
#pragma mark Disclosure
BL_PROC OSErr			BLGetRowDisclosureLevel( UInt16 inRow, UInt16* outDisclosureLevel,
												BlugsRef inList );
BL_PROC OSErr			BLSetRowDisclosureLevel( UInt16 inRow, UInt16 inDisclosureLevel,
												BlugsRef inList );
BL_PROC UInt16			BLGetParentRow( UInt16 inRow, BlugsRef inList );
BL_PROC Boolean			BLRowIsDisclosed( UInt16 inRow, BlugsRef inList );
BL_PROC OSErr			BLExpandRow( Boolean inDeepExpand, UInt16 inRow, BlugsRef inList );
BL_PROC OSErr			BLCollapseRow( Boolean inDeepCollapse, UInt16 inRow, BlugsRef inList );
BL_PROC UInt16			BLCountDescendants( UInt16 inRow, BlugsRef inList );
BL_PROC UInt16			BLGetDisclosureTriangleColumn( BlugsRef inList );
BL_PROC OSErr			BLSetDisclosureTriangleColumn( UInt16 inColumn, BlugsRef inList );


/*===============================*/
#pragma mark Title Bars
BL_PROC OSErr			BLNewTitleBar( Boolean inVertical, const BLTitleBarInfo* inInfo, BlugsRef inList );
BL_PROC OSErr			BLGetTitleBarInfo( Boolean inVertical, BLTitleBarInfo* outInfo, BlugsRef inList );
BL_PROC OSErr			BLSetTitleBarInfo( Boolean inVertical, UInt16 inWhichFields,
											const BLTitleBarInfo* inInfo, BlugsRef inList );
BL_PROC OSErr			BLSelectTitle( Boolean inVertical, UInt16 inTitle, BlugsRef inList  );
BL_PROC UInt16			BLGetSelectedTitle( Boolean inVertical, BlugsRef inList );


/*===============================*/
#pragma mark Scrolling and Navigation
BL_PROC OSErr			BLMakeVisible( BLCell inCell, BlugsRef inList );
BL_PROC void			BLPageUp( BlugsRef inList );
BL_PROC void			BLPageDown( BlugsRef inList );
BL_PROC OSErr			BLSetScrollDistance( UInt8 inDistance, Boolean inVertical,
												BlugsRef inList );


/*===============================*/
#pragma mark User-Defined Functions
BL_PROC OSErr			BLGetCallbacks( BLCallbacksPtr outCallbacks, BlugsRef inList );
BL_PROC OSErr			BLSetCallbacks( const BLCallbacksPtr inCallbacks, BlugsRef inList );
BL_PROC OSErr			BLRegisterContentHandler( BLContentType inContent, UInt16 inVariationCode,
													BLContentHandlerProcPtr inProc );
BL_PROC OSErr			BLRegisterBackgroundProc( BLBackgroundProcPtr inProc, BlugsRef inList );
BL_PROC OSErr			BLRegisterBevelButtonProc( BLBevelButtonProcPtr inProc, BlugsRef inList );

BL_PROC OSErr			BLRegisterBorderProc( BLBorderProcPtr inProc, BlugsRef inList );
BL_PROC OSErr			BLRegisterHiliteProc( BLHiliteProcPtr inProc, BlugsRef inList );
BL_PROC OSErr			BLRegisterRowExpandProc( BLRowExpandProcPtr inProc, BlugsRef inList );
BL_PROC OSErr			BLRegisterSecondarySortColumnProc( BLSecondarySortColumnProcPtr inProc,
															BlugsRef inList );
BL_PROC OSErr			BLRegisterPreDragProc( BLPreDragProcPtr inProc, BlugsRef inList );
BL_PROC OSErr			BLRegisterDragDataProc( BLDragDataProcPtr inProc, BlugsRef inList );
BL_PROC OSErr			BLRegisterDropValidationProc( BLDropValidationProcPtr inProc,
														BlugsRef inList );
BL_PROC OSErr			BLRegisterDropProc( BLDropProcPtr inProc, BlugsRef inList );
BL_PROC OSErr			BLRegisterPostDragProc( BLPostDragProcPtr inProc, BlugsRef inList );


/*===============================*/
#pragma mark Utility
BL_PROC void			BLSettings( UInt32 inSettings );
BL_PROC UInt32			BLEnvironment( void );
BL_PROC SInt16			BLAppearanceVersion( void );
BL_PROC void			BLDrawBevelButton( const Rect* inRect, ThemeDrawState inState,
											ThemeButtonValue inValue );
BL_PROC void			BLDrawPlacard( const Rect* inRect, ThemeDrawState inState );
#if __BL_USE_CARBON_API__
BL_PROC void			BLDumpList( const char* inName, BlugsRef inList );
#endif


/*===============================*/
#pragma mark Widgets
BL_PROC OSErr			BLAddWidgets( Boolean inVertical, UInt16 inCount, UInt16 inWidget,
										BlugsRef inList );
BL_PROC OSErr			BLDeleteWidgets( Boolean inVertical, UInt32 inCount, UInt32 inWidget,
										BlugsRef inList );
BL_PROC UInt16			BLCountWidgets( Boolean inVertical, BlugsRef inList );
BL_PROC OSErr			BLGetWidgetInfo( Boolean inVertical, UInt16 inWidget,
										BLWidgetInfo* outInfo, BlugsRef inList );
BL_PROC OSErr			BLSetWidgetInfo( Boolean inVertical, UInt16 inWidget,
										UInt16 inWhichFields, const BLWidgetInfo* inInfo,
										BlugsRef inList );
BL_PROC OSErr			BLGetWidgetData( Boolean inVertical, UInt16 inWidget, OSType inDataFlavor,
											UInt32* ioDataSize, void* outData, BlugsRef inList );
BL_PROC OSErr			BLSetWidgetData( Boolean inVertical, UInt16 inWidget, OSType inDataFlavor,
										UInt32 inDataSize, void* inData, BlugsRef inList );
BL_PROC void			BLClearWidget( Boolean inVertical, UInt16 inWidget, BlugsRef inList );
BL_PROC OSErr			BLGetWidgetRect( Boolean inVertical, UInt16 inWidget,
										Rect* outRect, BlugsRef inList );


/*===============================*/
#pragma mark List Manager Compatibility

#define BLSetDrawingMode				BLSetAutodraw
#define BLDoDraw						BLSetAutodraw
#define BLAddRowsCompat( count, row, list )	\
										BLAddRows( blDisclosureOptionRoot, count, row, list )
#define BLActivate						BLSetActive
#define BLGetListActive					BLIsActive
#define BLClrCell						BLClearCell



#endif /* __BLUGS__ */
#endif /* !REZ */

