mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-03 23:04:08 +01:00
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.
This commit is contained in:
parent
488a2b1bac
commit
c20232085a
4 changed files with 33 additions and 39 deletions
|
@ -59,7 +59,7 @@ strFromField( XP_U16 id, XP_UCHAR* buf, XP_U16 max )
|
||||||
} /* strFromField */
|
} /* strFromField */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ctlsFromState( PalmAppGlobals* globals, ConnsDlgState* state )
|
ctlsFromState( PalmAppGlobals* XP_UNUSED_BT(globals), ConnsDlgState* state )
|
||||||
{
|
{
|
||||||
XP_Bool isNewGame = state->isNewGame;
|
XP_Bool isNewGame = state->isNewGame;
|
||||||
XP_UCHAR buf[16];
|
XP_UCHAR buf[16];
|
||||||
|
@ -137,6 +137,8 @@ updateFormCtls( FormPtr form, ConnsDlgState* state )
|
||||||
XW_CONNS_BT_HOSTNAME_LABEL_ID,
|
XW_CONNS_BT_HOSTNAME_LABEL_ID,
|
||||||
XW_CONNS_BT_HOSTFIELD_ID,
|
XW_CONNS_BT_HOSTFIELD_ID,
|
||||||
XW_CONNS_BT_BROWSEBUTTON_ID,
|
XW_CONNS_BT_BROWSEBUTTON_ID,
|
||||||
|
#else
|
||||||
|
XW_CONNS_BT_NOTSUPPORT_LABEL_ID,
|
||||||
#endif
|
#endif
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
@ -148,11 +150,12 @@ updateFormCtls( FormPtr form, ConnsDlgState* state )
|
||||||
|
|
||||||
if ( state->addr->conType == COMMS_CONN_RELAY ) {
|
if ( state->addr->conType == COMMS_CONN_RELAY ) {
|
||||||
on = relayCtls;
|
on = relayCtls;
|
||||||
#ifdef XWFEATURE_BLUETOOTH
|
|
||||||
} else if ( state->addr->conType == COMMS_CONN_BT
|
} else if ( state->addr->conType == COMMS_CONN_BT
|
||||||
&& state->serverRole == SERVER_ISCLIENT ) {
|
#ifdef XWFEATURE_BLUETOOTH
|
||||||
on = btGuestCtls;
|
&& state->serverRole == SERVER_ISCLIENT
|
||||||
#endif
|
#endif
|
||||||
|
) {
|
||||||
|
on = btGuestCtls;
|
||||||
} else {
|
} else {
|
||||||
on = NULL;
|
on = NULL;
|
||||||
}
|
}
|
||||||
|
@ -182,14 +185,9 @@ conTypeToSel( CommsConnType conType )
|
||||||
{
|
{
|
||||||
XP_U16 result = 0;
|
XP_U16 result = 0;
|
||||||
switch ( conType ) {
|
switch ( conType ) {
|
||||||
#ifdef XWFEATURE_BLUETOOTH
|
|
||||||
case COMMS_CONN_BT: /* result = 0; */break;
|
case COMMS_CONN_BT: /* result = 0; */break;
|
||||||
case COMMS_CONN_IR: result = 1; break;
|
case COMMS_CONN_IR: result = 1; break;
|
||||||
case COMMS_CONN_RELAY: result = 2; 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:
|
default:
|
||||||
XP_ASSERT(0);
|
XP_ASSERT(0);
|
||||||
}
|
}
|
||||||
|
@ -199,20 +197,15 @@ conTypeToSel( CommsConnType conType )
|
||||||
static CommsConnType
|
static CommsConnType
|
||||||
selToConType( XP_U16 sel )
|
selToConType( XP_U16 sel )
|
||||||
{
|
{
|
||||||
CommsConnType conType;
|
CommsConnType conType = COMMS_CONN_BT;
|
||||||
switch( sel ) {
|
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 1: conType = COMMS_CONN_IR; break;
|
||||||
case 2: conType = COMMS_CONN_RELAY; 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);
|
default: XP_ASSERT(0);
|
||||||
}
|
}
|
||||||
return conType;
|
return conType;
|
||||||
}
|
} /* selToConType */
|
||||||
|
|
||||||
#ifdef XWFEATURE_BLUETOOTH
|
#ifdef XWFEATURE_BLUETOOTH
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -229,7 +229,7 @@ END /* FORM XW_PLAYERINFO_FORM */
|
||||||
#define CONNS_FIELD_LEFT 70
|
#define CONNS_FIELD_LEFT 70
|
||||||
#define LOCALIP_TOP 30
|
#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
|
USABLE MODAL SAVEBEHIND DEFAULTBTNID XW_CONNS_CANCEL_BUTTON_ID
|
||||||
BEGIN
|
BEGIN
|
||||||
TITLE "Connections"
|
TITLE "Connections"
|
||||||
|
@ -239,27 +239,23 @@ BEGIN
|
||||||
POPUPTRIGGER "" ID XW_CONNS_TYPE_TRIGGER_ID
|
POPUPTRIGGER "" ID XW_CONNS_TYPE_TRIGGER_ID
|
||||||
AT (PREVRIGHT+5 PREVTOP 72 12) LEFTANCHOR
|
AT (PREVRIGHT+5 PREVTOP 72 12) LEFTANCHOR
|
||||||
LIST
|
LIST
|
||||||
#ifdef XWFEATURE_BLUETOOTH
|
"Bluetooth" "IR" "Internet/IP" ID XW_CONNS_TYPE_LIST_ID
|
||||||
"Bluetooth"
|
PREVLEFT PREVTOP 72 12 VISIBLEITEMS 3
|
||||||
#endif
|
|
||||||
"IR" "Internet/IP" ID XW_CONNS_TYPE_LIST_ID
|
|
||||||
PREVLEFT PREVTOP 72 12 VISIBLEITEMS
|
|
||||||
#ifdef XWFEATURE_BLUETOOTH
|
|
||||||
3
|
|
||||||
#else
|
|
||||||
2
|
|
||||||
#endif
|
|
||||||
NONUSABLE POPUPLIST XW_CONNS_TYPE_TRIGGER_ID XW_CONNS_TYPE_LIST_ID
|
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
|
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 \
|
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
|
BUTTON "Browse" XW_CONNS_BT_BROWSEBUTTON_ID LEFTCOL+10 PREVBOTTOM+5
|
||||||
AUTO AUTO
|
AUTO AUTO NONUSABLE
|
||||||
#endif
|
|
||||||
|
|
||||||
|
/* Relay... */
|
||||||
LABEL "Relay name:" XW_CONNS_RELAY_LABEL_ID
|
LABEL "Relay name:" XW_CONNS_RELAY_LABEL_ID
|
||||||
AT ( LEFTCOL+10 LOCALIP_TOP )
|
AT ( LEFTCOL+10 LOCALIP_TOP )
|
||||||
FIELD XW_CONNS_RELAY_FIELD_ID CONNS_FIELD_LEFT PREVTOP 70 AUTO \
|
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 \
|
FIELD XW_CONNS_COOKIE_FIELD_ID CONNS_FIELD_LEFT PREVTOP 70 AUTO \
|
||||||
SINGLELINE EDITABLE UNDERLINED MAXCHARS 32
|
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
|
BUTTON "Ok" XW_CONNS_OK_BUTTON_ID PREVRIGHT+10 PREVTOP AUTO AUTO
|
||||||
END /* XW_CONNS_FORM */
|
END /* XW_CONNS_FORM */
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -135,5 +135,11 @@ XP_U8* palm_realloc(XP_U8* in, XP_U16 size);
|
||||||
# define XP_UNUSED_IR(x) XP_UNUSED(x)
|
# define XP_UNUSED_IR(x) XP_UNUSED(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef XWFEATURE_BLUETOOTH
|
||||||
|
# define XP_UNUSED_BT(x) x
|
||||||
|
#else
|
||||||
|
# define XP_UNUSED_BT(x) XP_UNUSED(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -333,11 +333,10 @@
|
||||||
#define XW_CONNS_PORT_FIELD_ID 2907
|
#define XW_CONNS_PORT_FIELD_ID 2907
|
||||||
#define XW_CONNS_RELAY_LABEL_ID 2908
|
#define XW_CONNS_RELAY_LABEL_ID 2908
|
||||||
#define XW_CONNS_RELAY_FIELD_ID 2909
|
#define XW_CONNS_RELAY_FIELD_ID 2909
|
||||||
#ifdef XWFEATURE_BLUETOOTH
|
#define XW_CONNS_BT_NOTSUPPORT_LABEL_ID 2910
|
||||||
# define XW_CONNS_BT_HOSTNAME_LABEL_ID 2910
|
#define XW_CONNS_BT_HOSTNAME_LABEL_ID 2911
|
||||||
# define XW_CONNS_BT_HOSTFIELD_ID 2911
|
#define XW_CONNS_BT_HOSTFIELD_ID 2912
|
||||||
# define XW_CONNS_BT_BROWSEBUTTON_ID 2912
|
#define XW_CONNS_BT_BROWSEBUTTON_ID 2913
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* selector for number of tiles during hint
|
* selector for number of tiles during hint
|
||||||
|
|
Loading…
Reference in a new issue