Backend

Name

Backend -- 

Synopsis




GdkGCValuesMask (*HexDrawFuncGdk)           (GdkDrawable *drawable,
                                             GdkGC *gc,
                                             HexData *data,
                                             gint x,
                                             gint y);
HexData*    hex_data_new_from_gdk_pixbuf    (GdkPixbuf *pixbuf);
HexOverlay* hex_overlay_new_from_gdk_pixbuf (GdkPixbuf *pixbuf,
                                             gint x_offset,
                                             gint y_offset,
                                             guint hex_width);

GdkBitmap*  hex_get_mask_from_width_gdk     (guint width);
GdkRegion*  hex_get_region_from_width_gdk   (guint width);
G_CONST_RETURN GdkBitmap* hex_get_mask_from_width_cached_gdk
                                            (guint width);
G_CONST_RETURN GdkRegion* hex_get_region_from_width_cached_gdk
                                            (guint width);

void        hex_draw_data_gdk               (GdkDrawable *drawable,
                                             GdkGC *gc,
                                             HexData *hex,
                                             gint x,
                                             gint y);
void        hex_draw_border_gdk             (GdkDrawable *drawable,
                                             GdkGC *gc,
                                             guint width,
                                             gint x,
                                             gint y,
                                             HexDirection dir);
void        hex_draw_list_gdk               (GdkDrawable *drawable,
                                             GdkGC *gc,
                                             HexList *list,
                                             gint x,
                                             gint y);
GdkPixmap*  hex_grid_get_gdk_pixmap         (HexGrid *grid,
                                             GdkWindow *window,
                                             GdkColormap *colormap,
                                             gint pixmap_depth,
                                             gint x,
                                             gint y);

struct      HexEvent;

Description

Details

HexDrawFuncGdk ()

GdkGCValuesMask (*HexDrawFuncGdk)           (GdkDrawable *drawable,
                                             GdkGC *gc,
                                             HexData *data,
                                             gint x,
                                             gint y);

The prototype for the draw function passed to hex_data_new().

drawable :

A GdkDrawable

gc :

a GdkGC. The clip mask for this gc blocks any drawing outside the hex but within the hex's bounding rectangle. Drawing outside the bounding rectangle may cause problems, however.

data :

The HexData to draw

x :

The position of the left side of the hex on the target

y :

The position of the top of the hex on the target

Returns :

A GdkGCValuesMask indicating which parts of gc have been changed.


hex_data_new_from_gdk_pixbuf ()

HexData*    hex_data_new_from_gdk_pixbuf    (GdkPixbuf *pixbuf);

Creates a new HexData from a GdkPixbuf.

pixbuf :

A GdkPixbuf containing the data. This must have the aspect ratio given by HEX_HEIGHT().

Returns :

a newly created HexData


hex_overlay_new_from_gdk_pixbuf ()

HexOverlay* hex_overlay_new_from_gdk_pixbuf (GdkPixbuf *pixbuf,
                                             gint x_offset,
                                             gint y_offset,
                                             guint hex_width);

A HexOverlay is a means of placing an image on a HexGrid by breaking it into several HexData objects.

pixbuf :

A pixbuf which will span one or more hexes.

x_offset :

The offset in pixels from the top of the upper left hex to the top of the pixbuf

y_offset :

The offset in pixels from the left side of the upper left hex to the left side of the pixbuf

hex_width :

The width of the hexes that will be generated

Returns :

a newly created HexOverlay


hex_get_mask_from_width_gdk ()

GdkBitmap*  hex_get_mask_from_width_gdk     (guint width);

get a hexagonal mask

width :

The width of the hex. Its height is given by HEX_HEIGHT().

Returns :

a GdkBitmap with the pixels inside the hex set


hex_get_region_from_width_gdk ()

GdkRegion*  hex_get_region_from_width_gdk   (guint width);

get a hexagonal region

width :

The width of the hex. Its height is given by HEX_HEIGHT().

Returns :

a GdkRegion describing the area inside the hex


hex_get_mask_from_width_cached_gdk ()

G_CONST_RETURN GdkBitmap* hex_get_mask_from_width_cached_gdk
                                            (guint width);

Get a cached hexagonal mask. If width is 0, the cache is flushed and NULL is returned.

width :

The width of the hex. Its height is given by HEX_HEIGHT().

Returns :

A GdkBitmap with the pixels inside the hex set. This bitmap is cached, and should not be altered by the calling routine. There is no need to unref this bitmap when you are through using it.


hex_get_region_from_width_cached_gdk ()

G_CONST_RETURN GdkRegion* hex_get_region_from_width_cached_gdk
                                            (guint width);

Get a cached hexagonal region. If width is 0, the cache is flushed and NULL is returned.

width :

The width of the hex. Its height is given by HEX_HEIGHT().

Returns :

A GdkRegion describing the area inside the hex. This region is cached, and should not be altered by the calling routine. There is no need to destroy this region when you are through using it.


hex_draw_data_gdk ()

void        hex_draw_data_gdk               (GdkDrawable *drawable,
                                             GdkGC *gc,
                                             HexData *hex,
                                             gint x,
                                             gint y);

Draws the HexData to a GdkDrawable

drawable :

the destination GdkDrawable

gc :

a GdkGC

hex :

the HexData to draw

x :

The x coordinate of the left corner of the HexData

y :

The y coordinate of the top edge of the HexData


hex_draw_border_gdk ()

void        hex_draw_border_gdk             (GdkDrawable *drawable,
                                             GdkGC *gc,
                                             guint width,
                                             gint x,
                                             gint y,
                                             HexDirection dir);

Draws the border of a hex to a GdkDrawable using the foreground color.

drawable :

the destination GdkDrawable

gc :

a GdkGC

width :

The width of the hex for which to draw a border. The height of the hex is given by HEX_HEIGHT().

x :

The x coordinate of the left corner of the hex.

y :

The y coordinate of the top edge of the hex.

dir :

Which sides of the border to draw. To draw all sides, use HEX_DIRECTION_MASK.


hex_draw_list_gdk ()

void        hex_draw_list_gdk               (GdkDrawable *drawable,
                                             GdkGC *gc,
                                             HexList *list,
                                             gint x,
                                             gint y);

Draws a HexList, with the lowest depth on the bottom and the highest on top (painter's algorithm).

drawable :

a GdkDrawable to draw to

gc :

a GdkGC

list :

a HexList. An empty list can be specified by passing NULL.

x :

the pixel location of the top of the hex

y :

the pixel location of the left corner of the hex


hex_grid_get_gdk_pixmap ()

GdkPixmap*  hex_grid_get_gdk_pixmap         (HexGrid *grid,
                                             GdkWindow *window,
                                             GdkColormap *colormap,
                                             gint pixmap_depth,
                                             gint x,
                                             gint y);

Gets a pixmap to which the tiles at location (x, y) are drawn. These pixmaps are cached internally.

grid :

a HexGrid

window :

a GdkWindow. Can be NULL if both colormap and pixmap_depth are given

colormap :

the GdkColormap for the pixmap. If NULL, the colormap of window is used

pixmap_depth :

the depth of the pixmap in bit planes. If <= 0, the depth of window is used

x :

the x position of a hex

y :

the y position of a hex

Returns :

a GdkPixmap to which the tiles at location (x, y) are drawn


struct HexEvent

struct HexEvent
{
    gint           x, y;  /* Pixel coordinates relative to grid */
    GdkEvent      *event;
    HexDisplayGtk *source;
};

A structure containing a GdkEvent and the coordinates of the hex it happened in.

gint x

The x coordinate of the hex where the event happened.

gint y

The y coordinate of the hex where the event happened.

GdkEvent *event

A GdkEvent

HexDisplayGtk *source

The HexDisplayGtk that received the event.