atomes 1.3.1
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
interface.c File Reference

General messaging functions. More...

#include "global.h"
#include "bind.h"
#include "callbacks.h"
#include "project.h"
#include "curve.h"
#include "affero.h"
Include dependency graph for interface.c:

Go to the source code of this file.

Functions

gchar * substitute_string (gchar *init, gchar *o_motif, gchar *n_motif)
 substitute all patterns in string
GtkWidget * addweb (int id)
 create a widget to present
G_MODULE_EXPORT void create_about_dialog (GtkWidget *widg, gpointer data)
 create the about dialog
void show_web (GtkWidget *dialog, int id)
 add / show web information to widget
void show_info (char *information, int val, GtkWidget *win)
 add / show information message to widget
void show_warning (char *warning, GtkWidget *win)
 show warning
void show_warning_ (char *warning, char *sub, char *tab)
 show warning from Fortran90
void show_error (char *error, int val, GtkWidget *win)
 show error message
void show_error_with_trace (gchar *error, atomes_error *this_error, int act, int val, GtkWidget *win)
 show error message
void show_error_ (char *error, char *sub, char *tab)
 show error from Fortran90
G_MODULE_EXPORT void run_yes_no (GtkDialog *dial, gint response_id, gpointer data)
 ask yes or no for something: running dialog
gboolean ask_yes_no (gchar *title, gchar *text, int type, GtkWidget *widg)
 ask yes or no for something: prepare dialog
gchar * exact_name (gchar *name)
 short cut to print string without spaces
GtkWidget * show_pop (char *pop, GtkWidget *pwin)
 display pop information window
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.
G_MODULE_EXPORT void on_answer_changed (GtkWidget *widg, gpointer data)
 Handling the GtkComboBox in 'int iask'.
G_MODULE_EXPORT void run_iask (GtkDialog *iask, gint response_id, gpointer data)
 enter an integer value - running the dialog
int iask (char *question, char *lab, int id, GtkWidget *win)
 enter an integer value - prepare the dialog
G_MODULE_EXPORT void run_cask (GtkDialog *cask, gint response_id, gpointer data)
 enter a string - running the dialog
gchar * cask (char *question, char *lab, int id, char *old, GtkWidget *win)
 enter a string - prepare the dialog
void init_data_ (int *nats, int *nspc, int *stps, int *cid)
 update project data using information from Fortran90
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 print_info (gchar *str, gchar *stag, GtkTextBuffer *buffer)
 print information in GtkTextBuffer
gchar * textcolor (int i)
 setup text color keyword
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
void send_chem_info_ (int prop[active_project -> nspec])
gchar * env_name (project *this_proj, int g, int s, int f, GtkTextBuffer *buffer)
 output the name of a coordination sphere
void update_after_calc (int calc)
 update all curve plots in the workspace after a calculation

Variables

GtkWidget * answer
gboolean res_yes_no
gchar * field_init [3]
gchar * coord_type [3]
gchar * npt_type [4]
gchar * npt_info [3]
gchar * cif_configurations [3]
gchar * cif_occupancies [3]
gchar * cif_config_legends
gchar * cif_config_leg
gchar * cif_occ [3]
gchar * cif_sites [2]
GtkWidget * answer_info
int res_int
gchar * res_char

Detailed Description

General messaging functions.

Author
Sébastien Le Roux sebas.nosp@m.tien.nosp@m..lero.nosp@m.ux@i.nosp@m.pcms..nosp@m.unis.nosp@m.tra.f.nosp@m.r

Definition in file interface.c.

Function Documentation

◆ addweb()

GtkWidget * addweb ( int id)

create a widget to present

Parameters
idAdd contact info (1) or not (0)

Definition at line 136 of file interface.c.

◆ ask_yes_no()

gboolean ask_yes_no ( gchar * title,
gchar * text,
int type,
GtkWidget * widg )

ask yes or no for something: prepare dialog

Parameters
titleTitle
textMessage
typethe type of message window
widgthe parent GtkWidget, if any

Definition at line 420 of file interface.c.

◆ cask()

gchar * cask ( char * question,
char * lab,
int id,
char * old,
GtkWidget * win )

enter a string - prepare the dialog

Parameters
questionMessage
labText to use for label
idthe required parameter id
oldthe initial value for the string
winthe parent GtkWidget, if any

Definition at line 770 of file interface.c.

◆ create_about_dialog()

G_MODULE_EXPORT void create_about_dialog ( GtkWidget * widg,
gpointer data )

create the about dialog

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 176 of file interface.c.

◆ dummy_ask_()

int dummy_ask_ ( char * question)

Ask to use dummy atoms or not from Fortran90.

Parameters
questionMessage

Definition at line 503 of file interface.c.

◆ env_name()

gchar * env_name ( project * this_proj,
int g,
int s,
int f,
GtkTextBuffer * buffer )

output the name of a coordination sphere

Parameters
this_projthe target project
gthe coordination (0 = total, 1 = partial)
sthe chemical species
fWith markup or not
bufferOutput in a GtkTextBuffer, or not if NULL

Definition at line 1022 of file interface.c.

◆ exact_name()

gchar * exact_name ( gchar * name)

short cut to print string without spaces

Parameters
namethe initial string

Definition at line 434 of file interface.c.

◆ iask()

int iask ( char * question,
char * lab,
int id,
GtkWidget * win )

enter an integer value - prepare the dialog

Parameters
questionMessage
labText to use for label
idthe required parameter id
winthe parent GtkWidget, if any

Definition at line 620 of file interface.c.

◆ init_data_()

void init_data_ ( int * nats,
int * nspc,
int * stps,
int * cid )

update project data using information from Fortran90

Parameters
natsnumber of atoms
nspcnumber of species
stpsnumber of steps
cidallocate chemistry data (1) or not (0)

Definition at line 807 of file interface.c.

◆ lattice_info_()

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

Parameters
bid0 or MD step if NPT
volumevolume
densitydensity
dvectsdirect space lattice vectors
rvectsreciprocal lattice vectors
modmodulus of lattice vectors (a,b,c)
anglattice angles (alpha, beta, gamma)
f_to_cfractional to cartesian matrix
c_to_fcartesian to fractional matrix

Definition at line 945 of file interface.c.

◆ leaving_question()

G_MODULE_EXPORT gboolean leaving_question ( GtkWidget * widget,
GdkEvent * event,
gpointer data )

Leaving atomes ?

Parameters
widgetthe GtkWidget sending the signal
eventthe GdkEvent triggering the signal
datathe associated data pointer

Definition at line 482 of file interface.c.

◆ on_answer_changed()

G_MODULE_EXPORT void on_answer_changed ( GtkWidget * widg,
gpointer data )

Handling the GtkComboBox in 'int iask'.

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 558 of file interface.c.

◆ print_info()

void print_info ( gchar * str,
gchar * stag,
GtkTextBuffer * buffer )

print information in GtkTextBuffer

Parameters
strthe text
stagthe tags
bufferthe GtkTextBuffer to print into

Definition at line 869 of file interface.c.

◆ run_cask()

G_MODULE_EXPORT void run_cask ( GtkDialog * cask,
gint response_id,
gpointer data )

enter a string - running the dialog

Parameters
caskthe GtkDialog sending the signal
response_idthe response id
datathe associated data pointer

Definition at line 729 of file interface.c.

◆ run_iask()

G_MODULE_EXPORT void run_iask ( GtkDialog * iask,
gint response_id,
gpointer data )

enter an integer value - running the dialog

Parameters
iaskthe GtkDialog sending the signal
response_idthe response id
datathe associated data pointer

Definition at line 577 of file interface.c.

◆ run_yes_no()

G_MODULE_EXPORT void run_yes_no ( GtkDialog * dial,
gint response_id,
gpointer data )

ask yes or no for something: running dialog

Parameters
dialthe GtkDialog sending the signal
response_idthe response id
datathe associated data pointer

Definition at line 404 of file interface.c.

◆ send_chem_info_()

void send_chem_info_ ( int prop[active_project -> nspec])

Definition at line 1002 of file interface.c.

◆ show_error()

void show_error ( char * error,
int val,
GtkWidget * win )

show error message

Parameters
errorthe error message
valAdd contact info (1) or not (0)
winParent GtkWidget, if any

Definition at line 299 of file interface.c.

◆ show_error_()

void show_error_ ( char * error,
char * sub,
char * tab )

show error from Fortran90

Parameters
errorMessage
subFortan90 subroutine
tabFortran90 pointer

Definition at line 384 of file interface.c.

◆ show_error_with_trace()

void show_error_with_trace ( gchar * error,
atomes_error * this_error,
int act,
int val,
GtkWidget * win )

show error message

Parameters
errorthe error message
back_traceBacktrace of the error
actruntime action
valAdd contact info (1) or not (0)
winParent GtkWidget, if any

Definition at line 328 of file interface.c.

◆ show_info()

void show_info ( char * information,
int val,
GtkWidget * win )

add / show information message to widget

Parameters
informationMessage
valAdd contact info (1) or not (0)
winthe GtkWidget to modify

Definition at line 240 of file interface.c.

◆ show_pop()

GtkWidget * show_pop ( char * pop,
GtkWidget * pwin )

display pop information window

Parameters
popMessage
pwinParent widget, if any

Definition at line 447 of file interface.c.

◆ show_warning()

void show_warning ( char * warning,
GtkWidget * win )

show warning

Parameters
warningMessage
winParent GtkWidget, if any

Definition at line 266 of file interface.c.

◆ show_warning_()

void show_warning_ ( char * warning,
char * sub,
char * tab )

show warning from Fortran90

Parameters
warningMessage
subFortan90 subroutine
tabFortran90 pointer

Definition at line 281 of file interface.c.

◆ show_web()

void show_web ( GtkWidget * dialog,
int id )

add / show web information to widget

Parameters
dialogthe GtkWidget to modify
idAdd contact info (1) or not (0)

Definition at line 222 of file interface.c.

◆ spec_data_()

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

Parameters
statusUpdate data (1) or not (0)
indthe chemical species
atdZ
nspNumber of atoms of this species
lbelSymbol
el_nmeElement
amssM
rdusRadius
nscattNeutron scattering length
xscattX scattering length

Definition at line 841 of file interface.c.

◆ substitute_string()

gchar * substitute_string ( gchar * init,
gchar * o_motif,
gchar * n_motif )
extern

substitute all patterns in string

Parameters
initthe initial string
o_motifthe pattern to replace
n_motifthe new pattern

Definition at line 375 of file w_library.c.

◆ textcolor()

gchar * textcolor ( int i)

setup text color keyword

Parameters
icolor id

Definition at line 893 of file interface.c.

◆ update_after_calc()

void update_after_calc ( int calc)

update all curve plots in the workspace after a calculation

Parameters
calcanalysis id

Definition at line 1110 of file interface.c.

Variable Documentation

◆ answer

GtkWidget* answer

Definition at line 81 of file interface.c.

◆ answer_info

GtkWidget* answer_info

Definition at line 548 of file interface.c.

◆ cif_config_leg

gchar* cif_config_leg
Initial value:
={i18n("\t<b>MD trajectory</b>\n"
"\t\tConsider the CIF file a MD trajectory\n\n"
"\t\tNumber of atom(s) must not change between configuration(s)\n\n"
"\t<b>Single configuration </b>\n"
"\t\tSelect a single configuration in the CIF file")}
#define i18n(String)
Definition global.c:80

Definition at line 537 of file interface.c.

◆ cif_config_legends

gchar* cif_config_legends
Initial value:
={i18n("\t<b>Single step chemical reaction</b>\n"
"\t\tConsider each configuration as a step in a chemical reaction:\n"
"\t\t\t- Atomic coordinates are sorted based on occupancy or disorder site\n"
"\t\t\t- Each describing the proportion of a reactant\n"
"\t\t\t- A super lattice is build to respect these proportions\n\n"
"\t<b>MD trajectory</b>\n"
"\t\tConsider the CIF file a MD trajectory\n\n"
"\t\tNumber of atom(s) must not change between configuration(s)\n\n"
"\t<b>Single configuration </b>\n"
"\t\tSelect a single configuration in the CIF file")}

Definition at line 527 of file interface.c.

◆ cif_configurations

gchar* cif_configurations[3]
Initial value:
={i18n("Single step chemical reaction"),
i18n("MD trajectory"),
i18n("Single configuration")}

Definition at line 521 of file interface.c.

◆ cif_occ

gchar* cif_occ[3]
Initial value:
={i18n("to lowest integer: <b>⌊</b>n<sub>sites</sub> x occupancy<b>⌋</b>"),
i18n("to highest integer: <b>⌈</b>n<sub>sites</sub> x occupancy<b>⌉</b>"),
i18n("to nearest integer: <b>⌊</b>n<sub>sites</sub> x occupancy<b>⌉</b>")}

Definition at line 542 of file interface.c.

◆ cif_occupancies

gchar* cif_occupancies[3]
Initial value:
={i18n("Round up to lowest integer"),
i18n("Round up to highest integer"),
i18n("Round up to nearest integer")}

Definition at line 524 of file interface.c.

◆ cif_sites

gchar* cif_sites[2]
Initial value:
={i18n("with n<sub>sites</sub> = f(space group, crystalline positions)"),
i18n("with n<sub>sites</sub> = f(symmetry positions, crystalline positions)")}

Definition at line 545 of file interface.c.

◆ coord_type

gchar* coord_type[3]
Initial value:
={i18n("Cartesian"),
i18n("Atomic units"),
i18n("Fractional")}

Definition at line 511 of file interface.c.

◆ field_init

gchar* field_init[3]
extern

Definition at line 4457 of file dlp_field.c.

◆ npt_info

gchar* npt_info[3]
Initial value:
={i18n("1 line by step, as many lines as MD steps"),
i18n("2 lines by step, twice as many lines as MD steps"),
i18n("3 lines by step, three times as many lines as MD steps")}

Definition at line 518 of file interface.c.

◆ npt_type

gchar* npt_type[4]
Initial value:
={"A\tB\tC\t&#x3B1;\t&#x3B2;\t&#x263;",
"A\tB\tC\n&#x3B1;\t&#x3B2;\t&#x263;",
"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>",
"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>"}

Definition at line 514 of file interface.c.

◆ res_char

gchar* res_char

Definition at line 718 of file interface.c.

◆ res_int

int res_int

Definition at line 566 of file interface.c.

◆ res_yes_no

gboolean res_yes_no

Definition at line 393 of file interface.c.