139 const gchar * contact =
i18n(
" Please contact me at:\n");
140 const gchar * seb =
" Dr. Sébastien Le Roux ";
144 const gchar * or =
i18n(
"\n Or check the website for information\n");
147 web = gtk_link_button_new_with_label (
ATOMES_URL, _(
"Visit the project's website"));
151 eseb = gtk_link_button_new_with_label (mailto, mailsh);
178 GtkWidget * aboutdialog;
185 const gchar * authors[] = {
"Dr. Sébastien Le Roux <sebastien.leroux@ipcms.unistra.fr>",
190 const gchar * weblabel =
"https://atomes.ipcms.fr";
191 const gchar * comments =
i18n(
"Visualization, analyzis, creation/edition and post-processing of atomic scale models !");
192 const gchar * copyrights =
"Copyright © 2026 \nDr. Sébastien Le Roux";
197 aboutdialog = gtk_about_dialog_new ();
198 gtk_about_dialog_set_logo (GTK_ABOUT_DIALOG(aboutdialog),
atomes_logo);
199 gtk_about_dialog_set_version (GTK_ABOUT_DIALOG(aboutdialog),
VERSION);
200 str = g_strdup_printf (
"%s",
PACKAGE);
201 gtk_about_dialog_set_program_name (GTK_ABOUT_DIALOG(aboutdialog), str);
203 gtk_about_dialog_set_comments (GTK_ABOUT_DIALOG(aboutdialog), _(comments));
204 gtk_about_dialog_set_website (GTK_ABOUT_DIALOG(aboutdialog), g_strdup_printf(
"%s",
ATOMES_URL));
205 gtk_about_dialog_set_website_label (GTK_ABOUT_DIALOG(aboutdialog), weblabel);
206 gtk_about_dialog_set_authors (GTK_ABOUT_DIALOG(aboutdialog), authors);
207 gtk_about_dialog_set_copyright (GTK_ABOUT_DIALOG(aboutdialog), copyrights);
208 gtk_about_dialog_set_license (GTK_ABOUT_DIALOG(aboutdialog),
affero_license);
209 gtk_about_dialog_set_license_type (GTK_ABOUT_DIALOG(aboutdialog), GTK_LICENSE_CUSTOM);
210 gtk_about_dialog_set_wrap_license (GTK_ABOUT_DIALOG(aboutdialog), FALSE);
225 GtkWidget * theweb =
addweb (
id);
245 info = g_strdup_printf (
"%s\n%s", information,
ifbug);
249 info = g_strdup_printf (
"%s", information);
252 GtkWidget * dialog =
message_dialogmodal (info, _(
"Information"), GTK_MESSAGE_INFO, GTK_BUTTONS_OK, win);
268 GtkWidget * dialog =
message_dialogmodal (warning, _(
"Warning"), GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, win);
285 wtot = g_strdup_printf (
"%s\n%s\n%s", warning, sub, tab);
304 etot = g_strdup_printf (
"%s", error);
308 etot = g_strdup_printf (
"%s\n%s", error,
ifbug);
310 GtkWidget * dialog =
message_dialogmodal (etot, _(
"Error"), GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, win);
312 g_warning (
"%s", etot);
330 GtkWidget * dialog =
message_dialogmodal (error, _(
"Error"), GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, win);
333 if (this_error -> error_trace)
335 trace = g_strdup_printf (_(
"\n\tError %s %s, at:\n"
336 "<span font_desc=\"monospace 10\">\t\tFile : <b>%s</b>\n"
337 "\t\tFunction: <b>%s()</b>\n"
338 "\t\tLine : <b>%d</b></span>\n\n"
339 "\tBacktrace:\n%s\t\t →\t\t <i>call to</i>\t<span font_desc=\"monospace 10\"><b>%s()</b></span>\n"),
340 (! act) ? _(
"reading") : _(
"saving"),
341 _(this_error -> error_signal.message),
342 this_error -> error_file,
343 this_error -> error_func,
344 this_error -> error_line,
345 this_error -> error_trace,
346 this_error -> error_func);
350 trace = g_strdup_printf (_(
"\n\tError %s %s, at:\n"
351 "<span font_desc=\"monospace 10\">\t\tFile : <b>%s</b>\n"
352 "\t\tFunction: <b>%s()</b>\n"
353 "\t\tLine : <b>%d</b></span>\n"),
354 (! act) ? _(
"reading") : _(
"saving"),
355 _(this_error -> error_signal.message),
356 this_error -> error_file,
357 this_error -> error_func,
358 this_error -> error_line);
360 GtkWidget * trace_label =
markup_label (trace, -1, -1, 0.0, 0.5);
361 gtk_label_set_selectable(GTK_LABEL(trace_label), TRUE);
364 GtkWidget * content_area = gtk_message_dialog_get_message_area(GTK_MESSAGE_DIALOG(dialog));
371 g_warning (
"%s", error);
388 etot = g_strdup_printf (
"%s\n\t%s\n\t%s", error, sub, tab);
404G_MODULE_EXPORT
void run_yes_no (GtkDialog * dial, gint response_id, gpointer data)
406 res_yes_no = (response_id == GTK_RESPONSE_YES) ? TRUE : FALSE;
449 GtkWidget * wpop =
create_win (_(
"Information"), pwin, TRUE, FALSE);
450 gtk_widget_set_size_request (wpop, 600, 80);
452 gtk_window_set_position (GTK_WINDOW (wpop), GTK_WIN_POS_CENTER);
471G_MODULE_EXPORT gboolean
leaving_question (GtkWindow * widget, gpointer data)
482G_MODULE_EXPORT gboolean
leaving_question (GtkWidget * widget, GdkEvent * event, gpointer data)
485 if (
ask_yes_no (_(
"Leaving ?!"), _(
"Are you sure you want to quit ?"), GTK_MESSAGE_QUESTION,
MainWindow))
512 i18n(
"Atomic units"),
514gchar *
npt_type[4]={
"A\tB\tC\tα\tβ\tɣ",
515 "A\tB\tC\nα\tβ\tɣ",
516 "a<sub>x</sub>\ta<sub>y</sub>\ta<sub>z</sub>\tb<sub>x</sub>\tb<sub>y</sub>\tb<sub>z</sub>\tc<sub>x</sub>\tc<sub>y</sub>\tc<sub>z</sub>",
517 "a<sub>x</sub>\ta<sub>y</sub>\ta<sub>z</sub>\nb<sub>x</sub>\tb<sub>y</sub>\tb<sub>z</sub>\nc<sub>x</sub>\tc<sub>y</sub>\tc<sub>z</sub>"};
519 i18n(
"2 lines by step, twice as many lines as MD steps"),
520 i18n(
"3 lines by step, three times as many lines as MD steps")};
522 i18n(
"MD trajectory"),
523 i18n(
"Single configuration")};
525 i18n(
"Round up to highest integer"),
526 i18n(
"Round up to nearest integer")};
528 "\t\tConsider each configuration as a step in a chemical reaction:\n"
529 "\t\t\t- Atomic coordinates are sorted based on occupancy or disorder site\n"
530 "\t\t\t- Each describing the proportion of a reactant\n"
531 "\t\t\t- A super lattice is build to respect these proportions\n\n"
532 "\t<b>MD trajectory</b>\n"
533 "\t\tConsider the CIF file a MD trajectory\n\n"
534 "\t\tNumber of atom(s) must not change between configuration(s)\n\n"
535 "\t<b>Single configuration </b>\n"
536 "\t\tSelect a single configuration in the CIF file")};
538 "\t\tConsider the CIF file a MD trajectory\n\n"
539 "\t\tNumber of atom(s) must not change between configuration(s)\n\n"
540 "\t<b>Single configuration </b>\n"
541 "\t\tSelect a single configuration in the CIF file")};
542gchar *
cif_occ[3]={
i18n(
"to lowest integer: <b>⌊</b>n<sub>sites</sub> x occupancy<b>⌋</b>"),
543 i18n(
"to highest integer: <b>⌈</b>n<sub>sites</sub> x occupancy<b>⌉</b>"),
544 i18n(
"to nearest integer: <b>⌊</b>n<sub>sites</sub> x occupancy<b>⌉</b>")};
545gchar *
cif_sites[2]={
i18n(
"with n<sub>sites</sub> = f(space group, crystalline positions)"),
546 i18n(
"with n<sub>sites</sub> = f(symmetry positions, crystalline positions)")};
562 j = (! i || i == 2) ? 0 : (i == 1) ? 1 : 2;
577G_MODULE_EXPORT
void run_iask (GtkDialog *
iask, gint response_id, gpointer data)
579 int i = GPOINTER_TO_INT(data);
580 gboolean done = FALSE;
582 if (response_id == GTK_RESPONSE_OK)
620int iask (
char * question,
char *
lab,
int id, GtkWidget * win)
629 gtk_box_set_spacing (GTK_BOX(
vbox), 15);
635 if (
id == 0 ||
id > 6)
637 answer = gtk_entry_new ();
638 gtk_widget_set_size_request (
answer, 100, -1);
639 gtk_entry_set_alignment (GTK_ENTRY(
answer), 1.0);
646 gtk_widget_set_size_request (
answer, -1, 30);
673 GtkTreeStore * store = store = gtk_tree_store_new (1, G_TYPE_STRING);
676 gtk_tree_store_append (store, & iter, NULL);
677 gtk_tree_store_set (store, & iter, 0, _(
npt_type[i]), -1);
679 answer = gtk_combo_box_new_with_model (GTK_TREE_MODEL(store));
680 GtkCellRenderer * renderer = gtk_cell_renderer_combo_new ();
681 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (
answer), renderer, TRUE);
682 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (
answer), renderer,
"text", 0, NULL);
698 gchar * str = g_strdup_printf (_(
"\t<b>Lowest integer: </b>\n"
699 "\t\t Occupancy %s\n\t\t\t ex:\t ⌊8.76⌋ = 8\n\n"
700 "\t<b>Highest integer: </b>\n"
701 "\t\t Occupancy %s\n\t\t\t ex:\t ⌈5.39⌉ = 6\n\n"
702 "\t<b>Nearest integer: </b>\n"
703 "\t\t Occupancy %s\n\t\t\t ex:\t ⌊6.82⌉ = 7\t\t and\t ⌊4.31⌉ = 4\n\n"
729G_MODULE_EXPORT
void run_cask (GtkDialog *
cask, gint response_id, gpointer data)
731 int i = GPOINTER_TO_INT(data);
732 gboolean done = FALSE;
737 if (response_id == GTK_RESPONSE_OK)
746 if (response_id == GTK_RESPONSE_OK)
770gchar *
cask (
char * question,
char *
lab,
int id,
char * old, GtkWidget * win)
773 GtkWidget * dialog_ask;
779 gtk_box_set_spacing (GTK_BOX(dialog_ask), 15);
784 quest = gtk_label_new (
lab);
787 answer = gtk_entry_new ();
789 gtk_widget_set_size_request (
answer, 50, -1);
790 gtk_entry_set_alignment (GTK_ENTRY(
answer), 1.0);
807void init_data_ (
int * nats,
int * nspc,
int * stps,
int * cid)
842 char * lbel,
char * el_nme,
843 double * amss,
double * rdus,
844 double * nscatt,
double * xscatt)
847 active_chem -> label[id]= g_strdup_printf(
"%s", lbel);
869void print_info (gchar * str, gchar * stag, GtkTextBuffer * buffer)
873 gtk_text_buffer_get_end_iter (buffer, &bEnd);
876 tag = gtk_text_tag_table_lookup (gtk_text_buffer_get_tag_table(buffer), stag);
877 gtk_text_buffer_insert_with_tags (buffer, &bEnd, str, -1,
tag, NULL);
881 tag = gtk_text_tag_table_lookup (gtk_text_buffer_get_tag_table(buffer),
"default-size");
882 gtk_text_buffer_insert_with_tags (buffer, &bEnd, str, -1,
tag, NULL);
895 switch (i - i * (i / 9))
910 return "light_green";
946 double dvects[3][3],
double rvects[3][3],
double mod[3],
double ang[3],
947 double f_to_c[3][3],
double c_to_f[3][3])
960 active_cell ->
box[* bid].frac_to_cart = mat4(f_to_c[0][0], f_to_c[0][1], f_to_c[0][2], 0.0,
961 f_to_c[1][0], f_to_c[1][1], f_to_c[1][2], 0.0,
962 f_to_c[2][0], f_to_c[2][1], f_to_c[2][2], 0.0,
964 active_cell ->
box[* bid].cart_to_frac = mat4(c_to_f[0][0], c_to_f[0][1], c_to_f[0][2], 0.0,
965 c_to_f[1][0], c_to_f[1][1], c_to_f[1][2], 0.0,
966 c_to_f[2][0], c_to_f[2][1], c_to_f[2][2], 0.0,
1030 for (l=0; l<this_proj -> nspec; l++)
1032 m += this_proj -> coord -> partial_geo[s][g][l];
1036 stra = g_strdup_printf (
"%s [", spec);
1042 for (l=0; l<this_proj -> nspec; l++)
1044 m = this_proj -> coord -> partial_geo[s][g][l];
1049 strb = g_strdup_printf (
"%s%s<sub>%d</sub>", stra,
exact_name(this_proj ->
chemistry -> label[l]), m);
1053 strb = g_strdup_printf (
"%s%s%d", stra,
exact_name(this_proj ->
chemistry -> label[l]), m);
1059 strb = g_strdup_printf (
"%d", m);
1073 strb = g_strdup_printf (
"%s", stra);
1076 stra = g_strdup_printf (
"%s", strb);
1079 strb = g_strdup_printf (
"%s]", stra);
1088 strb = g_strdup_printf (_(
"%s - isolated"), spec);
1092 print_info (_(
" - isolated"),
"bold", buffer);
1118 if (this_proj -> analysis[calc] -> init_ok)
1120 for (j= 0; j < this_proj -> analysis[calc] -> numc; j++)
1122 if (this_proj -> analysis[calc] -> curves[j] ->
plot != NULL)
The text of the Affero GPL v3 license.
Binding to the Fortran90 subroutines.
void quit_gtk()
Leave the application.
gchar * substitute_string(gchar *init, gchar *o_motif, gchar *n_motif)
substitute all patterns in string
Callback declarations for main window.
integer(kind=c_int) function chemistry()
#define PACKAGE_BUGREPORT
void update_curve(gpointer data)
update curve rendering
Variable declarations for the curve widget Functions for interactions with the curve widget.
gboolean cif_use_symmetry_positions
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
int combo_get_active(GtkWidget *combo)
retrieve the active item's position
GtkWidget * create_win(gchar *str, GtkWidget *parent, gboolean modal, gboolean resiz)
create a new GtkWindow
void combo_set_markup(GtkWidget *combo)
use pango markup in combo widget
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
chemical_data * active_chem
GtkWidget * stock_image(const gchar *stock_id)
create a GtkImage for the Gtk database
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.
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
G_MODULE_EXPORT void run_destroy_dialog(GtkDialog *dialog, gint response_id, gpointer data)
to destroy a GtkDialog when the dialog emit the closing signal
void update_entry_text(GtkEntry *entry, gchar *text)
update the content of a GtkEntry as string
void add_container_child(int type, GtkWidget *widg, GtkWidget *child)
Add a GtkWidget into another GtkWidget.
char * coord_files[NCFORMATS+1]
GtkWidget * message_dialogmodal(gchar *message, gchar *title, GtkMessageType mtype, GtkButtonsType buttons, GtkWidget *parent)
create a modal (cannot be ignored) message window
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
GtkWidget * create_expander(gchar *name, gchar *file_img)
create GtkExpander
void show_the_widgets(GtkWidget *widg)
show GtkWidget
project * get_project_by_id(int p)
get project pointer using id number
G_MODULE_EXPORT void on_answer_changed(GtkWidget *widg, gpointer data)
Handling the GtkComboBox in 'int iask'.
gchar * cif_configurations[3]
void show_web(GtkWidget *dialog, int id)
add / show web information to widget
G_MODULE_EXPORT void create_about_dialog(GtkWidget *widg, gpointer data)
create the about dialog
int iask(char *question, char *lab, int id, GtkWidget *win)
enter an integer value - prepare the dialog
gchar * cask(char *question, char *lab, int id, char *old, GtkWidget *win)
enter a string - prepare the dialog
void show_warning_(char *warning, char *sub, char *tab)
show warning from Fortran90
gchar * substitute_string(gchar *init, gchar *o_motif, gchar *n_motif)
substitute all patterns in string
void show_warning(char *warning, GtkWidget *win)
show warning
G_MODULE_EXPORT void run_cask(GtkDialog *cask, gint response_id, gpointer data)
enter a string - running the dialog
void spec_data_(int *status, int *ind, int *atd, int *nsp, char *lbel, char *el_nme, double *amss, double *rdus, double *nscatt, double *xscatt)
update project data using information from Fortran90
void show_info(char *information, int val, GtkWidget *win)
add / show information message to widget
gchar * textcolor(int i)
setup text color keyword
void show_error(char *error, int val, GtkWidget *win)
show error message
G_MODULE_EXPORT gboolean leaving_question(GtkWidget *widget, GdkEvent *event, gpointer data)
Leaving atomes ?
int dummy_ask_(char *question)
Ask to use dummy atoms or not from Fortran90.
void send_chem_info_(int prop[active_project -> nspec])
void update_after_calc(int calc)
update all curve plots in the workspace after a calculation
gchar * cif_occupancies[3]
gchar * cif_config_legends
void show_error_(char *error, char *sub, char *tab)
show error from Fortran90
void show_error_with_trace(gchar *error, atomes_error *this_error, int act, int val, GtkWidget *win)
show error message
void init_data_(int *nats, int *nspc, int *stps, int *cid)
update project data using information from Fortran90
void lattice_info_(int *bid, double *volume, double *density, double dvects[3][3], double rvects[3][3], double mod[3], double ang[3], double f_to_c[3][3], double c_to_f[3][3])
lattice data from Fortran90
gchar * env_name(project *this_proj, int g, int s, int f, GtkTextBuffer *buffer)
output the name of a coordination sphere
G_MODULE_EXPORT void run_iask(GtkDialog *iask, gint response_id, gpointer data)
enter an integer value - running the dialog
GtkWidget * show_pop(char *pop, GtkWidget *pwin)
display pop information window
G_MODULE_EXPORT void run_yes_no(GtkDialog *dial, gint response_id, gpointer data)
ask yes or no for something: running dialog
void print_info(gchar *str, gchar *stag, GtkTextBuffer *buffer)
print information in GtkTextBuffer
gboolean ask_yes_no(gchar *title, gchar *text, int type, GtkWidget *widg)
ask yes or no for something: prepare dialog
GtkWidget * addweb(int id)
create a widget to present
gchar * exact_name(gchar *name)
short cut to print string without spaces
void alloc_proj_data(project *this_proj, int cid)
allocate data
Function declarations for reading atomes project file Function declarations for saving atomes proje...