move vtmgr into ulinuxutl so linux variants don't all have to implement it

This commit is contained in:
Eric House 2011-04-16 22:34:47 -07:00
parent 92b255c35d
commit 7ef555033f
4 changed files with 13 additions and 19 deletions

View file

@ -1208,13 +1208,6 @@ initClientSocket( CursesAppGlobals* globals, char* serverName )
} /* initClientSocket */
#endif
static VTableMgr*
curses_util_getVTManager(XW_UtilCtxt* uc)
{
CursesAppGlobals* globals = (CursesAppGlobals*)uc->closure;
return globals->cGlobals.params->vtMgr;
} /* linux_util_getVTManager */
static XP_Bool
curses_util_askPassword( XW_UtilCtxt* XP_UNUSED(uc),
const XP_UCHAR* XP_UNUSED(name),
@ -1294,7 +1287,6 @@ setupCursesUtilCallbacks( CursesAppGlobals* globals, XW_UtilCtxt* util )
{
util->vtable->m_util_userError = curses_util_userError;
util->vtable->m_util_getVTManager = curses_util_getVTManager;
util->vtable->m_util_askPassword = curses_util_askPassword;
util->vtable->m_util_yOffsetChange = curses_util_yOffsetChange;
util->vtable->m_util_warnIllegalWord = curses_util_warnIllegalWord;
@ -1439,7 +1431,7 @@ relay_error_curses( void* XP_UNUSED(closure), XWREASON XP_UNUSED_DBG(relayErr) )
#endif
}
void
int
cursesmain( XP_Bool isServer, LaunchParams* params )
{
int piperesult;
@ -1647,5 +1639,6 @@ cursesmain( XP_Bool isServer, LaunchParams* params )
#endif
endwin();
return 0;
} /* cursesmain */
#endif /* PLATFORM_NCURSES */

View file

@ -106,6 +106,6 @@ DrawCtx* cursesDrawCtxtMake( WINDOW* boardWin );
*/
void cursesmain( XP_Bool isServer, LaunchParams* params );
int cursesmain( XP_Bool isServer, LaunchParams* params );
#endif

View file

@ -1052,9 +1052,11 @@ disenable_buttons( GtkAppGlobals* globals )
gtk_widget_set_sensitive( globals->prevhint_button, canHing );
gtk_widget_set_sensitive( globals->nexthint_button, canHing );
#ifdef XWFEATURE_CHAT
XP_Bool canChat = !!globals->cGlobals.game.comms
&& comms_canChat( globals->cGlobals.game.comms );
gtk_widget_set_sensitive( globals->chat_button, canChat );
#endif
}
static gboolean
@ -1289,13 +1291,6 @@ gtkUserError( GtkAppGlobals* XP_UNUSED(globals), const char* format, ... )
va_end(ap);
} /* gtkUserError */
static VTableMgr*
gtk_util_getVTManager(XW_UtilCtxt* uc)
{
GtkAppGlobals* globals = (GtkAppGlobals*)uc->closure;
return globals->cGlobals.params->vtMgr;
} /* linux_util_getVTManager */
static XP_S16
gtk_util_userPickTile( XW_UtilCtxt* uc, const PickInfo* pi,
XP_U16 playerNum, const XP_UCHAR** texts,
@ -1884,7 +1879,6 @@ setupGtkUtilCallbacks( GtkAppGlobals* globals, XW_UtilCtxt* util )
{
util->vtable->m_util_userError = gtk_util_userError;
util->vtable->m_util_userQuery = gtk_util_userQuery;
util->vtable->m_util_getVTManager = gtk_util_getVTManager;
util->vtable->m_util_userPickTile = gtk_util_userPickTile;
util->vtable->m_util_askPassword = gtk_util_askPassword;
util->vtable->m_util_trayHiddenChange = gtk_util_trayHiddenChange;

View file

@ -265,6 +265,13 @@ linux_util_getUserString( XW_UtilCtxt* XP_UNUSED(uc), XP_U16 code )
}
} /* linux_util_getUserString */
static VTableMgr*
linux_util_getVTManager( XW_UtilCtxt* uc )
{
CommonGlobals* cGlobals = (CommonGlobals*)uc->closure;
return cGlobals->params->vtMgr;
} /* linux_util_getVTManager */
void
linux_util_vt_init( MPFORMAL XW_UtilCtxt* util )
{
@ -274,7 +281,7 @@ linux_util_vt_init( MPFORMAL XW_UtilCtxt* util )
util->vtable->m_util_getSquareBonus = linux_util_getSquareBonus;
util->vtable->m_util_getCurSeconds = linux_util_getCurSeconds;
util->vtable->m_util_getUserString = linux_util_getUserString;
util->vtable->m_util_getVTManager = linux_util_getVTManager;
}
void