From c20232085ab497dd003b75e8883cd81a8eaebdf2 Mon Sep 17 00:00:00 2001 From: ehouse Date: Mon, 18 Sep 2006 04:40:27 +0000 Subject: [PATCH] Tweaks toward a dual ARM/68K binary where only 68K supports bluetooth. Don't try to not show the BT option for connecting, but in the case where it's not actually supported say so in the dialog. --- palm/connsdlg.c | 27 ++++++++++----------------- palm/l10n/xwords4_en_US.rcp.pre | 30 +++++++++++++----------------- palm/xptypes.h | 6 ++++++ palm/xwords4defines.h | 9 ++++----- 4 files changed, 33 insertions(+), 39 deletions(-) diff --git a/palm/connsdlg.c b/palm/connsdlg.c index ea35f8d4b..13a1b8835 100644 --- a/palm/connsdlg.c +++ b/palm/connsdlg.c @@ -59,7 +59,7 @@ strFromField( XP_U16 id, XP_UCHAR* buf, XP_U16 max ) } /* strFromField */ static void -ctlsFromState( PalmAppGlobals* globals, ConnsDlgState* state ) +ctlsFromState( PalmAppGlobals* XP_UNUSED_BT(globals), ConnsDlgState* state ) { XP_Bool isNewGame = state->isNewGame; XP_UCHAR buf[16]; @@ -137,6 +137,8 @@ updateFormCtls( FormPtr form, ConnsDlgState* state ) XW_CONNS_BT_HOSTNAME_LABEL_ID, XW_CONNS_BT_HOSTFIELD_ID, XW_CONNS_BT_BROWSEBUTTON_ID, +#else + XW_CONNS_BT_NOTSUPPORT_LABEL_ID, #endif 0 }; @@ -148,11 +150,12 @@ updateFormCtls( FormPtr form, ConnsDlgState* state ) if ( state->addr->conType == COMMS_CONN_RELAY ) { on = relayCtls; -#ifdef XWFEATURE_BLUETOOTH } else if ( state->addr->conType == COMMS_CONN_BT - && state->serverRole == SERVER_ISCLIENT ) { - on = btGuestCtls; +#ifdef XWFEATURE_BLUETOOTH + && state->serverRole == SERVER_ISCLIENT #endif + ) { + on = btGuestCtls; } else { on = NULL; } @@ -182,14 +185,9 @@ conTypeToSel( CommsConnType conType ) { XP_U16 result = 0; switch ( conType ) { -#ifdef XWFEATURE_BLUETOOTH case COMMS_CONN_BT: /* result = 0; */break; case COMMS_CONN_IR: result = 1; break; case COMMS_CONN_RELAY: result = 2; break; -#else - case COMMS_CONN_IR: /* result = 0; */break; - case COMMS_CONN_RELAY: result = 1; break; -#endif default: XP_ASSERT(0); } @@ -199,20 +197,15 @@ conTypeToSel( CommsConnType conType ) static CommsConnType selToConType( XP_U16 sel ) { - CommsConnType conType; + CommsConnType conType = COMMS_CONN_BT; switch( sel ) { -#ifdef XWFEATURE_BLUETOOTH - case 0: conType = COMMS_CONN_BT; break; + case 0: /* conType = COMMS_CONN_BT; */break; case 1: conType = COMMS_CONN_IR; break; case 2: conType = COMMS_CONN_RELAY; break; -#else - case 0: conType = COMMS_CONN_IR; break; - case 1: conType = COMMS_CONN_RELAY; break; -#endif default: XP_ASSERT(0); } return conType; -} +} /* selToConType */ #ifdef XWFEATURE_BLUETOOTH static void diff --git a/palm/l10n/xwords4_en_US.rcp.pre b/palm/l10n/xwords4_en_US.rcp.pre index fcbb16377..ff85a7945 100644 --- a/palm/l10n/xwords4_en_US.rcp.pre +++ b/palm/l10n/xwords4_en_US.rcp.pre @@ -229,7 +229,7 @@ END /* FORM XW_PLAYERINFO_FORM */ #define CONNS_FIELD_LEFT 70 #define LOCALIP_TOP 30 -FORM ID XW_CONNS_FORM AT (2 54 156 105) +FORM ID XW_CONNS_FORM AT (2 66 156 93) USABLE MODAL SAVEBEHIND DEFAULTBTNID XW_CONNS_CANCEL_BUTTON_ID BEGIN TITLE "Connections" @@ -239,27 +239,23 @@ BEGIN POPUPTRIGGER "" ID XW_CONNS_TYPE_TRIGGER_ID AT (PREVRIGHT+5 PREVTOP 72 12) LEFTANCHOR LIST -#ifdef XWFEATURE_BLUETOOTH - "Bluetooth" -#endif - "IR" "Internet/IP" ID XW_CONNS_TYPE_LIST_ID - PREVLEFT PREVTOP 72 12 VISIBLEITEMS -#ifdef XWFEATURE_BLUETOOTH - 3 -#else - 2 -#endif + "Bluetooth" "IR" "Internet/IP" ID XW_CONNS_TYPE_LIST_ID + PREVLEFT PREVTOP 72 12 VISIBLEITEMS 3 NONUSABLE POPUPLIST XW_CONNS_TYPE_TRIGGER_ID XW_CONNS_TYPE_LIST_ID -#ifdef XWFEATURE_BLUETOOTH +/* Bluetooth stuff must be here even if XWFEATURE_BLUETOOTH is not defined + since, e.g. ARM and 68K share these resources yet may not both support + BT */ + LABEL "Bluetooth not supported" XW_CONNS_BT_NOTSUPPORT_LABEL_ID + AT ( LEFTCOL+10 LOCALIP_TOP ) NONUSABLE LABEL "host name:" XW_CONNS_BT_HOSTNAME_LABEL_ID - AT ( LEFTCOL+10 LOCALIP_TOP ) + AT ( PREVLEFT PREVTOP ) NONUSABLE FIELD XW_CONNS_BT_HOSTFIELD_ID CONNS_FIELD_LEFT PREVTOP 70 AUTO \ - SINGLELINE EDITABLE UNDERLINED MAXCHARS 32 + SINGLELINE EDITABLE UNDERLINED MAXCHARS 32 NONUSABLE BUTTON "Browse" XW_CONNS_BT_BROWSEBUTTON_ID LEFTCOL+10 PREVBOTTOM+5 - AUTO AUTO -#endif + AUTO AUTO NONUSABLE +/* Relay... */ LABEL "Relay name:" XW_CONNS_RELAY_LABEL_ID AT ( LEFTCOL+10 LOCALIP_TOP ) FIELD XW_CONNS_RELAY_FIELD_ID CONNS_FIELD_LEFT PREVTOP 70 AUTO \ @@ -275,7 +271,7 @@ BEGIN FIELD XW_CONNS_COOKIE_FIELD_ID CONNS_FIELD_LEFT PREVTOP 70 AUTO \ SINGLELINE EDITABLE UNDERLINED MAXCHARS 32 - BUTTON "Cancel" XW_CONNS_CANCEL_BUTTON_ID 42 PREVBOTTOM+5 AUTO AUTO + BUTTON "Cancel" XW_CONNS_CANCEL_BUTTON_ID 42 PREVBOTTOM+6 AUTO AUTO BUTTON "Ok" XW_CONNS_OK_BUTTON_ID PREVRIGHT+10 PREVTOP AUTO AUTO END /* XW_CONNS_FORM */ #endif diff --git a/palm/xptypes.h b/palm/xptypes.h index 830c01f5a..e151df2fe 100644 --- a/palm/xptypes.h +++ b/palm/xptypes.h @@ -135,5 +135,11 @@ XP_U8* palm_realloc(XP_U8* in, XP_U16 size); # define XP_UNUSED_IR(x) XP_UNUSED(x) #endif +#ifdef XWFEATURE_BLUETOOTH +# define XP_UNUSED_BT(x) x +#else +# define XP_UNUSED_BT(x) XP_UNUSED(x) +#endif + #endif diff --git a/palm/xwords4defines.h b/palm/xwords4defines.h index 90346168d..572dec80d 100644 --- a/palm/xwords4defines.h +++ b/palm/xwords4defines.h @@ -333,11 +333,10 @@ #define XW_CONNS_PORT_FIELD_ID 2907 #define XW_CONNS_RELAY_LABEL_ID 2908 #define XW_CONNS_RELAY_FIELD_ID 2909 -#ifdef XWFEATURE_BLUETOOTH -# define XW_CONNS_BT_HOSTNAME_LABEL_ID 2910 -# define XW_CONNS_BT_HOSTFIELD_ID 2911 -# define XW_CONNS_BT_BROWSEBUTTON_ID 2912 -#endif +#define XW_CONNS_BT_NOTSUPPORT_LABEL_ID 2910 +#define XW_CONNS_BT_HOSTNAME_LABEL_ID 2911 +#define XW_CONNS_BT_HOSTFIELD_ID 2912 +#define XW_CONNS_BT_BROWSEBUTTON_ID 2913 /* * selector for number of tiles during hint