+rack_tile_position (int i, int *x, int *y)
+{
+ guess_tile_position (i, x, y);
+ *y += (LETTER_SIZE + LETTER_PAD);
+}
+
+typedef enum dict_paint_cursor_show
+{
+ DICT_PAINT_CURSOR_SHOW_FOUND,
+ DICT_PAINT_CURSOR_SHOW_UNFOUND_BLANKS,
+ DICT_PAINT_CURSOR_SHOW_ALL
+} dict_paint_cursor_show_t;
+
+typedef struct _dict_paint_cursor
+{
+ cairo_t *cr;
+ int line_height;
+ int x;
+ int y;
+ int max_column_width;
+ int max_y;
+ dict_paint_cursor_show_t show;
+} dict_paint_cursor_t;
+
+static void
+dict_paint_action (void *closure, char *word, dict_entry_t *entry)
+{
+ dict_paint_cursor_t *cursor = closure;
+ cairo_t *cr = cursor->cr;
+ double new_x, new_y;
+ int found, show_blanks = FALSE;
+
+ if (strlen (word) < 3)
+ return;
+
+ found = *entry & RACK_DICT_ENTRY_FOUND;
+
+ cairo_set_source_rgb (cr, 0, 0, 0); /* black */
+
+ switch (cursor->show) {
+ case DICT_PAINT_CURSOR_SHOW_FOUND:
+ if (! found)
+ return;
+ break;
+ case DICT_PAINT_CURSOR_SHOW_UNFOUND_BLANKS:
+ if (found)
+ return;
+ show_blanks = TRUE;
+ break;
+ case DICT_PAINT_CURSOR_SHOW_ALL:
+ if (! found)
+ cairo_set_source_rgb (cr, 1, 0, 0); /* red */
+ break;
+ }
+
+ /* Don't bother displaying unfound obscure words. */
+ if (*entry & RACK_DICT_ENTRY_OBSCURE) {
+ if (! found)
+ return;
+ cairo_set_source_rgb (cr, 0, 1, 0); /* green */
+ }
+
+ cairo_move_to (cr, cursor->x, cursor->y);
+ if (show_blanks) {
+ int i, length = strlen (word);
+ for (i = 0; i < length; i++)
+ cairo_show_text (cr, "_");
+ } else {
+ cairo_show_text (cr, word);
+ }
+ cairo_get_current_point (cr, &new_x, &new_y);
+ if (new_x > cursor->max_column_width)
+ cursor->max_column_width = new_x;
+ cursor->y += cursor->line_height;
+ if (cursor->y > cursor->max_y) {
+ cursor->x = cursor->max_column_width + cursor->line_height / 2;
+ cursor->y = cursor->line_height;
+ }
+}
+
+#define SOLUTION_FONT_SIZE 12
+#define SOLUTION_LINE_HEIGHT (1.5 * SOLUTION_FONT_SIZE)
+
+static void
+dict_paint (cairo_t *cr, void *closure, double width, double height)