HexDisplayGtk

Name

HexDisplayGtk -- A Display Widget for HexGrid

Synopsis




struct      HexDisplayGtk;
struct      HexDisplayGtkClass;


GtkWidget*  hex_display_gtk_new             (HexGrid *grid);
void        hex_display_gtk_set_grid        (HexDisplayGtk *disp,
                                             HexGrid *grid);
HexGrid*    hex_display_gtk_get_grid        (HexDisplayGtk *disp);
void        hex_display_gtk_center_hex      (HexDisplayGtk *disp,
                                             guint x,
                                             guint y);
GdkEventMask hex_display_gtk_get_hex_events (HexDisplayGtk *disp);
void        hex_display_gtk_set_hex_events  (HexDisplayGtk *disp,
                                             GdkEventMask events);
#define     HEX_DISPLAY_GTK_HEX_EVENT_MASK

Object Hierarchy


  GObject
   +----GtkObject
         +----GtkWidget
               +----GtkDrawingArea
                     +----HexDisplayGtk

Implemented Interfaces

HexDisplayGtk implements AtkImplementorIface.

Signal Prototypes


"hex-event" gboolean    user_function      (HexDisplayGtk *hexdisplaygtk,
                                            GdkEvent *event,
                                            gint arg1,
                                            gint arg2,
                                            gpointer user_data);

Description

A HexDisplayGtk is a GtkWidget which displays a HexGrid. Since most of what it does is react to changes in HexGrid, once you've set the grid there's not much hexmap-specific functionallity.

Details

struct HexDisplayGtk

struct HexDisplayGtk;

A display object which shows some or all of a HexGrid


struct HexDisplayGtkClass

struct HexDisplayGtkClass;

The class structure of a HexDisplayGtk


hex_display_gtk_new ()

GtkWidget*  hex_display_gtk_new             (HexGrid *grid);

create a HexDisplayGtk

grid :

the HexGrid to display. Can be NULL

Returns :

the newly created HexDisplayGtk


hex_display_gtk_set_grid ()

void        hex_display_gtk_set_grid        (HexDisplayGtk *disp,
                                             HexGrid *grid);

set which HexGrid to display

disp :

a HexDisplayGtk

grid :

the HexGrid to display. Can be NULL


hex_display_gtk_get_grid ()

HexGrid*    hex_display_gtk_get_grid        (HexDisplayGtk *disp);

get the currently displayed HexGrid

disp :

a HexDisplayGtk

Returns :

the currently displayed HexGrid. Returns NULL if there is no grid


hex_display_gtk_center_hex ()

void        hex_display_gtk_center_hex      (HexDisplayGtk *disp,
                                             guint x,
                                             guint y);

center the display on the hex (x, y)

disp :

a HexDisplayGtk

x :

the x coordinate of a hex

y :

the y coordinate of a hex


hex_display_gtk_get_hex_events ()

GdkEventMask hex_display_gtk_get_hex_events (HexDisplayGtk *disp);

Returns the events sent by HexObject::event and HexDisplayGtk::hex-event.

disp :

a HexDisplayGtk

Returns :

The event mask


hex_display_gtk_set_hex_events ()

void        hex_display_gtk_set_hex_events  (HexDisplayGtk *disp,
                                             GdkEventMask events);

Sets the events sent by HexObject::event and HexDisplayGtk::hex-event to (events | HEX_DISPLAY_GTK_HEX_EVENT_MASK).

disp :

a HexDisplayGtk

events :

a mask which determines which events are sent


HEX_DISPLAY_GTK_HEX_EVENT_MASK

#define     HEX_DISPLAY_GTK_HEX_EVENT_MASK

A mask indicating which events a HexDisplayGtk is capable of transmitting to HexObject instances

Signals

The "hex-event" signal

gboolean    user_function                  (HexDisplayGtk *hexdisplaygtk,
                                            GdkEvent *event,
                                            gint arg1,
                                            gint arg2,
                                            gpointer user_data);

An event has occured in the hex at (x, y). This function is called after HexObject::event is called for any HexObject in the hex. The events sent are set by hex_display_set_hex_events(). The default is no events, and is in any case restricted to those in HEX_DISPLAY_GTK_HEX_EVENT_MASK. Known bugs: Since the hexes don't have their own windows, the GDK_ENTER_NOTIFY and GDK_LEAVE_NOTIFY events are synthetic. Therefore, GdkEventCrossing::subwindow is not what would be expected (and often NULL), and (FIXME) GdkEventCrossing::focus is probably incorrect in most cases.

hexdisplaygtk :

the object which received the signal.

event :

a GdkEvent

arg1 :

the x coordinate of the hex

arg2 :

the y coordinate of the hex

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop propagation of the event