#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) |
Declaration of the GcuPeriodic widget.
Definition in file gcuperiodic.h.
#define GCU_IS_PERIODIC | ( | obj | ) | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCU_TYPE_PERIODIC)) |
Definition at line 66 of file gcuperiodic.h.
Referenced by gcu_periodic_get_element(), and gcu_periodic_set_element().
#define GCU_IS_PERIODIC_CLASS | ( | klass | ) | (G_TYPE_CHECK_CLASS_TYPE ((klass), GCU_TYPE_PERIODIC)) |
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.
Definition at line 57 of file gcuperiodic.h.
Referenced by gcu_combo_periodic_get_element(), gcu_combo_periodic_set_element(), and main().
#define GCU_PERIODIC_CLASS | ( | klass | ) | (G_TYPE_CHECK_CLASS_CAST ((klass), GCU_TYPE_PERIODIC, GcuPeriodicClass)) |
Casts klass to a GcuPeriodicClass * pointer.
Definition at line 62 of file gcuperiodic.h.
#define GCU_PERIODIC_GET_CLASS | ( | obj | ) | (G_TYPE_INSTANCE_GET_CLASS ((obj), GCU_TYPE_PERIODIC, GcuPeriodicClass)) |
Definition at line 75 of file gcuperiodic.h.
#define GCU_TYPE_PERIODIC (gcu_periodic_get_type ()) |
Definition at line 51 of file gcuperiodic.h.
Referenced by gcu_periodic_new().
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:
Definition at line 124 of file gcuperiodic.h.
Predefined coloring scheme used for the buttons when displaying the periodic table of the GcuPeriodic widget. Possible values are:
Definition at line 43 of file gcuperiodic.h.
int gcu_periodic_add_color_scheme | ( | GcuPeriodic * | periodic, | |
GcuPeriodicColorFunc | func, | |||
GtkWidget * | extra_widget, | |||
gpointer | user_data | |||
) |
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.
Definition at line 433 of file gcuperiodic.c.
guint gcu_periodic_get_element | ( | GcuPeriodic * | periodic | ) |
gcu_periodic_get_element:
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.
Definition at line 271 of file gcuperiodic.c.
References GCU_IS_PERIODIC.
GType gcu_periodic_get_type | ( | void | ) |
Definition at line 109 of file gcuperiodic.c.
GtkWidget* gcu_periodic_new | ( | void | ) |
Definition at line 226 of file gcuperiodic.c.
References GCU_TYPE_PERIODIC.
void gcu_periodic_set_colors | ( | GcuPeriodic * | periodic | ) |
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.
Definition at line 358 of file gcuperiodic.c.
References gcu_element_get_default_color().
void gcu_periodic_set_element | ( | GcuPeriodic * | periodic, | |
guint | element | |||
) |
gcu_periodic_set_element:
periodic | a GcuPeriodic widget | |
element | the atomic number of the element to select or 0 |
Description: sets the selected element in the periodic table.
Definition at line 277 of file gcuperiodic.c.
References GCU_IS_PERIODIC.