mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
Cleanup for a5 release: always use status icons when building for bluetooth.
This commit is contained in:
parent
b2ed436b74
commit
621e049962
5 changed files with 31 additions and 54 deletions
|
@ -119,7 +119,7 @@ MYDEFS_COMMON += -DXWFEATURE_SEARCHLIMIT
|
|||
# MYDEFS_COMMON += -DXWFEATURE_RELAY
|
||||
|
||||
# turn on bluetooth comms option for 68K and ARM -- which won't work yet
|
||||
#BLUETOOTH = -DXWFEATURE_BLUETOOTH
|
||||
BLUETOOTH = -DXWFEATURE_BLUETOOTH
|
||||
#MYDEFS_COMMON += $(BLUETOOTH)
|
||||
|
||||
# Add menu allowing to choose to run 68K or ARM
|
||||
|
|
|
@ -86,7 +86,7 @@ BEGIN
|
|||
BITMAP "bmps/valuebuttonhd.pbitm" BPP 1 DENSITY 144
|
||||
END
|
||||
|
||||
#ifdef BTSTATUS_ICONS
|
||||
#ifdef XWFEATURE_BLUETOOTH
|
||||
BITMAP ID BTSTATUS_NONE_RES_ID AUTOCOMPRESS
|
||||
BEGIN
|
||||
BITMAP "bmps/downarrow.pbitm" BPP 1 DENSITY 72
|
||||
|
@ -110,7 +110,7 @@ BEGIN
|
|||
BITMAP "bmps/downarrow.pbitm" BPP 1 DENSITY 72
|
||||
BITMAP "bmps/bts_conn.bmp" BPP 8 DENSITY 144
|
||||
END
|
||||
#endif
|
||||
#endif /* XWFEATURE_BLUETOOTH */
|
||||
|
||||
#define TBH TRAY_BUTTON_HEIGHT_HR
|
||||
#define TBY TRAY_BUTTONS_Y_HR
|
||||
|
@ -141,8 +141,9 @@ BEGIN
|
|||
USABLE VALUE SBAR_START_VALUE MIN SBAR_MIN MAX SBAR_MIN
|
||||
PAGESIZE SBAR_PAGESIZE
|
||||
|
||||
#ifdef BTSTATUS_ICONS
|
||||
GADGET ID XW_BTSTATUS_GADGET_ID AT (PALM_FLIP_LEFT PREVBOTTOM+4 1 1) USABLE
|
||||
#ifdef XWFEATURE_BLUETOOTH
|
||||
GADGET ID XW_BTSTATUS_GADGET_ID AT (PALM_FLIP_LEFT PREVBOTTOM+4 16 16)
|
||||
NONUSABLE
|
||||
#endif
|
||||
|
||||
BUTTON "" XW_MAIN_SHOWTRAY_BUTTON_ID
|
||||
|
|
|
@ -1533,54 +1533,32 @@ static void
|
|||
showBTState( PalmAppGlobals* globals )
|
||||
{
|
||||
CommsCtxt* comms = globals->game.comms;
|
||||
if ( comms != NULL ) {
|
||||
if ( COMMS_CONN_BT == comms_getConType( globals->game.comms ) ) {
|
||||
#ifdef BTSTATUS_ICONS
|
||||
Int16 resID = 0;
|
||||
if ( (comms != NULL)
|
||||
&& (COMMS_CONN_BT == comms_getConType( globals->game.comms )) ) {
|
||||
Int16 resID = 0;
|
||||
|
||||
switch( globals->btUIState ) {
|
||||
case BTUI_NONE:
|
||||
resID = BTSTATUS_NONE_RES_ID; break;
|
||||
case BTUI_LISTENING:
|
||||
resID = BTSTATUS_LISTENING_RES_ID; break;
|
||||
case BTUI_CONNECTING:
|
||||
resID = BTSTATUS_SEEKING_RES_ID; break;
|
||||
case BTUI_CONNECTED:
|
||||
case BTUI_SERVING:
|
||||
resID = BTSTATUS_CONNECTED_RES_ID; break;
|
||||
}
|
||||
switch( globals->btUIState ) {
|
||||
case BTUI_NONE:
|
||||
resID = BTSTATUS_NONE_RES_ID; break;
|
||||
case BTUI_LISTENING:
|
||||
resID = BTSTATUS_LISTENING_RES_ID; break;
|
||||
case BTUI_CONNECTING:
|
||||
resID = BTSTATUS_SEEKING_RES_ID; break;
|
||||
case BTUI_CONNECTED:
|
||||
case BTUI_SERVING:
|
||||
resID = BTSTATUS_CONNECTED_RES_ID; break;
|
||||
}
|
||||
|
||||
if ( globals->lastBTStatusRes != resID ) {
|
||||
RectangleType bounds;
|
||||
getObjectBounds( XW_BTSTATUS_GADGET_ID, &bounds );
|
||||
if ( resID != 0 ) {
|
||||
XP_LOGF( "%s: resID = %d", __func__, resID );
|
||||
/* XP_LOGF( "%s: bounds: %d,%d,%d,%d", __func__, bounds.topLeft.x, */
|
||||
/* bounds.topLeft.y, bounds.extent.x, bounds.extent.y ); */
|
||||
draw_drawBitmapAt( globals->draw, resID,
|
||||
bounds.topLeft.x, bounds.topLeft.y );
|
||||
} else {
|
||||
WinEraseRectangle( &bounds, 0 );
|
||||
}
|
||||
globals->lastBTStatusRes = resID;
|
||||
if ( globals->lastBTStatusRes != resID ) {
|
||||
RectangleType bounds;
|
||||
getObjectBounds( XW_BTSTATUS_GADGET_ID, &bounds );
|
||||
if ( resID != 0 ) {
|
||||
draw_drawBitmapAt( globals->draw, resID,
|
||||
bounds.topLeft.x, bounds.topLeft.y );
|
||||
} else {
|
||||
WinEraseRectangle( &bounds, 0 );
|
||||
}
|
||||
#else
|
||||
XP_U16 yy = 160 - 27;
|
||||
char ch[] = { ' ', ' ' };
|
||||
switch( globals->btUIState ) {
|
||||
case BTUI_NONE:
|
||||
ch[0] = 'x'; break;
|
||||
case BTUI_LISTENING:
|
||||
ch[0] = 'L'; break;
|
||||
case BTUI_CONNECTING:
|
||||
ch[0] = 'c'; break;
|
||||
case BTUI_CONNECTED:
|
||||
ch[0] = 'C'; break;
|
||||
case BTUI_SERVING:
|
||||
ch[0] = 'S'; break;
|
||||
}
|
||||
WinDrawChars( ch, sizeof(ch), 160-7, yy );
|
||||
#endif
|
||||
globals->lastBTStatusRes = resID;
|
||||
}
|
||||
}
|
||||
} /* showBTState */
|
||||
|
@ -2007,7 +1985,7 @@ updateForLefty( PalmAppGlobals* globals, FormPtr form )
|
|||
XW_MAIN_TRADE_BUTTON_ID, -1,
|
||||
XW_MAIN_DONE_BUTTON_ID, TRAY_BUTTON_WIDTH-1,
|
||||
#endif
|
||||
#ifdef BTSTATUS_ICONS
|
||||
#ifdef XWFEATURE_BLUETOOTH
|
||||
XW_BTSTATUS_GADGET_ID, 0,
|
||||
#endif
|
||||
0,
|
||||
|
|
|
@ -331,9 +331,7 @@ struct PalmAppGlobals {
|
|||
|
||||
#ifdef XWFEATURE_BLUETOOTH
|
||||
struct PalmBTStuff* btStuff;
|
||||
# ifdef BTSTATUS_ICONS
|
||||
XP_U16 lastBTStatusRes;
|
||||
# endif
|
||||
BtUIState btUIState; /* For showing user what's up */
|
||||
#endif
|
||||
|
||||
|
|
|
@ -409,7 +409,7 @@
|
|||
#define SHOWTRAY_BUTTON_BMP_RES_ID 1008
|
||||
#define STAR_BMP_RES_ID 1009
|
||||
|
||||
#ifdef BTSTATUS_ICONS
|
||||
#ifdef XWFEATURE_BLUETOOTH
|
||||
# define BTSTATUS_NONE_RES_ID 1010
|
||||
# define BTSTATUS_LISTENING_RES_ID 1011
|
||||
# define BTSTATUS_SEEKING_RES_ID 1012
|
||||
|
|
Loading…
Add table
Reference in a new issue