xwords/xwords4/common/dbgutil.c
ehouse b171900dfb When moving focus through tray, skip empty space; when through board,
skip cells with tiles permanently played.  Space char raises focus but does
not move it laterally.
2006-11-09 06:05:40 +00:00

71 lines
1.8 KiB
C

/* -*-mode: C; fill-column: 78; c-basic-offset: 4; -*- */
/*
* Copyright 2006 by Eric House (xwords@eehouse.org). All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifdef DEBUG
#include "dbgutil.h"
#define CASESTR(s) case s: return #s
#define FUNC(f) #f
const char*
XP_Key_2str( XP_Key key )
{
switch( key ) {
CASESTR(XP_KEY_NONE);
CASESTR(XP_CURSOR_KEY_DOWN);
CASESTR(XP_CURSOR_KEY_RIGHT);
CASESTR(XP_CURSOR_KEY_UP);
CASESTR(XP_CURSOR_KEY_LEFT);
CASESTR(XP_CURSOR_KEY_DEL);
CASESTR(XP_RAISEFOCUS_KEY);
CASESTR(XP_RETURN_KEY);
CASESTR(XP_KEY_LAST );
default: return FUNC(__FUNCTION__) " unknown";
}
}
const char*
DrawFocusState_2str( DrawFocusState dfs )
{
switch( dfs ) {
CASESTR(DFS_NONE);
CASESTR(DFS_TOP);
CASESTR(DFS_DIVED);
default: return FUNC(__FUNCTION__) " unknown";
}
}
const char*
BoardObjectType_2str( BoardObjectType obj )
{
switch( obj ) {
CASESTR(OBJ_NONE);
CASESTR(OBJ_BOARD);
CASESTR(OBJ_SCORE);
CASESTR(OBJ_TRAY);
default: return FUNC(__FUNCTION__) " unknown";
}
}
#undef CASESTR
#endif /* DEBUG */