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");
148 gchar * mailto = g_strdup_printf (
"mailo:%s", PACKAGE_BUGREPORT);
149 gchar * mailsh = g_strdup_printf (
"<%s>",PACKAGE_BUGREPORT);
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 © 2024 \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"};
470 i = gtk_combo_box_get_active (GTK_COMBO_BOX(widg));
471 j = (! i || i == 2) ? 0 : (i == 1) ? 1 : 2;
486G_MODULE_EXPORT
void run_iask (GtkDialog *
iask, gint response_id, gpointer data)
488 int i = GPOINTER_TO_INT(data);
489 gboolean done = FALSE;
491 if (response_id == GTK_RESPONSE_OK)
529int iask (
char * question,
char *
lab,
int id, GtkWidget * win)
538 gtk_box_set_spacing (GTK_BOX(
vbox), 15);
541 quest = gtk_label_new (
lab);
544 if (
id == 0 ||
id > 3)
546 answer = gtk_entry_new ();
547 gtk_widget_set_size_request (
answer, 100, -1);
548 gtk_entry_set_alignment (GTK_ENTRY(
answer), 1.0);
555 gtk_widget_set_size_request (
answer, -1, 40);
563 GtkTreeStore * store = store = gtk_tree_store_new (1, G_TYPE_STRING);
566 gtk_tree_store_append (store, & iter, NULL);
567 gtk_tree_store_set (store, & iter, 0,
npt_type[i], -1);
569 answer = gtk_combo_box_new_with_model (GTK_TREE_MODEL(store));
570 GtkCellRenderer * renderer = gtk_cell_renderer_combo_new ();
571 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (
answer), renderer, TRUE);
572 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (
answer), renderer,
"text", 0, NULL);
573 GList * cell_list = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT(
answer));
574 if(cell_list && cell_list -> data)
576 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(
answer), cell_list -> data,
"markup", 0, NULL);
579 gtk_combo_box_set_active (GTK_COMBO_BOX(
answer), 0);
604G_MODULE_EXPORT
void run_cask (GtkDialog *
cask, gint response_id, gpointer data)
606 int i = GPOINTER_TO_INT(data);
607 gboolean done = FALSE;
612 if (response_id == GTK_RESPONSE_OK)
621 if (response_id == GTK_RESPONSE_OK)
645gchar *
cask (
char * question,
char *
lab,
int id,
char * old, GtkWidget * win)
648 GtkWidget * dialog_ask;
654 gtk_box_set_spacing (GTK_BOX(dialog_ask), 15);
659 quest = gtk_label_new (
lab);
662 answer = gtk_entry_new ();
664 gtk_widget_set_size_request (
answer, 50, -1);
665 gtk_entry_set_alignment (GTK_ENTRY(
answer), 1.0);
682void init_data_ (
int * nats,
int * nspc,
int * stps,
int * cid)
711 char * lbel,
char * el_nme,
712 double * amss,
double * rdus,
713 double * nscatt,
double * xscatt)
738void print_info (gchar * str, gchar * stag, GtkTextBuffer * buffer)
743 gtk_text_buffer_get_end_iter (buffer, &bEnd);
746 tag = gtk_text_tag_table_lookup (gtk_text_buffer_get_tag_table(buffer), stag);
747 gtk_text_buffer_insert_with_tags (buffer, &bEnd, str, -1,
tag, NULL);
751 tag = gtk_text_tag_table_lookup (gtk_text_buffer_get_tag_table(buffer),
"default-size");
752 gtk_text_buffer_insert_with_tags (buffer, &bEnd, str, -1,
tag, NULL);
766 switch (i - i * (i / 9))
769 col = g_strdup_printf (
"red");
772 col = g_strdup_printf (
"blue");
775 col = g_strdup_printf (
"cyan");
778 col = g_strdup_printf (
"green");
781 col = g_strdup_printf (
"light_green");
784 col = g_strdup_printf (
"yellow");
787 col = g_strdup_printf (
"orange");
790 col = g_strdup_printf (
"violet");
793 col = g_strdup_printf (
"pink");
817 double dvects[3][3],
double rvects[3][3],
double mod[3],
double ang[3],
818 double f_to_c[3][3],
double c_to_f[3][3])
825 active_cell -> box[* bid].vect[i][j] = dvects[j][i];
826 active_cell -> box[* bid].rvect[i][j] = rvects[j][i];
831 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,
832 f_to_c[1][0], f_to_c[1][1], f_to_c[1][2], 0.0,
833 f_to_c[2][0], f_to_c[2][1], f_to_c[2][2], 0.0,
835 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,
836 c_to_f[1][0], c_to_f[1][1], c_to_f[1][2], 0.0,
837 c_to_f[2][0], c_to_f[2][1], c_to_f[2][2], 0.0,
897 for (l=0; l<this_proj -> nspec; l++)
899 m += this_proj -> coord -> partial_geo[s][g][l];
903 stra = g_strdup_printf (
"%s [", spec);
909 for (l=0; l<this_proj -> nspec; l++)
911 m = this_proj -> coord -> partial_geo[s][g][l];
926 strb = g_strdup_printf (
"%d", m);
940 strb = g_strdup_printf (
"%s", stra);
943 stra = g_strdup_printf (
"%s", strb);
946 strb = g_strdup_printf (
"%s]", stra);
955 strb = g_strdup_printf (
"%s - isolated", spec);
985 if (this_proj -> initok[calc])
987 for (j= 0; j < this_proj -> numc[calc]; j++)
989 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()
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
double string_to_double(gpointer string)
convert string to double
Global variable declarations Global convenience function declarations Global data structure defin...
void run_this_gtk_dialog(GtkWidget *dial, GCallback handler, gpointer data)
run a GTK (3 and 4) basic GtkDialog
GtkWidget * create_win(gchar *str, GtkWidget *parent, gboolean modal, gboolean resiz)
create a new GtkWindow
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)
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'.
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.
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...