+rack_tile_position (int i, int *x, int *y)
+{
+ guess_tile_position (i, x, y);
+ *y += (LETTER_SIZE + LETTER_PAD);
+}
+
+typedef struct _dict_paint_cursor
+{
+ cairo_t *cr;
+ int line_height;
+ int x;
+ int y;
+ int max_column_width;
+ int max_y;
+ gboolean show_all;
+} 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;
+
+ if (strlen (word) < 3)
+ return;
+
+ cairo_move_to (cr, cursor->x, cursor->y);
+ if (*entry & RACK_DICT_ENTRY_FOUND || cursor->show_all) {
+ if (*entry & RACK_DICT_ENTRY_FOUND)
+ cairo_set_source_rgb (cr, 0, 0, 0); /* black */
+ else
+ cairo_set_source_rgb (cr, 1, 0, 0); /* red */
+ cairo_show_text (cr, word);
+ } else {
+ int i, length = strlen (word);
+ for (i = 0; i < length; i++)
+ cairo_show_text (cr, "_");
+ }
+ 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)