Commit graph

165 commits

Author SHA1 Message Date
ehouse
128d9c56ef Turn off BT, and up version for first RC release. 2007-04-05 04:19:44 +00:00
ehouse
03433901fc Closing BT lib from datahandler (since don't want to close on game
close in case next game will use); erase BT status icon when not BT
game; plug leak of dict name.
2007-03-18 23:57:30 +00:00
ehouse
aad182c2e3 turn stringFromStream into macro to aid logging for leak detection. Debug builds only effected. 2007-03-18 23:31:51 +00:00
ehouse
c7b46cffbf Pad prefs struct so ARM and 68K versions are using same addresses
(fixes crash opening game in ARM version that was saved in 68K);
renumber resource IDs so can be logged via a switch.
2007-03-17 15:37:15 +00:00
ehouse
971bfc280f Save and restore focus owner across app restarts (includes working around
OS's insistence on sending focusTake event on formOpen); up version numbers; turn off BT prior to beta release.
2007-02-24 03:35:51 +00:00
ehouse
621e049962 Cleanup for a5 release: always use status icons when building for bluetooth. 2007-02-18 03:33:17 +00:00
ehouse
f273e93c86 code to use bitmaps instead of letters to show bt conn status. 2007-02-12 08:05:35 +00:00
ehouse
b1d4a800c8 Fix nav for tungsten: test for lack rather than presence of keyUp events. 2007-02-08 15:16:46 +00:00
ehouse
a424d54445 Add a one-byte header to BT messages so one device can signal another
that a new game's begun without dropping the connection.  On Palm,
remove connection-drop on new game.  With this change starting a new
game takes imperciptible time, down from 30 seconds.
2007-02-08 02:53:10 +00:00
ehouse
f2ae7cb716 close and reopen bt module with every new game to fix, badly, client's
failure to connect if it's restarted before host; add event and use to
retry BtLibSocketListen when fails (since failure is usually
temporary).
2007-02-05 04:20:13 +00:00
ehouse
9a61f5c38b Add assert; don't call comms if has been set to null (fixes device
reset); fix failure to install connCB (removes need to manually resend
messages when client starts up first.)
2007-02-04 17:13:01 +00:00
ehouse
363cfdce04 Drop keyUp events not preceeded by keyDowns to catch leaks from
dismissed dialogs; don't drop first keyDown on OS4 since the bug that
works around isn't there; turn BT back off by default.
2007-02-04 04:10:11 +00:00
ehouse
7c8b7294cd add const to a bunch of char* decls in APIs and variables; no code change 2007-02-03 17:54:20 +00:00
ehouse
83a25455bb Fix Zodiac-only bug: printing keys generate only keyDown event, so
must use different handler than for nav keys; fix treo bug where forms
brought up during key handling get spurious key events by adding
keySafeCustomAlert that consumes up to the first keyDown before
calling FrmCustomAlert.
2007-02-03 17:36:56 +00:00
ehouse
b2f3e73672 Don't make any btlib calls until the main form is up. This works
around an (OS?) bug where, apparently, the confirm-turn-on-bt dialog
eats pending events, including frmLoadEvent, so that the form never
loads or is very broken if that dialog is allowed to come up too
early.
2007-02-02 08:24:06 +00:00
ehouse
9d74699181 Work around what looks like a PalmOS bug that generates a spurious
keyDown event to a form put up while processing a keyUp event in the
main form: set a flag while handling key events, and drop the first
keyDown in child forms when it's set.
2007-01-27 15:10:10 +00:00
ehouse
0313a89553 Test and special-case for zodiac, which gets events in the same way
has Treo but doesn't have OS support for moving focus among objects.
And since zodiac doesn't support the std Palm hires APIs don't try to
use them.  Up version string to b4.
2007-01-21 23:27:46 +00:00
ehouse
68730379b4 add five-way support for Tungstens; don't move cursor when keys are
meant for menu; redraw after hiding miniwindow when OS brings up
dialog;
2007-01-18 05:49:54 +00:00
ehouse
5a87db48bd keep track of last key down so can fake key up event when palm won't
be giving us one, e.g. when holding key results in a system window
coming up;
2007-01-12 03:34:43 +00:00
ehouse
fef8891e3c fix problems created by key-nav changes: don't drop hardware scroll
keys, and redraw after key-repeat if either up or down handled.
2007-01-07 05:25:28 +00:00
ehouse
e0010901f1 add board_handleKeyRepeat, and call it from palm and gtk. This lets a
held nav key walk the cursor across the board.
2007-01-07 04:32:29 +00:00
ehouse
8f924e9dc9 Don't show about dialog (with its alpha message) except when BT enabled. 2007-01-06 18:31:16 +00:00
ehouse
31b6526917 handle both keyUp and keyDown events, including dealing with devices
that don't generate the former.  Break key-handling code into separate
function.
2007-01-06 17:50:43 +00:00
ehouse
02c225c413 Fix so IR-only multi-device build works again. 2007-01-06 16:46:45 +00:00
ehouse
68e2f821d6 beta 2; redraw focus ring after redrawing tray buttons; move board
focus border so it coincides with regular border.
2006-12-21 07:55:19 +00:00
ehouse
1808fa804c When palm button loses focus to board obj, post event to be handled
after focus event, and on handling it inval rect of focus ring on
button.  This fixes drawing glitch where palm remembers pixels behind
focus ring but they're not right.
2006-12-20 04:49:24 +00:00
ehouse
afc302a29b When alt key pressed cursor can move onto occupied squares it normally skips. 2006-11-22 13:49:14 +00:00
ehouse
53765169be Draw focus differently in tray if whole thing has it, to include borders
between the tiles.
2006-11-17 13:46:06 +00:00
ehouse
7fe5718cc5 When "dived" focus reaches and crosses border of object, return as if
not handled.  This causes the platform to handle the key event itself,
typically by moving the focus to the next top-level object.
2006-11-17 13:41:13 +00:00
ehouse
a67be62069 Remove old focus-change callback; use extended handleKey API to allow
Palm to own all top-level focus change decisions (in accord with fnav
resource)
2006-11-14 06:54:14 +00:00
ehouse
d3812271a2 Add to draw APIs of individual elements (e.g. board cells) whether
they're focussed so that they can draw that during rather than after
everything else.  On palm, use this to draw focus using the system
selected color rather than with the blue nav rect.  Since a new param
was too much, add new enum type CellFlags and pass as bitvector to
draw APIs.
2006-11-12 14:36:15 +00:00
ehouse
74b6d76182 Fix messages getting dropped when remote device isn't connected by, on
getting a new connection, making a callback that calls resend_all().
This means a lot of duplication, but duplication is free with
bluetooth.  The underlying problem is that packets are reported as
sent not when acked by the other side, but when passed to a lower
level that may not be connected at all.
2006-11-11 22:52:39 +00:00
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
ehouse
708e270b2a add palm_util_notifyFocusChange to handle focus transitions away from
xplat code
2006-11-08 05:06:51 +00:00
ehouse
44eaa36319 More progress on one-handed navigation: fix ncurses board clipped to
bottom of tray; add focus-related params to draw*Finished routines
(and simplify to one) so platforms don't have to save from Begin
routines (and stop palm doing that); check version of saved game, and
handle case where older binary tries to open newer version; redraw
Palm tray buttons after focus change to stop focus-rect ghosting; fix
annoying overlap in saved games dialog; palm version goes to a3.
2006-11-05 16:54:18 +00:00
ehouse
3153e2b867 Lots of progress on one-handed navigation: add gadgets to stand in for board
scoreboard and tray on palm; make center drill into the focussed object and
spacebar come back up then move the focus among them.  Integrate with other
focussable objects on main form.  Go from separate drawCursor routines to
same for all three, with cursor only visible when focus is drilled down.
On curses, add a hilite rect routine that can be called after text is laid
down, and use for cursors.
2006-11-03 06:23:54 +00:00
ehouse
7c2e09cca5 Simple fnav resource for main form: a start 2006-10-30 00:28:46 +00:00
ehouse
da7a9dd562 When bt init fails, put up alert; check for failure after and don't
crash; erase bt status area even when no comms in order to erase after
turning bt off; in connect dlg, use a trigger rather than field and
button for host name.
2006-10-15 16:14:42 +00:00
ehouse
b73ac76775 Build with Bluetooth on; add alpha-only text to About dlg; show About
dlg on startup first time; fix null ptr deref bug.
2006-10-15 14:22:32 +00:00
ehouse
5f25ba9f57 remove BEYOND_IR, replacing with XWFEATURE_RELAY and
XWFEATURE_BLUETOOTH.  The goal is to be able to build to support
bluetooth only, or relay/ip only, e.g. for a palm bluetooth beta.
Seems to work.
2006-10-10 01:34:37 +00:00
ehouse
f6c0ea92e0 Raise status char a bit. 2006-10-07 03:38:36 +00:00
ehouse
0b0aef0908 Add quick hack to show BT connect state on main board, to be replace
by icons or something prettier later.  For new games dialog, replace
hard-coded list of controls to ignore with a runtime list.  This
allows checkboxes and fields to be enabled and disabled more easily.
Works around Palm's lack of a control state meaning "visible but
inactive" that works for all form elements.
2006-09-24 17:56:14 +00:00
ehouse
d78f9dd720 Add debug menu and in response dump bt state to stream for display.
Track sends and receives.  Add listening state for master, and don't
reset its acl when slave goes away.
2006-09-23 22:58:33 +00:00
ehouse
ecb8664e1b remove dead code using IR libs directly (no exchange mgr); rename
#define to be consistent with same for bluetooth.
2006-09-17 06:15:37 +00:00
ehouse
63afad6482 strutils macro change; tweak so compiles non-DEBUG and without Bluetooth 2006-09-15 07:42:10 +00:00
ehouse
3645481a53 New addr param to checkAndDeliver so address can be passed back to
comms; Add debug-only menus to toggle logging to file and memopad.
2006-09-14 01:46:41 +00:00
ehouse
c4b0f350e1 Lots of changes aimed at allowing to quit and restart in the middle of
a BT game: track states so can shutdown cleanly; transition from
master to slave; mechanism to defer work from callbacks to the main
loop.  Can now quit and restart as guest against host on linux.  Have
not tested between two Treos.
2006-09-08 07:06:21 +00:00
ehouse
74c6b241d7 Put up BT device browser while user is picking connection method
rather than when trying to send for first time, then pass address
through from conns dialog to bt code.
2006-08-26 21:12:10 +00:00
ehouse
0c915e61b0 First shot at bluetooth support (turned off in Makefile by default).
A full robot vs. robot game now works between two Treos.  Added UI to
choose BT as transport mechanism, and added new send proc to establish
socket connection between host and guest.  Works only for two devices:
no piconet yet.  No error recovery, ability to quit game in middle,
start new game, etc.
2006-08-23 04:44:55 +00:00
ehouse
1e8966c6f7 Fix compile errors due to missing UNUSED macros 2006-08-17 01:31:49 +00:00
ehouse
4daabf6fe5 Set -Wunused-parameter for those versions of gcc that support it, and
deal with the output by removing params where possible and elsewhere
by adding XP_UNUSED macro wrapping __attribute__((unused)).  There
should be NO change in function in spite of the large number of files.
2006-08-16 13:44:44 +00:00
ehouse
504f9641ea remove parameter following API change 2006-06-28 03:11:26 +00:00
ehouse
19414ae505 Finish scrollbar work by passing number of visible rows to
util_trayHiddenChange, which means an API change.  In board, calculate
bottom of board based on bottom of tray when tray is hidden, and round
so that it's an exact multiple of cell height.  In wince, take
advantage of the new parameter to fix the scrollbar so that very
constrained boards can be scrolled even when the tray is hidden.
2006-05-19 13:44:05 +00:00
ehouse
3a4c5dfff6 catch up with API change 2006-05-09 04:04:56 +00:00
ehouse
3388fc9f7b Remove HIGHRES compile-time tests: all palm releases will have HIGHRES
support now; build in different directories.
2006-03-31 10:57:01 +00:00
ehouse
92485783af update email address in header comments: no code change 2006-01-08 01:25:02 +00:00
ehouse
57ccb08528 fix for when BEYOND_IR not defined 2005-09-17 19:49:53 +00:00
ehouse
75b8f5342a add error messages 2005-09-04 20:34:16 +00:00
ehouse
c0bdfb54c9 constant name changed 2005-08-21 14:18:56 +00:00
ehouse
ae91d38e45 Clean up and fix timer code. 2005-08-03 01:14:49 +00:00
ehouse
1b40b1956e add const to match new signature 2005-07-30 02:44:42 +00:00
ehouse
bc3515272c Get rid of unused param 2005-07-14 02:54:47 +00:00
ehouse
84ec7e38f2 Get rid of WinCopyRect-based method of drawing letters and values in
tray tiles, since it seems not to work on all versions of PalmOS.
Simply drawing seems fine where tested; will try close clipping if
erasure happens elsewhere.  Draw board-top stuff one pixel higher on
highres devices, and fix scoreboard being too narrow on high-res
devices.
2005-07-14 02:45:10 +00:00
ehouse
e92234b324 cleanup: make module-local functions static 2005-06-25 05:43:56 +00:00
ehouse
684697216d fix timer not getting drawn on highres screens; handle heartbeat timer
and change to util_setTimer
2005-06-23 04:22:27 +00:00
ehouse
b485deb357 add palm_util_addrChange; track whether running on POSE to work around
NetLibSelect bug.
2005-04-03 16:54:54 +00:00
ehouse
8af072f8d9 move generic send/receive stuff from palmir.c. 2005-04-03 01:59:57 +00:00
ehouse
472f159245 catch up with API changes; make buffer bigger so crash doesn't happen
in tile picker for long-named players.
2005-01-24 05:21:45 +00:00
ehouse
c0efcd6b00 util function sig change 2005-01-13 04:37:36 +00:00
ehouse
5dd17b4729 fix non-high-res build so compiles again 2004-11-17 03:54:35 +00:00
ehouse
8219e62b83 use XP_MALLOC rather than MemPtrNew 2004-11-13 17:43:31 +00:00
ehouse
f57dbc0a5f don't scroll when menu's frontmost 2004-11-13 16:01:30 +00:00
ehouse
045383f7dd pass globals to palm_dictionary_make; handle five-way up/down in ask
dialog scrolling
2004-11-13 05:20:07 +00:00
ehouse
0433e3cc66 check that there's a form up before calling FrmCustomAlert (when
warning about missing dict)
2004-11-11 15:11:54 +00:00
ehouse
0664c9b089 bug: use ce's rule for hiding tray; works with always-visible case now
expected on high-res
2004-11-09 02:13:43 +00:00
ehouse
53f7ebe068 wrap launch-68K option in compile-time flag off by default 2004-11-08 14:44:52 +00:00
ehouse
6c22698ca8 add wrapper makeSimpleStream; handle new TILES_LEFT menuitem; server
now writes dict name to counts/values stream
2004-11-06 02:33:43 +00:00
ehouse
6a18321387 palmaskFromStrId changed as part of proving "Yes" and "No" buttons to
queries by default.  "Ok" becomes the answer only when there's a title
and (it's assumed) only one button needed.
2004-11-05 14:35:28 +00:00
ehouse
8080280ccc apply human-count test when hiding tray when quitting. No replaces
Cancel.
2004-11-04 02:01:47 +00:00
ehouse
fd93e1c13a tweaks on tray position 2004-11-03 03:58:46 +00:00
ehouse
1b0dc2cfbf tray can be in two positions/have two sizes only, either scrunched for
highres or square as it's always been.  Initial position is for
highres; at app startup, relocate if device is low-res. Also, fix
glitch in tile picker.
2004-11-02 06:20:29 +00:00
ehouse
5d7c608c61 report missing dicts; don't hide tray on close when only one human in
game
2004-10-30 04:51:46 +00:00
ehouse
affb392d8d relaunch app when switching from ARM to 68K 2004-10-13 01:05:53 +00:00
ehouse
f20f51abb7 deal with older app prefs version 2004-10-09 00:17:29 +00:00
ehouse
d7b82f905a engineStarting takes number of blanks; in ARM case show progress only
when non-zero.
2004-10-07 13:58:42 +00:00
ehouse
76ce9bae9c put randomness back in; bring up as ARM by default 2004-10-05 02:29:31 +00:00
ehouse
4081b11c6f remove dead field 2004-10-02 03:52:46 +00:00
ehouse
cceb68c831 separate highres support from screen resizing so can do only the former now 2004-10-01 01:40:47 +00:00
ehouse
c50fc5f37a swap shorts in prefs; workaround wierd codegen/pose bug; put break
back where accidentally removed.
2004-09-29 13:23:06 +00:00
ehouse
7f17483c89 tweaks to aid ARM debugging 2004-09-24 01:33:48 +00:00
ehouse
1cb340cf95 don't save prefs (for now) 2004-09-23 02:20:53 +00:00
ehouse
4843df586d cleanup unrelated to pnolet work 2004-09-21 04:57:00 +00:00
ehouse
748b316187 Temp code for PilotMain when pno; unrelated cleanup. 2004-09-19 03:27:13 +00:00
ehouse
1788752939 fix signed bug that broke scrolling in ask dialog 2004-08-31 13:27:28 +00:00
ehouse
a4198e4ddd add palm_util_getTraySearchLimits; addressed, for penDown only,
confusion between whether pen events are handled and whether the
handling means a redraw is required.  Might need to do same for
penMoved and penUp.
2004-06-25 06:43:46 +00:00
ehouse
42c4acd29e tweak board to right by one so gets bigger border in highres case 2004-05-16 15:02:41 +00:00
ehouse
09fb750eb1 double scale after reducing for border size 2004-05-16 14:32:24 +00:00
ehouse
b50c6f0b1d Inval whole board in hires case too; fix part of problem with vertical
scoreboard.
2004-05-15 01:14:51 +00:00
ehouse
e1d3b222a4 Allow deletion of picked tiles during face-up picking; add string for
attempt to undo tile assignment.
2004-05-14 08:59:10 +00:00
ehouse
452b3869bd cleanup 2004-05-06 04:10:48 +00:00