gcuperiodic.h File Reference

#include <gdk/gdk.h>
#include <gtk/gtk.h>

Go to the source code of this file.

Defines

#define GCU_TYPE_PERIODIC   (gcu_periodic_get_type ())
#define GCU_PERIODIC(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCU_TYPE_PERIODIC, GcuPeriodic))
#define GCU_PERIODIC_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), GCU_TYPE_PERIODIC, GcuPeriodicClass))
#define GCU_IS_PERIODIC(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCU_TYPE_PERIODIC))
#define GCU_IS_PERIODIC_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GCU_TYPE_PERIODIC))
#define GCU_PERIODIC_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GCU_TYPE_PERIODIC, GcuPeriodicClass))

Typedefs

typedef struct _GcuPeriodic GcuPeriodic
typedef struct _GcuPeriodicClass GcuPeriodicClass
typedef void(* GcuPeriodicColorFunc )(int, GdkColor *, gpointer)

Enumerations

enum  GcuPeriodicColorSchemes

Functions

GType gcu_periodic_get_type (void) G_GNUC_CONST
GtkWidget * gcu_periodic_new (void)
guint gcu_periodic_get_element (GcuPeriodic *periodic)
void gcu_periodic_set_element (GcuPeriodic *periodic, guint element)
int gcu_periodic_add_color_scheme (GcuPeriodic *periodic, GcuPeriodicColorFunc func, GtkWidget *extra_widget, gpointer user_data)
void gcu_periodic_set_colors (GcuPeriodic *periodic)


Detailed Description

Declaration of the GcuPeriodic widget.

Definition in file gcuperiodic.h.


Define Documentation

#define GCU_IS_PERIODIC ( obj   )     (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCU_TYPE_PERIODIC))

Returns:
TRUE if obj points to a GcuPeriodic widget, FALSE otherwise.

Definition at line 66 of file gcuperiodic.h.

#define GCU_IS_PERIODIC_CLASS ( klass   )     (G_TYPE_CHECK_CLASS_TYPE ((klass), GCU_TYPE_PERIODIC))

Returns:
TRUE if klass points to a GcuPeriodicClass, FALSE otherwise.

Definition at line 70 of file gcuperiodic.h.

#define GCU_PERIODIC ( obj   )     (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCU_TYPE_PERIODIC, GcuPeriodic))

Casts obj to a GcuPeriodic * pointer.

Returns:
a pointer to the GcuPeriodic * or NULL if obj does not point to a GcuPeriodic widget.

Definition at line 57 of file gcuperiodic.h.

Referenced by main().

#define GCU_PERIODIC_CLASS ( klass   )     (G_TYPE_CHECK_CLASS_CAST ((klass), GCU_TYPE_PERIODIC, GcuPeriodicClass))

Casts klass to a GcuPeriodicClass * pointer.

Returns:
a pointer to the GcuPeriodicClass * or NULL if obj not point to a GcuPeriodicClass.

Definition at line 62 of file gcuperiodic.h.

#define GCU_PERIODIC_GET_CLASS ( obj   )     (G_TYPE_INSTANCE_GET_CLASS ((obj), GCU_TYPE_PERIODIC, GcuPeriodicClass))

Returns:
the GcuPeriodicClass * associated to obj if obj points to a GcuPeriodic widget, NULL otherwise.

Definition at line 75 of file gcuperiodic.h.

#define GCU_TYPE_PERIODIC   (gcu_periodic_get_type ())

Returns:
the GType associated to GcuPeriodic

Definition at line 51 of file gcuperiodic.h.


Typedef Documentation

typedef struct _GcuPeriodic GcuPeriodic

The GcuPeriodic widget.

Definition at line 78 of file gcuperiodic.h.

typedef struct _GcuPeriodicClass GcuPeriodicClass

The GcuPeriodic widget object class.

Definition at line 80 of file gcuperiodic.h.

typedef void(* GcuPeriodicColorFunc)(int, GdkColor *, gpointer)

The callback used for color schemes. It takes three arguments:

  • the atomic number Z.
  • a pointer to the GdkColor structure to be filled by the callback
  • a pointer to user's data.

Definition at line 124 of file gcuperiodic.h.


Enumeration Type Documentation

Predefined coloring scheme used for the buttons when displaying the periodic table of the GcuPeriodic widget. Possible values are:

  • GCU_PERIODIC_COLOR_NONE: the default Gtk theme is used.
  • GCU_PERIODIC_COLOR_DEFAULT: the default color for each element is used as returned by gcu_element_get_default_color. Other values can be added using gcu_periodic_add_color_scheme.

Definition at line 43 of file gcuperiodic.h.


Function Documentation

int gcu_periodic_add_color_scheme ( GcuPeriodic periodic,
GcuPeriodicColorFunc  func,
GtkWidget *  extra_widget,
gpointer  user_data 
)

Parameters:
periodic a GcuPeriodic widget.
func the callback used to get the color for an element in the new color scheme.
extra_widget a widget to be added as a child of periodic.
user_data data to be passed to the func callback.
Using this function and the appropriate callback, the color used for the elements buttons can be changed to depend on any property of the elements.
Returns:
the identifier of the new color scheme.

guint gcu_periodic_get_element ( GcuPeriodic periodic  ) 

gcu_periodic_get_element:

Parameters:
periodic a GcuPeriodic widget
Description: used to get the currently selected element in the periodic table.

Returns: the atomic number of the currently selected element or 0 if none is selected.

GType gcu_periodic_get_type ( void   ) 

Returns:
the GType associated to GcuPeriodic

GtkWidget* gcu_periodic_new ( void   ) 

Returns:
a new GcuPeriodic

Referenced by main().

void gcu_periodic_set_colors ( GcuPeriodic periodic  ) 

Parameters:
periodic a GcuPeriodic widget.
Forces the update of the current color scheme. This is useful when the color scheme depends upon a parameter which has changed.

void gcu_periodic_set_element ( GcuPeriodic periodic,
guint  element 
)

gcu_periodic_set_element:

Parameters:
periodic a GcuPeriodic widget
element the atomic number of the element to select or 0
Description: sets the selected element in the periodic table.


Generated on Fri Sep 24 15:58:42 2010 for The Gnome Chemistry Utils by  doxygen 1.5.9