Commit graph

180 commits

Author SHA1 Message Date
Andy2
ab708e4db1 add devOrder (= hostID) to params passed on connect. Make linux apps compile after API change. 2010-10-29 06:32:18 -07:00
Andy2
7e0bcee6d2 add room name to callback used when device connects: fix linux to compile 2010-10-28 18:46:07 -07:00
Andy2
a13bb34419 plug memory leak 2010-10-04 22:14:44 -07:00
Eric House
14fd1f9023 add test code for chat feature: display incoming chat and send via
menu.  Sent message is hard-coded for now; should fix that.
2010-10-03 18:13:48 -07:00
Andy2
00cdbc97d3 Install a no-op TERM handler at first then replace later with one that
just exits main loop.  Do cleanup/file saving on exit from mainloop.
Fixes occasional crash where TERM came in before we were setup to
cleanup.
2010-09-20 04:55:35 -07:00
Andy2
452e3fc86b timeout in milliseconds instead of seconds 2010-09-16 04:46:04 -07:00
Andy2
fa50bd00f1 timeout final scores alert 2010-09-16 03:42:57 -07:00
Andy2
0d7165f881 add ability to run gtk from newrelay.sh. Trying to run 50 instances
crashes the relay as ACKs take too long to come back.
2010-09-16 01:44:54 -07:00
Eric House
9fc39a55ed add params to set public-room-related booleans; add timeout option on
modal dialogs so gtk version can run unattended.
2010-09-14 21:13:45 -07:00
Andy2
34a94f23a0 fix error message to not specify host or guest 2010-09-10 01:24:42 -07:00
Andy2
6dc21ae7a8 pass (hard-coded) param controlling non-turn board switching 2010-07-17 06:22:42 -07:00
Andy2
6484a2fb9b fix to compile (with or without KEYBOARD_NAV undefined) 2010-07-09 06:50:39 -07:00
Andy2
4425ff838c add buttons (gtk) to test new prev-move feature; modify to fit new api
(curses).
2010-07-07 05:29:04 -07:00
Andy2
3452666231 use board_canTogglePending to disable button 2010-07-03 11:39:10 -07:00
Andy2
592d99ba80 add new button and handler to test redo of undone pending moves. 2010-07-02 18:53:37 -07:00
Andy2
e150db29ee use board_canFlip() to prototype disabling flip button when useless. 2010-06-30 20:25:56 -07:00
Andy2
80aa22b2d1 add common prefs field sortNewTiles and way to set on linux cmdline 2010-06-17 18:10:32 -07:00
eehouse
f514717428 Change board_zoom to indicate direction only of zoom, not number of
cols.  When figuring internal dimensions zoom out as needed to meet
maxSize value.  This fixes problem where rotating a zoomed portrait
board to landscape leaves cells bigger than they can be made by
zooming, but then the desired zoom has been changed and stored and so
on return to portrait cells are smaller/less zoomed.  Need to see if I
can live with that.
2010-06-05 03:40:23 +00:00
eehouse
a80d874e9d change api for board_zoom and change callers. No effect on java and
no behavior change.
2010-06-05 03:39:06 +00:00
eehouse
a2d2b0adbd quick hack to enable/disable zoom buttons so can debug board.c w/out
android.
2010-06-05 03:38:40 +00:00
eehouse
e1d956ac09 catch up with board_setPos API change. 2010-06-03 04:58:02 +00:00
eehouse
04835a09e1 add missing params so compiles 2010-04-23 09:32:14 +00:00
eehouse
ad2c725a58 always install scrollbar because zooming can require it after the
fact.
2010-04-15 02:16:40 +00:00
eehouse
1950e38bda remove bogus assert and logging 2010-04-08 04:15:08 +00:00
eehouse
d263b47a56 lots of changes, still rough, to allow zooming in and out on board.
Includes ability to scroll horizontally by dragging.  Board init API
changes to specify board width and max height instead of cell
dimensions, so now board owns task of picking cell size.  If the
number of cells does not evenly divide into a board dimension then the
extra pixels are distributed among some columns/rows in a way that
still allows bitblit-based scroll implementations (though horizontal
scrolling at this point always does an invalAll()).  Not yet tested
with overlapping tray.  And still need to allow rows to be taller than
cols are wide if platform code has given the space.  Stream format
changes with this checkin.
2010-04-08 04:14:14 +00:00
eehouse
603462fc33 add option to skip modal dialog showing final game score (may prevent
curses version from becoming nonresponsive when used from playme.sh);
add menu command to curses version to resend messages.
2010-03-28 16:08:54 +00:00
eehouse
cb5cc975b3 add new params required for comms_getInitialAddr 2010-03-25 04:53:16 +00:00
eehouse
b3a4ac306e actually do something (on the gtk side at least) when -S param is
passed.
2010-03-21 03:10:29 +00:00
eehouse
6893fe742a fix r3013 breakage: remove gameID params 2010-02-01 01:50:38 +00:00
ehouse
4425eaa99e move showColors into CommonPrefs, removing separate storage in linux
and wince and removing setter from board and jni APIs.  Palm change
pending.
2010-01-26 04:14:18 +00:00
ehouse
82382a7cfa Pass results back via timers and call board_draw() when so indicates.
Needed to test dragDropSetAdd.  Candidate for merge to trunk.
2010-01-25 00:28:30 +00:00
ehouse
28265749f9 fix unused var warning in release build 2009-12-17 13:09:10 +00:00
ehouse
35f068e05c Implement new callback giving progress connecting with relay. 2009-12-14 04:06:26 +00:00
ehouse
c893fd4a9e On receipt of connection-denied message via new rerror callback, put
up new error messages and then conns dialog so user can connect again
after changing room name or just waiting.  A new game is started so
that comms is re-inited and will try again to connect to relay.
2009-12-04 08:18:49 +00:00
ehouse
066c3de9a7 add to gtk version a quick -F option to use new skip-confirm feature 2009-11-08 17:25:19 +00:00
ehouse
a13e1d6488 add util_clearTimer, implement on all platforms, and call when closing
comms to fix crash on Wince when timer fired after comms had been
deleted.  The closure stored and passed in was no longer a valid ptr.
2009-09-21 12:49:08 +00:00
ehouse
1da25307e5 Display relay state on board, horizontal scoreboard mode only for now. 2009-09-20 18:45:25 +00:00
ehouse
18e9301e87 rename Cookie to Invite, a change that may change. Rename everywhere
in clients but not in relay where cookie is too pervasive.  (There are
no code changes in this checkin.)
2009-09-14 03:11:11 +00:00
ehouse
6c4b991566 Modify comms and games APIs so single struct of callbacks is passed
instead of multiple callbacks; add callback called when relay state
changes; adapt linux and palm clients to new API.  (Wince changes
pending.)
2009-09-12 21:39:13 +00:00
ehouse
6827ab5d88 Unify signal handlers that do same thing; clean memory leaks and a
double-dispose.
2009-08-30 15:23:05 +00:00
ehouse
4c523b628c Make slow-robot work for curses client too. 2009-07-10 05:04:04 +00:00
ehouse
184a154c52 New feature, meant for testing relay, makes robot skip random number
of seconds within specified range before making a move.  Working only
on gtk so far, and will probably never be used other than on linux
clients.
2009-07-09 12:43:51 +00:00
ehouse
669e423ca8 Use new dict API to get rid of XP_UCHAR4 type, replacing with const XP_UCHAR*. 2009-04-07 04:23:56 +00:00
ehouse
2838f421a5 fix a couple of null ptr exceptions 2009-04-05 23:48:33 +00:00
ehouse
de4c57e740 include strerror output in logging when socket read fails 2009-03-08 19:56:01 +00:00
ehouse
aa48b4c3ed plug memory leak by closing relay socket when quitting 2009-02-28 19:19:42 +00:00
ehouse
3f01c9129e Lots of changes to make gtk version better test with relay: make
possible to start without specifying comms params, to switch roles
and/or number of players when starting new game; clean up dialogs,
esp. use notebook widget to have tab switch between comms types.
2009-02-28 18:52:44 +00:00
ehouse
46cb6c2955 fix assertion on exit: nuke mempool after everything it contains; call
gtk_main_quit rather than gtk_exit() so can exit from main()
2009-02-28 16:31:03 +00:00
ehouse
80b3425b5b log size of incoming packets 2009-02-07 18:15:17 +00:00
ehouse
c672fcfafd Make it possible to run same binary against relay with relay heartbeat
and direct with comms heartbeat.  This mostly means changing ifdefs.
2009-02-01 15:50:58 +00:00
ehouse
7158ef3802 Cleanup; add sms example to usage() 2009-01-05 02:11:13 +00:00
ehouse
342674276a Cleanup to build with relay enabled; don't enable any network features
if STANDALONE_ONLY is defined.
2009-01-03 23:56:20 +00:00
ehouse
cefd69d8b3 Since there's now a flag indicating whether to show the value of a
tile, make value unsigned.  Adjust/fix platforms.  Add cmdline flag to
linux apps for hiding values.
2008-12-29 03:09:35 +00:00
ehouse
1755267d55 Add support to gtk app for tranport over "sms", with files containing
base64-encoded data as the messages.  Make necessary changes to comms.
This is the foundation for doing real SMS transport on handhelds.
Currently a full robot game works for two gtk clients provided the
server is launched first.
2008-12-29 01:35:29 +00:00
ehouse
b24f3d66a7 fix warning when DEBUG not defined 2008-11-22 17:14:08 +00:00
ehouse
5cb97bf636 New Ubuntu has a stricter compiler... 2008-11-06 03:16:09 +00:00
ehouse
e30c72c829 make -q option take number of seconds to pause before quitting 2008-10-26 15:33:21 +00:00
ehouse
9b17c20117 gtk/ncurses support for Rem: focus and showing remaining tiles. Also
rewrite gtkask to use gtk_message_dialog and add sigint handler.
2008-10-24 09:07:30 +00:00
ehouse
f021964213 fix ncurses version so it can save games and read them back in: make existing gtk code run on both. 2008-09-18 03:46:27 +00:00
ehouse
ad52e63ff0 separate UI-specific code so that a non-UI linux library can be compiled, e.g. for use with a toolkit not gtk or ncurses 2008-06-30 03:39:27 +00:00
ehouse
bbfdeb6bf8 Draw tiles hanging a bit below board when hidden to allow testing of
common case on wince devices.
2008-06-07 23:03:47 +00:00
ehouse
c6da605b56 add missing error message 2008-05-24 16:08:13 +00:00
ehouse
5502c3ef8b Trying to give smartphone users way to use keypad to move tiles to
board.  Enabling key-to-text works, but constants to turn it off
aren't in cegcc.  So for b2 add a quick hack where 1 means first tile
in tray, 7 means last (rightmost).  Enable and test on gtk.
2008-05-11 20:29:43 +00:00
ehouse
ff254fcef4 add ability to scroll the board by dragging it. add new method
util_altKeyDown to allow user to choose between scrolling board and
dragging the hint rect when both are possible.  add adjustYOffset;
make it and board_setYOffset more tolerant of out-of-bounds inputs and
use that to simplify calling code.
2008-04-08 03:55:53 +00:00
ehouse
75ab88565d implement util_yOffsetChange; increase pen timer to half second. 2008-03-27 04:12:16 +00:00
ehouse
a3bc875191 Fix errors, all in debug-only code, flagged by __attribute__ format addition. 2008-03-11 12:24:23 +00:00
ehouse
f30dd17e00 rename constants to begin with GTK so they're unique. 2008-03-10 00:51:20 +00:00
ehouse
0b1f4b8f0a merge with drag_n_drop branch: apply patch generated with this command on that branch: svn diff -r 2080:2087 2008-03-08 23:16:21 +00:00
ehouse
6e9e5b5c99 Fix to compile and run standalone 2008-01-19 16:03:53 +00:00
ehouse
5457ea1b59 replace all __FUNCTION__ with __func__ 2007-12-02 19:13:25 +00:00
ehouse
a560c9f8a8 Add files forgotten with last checkin; add additional parameter to
addListener so listeners can be removed on reset.
2007-11-28 03:59:26 +00:00
ehouse
e1d5632a7b Re-add direct-via-ip transport, and implement for linux in order to
better test heartbeats.  Fix so can play against Palm over BT.
Assertions failing on Linux when reset, but it's otherwise done.
2007-11-26 02:58:25 +00:00
ehouse
4c8cf98d24 Add and set a compile-time option so comms will set a periodic timer
and use it to send and check for heartbeats over any transport.
Caller must supply a reset proc which is called when heartbeat hasn't
been received in too long.  No changes required to comms protocol, but
that means the heartbeat interval is fixed at compile time: can't be
negotiated, and the two ends had better agree.  Currently tested with
linux host and PalmOS guest, where only the first heartbeat failure is
recovered from.  So there's some debugging to be done still.
2007-11-18 23:43:27 +00:00
ehouse
880254c17f Fix tray hanging below main window; draw pending tiles white-on-black as on other platforms. 2007-10-24 12:46:15 +00:00
ehouse
dd7a5c8104 type name change only 2007-05-26 14:14:01 +00:00
ehouse
3f111c5657 name change only: Connectedness becomes DeviceRole 2007-02-02 08:34:37 +00:00
ehouse
7ed3ad89b7 Remove assert that's firing; don't inval_all from util_yOffsetChange:
that blocks testing common inval code.
2007-01-21 23:00:52 +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
593980817f Clean up for non-keyboard and non-keyboard-nav cases. Wince is the
latter: make it compile again.
2007-01-07 01:01:20 +00:00
ehouse
098a2ec5c4 Use new keydown/up APIs from linux, and add key support and drawing
changes to implement keyboard navigation/focus in gtk port.
2007-01-06 17:46:02 +00:00
ehouse
cac0fd94d7 Use new top-level focus drawing model, and new API indicating whether
key handled.
2006-11-14 06:47:50 +00:00
ehouse
4ccddbd93f add a done button 2006-11-13 02:02:15 +00:00
ehouse
2945a120f9 resend_all when a socket connects. This is the strategy needed with
Palm where apps quit and reopen connections many times during a game.
2006-11-11 22:44:31 +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
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
9137eff9fa Largely untested changes to allow BT in ncurses mode, centered around
integrating sockets into poll fdset; move relay and bt globals out of
a union so can test if in use without knowing current connection method.
2006-09-19 03:39:08 +00:00
ehouse
4479cf530d Get rid of separate accept thread, instead integrating listening
socket into main event loop (poll underneath).  Works for gtk; still
debugging ncurses.
2006-09-10 19:01:06 +00:00
ehouse
c27abcd486 Attempt to listen for connections on a separate thread so connected
game could disconnect and reconnect, but still need work on adding a
socket to the main thread's io queue from a different thread.
2006-09-08 07:23:19 +00:00
ehouse
fb87fd31d2 Start adding bt support to linux port. Required removing assumptions
that all connectivity was with relay and over streaming sockets (since
BT is using l2cap's datagram-style sockets.)  With this checkin, a full
robot-vs-robot game is possible with palm as host and linux as client.
Linux as host isn't started yet.
2006-08-26 21:15:20 +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
968dcf2835 removed a param from board_handlePenUp 2006-06-27 06:31:36 +00:00
ehouse
a4ac6f9ff4 call server_do after gameinfo dialog returns in case a player has
become a robot.
2006-06-14 06:22:21 +00:00
ehouse
b80808bc57 Support new tri-part enabled type; add "game info" dialog/menu to test
read-only side; support new attributes for column head and nplayers
label; hide labels as well as controls that go with them.
2006-06-10 05:50:27 +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
912d221b1c Replace overlap param with nHidden to give more flexibility in
creating situations where board must be scrolled.
2006-05-17 06:10:24 +00:00
ehouse
e98ef5b962 move scrollbar into its own box so it doesn't force buttons to be over-tall 2006-05-14 15:26:21 +00:00
ehouse
ba1aefcd49 make tray hide button toggle hidden state 2006-05-12 07:59:21 +00:00
ehouse
7297ab4be8 fix layout for vertical scoreboard option 2006-05-09 12:31:41 +00:00
ehouse
3a4c5dfff6 catch up with API change 2006-05-09 04:04:56 +00:00
ehouse
447af498a2 fix warning 2006-02-18 06:35:48 +00:00