The Gnome Chemistry Utils
0.14.0
|
#include <gdk/gdk.h>
#include <gtk/gtk.h>
Go to the source code of this file.
Macros | |
#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, GdkRGBA *, gpointer) |
Enumerations | |
enum | GcuPeriodicColorSchemes |
enum | GcuPeriodicTipSchemes { GCU_PERIODIC_TIP_NAME, GCU_PERIODIC_TIP_STANDARD } |
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) |
void | gcu_periodic_set_tips (GcuPeriodic *periodic, unsigned scheme) |
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 82 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 86 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 73 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 78 of file gcuperiodic.h.
#define GCU_PERIODIC_GET_CLASS | ( | obj | ) | (G_TYPE_INSTANCE_GET_CLASS ((obj), GCU_TYPE_PERIODIC, GcuPeriodicClass)) |
Definition at line 91 of file gcuperiodic.h.
#define GCU_TYPE_PERIODIC (gcu_periodic_get_type ()) |
Definition at line 67 of file gcuperiodic.h.
typedef struct _GcuPeriodic GcuPeriodic |
The GcuPeriodic widget.
Definition at line 94 of file gcuperiodic.h.
typedef struct _GcuPeriodicClass GcuPeriodicClass |
The GcuPeriodic widget object class.
Definition at line 96 of file gcuperiodic.h.
typedef void(* GcuPeriodicColorFunc)(int, GdkRGBA *, gpointer) |
The callback used for color schemes. It takes three arguments:
Definition at line 140 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.
Predefined tipsg scheme used when the mouse cursor is over an element button.
GCU_PERIODIC_TIP_NAME |
Show the element name in the tips popup. |
GCU_PERIODIC_TIP_STANDARD |
Show the element atomic number, symbol, name, electronic configuration, and atomic weight. |
Definition at line 53 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 399 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 317 of file gcuperiodic.c.
References GCU_IS_PERIODIC.
GType gcu_periodic_get_type | ( | void | ) |
GtkWidget* gcu_periodic_new | ( | void | ) |
Referenced by main().
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 340 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 323 of file gcuperiodic.c.
References GCU_IS_PERIODIC.
void gcu_periodic_set_tips | ( | GcuPeriodic * | periodic, |
unsigned | scheme | ||
) |
periodic | a GcuPeriodic widget. |
scheme | a tips scheme identifier. |
Configures the element buttons tips. scheme must be one of the values defined in the GcuPeriodicTipSchemes enum.
Definition at line 413 of file gcuperiodic.c.
References gcu_element_get_electronic_configuration(), gcu_element_get_name(), gcu_element_get_symbol(), gcu_element_get_weight_as_string(), GCU_PERIODIC_TIP_NAME, and GCU_PERIODIC_TIP_STANDARD.