add hand-coded implementation of HsNavDrawFocusRing. This works, but

should be replaced by generated code.
This commit is contained in:
ehouse 2006-11-29 04:11:24 +00:00
parent 3bd951aca5
commit e25caaba1a
4 changed files with 54 additions and 4 deletions

View file

@ -128,6 +128,41 @@ read_unaligned32( const unsigned char* src )
return val;
} /* read_unaligned32 */
#ifdef XWFEATURE_FIVEWAY
#include "pnostate.h"
Err
HsNavDrawFocusRing (FormType* formP, UInt16 objectID, Int16 extraInfo,
RectangleType* rP,
HsNavFocusRingStyleEnum ringStyle, Boolean forceRestore)
{
Err result;
FUNC_HEADER(HsNavDrawFocusRing);
RectangleType RectangleType_68K1;
SWAP_RECTANGLETYPE_ARM_TO_68K( &RectangleType_68K1, rP );
{
PNOState* sp = GET_CALLBACK_STATE();
STACK_START(unsigned char, stack, 18);
ADD_TO_STACK2(stack, hsSelNavDrawFocusRing, 0);
ADD_TO_STACK4(stack, formP, 2);
ADD_TO_STACK2(stack, objectID, 6);
ADD_TO_STACK2(stack, extraInfo, 8);
ADD_TO_STACK4(stack, &RectangleType_68K1, 10);
ADD_TO_STACK1(stack, ringStyle, 14);
ADD_TO_STACK1(stack, forceRestore, 16);
STACK_END(stack);
result = (Err)(*sp->call68KFuncP)( sp->emulStateP,
PceNativeTrapNo(sysTrapHsSelector),
stack, 18 );
sp->emulStateP->regA[7] -= 2;
}
FUNC_TAIL(HsNavDrawFocusRing);
return result;
}
#endif
/* Need to parse the format string */
Int16
StrPrintF( Char* s, const Char* formatStr, ... )

View file

@ -129,5 +129,15 @@ unsigned short read_unaligned16( const unsigned char* src );
# define EMIT_NAME(n,b)
#endif
/* Temporary until can generate */
#ifdef XWFEATURE_FIVEWAY
#include <Hs.h>
extern Err HsNavDrawFocusRing( FormType* formP, UInt16 objectID,
Int16 extraInfo,
RectangleType* boundsInsideRingP,
HsNavFocusRingStyleEnum ringStyle,
Boolean forceRestore);
#endif
#endif
#endif

View file

@ -407,8 +407,6 @@ getFocusOwner( void )
void
drawFocusRingOnGadget( XP_U16 idLow, XP_U16 idHigh )
{
#ifndef XW_TARGET_PNO /* temporary: I need to figure out how to call
HsNavDrawFocusRing from ARM code */
FormPtr form;
XP_S16 index;
XP_U16 focusID;
@ -443,7 +441,6 @@ drawFocusRingOnGadget( XP_U16 idLow, XP_U16 idHigh )
}
}
LOG_RETURN_VOID();
#endif
} /* drawFocusRingOnGadget */
XP_Bool

View file

@ -6,9 +6,17 @@
#include <PceNativeCall.h>
#include <MemoryMgr.h>
/* from http://news.palmos.com/read/messages?id=159373 */
typedef struct EmulStateType {
UInt32 instr;
UInt32 regD[8];
UInt32 regA[8];
UInt32 regPC;
} EmulStateType;
/* This gets written into the code by the callback below. */
typedef struct PNOState {
const void* emulStateP;
const EmulStateType* emulStateP;
Call68KFuncType* call68KFuncP;
void* gotTable;
} PNOState;