69#include <libxml/xmlreader.h>
72 {
"X",
i18n(
"Unknown"), 0, 0},
73 {
"H",
i18n(
"Hydrogen"), 1, 1.008},
74 {
"He",
i18n(
"Helium"), 2, 4.003},
75 {
"Li",
i18n(
"Lithium"), 3, 6.94},
76 {
"Be",
i18n(
"Beryllium"), 4, 9.012},
77 {
"B",
i18n(
"Boron"), 5, 10.81},
78 {
"C",
i18n(
"Carbon"), 6, 12.011},
79 {
"N",
i18n(
"Nitrogen"), 7, 14.007},
80 {
"O",
i18n(
"Oxygen"), 8, 15.999},
81 {
"F",
i18n(
"Fluorine"), 9, 18.998},
82 {
"Ne",
i18n(
"Neon"), 10, 20.18},
83 {
"Na",
i18n(
"Sodium"), 11, 22.99},
84 {
"Mg",
i18n(
"Magnesium"), 12, 24.305},
85 {
"Al",
i18n(
"Aluminium"), 13, 26.982},
86 {
"Si",
i18n(
"Silicon"), 14, 28.085},
87 {
"P",
i18n(
"Phosphorus"), 15, 30.974},
88 {
"S",
i18n(
"Sulfur"), 16, 32.06},
89 {
"Cl",
i18n(
"Chlorine"), 17, 35.45},
90 {
"Ar",
i18n(
"Argon"), 18, 39.948},
91 {
"K",
i18n(
"Potassium"), 19, 39.098},
92 {
"Ca",
i18n(
"Calcium"), 20, 40.078},
93 {
"Sc",
i18n(
"Scandium"), 21, 44.956},
94 {
"Ti",
i18n(
"Titanium"), 22, 47.867},
95 {
"V",
i18n(
"Vanadium"), 23, 50.942},
96 {
"Cr",
i18n(
"Chromium"), 24, 51.996},
97 {
"Mn",
i18n(
"Manganese"), 25, 54.938},
98 {
"Fe",
i18n(
"Iron"), 26, 55.845},
99 {
"Co",
i18n(
"Cobalt"), 27, 58.933},
100 {
"Ni",
i18n(
"Nickel"), 28, 58.693},
101 {
"Cu",
i18n(
"Copper"), 29, 63.546},
102 {
"Zn",
i18n(
"Zinc"), 30, 65.38},
103 {
"Ga",
i18n(
"Gallium"), 31, 69.723},
104 {
"Ge",
i18n(
"Germanium"), 32, 72.63},
105 {
"As",
i18n(
"Arsenic"), 33, 74.922},
106 {
"Se",
i18n(
"Selenium"), 34, 78.971},
107 {
"Br",
i18n(
"Bromine"), 35, 79.904},
108 {
"Kr",
i18n(
"Krypton"), 36, 83.798},
109 {
"Rb",
i18n(
"Rubidium"), 37, 85.468},
110 {
"Sr",
i18n(
"Strontium"), 38, 87.62},
111 {
"Y",
i18n(
"Yttrium"), 39, 88.906},
112 {
"Zr",
i18n(
"Zirconium"), 40, 91.224},
113 {
"Nb",
i18n(
"Niobium"), 41, 92.906},
114 {
"Mo",
i18n(
"Molybdenum"), 42, 95.95},
115 {
"Tc",
i18n(
"Technetium"), 43, 98},
116 {
"Ru",
i18n(
"Ruthenium"), 44, 101.07},
117 {
"Rh",
i18n(
"Rhodium"), 45, 102.906},
118 {
"Pd",
i18n(
"Palladium"), 46, 106.42},
119 {
"Ag",
i18n(
"Silver"), 47, 107.868},
120 {
"Cd",
i18n(
"Cadmium"), 48, 112.414},
121 {
"In",
i18n(
"Indium"), 49, 114.818},
122 {
"Sn",
i18n(
"Tin"), 50, 118.71},
123 {
"Sb",
i18n(
"Antimony"), 51, 121.76},
124 {
"Te",
i18n(
"Tellurium"), 52, 127.6},
125 {
"I",
i18n(
"Iodine"), 53, 126.904},
126 {
"Xe",
i18n(
"Xenon"), 54, 131.293},
127 {
"Cs",
i18n(
"Caesium"), 55, 132.905},
128 {
"Ba",
i18n(
"Barium"), 56, 137.327},
129 {
"La",
i18n(
"Lanthanum"), 57, 138.905},
130 {
"Ce",
i18n(
"Cerium"), 58, 140.116},
131 {
"Pr",
i18n(
"Praseodymium"), 59, 140.908},
132 {
"Nd",
i18n(
"Neodymium"), 60, 144.242},
133 {
"Pm",
i18n(
"Promethium"), 61, 145},
134 {
"Sm",
i18n(
"Samarium"), 62, 150.36},
135 {
"Eu",
i18n(
"Europium"), 63, 151.964},
136 {
"Gd",
i18n(
"Gadolinium"), 64, 157.25},
137 {
"Tb",
i18n(
"Terbium"), 65, 158.925},
138 {
"Dy",
i18n(
"Dysprosium"), 66, 162.5},
139 {
"Ho",
i18n(
"Holmium"), 67, 164.93},
140 {
"Er",
i18n(
"Erbium"), 68, 167.259},
141 {
"Tm",
i18n(
"Thulium"), 69, 168.934},
142 {
"Yb",
i18n(
"Ytterbium"), 70, 173.045},
143 {
"Lu",
i18n(
"Lutetium"), 71, 174.967},
144 {
"Hf",
i18n(
"Hafnium"), 72, 178.49},
145 {
"Ta",
i18n(
"Tantalum"), 73, 180.948},
146 {
"W",
i18n(
"Tungsten"), 74, 183.84},
147 {
"Re",
i18n(
"Rhenium"), 75, 186.207},
148 {
"Os",
i18n(
"Osmium"), 76, 190.23},
149 {
"Ir",
i18n(
"Iridium"), 77, 192.217},
150 {
"Pt",
i18n(
"Platinum"), 78, 195.084},
151 {
"Au",
i18n(
"Gold"), 79, 196.967},
152 {
"Hg",
i18n(
"Mercury"), 80, 200.592},
153 {
"Tl",
i18n(
"Thallium"), 81, 204.38},
154 {
"Pb",
i18n(
"Lead"), 82, 207.2},
155 {
"Bi",
i18n(
"Bismuth"), 83, 208.98},
156 {
"Po",
i18n(
"Polonium"), 84, 209},
157 {
"At",
i18n(
"Astatine"), 85, 210},
158 {
"Rn",
i18n(
"Radon"), 86, 222},
159 {
"Fr",
i18n(
"Francium"), 87, 223},
160 {
"Ra",
i18n(
"Radium"), 88, 226},
161 {
"Ac",
i18n(
"Actinium"), 89, 227},
162 {
"Th",
i18n(
"Thorium"), 90, 232.038},
163 {
"Pa",
i18n(
"Protactinium"), 91, 231.036},
164 {
"U",
i18n(
"Uranium"), 92, 238.029},
165 {
"Np",
i18n(
"Neptunium"), 93, 237},
166 {
"Pu",
i18n(
"Plutonium"), 94, 244},
167 {
"Am",
i18n(
"Americium"), 95, 243},
168 {
"Cm",
i18n(
"Curium"), 96, 247},
169 {
"Bk",
i18n(
"Berkelium"), 97, 247},
170 {
"Cf",
i18n(
"Californium"), 98, 251},
171 {
"Es",
i18n(
"Einsteinium"), 99, 252},
172 {
"Fm",
i18n(
"Fermium"), 100, 257},
173 {
"Md",
i18n(
"Mendelevium"), 101, 258},
174 {
"No",
i18n(
"Nobelium"), 102, 258},
175 {
"Lr",
i18n(
"Lawrencium"), 103, 262},
176 {
"Rf",
i18n(
"Rutherfordium"), 104, 267},
177 {
"Db",
i18n(
"Dubnium"), 105, 268},
178 {
"Sg",
i18n(
"Seaborgium"), 106, 269},
179 {
"Bh",
i18n(
"Bohrium"), 107, 270},
180 {
"Hs",
i18n(
"Hassium"), 108, 277},
181 {
"Mt",
i18n(
"Meitnerium"), 109, 278},
182 {
"Ds",
i18n(
"Darmstadtium"), 110, 281},
183 {
"Rg",
i18n(
"Roentgenium"), 111, 282},
184 {
"Cn",
i18n(
"Copernicium"), 112, 285},
185 {
"Nh",
i18n(
"Nihonium"), 113, 286},
186 {
"Fl",
i18n(
"Flerovium"), 114, 289},
187 {
"Mc",
i18n(
"Moscovium"), 115, 289},
188 {
"Lv",
i18n(
"Livermorium"), 116, 293},
189 {
"Ts",
i18n(
"Tennessine"), 117, 294},
190 {
"Og",
i18n(
"Oganesson"), 118, 294},
191 {
"D",
i18n(
"Deuterium"), 1, 2.014000}};
194 {
i18n(
"Atom"), NULL, -1, 0 },
201 { NULL,
"S", 16, 1 },
202 { NULL,
"Cl", 17, 1 },
203 { NULL,
i18n(
"Other ..."), -1, 1 },
204 {
i18n(
"Library"), NULL, -1, 0 },
205 { NULL,
"H<sub>2</sub>O", -1, 3 },
206 { NULL,
"CH<sub>4</sub>", -1, 5 },
207 { NULL,
i18n(
"Toluene"), -1, 15 },
208 { NULL,
"Cp", -1, 10 },
209 { NULL,
"C<sub>60</sub>", -1, 60},
210 { NULL,
i18n(
"Ni-Phthalocyanine"), -1, 57 },
211 { NULL,
i18n(
"More ..."), -1, -1 },
212 { NULL, NULL, -1, 0 }};
225 i18n(
"Carboxylic acids"),
226 i18n(
"Cyclic alkanes"),
227 i18n(
"Cyclic alkenes"),
231 i18n(
"Heterocyclics"),
237 i18n(
"Sugars (Linears)"),
238 i18n(
"Sugars (Cyclics)"),
271extern void gtk_window_change_gdk_visual (GtkWidget * win);
276extern G_MODULE_EXPORT
void on_realize (GtkGLArea * area, gpointer data);
277extern xmlNodePtr
findnode (xmlNodePtr startnode,
char * nname);
308 for (i=0; i<120; i++)
326 xmlFreeTextReader(reader);
342 gchar * buffer = NULL;
344 int inilen = strlen(init);
345 int oldlen = strlen(key);
346 int newlen = (
rep) ? strlen(
rep) : 0;
349 p = strstr(init, key);
350 if (! p)
return g_strdup(init);
352 buffer = g_malloc0 ((inilen+newlen-oldlen+1)*
sizeof*buffer);
356 strncat(buffer, init, p - init);
359 if (
rep) strcat(buffer,
rep);
362 strcat(buffer, p+oldlen);
377 gchar * str_a, * str_b;
379 str_b = g_strdup_printf (
"%s", init);
380 while (g_strcmp0 (str_a, str_b))
383 str_b = g_strdup_printf (
"%s", str_a);
421 xmlTextReaderPtr reader;
422 xmlNodePtr racine, name_node, chem_node;
423 xmlNodePtr n_node, at_node, sp_node, coord_node;
424 xmlNodePtr spec_node, lab_node, lot_node, pbc_node;
432 reader = xmlReaderForFile(
filetoread, NULL, 0);
434 racine = xmlDocGetRootElement(doc);
436 name_node =
findnode (racine -> children,
"names");
438 n_node =
findnode (name_node -> children,
"library-name");
440 content = xmlNodeGetContent(n_node);
441 lib_proj -> name = g_strdup_printf (
"%s", content);
444 n_node =
findnode (name_node -> children,
"iupac-name");
447 content = xmlNodeGetContent(n_node);
448 other_name[0] = g_strdup_printf (
"%s", content);
451 n_node =
findnode (name_node -> children,
"other-names");
453 n_node = n_node -> children;
454 for (name_node = n_node; name_node &&
o_names < 5; name_node = name_node->next)
456 if (name_node -> type == XML_ELEMENT_NODE)
458 content = xmlNodeGetContent(name_node);
464 chem_node =
findnode(racine -> children,
"chemistry");
466 at_node =
findnode (chem_node -> children,
"atoms");
468 content = xmlNodeGetContent(at_node);
472 sp_node =
findnode (chem_node -> children,
"species");
474 spec_node = sp_node -> properties -> children;
476 content = xmlNodeGetContent(spec_node);
481 lab_node = sp_node -> children;
486 lab_node =
findnode (lab_node,
"label");
488 content = xmlNodeGetContent(lab_node);
491 xspec = lab_node -> properties;
495 lot_node = xspec -> children;
497 if (g_strcmp0 (
"num",(
char *)xspec -> name) == 0)
499 content = xmlNodeGetContent(lot_node);
507 xspec = xspec -> next;
509 lab_node = lab_node -> next;
513 at_node =
findnode (racine -> children,
"coordinates");
515 coord_node = at_node -> children;
517 for (i=0; i<
lib_proj -> natomes; i++)
519 coord_node =
findnode (coord_node,
"atom");
521 xspec = coord_node -> properties;
525 lot_node = xspec -> children;
527 content = xmlNodeGetContent(lot_node);
528 if (g_strcmp0 (
"x",(
char *)xspec -> name) == 0)
532 else if (g_strcmp0 (
"y",(
char *)xspec -> name) == 0)
536 else if (g_strcmp0 (
"z",(
char *)xspec -> name) == 0)
540 else if (g_strcmp0 (
"sp",(
char *)xspec -> name) == 0)
546 xspec = xspec -> next;
548 coord_node = coord_node -> next;
550 pbc_node =
findnode (racine -> children,
"lattice");
551 if (pbc_node != NULL)
556 xmlFreeTextReader(reader);
572 xmlTextReaderPtr reader;
573 const xmlChar sml[8]=
"scl-xml";
575 xmlNodePtr racine, node;
579 reader = xmlReaderForFile(
filetoread, NULL, 0);
587 if (doc == NULL)
return NULL;
588 racine = xmlDocGetRootElement(doc);
589 if (g_strcmp0 ((
char *)(racine -> name), (
char *)sml) != 0)
594 node = racine -> children;
596 cdata = xmlNodeGetContent(node);
597 if (g_strcmp0 ((gchar *)cdata,
family_list[fam]) != 0)
604 node =
findnode (racine -> children,
"names");
610 node =
findnode (node -> children,
"library-name");
616 cdata = xmlNodeGetContent(node);
618 xmlFreeTextReader(reader);
620 return (gchar *)cdata;
636 if (g_strcmp0 (str, _(
family_list[i])) == 0)
return i;
654 for(j=i+1;j<num_f;j++)
658 str = g_strdup_printf (
"%s",
mol_name[i]);
660 mol_name[j] = g_strdup_printf (
"%s", str);
687 HANDLE hFind = FindFirstFile (libwin32, & ffd);
688 if (hFind != INVALID_HANDLE_VALUE)
690 if (ffd.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY)
692 str = g_strdup_printf (
"%s\\%s", libdir, (
char *)ffd.cFileName);
696 while (FindNextFile(hFind, &ffd) != 0)
698 if (ffd.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY)
700 str = g_strdup_printf (
"%s\\%s", libdir, (
char *)ffd.cFileName);
714 while ((dir = readdir(d)) != NULL)
716 if (dir -> d_type == DT_REG)
718 str = g_strdup_printf (
"%s/%s", libdir, dir -> d_name);
732 hFind = FindFirstFile (libwin32, & ffd);
733 if (hFind != INVALID_HANDLE_VALUE)
735 if (ffd.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY)
737 str = g_strdup_printf (
"%s\\%s", libdir, (
char *)ffd.cFileName);
748 while (FindNextFile(hFind, &ffd) != 0)
750 if (ffd.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY)
752 str = g_strdup_printf (
"%s\\%s", libdir, (
char *)ffd.cFileName);
767 d = opendir (libdir);
770 while ((dir = readdir(d)) != NULL)
772 if (dir -> d_type == DT_REG)
774 str = g_strdup_printf (
"%s/%s", libdir, dir -> d_name);
803 GtkTreeIter mol_level;
814 gtk_list_store_append (store, & mol_level);
815 gtk_list_store_set (store, & mol_level, 0, -(i+1), 1,
mol_name[i], -1);
829 GtkTreeIter family_level;
840 gtk_list_store_append (store, & family_level);
841 gtk_list_store_set (store, & family_level, 0, i, 1, _(
family_list[i]), -1);
856 GtkWidget * grid = gtk_grid_new ();
858 gtk_widget_set_size_request (grid, -1, 200);
859 gtk_grid_set_row_homogeneous (GTK_GRID (grid), TRUE);
860 gtk_grid_set_column_homogeneous (GTK_GRID (grid), TRUE);
861 gtk_grid_set_row_spacing (GTK_GRID (grid), 1);
862 gtk_grid_set_column_spacing (GTK_GRID (grid), 1);
864 gtk_grid_attach (GTK_GRID (grid),
lib_proj -> modelgl ->
plot, 0, 0, 4, 4);
865 gtk_grid_attach (GTK_GRID (grid),
markup_label(_(
"<i>Formula:</i>"), 100, -1, 0.0, 0.5), 5, 1, 3, 1);
879 str = g_strdup_printf (
"%s<sub>%d</sub>", str,
lib_proj ->
chemistry -> nsps[i]);
881 str = g_strdup_printf (
"%s</b>", str);
883 gtk_grid_attach (GTK_GRID (grid),
markup_label(str, 100, -1, 0.0, 0.5), 8, 1, 3, 1);
884 gtk_grid_attach (GTK_GRID (grid),
markup_label(_(
"<i>Molecular mass:</i>"), 100, -1, 0.0, 0.5), 5, 2, 3, 1);
891 str = g_strdup_printf (
"<b>%.3f g/mol</b>", mass);
892 gtk_grid_attach (GTK_GRID (grid),
markup_label(str, 100, -1, 0.0, 0.5), 8, 2, 3, 1);
895 gtk_grid_attach (GTK_GRID (grid),
markup_label(_(
"<i>IUPAC name:</i>"), 100, -1, 0.0, 0.5), 0, 5, 3, 1);
897 gtk_grid_attach (GTK_GRID (grid),
markup_label(str, 100, 30, 0.0, 0.5), 3, 5, 11, 1);
959 lib_proj -> modelgl -> anim -> last ->
img -> quality = 30;
965 gtk_widget_set_size_request (
lib_proj -> modelgl ->
plot, 150, 150);
983G_MODULE_EXPORT
void select_library_data (GtkTreeView * tree_view, GtkTreePath *
path, GtkTreeViewColumn * column, gpointer data)
986 GtkTreeModel *
model = gtk_tree_view_get_model(tree_view);
992 gtk_tree_model_get_value (
model, &
row, 1, & vbl);
993 int i = (int)g_value_get_int (&
val);
1004 the_molecule = g_strdup_printf (
"%s", (
char *)g_value_get_string (& vbl));
1021G_MODULE_EXPORT
void set_library_markup (GtkTreeViewColumn *
col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data)
1037 GtkWidget * scrol =
create_scroll (NULL, 150, 300, GTK_SHADOW_ETCHED_IN);
1038 GtkTreeViewColumn * datacol;
1039 GtkCellRenderer * datacel;
1040 GtkWidget * dataview = gtk_tree_view_new_with_model (GTK_TREE_MODEL(store));
1041 datacel = gtk_cell_renderer_text_new ();
1042 datacol = gtk_tree_view_column_new_with_attributes (name, datacel,
"text", 1, NULL);
1043 gtk_tree_view_column_set_cell_data_func (datacol, datacel,
set_library_markup, NULL, NULL);
1044 gtk_tree_view_append_column(GTK_TREE_VIEW(dataview), datacol);
1045 gtk_tree_view_column_set_alignment (datacol, 0.5);
1046 gtk_tree_view_set_activate_on_single_click (GTK_TREE_VIEW(dataview), TRUE);
1047 g_signal_connect (G_OBJECT(dataview),
"row-activated", G_CALLBACK(
select_library_data), NULL);
1048 g_object_unref (store);
1049 libselect[id] = gtk_tree_view_get_selection (GTK_TREE_VIEW(dataview));
1050 gtk_tree_selection_set_mode (
libselect[
id], GTK_SELECTION_SINGLE);
1069 gboolean done = FALSE;
1073 switch (response_id)
1075 case GTK_RESPONSE_APPLY:
1078 if (this_proj -> modelgl) this_proj -> modelgl -> other_status = 2;
1087 if (this_proj -> modelgl)
1089 vis = (this_proj -> modelgl -> atom_win) ? this_proj -> modelgl -> atom_win -> visible : FALSE;
1097 if (this_proj -> modelgl) this_proj -> modelgl -> nth_copy ++;
1104 if (this_proj -> modelgl)
1106 if (this_proj -> modelgl -> mode ==
EDITION) asearch -> todo[0] = 0;
1127 int nats = this_proj -> natomes;
1129 GtkWidget * lib =
dialogmodal (_(
"Library"), GTK_WINDOW((this_proj -> modelgl) ? this_proj -> modelgl -> win :
MainWindow));
1139 gtk_dialog_add_button (GTK_DIALOG(lib), (asearch ->
action ==
REPLACE) ? _(
"Replace") : _(
"Insert"), GTK_RESPONSE_APPLY);
1144 family_store = gtk_list_store_new (2, G_TYPE_INT, G_TYPE_STRING);
1147 molecule_store = gtk_list_store_new (2, G_TYPE_INT, G_TYPE_STRING);
1159 if (this_proj -> modelgl) this_proj -> modelgl -> nth_copy = 0;
1199 int family[6] = {0, 3, 9, 9, 15, 17};
1200 int molec[6] = {0, 8, 36, 21, 11, 0};
1202 int nats = this_proj -> natomes;
1207 if (this_proj -> modelgl) this_proj -> modelgl -> other_status = 2;
atom_search * remove_search
Binding to the Fortran90 subroutines.
double set_radius_(int *, int *)
gchar * substitute_string(gchar *init, gchar *o_motif, gchar *n_motif)
substitute all patterns in string
integer(kind=c_int) function chemistry()
void close_project(project *to_close)
close a project
double string_to_double(gpointer string)
convert string to double
Global variable declarations Global convenience function declarations Global data structure defin...
void run_this_gtk_dialog(GtkWidget *dial, GCallback handler, gpointer data)
run a GTK (3 and 4) basic GtkDialog
GtkWidget * create_scroll(GtkWidget *box, int dimx, int dimy, int shadow)
create a scroll window
GtkWidget * dialogmodal(gchar *str, GtkWindow *parent)
Create a new dialog modal window.
element_data periodic_table_info[]
chemical_data * active_chem
void set_renderer_markup(GtkTreeModel *mod, GtkTreeIter *iter, GtkCellRenderer *renderer, int col)
set Pango text markup for a GtkCellRenderer
G_MODULE_EXPORT void on_calc_bonds_released(GtkWidget *widg, gpointer data)
compute bonding properties
GtkWidget * dialog_get_content_area(GtkWidget *widg)
prepare GtkWidget to insert content in a GtkDialog window
GtkWidget * markup_label(gchar *text, int dimx, int dimy, float ax, float ay)
create a GtkLabel with pango markup
void add_box_child_start(int orientation, GtkWidget *widg, GtkWidget *child, gboolean expand, gboolean fill, int padding)
Add a GtkWidget in a GtkBox at the initial position.
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
void destroy_this_dialog(GtkDialog *dialog)
destroy a GtkDialog
GtkWidget * create_hbox(int spacing)
create a GtkBox with horizontal orientation
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
void add_container_child(int type, GtkWidget *widg, GtkWidget *child)
Add a GtkWidget into another GtkWidget.
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
void initcutoffs(chemical_data *chem, int species)
initialize bond cutoffs
void show_the_widgets(GtkWidget *widg)
show GtkWidget
project * get_project_by_id(int p)
get project pointer using id number
void update(glwin *view)
update the rendering of the OpenGL window
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
void set_this_style(glwin *view, int style)
set general style for atom(s) and bond(s)
Function declarations for the creation of the OpenGL window.
void init_project(gboolean alloc_box)
initialize a new project
void init_atomes_analysis(project *this_proj, gboolean apply_defaults)
initialize analysis data structures for atomes
Messaging function declarations.
void alloc_proj_data(project *this_proj, int cid)
allocate data
Function declarations for reading atomes project file Function declarations for saving atomes proje...
void active_project_changed(int id)
change the active project
int action_atoms_from_project(project *this_proj, atom_search *asearch, gboolean visible)
apply atom edition action to project (motion, remove, replace, insert, random move)
GtkWidget * lib_preview_box
G_MODULE_EXPORT void on_realize(GtkGLArea *area, gpointer data)
gchar * check_xml_string(gchar *init)
check for, and correct tags in XML string
gchar * family_list[FAMILY]
GtkListStore * family_store
GtkListStore * molecule_store
xmlNodePtr findnode(xmlNodePtr startnode, char *nname)
find XML node
int get_sml_files()
get the library 'Simple chemical library XML' files
gchar * substitute_string(gchar *init, gchar *o_motif, gchar *n_motif)
substitute all patterns in string
double get_z_from_periodic_table(gchar *lab)
get Z from atom label
void fill_molecule_tree(GtkListStore *store)
fill molecule list store
int get_family(gchar *str)
get molecular family id
G_MODULE_EXPORT void set_library_markup(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *mod, GtkTreeIter *iter, gpointer data)
set font markup in the molecular library tree store
void sort_files(int num_f)
sort file(s) by molecular family and name
int sml_preview(const char *filetoread)
retrieve preview information from 'Simple chemical library XML' file
GtkTreeIter first_family_iter
GtkTreeIter first_mol_iter
GtkTreeSelection * libselect[2]
void fill_family_tree(GtkListStore *store)
fill molecular family list store
void prepare_preview(int active, int id, gboolean visible)
prepare library molecule preview
void create_object_from_library(int p)
create object using the molecular library
GtkWidget * lib_preview_plot
gboolean create_3d_model(int p, gboolean load)
int clean_xml_data(xmlDoc *doc, xmlTextReaderPtr reader)
free XML data
GtkWidget * library_tree(GtkListStore *store, int id, gchar *name)
create library tree store widget
int insert_this_project_from_lib(int id, gboolean visible, project *this_proj, atom_search *asearch)
insert object from the library
gchar * replace_markup(char *init, char *key, char *rep)
replace pattern in string
void to_insert_in_project(int stat, int orig, project *this_proj, atom_search *asearch, gboolean visible)
to insert object in project
void insert_preview()
insert preview in library window and visualize
G_MODULE_EXPORT void run_select_from_library(GtkDialog *lib, gint response_id, gpointer data)
select from library - running the dialog
gchar * family_dir[FAMILY]
gchar * open_sml_file(const char *filetoread, int fam)
open 'Simple chemical library XML' file
G_MODULE_EXPORT void select_library_data(GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, gpointer data)
select library element callback
int select_from_library(gboolean visible, project *this_proj, atom_search *asearch)
select object to insert from the library