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

General callbacks
Functions to open and close files. More...

#include "global.h"
#include "interface.h"
#include "callbacks.h"
#include "bind.h"
#include "project.h"
#include "workspace.h"
#include "glwindow.h"
#include "glview.h"
#include "atom_edit.h"
#include "cell_edit.h"
#include "readers.h"
+ Include dependency graph for callbacks.c:

Go to the source code of this file.

Functions

void initcwidgets ()
 initializing curve values
 
G_MODULE_EXPORT void on_edit_activate (GtkWidget *widg, gpointer data)
 create an edition dialog - prepare the dialog
 
gchar * substitute_string (gchar *init, gchar *o_motif, gchar *n_motif)
 substitute all patterns in string
 
int open_cif_file (gchar *filename)
 
int open_coord_file (gchar *filename, int fti)
 open atomic coordinates file
 
int open_history_file (gchar *filename)
 
int open_cell_file (int format, gchar *filename)
 open the file that contains the cell parameters
 
double get_z_from_periodic_table (gchar *lab)
 get Z from atom label
 
void quit_gtk ()
 Leave the application.
 
G_MODULE_EXPORT void on_close_workspace (GtkWidget *widg, gpointer data)
 close the active workspace
 
int open_save (FILE *fp, int i, int pid, int aid, int npi, gchar *pfile)
 open or save project file
 
int open_save_workspace (FILE *fp, int act)
 open or save the active workspace
 
void open_this_proj (gpointer data, gpointer user_data)
 Open many projects, one at a time.
 
G_MODULE_EXPORT void run_on_open_save_active (GtkDialog *info, gint response_id, gpointer data)
 open or save an atomes file - running the dialog
 
G_MODULE_EXPORT void on_open_save_activate (GtkWidget *widg, gpointer data)
 open or save an atomes file - prepare the dialog
 
G_MODULE_EXPORT void on_save_as_activate (GtkWidget *widg, gpointer data)
 open or save, choosing a file name
 
void run_project ()
 send project data to Fortran90
 
void apply_project (gboolean showtools)
 get project ready for calculation and initialize the OpenGL window
 
void open_this_isaacs_xml_file (gchar *profile, int ptoc, gboolean visible)
 open an ISAACS XML file
 
G_MODULE_EXPORT void run_on_isaacs_port (GtkDialog *info, gint response_id, gpointer data)
 open or write ISAACS XML file - running the dialog
 
G_MODULE_EXPORT void on_isaacs_port (GtkWidget *widg, gpointer data)
 open or write ISAACS XML file - prepare the dialog
 
void to_read_pos ()
 send atomic coordinates to Fortran90
 
void check_read_sa ()
 reading CPMD/VASP trajectory, testing parameters to active the read capabilty
 
void update_sa_info (int sid)
 reading CPMD/VASP trajectory, update chemical species info
 
G_MODULE_EXPORT void update_sa (GtkEntry *res, gpointer data)
 reading CPMD/VASP trajectory, set the number of chemical species
 
G_MODULE_EXPORT void changed_spec_combo (GtkComboBox *box, gpointer data)
 reading CPMD/VASP trajectory, change the active species
 
void prepare_sp_box ()
 eading CPMD/VASP trajectory, prepare the species combo box
 
G_MODULE_EXPORT void update_at_sp (GtkEntry *res, gpointer data)
 reading CPMD/VASP trajectory, changing number of atomes or species
 
int prep_chem_data ()
 prepare chemical data to read CPMD/VASP file
 
G_MODULE_EXPORT void run_to_read_trj_or_vas (GtkDialog *dialog, gint response_id, gpointer data)
 reading CPMD/VASP trajectory: run the dialog
 
int to_read_trj_or_vas (int ff)
 reading CPMD/VASP trajectory - prepare the dialog
 
void cell_data_from_pdb_ (float *a, float *b, float *c, float *alp, float *bet, float *gam)
 update cell parameters from the data in the PDB file
 
G_MODULE_EXPORT void run_read_npt_data (GtkDialog *info, gint response_id, gpointer data)
 read NPT data associated with atomic coordinates: run the dialog GTK3 callback
 
int read_npt_data ()
 read NPT data associated with atomic coordinates: setup the dialog
 
int open_coordinate_file (int id)
 try to open coordinate file, type is based of id
 
void open_this_coordinate_file (int format, gchar *proj_name)
 open coordinate file format, if successful add to workspace
 
G_MODULE_EXPORT void run_on_coord_port (GtkDialog *info, gint response_id, gpointer data)
 export or import atomic coordinates: run dialog
 
G_MODULE_EXPORT void on_coord_port (GtkWidget *widg, gpointer data)
 export or import atomic coordinates: prepare dialog
 

Variables

char * coord_files [NCFORMATS+1]
 
char * coord_files_ext [NCFORMATS+1]
 
char ** las
 
const gchar * dfi [2]
 
gboolean save = TRUE
 
tint osp
 
gboolean run_os
 
GtkWidget * read_box
 
GtkWidget * all_sp_box
 
GtkWidget * sa_lab [2]
 
GtkWidget * sa_entry [2]
 
GtkWidget * read_this
 
int read_spec
 
int reading_vas_trj
 
int npt_selection
 
gchar * npt_file
 
GtkFileFilter * filter [NCFORMATS+1]
 
int pactive
 

Detailed Description

General callbacks
Functions to open and close files.

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 callbacks.c.

Function Documentation

◆ apply_project()

void apply_project ( gboolean showtools)

get project ready for calculation and initialize the OpenGL window

Parameters
showtools

Definition at line 665 of file callbacks.c.

◆ cell_data_from_pdb_()

void cell_data_from_pdb_ ( float * a,
float * b,
float * c,
float * alp,
float * bet,
float * gam )

update cell parameters from the data in the PDB file

Parameters
aa
bb
cc
alpalpha
betbeta
gamgamma

Definition at line 1166 of file callbacks.c.

◆ changed_spec_combo()

G_MODULE_EXPORT void changed_spec_combo ( GtkComboBox * box,
gpointer data )

reading CPMD/VASP trajectory, change the active species

Parameters
boxthe GtkComboBox sending the signal
datathe associated data pointer

Definition at line 974 of file callbacks.c.

◆ check_read_sa()

void check_read_sa ( )

reading CPMD/VASP trajectory, testing parameters to active the read capabilty

Definition at line 880 of file callbacks.c.

◆ get_z_from_periodic_table()

double get_z_from_periodic_table ( gchar * lab)
extern

get Z from atom label

Parameters
labthe atomic label

Definition at line 304 of file w_library.c.

◆ initcwidgets()

void initcwidgets ( )

initializing curve values

Definition at line 104 of file initc.c.

◆ on_close_workspace()

G_MODULE_EXPORT void on_close_workspace ( GtkWidget * widg,
gpointer data )

close the active workspace

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 133 of file callbacks.c.

◆ on_coord_port()

G_MODULE_EXPORT void on_coord_port ( GtkWidget * widg,
gpointer data )

export or import atomic coordinates: prepare dialog

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 1604 of file callbacks.c.

◆ on_edit_activate()

G_MODULE_EXPORT void on_edit_activate ( GtkWidget * widg,
gpointer data )
extern

create an edition dialog - prepare the dialog

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 839 of file edit_menu.c.

◆ on_isaacs_port()

G_MODULE_EXPORT void on_isaacs_port ( GtkWidget * widg,
gpointer data )

open or write ISAACS XML file - prepare the dialog

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer (int *) open = 0, save = 1

Definition at line 775 of file callbacks.c.

◆ on_open_save_activate()

G_MODULE_EXPORT void on_open_save_activate ( GtkWidget * widg,
gpointer data )

open or save an atomes file - prepare the dialog

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 423 of file callbacks.c.

◆ on_save_as_activate()

G_MODULE_EXPORT void on_save_as_activate ( GtkWidget * widg,
gpointer data )

open or save, choosing a file name

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 621 of file callbacks.c.

◆ open_cell_file()

int open_cell_file ( int format,
gchar * filename )
extern

open the file that contains the cell parameters

Parameters
formatFile format
filenameFile name

Definition at line 232 of file read_npt.c.

◆ open_cif_file()

int open_cif_file ( gchar * filename)
extern

◆ open_coord_file()

int open_coord_file ( gchar * filename,
int fti )
extern

open atomic coordinates file

Parameters
filenamethe file name
ftithe type of coordinates

Definition at line 250 of file read_coord.c.

◆ open_coordinate_file()

int open_coordinate_file ( int id)

try to open coordinate file, type is based of id

Parameters
idfile type to open

Definition at line 1268 of file callbacks.c.

◆ open_history_file()

int open_history_file ( gchar * filename)
extern

◆ open_save()

int open_save ( FILE * fp,
int i,
int pid,
int aid,
int npi,
gchar * pfile )

open or save project file

Parameters
fpthe file pointer
i0 = read, 1 = write
pidthe project id
aidthe active project id
npitotal number of projects
pfilethe file name

Definition at line 174 of file callbacks.c.

◆ open_save_workspace()

int open_save_workspace ( FILE * fp,
int act )

open or save the active workspace

Parameters
fpthe file to read or write
actthe action (0 = read, 1 = write)

Definition at line 234 of file callbacks.c.

◆ open_this_coordinate_file()

void open_this_coordinate_file ( int format,
gchar * proj_name )

open coordinate file format, if successful add to workspace

Parameters
formatthe format of the file that contains the atomic coordinates
proj_namethe project name to use, if any

Definition at line 1416 of file callbacks.c.

◆ open_this_isaacs_xml_file()

void open_this_isaacs_xml_file ( gchar * profile,
int ptoc,
gboolean visible )

open an ISAACS XML file

Parameters
profilethe XML file name
ptocthe previous active project
visibleread from the command line (FALSE), from the gui (TRUE)

Definition at line 685 of file callbacks.c.

◆ open_this_proj()

void open_this_proj ( gpointer data,
gpointer user_data )

Open many projects, one at a time.

Parameters
data
user_data

Definition at line 301 of file callbacks.c.

◆ prep_chem_data()

int prep_chem_data ( )

prepare chemical data to read CPMD/VASP file

Definition at line 1078 of file callbacks.c.

◆ prepare_sp_box()

void prepare_sp_box ( )

eading CPMD/VASP trajectory, prepare the species combo box

Definition at line 984 of file callbacks.c.

◆ quit_gtk()

void quit_gtk ( )

Leave the application.

Definition at line 119 of file callbacks.c.

◆ read_npt_data()

int read_npt_data ( )

read NPT data associated with atomic coordinates: setup the dialog

Definition at line 1231 of file callbacks.c.

◆ run_on_coord_port()

G_MODULE_EXPORT void run_on_coord_port ( GtkDialog * info,
gint response_id,
gpointer data )

export or import atomic coordinates: run dialog

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

Definition at line 1498 of file callbacks.c.

◆ run_on_isaacs_port()

G_MODULE_EXPORT void run_on_isaacs_port ( GtkDialog * info,
gint response_id,
gpointer data )

open or write ISAACS XML file - running the dialog

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

Definition at line 729 of file callbacks.c.

◆ run_on_open_save_active()

G_MODULE_EXPORT void run_on_open_save_active ( GtkDialog * info,
gint response_id,
gpointer data )

open or save an atomes file - running the dialog

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

Definition at line 338 of file callbacks.c.

◆ run_project()

void run_project ( )

send project data to Fortran90

Definition at line 633 of file callbacks.c.

◆ run_read_npt_data()

G_MODULE_EXPORT void run_read_npt_data ( GtkDialog * info,
gint response_id,
gpointer data )

read NPT data associated with atomic coordinates: run the dialog GTK3 callback

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

Definition at line 1206 of file callbacks.c.

◆ run_to_read_trj_or_vas()

G_MODULE_EXPORT void run_to_read_trj_or_vas ( GtkDialog * dialog,
gint response_id,
gpointer data )

reading CPMD/VASP trajectory: run the dialog

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

Definition at line 1100 of file callbacks.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 372 of file w_library.c.

◆ to_read_pos()

void to_read_pos ( )

send atomic coordinates to Fortran90

Definition at line 831 of file callbacks.c.

◆ to_read_trj_or_vas()

int to_read_trj_or_vas ( int ff)

reading CPMD/VASP trajectory - prepare the dialog

Parameters
fffile type

Definition at line 1129 of file callbacks.c.

◆ update_at_sp()

G_MODULE_EXPORT void update_at_sp ( GtkEntry * res,
gpointer data )

reading CPMD/VASP trajectory, changing number of atomes or species

Parameters
resthe GtkEntry sending the signal
datathe associated data pointer (int *) 0 = atomes, 1 = species

Definition at line 1038 of file callbacks.c.

◆ update_sa()

G_MODULE_EXPORT void update_sa ( GtkEntry * res,
gpointer data )

reading CPMD/VASP trajectory, set the number of chemical species

Parameters
resthe GtkEntry sending the signal
datathe associated data pointer

Definition at line 942 of file callbacks.c.

◆ update_sa_info()

void update_sa_info ( int sid)

reading CPMD/VASP trajectory, update chemical species info

Parameters
sidthe species id

Definition at line 906 of file callbacks.c.

Variable Documentation

◆ all_sp_box

GtkWidget* all_sp_box

Definition at line 869 of file callbacks.c.

◆ coord_files

char* coord_files[NCFORMATS+1]
Initial value:
= {"XYZ file",
"XYZ file - NPT",
"Chem3D file",
"CPMD trajectory",
"CPMD trajectory - NPT",
"VASP trajectory",
"VASP trajectory - NPT",
"Protein Data Bank file",
"Protein Data Bank file",
"Crystallographic information (crystal build)",
"Crystallographic information (symmetry positions)",
"DL-POLY HISTORY file",
"ISAACS Project File"}

Definition at line 86 of file callbacks.c.

◆ coord_files_ext

char* coord_files_ext[NCFORMATS+1]
Initial value:
={"xyz", "xyz", "c3d", "trj", "trj", "xdatcar", "xdatcar",
"pdb", "ent", "cif", "cif", "hist", "ipf"}

Definition at line 100 of file callbacks.c.

◆ dfi

const gchar* dfi[2]
extern

Definition at line 74 of file main.c.

◆ filter

GtkFileFilter* filter[NCFORMATS+1]

Definition at line 1405 of file callbacks.c.

◆ las

char** las

Definition at line 103 of file callbacks.c.

◆ npt_file

gchar* npt_file

Definition at line 1181 of file callbacks.c.

◆ npt_selection

int npt_selection

Definition at line 1180 of file callbacks.c.

◆ osp

tint osp

Definition at line 311 of file callbacks.c.

◆ pactive

int pactive

Definition at line 1406 of file callbacks.c.

◆ read_box

GtkWidget* read_box

Definition at line 868 of file callbacks.c.

◆ read_spec

int read_spec

Definition at line 873 of file callbacks.c.

◆ read_this

GtkWidget* read_this

Definition at line 872 of file callbacks.c.

◆ reading_vas_trj

int reading_vas_trj

Definition at line 1071 of file callbacks.c.

◆ run_os

gboolean run_os

Definition at line 312 of file callbacks.c.

◆ sa_entry

GtkWidget* sa_entry[2]

Definition at line 871 of file callbacks.c.

◆ sa_lab

GtkWidget* sa_lab[2]

Definition at line 870 of file callbacks.c.

◆ save

gboolean save = TRUE

Definition at line 160 of file callbacks.c.