1222 Commits

Author SHA1 Message Date
b9dfef7a12 Recompute solutions in Inertia if the user strays from the path. 2015-10-03 17:12:20 +01:00
bda4a963f4 Fix an instance generation hang in Signpost.
Also expand the set of permissible parameters (add 1xN, Nx1 and 2x2).
2015-10-03 17:12:20 +01:00
d442b830e4 Greatly improve and speed up the Filling instance generation. 2015-10-03 17:12:20 +01:00
a55607ff24 Greatly increase the speed of the Filling solver. 2015-10-03 17:12:20 +01:00
79fe68dc57 Towers: allow marking of clues as done with the keyboard 2015-10-03 17:12:20 +01:00
6179e8df56 Allow marking of clues as exhausted in Unequal. 2015-10-03 17:12:20 +01:00
a79fc46951 Display improvements to Range.
Make the grid look a lot less heavy; enhance highlighting of error
clues; highlight enclosed small regions much more prettily.
2015-10-03 17:12:01 +01:00
8889fafb07 Fix a misrendering in Guess.
When the cursor was visible, redrawing after undo-redo or label
toggling or resizing would draw background over the top of the
circular cursor.
2015-10-03 17:08:21 +01:00
5cb91f28ba Fix a memory error in Guess cursor handling. 2015-10-03 16:59:10 +01:00
ea8da331e3 Cancel dragging in Pearl by pressing Escape or Backspace. 2015-10-03 16:59:10 +01:00
bf8ff09a84 Change Pearl's cursor logic.
Keyboard dragging while holding Control now moves the cursor to the
target square. Shift-Control-arrowkey performs the previous behavior
of Control-arrowkey.
2015-10-03 16:59:04 +01:00
d64a79e2b8 Refactor Pearl's mark_in_direction, and invert a parameter. 2015-10-03 16:59:04 +01:00
8e35087e09 Refactor modifier handling in Pearl's cursor code. 2015-10-03 16:59:04 +01:00
11a394f69b Add more keyboard controls to Slant. 2015-10-03 16:59:04 +01:00
ebf31f52b0 Slant: hide keyboard cursor when using the mouse. 2015-10-03 16:59:04 +01:00
e59f820383 Rectangles: cancel keyboard drag with Escape. 2015-10-03 16:59:04 +01:00
c469bd285c Filling: enable keyboard-driven cursor dragging mode. 2015-10-03 16:59:04 +01:00
d5f7c4f871 Range: add pencil marks to squares by Shift-cursor keys. 2015-10-03 16:58:50 +01:00
7478275c8b Pattern: color multiple squares with Ctrl- or Shift-cursor keys. 2015-10-03 16:58:24 +01:00
9e1a7d87cd Add game_text_format to Tents.
Replaces an inactive stub implementation.
2015-10-03 16:58:18 +01:00
051ab1701e Add game_text_format to Pattern. 2015-10-03 16:58:18 +01:00
d0f88aafa4 Add game_text_format to Inertia. 2015-10-03 16:58:18 +01:00
e4d5b11bd8 Add game_text_format to Flip. 2015-10-03 16:58:18 +01:00
7543082f26 Add game_text_format to Pearl. 2015-10-03 16:58:18 +01:00
02434a6ed1 Add game_text_format to Dominosa. 2015-10-03 16:58:18 +01:00
dc688b1f23 Unequal: stop ignoring keys 'h' and 'm' while cursor active.
At least, so long as 'h' and 'm' are not "numbers".
2015-10-03 16:58:11 +01:00
87b2758b9c Fix a memory leak in Range's find_errors.
Only occurred in invalid instances, such as 3x1:1b when you put a
black in the middle square.
2015-10-03 16:58:05 +01:00
9b1b7e0f3a Don't overallocate colour memory in Loopy. 2015-10-03 16:58:05 +01:00
1380b55b5b Fix segfault in Range's game_text_format.
Occurred on Nx1 puzzles, etc.
2015-10-03 16:58:00 +01:00
c4198948a8 Fix typo in undo key handling.
Now we can undo with both 'u' and 'U', symmetrically with redoing with
both 'r' and 'R'.
2015-10-03 16:57:49 +01:00
6c71b459a6 Include an example of Range's text_format in the comments. 2015-10-03 16:57:49 +01:00
4fb9776d83 Fix a typo in the comments of Pearl.
Each stone can have 2 lines radiating from its centre, not 3.
2015-10-03 16:57:44 +01:00
c0308c9319 Add '-set colorspace RGB' to some icon convert commands.
Its absence was breaking the icon build on Ubuntu 14.04, because you
ask convert to map an image into a specific 16-colour palette, and it
does so and _then_ nonconsensually maps those colours in turn through
a colourspace transformation you didn't ask for, causing icon.pl to
fail an assertion when it finds an RGB value not in the palette.
2015-10-03 16:07:20 +01:00
9df80d7587 GTK 3 port: arrange configure.ac support for GTK 2/3 detection.
GTK 3 is the default, falling back to GTK 2 if 3 isn't available; you
can also say --with-gtk=2 to force GTK 2.
2015-10-03 16:07:20 +01:00
41cc7c868f GTK 3 port: don't turn off drawing area double buffering.
I think I did this in GTK2 on the basis that our server-side cache
pixmap was double-buffering enough for us - any puzzle which erased a
big area with a background rectangle and then redrew over the top of
it would do so only on the off-screen pixmap, and the updates would
only be copied to the visible window after it was all done.

In GTK3, I don't think there's any need - this is all the usual way
things are done anyway, as far as I can see. So I've turned this call
back off, at least until I hear of a reason why I need it again.
2015-10-03 16:07:20 +01:00
1b2e4d525f GTK 3 port: change API functions for widget sizing.
set_usize is deprecated, and get_preferred_size is the GTK 3 thing we
should use in place of size_request.
2015-10-03 16:07:20 +01:00
90b73ebcb7 GTK 3 port: use GtkBox directly, not GtkHBox and GtkVBox.
I've done this by #defining the old names in terms of the new ones,
because the old ones are still more concise!
2015-10-03 16:07:19 +01:00
2fb189cc36 GTK 3 port: be prepared not to use GtkStock.
GTK 3 has deprecated it in favour of just making you specify fixed
strings as button labels, which seems like a step backwards to me but
there we go.
2015-10-03 16:07:19 +01:00
88b38f5168 GTK 3 port: use GdkRGBA for the window background colour.
Suits our internal API better, anyway, with RGB components being
floats ranging from 0 to 1.
2015-10-03 16:07:19 +01:00
d6210656b8 GTK 3 port: stop getting default bg colour from the window style.
GTK3 window styles don't reliably provide one, so we have to fall back
to just making one up.
2015-10-03 16:07:19 +01:00
4e1cc65701 GTK 3 port: condition out the complicated window resize code.
In GTK 2, we had a big pile of horrible code to deal with the fact
that it's very hard to open a window in such a way as to make it easy
to resize smaller as well as bigger.

Essentially, we'd open the window with the drawing area's minimum size
request set to the desired _initial_ window size; then we'd wait until
GTK had finished creating other window components (menu bar, status
line) and the window's size allocation had settled down, and finally
reduce the size request to the real minimum size so that now the
window was resizable in both directions. This also involved some
deliberate checking of the Ubuntu Unity GTK extension which steals the
menu bar and put it elsewhere (see commit 8f8333a35), to avoid us
waiting forever for a menu bar that wasn't going to show up.

But in GTK3, this has all become actually sensible! All we now have to
do is to set the window's geometry hints to indicate the drawing area
itself as the base widget (probably a good plan anyway), and then we
can set the initial size using gtk_window_set_default_geometry() and
resize it later using gtk_window_resize_to_geometry(). So now we can
completely condition out all of the previous horrors, and consider
them to be legacy GTK2 compatibility code only. Phew.
2015-10-03 16:07:18 +01:00
37232c3c30 GTK 3 port: provide a 'draw' handler.
This is what GTK 3 uses in place of 'expose_event'. Also I've arranged
here for my internal USE_CAIRO_WITHOUT_PIXMAP setting to be enabled in
GTK3, as well as in GTK2 with deprecated functions disabled.
2015-10-03 16:07:04 +01:00
62c6312982 GTK 3 port: use GtkGrid as an alternative to GtkTable.
This also involves setting some "hexpand" properties on the widgets
contained in the GtkGrid, to achieve effects which GtkTable did by
setting flags in gtk_table_attach.
2015-10-03 16:07:04 +01:00
64d0a70e13 GTK 3 prep: use g_timeout_add, not gtk_timeout_add. 2015-10-03 16:07:04 +01:00
3d0d54e3b4 GTK 3 prep: use GTK instead of GDK window-icon functions.
We now build cleanly with -DGDK_DISABLE_DEPRECATED.
2015-10-03 16:07:04 +01:00
fd7882fb45 GTK 3 prep: make the server-side backing pixmap optional.
When GDK_DISABLE_DEPRECATED is defined, we now don't have fe->pixmap;
instead we just maintain our client-side window contents in fe->image,
and draw from there directly to the window in the expose handler.
2015-10-03 16:07:04 +01:00
07906104a2 GTK 3 prep: use gtk_radio_menu_item_get_group().
Replaces the previous deprecated spelling. We now build cleanly with
-DGTK_DISABLE_DEPRECATED.
2015-10-03 16:07:04 +01:00
2c1b00086d GTK 3 prep: use GtkComboBox for drop-down lists.
The previous GtkOptionMenu was long since deprecated.
2015-10-03 16:07:04 +01:00
71c7bcd981 GTK 3 prep: use the glib names for base object types. 2015-10-03 16:07:04 +01:00
0dc2fd1ea3 GTK 3 prep: use GTK_KEY_* constants. 2015-10-03 16:07:04 +01:00