1
/* ipuz-arrowword.h
2
 *
3
 * Copyright 2022 Jonathan Blandford <jrb@gnome.org>
4
 *
5
 * This library is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU Lesser General Public
7
 * License as published by the Free Software Foundation; either
8
 * version 2.1 of the License, or (at your option) any later version.
9
 *
10
 * This library is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 * Lesser General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU Lesser General Public
16
 * License along with this library; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
18
 *
19
 * SPDX-License-Identifier: (LGPL-2.1-or-later OR MIT)
20
 */
21

            
22
#pragma once
23

            
24
#include <glib-object.h>
25
#include <libipuz/ipuz-crossword.h>
26

            
27
G_BEGIN_DECLS
28

            
29

            
30
#define IPUZ_TYPE_ARROWWORD (ipuz_arrowword_get_type ())
31
3
G_DECLARE_DERIVABLE_TYPE   (IPuzArrowword, ipuz_arrowword, IPUZ, ARROWWORD, IPuzCrossword);
32

            
33

            
34
/* Determines the placement of clues in a cell
35
 */
36
typedef enum
37
{
38
  IPUZ_ARROWWORD_PLACEMENT_FILL,   /* @ Clue fills the cell @ */
39
  IPUZ_ARROWWORD_PLACEMENT_TOP,    /* @ Clue fills the top of the cell @ */
40
  IPUZ_ARROWWORD_PLACEMENT_BOTTOM, /* @ Clue fills the bottom of the cell @ */
41
} IPuzArrowwordPlacement;
42

            
43
/* Direction of the arrow coming out of the cell
44
 */
45
typedef enum
46
{
47
  IPUZ_ARROWWORD_ARROW_NONE,       /* @ Don't draw an arrow @ */
48
  IPUZ_ARROWWORD_ARROW_RIGHT,      /* @ → @ */
49
  IPUZ_ARROWWORD_ARROW_RIGHT_DOWN, /* @ ↴ @ */
50
  IPUZ_ARROWWORD_ARROW_DOWN,       /* @ ↓ @ */
51
  IPUZ_ARROWWORD_ARROW_DOWN_RIGHT, /* @ ↳ @ */
52
  IPUZ_ARROWWORD_ARROW_LEFT_DOWN,  /* @ ↙ @ */
53
  IPUZ_ARROWWORD_ARROW_UP_RIGHT,   /* @ ↱ @ */
54
} IPuzArrowwordArrow;
55

            
56

            
57
typedef void (*IPuzArrowwordForeachFunc) (IPuzArrowword          *arrowword,
58
                                          IPuzClue               *clue,
59
                                          IPuzCellCoord           block_coord,
60
                                          IPuzArrowwordPlacement  placement,
61
                                          IPuzArrowwordArrow      arrow,
62
                                          gpointer                user_data);
63

            
64
typedef struct _IPuzArrowwordClass
65
{
66
  IPuzCrosswordClass parent_class;
67
} IPuzArrowwordClass;
68

            
69

            
70
void ipuz_arrowword_blocks_foreach (IPuzArrowword            *self,
71
                                    IPuzArrowwordForeachFunc  func,
72
                                    gpointer                  data);
73
void ipuz_arrowword_print          (IPuzArrowword            *self);
74

            
75

            
76
G_END_DECLS