Struct

IpuzStyle

Description [src]

struct IpuzStyle {
  /* No available fields */
}

A struct that defines how a cell is should be visually styled.

Styles can either be anonymous and be defined on a per-cell basis, or they can be named and have a style_name associated with them. When they’re named, they are defined at the IpuzPuzzle level and can apply to multiple cells.

The ipuz spec doesn’t strongly define how the style should be rendered. Some latitude is given to implementations to interpret and render the style as is appropriate to their context.

Usage:

Here’s an example of putting a circle behind a specific cell.

static void
circle_cell (IpuzCrossword *puzzle,
             IpuzCellCoord *coord)
{
  g_autoptr (IpuzStyle) style = NULL;
  IpuzCell *cell;

  cell = ipuz_crossword_get_cell (IPUZ_CROSSWORD (puzzle), coord);

  style = ipuz_style_new ();
  ipuz_style_set_shapebg (style, IPUZ_STYLE_SHAPE_CIRCLE);
  ipuz_cell_set_style (style);
}

And here’s an example of setting a global style to set a background color:

static void
set_global_style_on_cell (IpuzPuzzle *puzzle,
                          IpuzCell   *cell)
{
  g_autoptr (IpuzStyle) style = NULL;

  // Create the global style
  style = ipuz_style_new ();
  ipuz_style_set_bg_color (style, "#f8e45c");
  ipuz_style_set_style_name (style, "yellow-bg");
  ipuz_puzzle_set_style (puzzle, "yellow-bg", style);

  // Set a cell.
  ipuz_cell_set_style_name (cell, style, "yellow-bg");
 }

Please see the ipuz spec for more details on these concepts.

Constructors

ipuz_style_new
No description available.

ipuz_style_new_from_json
No description available.

Functions

ipuz_style_side_opposite
No description available.

Instance methods

ipuz_style_build
No description available.

ipuz_style_copy
No description available.

ipuz_style_equal
No description available.

ipuz_style_foreach_mark

Calls func on each mark that is explicitly set on style. For each mark, it passes in the label at that position.

ipuz_style_get_barred
No description available.

ipuz_style_get_bg_color
No description available.

ipuz_style_get_border
No description available.

ipuz_style_get_border_color
No description available.

ipuz_style_get_dashed
No description available.

ipuz_style_get_divided
No description available.

ipuz_style_get_dotted
No description available.

ipuz_style_get_equal
No description available.

ipuz_style_get_greaterthan
No description available.

ipuz_style_get_highlight
No description available.

ipuz_style_get_image_url
No description available.

ipuz_style_get_imagebg_url
No description available.

ipuz_style_get_label
No description available.

ipuz_style_get_lessthan
No description available.

ipuz_style_get_named
No description available.

ipuz_style_get_shapebg
No description available.

ipuz_style_get_style_name
No description available.

ipuz_style_get_text_color
No description available.

ipuz_style_is_empty

Returns #true if style doesn’t have anything set, and makes no changes to the rendering of a cell it’s associated with.

ipuz_style_ref
No description available.

ipuz_style_set_barred
No description available.

ipuz_style_set_bg_color
No description available.

ipuz_style_set_border
No description available.

ipuz_style_set_border_color
No description available.

ipuz_style_set_dashed
No description available.

ipuz_style_set_divided
No description available.

ipuz_style_set_dotted
No description available.

ipuz_style_set_equal
No description available.

ipuz_style_set_greaterthan
No description available.

ipuz_style_set_highlight
No description available.

ipuz_style_set_image_url
No description available.

ipuz_style_set_imagebg_url
No description available.

ipuz_style_set_label
No description available.

ipuz_style_set_lessthan
No description available.

ipuz_style_set_named
No description available.

ipuz_style_set_shapebg
No description available.

ipuz_style_set_style_name
No description available.

ipuz_style_set_text_color
No description available.

ipuz_style_unref
No description available.