//CollapseUtils.h
#ifndef COLLAPSE_UTILS_H
#define COLLAPSE_UTILS_H

#include "includes.h"

//CollapseUtil constants
#define collapseStateLockUp 		0
#define collapseStateUp				1
#define collapseStateUser			2
#define collapseStateDown			3
#define collapseStateLockDown		4	
#define collapseStateModalUser		5				
#define collapseStateFullScreen 6
				
#define 	sonyVersion1	-1
#define		sonyVersion2	-2	

#ifndef SetBits
#define SetBits( b, len )      ( ( ( 1U << ( ( len ) - 1 ) ) - 1U + ( 1U << ( ( len ) - 1 ) ) ) << ( b ) )
#endif

//pinMaxConstraintSize is set to the max value of a Coord such that it can grow as big as the 
//hardware supports
#ifndef pinMaxConstraintSize
#define pinMaxConstraintSize 	SetBits( 0, ( sizeof( Coord) * 8 ) - 1 )
#endif


//Collapse Util func declare
void CollapseAppStart(void) FORMS_SEGMENT;
Int32 CollapseGetAPIVersion(void) FORMS_SEGMENT;
void CollapseAppStop(void) FORMS_SEGMENT;
void CollapseSetState(FormType* frmP, UInt8 newState) FORMS_SEGMENT;
Boolean CollapseResizeForm(FormType *frmP, Boolean isModal, Int16* returnOffsetX, Int16* returnOffsetY) FORMS_SEGMENT;
Boolean CollapseMoveResizeDialog(FormType* frmP, Boolean isModal, Int16* returnOffsetX, Int16* returnOffsetY) FORMS_SEGMENT;
void CollapseMoveResizeFormObject(FormType* frmP, UInt16 objectID, Int16 moveOffsetCoordsX, Int16 moveOffsetCoordsY, Int16 resizeOffsetCoordsX, Int16 resizeOffsetCoordsY) FORMS_SEGMENT;
void CollapseMoveFormBitmapObject(FormType* frmP, UInt16 objectID, Int16 moveOffsetCoordsX, Int16 moveOffsetCoordsY) FORMS_SEGMENT;
Err CollapseDisplayResizedEventCallback( SysNotifyParamType *notifyParamsP ) FORMS_SEGMENT;
UInt16 CollapseSetTriggerStates(UInt16 newState) FORMS_SEGMENT;
Boolean CollapseCheckForPin10NeedToRedraw(void) FORMS_SEGMENT;
void CollapseCheckWinEnterEvent(EventType* eventP) FORMS_SEGMENT;
void CollapseMoveGSI(FormType* frmP, Int16 moveOffsetCoordsX, Int16 moveOffsetCoordsY) FORMS_SEGMENT;
void CollapseHorizontallyCenterAllUI(FormType* frmP, Int16 offsetCoordsX) FORMS_SEGMENT;

#endif // COLLAPSE_UTILS_H
