127#include <libxml/encoding.h>
128#include <libxml/xmlwriter.h>
129#include <libxml/xmlreader.h>
130#include <libxml/parser.h>
132#include <sys/types.h>
141extern xmlNodePtr
findnode (xmlNodePtr startnode,
char * nname);
145extern gchar *
substitute_string (gchar * init, gchar * o_motif, gchar * n_motif);
146extern G_MODULE_EXPORT gboolean
scroll_scale_quality (GtkRange * range, GtkScrollType scroll, gdouble value, gpointer data);
153extern G_MODULE_EXPORT
void box_advanced (GtkWidget * widg, gpointer data);
154extern G_MODULE_EXPORT
void axis_advanced (GtkWidget * widg, gpointer data);
158extern G_MODULE_EXPORT
void scale_quality (GtkRange * range, gpointer data);
165extern GtkWidget *
adv_box (GtkWidget *
box,
char *
lab,
int vspace,
int size,
float xalign);
276gchar *
xml_style_leg[6] = {
"ball_and_stick",
"wireframes",
"spacefilled",
"spheres",
"cylinders",
"dots"};
278gchar *
xml_atom_leg[3] = {
"atoms_radius",
"dot_size",
"sphere_radius"};
279gchar *
xml_bond_leg[3] = {
"bond_radius",
"wireframe_width",
"cylinder_radius"};
295 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"parameter");
296 if (rc < 0)
return 0;
297 rc = xmlTextWriterWriteAttribute(writer, BAD_CAST (
const xmlChar *)
"info", BAD_CAST legend);
298 if (rc < 0)
return 0;
299 rc = xmlTextWriterWriteAttribute (writer, BAD_CAST (
const xmlChar *)
"key", BAD_CAST key);
300 if (rc < 0)
return 0;
303 str = g_strdup_printf (
"%d", did);
304 rc = xmlTextWriterWriteAttribute (writer, BAD_CAST (
const xmlChar *)
"id", BAD_CAST str);
306 if (rc < 0)
return 0;
308 str = g_strdup_printf (
"%f",
col.
red);
309 rc = xmlTextWriterWriteAttribute (writer, BAD_CAST (
const xmlChar *)
"red", BAD_CAST str);
311 if (rc < 0)
return 0;
312 str = g_strdup_printf (
"%f",
col.
green);
313 rc = xmlTextWriterWriteAttribute (writer, BAD_CAST (
const xmlChar *)
"green", BAD_CAST str);
315 if (rc < 0)
return 0;
316 str = g_strdup_printf (
"%f",
col.
blue);
317 rc = xmlTextWriterWriteAttribute (writer, BAD_CAST (
const xmlChar *)
"blue", BAD_CAST str);
319 if (rc < 0)
return 0;
320 str = g_strdup_printf (
"%f",
col.
alpha);
321 rc = xmlTextWriterWriteAttribute (writer, BAD_CAST (
const xmlChar *)
"alpha", BAD_CAST str);
323 if (rc < 0)
return 0;
324 rc = xmlTextWriterEndElement (writer);
325 if (rc < 0)
return 0;
343 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"parameter");
344 if (rc < 0)
return 0;
345 rc = xmlTextWriterWriteAttribute(writer, BAD_CAST (
const xmlChar *)
"info", BAD_CAST legend);
346 if (rc < 0)
return 0;
347 rc = xmlTextWriterWriteAttribute (writer, BAD_CAST (
const xmlChar *)
"key", BAD_CAST key);
348 if (rc < 0)
return 0;
351 str = g_strdup_printf (
"%d", did);
352 rc = xmlTextWriterWriteAttribute (writer, BAD_CAST (
const xmlChar *)
"id", BAD_CAST str);
354 if (rc < 0)
return 0;
356 str = g_strdup_printf (
"%f", data.
x);
357 rc = xmlTextWriterWriteAttribute (writer, BAD_CAST (
const xmlChar *)
"x", BAD_CAST str);
359 if (rc < 0)
return 0;
360 str = g_strdup_printf (
"%f", data.
y);
361 rc = xmlTextWriterWriteAttribute (writer, BAD_CAST (
const xmlChar *)
"y", BAD_CAST str);
363 if (rc < 0)
return 0;
364 str = g_strdup_printf (
"%f", data.
z);
365 rc = xmlTextWriterWriteAttribute (writer, BAD_CAST (
const xmlChar *)
"z", BAD_CAST str);
367 if (rc < 0)
return 0;
368 rc = xmlTextWriterEndElement (writer);
369 if (rc < 0)
return 0;
388 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"parameter");
389 if (rc < 0)
return 0;
390 rc = xmlTextWriterWriteAttribute (writer, BAD_CAST (
const xmlChar *)
"info", BAD_CAST xml_leg);
391 if (rc < 0)
return 0;
392 rc = xmlTextWriterWriteAttribute (writer, BAD_CAST (
const xmlChar *)
"key", BAD_CAST xml_key);
393 if (rc < 0)
return 0;
397 str = g_strdup_printf (
"%d", xml_id);
398 rc = xmlTextWriterWriteAttribute (writer, BAD_CAST (
const xmlChar *)
"id", BAD_CAST (
const xmlChar *)str);
400 if (rc < 0)
return 0;
402 rc = xmlTextWriterWriteFormatString (writer,
"%s", value);
403 if (rc < 0)
return 0;
404 rc = xmlTextWriterEndElement (writer);
405 if (rc < 0)
return 0;
421 if (! CreateDirectory(
ATOMES_CONFIG_DIR, NULL) && GetLastError() != ERROR_ALREADY_EXISTS)
434 xmlTextWriterPtr writer;
436 gchar * xml_delta_num_leg[8] = {
"g(r): number of δr",
"s(q): number of δq",
"s(k): number of δk",
"g(r) FFT: number of δr",
437 "Dij: number of δr [min(Dij)-max(Dij)]",
"Angles distribution: number of δθ [0-180°]",
438 "Spherical harmonics: l(max) in [2-40]",
"MSD: steps between configurations"};
439 gchar * xml_delta_t_leg[2] = {
"MSD: time steps δt",
"MSD: time unit"};
440 gchar * xml_rings_leg[7] = {
"Default search",
441 "Atom(s) to initiate the search from",
442 "Maximum size for a ring",
443 "Maximum number of rings of size n per MD step",
444 "Only search for ABAB rings",
445 "No homopolar bonds in the rings (A-A, B-B ...)",
446 "No homopolar bonds in the connectivity matrix"};
447 gchar * xml_chain_leg[7] = {
"Atom(s) to initiate the search from",
448 "Maximum size for a ring",
449 "Maximum number of rings of size n per MD step",
450 "Only search for AAAA chains",
451 "Only search for ABAB chains",
452 "No homopolar bonds in the chains (A-A, B-B ...)",
453 "Only search for 1-(2)n-1 chains"};
454 gchar * xml_opengl_leg[4] = {
"Default style",
456 "Polyhedra color map",
458 gchar * xml_material_leg[8] = {
"Predefine material",
466 gchar * xml_lightning_leg[7] = {
"Type",
473 gchar * xml_fog_leg[5] = {
"Mode",
478 gchar * xml_model_leg[2] = {
"Show clones",
480 gchar * xml_label_leg[6] = {
"Position",
486 gchar * xml_axis_leg[3] = {
"Legend on x",
492 if (writer == NULL)
return 0;
493 rc = xmlTextWriterSetIndent(writer, 1);
494 if (rc < 0)
return 0;
498 rc = xmlTextWriterStartDocument (writer, NULL,
MY_ENCODING, NULL);
499 if (rc < 0)
return 0;
501 rc = xmlTextWriterWriteComment (writer, (
const xmlChar *)
"atomes preferences XML file");
502 if (rc < 0)
return 0;
504 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"atomes_preferences-xml");
505 if (rc < 0)
return 0;
507 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"analysis");
508 if (rc < 0)
return 0;
509 int i, j, k, l, m, n, o;
514 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"cutoffs");
515 if (rc < 0)
return 0;
525 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"partials");
526 if (rc < 0)
return 0;
530 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"parameter");
531 if (rc < 0)
return 0;
533 rc = xmlTextWriterWriteAttribute(writer, BAD_CAST (
const xmlChar *)
"info", BAD_CAST str);
535 if (rc < 0)
return 0;
536 str = g_strdup_printf (
"%d", tmp_cut -> Z[0]);
537 rc = xmlTextWriterWriteAttribute (writer, BAD_CAST (
const xmlChar *)
"α", BAD_CAST str);
539 if (rc < 0)
return 0;
540 str = g_strdup_printf (
"%d", tmp_cut -> Z[1]);
541 rc = xmlTextWriterWriteAttribute (writer, BAD_CAST (
const xmlChar *)
"β", BAD_CAST str);
543 if (rc < 0)
return 0;
544 str = g_strdup_printf (
"%lf", tmp_cut -> cutoff);
545 rc = xmlTextWriterWriteFormatString (writer,
"%s", str);
547 if (rc < 0)
return 0;
548 rc = xmlTextWriterEndElement (writer);
549 if (rc < 0)
return 0;
550 tmp_cut = tmp_cut -> next;
552 rc = xmlTextWriterEndElement (writer);
553 if (rc < 0)
return 0;
555 rc = xmlTextWriterEndElement (writer);
556 if (rc < 0)
return 0;
592 rc = xmlTextWriterEndElement (writer);
593 if (rc < 0)
return 0;
595 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"opengl");
596 if (rc < 0)
return 0;
606 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"material");
607 if (rc < 0)
return 0;
626 rc = xmlTextWriterEndElement (writer);
627 if (rc < 0)
return 0;
629 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"lightning");
630 if (rc < 0)
return 0;
639 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"light");
640 if (rc < 0)
return 0;
641 str = g_strdup_printf (
"%d", i);
642 rc = xmlTextWriterWriteAttribute (writer, BAD_CAST (
const xmlChar *)
"id", BAD_CAST (
const xmlChar *)str);
644 if (rc < 0)
return 0;
674 rc = xmlTextWriterEndElement (writer);
675 if (rc < 0)
return 0;
679 rc = xmlTextWriterEndElement (writer);
680 if (rc < 0)
return 0;
682 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"fog");
683 if (rc < 0)
return 0;
700 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"parameter");
701 if (rc < 0)
return 0;
702 rc = xmlTextWriterWriteAttribute (writer, BAD_CAST (
const xmlChar *)
"info", BAD_CAST xml_fog_leg[3]);
703 if (rc < 0)
return 0;
704 rc = xmlTextWriterWriteAttribute (writer, BAD_CAST (
const xmlChar *)
"key", BAD_CAST
"fog.depth");
705 if (rc < 0)
return 0;
706 rc = xmlTextWriterWriteAttribute (writer, BAD_CAST (
const xmlChar *)
"id", BAD_CAST
"3");
707 if (rc < 0)
return 0;
709 rc = xmlTextWriterWriteAttribute (writer, BAD_CAST (
const xmlChar *)
"start", BAD_CAST str);
711 if (rc < 0)
return 0;
713 rc = xmlTextWriterWriteAttribute (writer, BAD_CAST (
const xmlChar *)
"end", BAD_CAST str);
715 if (rc < 0)
return 0;
716 rc = xmlTextWriterEndElement (writer);
717 if (rc < 0)
return 0;
722 rc = xmlTextWriterEndElement (writer);
723 if (rc < 0)
return 0;
726 rc = xmlTextWriterEndElement (writer);
727 if (rc < 0)
return 0;
730 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"model");
731 if (rc < 0)
return 0;
747 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"atoms_and_bonds");
748 if (rc < 0)
return 0;
753 gchar * str_a, * str_b;
756 do_atoms = do_bonds = FALSE;
773 if (i != 2 && i != 3 && i != 5)
779 if (do_atoms || do_bonds)
781 rc = xmlTextWriterStartElement (writer, BAD_CAST
xml_style_leg[i]);
782 if (rc < 0)
return 0;
786 k = (j == 0 || j == 2) ? 0 : (j == 1 || j == 4) ? 1 : 2;
799 l = (j == 2) ? 4 : 1;
800 for (m=0; m < l; m++)
805 n = (o && m) ? 5 : n;
809 rc = xmlTextWriterStartElement (writer, BAD_CAST str_a);
811 if (rc < 0)
return 0;
815 str = g_strdup_printf (
"%f", tmp_rad -> rad);
819 tmp_rad = tmp_rad -> next;
821 rc = xmlTextWriterEndElement (writer);
822 if (rc < 0)
return 0;
844 rc = xmlTextWriterStartElement (writer, BAD_CAST str_a);
846 if (rc < 0)
return 0;
850 str = g_strdup_printf (
"%f", tmp_rad -> rad);
854 tmp_rad = tmp_rad -> next;
856 rc = xmlTextWriterEndElement (writer);
857 if (rc < 0)
return 0;
861 rc = xmlTextWriterEndElement (writer);
862 if (rc < 0)
return 0;
867 rc = xmlTextWriterEndElement (writer);
868 if (rc < 0)
return 0;
872 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"labels");
873 if (rc < 0)
return 0;
874 gchar * obj[2]={
"atoms",
"clones"};
877 rc = xmlTextWriterStartElement (writer, BAD_CAST obj[i]);
878 if (rc < 0)
return 0;
902 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"colors");
903 if (rc < 0)
return 0;
915 tmp_col = tmp_col -> next;
918 rc = xmlTextWriterEndElement (writer);
919 if (rc < 0)
return 0;
922 rc = xmlTextWriterEndElement (writer);
923 if (rc < 0)
return 0;
927 rc = xmlTextWriterEndElement (writer);
928 if (rc < 0)
return 0;
934 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"colors");
935 if (rc < 0)
return 0;
940 rc = xmlTextWriterStartElement (writer, BAD_CAST obj[i]);
941 if (rc < 0)
return 0;
947 tmp_col = tmp_col -> next;
949 rc = xmlTextWriterEndElement (writer);
950 if (rc < 0)
return 0;
957 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"box");
958 if (rc < 0)
return 0;
966 rc = xmlTextWriterEndElement (writer);
967 if (rc < 0)
return 0;
971 rc = xmlTextWriterEndElement (writer);
972 if (rc < 0)
return 0;
975 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"view");
976 if (rc < 0)
return 0;
979 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"background");
1006 rc = xmlTextWriterEndElement (writer);
1007 if (rc < 0)
return 0;
1011 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"representation");
1012 if (rc < 0)
return 0;
1044 rc = xmlTextWriterEndElement (writer);
1045 if (rc < 0)
return 0;
1050 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"axis");
1051 if (rc < 0)
return 0;
1074 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"labels");
1075 if (rc < 0)
return 0;
1091 rc = xmlTextWriterEndElement (writer);
1092 if (rc < 0)
return 0;
1103 rc = xmlTextWriterEndElement (writer);
1104 if (rc < 0)
return 0;
1107 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"measures");
1108 if (rc < 0)
return 0;
1109 gchar * m_key[2]={
"standard",
"selection"};
1112 rc = xmlTextWriterStartElement (writer, BAD_CAST m_key[i]);
1113 if (rc < 0)
return 0;
1114 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"labels");
1115 if (rc < 0)
return 0;
1133 rc = xmlTextWriterEndElement (writer);
1134 if (rc < 0)
return 0;
1156 rc = xmlTextWriterEndElement (writer);
1157 if (rc < 0)
return 0;
1160 rc = xmlTextWriterEndElement (writer);
1161 if (rc < 0)
return 0;
1163 rc = xmlTextWriterStartElement (writer, BAD_CAST (
const xmlChar *)
"atom-selections");
1164 if (rc < 0)
return 0;
1170 rc = xmlTextWriterEndElement (writer);
1171 if (rc < 0)
return 0;
1174 rc = xmlTextWriterEndElement (writer);
1175 if (rc < 0)
return 0;
1177 rc = xmlTextWriterEndElement (writer);
1178 if (rc < 0)
return 0;
1180 rc = xmlTextWriterEndDocument (writer);
1181 if (rc < 0)
return 0;
1183 xmlFreeTextWriter (writer);
1198 return (g_strcmp0(content,
"") == 0) ? 0.0 :
string_to_double ((gpointer)content);
1229 cut -> next = g_malloc0(
sizeof*cut);
1237 cut -> Z[0] = bond ->
a;
1238 cut -> Z[1] = bond ->
b;
1242 else if (g_strcmp0(key,
"default_totcut") == 0)
1246 else if (g_strcmp0(key,
"default_num_delta") == 0)
1250 else if (g_strcmp0(key,
"default_delta_t") == 0)
1254 else if (g_strcmp0(key,
"default_rsparam") == 0)
1258 else if (g_strcmp0(key,
"default_csparam") == 0)
1262 else if (g_strcmp0(key,
"default_opengl") == 0)
1266 else if (g_strcmp0(key,
"default_material") == 0)
1272 else if (vid == 6 && vect)
1281 else if (g_strcmp0(key,
"default_lightning") == 0)
1285 else if (g_strcmp0(key,
"light.type") == 0)
1289 else if (g_strcmp0(key,
"light.fix") == 0)
1293 else if (g_strcmp0(key,
"light.direction") == 0 && vect)
1297 else if (g_strcmp0(key,
"light.position") == 0 && vect)
1301 else if (g_strcmp0(key,
"light.intensity") == 0 && vect)
1305 else if (g_strcmp0(key,
"light.attenuation") == 0 && vect)
1309 else if (g_strcmp0(key,
"light.spot") == 0 && vect)
1313 else if (g_strcmp0(key,
"fog.mode") == 0)
1317 else if (g_strcmp0(key,
"fog.type") == 0)
1321 else if (g_strcmp0(key,
"fog.density") == 0)
1325 else if (g_strcmp0(key,
"fog.depth") == 0)
1330 else if (g_strcmp0(key,
"fog.color") == 0 && vect)
1334 else if (g_strcmp0(key,
"default_cell") == 0)
1338 else if (g_strcmp0(key,
"default_clones") == 0)
1342 else if (g_strcmp0(key,
"default_at_rs") == 0)
1347 else if (g_strcmp0(key,
"default_bd_rw") == 0)
1352 else if (g_strcmp0(key,
"default_atomic_rad") == 0)
1357 while (tmp_rad -> next)
1359 tmp_rad = tmp_rad -> next;
1361 tmp_rad -> next = g_malloc0(
sizeof*tmp_rad);
1362 tmp_rad = tmp_rad -> next;
1372 else if (g_strcmp0(key,
"default_bond_rad") == 0)
1377 while (tmp_rad -> next)
1379 tmp_rad = tmp_rad -> next;
1381 tmp_rad -> next = g_malloc0(
sizeof*tmp_rad);
1382 tmp_rad = tmp_rad -> next;
1392 else if (g_strcmp0(key,
"default_label") == 0)
1418 else if (g_strcmp0(key,
"default_label_color") == 0)
1430 while (tmp_col -> next)
1432 tmp_col = tmp_col -> next;
1434 tmp_col -> next = g_malloc0(
sizeof*tmp_col);
1435 tmp_col = tmp_col -> next;
1446 else if (g_strcmp0(key,
"default_font_color") == 0)
1451 else if (g_strcmp0(key,
"default_atom_color") == 0)
1456 while (tmp_col -> next)
1458 tmp_col = tmp_col -> next;
1460 tmp_col -> next = g_malloc0(
sizeof*tmp_col);
1461 tmp_col = tmp_col -> next;
1471 else if (g_strcmp0(key,
"only_label_color") == 0)
1477 else if (g_strcmp0(key,
"default_box") == 0)
1496 else if (g_strcmp0(key,
"default_background") == 0)
1517 else if (g_strcmp0(key,
"default_rep") == 0)
1542 else if (g_strcmp0(key,
"default_axis") == 0)
1557 if (vid == 1 || vid == 4)
1573 else if (g_strcmp0(key,
"axis_legend") == 0)
1577 else if (g_strcmp0(key,
"default_mtilt") == 0)
1581 else if (g_strcmp0(key,
"default_mpattern") == 0)
1585 else if (g_strcmp0(key,
"default_mfactor") == 0)
1589 else if (g_strcmp0(key,
"default_mwidth") == 0)
1593 else if (g_strcmp0(key,
"default_sel_color") == 0)
1612 xmlAttrPtr p_details;
1613 gboolean set_codevar,
set_id;
1614 gboolean set_x, set_y, set_z;
1615 gboolean set_r, set_g, set_b, set_a;
1616 gboolean set_alpha, set_beta;
1624 while (parameter_node)
1626 content = g_strdup_printf (
"%s", xmlNodeGetContent(parameter_node));
1627 p_details = parameter_node -> properties;
1628 set_codevar =
set_id = FALSE;
1629 set_x = set_y = set_z = FALSE;
1630 set_r = set_g = set_b = set_a = FALSE;
1631 set_alpha = set_beta = FALSE;
1636 p_node = p_details -> children;
1639 if (g_strcmp0(
"key",(
char *)p_details -> name) == 0)
1641 key = g_strdup_printf (
"%s", xmlNodeGetContent(p_node));
1644 else if (g_strcmp0(
"id",(
char *)p_details -> name) == 0)
1649 else if (g_strcmp0(
"α",(
char *)p_details -> name) == 0)
1654 else if (g_strcmp0(
"β",(
char *)p_details -> name) == 0)
1659 else if (g_strcmp0(
"x",(
char *)p_details -> name) == 0)
1664 else if (g_strcmp0(
"y",(
char *)p_details -> name) == 0)
1669 else if (g_strcmp0(
"z",(
char *)p_details -> name) == 0)
1674 else if (g_strcmp0(
"start",(
char *)p_details -> name) == 0)
1678 else if (g_strcmp0(
"end",(
char *)p_details -> name) == 0)
1682 else if (g_strcmp0(
"red",(
char *)p_details -> name) == 0)
1687 else if (g_strcmp0(
"green",(
char *)p_details -> name) == 0)
1692 else if (g_strcmp0(
"blue",(
char *)p_details -> name) == 0)
1697 else if (g_strcmp0(
"alpha",(
char *)p_details -> name) == 0)
1703 p_details = p_details -> next;
1706 if ((set_codevar && (
set_id || (set_r && set_g && set_b && set_a))) || (set_alpha && set_beta))
1709 set_parameter (content, key,
id, (set_alpha && set_beta) ? & bond : NULL, (set_x && set_y && set_z) ? & vec : NULL, start, end, (set_r && set_g && set_b && set_a) ? &
col : NULL);
1712 parameter_node = parameter_node -> next;
1713 parameter_node =
findnode (parameter_node,
"parameter");
1726 xmlNodePtr l_node, p_node;
1727 xmlNodePtr parameter_node;
1728 xmlAttrPtr l_details, p_details;
1731 gboolean set_codevar;
1732 gboolean set_lid = FALSE;
1733 gboolean set_x, set_y, set_z;
1736 l_details = light_node -> properties;
1739 l_node = l_details -> children;
1742 if (g_strcmp0(
"id",(
char *)l_details -> name) == 0)
1748 l_details = l_details -> next;
1752 parameter_node =
findnode (light_node -> children,
"parameter");
1753 set_codevar = FALSE;
1754 set_x = set_y = set_z = FALSE;
1755 while (parameter_node)
1757 content = g_strdup_printf (
"%s", xmlNodeGetContent(parameter_node));
1758 p_details = parameter_node -> properties;
1761 p_node = p_details -> children;
1764 if (g_strcmp0(
"key",(
char *)p_details -> name) == 0)
1766 key = g_strdup_printf (
"%s", xmlNodeGetContent(p_node));
1769 else if (g_strcmp0(
"x",(
char *)p_details -> name) == 0)
1774 else if (g_strcmp0(
"y",(
char *)p_details -> name) == 0)
1779 else if (g_strcmp0(
"z",(
char *)p_details -> name) == 0)
1785 p_details = p_details -> next;
1789 set_parameter (content, key, lid, NULL, (set_x && set_y && set_z) ? & vec : NULL, -1.0, -1.0, NULL);
1792 parameter_node = parameter_node -> next;
1793 parameter_node =
findnode (parameter_node,
"parameter");
1808 node =
findnode (preference_node -> children,
"parameter");
1825 i = (style == 0 || style == 2) ? 0 : (style == 1 || style == 4) ? 1 : 2;
1828 k = (style == 2) ? 4 : 1;
1847 i = (style < 2) ? style : 2;
1865 xmlTextReaderPtr reader;
1867 xmlNodePtr node, p_node, l_node, c_node;
1868 const xmlChar aml[22]=
"atomes_preferences-xml";
1876 racine = xmlDocGetRootElement (doc);
1877 if (! g_strcmp0 ((
char *)(racine -> name), (
char *)aml))
1879 node =
findnode(racine -> children,
"analysis");
1882 p_node =
findnode (node -> children,
"cutoffs");
1886 l_node =
findnode(p_node -> children,
"partials");
1894 node =
findnode(racine -> children,
"opengl");
1897 p_node =
findnode (node -> children,
"material");
1902 p_node =
findnode (node -> children,
"lightning");
1906 l_node =
findnode (p_node -> children,
"light");
1910 l_node = l_node -> next;
1911 l_node =
findnode (l_node,
"light");
1914 p_node =
findnode (node -> children,
"fog");
1921 node =
findnode(racine -> children,
"model");
1925 p_node =
findnode(node -> children,
"atoms_and_bonds");
1937 p_node =
findnode(node -> children,
"labels");
1942 l_node =
findnode (p_node -> children, (i) ?
"clones" :
"atoms");
1947 c_node =
findnode(l_node -> children,
"colors");
1955 c_node =
findnode(node -> children,
"colors");
1960 l_node =
findnode (c_node -> children, (i) ?
"clones" :
"atoms");
1968 p_node =
findnode(node -> children,
"box");
1974 node =
findnode(racine -> children,
"view");
1978 p_node =
findnode(node -> children,
"background");
1983 p_node =
findnode(node -> children,
"representation");
1988 p_node =
findnode(node -> children,
"axis");
1992 l_node =
findnode(p_node -> children,
"labels");
1999 c_node =
findnode(p_node -> children,
"colors");
2005 p_node =
findnode(node -> children,
"measures");
2008 l_node =
findnode(p_node -> children,
"standard");
2011 c_node =
findnode(l_node -> children,
"labels");
2019 l_node =
findnode(p_node -> children,
"selection");
2022 c_node =
findnode(l_node -> children,
"labels");
2031 p_node =
findnode(node -> children,
"atom-selections");
2040 xmlFreeTextReader(reader);
2121 for (i=0; i<16; i++)
2170 default_label[i].
font = (i > 2) ? g_strdup_printf (
"FreeMono Bold 18") : g_strdup_printf (
"Sans Bold 12");
2275GtkWidget *
pref_list (gchar * mess[2],
int nelem, gchar * mlist[nelem][2], gchar * end)
2285 for (i=0; i<nelem; i++)
2289 str = g_strdup_printf (
"<b>%s</b>", mlist[i][0]);
2314 i = GPOINTER_TO_INT (data);
2338 int i = GPOINTER_TO_INT (data);
2349 GtkWidget * notebook = gtk_notebook_new ();
2350 gtk_notebook_set_scrollable (GTK_NOTEBOOK(notebook), TRUE);
2351 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(notebook), GTK_POS_TOP);
2353 gchar * info[2] = {
"The <b>View</b> tab regroups representation options",
2354 "which effect apply to the general aspect of the model:"};
2355 gchar * m_list[3][2] = {{
"Representation",
"scene set-up and orientation"},
2356 {
"Axis",
"axis options"},
2357 {
"Tools",
"measures and selections option"}};
2365 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
vbox, gtk_label_new (
"General"));
2370 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
pref_rep_win -> win, gtk_label_new (
"Representation"));
2375 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
pref_axis_win -> win, gtk_label_new (
"Axis"));
2404 GtkWidget * hhbox, * vvbox;
2411 hhbox =
abox (vvbox,
"Color", 0);
2412 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hhbox,
color_button(
tmp_sel_color[i], TRUE, 100, -1, G_CALLBACK(
set_selection_color), GINT_TO_POINTER(i)), FALSE, FALSE, 0);
2417 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
vbox, gtk_label_new (
"Tools"));
2456 int object = GPOINTER_TO_INT(data);
2472 else if (
object < 100)
2494 gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER(
edit_colob), & rgb_col);
2510 int i = GPOINTER_TO_INT(data);
2534 if (! old_list)
return NULL;
2541 tmp_rbd -> Z = tmp_rad -> Z;
2542 tmp_rbd -> rad = tmp_rad -> rad;
2543 if (tmp_rad -> next)
2545 tmp_rbd -> next = g_malloc0(
sizeof*tmp_rbd -> next);
2546 tmp_rbd -> next -> prev = tmp_rbd;
2547 tmp_rbd = tmp_rbd -> next;
2549 tmp_rad = tmp_rad -> next;
2570 if (tmp_rad -> Z ==
z)
2573 return tmp_rad -> rad;
2575 tmp_rad = tmp_rad -> next;
2579 object = -
object - 2;
2581 if (
object == 0 ||
object == 3)
2597 if (
object == 2 ||
object == 7 ||
col)
2605 else if (
object == 1 ||
object == 4 ||
object == 6 ||
object == 9)
2610 else if (
object == 0 ||
object == 3 ||
object == 5 ||
object == 8)
2628 if (! old_list)
return NULL;
2635 tmp_rbd -> Z = tmp_rad -> Z;
2636 tmp_rbd ->
col = tmp_rad ->
col;
2637 if (tmp_rad -> next)
2639 tmp_rbd -> next = g_malloc0(
sizeof*tmp_rbd -> next);
2640 tmp_rbd -> next -> prev = tmp_rbd;
2641 tmp_rbd = tmp_rbd -> next;
2643 tmp_rad = tmp_rad -> next;
2661 if (tmp_col -> Z ==
z)
2664 return tmp_col ->
col;
2666 tmp_col = tmp_col -> next;
2681G_MODULE_EXPORT
void edit_pref (GtkCellRendererText * cell, gchar * path_string, gchar * new_text, gpointer user_data)
2683 int col = GPOINTER_TO_INT(user_data);
2684 GtkTreeModel * pref_model = gtk_tree_view_get_model(GTK_TREE_VIEW(
pref_tree));
2686 gtk_tree_model_get_iter_from_string (pref_model, &
row, path_string);
2689 gtk_tree_model_get (pref_model, &
row, 3, &
z, -1);
2690 gtk_list_store_set (GTK_LIST_STORE(pref_model), &
row,
col+4,
val, -1);
2691 gboolean add_elem = FALSE;
2692 gboolean remove_elem = FALSE;
2694 int col_val[4] = {1, 3, 5, 10};
2702 if (tmp_list -> Z ==
z)
2704 tmp_list -> rad =
val;
2708 if (tmp_list -> next)
2710 if (tmp_list -> prev)
2712 tmp_list -> prev -> next = tmp_list -> next;
2713 tmp_list -> next -> prev = tmp_list -> prev;
2721 else if (tmp_list -> prev)
2739 tmp_list = tmp_list -> next;
2754 if (! tmp_list -> next)
break;
2755 tmp_list = tmp_list -> next;
2757 tmp_list -> next = g_malloc0(
sizeof*tmp_list -> next);
2758 tmp_list -> next -> prev = tmp_list;
2759 tmp_list = tmp_list -> next;
2767 tmp_list -> rad =
val;
2768 gtk_tree_model_get (pref_model, &
row, 0, &
z, -1);
2777 b = (
z -
a * 10) / 5;
2778 c = (
z -
a * 10 -
b * 5) / 3;
2779 d =
z -
a * 10 -
b * 5 -
c * 3;
2781 if (
a ||
col == 3)
z += 10;
2782 if (
b ||
col == 2)
z += 5;
2783 if (
c ||
col == 1)
z += 3;
2784 if (
d ||
col == 0)
z += 1;
2786 gtk_list_store_set (GTK_LIST_STORE(pref_model), &
row, 0,
z, -1);
2788 else if (remove_elem)
2790 gtk_tree_model_get (pref_model, &
row, 0, &
z, -1);
2792 gtk_list_store_set (GTK_LIST_STORE(pref_model), &
row, 0,
z, -1);
2808 int object = GPOINTER_TO_INT (data);
2809 gboolean do_style = (
object < 100) ? TRUE : FALSE;
2810 gboolean do_label = (
object == 1000 ||
object == 1001) ? TRUE : FALSE;
2811 switch (response_id)
2813 case GTK_RESPONSE_APPLY:
2818 object = -
object - 2;
2824 j = (
object == 4 ||
object == 9) ? 4 : 1;
2825 k = (
object < 5) ? 7 : 5;
2826 object =
object - 2;
2857 j = (
object < 0) ? 1 : (
object == 4 ||
object == 9) ? 4 : 1;
2892void color_set_color (GtkTreeViewColumn *
col, GtkCellRenderer * renderer, GtkTreeModel * mod, GtkTreeIter * iter, gpointer data)
2895 gtk_tree_model_get (mod, iter, 3, &
z, -1);
2898 g_object_set (renderer,
"background-rgba", & colo,
"background-set", TRUE, NULL);
2914 int cid = GPOINTER_TO_INT (data);
2916 gtk_tree_model_get (mod, iter, 0, & vid, -1);
2917 gboolean docol = FALSE;
2921 docol = (cid == 0) ? TRUE : FALSE;
2924 docol = (cid == 1) ? TRUE : FALSE;
2927 docol = (cid == 2) ? TRUE : FALSE;
2930 docol = (cid == 3) ? TRUE : FALSE;
2933 docol = (cid == 0 || cid == 1) ? TRUE : FALSE;
2936 docol = (cid == 0 || cid == 2) ? TRUE : FALSE;
2939 docol = (cid == 1 || cid == 2) ? TRUE : FALSE;
2942 docol = (cid == 0 || cid == 3) ? TRUE : FALSE;
2945 docol = (cid == 1 || cid == 3) ? TRUE : FALSE;
2948 docol = (cid == 2 || cid == 3) ? TRUE : FALSE;
2951 docol = (cid != 3) ? TRUE : FALSE;
2954 docol = (cid != 2) ? TRUE : FALSE;
2957 docol = (cid != 1) ? TRUE : FALSE;
2960 docol = (cid != 0) ? TRUE : FALSE;
2979 if (col_a.
red != col_b.
red)
return FALSE;
2980 if (col_a.
green != col_b.
green)
return FALSE;
2981 if (col_a.
blue != col_b.
blue)
return FALSE;
2982 if (col_a.
alpha != col_b.
alpha)
return FALSE;
2995G_MODULE_EXPORT
void run_ac_color (GtkDialog * win, gint response_id, gpointer data)
2997 if (response_id == GTK_RESPONSE_OK)
3000 int i = GPOINTER_TO_INT (data);
3010 if (tmp_list -> Z == i)
3012 tmp_list ->
col = colo;
3015 if (tmp_list -> next)
3017 if (tmp_list -> prev)
3019 tmp_list -> prev -> next = tmp_list -> next;
3020 tmp_list -> next -> prev = tmp_list -> prev;
3028 else if (tmp_list -> prev)
3046 tmp_list = tmp_list -> next;
3060 if (! tmp_list -> next)
break;
3061 tmp_list = tmp_list -> next;
3063 tmp_list -> next = g_malloc0(
sizeof*tmp_list -> next);
3064 tmp_list -> next -> prev = tmp_list;
3065 tmp_list = tmp_list -> next;
3073 tmp_list ->
col = colo;
3090void color_button_event (GtkWidget * widget,
double event_x,
double event_y, guint event_button, gpointer data)
3092 if (event_button == 1)
3094 GtkTreeModel *
model = gtk_tree_view_get_model(GTK_TREE_VIEW(widget));
3096 GtkTreeViewColumn * column;
3100 gtk_tree_view_convert_widget_to_bin_window_coords (GTK_TREE_VIEW(widget), event_x, event_y, & e_x, & e_y);
3101 if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW(widget), e_x, e_y, &
path, & column, & i, & j))
3103 if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW(widget), event_x, event_y, &
path, & column, & i, & j))
3106 if (g_strcmp0(
"Color", gtk_tree_view_column_get_title (column)) == 0)
3111 i = GPOINTER_TO_INT(data);
3112 gchar * obj[2]={
"atom",
"clone"};
3114 gtk_tree_model_get (
model, &
row, 3, &
z, -1);
3117 GtkWidget * win = gtk_color_chooser_dialog_new (str, GTK_WINDOW(
MainWindow));
3118 gtk_window_set_modal (GTK_WINDOW(win), TRUE);
3119 gtk_color_chooser_set_use_alpha (GTK_COLOR_CHOOSER(win), TRUE);
3120 gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER(win), &
col);
3141G_MODULE_EXPORT
void pref_color_button_pressed (GtkGesture * gesture,
int n_press,
double x,
double y, gpointer data)
3144 gtk_gesture_single_get_current_button ((GtkGestureSingle * )gesture), data);
3158 if (event -> type == GDK_BUTTON_PRESS)
3160 GdkEventButton * bevent = (GdkEventButton*)event;
3190 gchar * ats[3]={
"atom(s)",
"dot(s)",
"sphere(s)"};
3191 gchar * dim[3]={
"radius",
"size",
"width"};
3192 gchar * bts[3]={
"bond(s)",
"wireframe(s)",
"cylinder(s)"};
3194 int i, j, k, l, n, m;
3198 gboolean do_style = (
the_object < 100) ? TRUE : FALSE;
3199 gboolean do_label = FALSE;
3206 aid = (aid) > 2 ? aid - 3 : aid;
3208 str = (
the_object < -4) ? g_strdup_printf (
"Edit cloned %s %s", bts[aid], dim[bid]) : g_strdup_printf (
"Edit %s %s", bts[aid], dim[bid]);
3215 aid = (aid == 0 || aid == 2 || aid == 5 || aid == 7) ? 0 : (aid == 1 || aid == 4 || aid == 6 || aid == 9) ? 1 : 2;
3217 str = (
the_object - 2 > 4) ? g_strdup_printf (
"Edit cloned %s %s", ats[aid], dim[bid]) : g_strdup_printf (
"Edit %s %s", ats[aid], dim[bid]);
3227 str = g_strdup_printf (
"Select %s color", (aid) ?
"clone" :
"atom");
3232 str = g_strdup_printf (
"Select %s label color", (aid) ?
"clone" :
"atom");
3242 gtk_window_set_default_size (GTK_WINDOW(win), (num_col == 8) ? 600 : 300, 600);
3244 GType s_type[8] = {G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_DOUBLE, G_TYPE_DOUBLE, G_TYPE_DOUBLE, G_TYPE_DOUBLE};
3245 GType c_type[5] = {G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING};
3246 GtkTreeViewColumn * pref_col[num_col];
3247 GtkCellRenderer * pref_cel[num_col];
3248 GtkTreeSelection * pref_select;
3249 GtkListStore * pref_model;
3253 pref_model = gtk_list_store_newv (num_col, s_type);
3255 j = (num_col == 8) ? 4 : 1;
3274 pref_model = gtk_list_store_newv (num_col, c_type);
3278 for (i=1; i<119; i++)
3281 gtk_list_store_append (pref_model, & elem);
3284 gtk_list_store_set (pref_model, & elem, 0,
user_defined,
3302 gtk_list_store_set (pref_model, & elem, 0, j, -1);
3307 gtk_list_store_set (pref_model, & elem, 0,
user_defined,
3315 pref_tree = gtk_tree_view_new_with_model (GTK_TREE_MODEL(pref_model));
3316 gchar * name[3] = {
"Element",
"Symbol",
"Z"};
3317 gchar * g_name[3] = {
"Radius",
"Size",
"Width"};
3318 gchar * f_name[4] = {
"Covalent [1]",
"Ionic [2]",
"van Der Waals [3]",
"Crystal [4,5]"};
3319 for (i=0; i<num_col; i++)
3321 pref_cel[i] = gtk_cell_renderer_text_new();
3326 g_object_set (pref_cel[i],
"editable", TRUE, NULL);
3327 gtk_cell_renderer_set_alignment (pref_cel[i], 0.5, 0.5);
3328 g_signal_connect (G_OBJECT(pref_cel[i]),
"edited", G_CALLBACK(
edit_pref), GINT_TO_POINTER(i-4));
3329 pref_col[i] = gtk_tree_view_column_new_with_attributes((num_col) == 8 ? f_name[i-4] : g_name[bid], pref_cel[i],
"text", i, NULL);
3334 gtk_cell_renderer_set_alignment (pref_cel[i], 0.5, 0.5);
3335 pref_col[i] = gtk_tree_view_column_new_with_attributes(
"Color", pref_cel[i],
"text", i, NULL);
3336 gtk_tree_view_column_set_cell_data_func (pref_col[i], pref_cel[i],
color_set_color, NULL, NULL);
3341 pref_col[i] = gtk_tree_view_column_new_with_attributes(name[i-1], pref_cel[i],
"text", i, NULL);
3342 gtk_tree_view_column_set_alignment (pref_col[i], 0.5);
3343 gtk_tree_view_column_set_resizable (pref_col[i], TRUE);
3344 gtk_tree_view_column_set_min_width (pref_col[i], 50);
3348 pref_col[i] = gtk_tree_view_column_new_with_attributes(
"", pref_cel[i],
"text", i, NULL);
3349 gtk_tree_view_column_set_visible (pref_col[i], FALSE);
3351 gtk_tree_view_append_column(GTK_TREE_VIEW(
pref_tree), pref_col[i]);
3353 g_object_unref (pref_model);
3354 pref_select = gtk_tree_view_get_selection (GTK_TREE_VIEW(
pref_tree));
3355 gtk_tree_selection_set_mode (pref_select, GTK_SELECTION_SINGLE);
3356 gtk_tree_view_expand_all (GTK_TREE_VIEW(
pref_tree));
3361 add_widget_gesture_and_key_action (
pref_tree,
"pref-context-click", G_CALLBACK(pref_color_button_pressed), GINT_TO_POINTER(aid),
3362 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
3372 gchar * legend={
"\n<sub>[1] B. Cordero and al. <i>Dalton Trans</i>, <b>213</b>:1112 (2008).</sub>\n"
3373 "<sub>[2] Slater. <i>J. Chem. Phys.</i>, <b>41</b>:3199 (1964).</sub>\n"
3374 "<sub>[3] Bondi A. <i>J. Phys. Chem.</i>, <b>68</b>:441 (1964).</sub>\n"
3375 "<sub>[4] R.D. Shannon and C.T. Prewitt <i>Acta Cryst. B</i>, <b>25</b>:925-946 (1969).</sub>\n"
3376 "<sub>[5] R.D. Shannon <i>Acta Cryst. A</i>, <b>23</b>:751-767 (1976).</sub>"};
3385 gchar * info[3] = {
"By default label and species colors are similar,",
"you can modify that using this dialog window.",
"You can also use a single color for all labels:"};
3397 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox,
check_button (
"Use single color", -1, -1,
tmp_label[aid] -> n_colors, G_CALLBACK(
toggled_default_stuff), data), FALSE, FALSE, 30);
3426 int clone = ((
object && style > 2) || (!
object && style > 4)) ? 20 : 0;
3427 int mod = (object) ? -1 : 1;
3428 gboolean over = (! object) ? TRUE : (
object && (style != 2 && style != 5)) ? TRUE : FALSE;
3434 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox,
create_button (
"Edit species related parameters",
IMG_NONE, NULL, -1, -1, GTK_RELIEF_NORMAL, G_CALLBACK(
edit_species_parameters), GINT_TO_POINTER(mod*(style+2))), FALSE, FALSE, 60);
3438 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox,
check_button (
"Override species based parameters", -1, -1, (
object) ?
tmp_o_bd_rw[style] :
tmp_o_at_rs[style], G_CALLBACK(
toggled_default_stuff), GINT_TO_POINTER(mod*(style+2))), FALSE, FALSE, 10);
3451 leg = g_strdup_printf (
"%s", (style == 1 || style == 4) ?
"pts" :
"Å");
3459 leg = g_strdup_printf (
"%s", (style == 1 || style == 6 || style == 4 || style == 9) ?
"pts" :
"Å");
3477 gchar *
object[3]={
"<b>Atom(s)</b>",
"<b>Bond(s)</b>",
"\t<u>Clone(s)</u>"};
3478 gchar * ats[3]={
"tom(s) ",
"ot(s)",
"phere(s)"};
3479 gchar * ha_init[3]={
"A",
"D",
"S"};
3480 gchar * la_init[3]={
"a",
"d",
"s"};
3481 gchar * dim[3]={
"radius",
"size",
"width"};
3482 gchar * bts[3]={
"ond(s)",
"ireframe(s)",
"ylinder(s)"};
3483 gchar * hb_init[3]={
"B",
"W",
"C"};
3484 gchar * lb_init[3]={
"b",
"w",
"c"};
3489 gboolean do_atoms = FALSE;
3490 gboolean do_bonds = FALSE;
3491 if (style == 0 || style == 1 || style == 2 || style == 3 || style == 5)
3495 if (style == 0 || style == 1 || style == 4)
3498 bsid = (style == 4) ? 2 : style;
3502 lid = (style == 3) ? 2 : (style == 1 || style == 5) ? 1 : 0;
3508 str = g_strdup_printf (
"\t%s%s %s", ha_init[lid], ats[lid], dim[(lid != 1) ? 0 : 1]);
3512 str = g_strdup_printf (
"\t\tClone %s%s %s", la_init[lid], ats[lid], dim[(lid != 1) ? 0 : 1]);
3527 str = g_strdup_printf (
"\t%s%s %s", hb_init[bsid], bts[bsid], dim[(bsid != 1) ? 0 : 2]);
3531 str = g_strdup_printf (
"\t\tClone %s%s %s", lb_init[bsid], bts[bsid], dim[(bsid != 1) ? 0 : 2]);
3549 GtkWidget * notebook = gtk_notebook_new ();
3550 gtk_notebook_set_scrollable (GTK_NOTEBOOK(notebook), TRUE);
3551 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(notebook), GTK_POS_TOP);
3555 gchar * info[2] = {
"The <b>Model</b> tab regroups atom(s), bond(s) and clone(s) options",
3556 "which effect apply when the corresponding <b>OpenGL</b> style is used:"};
3557 gchar * m_list[4][2] = {{
"Ball and stick",
"atoms<sup>*</sup> and bonds radii"},
3558 {
"Wireframe",
"dots<sup>**</sup> size and wireframes width"},
3559 {
"Spacefill",
"tabulated parameters"},
3560 {
"Cylinders",
"bonds radii"}};
3563 gchar * other_info[2] = {
"It also provides options to customize atomic label(s),",
"and, the model box, if any:"};
3564 gchar * o_list[2][2] = {{
"Labels",
"atom labels"},
3565 {
"Box",
"model box details"}};
3570 gchar * obj[2] = {
"<b>Atoms</b>",
"<b>Clones</b>"};
3575 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox,
create_button (
"Edit species colors",
IMG_NONE, NULL, -1, -1, GTK_RELIEF_NORMAL, G_CALLBACK(
edit_species_parameters), GINT_TO_POINTER(100+i)), FALSE, FALSE, 30);
3579 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox,
check_button (
"Always show clone(s), if any.", 250, -1,
tmp_clones, G_CALLBACK(
toggled_default_stuff), GINT_TO_POINTER(0)), FALSE, FALSE, 30);
3582 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox,
check_button (
"Always show box, if any.", 250, -1,
tmp_clones, G_CALLBACK(
toggled_default_stuff), GINT_TO_POINTER(1)), FALSE, FALSE, 30);
3586 append_comments (
vbox,
"<sup>*</sup>",
"the same parameters are also used for the <b>spheres</b> style");
3587 append_comments (
vbox,
"<sup>**</sup>",
"the same parameters are also used for the <b>dots</b> style");
3589 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
vbox, gtk_label_new (
"General"));
3593 if (i != 3 && i != 5) gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
style_tab (i), gtk_label_new (
text_styles[i]));
3608 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hhbox,
create_button (
"Adjust color(s)",
IMG_NONE, NULL, 220, -1, GTK_RELIEF_NORMAL, G_CALLBACK(
edit_species_parameters), GINT_TO_POINTER(1000+i)), FALSE, FALSE, 15);
3612 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
vbox, gtk_label_new (
"Labels"));
3616 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
pref_box_win -> win, gtk_label_new (
"Box"));
3632 if (gtk_combo_box_get_active_iter (
box, & iter))
3634 GtkTreeModel *
model = gtk_combo_box_get_model (
box);
3636 gtk_tree_model_get (
model, & iter, 1, & i, -1);
3648 GtkTreeIter iter, iter2;
3649 GtkTreeStore * store;
3651 store = gtk_tree_store_new (2, G_TYPE_STRING, G_TYPE_INT);
3652 gtk_tree_store_append (store, & iter, NULL);
3653 gtk_tree_store_set (store, & iter, 0,
"f(atoms) <sup>*</sup>", 1, 0, -1);
3656 gtk_tree_store_append (store, & iter, NULL);
3657 gtk_tree_store_set (store, & iter, 0,
text_styles[i], 1, i+1, -1);
3662 gtk_tree_store_append (store, & iter2, & iter);
3663 gtk_tree_store_set (store, & iter2, 0,
text_filled[j], 1, -j-1, -1);
3667 return GTK_TREE_MODEL (store);
3682 j = GPOINTER_TO_INT(data);
3700 g_signal_connect (G_OBJECT(combo),
"changed", G_CALLBACK(
set_default_map), GINT_TO_POINTER(obj));
3711 GtkWidget * notebook = gtk_notebook_new ();
3712 gtk_notebook_set_scrollable (GTK_NOTEBOOK(notebook), TRUE);
3713 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(notebook), GTK_POS_TOP);
3727 gchar * info[2] = {
"The <b>OpenGL</b> tab regroups rendering options",
3728 "use it to configure the OpenGL 3D scene:"};
3729 gchar * m_list[3][2] = {{
"Material",
"aspect for atom(s) and bond(s)"},
3730 {
"Lights",
"lightning of the scene"},
3731 {
"Fog",
"atmosphere effects"}};
3732 gchar * end = {
"It also offers to adjust the main visualization style and the color maps"};
3739 combo = gtk_combo_box_new_with_model (
model);
3740 g_object_unref (
model);
3741 GtkCellRenderer * renderer = gtk_cell_renderer_combo_new ();
3742 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, TRUE);
3743 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), renderer,
"text", 0, NULL);
3746 g_signal_connect (G_OBJECT(combo),
"changed", G_CALLBACK(
set_default_style), NULL);
3749 append_comments (
vbox,
"<sup>*</sup>",
"if 10 000 atoms or more: <b>Wireframe</b>, otherwise: <b>Ball and stick</b>");
3766 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
vbox, gtk_label_new (
"General"));
3772 gtk_notebook_set_current_page (GTK_NOTEBOOK(notebook), 0);
3786 int i = GPOINTER_TO_INT(data);
3868 cut -> cutoff = value;
3925 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox,
markup_label(
"R<sub>cut</sub> (α, β)", 100, -1, 0.5, 0.5), FALSE, FALSE, 10);
3940 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox,
check_button (NULL, 20, -1, tmp_cut -> use, G_CALLBACK(
toggled_use_cutoff), (gpointer)tmp_cut), FALSE, FALSE, 10);
3941 tmp_cut = tmp_cut -> next;
3963 if (tmp_cut -> Z[0] == z_a && tmp_cut -> Z[1] == z_b)
return FALSE;
3964 tmp_cut = tmp_cut -> next;
3997 while (tmp_cut -> next)
3999 tmp_cut = tmp_cut -> next;
4001 tmp_cut -> next = g_malloc0(
sizeof*tmp_cut -> next);
4002 tmp_cut -> next -> prev = tmp_cut;
4003 tmp_cut = tmp_cut -> next;
4005 tmp_cut -> Z[0] =
min(k, l);
4006 tmp_cut -> Z[1] =
max(k, l);
4007 tmp_cut -> use = FALSE;
4008 tmp_cut -> cutoff = 1.0;
4032 new_cutoff = g_malloc0(
sizeof*new_cutoff);
4037 cut_b -> next = g_malloc0(
sizeof*cut_b -> next);
4038 cut_b -> next -> prev = cut_b;
4039 cut_b = cut_b -> next;
4041 cut_b -> Z[0] = cut_a -> Z[0];
4042 cut_b -> Z[1] = cut_a -> Z[1];
4043 cut_b -> use = cut_a -> use;
4044 cut_b -> cutoff = cut_a -> cutoff;
4046 cut_a = cut_a -> next;
4060G_MODULE_EXPORT
void edit_cutoffs (GtkDialog * edit_cuts, gint response_id, gpointer data)
4062 switch (response_id)
4064 case GTK_RESPONSE_APPLY:
4109 for (j=1; j<119; j++)
4133 GtkWidget * notebook = gtk_notebook_new ();
4136 gtk_notebook_set_scrollable (GTK_NOTEBOOK(notebook), TRUE);
4137 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(notebook), GTK_POS_TOP);
4138 gchar * default_delta_num_leg[8] = {
"<b>g(r)</b>: number of δr",
"<b>s(q)</b>: number of δq",
"<b>s(k)</b>: number of δk",
"<b>g(r) FFT</b>: number of δr",
4139 "<b>D<sub>ij</sub></b>: number of δr [D<sub>ij</sub>min-D<sub>ij</sub>max]",
"<b>Angles distribution</b>: number of δθ [0-180°]",
4140 "<b>Spherical harmonics</b>: l<sub>max</sub> in [2-40]",
"step(s) between configurations"};
4141 gchar * info[2] = {
"The <b>Analysis</b> tab regroups calculation options",
4142 "use it to setup your own default parameters:"};
4143 gchar * m_list[3][2] = {{
"Calculations",
"most analysis options"},
4144 {
"Rings",
"ring statistics options"},
4145 {
"Chains",
"chain statistics options"}};
4150 add_box_child_start (GTK_ORIENTATION_VERTICAL,
vbox,
markup_label(
"To determine the existence, or the absence, of a chemical bond", -1, -1, 0.5, 0.5), FALSE, FALSE, 0);
4154 add_box_child_start (GTK_ORIENTATION_VERTICAL, vvbox,
markup_label(
"It is used for analysis purposes, and, to draw bonds in the OpenGL window.", -1, -1, 0.5, 0.5), FALSE, FALSE, 0);
4167 gtk_widget_set_size_request (combo, 180, -1);
4169 g_signal_connect(G_OBJECT(combo),
"changed", G_CALLBACK(
totcut_changed), NULL);
4184 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, hhbox,
create_button (
"Set default cutoff(s)",
IMG_NONE, NULL, 180, -1, GTK_RELIEF_NORMAL, G_CALLBACK(
set_cutoffs_default), NULL), FALSE, FALSE, 10);
4187 append_comments (
vbox,
"<sup>*</sup>",
"The highest this value is, the highest the number of neighbors around an atom.");
4189 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
vbox, gtk_label_new (
"General"));
4218 g_signal_connect(G_OBJECT(tcombo),
"changed", G_CALLBACK(
tunit_changed), NULL);
4223 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
vbox, gtk_label_new (
"Calculations"));
4230 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
vbox, gtk_label_new ((i) ?
"Chains" :
"Rings"));
4294 for (i=0; i<16; i++)
4358 new_rep ->
rep = old_rep ->
rep;
4361 new_rep -> gnear = old_rep -> gnear;
4365 new_rep -> c_angle[i] = old_rep -> c_angle[i];
4366 new_rep -> c_shift[i] = old_rep -> c_shift[i];
4380 new_back -> gradient = old_back -> gradient;
4381 new_back -> direction = old_back -> direction;
4387 new_back -> gradient_color[i] = old_back -> gradient_color[i];
4401 new_box ->
box = old_box ->
box;
4403 new_box -> line = old_box -> line;
4404 new_box -> rad = old_box -> rad;
4417 new_axis ->
axis = old_axis ->
axis;
4418 new_axis -> length = old_axis -> length;
4420 new_axis -> line = old_axis -> line;
4421 new_axis -> rad = old_axis -> rad;
4422 new_axis -> t_pos = old_axis -> t_pos;
4427 new_axis -> c_pos[i] = old_axis -> c_pos[i];
4428 if (old_axis -> title[i]) new_axis -> title[i] = g_strdup_printf (
"%s", old_axis -> title[i]);
4430 if (old_axis ->
color)
4509G_MODULE_EXPORT
void update_projects (GtkDialog * proj_sel, gint response_id, gpointer data)
4512 switch (response_id)
4514 case GTK_RESPONSE_OK:
4626 for (i=0; i<16; i++)
4664 if (
ask_yes_no(
"Apply to projet(s) in workspace ?",
"Preferences were saved for the active session !\n Do you want to apply preferences to the project(s) opened in the workspace ?", GTK_MESSAGE_QUESTION,
pref_ogl_edit -> win))
4667 GtkWidget * proj_sel =
message_dialogmodal (
"Project selection",
"Select to apply preferences", GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK,
MainWindow);
4675 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox,
check_button (
get_project_by_id(i) -> name, 200, -1, FALSE, G_CALLBACK(
toggled_select_project), GINT_TO_POINTER(i)), FALSE, FALSE, 40);
4709 i = (i < 0) ? 0 : i;
4713 i = (i < 0) ? 0 : i;
4729 if (
ask_yes_no(
"Restore default parameters",
"Are you sure ?", GTK_MESSAGE_QUESTION,
MainWindow))
4759 switch (response_id)
4761 case GTK_RESPONSE_APPLY:
4765 gchar * str = g_strdup_printf (
"Do you want to save <b>atomes</b> preferences in:\n\n\t%s\n\nIf found this file is processed at every <b>atomes</b> startup.\n\n\t\t\t\t\t\tSave file ?",
ATOMES_CONFIG);
4766 if (
ask_yes_no(
"Save atomes preferences to file ?", str, GTK_MESSAGE_QUESTION, (GtkWidget *)edit_prefs))
4808 gtk_widget_set_size_request (win, 625, 645);
4809 gtk_window_set_resizable (GTK_WINDOW (win), FALSE);
4817 gchar * mess[2] = {
"Browse the following to modify the default configuration of <b>atomes</b>",
4818 "by replacing internal parameters by user defined preferences."};
4819 gchar * mlist[4][2]= {{
"Analysis",
"calculation preferences"},
4820 {
"OpenGL",
"rendering preferences"},
4821 {
"Model",
"atom(s), bond(s) and box preferences"},
4822 {
"View",
"representation and projection preferences"}};
4823 gchar * end =
"Default parameters are used for any new project added to the workspace\n";
4838 GtkWidget * but_lab =
markup_label (
"Restore <b>atomes</b> default parameters", -1, -1, 0.5, 0.5);
4842 gtk_notebook_append_page (GTK_NOTEBOOK(
preference_notebook), gbox, gtk_label_new (
"General"));
4864 gchar * pstring[5]={
"rendering",
"box",
"axis",
"backgorund",
"representation"};
4865 gchar * str = g_strdup_printf (
"Set %s preferences as default preferences ?", pstring[oid ->
b]);
4867 if (
ask_yes_no(
"Set model preferences as default ?", str, GTK_MESSAGE_QUESTION, this_proj -> modelgl -> win))
4870 image *
img = this_proj -> modelgl -> anim -> last ->
img;
4906 str = g_strdup_printf (
"Do you want to save <b>atomes</b> preferences in:\n\n\t%s\n\nIf found this file is processed at every <b>atomes</b> startup.\n\n\t\t\t\t\t\tSave file ?",
ATOMES_CONFIG);
4907 if (
ask_yes_no(
"Save atomes preferences to file ?", str, GTK_MESSAGE_QUESTION, this_proj -> modelgl -> win))
Binding to the Fortran90 subroutines.
double set_radius_(int *, int *)
Callback declarations for main window.
ColRGBA init_color(int id, int numid)
initialize color based id number over total number of elements
double scale(double axe)
find appropriate major tick spacing based on axis length
int * duplicate_int(int num, int *old_val)
copy a list of int
gboolean * duplicate_bool(int num, gboolean *old_val)
copy a list of gboolean
double * duplicate_double(int num, double *old_val)
copy a list of double
gboolean * allocbool(int val)
allocate a gboolean * pointer
double * allocdouble(int val)
allocate a double * pointer
int * allocint(int val)
allocate an int * pointer
gchar * ATOMES_CONFIG_DIR
double string_to_double(gpointer string)
convert string to double
Global variable declarations Global convenience function declarations Global data structure defin...
GtkWidget * dialog_cancel_apply(gchar *title, GtkWidget *parent, gboolean resiz)
create a dialog modal offering a choice to apply something or not
void run_this_gtk_dialog(GtkWidget *dial, GCallback handler, gpointer data)
run a GTK (3 and 4) basic GtkDialog
int combo_get_active(GtkWidget *combo)
retrieve the active item's position
GtkWidget * create_entry(GCallback handler, int dim, int cdim, gboolean key_release, gpointer data)
Create a GtkEntry.
void update_entry_double(GtkEntry *entry, double doubleval)
update the content of a GtkEntry as double
void set_renderer_color(int tocol, GtkCellRenderer *renderer, ColRGBA col)
set the color of a GtkCellRenderer
void append_comments(GtkWidget *vbox, gchar *symbol, gchar *legend)
append comments to a vertical box
GtkWidget * create_scroll(GtkWidget *box, int dimx, int dimy, int shadow)
create a scroll window
void combo_set_markup(GtkWidget *combo)
use pango markup in combo widget
element_data periodic_table_info[]
ColRGBA get_window_color(GtkWidget *color_win)
get the ColRGBA color from a color selection window
void combo_set_active(GtkWidget *combo, int pos)
set the active item's position
const gchar * entry_get_text(GtkEntry *entry)
get the text in a GtkEntry
GdkRGBA colrgba_togtkrgba(ColRGBA col)
convert ColRGBA color to GdkRGBA color
void update_entry_int(GtkEntry *entry, int intval)
update the content of a GtkEntry as int
GtkWidget * check_button(gchar *text, int dimx, int dimy, gboolean state, GCallback handler, gpointer data)
create a check button
GtkWidget * create_button(gchar *text, int image_format, gchar *image, int dimx, int dimy, int relief, GCallback handler, gpointer data)
create a simple button
GtkWidget * create_combo()
create a GtkCombox widget, note deprecated in GTK4
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.
ColRGBA get_button_color(GtkColorChooser *colob)
get the ColRGBA color from a GtkColorChooser button
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
void combo_text_append(GtkWidget *combo, gchar *text)
append text in GtkComboBox widget
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
GtkWidget * color_button(ColRGBA col, gboolean alpha, int dimx, int dimy, GCallback handler, gpointer data)
create a color selection button
void add_box_child_end(GtkWidget *widg, GtkWidget *child, gboolean expand, gboolean fill, int padding)
Add a GtkWidget in a GtkBox at the end position.
void add_container_child(int type, GtkWidget *widg, GtkWidget *child)
Add a GtkWidget into another GtkWidget.
GtkWidget * message_dialogmodal(gchar *message, gchar *title, GtkMessageType mtype, GtkButtonsType buttons, GtkWidget *parent)
create a modal (cannot be ignored) message window
void hide_the_widgets(GtkWidget *widg)
hide GtkWidget
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
ColRGBA * duplicate_color(int num, ColRGBA *col)
duplicate a ColRGBA pointer
int button_get_status(GtkWidget *button)
get status of check / toggle button
GtkWidget * abox(GtkWidget *box, char *lab, int vspace)
box creating routine, to help design faster elements for the GUI
void show_the_widgets(GtkWidget *widg)
show GtkWidget
project * get_project_by_id(int p)
get project pointer using id number
void zoom(glwin *view, int delta)
zoom in or zoom out in the OpenGL window
ColRGBA set_default_color(int z)
pick the default color for an atom
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
#define DEFAULT_LIGHTNING
Default OpenGL material ligthning.
#define DEFAULT_AMBIANT_OCCLUSION
Default OpenGL material ambiant occlusion.
#define DEFAULT_GAMMA_CORRECTION
Default OpenGL material gamma correction.
#define CAMERA_ANGLE_X
Default value for the OpenGL camera pitch in °
#define DEFAULT_OPACITY
Default OpenGL opacity.
#define DEFAULT_ROUGHNESS
Default OpenGL material roughness.
#define DEFAULT_METALLIC
Default OpenGL material metallic.
#define ZOOM
Default value for the OpenGL zoom.
#define QUALITY
Default OpenGL quality (number of polygons)
#define CAMERA_ANGLE_Y
Default value for the OpenGL camera heading in °
Variable declarations related the OpenGL window Data structure declarations related the OpenGL wind...
struct box box
box layout data structure
struct axis axis
axis layout data structure
char * text_filled[FILLED_STYLES]
char * text_styles[OGL_STYLES]
void show_error(char *error, int val, GtkWidget *win)
show error message
gboolean ask_yes_no(gchar *title, gchar *text, int type, GtkWidget *widg)
ask yes or no for something: prepare dialog
Messaging function declarations.
GtkWidget * over_param(int object, int style)
create override check button and entry
element_color * tmp_label_color[2]
background default_background
gboolean are_identical_colors(ColRGBA col_a, ColRGBA col_b)
test if two colors are identicals
axis_edition * pref_axis_win
Lightning default_lightning
void create_user_preferences_dialog()
G_MODULE_EXPORT void set_cutoffs_default(GtkButton *but, gpointer data)
set default cutoff radii
opengl_edition * pref_ogl_edit
element_radius * tmp_atomic_rad[16]
element_color * duplicate_element_color(element_color *old_list)
duplicate an element color data structure
xmlNodePtr findnode(xmlNodePtr startnode, char *nname)
find XML node
void read_light(xmlNodePtr light_node)
read light preferences from XML configuration
gradient_edition * pref_gradient_win
Light * copy_light_sources(int dima, int dimb, Light *old_sp)
create a copy of a list of light sources
G_MODULE_EXPORT void edit_pref(GtkCellRendererText *cell, gchar *path_string, gchar *new_text, gpointer user_data)
edit cell in the preferences tree model
void radius_set_color_and_markup(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *mod, GtkTreeIter *iter, gpointer data)
set text font and color
GtkWidget * lights_tab(glwin *view, opengl_edition *ogl_edit, Lightning *the_light)
OpenGL light(s) parameters tab.
GtkWidget * combo_map(int obj)
create color map combo
void read_style_from_xml_file(xmlNodePtr style_node, int style)
read style preferences from XML file
GtkWidget * materials_tab(glwin *view, opengl_edition *ogl_edit, Material *the_mat)
OpenGL material parameters tab.
gchar * substitute_string(gchar *init, gchar *o_motif, gchar *n_motif)
substitute all patterns in string
GtkWidget * atom_entry_over[8]
G_MODULE_EXPORT void toggled_select_project(GtkToggleButton *but, gpointer data)
toggle select / unselect project to update callback GTK3
ColRGBA default_sel_color[2]
void edit_bonds(GtkWidget *vbox)
creation of the edit bond cutoff widgets
G_MODULE_EXPORT void edit_cutoffs(GtkDialog *edit_cuts, gint response_id, gpointer data)
edit partial cutoffs - running the dialog
int default_acl_format[2]
ColRGBA get_spec_color(int z, element_color *clist)
retrieve the color of a chemical species
void setup_fog_dialogs(opengl_edition *ogl_edit, int fid)
update OpenGL fog tab based of fog type
void prepare_tmp_default()
prepare temporary parameters
box_edition * pref_box_win
bond_cutoff * duplicate_cutoffs(bond_cutoff *old_cutoff)
duplicate bond cutoff data structure
void duplicate_material(Material *new_mat, Material *old_mat)
duplicate material data
G_MODULE_EXPORT void set_default_map(GtkComboBox *box, gpointer data)
change default atom(s) or polyhedra color map
void apply_default_parameters_to_project(project *this_proj)
apply new default parameters to project
G_MODULE_EXPORT void set_default_style(GtkComboBox *box, gpointer data)
change default atom(s) and bond(s) style
G_MODULE_EXPORT void edit_preferences(GtkDialog *edit_prefs, gint response_id, gpointer data)
edit preferences - running the dialog
GtkWidget * opengl_preferences()
OpenGL preferences.
G_MODULE_EXPORT void set_default_options(GtkButton *but, gpointer data)
set options as default options
element_radius * tmp_bond_rad[6]
G_MODULE_EXPORT gboolean scroll_scale_quality(GtkRange *range, GtkScrollType scroll, gdouble value, gpointer data)
update OpenGL quality - scroll callback
void duplicate_screen_label(screen_label *new_lab, screen_label *old_lab)
copy screen_label data structure
G_MODULE_EXPORT void restore_defaults_parameters(GtkButton *but, gpointer data)
element_color * color_list
float get_radius(int object, int col, int z, element_radius *rad_list)
retrieve the radius/width of a species depending on style
G_MODULE_EXPORT void gradient_advanced(GtkWidget *widg, gpointer data)
Background configuration window.
GtkWidget * view_preferences()
view preferences
G_MODULE_EXPORT void set_measures(GtkComboBox *box, gpointer data)
change measure type
int xml_save_xyz_to_file(xmlTextWriterPtr writer, int did, gchar *legend, gchar *key, vec3_t data)
save vector data (x,y,z) to XML file
element_radius * duplicate_element_radius(element_radius *old_list)
duplicate an element radius data structure
void add_global_option(GtkWidget *vbox, tint *oid)
add a button to update global user preferences
Light init_light_source(int type, float val, float vbl)
initialize a light source
G_MODULE_EXPORT void set_selection_color(GtkColorChooser *colob, gpointer data)
change selection color
element_color * default_atom_color[2]
GtkWidget * bond_entry_over[6]
void duplicate_box_data(box *new_box, box *old_box)
duplicate box_data data structure
GtkWidget * style_tab(int style)
create preferences tab for a style
G_MODULE_EXPORT void toggled_default_stuff(GtkToggleButton *but, gpointer data)
toggle set / unset default callback GTK3
void read_parameter(xmlNodePtr parameter_node)
read preferences from XML configuration
G_MODULE_EXPORT void set_default_num_delta(GtkEntry *res, gpointer data)
update default number of delta preferences
GtkWidget * pref_list(gchar *mess[2], int nelem, gchar *mlist[nelem][2], gchar *end)
print information message with item list of elements
bond_cutoff * tmp_bond_cutoff
G_MODULE_EXPORT void totcut_changed(GtkComboBox *box, gpointer data)
change method to evaluate the total cutoff
GtkWidget * fog_tab(glwin *view, opengl_edition *ogl_edit, Fog *the_fog)
OpenGL fog parameters tab.
gboolean * default_o_at_rs
G_MODULE_EXPORT void set_default_stuff(GtkEntry *res, gpointer data)
update default number of delta preferences
int xml_save_parameter_to_file(xmlTextWriterPtr writer, gchar *xml_leg, gchar *xml_key, gboolean doid, int xml_id, gchar *value)
save single parameter to XML file
G_MODULE_EXPORT void axis_advanced(GtkWidget *widg, gpointer data)
create the axis advanced parameters window
Material default_material
void color_set_color(GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *mod, GtkTreeIter *iter, gpointer data)
set background color
element_radius ** edit_list
element_color * tmp_atom_color[2]
element_radius * default_bond_rad[6]
G_MODULE_EXPORT void edit_chem_preferences(GtkDialog *edit_chem, gint response_id, gpointer data)
edit chem preferences - running the dialog
void read_preferences(xmlNodePtr preference_node)
read preferences from XML configuration
element_color * default_label_color[2]
void set_atomes_preferences()
set software default parameters
GtkTreeModel * style_combo_tree()
create opengl style combo model
G_MODULE_EXPORT void run_ac_color(GtkDialog *win, gint response_id, gpointer data)
window color chooser - running the dialog
rep_edition * pref_rep_win
gboolean default_mtilt[2]
void duplicate_background_data(background *new_back, background *old_back)
duplicate background data structure
void update_light_data(int li, opengl_edition *ogl_win)
update light data
void set_atomes_defaults()
set atomes default parameters
G_MODULE_EXPORT gboolean pref_color_button_event(GtkWidget *widget, GdkEvent *event, gpointer data)
gchar * ogl_settings[3][10]
void duplicate_axis_data(axis *new_axis, axis *old_axis)
duplicate axis_data data structure
element_radius * default_atomic_rad[16]
GtkWidget * calc_preferences()
analysis preferences
G_MODULE_EXPORT void edit_pc_value(GtkEntry *res, gpointer data)
update partial cutoff value
void update_gradient_widgets(gradient_edition *gradient_win, background *back)
update the widgets of the gradient window
gchar * xml_filled_leg[4]
GtkWidget * lightning_fix(glwin *view, Material *this_material)
void save_preferences()
save user preferences
screen_label * tmp_label[5]
G_MODULE_EXPORT void tunit_changed(GtkComboBox *box, gpointer data)
change default time units
gboolean * default_o_bd_rw
G_MODULE_EXPORT void edit_species_parameters(GtkButton *but, gpointer data)
edit atoms and bonds species related parameters
void duplicate_fog(Fog *new_fog, Fog *old_fog)
duplicate fog data
bond_cutoff * default_bond_cutoff
GtkWidget * preference_notebook
G_MODULE_EXPORT void update_projects(GtkDialog *proj_sel, gint response_id, gpointer data)
update projects in the workspace using new preferences
G_MODULE_EXPORT void box_advanced(GtkWidget *widg, gpointer data)
create the box edition window
screen_label default_label[5]
GtkWidget * adv_box(GtkWidget *box, char *lab, int vspace, int size, float xalign)
create a box with markup label
background * tmp_background
G_MODULE_EXPORT void scale_quality(GtkRange *range, gpointer data)
update OpenGL quality - range callback
G_MODULE_EXPORT void cut_spec_changed(GtkComboBox *box, gpointer data)
partial cutoff chemical species
void calc_rings(GtkWidget *vbox)
creation of the rings statistics calculation widgets
gboolean not_in_cutoffs(int z_a, int z_b)
look in bond cutoff between species a and b is already defined
void color_button_event(GtkWidget *widget, double event_x, double event_y, guint event_button, gpointer data)
species color selection mouse button event
GtkWidget * model_preferences()
model preferences
double xml_string_to_double(gchar *content)
convert XML string to double
void duplicate_rep_data(rep_data *new_rep, rep_data *old_rep)
duplicate rep_data data structure
void read_preferences_from_xml_file()
read software preferences from XML file
G_MODULE_EXPORT void representation_advanced(GtkWidget *widg, gpointer data)
open advanced representation dialog
G_MODULE_EXPORT void set_stuff_color(GtkColorChooser *colob, gpointer data)
change stuff color
void clean_all_tmp()
free all temporary buffers
void add_cut_box()
update partial cutoffs widgets
void set_parameter(gchar *content, gchar *key, int vid, dint *bond, vec3_t *vect, float start, float end, ColRGBA *col)
set default parameter
void adjust_preferences_window()
adjust the widgets of the preferences window
GtkWidget * labels_tab(glwin *view, int lid)
create atomic label(s) tab for the atom(s) / clone(s) window
int xml_save_color_to_file(xmlTextWriterPtr writer, int did, gchar *legend, gchar *key, ColRGBA col)
save color data (red, green, blue, alpha) to XML file
G_MODULE_EXPORT void toggled_use_cutoff(GtkToggleButton *but, gpointer data)
int save_preferences_to_xml_file()
save software preferences to XML file
Preference variable declarations.
Function declarations for reading atomes project file Function declarations for saving atomes proje...
ColRGBA gradient_color[2]
G_MODULE_EXPORT void set_id(GtkEntry *entry, gpointer data)
set search id if >= 10 000 atoms
Function declarations for workspace managment.