138 const gchar * contact =
" Please contact me at:\n";
139 const gchar * seb =
" Dr. Sébastien Le Roux ";
143 const gchar * or =
"\n Or check the website for information\n";
146 web = gtk_link_button_new_with_label (
ATOMES_URL,
"Visit the project's website");
150 eseb = gtk_link_button_new_with_label (mailto, mailsh);
177 GtkWidget * aboutdialog;
183 const gchar *authors[] = {
"Dr. Sébastien Le Roux <sebastien.leroux@ipcms.unistra.fr>",
"", NULL};
184 const gchar * weblabel =
"https://atomes.ipcms.fr";
185 const gchar * comments =
"Visualization, analyzis, creation/edition and post-processing of atomistic models !";
186 const gchar * copyrights =
"Copyright © 2025 \nDr. Sébastien Le Roux";
191 aboutdialog = gtk_about_dialog_new ();
192 gtk_about_dialog_set_logo (GTK_ABOUT_DIALOG(aboutdialog),
atomes_logo);
193 gtk_about_dialog_set_version (GTK_ABOUT_DIALOG(aboutdialog),
VERSION);
194 gchar * str = g_strdup_printf (
"%s",
PACKAGE);
195 gtk_about_dialog_set_program_name (GTK_ABOUT_DIALOG(aboutdialog), str);
197 gtk_about_dialog_set_comments (GTK_ABOUT_DIALOG(aboutdialog), comments);
198 gtk_about_dialog_set_website (GTK_ABOUT_DIALOG(aboutdialog), g_strdup_printf(
"%s",
ATOMES_URL));
199 gtk_about_dialog_set_website_label (GTK_ABOUT_DIALOG(aboutdialog), weblabel);
200 gtk_about_dialog_set_authors (GTK_ABOUT_DIALOG(aboutdialog), authors);
201 gtk_about_dialog_set_copyright (GTK_ABOUT_DIALOG(aboutdialog), copyrights);
202 gtk_about_dialog_set_license (GTK_ABOUT_DIALOG(aboutdialog),
affero_license);
203 gtk_about_dialog_set_license_type (GTK_ABOUT_DIALOG(aboutdialog), GTK_LICENSE_CUSTOM);
204 gtk_about_dialog_set_wrap_license (GTK_ABOUT_DIALOG(aboutdialog), FALSE);
219 GtkWidget * theweb =
addweb (
id);
239 info = g_strdup_printf (
"%s\n%s", information,
ifbug);
243 info = g_strdup_printf (
"%s", information);
246 GtkWidget * dialog =
message_dialogmodal (info,
"Information", GTK_MESSAGE_INFO, GTK_BUTTONS_OK, win);
262 GtkWidget * dialog =
message_dialogmodal (warning,
"Warning", GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, win);
279 wtot = g_strdup_printf (
"%s\n%s\n%s", warning, sub, tab);
298 etot = g_strdup_printf (
"%s", error);
302 etot = g_strdup_printf (
"%s\n%s", error,
ifbug);
304 GtkWidget * dialog =
message_dialogmodal (etot,
"Error", GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, win);
306 g_warning (
"%s", etot);
324 etot = g_strdup_printf (
"%s\n\t%s\n\t%s", error, sub, tab);
340G_MODULE_EXPORT
void run_yes_no (GtkDialog * dial, gint response_id, gpointer data)
342 res_yes_no = (response_id == GTK_RESPONSE_YES) ? TRUE : FALSE;
385 GtkWidget * wpop =
create_win (
"Information", pwin, TRUE, FALSE);
386 gtk_widget_set_size_request (wpop, 600, 80);
388 gtk_window_set_position (GTK_WINDOW (wpop), GTK_WIN_POS_CENTER);
407G_MODULE_EXPORT gboolean
leaving_question (GtkWindow * widget, gpointer data)
418G_MODULE_EXPORT gboolean
leaving_question (GtkWidget * widget, GdkEvent * event, gpointer data)
421 if (
ask_yes_no (
"Leaving ?!",
"Are you sure you want to quit ?", GTK_MESSAGE_QUESTION,
MainWindow))
450gchar *
npt_type[4]={
"A\tB\tC\tα\tβ\tɣ",
451 "A\tB\tC\nα\tβ\tɣ",
452 "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>",
453 "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>"};
454gchar *
npt_info[3]={
"1 line by step, as many lines as MD steps",
455 "2 lines by step, twice as many lines as MD steps",
456 "3 lines by step, three times as many lines as MD steps"};
459 "Single configuration"};
461 "Round up to highest integer",
462 "Round up to nearest integer"};
464 "\t\tConsider each configuration as a step in a chemical reaction:\n"
465 "\t\t\t- Atomic coordinates are sorted based on occupancy or disorder site\n"
466 "\t\t\t- Each describeing the proportion of a reactant\n"
467 "\t\t\t- A super lattice is build to respect these proportions\n\n"
468 "\t<b>MD trajectory</b>\n"
469 "\t\tConsider the CIF file a MD trajectory\n\n"
470 "\t\tNumber of atom(s) must not change between configuration(s)\n\n"
471 "\t<b>Single configuration </b>\n"
472 "\t\tSelect a single configuration in the CIF file"};
474 "\t\tConsider the CIF file a MD trajectory\n\n"
475 "\t\tNumber of atom(s) must not change between configuration(s)\n\n"
476 "\t<b>Single configuration </b>\n"
477 "\t\tSelect a single configuration in the CIF file"};
478gchar *
cif_occ[3]={
"to lowest integer: <b>⌊</b>n<sub>sites</sub> x occupancy<b>⌋</b>",
479 "to highest integer: <b>⌈</b>n<sub>sites</sub> x occupancy<b>⌉</b>",
480 "to nearest integer: <b>⌊</b>n<sub>sites</sub> x occupancy<b>⌉</b>"};
481gchar *
cif_sites[2]={
"with n<sub>sites</sub> = f(space group, crystalline positions)",
482 "with n<sub>sites</sub> = f(symmetry positions, crystalline positions)"};
498 j = (! i || i == 2) ? 0 : (i == 1) ? 1 : 2;
513G_MODULE_EXPORT
void run_iask (GtkDialog *
iask, gint response_id, gpointer data)
515 int i = GPOINTER_TO_INT(data);
516 gboolean done = FALSE;
518 if (response_id == GTK_RESPONSE_OK)
556int iask (
char * question,
char *
lab,
int id, GtkWidget * win)
565 gtk_box_set_spacing (GTK_BOX(
vbox), 15);
568 quest = gtk_label_new (
lab);
571 if (
id == 0 ||
id > 6)
573 answer = gtk_entry_new ();
574 gtk_widget_set_size_request (
answer, 100, -1);
575 gtk_entry_set_alignment (GTK_ENTRY(
answer), 1.0);
582 gtk_widget_set_size_request (
answer, -1, 30);
609 GtkTreeStore * store = store = gtk_tree_store_new (1, G_TYPE_STRING);
612 gtk_tree_store_append (store, & iter, NULL);
613 gtk_tree_store_set (store, & iter, 0,
npt_type[i], -1);
615 answer = gtk_combo_box_new_with_model (GTK_TREE_MODEL(store));
616 GtkCellRenderer * renderer = gtk_cell_renderer_combo_new ();
617 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (
answer), renderer, TRUE);
618 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (
answer), renderer,
"text", 0, NULL);
634 gchar * str = g_strdup_printf (
"\t<b>Lowest integer: </b>\n"
635 "\t\t Occupancy %s\n\t\t\t ex:\t ⌊8.76⌋ = 8\n\n"
636 "\t<b>Highest integer: </b>\n"
637 "\t\t Occupancy %s\n\t\t\t ex:\t ⌈5.39⌉ = 6\n\n"
638 "\t<b>Nearest integer: </b>\n"
639 "\t\t Occupancy %s\n\t\t\t ex:\t ⌊6.82⌉ = 7\t\t and\t ⌊4.31⌉ = 4\n\n"
665G_MODULE_EXPORT
void run_cask (GtkDialog *
cask, gint response_id, gpointer data)
667 int i = GPOINTER_TO_INT(data);
668 gboolean done = FALSE;
673 if (response_id == GTK_RESPONSE_OK)
682 if (response_id == GTK_RESPONSE_OK)
706gchar *
cask (
char * question,
char *
lab,
int id,
char * old, GtkWidget * win)
709 GtkWidget * dialog_ask;
715 gtk_box_set_spacing (GTK_BOX(dialog_ask), 15);
720 quest = gtk_label_new (
lab);
723 answer = gtk_entry_new ();
725 gtk_widget_set_size_request (
answer, 50, -1);
726 gtk_entry_set_alignment (GTK_ENTRY(
answer), 1.0);
743void init_data_ (
int * nats,
int * nspc,
int * stps,
int * cid)
772 char * lbel,
char * el_nme,
773 double * amss,
double * rdus,
774 double * nscatt,
double * xscatt)
799void print_info (gchar * str, gchar * stag, GtkTextBuffer * buffer)
804 gtk_text_buffer_get_end_iter (buffer, &bEnd);
807 tag = gtk_text_tag_table_lookup (gtk_text_buffer_get_tag_table(buffer), stag);
808 gtk_text_buffer_insert_with_tags (buffer, &bEnd, str, -1,
tag, NULL);
812 tag = gtk_text_tag_table_lookup (gtk_text_buffer_get_tag_table(buffer),
"default-size");
813 gtk_text_buffer_insert_with_tags (buffer, &bEnd, str, -1,
tag, NULL);
827 switch (i - i * (i / 9))
830 col = g_strdup_printf (
"red");
833 col = g_strdup_printf (
"blue");
836 col = g_strdup_printf (
"cyan");
839 col = g_strdup_printf (
"green");
842 col = g_strdup_printf (
"light_green");
845 col = g_strdup_printf (
"yellow");
848 col = g_strdup_printf (
"orange");
851 col = g_strdup_printf (
"violet");
854 col = g_strdup_printf (
"pink");
878 double dvects[3][3],
double rvects[3][3],
double mod[3],
double ang[3],
879 double f_to_c[3][3],
double c_to_f[3][3])
892 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,
893 f_to_c[1][0], f_to_c[1][1], f_to_c[1][2], 0.0,
894 f_to_c[2][0], f_to_c[2][1], f_to_c[2][2], 0.0,
896 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,
897 c_to_f[1][0], c_to_f[1][1], c_to_f[1][2], 0.0,
898 c_to_f[2][0], c_to_f[2][1], c_to_f[2][2], 0.0,
958 for (l=0; l<this_proj -> nspec; l++)
960 m += this_proj -> coord -> partial_geo[s][g][l];
964 stra = g_strdup_printf (
"%s [", spec);
970 for (l=0; l<this_proj -> nspec; l++)
972 m = this_proj -> coord -> partial_geo[s][g][l];
987 strb = g_strdup_printf (
"%d", m);
1001 strb = g_strdup_printf (
"%s", stra);
1004 stra = g_strdup_printf (
"%s", strb);
1007 strb = g_strdup_printf (
"%s]", stra);
1016 strb = g_strdup_printf (
"%s - isolated", spec);
1046 if (this_proj -> initok[calc])
1048 for (j= 0; j < this_proj -> numc[calc]; j++)
1050 if (this_proj -> curves[calc][j] ->
plot != NULL)
The text of the Affero GPL v3 license.
Binding to the Fortran90 subroutines.
void quit_gtk()
Leave the application.
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.
void label(cairo_t *cr, double val, int axe, int p, project *this_proj)
draw axis label
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
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)
To 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 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)
ouput 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...