mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-28 07:58:08 +01:00
remove use of thread->env mapper for drawing
This commit is contained in:
parent
cfaa6849b2
commit
b7b7da795a
24 changed files with 452 additions and 442 deletions
|
@ -37,7 +37,6 @@ enum {
|
|||
|
||||
typedef struct _AndDraw {
|
||||
DrawCtxVTable* vtable;
|
||||
EnvThreadInfo* ti;
|
||||
jobject jdraw; /* global ref; free it! */
|
||||
XP_LangCode curLang;
|
||||
jobject jCache[JCACHE_COUNT];
|
||||
|
@ -48,9 +47,8 @@ typedef struct _AndDraw {
|
|||
#define CHECKOUT_MARKER ((jobject)-1)
|
||||
|
||||
static jobject
|
||||
makeJRect( AndDraw* draw, int indx, const XP_Rect* rect )
|
||||
makeJRect( AndDraw* draw, JNIEnv* env, int indx, const XP_Rect* rect )
|
||||
{
|
||||
JNIEnv* env = ENVFORME( draw->ti );
|
||||
jobject robj = draw->jCache[indx];
|
||||
#ifdef DEBUG
|
||||
XP_ASSERT( CHECKOUT_MARKER != robj );
|
||||
|
@ -103,9 +101,9 @@ readJRect( JNIEnv* env, XP_Rect* rect, jobject jrect )
|
|||
}
|
||||
|
||||
static jobject
|
||||
makeJRects( AndDraw* draw, int indx, XP_U16 nPlayers, const XP_Rect rects[] )
|
||||
makeJRects( AndDraw* draw, XWEnv xwe, int indx, XP_U16 nPlayers, const XP_Rect rects[] )
|
||||
{
|
||||
JNIEnv* env = ENVFORME( draw->ti );
|
||||
JNIEnv* env = xwe;
|
||||
jobject jrects = draw->jCache[indx];
|
||||
if ( !jrects ) {
|
||||
jclass rclass = (*env)->FindClass( env, "android/graphics/Rect");
|
||||
|
@ -137,9 +135,10 @@ makeJRects( AndDraw* draw, int indx, XP_U16 nPlayers, const XP_Rect rects[] )
|
|||
}
|
||||
|
||||
static jobject
|
||||
makeDSIs( AndDraw* draw, int indx, XP_U16 nPlayers, const DrawScoreInfo dsis[] )
|
||||
makeDSIs( AndDraw* draw, XWEnv xwe, int indx, XP_U16 nPlayers,
|
||||
const DrawScoreInfo dsis[] )
|
||||
{
|
||||
JNIEnv* env = ENVFORME( draw->ti );
|
||||
JNIEnv* env = xwe;
|
||||
jobject dsiobjs = draw->jCache[indx];
|
||||
|
||||
if ( !dsiobjs ) {
|
||||
|
@ -179,9 +178,9 @@ makeDSIs( AndDraw* draw, int indx, XP_U16 nPlayers, const DrawScoreInfo dsis[] )
|
|||
#else
|
||||
|
||||
static jobject
|
||||
makeDSI( AndDraw* draw, int indx, const DrawScoreInfo* dsi )
|
||||
makeDSI( AndDraw* draw, XWEnv xwe, int indx, const DrawScoreInfo* dsi )
|
||||
{
|
||||
JNIEnv* env = ENVFORME( draw->ti );
|
||||
JNIEnv* env = xwe;
|
||||
jobject dsiobj = draw->jCache[indx];
|
||||
|
||||
if ( !dsiobj ) {
|
||||
|
@ -209,13 +208,13 @@ makeDSI( AndDraw* draw, int indx, const DrawScoreInfo* dsi )
|
|||
#endif
|
||||
|
||||
#define DRAW_CBK_HEADER(nam,sig) \
|
||||
JNIEnv* env = xwe; \
|
||||
AndDraw* draw = (AndDraw*)dctx; \
|
||||
JNIEnv* env = ENVFORME( draw->ti ); \
|
||||
XP_ASSERT( !!draw->jdraw ); \
|
||||
jmethodID mid = getMethodID( env, draw->jdraw, nam, sig );
|
||||
jmethodID mid = getMethodID( xwe, draw->jdraw, nam, sig );
|
||||
|
||||
static XP_Bool
|
||||
and_draw_scoreBegin( DrawCtx* dctx, const XP_Rect* rect,
|
||||
and_draw_scoreBegin( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rect,
|
||||
XP_U16 numPlayers, const XP_S16* const scores,
|
||||
XP_S16 remCount, DrawFocusState XP_UNUSED(dfs) )
|
||||
{
|
||||
|
@ -228,7 +227,7 @@ and_draw_scoreBegin( DrawCtx* dctx, const XP_Rect* rect,
|
|||
jarr[ii] = scores[ii];
|
||||
}
|
||||
jintArray jscores = makeIntArray( env, numPlayers, jarr, sizeof(jarr[0]) );
|
||||
jobject jrect = makeJRect( draw, JCACHE_RECT0, rect );
|
||||
jobject jrect = makeJRect( draw, env, JCACHE_RECT0, rect );
|
||||
|
||||
result = (*env)->CallBooleanMethod( env, draw->jdraw, mid,
|
||||
jrect, numPlayers, jscores, remCount );
|
||||
|
@ -245,7 +244,7 @@ and_draw_drawRemText( DrawCtx* dctx, XP_S16 nTilesLeft,
|
|||
{
|
||||
DRAW_CBK_HEADER("drawRemText", "(IZLandroid/graphics/Rect;)Z" );
|
||||
|
||||
jobject jrect = makeJRect( draw, JCACHE_RECT0, rect );
|
||||
jobject jrect = makeJRect( draw, env, JCACHE_RECT0, rect );
|
||||
jboolean result = (*env)->CallBooleanMethod( env, draw->jdraw, mid,
|
||||
nTilesLeft, focussed, jrect );
|
||||
if ( result ) {
|
||||
|
@ -256,7 +255,7 @@ and_draw_drawRemText( DrawCtx* dctx, XP_S16 nTilesLeft,
|
|||
}
|
||||
|
||||
static void
|
||||
and_draw_score_drawPlayers( DrawCtx* dctx, const XP_Rect* scoreRect,
|
||||
and_draw_score_drawPlayers( DrawCtx* dctx, XWEnv xwe, const XP_Rect* scoreRect,
|
||||
XP_U16 nPlayers, DrawScoreInfo playerData[],
|
||||
XP_Rect playerRects[] )
|
||||
{
|
||||
|
@ -264,9 +263,9 @@ and_draw_score_drawPlayers( DrawCtx* dctx, const XP_Rect* scoreRect,
|
|||
"[L" PKG_PATH("jni/DrawScoreInfo;")
|
||||
"[Landroid/graphics/Rect;)V" );
|
||||
|
||||
jobject jrect = makeJRect( draw, JCACHE_RECT0, scoreRect );
|
||||
jobject jdsis = makeDSIs( draw, JCACHE_DSIS, nPlayers, playerData );
|
||||
jobject jrects = makeJRects( draw, JCACHE_RECTS, nPlayers, NULL );
|
||||
jobject jrect = makeJRect( draw, env, JCACHE_RECT0, scoreRect );
|
||||
jobject jdsis = makeDSIs( draw, xwe, JCACHE_DSIS, nPlayers, playerData );
|
||||
jobject jrects = makeJRects( draw, env, JCACHE_RECTS, nPlayers, NULL );
|
||||
(*env)->CallVoidMethod( env, draw->jdraw, mid, jrect, jdsis, jrects );
|
||||
|
||||
for ( int ii = 0; ii < nPlayers; ++ii ) {
|
||||
|
@ -279,7 +278,7 @@ and_draw_score_drawPlayers( DrawCtx* dctx, const XP_Rect* scoreRect,
|
|||
#else
|
||||
|
||||
static XP_Bool
|
||||
and_draw_measureRemText( DrawCtx* dctx, const XP_Rect* rect,
|
||||
and_draw_measureRemText( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rect,
|
||||
XP_S16 nTilesLeft,
|
||||
XP_U16* width, XP_U16* height )
|
||||
{
|
||||
|
@ -287,7 +286,7 @@ and_draw_measureRemText( DrawCtx* dctx, const XP_Rect* rect,
|
|||
|
||||
jintArray widthArray = (*env)->NewIntArray( env, 1 );
|
||||
jintArray heightArray = (*env)->NewIntArray( env, 1 );
|
||||
jobject jrect = makeJRect( draw, JCACHE_RECT0, rect );
|
||||
jobject jrect = makeJRect( draw, xwe, JCACHE_RECT0, rect );
|
||||
|
||||
jboolean result = (*env)->CallBooleanMethod( env, draw->jdraw, mid, jrect,
|
||||
nTilesLeft, widthArray,
|
||||
|
@ -304,15 +303,15 @@ and_draw_measureRemText( DrawCtx* dctx, const XP_Rect* rect,
|
|||
} /* and_draw_measureRemText */
|
||||
|
||||
static void
|
||||
and_draw_drawRemText( DrawCtx* dctx, const XP_Rect* rInner,
|
||||
and_draw_drawRemText( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rInner,
|
||||
const XP_Rect* rOuter,
|
||||
XP_S16 nTilesLeft, XP_Bool focussed )
|
||||
{
|
||||
DRAW_CBK_HEADER("drawRemText",
|
||||
"(Landroid/graphics/Rect;Landroid/graphics/Rect;IZ)V" );
|
||||
|
||||
jobject jrinner = makeJRect( draw, JCACHE_RECT0, rInner );
|
||||
jobject jrouter = makeJRect( draw, JCACHE_RECT1, rOuter );
|
||||
jobject jrinner = makeJRect( draw, env, JCACHE_RECT0, rInner );
|
||||
jobject jrouter = makeJRect( draw, env, JCACHE_RECT1, rOuter );
|
||||
|
||||
(*env)->CallVoidMethod( env, draw->jdraw, mid, jrinner, jrouter,
|
||||
nTilesLeft, focussed );
|
||||
|
@ -321,8 +320,7 @@ and_draw_drawRemText( DrawCtx* dctx, const XP_Rect* rInner,
|
|||
}
|
||||
|
||||
static void
|
||||
and_draw_measureScoreText( DrawCtx* dctx,
|
||||
const XP_Rect* r,
|
||||
and_draw_measureScoreText( DrawCtx* dctx, XWEnv xwe, const XP_Rect* r,
|
||||
const DrawScoreInfo* dsi,
|
||||
XP_U16* width, XP_U16* height )
|
||||
{
|
||||
|
@ -330,8 +328,8 @@ and_draw_measureScoreText( DrawCtx* dctx,
|
|||
"(Landroid/graphics/Rect;L"
|
||||
PKG_PATH("jni/DrawScoreInfo;[I[I)V") );
|
||||
|
||||
jobject jrect = makeJRect( draw, JCACHE_RECT0, r );
|
||||
jobject jdsi = makeDSI( draw, JCACHE_DSI, dsi );
|
||||
jobject jrect = makeJRect( draw, env, JCACHE_RECT0, r );
|
||||
jobject jdsi = makeDSI( draw, xwe, JCACHE_DSI, dsi );
|
||||
|
||||
jintArray widthArray = (*env)->NewIntArray( env, 1 );
|
||||
jintArray heightArray = (*env)->NewIntArray( env, 1 );
|
||||
|
@ -348,7 +346,7 @@ and_draw_measureScoreText( DrawCtx* dctx,
|
|||
} /* and_draw_measureScoreText */
|
||||
|
||||
static void
|
||||
and_draw_score_drawPlayer( DrawCtx* dctx, const XP_Rect* rInner,
|
||||
and_draw_score_drawPlayer( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rInner,
|
||||
const XP_Rect* rOuter, XP_U16 gotPct,
|
||||
const DrawScoreInfo* dsi )
|
||||
{
|
||||
|
@ -356,9 +354,9 @@ and_draw_score_drawPlayer( DrawCtx* dctx, const XP_Rect* rInner,
|
|||
"(Landroid/graphics/Rect;Landroid/graphics/Rect;I"
|
||||
"L" PKG_PATH("jni/DrawScoreInfo") ";)V" );
|
||||
|
||||
jobject jrinner = makeJRect( draw, JCACHE_RECT0, rInner );
|
||||
jobject jrouter = makeJRect( draw, JCACHE_RECT1, rOuter );
|
||||
jobject jdsi = makeDSI( draw, JCACHE_DSI, dsi );
|
||||
jobject jrinner = makeJRect( draw, xwe, JCACHE_RECT0, rInner );
|
||||
jobject jrouter = makeJRect( draw, xwe, JCACHE_RECT1, rOuter );
|
||||
jobject jdsi = makeDSI( draw, xwe, JCACHE_DSI, dsi );
|
||||
|
||||
(*env)->CallVoidMethod( env, draw->jdraw, mid, jrinner, jrouter, gotPct,
|
||||
jdsi );
|
||||
|
@ -368,7 +366,7 @@ and_draw_score_drawPlayer( DrawCtx* dctx, const XP_Rect* rInner,
|
|||
#endif
|
||||
|
||||
static void
|
||||
and_draw_drawTimer( DrawCtx* dctx, const XP_Rect* rect, XP_U16 player,
|
||||
and_draw_drawTimer( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rect, XP_U16 player,
|
||||
XP_S16 secondsLeft, XP_Bool inDuplicateMode )
|
||||
{
|
||||
if ( rect->width == 0 ) {
|
||||
|
@ -376,7 +374,7 @@ and_draw_drawTimer( DrawCtx* dctx, const XP_Rect* rect, XP_U16 player,
|
|||
} else {
|
||||
DRAW_CBK_HEADER("drawTimer", "(Landroid/graphics/Rect;IIZ)V" );
|
||||
|
||||
jobject jrect = makeJRect( draw, JCACHE_RECT0, rect );
|
||||
jobject jrect = makeJRect( draw, xwe, JCACHE_RECT0, rect );
|
||||
(*env)->CallVoidMethod( env, draw->jdraw, mid,
|
||||
jrect, player, secondsLeft, inDuplicateMode );
|
||||
returnJRect( draw, JCACHE_RECT0, jrect );
|
||||
|
@ -384,11 +382,15 @@ and_draw_drawTimer( DrawCtx* dctx, const XP_Rect* rect, XP_U16 player,
|
|||
}
|
||||
|
||||
/* Not used on android yet */
|
||||
static XP_Bool and_draw_beginDraw( DrawCtx* XP_UNUSED(dctx) ) {return XP_TRUE;}
|
||||
static void and_draw_endDraw( DrawCtx* XP_UNUSED(dctx) ) {}
|
||||
static XP_Bool and_draw_beginDraw( DrawCtx* XP_UNUSED(dctx),
|
||||
XWEnv XP_UNUSED(xwe) ) {
|
||||
return XP_TRUE;
|
||||
}
|
||||
static void and_draw_endDraw( DrawCtx* XP_UNUSED(dctx), XWEnv XP_UNUSED(xwe) ) {}
|
||||
|
||||
static XP_Bool
|
||||
and_draw_boardBegin( DrawCtx* XP_UNUSED(dctx), const XP_Rect* XP_UNUSED(rect),
|
||||
and_draw_boardBegin( DrawCtx* XP_UNUSED(dctx), XWEnv XP_UNUSED(xwe),
|
||||
const XP_Rect* XP_UNUSED(rect),
|
||||
XP_U16 XP_UNUSED(cellWidth), XP_U16 XP_UNUSED(cellHeight),
|
||||
DrawFocusState XP_UNUSED(dfs) )
|
||||
{
|
||||
|
@ -396,14 +398,15 @@ and_draw_boardBegin( DrawCtx* XP_UNUSED(dctx), const XP_Rect* XP_UNUSED(rect),
|
|||
}
|
||||
|
||||
static XP_Bool
|
||||
and_draw_drawCell( DrawCtx* dctx, const XP_Rect* rect, const XP_UCHAR* text,
|
||||
and_draw_drawCell( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rect,
|
||||
const XP_UCHAR* text,
|
||||
const XP_Bitmaps* bitmaps, Tile tile, XP_U16 value,
|
||||
XP_S16 owner, XWBonusType bonus, HintAtts hintAtts,
|
||||
CellFlags flags )
|
||||
{
|
||||
DRAW_CBK_HEADER("drawCell",
|
||||
"(Landroid/graphics/Rect;Ljava/lang/String;IIIIII)Z" );
|
||||
jobject jrect = makeJRect( draw, JCACHE_RECT0, rect );
|
||||
jobject jrect = makeJRect( draw, xwe, JCACHE_RECT0, rect );
|
||||
jstring jtext = NULL;
|
||||
if ( !!text ) {
|
||||
if ( 0 == strcmp( "_", text ) ) {
|
||||
|
@ -423,20 +426,22 @@ and_draw_drawCell( DrawCtx* dctx, const XP_Rect* rect, const XP_UCHAR* text,
|
|||
}
|
||||
|
||||
static void
|
||||
and_draw_drawBoardArrow(DrawCtx* dctx, const XP_Rect* rect, XWBonusType bonus,
|
||||
XP_Bool vert, HintAtts hintAtts, CellFlags flags )
|
||||
and_draw_drawBoardArrow( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rect,
|
||||
XWBonusType bonus,XP_Bool vert, HintAtts hintAtts,
|
||||
CellFlags flags )
|
||||
{
|
||||
DRAW_CBK_HEADER("drawBoardArrow", "(Landroid/graphics/Rect;IZII)V" );
|
||||
|
||||
jobject jrect = makeJRect( draw, JCACHE_RECT0, rect );
|
||||
jobject jrect = makeJRect( draw, xwe, JCACHE_RECT0, rect );
|
||||
(*env)->CallVoidMethod( env, draw->jdraw, mid,
|
||||
jrect, bonus, vert, hintAtts, flags );
|
||||
returnJRect( draw, JCACHE_RECT0, jrect );
|
||||
}
|
||||
|
||||
static XP_Bool
|
||||
and_draw_vertScrollBoard( DrawCtx* XP_UNUSED(dctx), XP_Rect* XP_UNUSED(rect),
|
||||
XP_S16 XP_UNUSED(dist), DrawFocusState XP_UNUSED(dfs) )
|
||||
and_draw_vertScrollBoard( DrawCtx* XP_UNUSED(dctx), XWEnv XP_UNUSED(xwe),
|
||||
XP_Rect* XP_UNUSED(rect), XP_S16 XP_UNUSED(dist),
|
||||
DrawFocusState XP_UNUSED(dfs) )
|
||||
{
|
||||
/* Scrolling a bitmap in-place isn't any faster than drawing every cell
|
||||
anew so no point in calling into java. */
|
||||
|
@ -444,12 +449,12 @@ and_draw_vertScrollBoard( DrawCtx* XP_UNUSED(dctx), XP_Rect* XP_UNUSED(rect),
|
|||
}
|
||||
|
||||
static XP_Bool
|
||||
and_draw_trayBegin( DrawCtx* dctx, const XP_Rect* rect, XP_U16 owner,
|
||||
and_draw_trayBegin( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rect, XP_U16 owner,
|
||||
XP_S16 score, DrawFocusState XP_UNUSED(dfs) )
|
||||
{
|
||||
DRAW_CBK_HEADER( "trayBegin", "(Landroid/graphics/Rect;II)Z" );
|
||||
|
||||
jobject jrect = makeJRect( draw, JCACHE_RECT0, rect );
|
||||
jobject jrect = makeJRect( draw, xwe, JCACHE_RECT0, rect );
|
||||
|
||||
jboolean result = (*env)->CallBooleanMethod( env, draw->jdraw, mid,
|
||||
jrect, owner, score );
|
||||
|
@ -458,13 +463,14 @@ and_draw_trayBegin( DrawCtx* dctx, const XP_Rect* rect, XP_U16 owner,
|
|||
}
|
||||
|
||||
static XP_Bool
|
||||
and_draw_drawTile( DrawCtx* dctx, const XP_Rect* rect, const XP_UCHAR* text,
|
||||
const XP_Bitmaps* bitmaps, XP_U16 val, CellFlags flags )
|
||||
and_draw_drawTile( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rect,
|
||||
const XP_UCHAR* text, const XP_Bitmaps* bitmaps,
|
||||
XP_U16 val, CellFlags flags )
|
||||
{
|
||||
XP_Bool result;
|
||||
DRAW_CBK_HEADER( "drawTile",
|
||||
"(Landroid/graphics/Rect;Ljava/lang/String;II)Z" );
|
||||
jobject jrect = makeJRect( draw, JCACHE_RECT0, rect );
|
||||
jobject jrect = makeJRect( draw, xwe, JCACHE_RECT0, rect );
|
||||
jstring jtext = NULL;
|
||||
if ( !!text ) {
|
||||
jtext = (*env)->NewStringUTF( env, text );
|
||||
|
@ -478,7 +484,7 @@ and_draw_drawTile( DrawCtx* dctx, const XP_Rect* rect, const XP_UCHAR* text,
|
|||
}
|
||||
|
||||
static XP_Bool
|
||||
and_draw_drawTileMidDrag( DrawCtx* dctx, const XP_Rect* rect,
|
||||
and_draw_drawTileMidDrag( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rect,
|
||||
const XP_UCHAR* text, const XP_Bitmaps* bitmaps,
|
||||
XP_U16 val, XP_U16 owner, CellFlags flags )
|
||||
{
|
||||
|
@ -486,7 +492,7 @@ and_draw_drawTileMidDrag( DrawCtx* dctx, const XP_Rect* rect,
|
|||
DRAW_CBK_HEADER( "drawTileMidDrag",
|
||||
"(Landroid/graphics/Rect;Ljava/lang/String;III)Z" );
|
||||
|
||||
jobject jrect = makeJRect( draw, JCACHE_RECT0, rect );
|
||||
jobject jrect = makeJRect( draw, xwe, JCACHE_RECT0, rect );
|
||||
jstring jtext = NULL;
|
||||
if ( !!text ) {
|
||||
jtext = (*env)->NewStringUTF( env, text );
|
||||
|
@ -500,11 +506,11 @@ and_draw_drawTileMidDrag( DrawCtx* dctx, const XP_Rect* rect,
|
|||
}
|
||||
|
||||
static XP_Bool
|
||||
and_draw_drawTileBack( DrawCtx* dctx, const XP_Rect* rect, CellFlags flags )
|
||||
and_draw_drawTileBack( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rect, CellFlags flags )
|
||||
{
|
||||
DRAW_CBK_HEADER( "drawTileBack", "(Landroid/graphics/Rect;I)Z" );
|
||||
|
||||
jobject jrect = makeJRect( draw, JCACHE_RECT0, rect );
|
||||
jobject jrect = makeJRect( draw, xwe, JCACHE_RECT0, rect );
|
||||
|
||||
XP_Bool result = (*env)->CallBooleanMethod( env, draw->jdraw, mid, jrect, flags );
|
||||
returnJRect( draw, JCACHE_RECT0, jrect );
|
||||
|
@ -512,11 +518,11 @@ and_draw_drawTileBack( DrawCtx* dctx, const XP_Rect* rect, CellFlags flags )
|
|||
}
|
||||
|
||||
static void
|
||||
and_draw_drawTrayDivider( DrawCtx* dctx, const XP_Rect* rect, CellFlags flags )
|
||||
and_draw_drawTrayDivider( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rect, CellFlags flags )
|
||||
{
|
||||
DRAW_CBK_HEADER( "drawTrayDivider", "(Landroid/graphics/Rect;I)V" );
|
||||
|
||||
jobject jrect = makeJRect( draw, JCACHE_RECT0, rect );
|
||||
jobject jrect = makeJRect( draw, xwe, JCACHE_RECT0, rect );
|
||||
|
||||
(*env)->CallVoidMethod( env, draw->jdraw, mid,
|
||||
jrect, flags );
|
||||
|
@ -524,13 +530,13 @@ and_draw_drawTrayDivider( DrawCtx* dctx, const XP_Rect* rect, CellFlags flags )
|
|||
}
|
||||
|
||||
static void
|
||||
and_draw_score_pendingScore( DrawCtx* dctx, const XP_Rect* rect,
|
||||
and_draw_score_pendingScore( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rect,
|
||||
XP_S16 score, XP_U16 playerNum,
|
||||
XP_Bool curTurn, CellFlags flags )
|
||||
{
|
||||
DRAW_CBK_HEADER( "score_pendingScore", "(Landroid/graphics/Rect;IIZI)V" );
|
||||
|
||||
jobject jrect = makeJRect( draw, JCACHE_RECT0, rect );
|
||||
jobject jrect = makeJRect( draw, xwe, JCACHE_RECT0, rect );
|
||||
|
||||
(*env)->CallVoidMethod( env, draw->jdraw, mid,
|
||||
jrect, score, playerNum, curTurn, flags );
|
||||
|
@ -538,14 +544,14 @@ and_draw_score_pendingScore( DrawCtx* dctx, const XP_Rect* rect,
|
|||
}
|
||||
|
||||
static void
|
||||
and_draw_objFinished( DrawCtx* dctx, BoardObjectType typ,
|
||||
and_draw_objFinished( DrawCtx* dctx, XWEnv xwe, BoardObjectType typ,
|
||||
const XP_Rect* rect,
|
||||
DrawFocusState XP_UNUSED(dfs) )
|
||||
{
|
||||
#ifndef XWFEATURE_SCOREONEPASS
|
||||
DRAW_CBK_HEADER( "objFinished", "(ILandroid/graphics/Rect;)V" );
|
||||
|
||||
jobject jrect = makeJRect( draw, JCACHE_RECT0, rect );
|
||||
jobject jrect = makeJRect( draw, xwe, JCACHE_RECT0, rect );
|
||||
(*env)->CallVoidMethod( env, draw->jdraw, mid,
|
||||
(jint)typ, jrect );
|
||||
returnJRect( draw, JCACHE_RECT0, jrect );
|
||||
|
@ -553,7 +559,7 @@ and_draw_objFinished( DrawCtx* dctx, BoardObjectType typ,
|
|||
}
|
||||
|
||||
static void
|
||||
and_draw_dictChanged( DrawCtx* dctx, XP_S16 playerNum,
|
||||
and_draw_dictChanged( DrawCtx* dctx, XWEnv xwe, XP_S16 playerNum,
|
||||
const DictionaryCtxt* dict )
|
||||
{
|
||||
AndDraw* draw = (AndDraw*)dctx;
|
||||
|
@ -583,7 +589,7 @@ and_draw_dictChanged( DrawCtx* dctx, XP_S16 playerNum,
|
|||
|
||||
#ifdef XWFEATURE_MINIWIN
|
||||
static const XP_UCHAR*
|
||||
and_draw_getMiniWText( DrawCtx* dctx, XWMiniTextType textHint )
|
||||
and_draw_getMiniWText( DrawCtx* dctx, XWEnv xwe, XWMiniTextType textHint )
|
||||
{
|
||||
DRAW_CBK_HEADER( "getMiniWText", "(I)Ljava/lang/String;" );
|
||||
jstring jstr = (*env)->CallObjectMethod( env, draw->jdraw, mid,
|
||||
|
@ -596,7 +602,7 @@ and_draw_getMiniWText( DrawCtx* dctx, XWMiniTextType textHint )
|
|||
}
|
||||
|
||||
static void
|
||||
and_draw_measureMiniWText( DrawCtx* dctx, const XP_UCHAR* textP,
|
||||
and_draw_measureMiniWText( DrawCtx* dctx, XWEnv xwe, const XP_UCHAR* textP,
|
||||
XP_U16* width, XP_U16* height )
|
||||
{
|
||||
DRAW_CBK_HEADER( "measureMiniWText", "(Ljava/lang/String;[I[I)V" );
|
||||
|
@ -618,14 +624,14 @@ and_draw_measureMiniWText( DrawCtx* dctx, const XP_UCHAR* textP,
|
|||
}
|
||||
|
||||
static void
|
||||
and_draw_drawMiniWindow( DrawCtx* dctx, const XP_UCHAR* text,
|
||||
and_draw_drawMiniWindow( DrawCtx* dctx, XWEnv xwe, const XP_UCHAR* text,
|
||||
const XP_Rect* rect, void** closure )
|
||||
{
|
||||
DRAW_CBK_HEADER( "drawMiniWindow",
|
||||
"(Ljava/lang/String;Landroid/graphics/Rect;)V" );
|
||||
|
||||
jstring jstr = (*env)->NewStringUTF( env, text );
|
||||
jobject jrect = makeJRect( draw, JCACHE_RECT0, rect );
|
||||
jobject jrect = makeJRect( draw, xwe, JCACHE_RECT0, rect );
|
||||
|
||||
(*env)->CallVoidMethod( env, draw->jdraw, mid,
|
||||
jstr, jrect );
|
||||
|
@ -635,22 +641,20 @@ and_draw_drawMiniWindow( DrawCtx* dctx, const XP_UCHAR* text,
|
|||
#endif
|
||||
|
||||
static XP_Bool
|
||||
draw_doNothing( DrawCtx* dctx, ... )
|
||||
draw_doNothing( DrawCtx* dctx, XWEnv xwe, ... )
|
||||
{
|
||||
LOG_FUNC();
|
||||
return XP_FALSE;
|
||||
} /* draw_doNothing */
|
||||
|
||||
DrawCtx*
|
||||
makeDraw( MPFORMAL EnvThreadInfo* ti, jobject jdraw )
|
||||
makeDraw( MPFORMAL JNIEnv* env, jobject jdraw )
|
||||
{
|
||||
AndDraw* draw = (AndDraw*)XP_CALLOC( mpool, sizeof(*draw) );
|
||||
JNIEnv* env = ENVFORME( ti );
|
||||
draw->vtable = XP_MALLOC( mpool, sizeof(*draw->vtable) );
|
||||
if ( NULL != jdraw ) {
|
||||
draw->jdraw = (*env)->NewGlobalRef( env, jdraw );
|
||||
}
|
||||
draw->ti = ti;
|
||||
MPASSIGN( draw->mpool, mpool );
|
||||
|
||||
for ( int ii = 0; ii < sizeof(*draw->vtable)/sizeof(void*); ++ii ) {
|
||||
|
@ -698,11 +702,10 @@ makeDraw( MPFORMAL EnvThreadInfo* ti, jobject jdraw )
|
|||
}
|
||||
|
||||
void
|
||||
destroyDraw( DrawCtx** dctx )
|
||||
destroyDraw( DrawCtx** dctx, JNIEnv* env )
|
||||
{
|
||||
if ( !!*dctx ) {
|
||||
AndDraw* draw = (AndDraw*)*dctx;
|
||||
JNIEnv* env = ENVFORME( draw->ti );
|
||||
if ( NULL != draw->jdraw ) {
|
||||
(*env)->DeleteGlobalRef( env, draw->jdraw );
|
||||
}
|
||||
|
|
|
@ -27,8 +27,7 @@
|
|||
|
||||
#include "andglobals.h"
|
||||
|
||||
DrawCtx* makeDraw( MPFORMAL EnvThreadInfo* ti, jobject j_draw );
|
||||
void destroyDraw( DrawCtx** dctx );
|
||||
|
||||
DrawCtx* makeDraw( MPFORMAL JNIEnv* env, jobject j_draw );
|
||||
void destroyDraw( DrawCtx** dctx, JNIEnv* env );
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1021,7 +1021,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_game_1makeNewGame
|
|||
globals->jniutil = state->globalJNI->jniutil;
|
||||
DrawCtx* dctx = NULL;
|
||||
if ( !!j_draw ) {
|
||||
dctx = makeDraw( MPPARM(mpool) ti, j_draw );
|
||||
dctx = makeDraw( MPPARM(mpool) env, j_draw );
|
||||
}
|
||||
globals->dctx = dctx;
|
||||
globals->xportProcs = makeXportProcs( MPPARM(mpool) ti, j_procs );
|
||||
|
@ -1064,7 +1064,7 @@ JNIEXPORT void JNICALL Java_org_eehouse_android_xw4_jni_XwJNI_game_1dispose
|
|||
|
||||
game_dispose( &state->game, env );
|
||||
|
||||
destroyDraw( &globals->dctx );
|
||||
destroyDraw( &globals->dctx, env );
|
||||
destroyXportProcs( &globals->xportProcs );
|
||||
destroyUtil( &globals->util );
|
||||
vtmgr_destroy( MPPARM(mpool) globals->vtMgr );
|
||||
|
@ -1093,7 +1093,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_game_1makeFromStream
|
|||
globals->jniutil, &dict, &dicts, jdictNames, jdicts, jpaths,
|
||||
jlang );
|
||||
if ( !!jdraw ) {
|
||||
globals->dctx = makeDraw( MPPARM(mpool) ti, jdraw );
|
||||
globals->dctx = makeDraw( MPPARM(mpool) env, jdraw );
|
||||
}
|
||||
globals->xportProcs = makeXportProcs( MPPARM(mpool) ti, jprocs );
|
||||
|
||||
|
@ -1169,10 +1169,10 @@ Java_org_eehouse_android_xw4_jni_XwJNI_board_1setDraw
|
|||
{
|
||||
XWJNI_START_GLOBALS();
|
||||
|
||||
DrawCtx* newDraw = makeDraw( MPPARM(mpool) &state->globalJNI->ti, jdraw );
|
||||
board_setDraw( state->game.board, newDraw );
|
||||
DrawCtx* newDraw = makeDraw( MPPARM(mpool) env, jdraw );
|
||||
board_setDraw( state->game.board, env, newDraw );
|
||||
|
||||
destroyDraw( &globals->dctx );
|
||||
destroyDraw( &globals->dctx, env );
|
||||
globals->dctx = newDraw;
|
||||
|
||||
XWJNI_END();
|
||||
|
@ -1193,7 +1193,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_board_1draw
|
|||
{
|
||||
jboolean result;
|
||||
XWJNI_START();
|
||||
result = board_draw( state->game.board );
|
||||
result = board_draw( state->game.board, env );
|
||||
XWJNI_END();
|
||||
return result;
|
||||
}
|
||||
|
@ -1204,9 +1204,9 @@ Java_org_eehouse_android_xw4_jni_XwJNI_board_1drawSnapshot
|
|||
jint height )
|
||||
{
|
||||
XWJNI_START();
|
||||
DrawCtx* newDraw = makeDraw( MPPARM(mpool) &state->globalJNI->ti, jdraw );
|
||||
board_drawSnapshot( state->game.board, newDraw, width, height );
|
||||
destroyDraw( &newDraw );
|
||||
DrawCtx* newDraw = makeDraw( MPPARM(mpool) env, jdraw );
|
||||
board_drawSnapshot( state->game.board, env, newDraw, width, height );
|
||||
destroyDraw( &newDraw, env );
|
||||
XWJNI_END();
|
||||
}
|
||||
|
||||
|
@ -1603,7 +1603,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_board_1requestHint
|
|||
jboolean result;
|
||||
XWJNI_START();
|
||||
XP_Bool tmpbool;
|
||||
result = board_requestHint( state->game.board,
|
||||
result = board_requestHint( state->game.board, env,
|
||||
#ifdef XWFEATURE_SEARCHLIMIT
|
||||
useLimits,
|
||||
#endif
|
||||
|
|
|
@ -88,7 +88,7 @@ static void boardCellChanged( void* board, XP_U16 turn, XP_U16 col,
|
|||
XP_U16 row, XP_Bool added );
|
||||
static void boardTilesChanged( void* board, XP_U16 turn, XP_S16 index1,
|
||||
XP_S16 index2 );
|
||||
static void dictChanged( void* p_board, XP_S16 playerNum,
|
||||
static void dictChanged( void* p_board, XWEnv xwe, XP_S16 playerNum,
|
||||
const DictionaryCtxt* oldDict,
|
||||
const DictionaryCtxt* newDict );
|
||||
|
||||
|
@ -294,12 +294,12 @@ board_makeFromStream( MPFORMAL XWStreamCtxt* stream, ModelCtxt* model,
|
|||
} /* board_makeFromStream */
|
||||
|
||||
void
|
||||
board_setDraw( BoardCtxt* board, DrawCtx* draw )
|
||||
board_setDraw( BoardCtxt* board, XWEnv xwe, DrawCtx* draw )
|
||||
{
|
||||
board->draw = draw;
|
||||
if ( !!draw ) {
|
||||
DictionaryCtxt* langDict = model_getDictionary( board->model );
|
||||
draw_dictChanged( draw, -1, langDict );
|
||||
draw_dictChanged( draw, xwe, -1, langDict );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -403,13 +403,13 @@ board_reset( BoardCtxt* board )
|
|||
} /* board_reset */
|
||||
|
||||
void
|
||||
board_drawSnapshot( const BoardCtxt* curBoard, DrawCtx* dctx,
|
||||
board_drawSnapshot( const BoardCtxt* curBoard, XWEnv xwe, DrawCtx* dctx,
|
||||
XP_U16 width, XP_U16 height )
|
||||
{
|
||||
BoardCtxt* newBoard = board_make( MPPARM(curBoard->mpool)
|
||||
curBoard->model,
|
||||
curBoard->server, dctx, curBoard->util );
|
||||
board_setDraw( newBoard, dctx ); /* so draw_dictChanged() will get called */
|
||||
board_setDraw( newBoard, xwe, dctx ); /* so draw_dictChanged() will get called */
|
||||
XP_U16 fontWidth = width / curBoard->gi->boardSize;
|
||||
board_figureLayout( newBoard, curBoard->gi, 0, 0, width, height,
|
||||
100, 0, 0, 0, fontWidth, width, XP_FALSE, NULL );
|
||||
|
@ -417,7 +417,7 @@ board_drawSnapshot( const BoardCtxt* curBoard, DrawCtx* dctx,
|
|||
newBoard->showColors = curBoard->showColors;
|
||||
newBoard->showGrid = curBoard->showGrid;
|
||||
|
||||
board_draw( newBoard );
|
||||
board_draw( newBoard, xwe );
|
||||
board_destroy( newBoard, XP_FALSE );
|
||||
}
|
||||
|
||||
|
@ -1258,13 +1258,13 @@ board_selectPlayer( BoardCtxt* board, XP_U16 newPlayer, XP_Bool canSwitch )
|
|||
} /* board_selectPlayer */
|
||||
|
||||
void
|
||||
board_hiliteCellAt( BoardCtxt* board, XP_U16 col, XP_U16 row )
|
||||
board_hiliteCellAt( BoardCtxt* board, XWEnv xwe, XP_U16 col, XP_U16 row )
|
||||
{
|
||||
XP_Rect cellRect;
|
||||
|
||||
flipIf( board, col, row, &col, &row );
|
||||
if ( getCellRect( board, col, row, &cellRect ) ) {
|
||||
draw_invertCell( board->draw, &cellRect );
|
||||
draw_invertCell( board->draw, xwe, &cellRect );
|
||||
invalCell( board, col, row );
|
||||
}
|
||||
/* sleep(1); */
|
||||
|
@ -1417,7 +1417,7 @@ setTimerIf( BoardCtxt* board )
|
|||
} /* setTimerIf */
|
||||
|
||||
static void
|
||||
timerFiredForTimer( BoardCtxt* board )
|
||||
timerFiredForTimer( BoardCtxt* board, XWEnv xwe )
|
||||
{
|
||||
board->timerPending = XP_FALSE;
|
||||
if ( !board->gameOver || !server_canUnpause( board->server ) ) {
|
||||
|
@ -1432,7 +1432,7 @@ timerFiredForTimer( BoardCtxt* board )
|
|||
}
|
||||
}
|
||||
if ( doDraw ) {
|
||||
drawTimer( board );
|
||||
drawTimer( board, xwe );
|
||||
}
|
||||
}
|
||||
setTimerIf( board );
|
||||
|
@ -1447,7 +1447,7 @@ p_board_timerFired( void* closure, XWEnv xwe, XWTimerReason why )
|
|||
draw = timerFiredForPen( board, xwe );
|
||||
} else {
|
||||
XP_ASSERT( why == TIMER_TIMERTICK );
|
||||
timerFiredForTimer( board );
|
||||
timerFiredForTimer( board, xwe );
|
||||
}
|
||||
return draw;
|
||||
} /* board_timerFired */
|
||||
|
@ -2128,7 +2128,7 @@ MIN_TRADE_TILES( const BoardCtxt* board )
|
|||
* any redrawing to be done.
|
||||
*/
|
||||
XP_Bool
|
||||
board_requestHint( BoardCtxt* board,
|
||||
board_requestHint( BoardCtxt* board, XWEnv xwe,
|
||||
#ifdef XWFEATURE_SEARCHLIMIT
|
||||
XP_Bool useTileLimits,
|
||||
#endif
|
||||
|
@ -2170,7 +2170,7 @@ board_requestHint( BoardCtxt* board,
|
|||
that it's ok to wait until we've found the move anyway. */
|
||||
redraw = XP_TRUE;
|
||||
#else
|
||||
board_draw( board );
|
||||
board_draw( board, xwe );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -3907,13 +3907,14 @@ boardTilesChanged( void* p_board, XP_U16 turn, XP_S16 index1, XP_S16 index2 )
|
|||
} /* boardTilesChanged */
|
||||
|
||||
static void
|
||||
dictChanged( void* p_board, XP_S16 playerNum, const DictionaryCtxt* oldDict,
|
||||
dictChanged( void* p_board, XWEnv xwe, XP_S16 playerNum,
|
||||
const DictionaryCtxt* oldDict,
|
||||
const DictionaryCtxt* newDict )
|
||||
{
|
||||
BoardCtxt* board = (BoardCtxt*)p_board;
|
||||
if ( !!board->draw ) {
|
||||
if ( (NULL == oldDict) || (oldDict != newDict) ) {
|
||||
draw_dictChanged( board->draw, playerNum, newDict );
|
||||
draw_dictChanged( board->draw, xwe, playerNum, newDict );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ BoardCtxt* board_makeFromStream( MPFORMAL XWStreamCtxt* stream,
|
|||
DrawCtx* draw, XW_UtilCtxt* util,
|
||||
XP_U16 nPlayers );
|
||||
void board_setCallbacks( BoardCtxt* board );
|
||||
void board_setDraw( BoardCtxt* board, DrawCtx* draw );
|
||||
void board_setDraw( BoardCtxt* board, XWEnv xwe, DrawCtx* draw );
|
||||
DrawCtx* board_getDraw( const BoardCtxt* board );
|
||||
|
||||
void board_destroy( BoardCtxt* board, XP_Bool ownsUtil );
|
||||
|
@ -75,7 +75,7 @@ void board_writeToStream( const BoardCtxt* board, XWStreamCtxt* stream );
|
|||
|
||||
void board_reset( BoardCtxt* board );
|
||||
|
||||
void board_drawSnapshot( const BoardCtxt* board, DrawCtx* dctx,
|
||||
void board_drawSnapshot( const BoardCtxt* board, XWEnv xwe, DrawCtx* dctx,
|
||||
XP_U16 width, XP_U16 height );
|
||||
|
||||
/* Layout. Either done internally or by client */
|
||||
|
@ -145,7 +145,7 @@ XP_Bool board_getActiveRect( const BoardCtxt* board, XP_Rect* rect,
|
|||
XP_U16* nCols, XP_U16* nRows );
|
||||
#endif
|
||||
|
||||
XP_Bool board_draw( BoardCtxt* board );
|
||||
XP_Bool board_draw( BoardCtxt* board, XWEnv xwe );
|
||||
|
||||
XP_Bool board_get_flipped( const BoardCtxt* board );
|
||||
XP_Bool board_flip( BoardCtxt* board );
|
||||
|
@ -160,7 +160,7 @@ XP_U16 board_getSelPlayer(const BoardCtxt* board );
|
|||
XP_Bool board_passwordProvided( BoardCtxt* board, XP_U16 player, const
|
||||
XP_UCHAR* pass );
|
||||
|
||||
XP_Bool board_requestHint( BoardCtxt* board,
|
||||
XP_Bool board_requestHint( BoardCtxt* board, XWEnv xwe,
|
||||
#ifdef XWFEATURE_SEARCHLIMIT
|
||||
XP_Bool useTileLimits,
|
||||
#endif
|
||||
|
@ -170,7 +170,7 @@ XP_Bool board_prefsChanged( BoardCtxt* board, const CommonPrefs* cp );
|
|||
|
||||
BoardObjectType board_getFocusOwner( BoardCtxt* board );
|
||||
|
||||
void board_hiliteCellAt( BoardCtxt* board, XP_U16 col, XP_U16 row );
|
||||
void board_hiliteCellAt( BoardCtxt* board, XWEnv xwe, XP_U16 col, XP_U16 row );
|
||||
XP_Bool board_setBlankValue( BoardCtxt* board, XP_U16 XP_UNUSED(player),
|
||||
XP_U16 col, XP_U16 row, XP_U16 tileIndex );
|
||||
|
||||
|
|
|
@ -69,10 +69,10 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
static XP_Bool drawCell( BoardCtxt* board, XP_U16 col, XP_U16 row,
|
||||
static XP_Bool drawCell( BoardCtxt* board, XWEnv xwe, XP_U16 col, XP_U16 row,
|
||||
XP_Bool skipBlanks );
|
||||
static void drawBoard( BoardCtxt* board );
|
||||
static void scrollIfCan( BoardCtxt* board );
|
||||
static void drawBoard( BoardCtxt* board, XWEnv xwe );
|
||||
static void scrollIfCan( BoardCtxt* board, XWEnv xwe );
|
||||
#ifdef KEYBOARD_NAV
|
||||
static XP_Bool cellFocused( const BoardCtxt* board, XP_U16 col, XP_U16 row );
|
||||
#endif
|
||||
|
@ -97,7 +97,7 @@ static XP_UCHAR* formatFlags(XP_UCHAR* buf, XP_U16 len, CellFlags flags);
|
|||
#endif
|
||||
|
||||
#ifdef POINTER_SUPPORT
|
||||
static void drawDragTileIf( BoardCtxt* board );
|
||||
static void drawDragTileIf( BoardCtxt* board, XWEnv xwe );
|
||||
#endif
|
||||
|
||||
#ifdef KEYBOARD_NAV
|
||||
|
@ -263,10 +263,10 @@ flagsForCrosshairs( const BoardCtxt* board, XP_U16 col, XP_U16 row )
|
|||
#endif
|
||||
|
||||
static void
|
||||
drawBoard( BoardCtxt* board )
|
||||
drawBoard( BoardCtxt* board, XWEnv xwe )
|
||||
{
|
||||
if ( board->needsDrawing
|
||||
&& draw_boardBegin( board->draw, &board->boardBounds,
|
||||
&& draw_boardBegin( board->draw, xwe, &board->boardBounds,
|
||||
board->sd[SCROLL_H].scale,
|
||||
board->sd[SCROLL_V].scale,
|
||||
dfsFor( board, OBJ_BOARD ) ) ) {
|
||||
|
@ -280,7 +280,7 @@ drawBoard( BoardCtxt* board )
|
|||
ScrollData* vsd = &board->sd[SCROLL_V];
|
||||
BlankQueue bq;
|
||||
|
||||
scrollIfCan( board ); /* this must happen before we count blanks
|
||||
scrollIfCan( board, xwe ); /* this must happen before we count blanks
|
||||
since it invalidates squares */
|
||||
|
||||
/* This is freaking expensive!!!! PENDING FIXME Can't we start from
|
||||
|
@ -313,7 +313,7 @@ drawBoard( BoardCtxt* board )
|
|||
for ( col = 0; col < nVisCols; ++col ) {
|
||||
RowFlags colMask = 1 << (col + hsd->offset);
|
||||
if ( 0 != (rowFlags & colMask) ) {
|
||||
if ( !drawCell( board, col + hsd->offset,
|
||||
if ( !drawCell( board, xwe, col + hsd->offset,
|
||||
row, XP_TRUE )) {
|
||||
failedBits |= colMask;
|
||||
allDrawn = XP_FALSE;
|
||||
|
@ -326,7 +326,7 @@ drawBoard( BoardCtxt* board )
|
|||
|
||||
/* draw the blanks we skipped before */
|
||||
for ( ii = 0; ii < bq.nBlanks; ++ii ) {
|
||||
if ( !drawCell( board, bq.col[ii], bq.row[ii], XP_FALSE ) ) {
|
||||
if ( !drawCell( board, xwe, bq.col[ii], bq.row[ii], XP_FALSE ) ) {
|
||||
allDrawn = XP_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -350,7 +350,7 @@ drawBoard( BoardCtxt* board )
|
|||
flags |= flagsForCrosshairs( board, col, row );
|
||||
#endif
|
||||
|
||||
draw_drawBoardArrow( board->draw, &arrowRect, bonus,
|
||||
draw_drawBoardArrow( board->draw, xwe, &arrowRect, bonus,
|
||||
arrow->vert, hintAtts, flags );
|
||||
}
|
||||
}
|
||||
|
@ -358,9 +358,9 @@ drawBoard( BoardCtxt* board )
|
|||
/* I doubt the two of these can happen at the same time */
|
||||
drawTradeWindowIf( board );
|
||||
#ifdef POINTER_SUPPORT
|
||||
drawDragTileIf( board );
|
||||
drawDragTileIf( board, xwe );
|
||||
#endif
|
||||
draw_objFinished( board->draw, OBJ_BOARD, &board->boardBounds,
|
||||
draw_objFinished( board->draw, xwe, OBJ_BOARD, &board->boardBounds,
|
||||
dfsFor( board, OBJ_BOARD ) );
|
||||
|
||||
board->needsDrawing = !allDrawn;
|
||||
|
@ -368,7 +368,7 @@ drawBoard( BoardCtxt* board )
|
|||
} /* drawBoard */
|
||||
|
||||
static XP_Bool
|
||||
drawCell( BoardCtxt* board, const XP_U16 col, const XP_U16 row, XP_Bool skipBlanks )
|
||||
drawCell( BoardCtxt* board, XWEnv xwe, const XP_U16 col, const XP_U16 row, XP_Bool skipBlanks )
|
||||
{
|
||||
XP_Bool success = XP_TRUE;
|
||||
XP_Rect cellRect = {0};
|
||||
|
@ -466,7 +466,7 @@ drawCell( BoardCtxt* board, const XP_U16 col, const XP_U16 row, XP_Bool skipBlan
|
|||
flags |= flagsForCrosshairs( board, col, row );
|
||||
#endif
|
||||
|
||||
success = draw_drawCell( board->draw, &cellRect, textP, bptr,
|
||||
success = draw_drawCell( board->draw, xwe, &cellRect, textP, bptr,
|
||||
tile, value, owner, bonus, hintAtts,
|
||||
flags );
|
||||
#ifdef LOG_CELL_DRAW
|
||||
|
@ -526,7 +526,7 @@ cellFocused( const BoardCtxt* board, XP_U16 col, XP_U16 row )
|
|||
|
||||
#ifdef POINTER_SUPPORT
|
||||
static void
|
||||
drawDragTileIf( BoardCtxt* board )
|
||||
drawDragTileIf( BoardCtxt* board, XWEnv xwe )
|
||||
{
|
||||
if ( dragDropInProgress( board ) ) {
|
||||
XP_U16 col, row;
|
||||
|
@ -553,7 +553,7 @@ drawDragTileIf( BoardCtxt* board )
|
|||
if ( board->hideValsInTray && !board->showCellValues ) {
|
||||
flags |= CELL_VALHIDDEN;
|
||||
}
|
||||
draw_drawTileMidDrag( board->draw, &rect, face,
|
||||
draw_drawTileMidDrag( board->draw, xwe, &rect, face,
|
||||
bitmaps.nBitmaps > 0 ? &bitmaps : NULL,
|
||||
value, board->selPlayer, flags );
|
||||
}
|
||||
|
@ -579,7 +579,7 @@ sumRowHeights( const BoardCtxt* board, XP_U16 row1, XP_U16 row2 )
|
|||
}
|
||||
|
||||
static void
|
||||
scrollIfCan( BoardCtxt* board )
|
||||
scrollIfCan( BoardCtxt* board, XWEnv xwe )
|
||||
{
|
||||
ScrollData* vsd = &board->sd[SCROLL_V];
|
||||
if ( vsd->offset != board->prevYScrollOffset ) {
|
||||
|
@ -597,7 +597,7 @@ scrollIfCan( BoardCtxt* board )
|
|||
invalSelTradeWindow( board );
|
||||
|
||||
dist = sumRowHeights( board, board->prevYScrollOffset, vsd->offset );
|
||||
scrolled = draw_vertScrollBoard( board->draw, &scrollR, dist,
|
||||
scrolled = draw_vertScrollBoard( board->draw, xwe, &scrollR, dist,
|
||||
dfsFor( board, OBJ_BOARD ) );
|
||||
|
||||
if ( scrolled ) {
|
||||
|
@ -632,16 +632,16 @@ drawTradeWindowIf( BoardCtxt* board )
|
|||
#endif
|
||||
|
||||
XP_Bool
|
||||
board_draw( BoardCtxt* board )
|
||||
board_draw( BoardCtxt* board, XWEnv xwe )
|
||||
{
|
||||
if ( !!board->draw && board->boardBounds.width > 0 ) {
|
||||
if ( draw_beginDraw( board->draw ) ) {
|
||||
if ( draw_beginDraw( board->draw, xwe ) ) {
|
||||
|
||||
drawScoreBoard( board );
|
||||
drawTray( board );
|
||||
drawBoard( board );
|
||||
drawScoreBoard( board, xwe );
|
||||
drawTray( board, xwe );
|
||||
drawBoard( board, xwe );
|
||||
|
||||
draw_endDraw( board->draw );
|
||||
draw_endDraw( board->draw, xwe );
|
||||
}
|
||||
}
|
||||
return !board->needsDrawing && 0 == board->trayInvalBits;
|
||||
|
|
|
@ -244,7 +244,7 @@ struct BoardCtxt {
|
|||
|
||||
/* tray-related functions */
|
||||
XP_Bool handlePenUpTray( BoardCtxt* board, XP_U16 x, XP_U16 y );
|
||||
void drawTray( BoardCtxt* board );
|
||||
void drawTray( BoardCtxt* board, XWEnv xwe );
|
||||
XP_Bool moveTileToArrowLoc( BoardCtxt* board, XP_U8 index );
|
||||
XP_U16 indexForBits( XP_U8 bits );
|
||||
XP_Bool rectContainsPt( const XP_Rect* rect1, XP_S16 x, XP_S16 y );
|
||||
|
|
|
@ -628,7 +628,7 @@ setLimitsFrom( const BoardCtxt* board, BdHintLimits* limits )
|
|||
#endif
|
||||
|
||||
static XP_Bool
|
||||
scrollTimerProc( void* closure, XWEnv XP_UNUSED(xwe), XWTimerReason XP_UNUSED_DBG(why) )
|
||||
scrollTimerProc( void* closure, XWEnv xwe, XWTimerReason XP_UNUSED_DBG(why) )
|
||||
{
|
||||
XP_Bool draw = XP_FALSE;
|
||||
BoardCtxt* board = (BoardCtxt*)closure;
|
||||
|
@ -653,7 +653,7 @@ scrollTimerProc( void* closure, XWEnv XP_UNUSED(xwe), XWTimerReason XP_UNUSED_DB
|
|||
}
|
||||
if ( scrollIntoView( board, ds->cur.u.board.col,
|
||||
ds->cur.u.board.row ) ) {
|
||||
board_draw( board ); /* may fail, e.g. on wince */
|
||||
board_draw( board, xwe ); /* may fail, e.g. on wince */
|
||||
startScrollTimerIf( board );
|
||||
draw = XP_TRUE;
|
||||
}
|
||||
|
|
|
@ -100,102 +100,102 @@ typedef struct DrawCtxVTable {
|
|||
#endif
|
||||
|
||||
#ifdef DRAW_WITH_PRIMITIVES
|
||||
void DRAW_VTABLE_NAME(setClip)( DrawCtx* dctx, const XP_Rect* newClip,
|
||||
void DRAW_VTABLE_NAME(setClip)( DrawCtx* dctx, XWEnv xwe, XWEnv xwe, const XP_Rect* newClip,
|
||||
const XP_Rect* oldClip );
|
||||
void DRAW_VTABLE_NAME(frameRect)( DrawCtx* dctx, const XP_Rect* rect );
|
||||
void DRAW_VTABLE_NAME(invertRect)( DrawCtx* dctx, const XP_Rect* rect );
|
||||
void DRAW_VTABLE_NAME(drawString)( DrawCtx* dctx, const XP_UCHAR* str,
|
||||
void DRAW_VTABLE_NAME(frameRect)( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rect );
|
||||
void DRAW_VTABLE_NAME(invertRect)( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rect );
|
||||
void DRAW_VTABLE_NAME(drawString)( DrawCtx* dctx, XWEnv xwe, const XP_UCHAR* str,
|
||||
XP_U16 x, XP_U16 y );
|
||||
void DRAW_VTABLE_NAME(drawBitmap)( DrawCtx* dctx, const XP_Bitmap bm,
|
||||
void DRAW_VTABLE_NAME(drawBitmap)( DrawCtx* dctx, XWEnv xwe, const XP_Bitmap bm,
|
||||
XP_U16 x, XP_U16 y );
|
||||
void DRAW_VTABLE_NAME(measureText)( DrawCtx* dctx, const XP_UCHAR* buf,
|
||||
void DRAW_VTABLE_NAME(measureText)( DrawCtx* dctx, XWEnv xwe, const XP_UCHAR* buf,
|
||||
XP_U16* widthP, XP_U16* heightP );
|
||||
#endif
|
||||
|
||||
void DRAW_VTABLE_NAME(destroyCtxt) ( DrawCtx* dctx );
|
||||
void DRAW_VTABLE_NAME(destroyCtxt) ( DrawCtx* dctx, XWEnv xwe );
|
||||
|
||||
void DRAW_VTABLE_NAME(dictChanged)( DrawCtx* dctx, XP_S16 playerNum,
|
||||
void DRAW_VTABLE_NAME(dictChanged)( DrawCtx* dctx, XWEnv xwe, XP_S16 playerNum,
|
||||
const DictionaryCtxt* dict );
|
||||
|
||||
XP_Bool DRAW_VTABLE_NAME(beginDraw) ( DrawCtx* dctx );
|
||||
void DRAW_VTABLE_NAME(endDraw) ( DrawCtx* dctx );
|
||||
XP_Bool DRAW_VTABLE_NAME(beginDraw) ( DrawCtx* dctx, XWEnv xwe );
|
||||
void DRAW_VTABLE_NAME(endDraw) ( DrawCtx* dctx, XWEnv xwe );
|
||||
|
||||
XP_Bool DRAW_VTABLE_NAME(boardBegin) ( DrawCtx* dctx,
|
||||
XP_Bool DRAW_VTABLE_NAME(boardBegin) ( DrawCtx* dctx, XWEnv xwe,
|
||||
const XP_Rect* rect,
|
||||
XP_U16 hScale, XP_U16 vScale,
|
||||
DrawFocusState dfs );
|
||||
void DRAW_VTABLE_NAME(objFinished)( DrawCtx* dctx, BoardObjectType typ,
|
||||
void DRAW_VTABLE_NAME(objFinished)( DrawCtx* dctx, XWEnv xwe, BoardObjectType typ,
|
||||
const XP_Rect* rect,
|
||||
DrawFocusState dfs );
|
||||
|
||||
/* rect is not const: set by callee */
|
||||
XP_Bool DRAW_VTABLE_NAME(vertScrollBoard) (DrawCtx* dctx, XP_Rect* rect,
|
||||
XP_Bool DRAW_VTABLE_NAME(vertScrollBoard) (DrawCtx* dctx, XWEnv xwe, XP_Rect* rect,
|
||||
XP_S16 dist, DrawFocusState dfs );
|
||||
|
||||
XP_Bool DRAW_VTABLE_NAME(trayBegin) ( DrawCtx* dctx, const XP_Rect* rect,
|
||||
XP_Bool DRAW_VTABLE_NAME(trayBegin) ( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rect,
|
||||
XP_U16 owner, XP_S16 score,
|
||||
DrawFocusState dfs );
|
||||
|
||||
XP_Bool DRAW_VTABLE_NAME(scoreBegin) ( DrawCtx* dctx, const XP_Rect* rect,
|
||||
XP_Bool DRAW_VTABLE_NAME(scoreBegin) ( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rect,
|
||||
XP_U16 numPlayers,
|
||||
const XP_S16* const scores,
|
||||
XP_S16 remCount, DrawFocusState dfs );
|
||||
#ifdef XWFEATURE_SCOREONEPASS
|
||||
XP_Bool DRAW_VTABLE_NAME(drawRemText) ( DrawCtx* dctx, XP_S16 nTilesLeft,
|
||||
XP_Bool DRAW_VTABLE_NAME(drawRemText) ( DrawCtx* dctx, XWEnv xwe, XP_S16 nTilesLeft,
|
||||
XP_Bool focussed, XP_Rect* rect );
|
||||
void DRAW_VTABLE_NAME(score_drawPlayers)( DrawCtx* dctx,
|
||||
void DRAW_VTABLE_NAME(score_drawPlayers)( DrawCtx* dctx, XWEnv xwe,
|
||||
const XP_Rect* scoreRect,
|
||||
XP_U16 nPlayers,
|
||||
DrawScoreInfo playerData[],
|
||||
DrawScoreInfo playerData[],
|
||||
XP_Rect playerRects[] );
|
||||
#else
|
||||
XP_Bool DRAW_VTABLE_NAME(measureRemText) ( DrawCtx* dctx, const XP_Rect* r,
|
||||
XP_S16 nTilesLeft,
|
||||
XP_Bool DRAW_VTABLE_NAME(measureRemText) ( DrawCtx* dctx, XWEnv xwe, const XP_Rect* r,
|
||||
XP_S16 nTilesLeft,
|
||||
XP_U16* width, XP_U16* height );
|
||||
void DRAW_VTABLE_NAME(drawRemText) ( DrawCtx* dctx, const XP_Rect* rInner,
|
||||
const XP_Rect* rOuter,
|
||||
void DRAW_VTABLE_NAME(drawRemText) ( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rInner,
|
||||
const XP_Rect* rOuter,
|
||||
XP_S16 nTilesLeft, XP_Bool focussed );
|
||||
void DRAW_VTABLE_NAME(measureScoreText) ( DrawCtx* dctx,
|
||||
void DRAW_VTABLE_NAME(measureScoreText) ( DrawCtx* dctx, XWEnv xwe,
|
||||
const XP_Rect* r,
|
||||
const DrawScoreInfo* dsi,
|
||||
XP_U16* width, XP_U16* height );
|
||||
void DRAW_VTABLE_NAME(score_drawPlayer) ( DrawCtx* dctx,
|
||||
void DRAW_VTABLE_NAME(score_drawPlayer) ( DrawCtx* dctx, XWEnv xwe,
|
||||
const XP_Rect* rInner,
|
||||
const XP_Rect* rOuter,
|
||||
XP_U16 gotPct,
|
||||
const DrawScoreInfo* dsi );
|
||||
#endif
|
||||
void DRAW_VTABLE_NAME(score_pendingScore) ( DrawCtx* dctx,
|
||||
const XP_Rect* rect,
|
||||
XP_S16 score,
|
||||
void DRAW_VTABLE_NAME(score_pendingScore) ( DrawCtx* dctx, XWEnv xwe,
|
||||
const XP_Rect* rect,
|
||||
XP_S16 score,
|
||||
XP_U16 playerNum,
|
||||
XP_Bool curTurn,
|
||||
CellFlags flags );
|
||||
|
||||
void DRAW_VTABLE_NAME(drawTimer) ( DrawCtx* dctx, const XP_Rect* rect,
|
||||
void DRAW_VTABLE_NAME(drawTimer) ( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rect,
|
||||
XP_U16 player, XP_S16 secondsLeft,
|
||||
XP_Bool turnDone );
|
||||
|
||||
XP_Bool DRAW_VTABLE_NAME(drawCell) ( DrawCtx* dctx, const XP_Rect* rect,
|
||||
XP_Bool DRAW_VTABLE_NAME(drawCell) ( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rect,
|
||||
/* at least one of these two will be
|
||||
null */
|
||||
const XP_UCHAR* text,
|
||||
const XP_UCHAR* text,
|
||||
const XP_Bitmaps* bitmaps,
|
||||
Tile tile, XP_U16 value,
|
||||
XP_S16 owner, /* -1 means don't use */
|
||||
XWBonusType bonus, HintAtts hintAtts,
|
||||
CellFlags flags );
|
||||
|
||||
void DRAW_VTABLE_NAME(invertCell) ( DrawCtx* dctx, const XP_Rect* rect );
|
||||
void DRAW_VTABLE_NAME(invertCell) ( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rect );
|
||||
|
||||
XP_Bool DRAW_VTABLE_NAME(drawTile) ( DrawCtx* dctx, const XP_Rect* rect,
|
||||
XP_Bool DRAW_VTABLE_NAME(drawTile) ( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rect,
|
||||
/* at least 1 of these 2 will be
|
||||
null*/
|
||||
const XP_UCHAR* text,
|
||||
const XP_UCHAR* text,
|
||||
const XP_Bitmaps* bitmaps,
|
||||
XP_U16 val, CellFlags flags );
|
||||
#ifdef POINTER_SUPPORT
|
||||
XP_Bool DRAW_VTABLE_NAME(drawTileMidDrag) ( DrawCtx* dctx,
|
||||
XP_Bool DRAW_VTABLE_NAME(drawTileMidDrag) ( DrawCtx* dctx, XWEnv xwe,
|
||||
const XP_Rect* rect,
|
||||
/* at least 1 of these 2 will
|
||||
be null*/
|
||||
|
@ -204,24 +204,24 @@ typedef struct DrawCtxVTable {
|
|||
XP_U16 val, XP_U16 owner,
|
||||
CellFlags flags );
|
||||
#endif
|
||||
XP_Bool DRAW_VTABLE_NAME(drawTileBack) ( DrawCtx* dctx, const XP_Rect* rect,
|
||||
XP_Bool DRAW_VTABLE_NAME(drawTileBack) ( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rect,
|
||||
CellFlags flags );
|
||||
void DRAW_VTABLE_NAME(drawTrayDivider) ( DrawCtx* dctx, const XP_Rect* rect,
|
||||
void DRAW_VTABLE_NAME(drawTrayDivider) ( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rect,
|
||||
CellFlags flags );
|
||||
|
||||
void DRAW_VTABLE_NAME(clearRect) ( DrawCtx* dctx, const XP_Rect* rect );
|
||||
void DRAW_VTABLE_NAME(clearRect) ( DrawCtx* dctx, XWEnv xwe, const XP_Rect* rect );
|
||||
|
||||
void DRAW_VTABLE_NAME(drawBoardArrow) ( DrawCtx* dctx,
|
||||
void DRAW_VTABLE_NAME(drawBoardArrow) ( DrawCtx* dctx, XWEnv xwe,
|
||||
const XP_Rect* rect,
|
||||
XWBonusType bonus, XP_Bool vert,
|
||||
HintAtts hintAtts,
|
||||
CellFlags flags);
|
||||
#ifdef XWFEATURE_MINIWIN
|
||||
const XP_UCHAR* DRAW_VTABLE_NAME(getMiniWText) ( DrawCtx* dctx,
|
||||
const XP_UCHAR* DRAW_VTABLE_NAME(getMiniWText) ( DrawCtx* dctx, XWEnv xwe,
|
||||
XWMiniTextType textHint );
|
||||
void DRAW_VTABLE_NAME(measureMiniWText) ( DrawCtx* dctx, const XP_UCHAR* textP,
|
||||
void DRAW_VTABLE_NAME(measureMiniWText) ( DrawCtx* dctx, XWEnv xwe, const XP_UCHAR* textP,
|
||||
XP_U16* width, XP_U16* height );
|
||||
void DRAW_VTABLE_NAME(drawMiniWindow)( DrawCtx* dctx, const XP_UCHAR* text,
|
||||
void DRAW_VTABLE_NAME(drawMiniWindow)( DrawCtx* dctx, XWEnv xwe, const XP_UCHAR* text,
|
||||
const XP_Rect* rect, void** closure );
|
||||
#endif
|
||||
#ifndef DRAW_LINK_DIRECT
|
||||
|
@ -254,98 +254,98 @@ struct DrawCtx {
|
|||
linked##_draw_##name(dc,(p1),(p2),(p3),(p4),(p5),(p6),(p7),\
|
||||
(p8),(p9),(p10))
|
||||
#else
|
||||
# define CALL_DRAW_NAME0(name,dc) ((dc)->vtable->m_draw_##name)(dc)
|
||||
# define CALL_DRAW_NAME1(name,dc,p1) ((dc)->vtable->m_draw_##name)(dc,(p1))
|
||||
# define CALL_DRAW_NAME2(name,dc,p1,p2) \
|
||||
((dc)->vtable->m_draw_##name)(dc,(p1),(p2))
|
||||
# define CALL_DRAW_NAME3(name,dc,p1,p2,p3) \
|
||||
((dc)->vtable->m_draw_##name)(dc,(p1),(p2),(p3))
|
||||
# define CALL_DRAW_NAME4(name,dc,p1,p2,p3,p4) \
|
||||
((dc)->vtable->m_draw_##name)(dc,(p1),(p2),(p3),(p4))
|
||||
# define CALL_DRAW_NAME5(name,dc,p1,p2,p3,p4,p5) \
|
||||
((dc)->vtable->m_draw_##name)(dc,(p1),(p2),(p3),(p4),(p5))
|
||||
# define CALL_DRAW_NAME6(name,dc,p1,p2,p3,p4,p5,p6) \
|
||||
((dc)->vtable->m_draw_##name)(dc,(p1),(p2),(p3),(p4),(p5),(p6))
|
||||
# define CALL_DRAW_NAME8(name,dc,p1,p2,p3,p4,p5,p6,p7,p8) \
|
||||
((dc)->vtable->m_draw_##name)(dc,(p1),(p2),(p3),(p4),(p5),(p6),(p7), \
|
||||
# define CALL_DRAW_NAME0(name,dc,e) ((dc)->vtable->m_draw_##name)((dc), (e))
|
||||
# define CALL_DRAW_NAME1(name,dc,e,p1) ((dc)->vtable->m_draw_##name)((dc),(e),(p1))
|
||||
# define CALL_DRAW_NAME2(name,dc,e,p1,p2) \
|
||||
((dc)->vtable->m_draw_##name)(dc,(e),(p1),(p2))
|
||||
# define CALL_DRAW_NAME3(name,dc,e,p1,p2,p3) \
|
||||
((dc)->vtable->m_draw_##name)((dc),(e),(p1),(p2),(p3))
|
||||
# define CALL_DRAW_NAME4(name,dc,e,p1,p2,p3,p4) \
|
||||
((dc)->vtable->m_draw_##name)((dc),(e),(p1),(p2),(p3),(p4))
|
||||
# define CALL_DRAW_NAME5(name,dc,e,p1,p2,p3,p4,p5) \
|
||||
((dc)->vtable->m_draw_##name)((dc),(e),(p1),(p2),(p3),(p4),(p5))
|
||||
# define CALL_DRAW_NAME6(name,dc,e,p1,p2,p3,p4,p5,p6) \
|
||||
((dc)->vtable->m_draw_##name)((dc),(e),(p1),(p2),(p3),(p4),(p5),(p6))
|
||||
# define CALL_DRAW_NAME8(name,dc,e,p1,p2,p3,p4,p5,p6,p7,p8) \
|
||||
((dc)->vtable->m_draw_##name)((dc),(e),(p1),(p2),(p3),(p4),(p5),(p6),(p7), \
|
||||
(p8))
|
||||
# define CALL_DRAW_NAME9(name,dc,p1,p2,p3,p4,p5,p6,p7,p8,p9) \
|
||||
((dc)->vtable->m_draw_##name)(dc,(p1),(p2),(p3),(p4),(p5),(p6),(p7), \
|
||||
# define CALL_DRAW_NAME9(name,dc,e,p1,p2,p3,p4,p5,p6,p7,p8,p9) \
|
||||
((dc)->vtable->m_draw_##name)((dc),(e),(p1),(p2),(p3),(p4),(p5),(p6),(p7), \
|
||||
(p8),(p9))
|
||||
# define CALL_DRAW_NAME10(name,dc,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) \
|
||||
((dc)->vtable->m_draw_##name)(dc,(p1),(p2),(p3),(p4),(p5),(p6),(p7),\
|
||||
(p8),(p9),(p10))
|
||||
# define CALL_DRAW_NAME10(name,dc,e,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) \
|
||||
((dc)->vtable->m_draw_##name)((dc),(e),(p1),(p2),(p3),(p4),(p5),(p6),(p7), \
|
||||
(p8),(p9),(p10))
|
||||
#endif
|
||||
|
||||
#define draw_destroyCtxt(dc) CALL_DRAW_NAME0(destroyCtxt, dc)
|
||||
#define draw_dictChanged( dc, n, d ) CALL_DRAW_NAME2(dictChanged, (dc), (n), (d))
|
||||
#define draw_beginDraw( dc ) CALL_DRAW_NAME0(beginDraw, (dc))
|
||||
#define draw_endDraw( dc ) CALL_DRAW_NAME0(endDraw, (dc))
|
||||
#define draw_boardBegin( dc,r,h,v,f ) CALL_DRAW_NAME4(boardBegin, (dc),\
|
||||
#define draw_destroyCtxt(dc,e) CALL_DRAW_NAME0(destroyCtxt, (dc), (e))
|
||||
#define draw_dictChanged( dc, e, n, d ) CALL_DRAW_NAME2(dictChanged, (dc),(e),(n),(d))
|
||||
#define draw_beginDraw( dc,e ) CALL_DRAW_NAME0(beginDraw, (dc), (e))
|
||||
#define draw_endDraw( dc,e ) CALL_DRAW_NAME0(endDraw, (dc), (e))
|
||||
#define draw_boardBegin( dc,e,r,h,v,f ) CALL_DRAW_NAME4(boardBegin, (dc), (e), \
|
||||
(r),(h),(v),(f))
|
||||
#define draw_objFinished( dc, t, r, d ) \
|
||||
CALL_DRAW_NAME3(objFinished, (dc), (t), (r), (d))
|
||||
#define draw_trayBegin( dc, r, o, s, f ) \
|
||||
CALL_DRAW_NAME4(trayBegin, dc, r, o, s, f)
|
||||
#define draw_vertScrollBoard( dc, r, d, f ) \
|
||||
CALL_DRAW_NAME3(vertScrollBoard, (dc),(r),(d),(f))
|
||||
#define draw_scoreBegin( dc, r, t, s, c, f ) \
|
||||
CALL_DRAW_NAME5( scoreBegin,(dc), (r), (t), (s), (c), (f))
|
||||
#define draw_objFinished( dc, e, t, r, d ) \
|
||||
CALL_DRAW_NAME3(objFinished, (dc),(e), (t), (r), (d))
|
||||
#define draw_trayBegin( dc, e, r, o, s, f ) \
|
||||
CALL_DRAW_NAME4(trayBegin, dc, e, r, o, s, f)
|
||||
#define draw_vertScrollBoard( dc, e, r, d, f ) \
|
||||
CALL_DRAW_NAME3(vertScrollBoard, (dc),(e),(r),(d),(f))
|
||||
#define draw_scoreBegin( dc, e, r, t, s, c, f ) \
|
||||
CALL_DRAW_NAME5( scoreBegin,(dc),(e), (r), (t), (s), (c), (f))
|
||||
#ifdef XWFEATURE_SCOREONEPASS
|
||||
# define draw_drawRemText( dc, nt, f, ro ) \
|
||||
CALL_DRAW_NAME3(drawRemText, (dc), (nt), (f), (ro) )
|
||||
# define draw_score_drawPlayers( dc, r, np, pd, pr ) \
|
||||
CALL_DRAW_NAME4(score_drawPlayers, (dc), (r), (np), (pd), (pr) )
|
||||
# define draw_drawRemText( dc, e, nt, f, ro ) \
|
||||
CALL_DRAW_NAME3(drawRemText, (dc),(e), (nt), (f), (ro) )
|
||||
# define draw_score_drawPlayers( dc, e, r, np, pd, pr ) \
|
||||
CALL_DRAW_NAME4(score_drawPlayers, (dc),(e), (r), (np), (pd), (pr) )
|
||||
#else
|
||||
# define draw_measureRemText( dc, r, n, wp, hp ) \
|
||||
CALL_DRAW_NAME4(measureRemText, (dc), (r), (n), (wp), (hp) )
|
||||
# define draw_drawRemText( dc, ri, ro, n, f ) \
|
||||
CALL_DRAW_NAME4(drawRemText, (dc), (ri), (ro), (n), (f) )
|
||||
# define draw_measureScoreText(dc,r,dsi,wp,hp) \
|
||||
CALL_DRAW_NAME4(measureScoreText,(dc),(r),(dsi),(wp),(hp))
|
||||
# define draw_score_drawPlayer(dc, ri, ro, gp, dsi) \
|
||||
CALL_DRAW_NAME4(score_drawPlayer,(dc),(ri),(ro),(gp),(dsi))
|
||||
# define draw_measureRemText( dc, e, r, n, wp, hp ) \
|
||||
CALL_DRAW_NAME4(measureRemText, (dc),(e), (r), (n), (wp), (hp) )
|
||||
# define draw_drawRemText( dc, e, ri, ro, n, f ) \
|
||||
CALL_DRAW_NAME4(drawRemText, (dc),(e), (ri), (ro), (n), (f) )
|
||||
# define draw_measureScoreText(dc, e, r, dsi, wp, hp) \
|
||||
CALL_DRAW_NAME4(measureScoreText,(dc),(e),(r),(dsi),(wp),(hp))
|
||||
# define draw_score_drawPlayer(dc, e, ri, ro, gp, dsi) \
|
||||
CALL_DRAW_NAME4(score_drawPlayer,(dc),(e),(ri),(ro),(gp),(dsi))
|
||||
#endif
|
||||
#define draw_score_pendingScore(dc, r, s, p, t, f ) \
|
||||
CALL_DRAW_NAME5(score_pendingScore,(dc), (r), (s), (p), (t), (f))
|
||||
#define draw_drawTimer( dc, r, plyr, sec, dm ) \
|
||||
CALL_DRAW_NAME4(drawTimer,(dc),(r),(plyr),(sec), (dm))
|
||||
#define draw_drawCell( dc, rect, txt, bmap, t, v,o, bon, hi, f ) \
|
||||
CALL_DRAW_NAME9(drawCell,(dc),(rect),(txt),(bmap),(t),(v),(o),(bon),(hi), \
|
||||
#define draw_score_pendingScore(dc, e, r, s, p, t, f ) \
|
||||
CALL_DRAW_NAME5(score_pendingScore,(dc),(e), (r), (s), (p), (t), (f))
|
||||
#define draw_drawTimer( dc, e, r, plyr, sec, dm ) \
|
||||
CALL_DRAW_NAME4(drawTimer,(dc),(e),(r),(plyr),(sec), (dm))
|
||||
#define draw_drawCell( dc, e, rect, txt, bmap, t, v,o, bon, hi, f ) \
|
||||
CALL_DRAW_NAME9(drawCell,(dc),(e),(rect),(txt),(bmap),(t),(v),(o),(bon),(hi), \
|
||||
(f))
|
||||
#define draw_invertCell( dc, rect ) CALL_DRAW_NAME1(invertCell,(dc),(rect))
|
||||
#define draw_drawTile( dc, rect, text, bmp, val, hil ) \
|
||||
CALL_DRAW_NAME5(drawTile,(dc),(rect),(text),(bmp),(val),(hil))
|
||||
#define draw_invertCell( dc, e, rect ) CALL_DRAW_NAME1(invertCell,(dc),(e),(rect))
|
||||
#define draw_drawTile( dc, e, rect, text, bmp, val, hil ) \
|
||||
CALL_DRAW_NAME5(drawTile,(dc),(e),(rect),(text),(bmp),(val),(hil))
|
||||
#ifdef POINTER_SUPPORT
|
||||
#define draw_drawTileMidDrag( dc, rect, text, bmp, val, ownr, hil ) \
|
||||
CALL_DRAW_NAME6(drawTileMidDrag,(dc),(rect),(text),(bmp),(val),(ownr),(hil))
|
||||
#define draw_drawTileMidDrag( dc, e, rect, text, bmp, val, ownr, hil ) \
|
||||
CALL_DRAW_NAME6(drawTileMidDrag,(dc),(e),(rect),(text),(bmp),(val),(ownr),(hil))
|
||||
#endif /* POINTER_SUPPORT */
|
||||
#define draw_drawTileBack( dc, rect, f ) \
|
||||
CALL_DRAW_NAME2(drawTileBack, (dc), (rect), (f) )
|
||||
#define draw_drawTrayDivider( dc, rect, s ) \
|
||||
CALL_DRAW_NAME2(drawTrayDivider,(dc),(rect), (s))
|
||||
#define draw_clearRect( dc, rect ) CALL_DRAW_NAME1(clearRect,(dc),(rect))
|
||||
#define draw_drawBoardArrow( dc, r, b, v, h, f ) \
|
||||
CALL_DRAW_NAME5(drawBoardArrow,(dc),(r),(b), (v), (h), (f))
|
||||
#define draw_drawTileBack( dc, e, rect, f ) \
|
||||
CALL_DRAW_NAME2(drawTileBack, (dc),(e), (rect), (f) )
|
||||
#define draw_drawTrayDivider( dc, e, rect, s ) \
|
||||
CALL_DRAW_NAME2(drawTrayDivider,(dc),(e),(rect), (s))
|
||||
#define draw_clearRect( dc, e, rect ) CALL_DRAW_NAME1(clearRect,(dc),(e),(rect))
|
||||
#define draw_drawBoardArrow( dc, e, r, b, v, h, f ) \
|
||||
CALL_DRAW_NAME5(drawBoardArrow,(dc),(e),(r),(b), (v), (h), (f))
|
||||
|
||||
#ifdef XWFEATURE_MINIWIN
|
||||
# define draw_getMiniWText( dc, b ) CALL_DRAW_NAME1(getMiniWText, (dc),(b) )
|
||||
# define draw_measureMiniWText( dc, t, wp, hp) \
|
||||
CALL_DRAW_NAME3(measureMiniWText, (dc),(t), (wp), (hp) )
|
||||
# define draw_drawMiniWindow( dc, t, r, c ) \
|
||||
CALL_DRAW_NAME3(drawMiniWindow, (dc), (t), (r), (c) )
|
||||
# define draw_getMiniWText( dc, e, b ) CALL_DRAW_NAME1(getMiniWText, (dc),(e),(b) )
|
||||
# define draw_measureMiniWText( dc, e, t, wp, hp) \
|
||||
CALL_DRAW_NAME3(measureMiniWText, (dc),(e),(t), (wp), (hp) )
|
||||
# define draw_drawMiniWindow( dc, e, t, r, c ) \
|
||||
CALL_DRAW_NAME3(drawMiniWindow, (dc),(e), (t), (r), (c) )
|
||||
#endif
|
||||
|
||||
#ifdef DRAW_WITH_PRIMITIVES
|
||||
# define draw_setClip( dc, rn, ro ) CALL_DRAW_NAME2(setClip, (dc), (rn), (ro))
|
||||
# define draw_frameRect( dc, r ) CALL_DRAW_NAME1(frameRect, (dc), (r) )
|
||||
# define draw_invertRect( dc, r ) CALL_DRAW_NAME1(invertCell, (dc), (r) )
|
||||
# define draw_drawString( dc, s, x, y) \
|
||||
CALL_DRAW_NAME3(drawString, (dc), (s), (x), (y) )
|
||||
# define draw_drawBitmap( dc, bm, x, y ) \
|
||||
CALL_DRAW_NAME3(drawBitmap, (dc), (bm), (x), (y) )
|
||||
# define draw_measureText( dc, t, wp, hp ) \
|
||||
CALL_DRAW_NAME3(measureText, (dc), (t), (wp), (hp) )
|
||||
# define draw_setClip( dc, e, rn, ro ) CALL_DRAW_NAME2(setClip, (dc),(e), (rn), (ro))
|
||||
# define draw_frameRect( dc, e, r ) CALL_DRAW_NAME1(frameRect, (dc),(e), (r) )
|
||||
# define draw_invertRect( dc, e, r ) CALL_DRAW_NAME1(invertCell, (dc),(e), (r) )
|
||||
# define draw_drawString( dc, e, s, x, y) \
|
||||
CALL_DRAW_NAME3(drawString, (dc),(e), (s), (x), (y) )
|
||||
# define draw_drawBitmap( dc, e, bm, x, y ) \
|
||||
CALL_DRAW_NAME3(drawBitmap, (dc),(e), (bm), (x), (y) )
|
||||
# define draw_measureText( dc, e, t, wp, hp ) \
|
||||
CALL_DRAW_NAME3(measureText, (dc),(e), (t), (wp), (hp) )
|
||||
|
||||
void InitDrawDefaults( DrawCtxVTable* vtable );
|
||||
#endif /* DRAW_WITH_PRIMITIVES */
|
||||
|
|
|
@ -154,7 +154,7 @@ game_makeNewGame( MPFORMAL XWEnv xwe, XWGame* game, CurGameInfo* gi,
|
|||
NULL, util );
|
||||
board_setCallbacks( game->board );
|
||||
|
||||
board_setDraw( game->board, draw );
|
||||
board_setDraw( game->board, xwe, draw );
|
||||
setListeners( game, cp );
|
||||
} /* game_makeNewGame */
|
||||
|
||||
|
@ -295,7 +295,7 @@ game_makeFromStream( MPFORMAL XWEnv xwe, XWStreamCtxt* stream, XWGame* game,
|
|||
game->model, game->server,
|
||||
NULL, util, gi->nPlayers );
|
||||
setListeners( game, cp );
|
||||
board_setDraw( game->board, draw );
|
||||
board_setDraw( game->board, xwe, draw );
|
||||
success = XP_TRUE;
|
||||
} while( XP_FALSE );
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ static void notifyBoardListeners( ModelCtxt* model, XP_U16 turn,
|
|||
XP_U16 col, XP_U16 row, XP_Bool added );
|
||||
static void notifyTrayListeners( ModelCtxt* model, XP_U16 turn,
|
||||
XP_S16 index1, XP_S16 index2 );
|
||||
static void notifyDictListeners( ModelCtxt* model, XP_S16 playerNum,
|
||||
static void notifyDictListeners( ModelCtxt* model, XWEnv xwe, XP_S16 playerNum,
|
||||
DictionaryCtxt* oldDict,
|
||||
DictionaryCtxt* newDict );
|
||||
static void model_unrefDicts( ModelCtxt* model, XWEnv xwe );
|
||||
|
@ -582,7 +582,7 @@ model_setDictionary( ModelCtxt* model, XWEnv xwe, DictionaryCtxt* dict )
|
|||
setStackBits( model, dict );
|
||||
}
|
||||
|
||||
notifyDictListeners( model, -1, oldDict, dict );
|
||||
notifyDictListeners( model, xwe, -1, oldDict, dict );
|
||||
dict_unref( oldDict, xwe );
|
||||
} /* model_setDictionary */
|
||||
|
||||
|
@ -602,7 +602,7 @@ model_setPlayerDicts( ModelCtxt* model, XWEnv xwe, const PlayerDicts* dicts )
|
|||
|| dict_tilesAreSame( gameDict, newDict ) );
|
||||
model->vol.dicts.dicts[ii] = dict_ref( newDict, xwe );
|
||||
|
||||
notifyDictListeners( model, ii, oldDict, newDict );
|
||||
notifyDictListeners( model, xwe, ii, oldDict, newDict );
|
||||
setStackBits( model, newDict );
|
||||
|
||||
dict_unref( oldDict, xwe );
|
||||
|
@ -2216,12 +2216,12 @@ notifyTrayListeners( ModelCtxt* model, XP_U16 turn, XP_S16 index1,
|
|||
} /* notifyTrayListeners */
|
||||
|
||||
static void
|
||||
notifyDictListeners( ModelCtxt* model, XP_S16 playerNum,
|
||||
notifyDictListeners( ModelCtxt* model, XWEnv xwe, XP_S16 playerNum,
|
||||
DictionaryCtxt* oldDict, DictionaryCtxt* newDict )
|
||||
{
|
||||
if ( model->vol.dictListenerFunc != NULL ) {
|
||||
(*model->vol.dictListenerFunc)( model->vol.dictListenerData, playerNum,
|
||||
oldDict, newDict );
|
||||
(*model->vol.dictListenerFunc)( model->vol.dictListenerData, xwe,
|
||||
playerNum, oldDict, newDict );
|
||||
}
|
||||
} /* notifyDictListeners */
|
||||
|
||||
|
|
|
@ -263,7 +263,7 @@ typedef void (*TrayListener)( void* data, XP_U16 turn,
|
|||
XP_S16 index1, XP_S16 index2 );
|
||||
void model_setTrayListener( ModelCtxt* model, TrayListener bl,
|
||||
void* data );
|
||||
typedef void (*DictListener)( void* data, XP_S16 playerNum,
|
||||
typedef void (*DictListener)( void* data, XWEnv xwe, XP_S16 playerNum,
|
||||
const DictionaryCtxt* oldDict,
|
||||
const DictionaryCtxt* newDict );
|
||||
void model_setDictListener( ModelCtxt* model, DictListener dl,
|
||||
|
|
|
@ -56,7 +56,7 @@ drawScoreBoard( BoardCtxt* board )
|
|||
}
|
||||
}
|
||||
|
||||
if ( draw_scoreBegin( board->draw, &board->scoreBdBounds, nPlayers,
|
||||
if ( draw_scoreBegin( board->draw, xwe, &board->scoreBdBounds, nPlayers,
|
||||
scores.arr, nTilesInPool, dfs ) ) {
|
||||
XP_U16 selPlayer = board->selPlayer;
|
||||
XP_Rect playerRects[nPlayers];
|
||||
|
@ -82,7 +82,7 @@ drawScoreBoard( BoardCtxt* board )
|
|||
XP_MEMSET( data, 0, sizeof(data) );
|
||||
|
||||
XP_Rect scoreRect = board->scoreBdBounds;
|
||||
if ( !draw_drawRemText( board->draw, nTilesInPool,
|
||||
if ( !draw_drawRemText( board->draw, xwe, nTilesInPool,
|
||||
focusAll || remFocussed,
|
||||
&scoreRect ) ) {
|
||||
scoreRect.height = scoreRect.width = 0;
|
||||
|
@ -127,8 +127,8 @@ drawScoreBoard( BoardCtxt* board )
|
|||
model_getNumTilesTotal( model, ii );
|
||||
}
|
||||
|
||||
draw_score_drawPlayers( board->draw, &scoreRect, nPlayers, data,
|
||||
playerRects );
|
||||
draw_score_drawPlayers( board->draw, xwe, &scoreRect, nPlayers,
|
||||
data, playerRects );
|
||||
for ( ii = 0; ii < nPlayers; ++ii ) {
|
||||
XP_Rect* rp = &playerRects[ii];
|
||||
board->pti[ii].scoreDims = isVertical ? rp->height : rp->width;
|
||||
|
@ -137,7 +137,7 @@ drawScoreBoard( BoardCtxt* board )
|
|||
sizeof(board->pti[ii].scoreRects) );
|
||||
#endif
|
||||
}
|
||||
draw_objFinished( board->draw, OBJ_SCORE,
|
||||
draw_objFinished( board->draw, xwe, OBJ_SCORE,
|
||||
&board->scoreBdBounds, dfs );
|
||||
|
||||
board->scoreBoardInvalid = XP_FALSE;
|
||||
|
@ -166,7 +166,7 @@ typedef struct _DrawScoreData {
|
|||
} DrawScoreData;
|
||||
|
||||
void
|
||||
drawScoreBoard( BoardCtxt* board )
|
||||
drawScoreBoard( BoardCtxt* board, XWEnv xwe )
|
||||
{
|
||||
if ( board->scoreBoardInvalid ) {
|
||||
short ii;
|
||||
|
@ -208,7 +208,7 @@ drawScoreBoard( BoardCtxt* board )
|
|||
}
|
||||
}
|
||||
|
||||
if ( draw_scoreBegin( board->draw, &board->scoreBdBounds, nPlayers,
|
||||
if ( draw_scoreBegin( board->draw, xwe, &board->scoreBdBounds, nPlayers,
|
||||
scores.arr, nTilesInPool,
|
||||
dfsFor( board, OBJ_SCORE ) ) ) {
|
||||
XP_U16 totalDim = 0; /* not counting rem */
|
||||
|
@ -217,7 +217,7 @@ drawScoreBoard( BoardCtxt* board )
|
|||
/* Let platform decide whether the rem: string should be given
|
||||
any space once there are no tiles left. On Palm that space
|
||||
is clickable to drop a menu, so will probably leave it. */
|
||||
if ( !draw_measureRemText( board->draw, &board->scoreBdBounds,
|
||||
if ( !draw_measureRemText( board->draw, xwe, &board->scoreBdBounds,
|
||||
nTilesInPool, &remWidth,
|
||||
&remHeight ) ) {
|
||||
remWidth = remHeight = 0;
|
||||
|
@ -274,7 +274,7 @@ drawScoreBoard( BoardCtxt* board )
|
|||
dp->dsi.nTilesLeft = (nTilesInPool > 0)? -1:
|
||||
model_getNumTilesTotal( model, ii );
|
||||
|
||||
draw_measureScoreText( board->draw, &scoreRect,
|
||||
draw_measureScoreText( board->draw, xwe, &scoreRect,
|
||||
&dp->dsi, &dp->width,
|
||||
&dp->height );
|
||||
|
||||
|
@ -302,7 +302,7 @@ drawScoreBoard( BoardCtxt* board )
|
|||
XP_Rect innerRect;
|
||||
*adjustDim = remDim;
|
||||
centerIn( &innerRect, &scoreRect, remWidth, remHeight );
|
||||
draw_drawRemText( board->draw, &innerRect, &scoreRect,
|
||||
draw_drawRemText( board->draw, xwe, &innerRect, &scoreRect,
|
||||
nTilesInPool,
|
||||
focusAll || remFocussed );
|
||||
*adjustPt += remDim;
|
||||
|
@ -324,7 +324,7 @@ drawScoreBoard( BoardCtxt* board )
|
|||
|
||||
centerIn( &innerRect, &scoreRect, dp->width,
|
||||
dp->height );
|
||||
draw_score_drawPlayer( board->draw, &innerRect,
|
||||
draw_score_drawPlayer( board->draw, xwe, &innerRect,
|
||||
&scoreRect, gotPct, &dp->dsi );
|
||||
#ifdef KEYBOARD_NAV
|
||||
XP_MEMCPY( &board->pti[ii].scoreRects, &scoreRect,
|
||||
|
@ -334,7 +334,7 @@ drawScoreBoard( BoardCtxt* board )
|
|||
}
|
||||
}
|
||||
|
||||
draw_objFinished( board->draw, OBJ_SCORE,
|
||||
draw_objFinished( board->draw, xwe, OBJ_SCORE,
|
||||
&board->scoreBdBounds,
|
||||
dfsFor( board, OBJ_SCORE ) );
|
||||
|
||||
|
@ -343,12 +343,12 @@ drawScoreBoard( BoardCtxt* board )
|
|||
}
|
||||
}
|
||||
|
||||
drawTimer( board );
|
||||
drawTimer( board, xwe );
|
||||
} /* drawScoreBoard */
|
||||
#endif
|
||||
|
||||
void
|
||||
drawTimer( const BoardCtxt* board )
|
||||
drawTimer( const BoardCtxt* board, XWEnv xwe )
|
||||
{
|
||||
if ( !!board->draw && board->gi->timerEnabled ) {
|
||||
XP_S16 secondsLeft = server_getTimerSeconds( board->server,
|
||||
|
@ -356,7 +356,7 @@ drawTimer( const BoardCtxt* board )
|
|||
XP_Bool turnDone = board->gi->inDuplicateMode
|
||||
? server_dupTurnDone( board->server, board->selPlayer )
|
||||
: XP_FALSE;
|
||||
draw_drawTimer( board->draw, &board->timerBounds,
|
||||
draw_drawTimer( board->draw, xwe, &board->timerBounds,
|
||||
board->selPlayer, secondsLeft, turnDone );
|
||||
}
|
||||
} /* drawTimer */
|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
|
||||
#include "boardp.h"
|
||||
|
||||
void drawScoreBoard( BoardCtxt* board );
|
||||
void drawScoreBoard( BoardCtxt* board, XWEnv xwe );
|
||||
XP_S16 figureScoreRectTapped( const BoardCtxt* board, XP_U16 x, XP_U16 y );
|
||||
void drawTimer( const BoardCtxt* board );
|
||||
void drawTimer( const BoardCtxt* board, XWEnv xwe );
|
||||
void penTimerFiredScore( const BoardCtxt* board );
|
||||
|
||||
#if defined POINTER_SUPPORT || defined KEYBOARD_NAV
|
||||
|
|
|
@ -29,7 +29,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
/****************************** prototypes ******************************/
|
||||
static void drawPendingScore( BoardCtxt* board, XP_S16 turnScore,
|
||||
static void drawPendingScore( BoardCtxt* board, XWEnv xwe, XP_S16 turnScore,
|
||||
XP_Bool hasCursor );
|
||||
static XP_S16 figurePendingScore( const BoardCtxt* board );
|
||||
static XP_U16 countTilesToShow( BoardCtxt* board );
|
||||
|
@ -130,7 +130,7 @@ figureTrayTileRect( BoardCtxt* board, XP_U16 index, XP_Rect* rect )
|
|||
*/
|
||||
|
||||
void
|
||||
drawTray( BoardCtxt* board )
|
||||
drawTray( BoardCtxt* board, XWEnv xwe )
|
||||
{
|
||||
XP_Rect tileRect;
|
||||
|
||||
|
@ -140,7 +140,7 @@ drawTray( BoardCtxt* board )
|
|||
|
||||
XP_S16 turnScore = figurePendingScore( board );
|
||||
|
||||
if ( draw_trayBegin( board->draw, &board->trayBounds, turn,
|
||||
if ( draw_trayBegin( board->draw, xwe, &board->trayBounds, turn,
|
||||
turnScore, dfsFor( board, OBJ_TRAY ) ) ) {
|
||||
DictionaryCtxt* dictionary = model_getDictionary( board->model );
|
||||
XP_U16 trayInvalBits = board->trayInvalBits;
|
||||
|
@ -195,7 +195,7 @@ drawTray( BoardCtxt* board )
|
|||
|
||||
XP_Bool drew;
|
||||
if ( ii >= numInTray ) {
|
||||
drew = draw_drawTile( board->draw, &tileRect, NULL,
|
||||
drew = draw_drawTile( board->draw, xwe, &tileRect, NULL,
|
||||
NULL, -1,
|
||||
flags | CELL_ISEMPTY );
|
||||
} else if ( showFaces ) {
|
||||
|
@ -235,12 +235,12 @@ drawTray( BoardCtxt* board )
|
|||
flags |= CELL_ISBLANK;
|
||||
}
|
||||
|
||||
drew = draw_drawTile( board->draw, &tileRect, textP,
|
||||
drew = draw_drawTile( board->draw, xwe, &tileRect, textP,
|
||||
( bitmaps.nBitmaps > 0
|
||||
? &bitmaps : NULL ),
|
||||
value, flags );
|
||||
} else {
|
||||
drew = draw_drawTileBack( board->draw, &tileRect,
|
||||
drew = draw_drawTileBack( board->draw, xwe, &tileRect,
|
||||
flags );
|
||||
}
|
||||
|
||||
|
@ -258,14 +258,14 @@ drawTray( BoardCtxt* board )
|
|||
|| dragDropIsDividerDrag(board) ) {
|
||||
flags |= CELL_PENDING;
|
||||
}
|
||||
draw_drawTrayDivider( board->draw, ÷r, flags );
|
||||
draw_drawTrayDivider( board->draw, xwe, ÷r, flags );
|
||||
board->dividerInvalid = XP_FALSE;
|
||||
}
|
||||
drawPendingScore( board, turnScore,
|
||||
drawPendingScore( board, xwe, turnScore,
|
||||
(cursorBits & (1<<(MAX_TRAY_TILES-1))) != 0);
|
||||
}
|
||||
|
||||
draw_objFinished( board->draw, OBJ_TRAY, &board->trayBounds,
|
||||
draw_objFinished( board->draw, xwe, OBJ_TRAY, &board->trayBounds,
|
||||
dfsFor( board, OBJ_TRAY ) );
|
||||
|
||||
board->trayInvalBits = trayInvalBits;
|
||||
|
@ -333,7 +333,7 @@ figurePendingScore( const BoardCtxt* board )
|
|||
}
|
||||
|
||||
static void
|
||||
drawPendingScore( BoardCtxt* board, XP_S16 turnScore, XP_Bool hasCursor )
|
||||
drawPendingScore( BoardCtxt* board, XWEnv xwe, XP_S16 turnScore, XP_Bool hasCursor )
|
||||
{
|
||||
/* Draw the pending score down in the last tray's rect */
|
||||
if ( countTilesToShow( board ) < MAX_TRAY_TILES ) {
|
||||
|
@ -343,7 +343,7 @@ drawPendingScore( BoardCtxt* board, XP_S16 turnScore, XP_Bool hasCursor )
|
|||
|
||||
figureTrayTileRect( board, MAX_TRAY_TILES-1, &lastTileR );
|
||||
if ( 0 < lastTileR.width && 0 < lastTileR.height ) {
|
||||
draw_score_pendingScore( board->draw, &lastTileR, turnScore,
|
||||
draw_score_pendingScore( board->draw, xwe, &lastTileR, turnScore,
|
||||
selPlayer, curTurn,
|
||||
hasCursor?CELL_ISCURSOR:CELL_NONE );
|
||||
}
|
||||
|
|
|
@ -314,7 +314,7 @@ onGameSaved( void* closure, sqlite3_int64 rowid, XP_Bool firstTime )
|
|||
|
||||
BoardCtxt* board = cGlobals->game.board;
|
||||
board_invalAll( board );
|
||||
board_draw( board );
|
||||
board_draw( board, NULL_XWE );
|
||||
/* May not be recorded */
|
||||
XP_ASSERT( cGlobals->rowid == rowid );
|
||||
// cGlobals->rowid = rowid;
|
||||
|
@ -440,7 +440,7 @@ commonInit( CursesBoardState* cbState, sqlite3_int64 rowid,
|
|||
if ( !!gi ) {
|
||||
XP_ASSERT( !cGlobals->dict );
|
||||
cGlobals->dict = linux_dictionary_make( MPPARM(cGlobals->util->mpool)
|
||||
params, gi->dictName, XP_TRUE );
|
||||
NULL_XWE, params, gi->dictName, XP_TRUE );
|
||||
gi->dictLang = dict_getLangCode( cGlobals->dict );
|
||||
}
|
||||
|
||||
|
@ -567,7 +567,7 @@ setupBoard( CursesBoardGlobals* bGlobals )
|
|||
board_applyLayout( board, &dims );
|
||||
XP_LOGF( "%s(): calling board_draw()", __func__ );
|
||||
board_invalAll( board );
|
||||
board_draw( board );
|
||||
board_draw( board, NULL_XWE );
|
||||
}
|
||||
|
||||
static CursesBoardGlobals*
|
||||
|
@ -615,7 +615,7 @@ enableDraw( CursesBoardGlobals* bGlobals, const cb_dims* dims )
|
|||
CommonGlobals* cGlobals = &bGlobals->cGlobals;
|
||||
if( !!bGlobals->boardWin ) {
|
||||
cGlobals->draw = cursesDrawCtxtMake( bGlobals->boardWin );
|
||||
board_setDraw( cGlobals->game.board, cGlobals->draw );
|
||||
board_setDraw( cGlobals->game.board, NULL_XWE, cGlobals->draw );
|
||||
}
|
||||
|
||||
setupBoard( bGlobals );
|
||||
|
@ -774,7 +774,7 @@ ask_move( gpointer data )
|
|||
VSIZE(answers)-1, answers) ) {
|
||||
BoardCtxt* board = cGlobals->game.board;
|
||||
if ( board_commitTurn( board, XP_TRUE, XP_TRUE, NULL ) ) {
|
||||
board_draw( board );
|
||||
board_draw( board, NULL_XWE );
|
||||
linuxSaveGame( &bGlobals->cGlobals );
|
||||
}
|
||||
}
|
||||
|
@ -856,7 +856,7 @@ ask_trade( gpointer data )
|
|||
VSIZE(buttons), buttons ) ) {
|
||||
BoardCtxt* board = cGlobals->game.board;
|
||||
if ( board_commitTurn( board, XP_TRUE, XP_TRUE, NULL ) ) {
|
||||
board_draw( board );
|
||||
board_draw( board, NULL_XWE );
|
||||
linuxSaveGame( cGlobals );
|
||||
}
|
||||
}
|
||||
|
@ -936,7 +936,7 @@ curses_util_notifyGameOver( XW_UtilCtxt* uc, XP_S16 quitter )
|
|||
CursesBoardGlobals* bGlobals = (CursesBoardGlobals*)uc->closure;
|
||||
CommonGlobals* cGlobals = &bGlobals->cGlobals;
|
||||
LaunchParams* params = cGlobals->params;
|
||||
board_draw( cGlobals->game.board );
|
||||
board_draw( cGlobals->game.board, NULL_XWE );
|
||||
|
||||
/* game belongs in cGlobals... */
|
||||
if ( params->printHistory ) {
|
||||
|
@ -1161,7 +1161,7 @@ handleFlip( void* closure, int XP_UNUSED(key) )
|
|||
CursesBoardGlobals* bGlobals = (CursesBoardGlobals*)closure;
|
||||
CommonGlobals* cGlobals = &bGlobals->cGlobals;
|
||||
if ( board_flip( cGlobals->game.board ) ) {
|
||||
board_draw( cGlobals->game.board );
|
||||
board_draw( cGlobals->game.board, NULL_XWE );
|
||||
}
|
||||
|
||||
return XP_TRUE;
|
||||
|
@ -1173,7 +1173,7 @@ handleToggleValues( void* closure, int XP_UNUSED(key) )
|
|||
CursesBoardGlobals* bGlobals = (CursesBoardGlobals*)closure;
|
||||
CommonGlobals* cGlobals = &bGlobals->cGlobals;
|
||||
if ( board_toggle_showValues( cGlobals->game.board ) ) {
|
||||
board_draw( cGlobals->game.board );
|
||||
board_draw( cGlobals->game.board, NULL_XWE );
|
||||
}
|
||||
return XP_TRUE;
|
||||
} /* handleToggleValues */
|
||||
|
@ -1185,7 +1185,7 @@ handleBackspace( void* closure, int XP_UNUSED(key) )
|
|||
XP_Bool handled;
|
||||
if ( board_handleKey( cGlobals->game.board,
|
||||
XP_CURSOR_KEY_DEL, &handled ) ) {
|
||||
board_draw( cGlobals->game.board );
|
||||
board_draw( cGlobals->game.board, NULL_XWE );
|
||||
}
|
||||
return XP_TRUE;
|
||||
} /* handleBackspace */
|
||||
|
@ -1196,7 +1196,7 @@ handleUndo( void* closure, int XP_UNUSED(key) )
|
|||
CursesBoardGlobals* bGlobals = (CursesBoardGlobals*)closure;
|
||||
CommonGlobals* cGlobals = &bGlobals->cGlobals;
|
||||
if ( server_handleUndo( cGlobals->game.server, 0 ) ) {
|
||||
board_draw( cGlobals->game.board );
|
||||
board_draw( cGlobals->game.board, NULL_XWE );
|
||||
}
|
||||
return XP_TRUE;
|
||||
} /* handleUndo */
|
||||
|
@ -1206,7 +1206,7 @@ handleReplace( void* closure, int XP_UNUSED(key) )
|
|||
{
|
||||
CommonGlobals* cGlobals = &((CursesBoardGlobals*)closure)->cGlobals;
|
||||
if ( board_replaceTiles( cGlobals->game.board ) ) {
|
||||
board_draw( cGlobals->game.board );
|
||||
board_draw( cGlobals->game.board, NULL_XWE );
|
||||
}
|
||||
return XP_TRUE;
|
||||
} /* handleReplace */
|
||||
|
@ -1285,7 +1285,7 @@ handleCommit( void* closure, int XP_UNUSED(key) )
|
|||
CursesBoardGlobals* bGlobals = (CursesBoardGlobals*)closure;
|
||||
CommonGlobals* cGlobals = &bGlobals->cGlobals;
|
||||
if ( board_commitTurn( cGlobals->game.board, XP_FALSE, XP_FALSE, NULL ) ) {
|
||||
board_draw( cGlobals->game.board );
|
||||
board_draw( cGlobals->game.board, NULL_XWE );
|
||||
}
|
||||
return XP_TRUE;
|
||||
} /* handleCommit */
|
||||
|
@ -1295,7 +1295,7 @@ handleJuggle( void* closure, int XP_UNUSED(key) )
|
|||
{
|
||||
CommonGlobals* cGlobals = &((CursesBoardGlobals*)closure)->cGlobals;
|
||||
if ( board_juggleTray( cGlobals->game.board ) ) {
|
||||
board_draw( cGlobals->game.board );
|
||||
board_draw( cGlobals->game.board, NULL_XWE );
|
||||
}
|
||||
return XP_TRUE;
|
||||
} /* handleJuggle */
|
||||
|
@ -1311,7 +1311,7 @@ handleHide( void* closure, int XP_UNUSED(key) )
|
|||
? board_hideTray( cGlobals->game.board )
|
||||
: board_showTray( cGlobals->game.board );
|
||||
if ( draw ) {
|
||||
board_draw( cGlobals->game.board );
|
||||
board_draw( cGlobals->game.board, NULL_XWE );
|
||||
}
|
||||
|
||||
return XP_TRUE;
|
||||
|
@ -1344,7 +1344,7 @@ handleFocusKey( CursesBoardGlobals* bGlobals, XP_Key key )
|
|||
}
|
||||
|
||||
if ( draw ) {
|
||||
board_draw( cGlobals->game.board );
|
||||
board_draw( cGlobals->game.board, NULL_XWE );
|
||||
}
|
||||
return XP_TRUE;
|
||||
} /* handleFocusKey */
|
||||
|
@ -1385,13 +1385,13 @@ handleHint( void* closure, int XP_UNUSED(key) )
|
|||
CursesBoardGlobals* bGlobals = (CursesBoardGlobals*)closure;
|
||||
CommonGlobals* cGlobals = &bGlobals->cGlobals;
|
||||
XP_Bool redo;
|
||||
XP_Bool draw = board_requestHint( cGlobals->game.board,
|
||||
XP_Bool draw = board_requestHint( cGlobals->game.board, NULL_XWE,
|
||||
#ifdef XWFEATURE_SEARCHLIMIT
|
||||
XP_FALSE,
|
||||
#endif
|
||||
XP_FALSE, &redo );
|
||||
if ( draw ) {
|
||||
board_draw( cGlobals->game.board );
|
||||
board_draw( cGlobals->game.board, NULL_XWE );
|
||||
}
|
||||
return XP_TRUE;
|
||||
}
|
||||
|
@ -1449,7 +1449,7 @@ handleSpace( void* closure, int XP_UNUSED(key) )
|
|||
checkAssignFocus( board );
|
||||
XP_Bool handled;
|
||||
(void)board_handleKey( board, XP_RAISEFOCUS_KEY, &handled );
|
||||
board_draw( board );
|
||||
board_draw( board, NULL_XWE );
|
||||
return XP_TRUE;
|
||||
} /* handleSpace */
|
||||
|
||||
|
@ -1461,7 +1461,7 @@ handleRet( void* closure, int key )
|
|||
XP_Bool handled;
|
||||
XP_Key xpKey = (key & ALT_BIT) == 0 ? XP_RETURN_KEY : XP_ALTRETURN_KEY;
|
||||
if ( board_handleKey( board, xpKey, &handled ) ) {
|
||||
board_draw( board );
|
||||
board_draw( board, NULL_XWE );
|
||||
}
|
||||
return XP_TRUE;
|
||||
} /* handleRet */
|
||||
|
|
|
@ -38,7 +38,7 @@ typedef struct CursesDrawCtx {
|
|||
WINDOW* boardWin;
|
||||
} CursesDrawCtx;
|
||||
|
||||
static void curses_draw_clearRect( DrawCtx* p_dctx, const XP_Rect* rectP );
|
||||
static void curses_draw_clearRect( DrawCtx* p_dctx, XWEnv xwe, const XP_Rect* rectP );
|
||||
static void getTops( const XP_Rect* rect, int* toptop, int* topbot );
|
||||
|
||||
static void
|
||||
|
@ -68,31 +68,31 @@ cursesHiliteRect( WINDOW* window, const XP_Rect* rect )
|
|||
}
|
||||
|
||||
static void
|
||||
curses_draw_destroyCtxt( DrawCtx* XP_UNUSED(p_dctx) )
|
||||
curses_draw_destroyCtxt( DrawCtx* XP_UNUSED(p_dctx), XWEnv XP_UNUSED(xwe) )
|
||||
{
|
||||
// CursesDrawCtx* dctx = (CursesDrawCtx*)p_dctx;
|
||||
} /* draw_setup */
|
||||
|
||||
static void
|
||||
curses_draw_dictChanged( DrawCtx* XP_UNUSED(p_dctx),
|
||||
curses_draw_dictChanged( DrawCtx* XP_UNUSED(p_dctx), XWEnv XP_UNUSED(xwe),
|
||||
XP_S16 XP_UNUSED(playerNum),
|
||||
const DictionaryCtxt* XP_UNUSED(dict) )
|
||||
{
|
||||
}
|
||||
|
||||
static XP_Bool
|
||||
curses_draw_beginDraw( DrawCtx* XP_UNUSED(p_dctx) )
|
||||
curses_draw_beginDraw( DrawCtx* XP_UNUSED(p_dctx), XWEnv XP_UNUSED(xwe) )
|
||||
{
|
||||
return XP_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
curses_draw_endDraw( DrawCtx* XP_UNUSED(dctx) )
|
||||
curses_draw_endDraw( DrawCtx* XP_UNUSED(dctx), XWEnv XP_UNUSED(xwe) )
|
||||
{
|
||||
}
|
||||
|
||||
static XP_Bool
|
||||
curses_draw_boardBegin( DrawCtx* XP_UNUSED(p_dctx),
|
||||
curses_draw_boardBegin( DrawCtx* XP_UNUSED(p_dctx), XWEnv XP_UNUSED(xwe),
|
||||
const XP_Rect* XP_UNUSED(rect),
|
||||
XP_U16 XP_UNUSED(width), XP_U16 XP_UNUSED(height),
|
||||
DrawFocusState XP_UNUSED(dfs) )
|
||||
|
@ -101,7 +101,7 @@ curses_draw_boardBegin( DrawCtx* XP_UNUSED(p_dctx),
|
|||
} /* curses_draw_boardBegin */
|
||||
|
||||
static XP_Bool
|
||||
curses_draw_trayBegin( DrawCtx* XP_UNUSED(p_dctx),
|
||||
curses_draw_trayBegin( DrawCtx* XP_UNUSED(p_dctx), XWEnv XP_UNUSED(xwe),
|
||||
const XP_Rect* XP_UNUSED(rect),
|
||||
XP_U16 XP_UNUSED(owner),
|
||||
XP_S16 XP_UNUSED(score),
|
||||
|
@ -111,7 +111,7 @@ curses_draw_trayBegin( DrawCtx* XP_UNUSED(p_dctx),
|
|||
} /* curses_draw_trayBegin */
|
||||
|
||||
static XP_Bool
|
||||
curses_draw_scoreBegin( DrawCtx* p_dctx, const XP_Rect* rect,
|
||||
curses_draw_scoreBegin( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), const XP_Rect* rect,
|
||||
XP_U16 XP_UNUSED(numPlayers),
|
||||
const XP_S16* const XP_UNUSED(scores),
|
||||
XP_S16 XP_UNUSED(remCount),
|
||||
|
@ -124,7 +124,7 @@ curses_draw_scoreBegin( DrawCtx* p_dctx, const XP_Rect* rect,
|
|||
|
||||
#ifdef XWFEATURE_SCOREONEPASS
|
||||
static XP_Bool
|
||||
curses_draw_drawRemText( DrawCtx* p_dctx, XP_S16 nTilesLeft,
|
||||
curses_draw_drawRemText( DrawCtx* p_dctx, XWEnv xwe, XP_S16 nTilesLeft,
|
||||
XP_Bool focussed, XP_Rect* rect )
|
||||
{
|
||||
XP_USE(p_dctx);
|
||||
|
@ -156,7 +156,7 @@ formatRemText( XP_S16 nTilesLeft, const XP_Rect* rect, char* buf, char** lines )
|
|||
} /* formatRemText */
|
||||
|
||||
static XP_Bool
|
||||
curses_draw_measureRemText( DrawCtx* XP_UNUSED(dctx),
|
||||
curses_draw_measureRemText( DrawCtx* XP_UNUSED(dctx), XWEnv XP_UNUSED(xwe),
|
||||
const XP_Rect* rect,
|
||||
XP_S16 nTilesLeft,
|
||||
XP_U16* width, XP_U16* height )
|
||||
|
@ -179,7 +179,7 @@ curses_draw_measureRemText( DrawCtx* XP_UNUSED(dctx),
|
|||
} /* curses_draw_measureRemText */
|
||||
|
||||
static void
|
||||
curses_draw_drawRemText( DrawCtx* p_dctx, const XP_Rect* rInner,
|
||||
curses_draw_drawRemText( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), const XP_Rect* rInner,
|
||||
const XP_Rect* rOuter, XP_S16 nTilesLeft,
|
||||
XP_Bool focussed )
|
||||
{
|
||||
|
@ -284,7 +284,7 @@ formatScoreText( XP_UCHAR* out, const DrawScoreInfo* dsi, const XP_Rect* rect,
|
|||
} /* formatScoreText */
|
||||
|
||||
static void
|
||||
curses_draw_measureScoreText( DrawCtx* XP_UNUSED(p_dctx),
|
||||
curses_draw_measureScoreText( DrawCtx* XP_UNUSED(p_dctx), XWEnv XP_UNUSED(xwe),
|
||||
const XP_Rect* rect,
|
||||
const DrawScoreInfo* dsi,
|
||||
XP_U16* width, XP_U16* height )
|
||||
|
@ -305,14 +305,14 @@ curses_draw_measureScoreText( DrawCtx* XP_UNUSED(p_dctx),
|
|||
} /* curses_draw_measureScoreText */
|
||||
|
||||
static void
|
||||
curses_draw_score_drawPlayer( DrawCtx* p_dctx, const XP_Rect* rInner,
|
||||
const XP_Rect* rOuter,
|
||||
curses_draw_score_drawPlayer( DrawCtx* p_dctx, XWEnv xwe,
|
||||
const XP_Rect* rInner, const XP_Rect* rOuter,
|
||||
XP_U16 XP_UNUSED(gotPct), const DrawScoreInfo* dsi )
|
||||
{
|
||||
CursesDrawCtx* dctx = (CursesDrawCtx*)p_dctx;
|
||||
char buf[100];
|
||||
|
||||
curses_draw_clearRect( p_dctx, rOuter );
|
||||
curses_draw_clearRect( p_dctx, xwe, rOuter );
|
||||
|
||||
/* print the name and turn/remoteness indicator */
|
||||
char* lines[3] = {0};
|
||||
|
@ -331,7 +331,7 @@ curses_draw_score_drawPlayer( DrawCtx* p_dctx, const XP_Rect* rInner,
|
|||
#endif
|
||||
|
||||
static void
|
||||
curses_draw_score_pendingScore( DrawCtx* p_dctx, const XP_Rect* rect,
|
||||
curses_draw_score_pendingScore( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), const XP_Rect* rect,
|
||||
XP_S16 score, XP_U16 XP_UNUSED(playerNum),
|
||||
XP_Bool XP_UNUSED(curTurn),
|
||||
CellFlags XP_UNUSED(flags) )
|
||||
|
@ -353,7 +353,7 @@ curses_draw_score_pendingScore( DrawCtx* p_dctx, const XP_Rect* rect,
|
|||
} /* curses_draw_score_pendingScore */
|
||||
|
||||
static void
|
||||
curses_draw_drawTimer( DrawCtx* p_dctx, const XP_Rect* rInner,
|
||||
curses_draw_drawTimer( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), const XP_Rect* rInner,
|
||||
XP_U16 XP_UNUSED(playerNum), XP_S16 secondsLeft,
|
||||
XP_Bool XP_UNUSED(localTurnDone) )
|
||||
{
|
||||
|
@ -367,7 +367,8 @@ curses_draw_drawTimer( DrawCtx* p_dctx, const XP_Rect* rInner,
|
|||
}
|
||||
|
||||
static void
|
||||
curses_draw_objFinished( DrawCtx* p_dctx, BoardObjectType XP_UNUSED(typ),
|
||||
curses_draw_objFinished( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe),
|
||||
BoardObjectType XP_UNUSED(typ),
|
||||
const XP_Rect* XP_UNUSED(rect),
|
||||
DrawFocusState XP_UNUSED(dfs) )
|
||||
{
|
||||
|
@ -377,8 +378,9 @@ curses_draw_objFinished( DrawCtx* p_dctx, BoardObjectType XP_UNUSED(typ),
|
|||
|
||||
|
||||
static XP_Bool
|
||||
curses_draw_vertScrollBoard( DrawCtx* XP_UNUSED(dctx), XP_Rect* XP_UNUSED(rect),
|
||||
XP_S16 XP_UNUSED(dist), DrawFocusState XP_UNUSED(dfs) )
|
||||
curses_draw_vertScrollBoard( DrawCtx* XP_UNUSED(dctx), XWEnv XP_UNUSED(xwe),
|
||||
XP_Rect* XP_UNUSED(rect), XP_S16 XP_UNUSED(dist),
|
||||
DrawFocusState XP_UNUSED(dfs) )
|
||||
{
|
||||
XP_ASSERT(0);
|
||||
return XP_TRUE;
|
||||
|
@ -387,7 +389,7 @@ curses_draw_vertScrollBoard( DrawCtx* XP_UNUSED(dctx), XP_Rect* XP_UNUSED(rect),
|
|||
#define MY_PAIR 1
|
||||
|
||||
static XP_Bool
|
||||
curses_draw_drawCell( DrawCtx* p_dctx, const XP_Rect* rect,
|
||||
curses_draw_drawCell( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), const XP_Rect* rect,
|
||||
const XP_UCHAR* letter,
|
||||
const XP_Bitmaps* XP_UNUSED(bitmaps),
|
||||
Tile XP_UNUSED(tile), XP_U16 XP_UNUSED(value),
|
||||
|
@ -445,7 +447,8 @@ curses_draw_drawCell( DrawCtx* p_dctx, const XP_Rect* rect,
|
|||
} /* curses_draw_drawCell */
|
||||
|
||||
static void
|
||||
curses_draw_invertCell( DrawCtx* XP_UNUSED(dctx), const XP_Rect* XP_UNUSED(rect) )
|
||||
curses_draw_invertCell( DrawCtx* XP_UNUSED(dctx), XWEnv XP_UNUSED(xwe),
|
||||
const XP_Rect* XP_UNUSED(rect) )
|
||||
{
|
||||
XP_ASSERT(0);
|
||||
}
|
||||
|
@ -488,7 +491,7 @@ curses_stringInTile( CursesDrawCtx* dctx, const XP_Rect* rect,
|
|||
} /* curses_stringInTile */
|
||||
|
||||
static XP_Bool
|
||||
curses_draw_drawTile( DrawCtx* p_dctx, const XP_Rect* rect,
|
||||
curses_draw_drawTile( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), const XP_Rect* rect,
|
||||
const XP_UCHAR* textP, const XP_Bitmaps* XP_UNUSED(bitmaps),
|
||||
XP_U16 val, CellFlags flags )
|
||||
{
|
||||
|
@ -533,8 +536,8 @@ curses_draw_drawTile( DrawCtx* p_dctx, const XP_Rect* rect,
|
|||
} /* curses_draw_drawTile */
|
||||
|
||||
static XP_Bool
|
||||
curses_draw_drawTileBack( DrawCtx* p_dctx, const XP_Rect* rect,
|
||||
CellFlags flags )
|
||||
curses_draw_drawTileBack( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe),
|
||||
const XP_Rect* rect, CellFlags flags )
|
||||
{
|
||||
CursesDrawCtx* dctx = (CursesDrawCtx*)p_dctx;
|
||||
curses_stringInTile( dctx, rect, "?", "?" );
|
||||
|
@ -545,7 +548,7 @@ curses_draw_drawTileBack( DrawCtx* p_dctx, const XP_Rect* rect,
|
|||
} /* curses_draw_drawTileBack */
|
||||
|
||||
static XP_Bool
|
||||
curses_draw_drawTileMidDrag( DrawCtx* XP_UNUSED(dctx),
|
||||
curses_draw_drawTileMidDrag( DrawCtx* XP_UNUSED(dctx), XWEnv XP_UNUSED(xwe),
|
||||
const XP_Rect* XP_UNUSED(rect),
|
||||
const XP_UCHAR* XP_UNUSED(text),
|
||||
const XP_Bitmaps* XP_UNUSED(bitmaps),
|
||||
|
@ -557,8 +560,8 @@ curses_draw_drawTileMidDrag( DrawCtx* XP_UNUSED(dctx),
|
|||
}
|
||||
|
||||
static void
|
||||
curses_draw_drawTrayDivider( DrawCtx* p_dctx, const XP_Rect* rect,
|
||||
CellFlags flags )
|
||||
curses_draw_drawTrayDivider( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe),
|
||||
const XP_Rect* rect, CellFlags flags )
|
||||
{
|
||||
CursesDrawCtx* dctx = (CursesDrawCtx*)p_dctx;
|
||||
eraseRect( dctx, rect );
|
||||
|
@ -571,7 +574,8 @@ curses_draw_drawTrayDivider( DrawCtx* p_dctx, const XP_Rect* rect,
|
|||
} /* curses_draw_drawTrayDivider */
|
||||
|
||||
static void
|
||||
curses_draw_drawBoardArrow( DrawCtx* p_dctx, const XP_Rect* rect,
|
||||
curses_draw_drawBoardArrow( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe),
|
||||
const XP_Rect* rect,
|
||||
XWBonusType XP_UNUSED(cursorBonus),
|
||||
XP_Bool vertical, HintAtts XP_UNUSED(hintAtts),
|
||||
CellFlags XP_UNUSED(flags) )
|
||||
|
@ -589,7 +593,7 @@ curses_draw_drawBoardArrow( DrawCtx* p_dctx, const XP_Rect* rect,
|
|||
} /* curses_draw_drawBoardArrow */
|
||||
|
||||
static void
|
||||
curses_draw_clearRect( DrawCtx* p_dctx, const XP_Rect* rectP )
|
||||
curses_draw_clearRect( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), const XP_Rect* rectP )
|
||||
{
|
||||
CursesDrawCtx* dctx = (CursesDrawCtx*)p_dctx;
|
||||
XP_Rect rect = *rectP;
|
||||
|
@ -599,15 +603,15 @@ curses_draw_clearRect( DrawCtx* p_dctx, const XP_Rect* rectP )
|
|||
|
||||
#ifdef XWFEATURE_MINIWIN
|
||||
static const XP_UCHAR*
|
||||
curses_draw_getMiniWText( DrawCtx* XP_UNUSED(p_dctx),
|
||||
curses_draw_getMiniWText( DrawCtx* XP_UNUSED(p_dctx), XWEnv XP_UNUSED(xwe),
|
||||
XWMiniTextType XP_UNUSED(textHint) )
|
||||
{
|
||||
return "Trading...";
|
||||
} /* curses_draw_getMiniWText */
|
||||
|
||||
static void
|
||||
curses_draw_measureMiniWText( DrawCtx* XP_UNUSED(p_dctx), const XP_UCHAR* str,
|
||||
XP_U16* widthP, XP_U16* heightP )
|
||||
curses_draw_measureMiniWText( DrawCtx* XP_UNUSED(p_dctx), XWEnv XP_UNUSED(xwe),
|
||||
const XP_UCHAR* str, XP_U16* widthP, XP_U16* heightP )
|
||||
{
|
||||
*widthP = strlen(str) + 4;
|
||||
*heightP = 3;
|
||||
|
@ -628,8 +632,9 @@ drawRect( WINDOW* win, const XP_Rect* rect, char vert, char hor )
|
|||
} /* drawRect */
|
||||
|
||||
static void
|
||||
curses_draw_drawMiniWindow( DrawCtx* p_dctx, const XP_UCHAR* text,
|
||||
const XP_Rect* rect, void** XP_UNUSED(closure) )
|
||||
curses_draw_drawMiniWindow( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe),
|
||||
const XP_UCHAR* text, const XP_Rect* rect,
|
||||
void** XP_UNUSED(closure) )
|
||||
{
|
||||
CursesDrawCtx* dctx = (CursesDrawCtx*)p_dctx;
|
||||
XP_Rect smallerR;
|
||||
|
@ -651,7 +656,7 @@ curses_draw_drawMiniWindow( DrawCtx* p_dctx, const XP_UCHAR* text,
|
|||
|
||||
#if 0
|
||||
static void
|
||||
curses_draw_frameTray( DrawCtx* p_dctx, XP_Rect* rect )
|
||||
curses_draw_frameTray( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), XP_Rect* rect )
|
||||
{
|
||||
CursesDrawCtx* dctx = (CursesDrawCtx*)p_dctx;
|
||||
box( dctx->boardWin, '*', '+');
|
||||
|
|
|
@ -290,7 +290,7 @@ addSnapshot( CommonGlobals* cGlobals )
|
|||
GtkDrawCtx* dctx = (GtkDrawCtx*)board_getDraw( board );
|
||||
if ( !!dctx ) {
|
||||
addSurface( dctx, SNAP_WIDTH, SNAP_HEIGHT );
|
||||
board_drawSnapshot( board, (DrawCtx*)dctx, SNAP_WIDTH, SNAP_HEIGHT );
|
||||
board_drawSnapshot( board, NULL_XWE, (DrawCtx*)dctx, SNAP_WIDTH, SNAP_HEIGHT );
|
||||
|
||||
XWStreamCtxt* stream = mem_stream_make_raw( MPPARM(cGlobals->util->mpool)
|
||||
cGlobals->params->vtMgr );
|
||||
|
|
|
@ -145,7 +145,7 @@ button_press_event( GtkWidget* XP_UNUSED(widget), GdkEventButton *event,
|
|||
redraw = board_handlePenDown( globals->cGlobals.game.board,
|
||||
event->x, event->y, &handled );
|
||||
if ( redraw ) {
|
||||
board_draw( globals->cGlobals.game.board );
|
||||
board_draw( globals->cGlobals.game.board, NULL_XWE );
|
||||
disenable_buttons( globals );
|
||||
}
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ motion_notify_event( GtkWidget* XP_UNUSED(widget), GdkEventMotion *event,
|
|||
handled = board_handlePenMove( globals->cGlobals.game.board, event->x,
|
||||
event->y );
|
||||
if ( handled ) {
|
||||
board_draw( globals->cGlobals.game.board );
|
||||
board_draw( globals->cGlobals.game.board, NULL_XWE );
|
||||
disenable_buttons( globals );
|
||||
}
|
||||
} else {
|
||||
|
@ -187,7 +187,7 @@ button_release_event( GtkWidget* XP_UNUSED(widget), GdkEventMotion *event,
|
|||
event->x,
|
||||
event->y );
|
||||
if ( redraw ) {
|
||||
board_draw( globals->cGlobals.game.board );
|
||||
board_draw( globals->cGlobals.game.board, NULL_XWE );
|
||||
disenable_buttons( globals );
|
||||
}
|
||||
globals->mouseDown = XP_FALSE;
|
||||
|
@ -267,7 +267,7 @@ key_press_event( GtkWidget* XP_UNUSED(widget), GdkEventKey* event,
|
|||
: board_handleKeyDown( globals->cGlobals.game.board, xpkey,
|
||||
&handled );
|
||||
if ( draw ) {
|
||||
board_draw( globals->cGlobals.game.board );
|
||||
board_draw( globals->cGlobals.game.board, NULL_XWE );
|
||||
}
|
||||
}
|
||||
globals->keyDown = XP_TRUE;
|
||||
|
@ -297,7 +297,7 @@ key_release_event( GtkWidget* XP_UNUSED(widget), GdkEventKey* event,
|
|||
}
|
||||
#endif
|
||||
if ( draw ) {
|
||||
board_draw( globals->cGlobals.game.board );
|
||||
board_draw( globals->cGlobals.game.board, NULL_XWE );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -847,7 +847,7 @@ new_game_impl( GtkGameGlobals* globals, XP_Bool fireConnDlg )
|
|||
#endif
|
||||
(void)server_do( cGlobals->game.server ); /* assign tiles, etc. */
|
||||
board_invalAll( cGlobals->game.board );
|
||||
board_draw( cGlobals->game.board );
|
||||
board_draw( cGlobals->game.board, NULL_XWE );
|
||||
}
|
||||
return success;
|
||||
} /* new_game_impl */
|
||||
|
@ -869,7 +869,7 @@ game_info( GtkWidget* XP_UNUSED(widget), GtkGameGlobals* globals )
|
|||
CurGameInfo* gi = globals->cGlobals.gi;
|
||||
if ( gtkNewGameDialog( globals, gi, &addr, XP_FALSE, XP_FALSE ) ) {
|
||||
if ( server_do( globals->cGlobals.game.server ) ) {
|
||||
board_draw( globals->cGlobals.game.board );
|
||||
board_draw( globals->cGlobals.game.board, NULL_XWE );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -897,8 +897,8 @@ change_dictionary( GtkWidget* XP_UNUSED(widget), GtkGameGlobals* globals )
|
|||
gchar* name = gtkaskdict( dicts, buf, VSIZE(buf) );
|
||||
if ( !!name ) {
|
||||
DictionaryCtxt* dict =
|
||||
linux_dictionary_make( MPPARM(cGlobals->util->mpool) params, name,
|
||||
params->useMmap );
|
||||
linux_dictionary_make( MPPARM(cGlobals->util->mpool) NULL_XWE,
|
||||
params, name, params->useMmap );
|
||||
game_changeDict( MPPARM(cGlobals->util->mpool) &cGlobals->game, NULL_XWE,
|
||||
cGlobals->gi, dict );
|
||||
}
|
||||
|
@ -942,7 +942,7 @@ handle_trade_cancel( GtkWidget* XP_UNUSED(widget), GtkGameGlobals* globals )
|
|||
{
|
||||
BoardCtxt* board = globals->cGlobals.game.board;
|
||||
if ( board_endTrade( board ) ) {
|
||||
board_draw( board );
|
||||
board_draw( board, NULL_XWE );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1007,7 +1007,7 @@ inval_board_ontimer( gpointer data )
|
|||
{
|
||||
GtkGameGlobals* globals = (GtkGameGlobals*)data;
|
||||
BoardCtxt* board = globals->cGlobals.game.board;
|
||||
board_draw( board );
|
||||
board_draw( board, NULL_XWE );
|
||||
return XP_FALSE;
|
||||
} /* inval_board_ontimer */
|
||||
|
||||
|
@ -1164,7 +1164,7 @@ handle_flip_button( GtkWidget* XP_UNUSED(widget), gpointer _globals )
|
|||
{
|
||||
GtkGameGlobals* globals = (GtkGameGlobals*)_globals;
|
||||
if ( board_flip( globals->cGlobals.game.board ) ) {
|
||||
board_draw( globals->cGlobals.game.board );
|
||||
board_draw( globals->cGlobals.game.board, NULL_XWE );
|
||||
}
|
||||
return TRUE;
|
||||
} /* handle_flip_button */
|
||||
|
@ -1174,7 +1174,7 @@ handle_value_button( GtkWidget* XP_UNUSED(widget), gpointer closure )
|
|||
{
|
||||
GtkGameGlobals* globals = (GtkGameGlobals*)closure;
|
||||
if ( board_toggle_showValues( globals->cGlobals.game.board ) ) {
|
||||
board_draw( globals->cGlobals.game.board );
|
||||
board_draw( globals->cGlobals.game.board, NULL_XWE );
|
||||
}
|
||||
return TRUE;
|
||||
} /* handle_value_button */
|
||||
|
@ -1183,12 +1183,12 @@ static void
|
|||
handle_hint_button( GtkGameGlobals* globals, XP_Bool prev )
|
||||
{
|
||||
XP_Bool redo;
|
||||
if ( board_requestHint( globals->cGlobals.game.board,
|
||||
if ( board_requestHint( globals->cGlobals.game.board, NULL_XWE,
|
||||
#ifdef XWFEATURE_SEARCHLIMIT
|
||||
XP_FALSE,
|
||||
#endif
|
||||
prev, &redo ) ) {
|
||||
board_draw( globals->cGlobals.game.board );
|
||||
board_draw( globals->cGlobals.game.board, NULL_XWE );
|
||||
disenable_buttons( globals );
|
||||
}
|
||||
} /* handle_hint_button */
|
||||
|
@ -1211,12 +1211,12 @@ handle_nhint_button( GtkWidget* XP_UNUSED(widget), GtkGameGlobals* globals )
|
|||
XP_Bool redo;
|
||||
|
||||
board_resetEngine( globals->cGlobals.game.board );
|
||||
if ( board_requestHint( globals->cGlobals.game.board,
|
||||
if ( board_requestHint( globals->cGlobals.game.board, NULL_XWE,
|
||||
#ifdef XWFEATURE_SEARCHLIMIT
|
||||
XP_TRUE,
|
||||
#endif
|
||||
XP_FALSE, &redo ) ) {
|
||||
board_draw( globals->cGlobals.game.board );
|
||||
board_draw( globals->cGlobals.game.board, NULL_XWE );
|
||||
}
|
||||
} /* handle_nhint_button */
|
||||
|
||||
|
@ -1234,7 +1234,7 @@ static void
|
|||
handle_juggle_button( GtkWidget* XP_UNUSED(widget), GtkGameGlobals* globals )
|
||||
{
|
||||
if ( board_juggleTray( globals->cGlobals.game.board ) ) {
|
||||
board_draw( globals->cGlobals.game.board );
|
||||
board_draw( globals->cGlobals.game.board, NULL_XWE );
|
||||
}
|
||||
} /* handle_juggle_button */
|
||||
|
||||
|
@ -1242,7 +1242,7 @@ static void
|
|||
handle_undo_button( GtkWidget* XP_UNUSED(widget), GtkGameGlobals* globals )
|
||||
{
|
||||
if ( server_handleUndo( globals->cGlobals.game.server, 0 ) ) {
|
||||
board_draw( globals->cGlobals.game.board );
|
||||
board_draw( globals->cGlobals.game.board, NULL_XWE );
|
||||
}
|
||||
} /* handle_undo_button */
|
||||
|
||||
|
@ -1258,7 +1258,7 @@ handle_toggle_undo( GtkWidget* XP_UNUSED(widget),
|
|||
{
|
||||
BoardCtxt* board = globals->cGlobals.game.board;
|
||||
if ( board_redoReplacedTiles( board ) || board_replaceTiles( board ) ) {
|
||||
board_draw( board );
|
||||
board_draw( board, NULL_XWE );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1266,7 +1266,7 @@ static void
|
|||
handle_trade_button( GtkWidget* XP_UNUSED(widget), GtkGameGlobals* globals )
|
||||
{
|
||||
if ( board_beginTrade( globals->cGlobals.game.board ) ) {
|
||||
board_draw( globals->cGlobals.game.board );
|
||||
board_draw( globals->cGlobals.game.board, NULL_XWE );
|
||||
disenable_buttons( globals );
|
||||
}
|
||||
} /* handle_juggle_button */
|
||||
|
@ -1276,7 +1276,7 @@ handle_done_button( GtkWidget* XP_UNUSED(widget), GtkGameGlobals* globals )
|
|||
{
|
||||
if ( board_commitTurn( globals->cGlobals.game.board, XP_FALSE,
|
||||
XP_FALSE, NULL ) ) {
|
||||
board_draw( globals->cGlobals.game.board );
|
||||
board_draw( globals->cGlobals.game.board, NULL_XWE );
|
||||
disenable_buttons( globals );
|
||||
}
|
||||
} /* handle_done_button */
|
||||
|
@ -1293,7 +1293,7 @@ handle_zoomin_button( GtkWidget* XP_UNUSED(widget), GtkGameGlobals* globals )
|
|||
{
|
||||
XP_Bool inOut[2];
|
||||
if ( board_zoom( globals->cGlobals.game.board, 1, inOut ) ) {
|
||||
board_draw( globals->cGlobals.game.board );
|
||||
board_draw( globals->cGlobals.game.board, NULL_XWE );
|
||||
setZoomButtons( globals, inOut );
|
||||
}
|
||||
} /* handle_zoomin_button */
|
||||
|
@ -1303,7 +1303,7 @@ handle_zoomout_button( GtkWidget* XP_UNUSED(widget), GtkGameGlobals* globals )
|
|||
{
|
||||
XP_Bool inOut[2];
|
||||
if ( board_zoom( globals->cGlobals.game.board, -1, inOut ) ) {
|
||||
board_draw( globals->cGlobals.game.board );
|
||||
board_draw( globals->cGlobals.game.board, NULL_XWE );
|
||||
setZoomButtons( globals, inOut );
|
||||
}
|
||||
} /* handle_zoomout_button */
|
||||
|
@ -1345,7 +1345,7 @@ scroll_value_changed( GtkAdjustment *adj, GtkGameGlobals* globals )
|
|||
newValue = (XP_U16)newValueF;
|
||||
|
||||
if ( board_setYOffset( globals->cGlobals.game.board, newValue ) ) {
|
||||
board_draw( globals->cGlobals.game.board );
|
||||
board_draw( globals->cGlobals.game.board, NULL_XWE );
|
||||
}
|
||||
} /* scroll_value_changed */
|
||||
|
||||
|
@ -1355,7 +1355,7 @@ handle_grid_button( GtkWidget* XP_UNUSED(widget), GtkGameGlobals* globals )
|
|||
globals->gridOn = !globals->gridOn;
|
||||
|
||||
board_invalAll( globals->cGlobals.game.board );
|
||||
board_draw( globals->cGlobals.game.board );
|
||||
board_draw( globals->cGlobals.game.board, NULL_XWE );
|
||||
} /* handle_grid_button */
|
||||
|
||||
static void
|
||||
|
@ -1380,7 +1380,7 @@ handle_hide_button( GtkWidget* XP_UNUSED(widget), GtkGameGlobals* globals )
|
|||
draw = board_showTray( board );
|
||||
}
|
||||
if ( draw ) {
|
||||
board_draw( board );
|
||||
board_draw( board, NULL_XWE );
|
||||
}
|
||||
} /* handle_hide_button */
|
||||
|
||||
|
@ -1389,7 +1389,7 @@ handle_commit_button( GtkWidget* XP_UNUSED(widget), GtkGameGlobals* globals )
|
|||
{
|
||||
if ( board_commitTurn( globals->cGlobals.game.board, XP_FALSE,
|
||||
XP_FALSE, NULL ) ) {
|
||||
board_draw( globals->cGlobals.game.board );
|
||||
board_draw( globals->cGlobals.game.board, NULL_XWE );
|
||||
}
|
||||
} /* handle_commit_button */
|
||||
|
||||
|
@ -1528,7 +1528,7 @@ ask_blank( gpointer data )
|
|||
&& board_setBlankValue( cGlobals->game.board, cGlobals->selPlayer,
|
||||
cGlobals->blankCol, cGlobals->blankRow,
|
||||
result ) ) {
|
||||
board_draw( cGlobals->game.board );
|
||||
board_draw( cGlobals->game.board, NULL_XWE );
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -1596,7 +1596,7 @@ ask_tiles( gpointer data )
|
|||
}
|
||||
|
||||
if ( draw ) {
|
||||
board_draw( board );
|
||||
board_draw( board, NULL_XWE );
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -1633,7 +1633,7 @@ ask_password( gpointer data )
|
|||
if ( gtkpasswdask( cGlobals->askPassName, buf, &len ) ) {
|
||||
BoardCtxt* board = cGlobals->game.board;
|
||||
if ( board_passwordProvided( board, cGlobals->selPlayer, buf ) ) {
|
||||
board_draw( board );
|
||||
board_draw( board, NULL_XWE );
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -1781,7 +1781,7 @@ gtk_util_notifyGameOver( XW_UtilCtxt* uc, XP_S16 quitter )
|
|||
destroy_board_window( NULL, globals );
|
||||
} else if ( cGlobals->params->undoWhenDone ) {
|
||||
server_handleUndo( cGlobals->game.server, 0 );
|
||||
board_draw( cGlobals->game.board );
|
||||
board_draw( cGlobals->game.board, NULL_XWE );
|
||||
} else if ( !cGlobals->params->skipGameOver ) {
|
||||
gtkShowFinalScores( globals, XP_TRUE );
|
||||
}
|
||||
|
@ -1820,7 +1820,7 @@ gtk_util_hiliteCell( XW_UtilCtxt* uc, XP_U16 col, XP_U16 row )
|
|||
gboolean pending;
|
||||
#endif
|
||||
|
||||
board_hiliteCellAt( globals->cGlobals.game.board, col, row );
|
||||
board_hiliteCellAt( globals->cGlobals.game.board, NULL_XWE, col, row );
|
||||
if ( globals->cGlobals.params->sleepOnAnchor ) {
|
||||
usleep( 10000 );
|
||||
}
|
||||
|
@ -2049,7 +2049,7 @@ ask_move( gpointer data )
|
|||
if ( GTK_RESPONSE_OK == chosen || chosen == GTK_RESPONSE_YES ) {
|
||||
BoardCtxt* board = cGlobals->game.board;
|
||||
if ( board_commitTurn( board, XP_TRUE, XP_TRUE, NULL ) ) {
|
||||
board_draw( board );
|
||||
board_draw( board, NULL_XWE );
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -2080,7 +2080,7 @@ ask_trade( gpointer data )
|
|||
GTK_BUTTONS_YES_NO, NULL ) ) {
|
||||
BoardCtxt* board = cGlobals->game.board;
|
||||
if ( board_commitTurn( board, XP_TRUE, XP_TRUE, NULL ) ) {
|
||||
board_draw( board );
|
||||
board_draw( board, NULL_XWE );
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -2420,7 +2420,7 @@ on_draw_event( GtkWidget* widget, cairo_t* cr, gpointer user_data )
|
|||
GtkGameGlobals* globals = (GtkGameGlobals*)user_data;
|
||||
CommonGlobals* cGlobals = &globals->cGlobals;
|
||||
board_invalAll( cGlobals->game.board );
|
||||
board_draw( cGlobals->game.board );
|
||||
board_draw( cGlobals->game.board, NULL_XWE );
|
||||
draw_gtk_status( (GtkDrawCtx*)cGlobals->draw, globals->stateChar );
|
||||
|
||||
XP_USE(widget);
|
||||
|
@ -2443,7 +2443,7 @@ initBoardGlobalsGtk( GtkGameGlobals* globals, LaunchParams* params,
|
|||
initGlobalsNoDraw( globals, params, gi );
|
||||
if ( !!gi ) {
|
||||
XP_ASSERT( !cGlobals->dict );
|
||||
cGlobals->dict = linux_dictionary_make( MEMPOOL params,
|
||||
cGlobals->dict = linux_dictionary_make( MEMPOOL NULL_XWE, params,
|
||||
gi->dictName, XP_TRUE );
|
||||
gi->dictLang = dict_getLangCode( cGlobals->dict );
|
||||
}
|
||||
|
@ -2656,7 +2656,7 @@ makeNewGame( GtkGameGlobals* globals )
|
|||
XP_TRUE, XP_FALSE );
|
||||
if ( success && !!gi->dictName && !cGlobals->dict ) {
|
||||
cGlobals->dict =
|
||||
linux_dictionary_make( MEMPOOL cGlobals->params,
|
||||
linux_dictionary_make( MEMPOOL NULL_XWE, cGlobals->params,
|
||||
gi->dictName, XP_TRUE );
|
||||
gi->dictLang = dict_getLangCode( cGlobals->dict );
|
||||
}
|
||||
|
|
|
@ -45,7 +45,8 @@ typedef struct FontPerSize {
|
|||
PangoLayout* layout;
|
||||
} FontPerSize;
|
||||
|
||||
static void gtk_draw_measureScoreText( DrawCtx* p_dctx, const XP_Rect* bounds,
|
||||
static void gtk_draw_measureScoreText( DrawCtx* p_dctx, XWEnv xwe,
|
||||
const XP_Rect* bounds,
|
||||
const DrawScoreInfo* dsi,
|
||||
XP_U16* widthP, XP_U16* heightP );
|
||||
static gdouble figureColor( int in );
|
||||
|
@ -210,32 +211,32 @@ gtkEraseRect( const GtkDrawCtx* dctx, const XP_Rect* rect )
|
|||
#ifdef DRAW_WITH_PRIMITIVES
|
||||
|
||||
static void
|
||||
gtk_prim_draw_setClip( DrawCtx* p_dctx, XP_Rect* newClip, XP_Rect* oldClip)
|
||||
gtk_prim_draw_setClip( DrawCtx* p_dctx, XWEnv xwe, XP_Rect* newClip, XP_Rect* oldClip)
|
||||
{
|
||||
} /* gtk_prim_draw_setClip */
|
||||
|
||||
static void
|
||||
gtk_prim_draw_frameRect( DrawCtx* p_dctx, XP_Rect* rect )
|
||||
gtk_prim_draw_frameRect( DrawCtx* p_dctx, XWEnv xwe, XP_Rect* rect )
|
||||
{
|
||||
GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx;
|
||||
frameRect( dctx, rect );
|
||||
} /* gtk_prim_draw_frameRect */
|
||||
|
||||
static void
|
||||
gtk_prim_draw_invertRect( DrawCtx* p_dctx, XP_Rect* rect )
|
||||
gtk_prim_draw_invertRect( DrawCtx* p_dctx, XWEnv xwe, XP_Rect* rect )
|
||||
{
|
||||
/* not sure you can do this on GTK!! */
|
||||
} /* gtk_prim_draw_invertRect */
|
||||
|
||||
static void
|
||||
gtk_prim_draw_clearRect( DrawCtx* p_dctx, XP_Rect* rect )
|
||||
gtk_prim_draw_clearRect( DrawCtx* p_dctx, XWEnv xwe, XP_Rect* rect )
|
||||
{
|
||||
GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx;
|
||||
gtkEraseRect( dctx, rect );
|
||||
} /* gtk_prim_draw_clearRect */
|
||||
|
||||
static void
|
||||
gtk_prim_draw_drawString( DrawCtx* p_dctx, XP_UCHAR* str,
|
||||
gtk_prim_draw_drawString( DrawCtx* p_dctx, XWEnv xwe, XP_UCHAR* str,
|
||||
XP_U16 x, XP_U16 y )
|
||||
{
|
||||
GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx;
|
||||
|
@ -245,13 +246,13 @@ gtk_prim_draw_drawString( DrawCtx* p_dctx, XP_UCHAR* str,
|
|||
} /* gtk_prim_draw_drawString */
|
||||
|
||||
static void
|
||||
gtk_prim_draw_drawBitmap( DrawCtx* p_dctx, XP_Bitmap bm,
|
||||
gtk_prim_draw_drawBitmap( DrawCtx* p_dctx, XWEnv xwe, XP_Bitmap bm,
|
||||
XP_U16 x, XP_U16 y )
|
||||
{
|
||||
} /* gtk_prim_draw_drawBitmap */
|
||||
|
||||
static void
|
||||
gtk_prim_draw_measureText( DrawCtx* p_dctx, XP_UCHAR* str,
|
||||
gtk_prim_draw_measureText( DrawCtx* p_dctx, XWEnv xwe, XP_UCHAR* str,
|
||||
XP_U16* widthP, XP_U16* heightP )
|
||||
{
|
||||
GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx;
|
||||
|
@ -439,7 +440,7 @@ freer( gpointer data, gpointer XP_UNUSED(user_data) )
|
|||
}
|
||||
|
||||
static void
|
||||
gtk_draw_destroyCtxt( DrawCtx* p_dctx )
|
||||
gtk_draw_destroyCtxt( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe) )
|
||||
{
|
||||
GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx;
|
||||
GtkAllocation alloc;
|
||||
|
@ -460,14 +461,14 @@ gtk_draw_destroyCtxt( DrawCtx* p_dctx )
|
|||
|
||||
|
||||
static void
|
||||
gtk_draw_dictChanged( DrawCtx* XP_UNUSED(p_dctx),
|
||||
gtk_draw_dictChanged( DrawCtx* XP_UNUSED(p_dctx), XWEnv XP_UNUSED(xwe),
|
||||
XP_S16 XP_UNUSED(playerNum),
|
||||
const DictionaryCtxt* XP_UNUSED(dict) )
|
||||
{
|
||||
}
|
||||
|
||||
static XP_Bool
|
||||
gtk_draw_beginDraw( DrawCtx* p_dctx )
|
||||
gtk_draw_beginDraw( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe) )
|
||||
{
|
||||
#ifdef USE_CAIRO
|
||||
GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx;
|
||||
|
@ -478,7 +479,7 @@ gtk_draw_beginDraw( DrawCtx* p_dctx )
|
|||
}
|
||||
|
||||
static void
|
||||
gtk_draw_endDraw( DrawCtx* p_dctx )
|
||||
gtk_draw_endDraw( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe) )
|
||||
{
|
||||
#ifdef USE_CAIRO
|
||||
GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx;
|
||||
|
@ -487,7 +488,7 @@ gtk_draw_endDraw( DrawCtx* p_dctx )
|
|||
}
|
||||
|
||||
static XP_Bool
|
||||
gtk_draw_boardBegin( DrawCtx* p_dctx, const XP_Rect* rect,
|
||||
gtk_draw_boardBegin( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), const XP_Rect* rect,
|
||||
XP_U16 width, XP_U16 height,
|
||||
DrawFocusState XP_UNUSED(dfs) )
|
||||
{
|
||||
|
@ -506,7 +507,7 @@ gtk_draw_boardBegin( DrawCtx* p_dctx, const XP_Rect* rect,
|
|||
} /* gtk_draw_boardBegin */
|
||||
|
||||
static void
|
||||
gtk_draw_objFinished( DrawCtx* XP_UNUSED(p_dctx),
|
||||
gtk_draw_objFinished( DrawCtx* XP_UNUSED(p_dctx), XWEnv XP_UNUSED(xwe),
|
||||
BoardObjectType XP_UNUSED(typ),
|
||||
const XP_Rect* XP_UNUSED(rect),
|
||||
DrawFocusState XP_UNUSED(dfs) )
|
||||
|
@ -514,7 +515,7 @@ gtk_draw_objFinished( DrawCtx* XP_UNUSED(p_dctx),
|
|||
} /* gtk_draw_objFinished */
|
||||
|
||||
static XP_Bool
|
||||
gtk_draw_vertScrollBoard( DrawCtx* p_dctx, XP_Rect* rect,
|
||||
gtk_draw_vertScrollBoard( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), XP_Rect* rect,
|
||||
XP_S16 dist, DrawFocusState XP_UNUSED(dfs) )
|
||||
{
|
||||
GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx;
|
||||
|
@ -606,7 +607,7 @@ drawCrosshairs( GtkDrawCtx* dctx, const XP_Rect* rect, CellFlags flags )
|
|||
#endif
|
||||
|
||||
static XP_Bool
|
||||
gtk_draw_drawCell( DrawCtx* p_dctx, const XP_Rect* rect, const XP_UCHAR* letter,
|
||||
gtk_draw_drawCell( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), const XP_Rect* rect, const XP_UCHAR* letter,
|
||||
const XP_Bitmaps* bitmaps, Tile XP_UNUSED(tile),
|
||||
XP_U16 XP_UNUSED(value), XP_S16 owner, XWBonusType bonus,
|
||||
HintAtts hintAtts, CellFlags flags )
|
||||
|
@ -715,7 +716,7 @@ gtk_draw_drawCell( DrawCtx* p_dctx, const XP_Rect* rect, const XP_UCHAR* letter,
|
|||
} /* gtk_draw_drawCell */
|
||||
|
||||
static void
|
||||
gtk_draw_invertCell( DrawCtx* XP_UNUSED(p_dctx),
|
||||
gtk_draw_invertCell( DrawCtx* XP_UNUSED(p_dctx), XWEnv XP_UNUSED(xwe),
|
||||
const XP_Rect* XP_UNUSED(rect) )
|
||||
{
|
||||
/* GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx; */
|
||||
|
@ -736,7 +737,7 @@ gtk_draw_invertCell( DrawCtx* XP_UNUSED(p_dctx),
|
|||
} /* gtk_draw_invertCell */
|
||||
|
||||
static XP_Bool
|
||||
gtk_draw_trayBegin( DrawCtx* p_dctx, const XP_Rect* XP_UNUSED(rect),
|
||||
gtk_draw_trayBegin( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), const XP_Rect* XP_UNUSED(rect),
|
||||
XP_U16 owner, XP_S16 XP_UNUSED(owner),
|
||||
DrawFocusState XP_UNUSED(dfs) )
|
||||
{
|
||||
|
@ -749,7 +750,7 @@ gtk_draw_trayBegin( DrawCtx* p_dctx, const XP_Rect* XP_UNUSED(rect),
|
|||
} /* gtk_draw_trayBegin */
|
||||
|
||||
static XP_Bool
|
||||
gtkDrawTileImpl( DrawCtx* p_dctx, const XP_Rect* rect, const XP_UCHAR* textP,
|
||||
gtkDrawTileImpl( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), const XP_Rect* rect, const XP_UCHAR* textP,
|
||||
const XP_Bitmaps* bitmaps, XP_U16 val, CellFlags flags,
|
||||
XP_Bool clearBack )
|
||||
{
|
||||
|
@ -815,26 +816,26 @@ gtkDrawTileImpl( DrawCtx* p_dctx, const XP_Rect* rect, const XP_UCHAR* textP,
|
|||
} /* gtkDrawTileImpl */
|
||||
|
||||
static XP_Bool
|
||||
gtk_draw_drawTile( DrawCtx* p_dctx, const XP_Rect* rect, const XP_UCHAR* textP,
|
||||
gtk_draw_drawTile( DrawCtx* p_dctx, XWEnv xwe, const XP_Rect* rect, const XP_UCHAR* textP,
|
||||
const XP_Bitmaps* bitmaps, XP_U16 val, CellFlags flags )
|
||||
{
|
||||
return gtkDrawTileImpl( p_dctx, rect, textP, bitmaps, val, flags, XP_TRUE );
|
||||
return gtkDrawTileImpl( p_dctx, xwe, rect, textP, bitmaps, val, flags, XP_TRUE );
|
||||
}
|
||||
|
||||
#ifdef POINTER_SUPPORT
|
||||
static XP_Bool
|
||||
gtk_draw_drawTileMidDrag( DrawCtx* p_dctx, const XP_Rect* rect,
|
||||
gtk_draw_drawTileMidDrag( DrawCtx* p_dctx, XWEnv xwe, const XP_Rect* rect,
|
||||
const XP_UCHAR* textP, const XP_Bitmaps* bitmaps,
|
||||
XP_U16 val, XP_U16 owner, CellFlags flags )
|
||||
{
|
||||
gtk_draw_trayBegin( p_dctx, rect, owner, 0, DFS_NONE );
|
||||
return gtkDrawTileImpl( p_dctx, rect, textP, bitmaps, val,
|
||||
gtk_draw_trayBegin( p_dctx, xwe, rect, owner, 0, DFS_NONE );
|
||||
return gtkDrawTileImpl( p_dctx, xwe, rect, textP, bitmaps, val,
|
||||
flags | (CELL_PENDING|CELL_RECENT), XP_FALSE );
|
||||
}
|
||||
#endif
|
||||
|
||||
static XP_Bool
|
||||
gtk_draw_drawTileBack( DrawCtx* p_dctx, const XP_Rect* rect,
|
||||
gtk_draw_drawTileBack( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), const XP_Rect* rect,
|
||||
CellFlags flags )
|
||||
{
|
||||
GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx;
|
||||
|
@ -855,8 +856,8 @@ gtk_draw_drawTileBack( DrawCtx* p_dctx, const XP_Rect* rect,
|
|||
} /* gtk_draw_drawTileBack */
|
||||
|
||||
static void
|
||||
gtk_draw_drawTrayDivider( DrawCtx* p_dctx, const XP_Rect* rect,
|
||||
CellFlags flags )
|
||||
gtk_draw_drawTrayDivider( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe),
|
||||
const XP_Rect* rect, CellFlags flags )
|
||||
{
|
||||
GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx;
|
||||
XP_Rect r = *rect;
|
||||
|
@ -879,7 +880,7 @@ gtk_draw_drawTrayDivider( DrawCtx* p_dctx, const XP_Rect* rect,
|
|||
} /* gtk_draw_drawTrayDivider */
|
||||
|
||||
static void
|
||||
gtk_draw_clearRect( DrawCtx* p_dctx, const XP_Rect* rectP )
|
||||
gtk_draw_clearRect( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), const XP_Rect* rectP )
|
||||
{
|
||||
GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx;
|
||||
XP_Rect rect = *rectP;
|
||||
|
@ -892,7 +893,7 @@ gtk_draw_clearRect( DrawCtx* p_dctx, const XP_Rect* rectP )
|
|||
} /* gtk_draw_clearRect */
|
||||
|
||||
static void
|
||||
gtk_draw_drawBoardArrow( DrawCtx* p_dctx, const XP_Rect* rectP,
|
||||
gtk_draw_drawBoardArrow( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), const XP_Rect* rectP,
|
||||
XWBonusType XP_UNUSED(cursorBonus), XP_Bool vertical,
|
||||
HintAtts hintAtts, CellFlags XP_UNUSED(flags) )
|
||||
{
|
||||
|
@ -907,7 +908,7 @@ gtk_draw_drawBoardArrow( DrawCtx* p_dctx, const XP_Rect* rectP,
|
|||
} /* gtk_draw_drawBoardCursor */
|
||||
|
||||
static XP_Bool
|
||||
gtk_draw_scoreBegin( DrawCtx* p_dctx, const XP_Rect* rect,
|
||||
gtk_draw_scoreBegin( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), const XP_Rect* rect,
|
||||
XP_U16 XP_UNUSED(numPlayers),
|
||||
const XP_S16* const XP_UNUSED(scores),
|
||||
XP_S16 XP_UNUSED(remCount),
|
||||
|
@ -958,8 +959,8 @@ getLayoutToFitRect( GtkDrawCtx* dctx, const XP_UCHAR* str, const XP_Rect* rect,
|
|||
} /* getLayoutToFitRect */
|
||||
|
||||
static void
|
||||
gtkDrawDrawRemText( DrawCtx* p_dctx, const XP_Rect* rect, XP_S16 nTilesLeft,
|
||||
XP_U16* widthP, XP_U16* heightP, XP_Bool focussed )
|
||||
gtkDrawDrawRemText( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), const XP_Rect* rect,
|
||||
XP_S16 nTilesLeft, XP_U16* widthP, XP_U16* heightP, XP_Bool focussed )
|
||||
{
|
||||
GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx;
|
||||
XP_UCHAR buf[10];
|
||||
|
@ -991,7 +992,7 @@ gtkDrawDrawRemText( DrawCtx* p_dctx, const XP_Rect* rect, XP_S16 nTilesLeft,
|
|||
} /* gtkDrawDrawRemText */
|
||||
|
||||
static void
|
||||
gtk_draw_score_drawPlayer( DrawCtx* p_dctx, const XP_Rect* rInner,
|
||||
gtk_draw_score_drawPlayer( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), const XP_Rect* rInner,
|
||||
const XP_Rect* rOuter,
|
||||
XP_U16 XP_UNUSED(gotPct), const DrawScoreInfo* dsi )
|
||||
{
|
||||
|
@ -1049,7 +1050,7 @@ gtk_draw_score_drawPlayer( DrawCtx* p_dctx, const XP_Rect* rInner,
|
|||
|
||||
#ifdef XWFEATURE_SCOREONEPASS
|
||||
static XP_Bool
|
||||
gtk_draw_drawRemText( DrawCtx* p_dctx, XP_S16 nTilesLeft,
|
||||
gtk_draw_drawRemText( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), XP_S16 nTilesLeft,
|
||||
XP_Bool focussed, XP_Rect* rect )
|
||||
{
|
||||
XP_Bool drawIt = 0 <= nTilesLeft;
|
||||
|
@ -1064,7 +1065,7 @@ gtk_draw_drawRemText( DrawCtx* p_dctx, XP_S16 nTilesLeft,
|
|||
}
|
||||
|
||||
static void
|
||||
gtk_draw_score_drawPlayers( DrawCtx* p_dctx, const XP_Rect* scoreRect,
|
||||
gtk_draw_score_drawPlayers( DrawCtx* p_dctx, XWEnv xwe, const XP_Rect* scoreRect,
|
||||
XP_U16 nPlayers,
|
||||
DrawScoreInfo playerData[],
|
||||
XP_Rect playerRects[] )
|
||||
|
@ -1078,13 +1079,13 @@ gtk_draw_score_drawPlayers( DrawCtx* p_dctx, const XP_Rect* scoreRect,
|
|||
for ( ii = 0; ii < nPlayers; ++ii ) {
|
||||
XP_U16 ignoreW, ignoreH;
|
||||
XP_Rect innerR;
|
||||
gtk_draw_measureScoreText( p_dctx, &rect, &playerData[ii], &ignoreW,
|
||||
gtk_draw_measureScoreText( p_dctx, xwe, &rect, &playerData[ii], &ignoreW,
|
||||
&ignoreH );
|
||||
|
||||
innerR = rect;
|
||||
innerR.left += 4;
|
||||
innerR.width -= 8;
|
||||
gtk_draw_score_drawPlayer( p_dctx, &innerR, &rect, 0, &playerData[ii] );
|
||||
gtk_draw_score_drawPlayer( p_dctx, xwe, &innerR, &rect, 0, &playerData[ii] );
|
||||
|
||||
playerRects[ii] = rect;
|
||||
rect.left += rect.width;
|
||||
|
@ -1094,22 +1095,22 @@ gtk_draw_score_drawPlayers( DrawCtx* p_dctx, const XP_Rect* scoreRect,
|
|||
|
||||
#else
|
||||
static XP_Bool
|
||||
gtk_draw_measureRemText( DrawCtx* p_dctx, const XP_Rect* rect, XP_S16 nTilesLeft,
|
||||
gtk_draw_measureRemText( DrawCtx* p_dctx, XWEnv xwe, const XP_Rect* rect, XP_S16 nTilesLeft,
|
||||
XP_U16* width, XP_U16* height )
|
||||
{
|
||||
XP_Bool drawIt = 0 <= nTilesLeft;
|
||||
if ( drawIt ) {
|
||||
gtkDrawDrawRemText( p_dctx, rect, nTilesLeft, width, height, XP_FALSE );
|
||||
gtkDrawDrawRemText( p_dctx, xwe, rect, nTilesLeft, width, height, XP_FALSE );
|
||||
}
|
||||
return drawIt;
|
||||
} /* gtk_draw_measureRemText */
|
||||
|
||||
static void
|
||||
gtk_draw_drawRemText( DrawCtx* p_dctx, const XP_Rect* rInner,
|
||||
gtk_draw_drawRemText( DrawCtx* p_dctx, XWEnv xwe, const XP_Rect* rInner,
|
||||
const XP_Rect* XP_UNUSED(rOuter), XP_S16 nTilesLeft,
|
||||
XP_Bool focussed )
|
||||
{
|
||||
gtkDrawDrawRemText( p_dctx, rInner, nTilesLeft, NULL, NULL, focussed );
|
||||
gtkDrawDrawRemText( p_dctx, xwe, rInner, nTilesLeft, NULL, NULL, focussed );
|
||||
} /* gtk_draw_drawRemText */
|
||||
|
||||
#endif
|
||||
|
@ -1185,7 +1186,7 @@ formatScoreText( PangoLayout* layout, XP_UCHAR* buf, XP_U16 bufLen,
|
|||
} /* formatScoreText */
|
||||
|
||||
static void
|
||||
gtk_draw_measureScoreText( DrawCtx* p_dctx, const XP_Rect* bounds,
|
||||
gtk_draw_measureScoreText( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), const XP_Rect* bounds,
|
||||
const DrawScoreInfo* dsi,
|
||||
XP_U16* widthP, XP_U16* heightP )
|
||||
{
|
||||
|
@ -1207,7 +1208,7 @@ gtk_draw_measureScoreText( DrawCtx* p_dctx, const XP_Rect* bounds,
|
|||
} /* gtk_draw_measureScoreText */
|
||||
|
||||
static void
|
||||
gtk_draw_score_pendingScore( DrawCtx* p_dctx, const XP_Rect* rect,
|
||||
gtk_draw_score_pendingScore( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), const XP_Rect* rect,
|
||||
XP_S16 score, XP_U16 XP_UNUSED(playerNum),
|
||||
XP_Bool curTurn, CellFlags flags )
|
||||
{
|
||||
|
@ -1246,7 +1247,7 @@ gtk_draw_score_pendingScore( DrawCtx* p_dctx, const XP_Rect* rect,
|
|||
} /* gtk_draw_score_pendingScore */
|
||||
|
||||
static void
|
||||
gtk_draw_drawTimer( DrawCtx* p_dctx, const XP_Rect* rInner,
|
||||
gtk_draw_drawTimer( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), const XP_Rect* rInner,
|
||||
XP_U16 playerNum, XP_S16 secondsLeft,
|
||||
XP_Bool localTurnDone )
|
||||
{
|
||||
|
@ -1283,7 +1284,8 @@ frameRect( GtkDrawCtx* dctx, const XP_Rect* rect )
|
|||
} /* frameRect */
|
||||
|
||||
static const XP_UCHAR*
|
||||
gtk_draw_getMiniWText( DrawCtx* XP_UNUSED(p_dctx), XWMiniTextType textHint )
|
||||
gtk_draw_getMiniWText( DrawCtx* XP_UNUSED(p_dctx), XWEnv XP_UNUSED(xwe),
|
||||
XWMiniTextType textHint )
|
||||
{
|
||||
/* GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx; */
|
||||
XP_UCHAR* str;
|
||||
|
@ -1306,7 +1308,7 @@ gtk_draw_getMiniWText( DrawCtx* XP_UNUSED(p_dctx), XWMiniTextType textHint )
|
|||
} /* gtk_draw_getMiniWText */
|
||||
|
||||
static void
|
||||
gtk_draw_measureMiniWText( DrawCtx* p_dctx, const XP_UCHAR* str,
|
||||
gtk_draw_measureMiniWText( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), const XP_UCHAR* str,
|
||||
XP_U16* widthP, XP_U16* heightP )
|
||||
{
|
||||
GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx;
|
||||
|
@ -1320,7 +1322,7 @@ gtk_draw_measureMiniWText( DrawCtx* p_dctx, const XP_UCHAR* str,
|
|||
} /* gtk_draw_measureMiniWText */
|
||||
|
||||
static void
|
||||
gtk_draw_drawMiniWindow( DrawCtx* p_dctx, const XP_UCHAR* text,
|
||||
gtk_draw_drawMiniWindow( DrawCtx* p_dctx, XWEnv XP_UNUSED(xwe), const XP_UCHAR* text,
|
||||
const XP_Rect* rect, void** XP_UNUSED(closureP) )
|
||||
{
|
||||
GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#ifndef _LINUXDICT_H_
|
||||
#define _LINUXDICT_H_
|
||||
|
||||
DictionaryCtxt* linux_dictionary_make( MPFORMAL
|
||||
DictionaryCtxt* linux_dictionary_make( MPFORMAL XWEnv xwe,
|
||||
const LaunchParams* mainParams,
|
||||
const char* dictFileName,
|
||||
XP_Bool useMMap );
|
||||
|
|
|
@ -406,7 +406,7 @@ makeDictForStream( CommonGlobals* cGlobals, XWStreamCtxt* stream )
|
|||
stream_setPos( stream, POS_READ, pos );
|
||||
|
||||
DictionaryCtxt* dict =
|
||||
linux_dictionary_make( MPPARM(cGlobals->util->mpool) cGlobals->params,
|
||||
linux_dictionary_make( MPPARM(cGlobals->util->mpool) NULL_XWE, cGlobals->params,
|
||||
gi.dictName, XP_TRUE );
|
||||
gi_disposePlayerInfo( MPPARM(cGlobals->util->mpool) &gi );
|
||||
XP_ASSERT( !!dict );
|
||||
|
@ -440,7 +440,7 @@ gameGotBuf( CommonGlobals* cGlobals, XP_Bool hasDraw, const XP_U8* buf,
|
|||
}
|
||||
}
|
||||
if ( hasDraw && redraw ) {
|
||||
board_draw( game->board );
|
||||
board_draw( game->board, NULL_XWE );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -773,7 +773,7 @@ secondTimerFired( gpointer data )
|
|||
if ( (XP_RANDOM() % 1000) < undoRatio ) {
|
||||
XP_LOGFF( "calling server_handleUndo()" );
|
||||
if ( server_handleUndo( game->server, 1 ) ) {
|
||||
board_draw( game->board );
|
||||
board_draw( game->board, NULL_XWE );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2087,7 +2087,7 @@ walk_dict_test_all( MPFORMAL const LaunchParams* params, GSList* testDicts,
|
|||
for ( ii = 0; ii < count; ++ii ) {
|
||||
gchar* name = (gchar*)g_slist_nth_data( testDicts, ii );
|
||||
DictionaryCtxt* dict =
|
||||
linux_dictionary_make( MPPARM(mpool) params, name,
|
||||
linux_dictionary_make( MPPARM(mpool) NULL_XWE, params, name,
|
||||
params->useMmap );
|
||||
if ( NULL != dict ) {
|
||||
XP_LOGF( "walk_dict_test(%s)", name );
|
||||
|
@ -2250,7 +2250,7 @@ dup_timer_func( gpointer data )
|
|||
CommonGlobals* cGlobals = (CommonGlobals*)data;
|
||||
|
||||
if ( linuxFireTimer( cGlobals, TIMER_DUP_TIMERCHECK ) ) {
|
||||
board_draw( cGlobals->game.board );
|
||||
board_draw( cGlobals->game.board, NULL_XWE );
|
||||
}
|
||||
|
||||
return XP_FALSE;
|
||||
|
@ -2262,7 +2262,7 @@ score_timer_func( gpointer data )
|
|||
CommonGlobals* cGlobals = (CommonGlobals*)data;
|
||||
|
||||
if ( linuxFireTimer( cGlobals, TIMER_TIMERTICK ) ) {
|
||||
board_draw( cGlobals->game.board );
|
||||
board_draw( cGlobals->game.board, NULL_XWE );
|
||||
}
|
||||
|
||||
return XP_FALSE;
|
||||
|
@ -2275,7 +2275,7 @@ comms_timer_func( gpointer data )
|
|||
GtkGameGlobals* globals = (GtkGameGlobals*)data;
|
||||
|
||||
if ( linuxFireTimer( &globals->cGlobals, TIMER_COMMS ) ) {
|
||||
board_draw( globals->cGlobals.game.board );
|
||||
board_draw( globals->cGlobals.game.board, NULL_XWE );
|
||||
}
|
||||
|
||||
return (gint)0;
|
||||
|
@ -2288,7 +2288,7 @@ pen_timer_func( gpointer data )
|
|||
CommonGlobals* cGlobals = (CommonGlobals*)data;
|
||||
|
||||
if ( linuxFireTimer( cGlobals, TIMER_PENDOWN ) ) {
|
||||
board_draw( cGlobals->game.board );
|
||||
board_draw( cGlobals->game.board, NULL_XWE );
|
||||
}
|
||||
|
||||
return XP_FALSE;
|
||||
|
@ -2301,7 +2301,7 @@ slowrob_timer_func( gpointer data )
|
|||
CommonGlobals* cGlobals = (CommonGlobals*)data;
|
||||
|
||||
if ( linuxFireTimer( cGlobals, TIMER_SLOWROBOT ) ) {
|
||||
board_draw( cGlobals->game.board );
|
||||
board_draw( cGlobals->game.board, NULL_XWE );
|
||||
}
|
||||
|
||||
return (gint)0;
|
||||
|
@ -2379,7 +2379,7 @@ idle_func( gpointer data )
|
|||
ServerCtxt* server = cGlobals->game.server;
|
||||
if ( !!server && server_do( server ) ) {
|
||||
if ( !!cGlobals->game.board ) {
|
||||
board_draw( cGlobals->game.board );
|
||||
board_draw( cGlobals->game.board, NULL_XWE );
|
||||
}
|
||||
}
|
||||
return 0; /* 0 will stop it from being called again */
|
||||
|
@ -2485,7 +2485,7 @@ dawg2dict( const LaunchParams* params, GSList* testDicts )
|
|||
guint count = g_slist_length( testDicts );
|
||||
for ( int ii = 0; ii < count; ++ii ) {
|
||||
DictionaryCtxt* dict =
|
||||
linux_dictionary_make( MPPARM(params->mpool) params,
|
||||
linux_dictionary_make( MPPARM(params->mpool) NULL_XWE, params,
|
||||
g_slist_nth_data( testDicts, ii ),
|
||||
params->useMmap );
|
||||
if ( NULL != dict ) {
|
||||
|
@ -3068,7 +3068,7 @@ main( int argc, char** argv )
|
|||
/* char path[256]; */
|
||||
/* getDictPath( &mainParams, mainParams.gi.dictName, path, VSIZE(path) ); */
|
||||
DictionaryCtxt* dict =
|
||||
linux_dictionary_make( MPPARM(mainParams.mpool) &mainParams,
|
||||
linux_dictionary_make( MPPARM(mainParams.mpool) NULL_XWE, &mainParams,
|
||||
mainParams.pgi.dictName,
|
||||
mainParams.useMmap );
|
||||
XP_ASSERT( !!dict );
|
||||
|
|
|
@ -104,10 +104,10 @@ linux_freep( void** ptrp )
|
|||
#endif
|
||||
|
||||
static DictionaryCtxt*
|
||||
linux_util_makeEmptyDict( XW_UtilCtxt* XP_UNUSED_DBG(uctx), XWEnv XP_UNUSED(xwe) )
|
||||
linux_util_makeEmptyDict( XW_UtilCtxt* XP_UNUSED_DBG(uctx), XWEnv xwe )
|
||||
{
|
||||
XP_DEBUGF( "linux_util_makeEmptyDict called" );
|
||||
return linux_dictionary_make( MPPARM(uctx->mpool) NULL, NULL, XP_FALSE );
|
||||
return linux_dictionary_make( MPPARM(uctx->mpool) xwe, NULL, NULL, XP_FALSE );
|
||||
} /* linux_util_makeEmptyDict */
|
||||
|
||||
#define EM BONUS_NONE
|
||||
|
|
|
@ -296,6 +296,6 @@ typedef struct _GtkAppGlobals {
|
|||
} GtkAppGlobals;
|
||||
#endif
|
||||
|
||||
#define NULL_XWE ((XWEnv*)NULL)
|
||||
#define NULL_XWE ((XWEnv)NULL)
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue