Hexmap Gtk+ Bindings Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
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; |
GdkGCValuesMask (*HexDrawFuncGdk) (GdkDrawable *drawable, GdkGC *gc, HexData *data, gint x, gint y); |
The prototype for the draw function passed to hex_data_new().
A GdkDrawable
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.
The HexData to draw
The position of the left side of the hex on the target
The position of the top of the hex on the target
A GdkGCValuesMask indicating which parts of gc have been changed.
HexData* hex_data_new_from_gdk_pixbuf (GdkPixbuf *pixbuf); |
Creates a new HexData from a GdkPixbuf.
A GdkPixbuf containing the data. This must have the aspect ratio given by HEX_HEIGHT().
a newly created HexData
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.
A pixbuf which will span one or more hexes.
The offset in pixels from the top of the upper left hex to the top of the pixbuf
The offset in pixels from the left side of the upper left hex to the left side of the pixbuf
The width of the hexes that will be generated
a newly created HexOverlay
GdkBitmap* hex_get_mask_from_width_gdk (guint width); |
get a hexagonal mask
The width of the hex. Its height is given by HEX_HEIGHT().
a GdkBitmap with the pixels inside the hex set
GdkRegion* hex_get_region_from_width_gdk (guint width); |
get a hexagonal region
The width of the hex. Its height is given by HEX_HEIGHT().
a GdkRegion describing the area inside the hex
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.
The width of the hex. Its height is given by HEX_HEIGHT().
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.
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.
The width of the hex. Its height is given by HEX_HEIGHT().
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.
void hex_draw_data_gdk (GdkDrawable *drawable, GdkGC *gc, HexData *hex, gint x, gint y); |
Draws the HexData to a GdkDrawable
the destination GdkDrawable
a GdkGC
the HexData to draw
The x coordinate of the left corner of the HexData
The y coordinate of the top edge of the HexData
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.
the destination GdkDrawable
a GdkGC
The width of the hex for which to draw a border. The height of the hex is given by HEX_HEIGHT().
The x coordinate of the left corner of the hex.
The y coordinate of the top edge of the hex.
Which sides of the border to draw. To draw all sides, use HEX_DIRECTION_MASK.
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).
a GdkDrawable to draw to
a GdkGC
a HexList. An empty list can be specified by passing NULL.
the pixel location of the top of the hex
the pixel location of the left corner of the hex
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.
a HexGrid
a GdkWindow. Can be NULL if both colormap and pixmap_depth are given
the GdkColormap for the pixmap. If NULL, the colormap of window is used
the depth of the pixmap in bit planes. If <= 0, the depth of window is used
the x position of a hex
the y position of a hex
a GdkPixmap to which the tiles at location (x, y) are drawn
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.
The x coordinate of the hex where the event happened.
The y coordinate of the hex where the event happened.
A GdkEvent
The HexDisplayGtk that received the event.